@highlight-run/rrweb 2.0.1 → 2.0.6
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/plugins/console-record.js +12 -655
- package/dist/plugins/console-record.min.js +12 -15
- package/dist/plugins/console-record.min.js.map +1 -1
- package/dist/plugins/console-replay.js +4 -293
- package/dist/plugins/console-replay.min.js +4 -15
- package/dist/plugins/console-replay.min.js.map +1 -1
- package/dist/plugins/sequential-id-record.js +1 -33
- package/dist/plugins/sequential-id-record.min.js +1 -1
- package/dist/plugins/sequential-id-record.min.js.map +1 -1
- package/dist/plugins/sequential-id-replay.js +1 -37
- package/dist/plugins/sequential-id-replay.min.js +1 -1
- package/dist/plugins/sequential-id-replay.min.js.map +1 -1
- package/dist/record/rrweb-record-pack.js +3 -747
- package/dist/record/rrweb-record-pack.min.js +3 -15
- package/dist/record/rrweb-record-pack.min.js.map +1 -1
- package/dist/record/rrweb-record.js +4 -3318
- package/dist/record/rrweb-record.min.js +4 -15
- package/dist/record/rrweb-record.min.js.map +1 -1
- package/dist/replay/rrweb-replay-unpack.css +1 -0
- package/dist/replay/rrweb-replay-unpack.js +5 -4614
- package/dist/replay/rrweb-replay-unpack.min.js +5 -17
- package/dist/replay/rrweb-replay-unpack.min.js.map +1 -1
- package/dist/replay/rrweb-replay.css +1 -0
- package/dist/replay/rrweb-replay.js +5 -4204
- package/dist/replay/rrweb-replay.min.js +5 -17
- package/dist/replay/rrweb-replay.min.js.map +1 -1
- package/dist/rrweb-all.css +1 -0
- package/dist/rrweb-all.js +16 -8696
- package/dist/rrweb-all.min.js +16 -17
- package/dist/rrweb-all.min.js.map +1 -1
- package/dist/rrweb.css +1 -0
- package/dist/rrweb.js +6 -7282
- package/dist/rrweb.min.js +6 -17
- package/dist/rrweb.min.js.map +1 -1
- package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__auto__createBase64WorkerFactory.js +12 -0
- package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__auto__isNodeJS.js +7 -0
- package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js +31 -0
- package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__node__WorkerClass.js +11 -0
- package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__node__createBase64WorkerFactory.js +18 -0
- package/es/rrweb/_virtual/image-bitmap-data-url-worker.js +6 -0
- package/es/rrweb/all.css +1 -0
- package/es/rrweb/ext/mitt/dist/mitt.es.js +1 -1
- package/es/rrweb/ext/tslib/tslib.es6.js +38 -0
- package/es/rrweb/packages/rrdom/es/virtual-dom.js +1099 -0
- package/es/rrweb/packages/rrweb/src/index.js +6 -4
- package/es/rrweb/packages/rrweb/src/packer/base.js +1 -1
- package/es/rrweb/packages/rrweb/src/packer/pack.js +4 -5
- package/es/rrweb/packages/rrweb/src/packer/unpack.js +24 -24
- package/es/rrweb/packages/rrweb/src/plugins/console/record/error-stack-parser.js +175 -176
- package/es/rrweb/packages/rrweb/src/plugins/console/record/index.js +109 -128
- package/es/rrweb/packages/rrweb/src/plugins/console/record/stringify.js +125 -138
- package/es/rrweb/packages/rrweb/src/plugins/console/replay/index.js +88 -105
- package/es/rrweb/packages/rrweb/src/plugins/sequential-id/record/index.js +19 -20
- package/es/rrweb/packages/rrweb/src/plugins/sequential-id/replay/index.js +25 -25
- package/es/rrweb/packages/rrweb/src/record/iframe-manager.js +29 -30
- package/es/rrweb/packages/rrweb/src/record/index.js +348 -373
- package/es/rrweb/packages/rrweb/src/record/mutation.js +487 -528
- package/es/rrweb/packages/rrweb/src/record/observer.js +584 -659
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/2d.js +44 -73
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas-manager.js +166 -87
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas.js +21 -26
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/serialize-args.js +119 -112
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/webgl.js +53 -72
- package/es/rrweb/packages/rrweb/src/record/shadow-dom-manager.js +38 -40
- package/es/rrweb/packages/rrweb/src/record/stylesheet-manager.js +31 -0
- package/es/rrweb/packages/rrweb/src/replay/canvas/2d.js +27 -23
- package/es/rrweb/packages/rrweb/src/replay/canvas/deserialize-args.js +67 -0
- package/es/rrweb/packages/rrweb/src/replay/canvas/index.js +37 -29
- package/es/rrweb/packages/rrweb/src/replay/canvas/webgl.js +58 -120
- package/es/rrweb/packages/rrweb/src/replay/index.js +1545 -1854
- package/es/rrweb/packages/rrweb/src/replay/machine.js +275 -315
- package/es/rrweb/packages/rrweb/src/replay/smoothscroll.js +216 -218
- package/es/rrweb/packages/rrweb/src/replay/styles/inject-style.js +7 -7
- package/es/rrweb/packages/rrweb/src/replay/timer.js +87 -91
- package/es/rrweb/packages/rrweb/src/types.js +72 -72
- package/es/rrweb/packages/rrweb/src/utils.js +312 -506
- package/es/rrweb/packages/rrweb-snapshot/es/rrweb-snapshot.js +190 -72
- package/lib/plugins/console-record.js +469 -627
- package/lib/plugins/console-replay.js +198 -268
- package/lib/plugins/sequential-id-record.js +19 -20
- package/lib/plugins/sequential-id-replay.js +25 -25
- package/lib/record/rrweb-record-pack.js +184 -139
- package/lib/record/rrweb-record.js +2467 -2425
- package/lib/replay/rrweb-replay-unpack.css +1 -0
- package/lib/replay/rrweb-replay-unpack.js +3798 -3344
- package/lib/replay/rrweb-replay.css +1 -0
- package/lib/replay/rrweb-replay.js +3743 -3289
- package/lib/rrweb-all.css +1 -0
- package/lib/rrweb-all.js +6721 -6249
- package/lib/rrweb.css +1 -0
- package/lib/rrweb.js +6151 -5632
- package/package.json +14 -13
- package/typings/packer/base.d.ts +1 -1
- package/typings/plugins/console/record/index.d.ts +1 -1
- package/typings/plugins/console/record/stringify.d.ts +1 -1
- package/typings/plugins/sequential-id/record/index.d.ts +1 -1
- package/typings/plugins/sequential-id/replay/index.d.ts +1 -1
- package/typings/record/iframe-manager.d.ts +3 -3
- package/typings/record/index.d.ts +1 -1
- package/typings/record/mutation.d.ts +2 -1
- package/typings/record/observers/canvas/2d.d.ts +2 -1
- package/typings/record/observers/canvas/canvas-manager.d.ts +5 -2
- package/typings/record/observers/canvas/canvas.d.ts +1 -1
- package/typings/record/observers/canvas/serialize-args.d.ts +5 -5
- package/typings/record/observers/canvas/webgl.d.ts +2 -1
- package/typings/record/shadow-dom-manager.d.ts +2 -1
- package/typings/record/stylesheet-manager.d.ts +12 -0
- package/typings/record/workers/image-bitmap-data-url-worker.d.ts +5 -0
- package/typings/replay/canvas/2d.d.ts +3 -3
- package/typings/replay/canvas/deserialize-args.d.ts +7 -0
- package/typings/replay/canvas/index.d.ts +4 -3
- package/typings/replay/canvas/webgl.d.ts +3 -5
- package/typings/replay/index.d.ts +7 -10
- package/typings/types.d.ts +45 -17
- package/typings/utils.d.ts +17 -44
- package/es/rrweb/packages/rrweb/ext/tslib/tslib.es6.js +0 -78
- package/es/rrweb/packages/rrweb/src/replay/virtual-styles.js +0 -121
- package/typings/replay/virtual-styles.d.ts +0 -43
|
@@ -2,134 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
/*! *****************************************************************************
|
|
6
|
-
Copyright (c) Microsoft Corporation.
|
|
7
|
-
|
|
8
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
9
|
-
purpose with or without fee is hereby granted.
|
|
10
|
-
|
|
11
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
12
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
13
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
14
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
15
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
16
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
17
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
18
|
-
***************************************************************************** */
|
|
19
|
-
|
|
20
|
-
function __values(o) {
|
|
21
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
22
|
-
if (m) return m.call(o);
|
|
23
|
-
if (o && typeof o.length === "number") return {
|
|
24
|
-
next: function () {
|
|
25
|
-
if (o && i >= o.length) o = void 0;
|
|
26
|
-
return { value: o && o[i++], done: !o };
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function __read(o, n) {
|
|
33
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
34
|
-
if (!m) return o;
|
|
35
|
-
var i = m.call(o), r, ar = [], e;
|
|
36
|
-
try {
|
|
37
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
38
|
-
}
|
|
39
|
-
catch (error) { e = { error: error }; }
|
|
40
|
-
finally {
|
|
41
|
-
try {
|
|
42
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
43
|
-
}
|
|
44
|
-
finally { if (e) throw e.error; }
|
|
45
|
-
}
|
|
46
|
-
return ar;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function __spreadArray(to, from, pack) {
|
|
50
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
51
|
-
if (ar || !(i in from)) {
|
|
52
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
53
|
-
ar[i] = from[i];
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
var EventType;
|
|
60
|
-
(function (EventType) {
|
|
61
|
-
EventType[EventType["DomContentLoaded"] = 0] = "DomContentLoaded";
|
|
62
|
-
EventType[EventType["Load"] = 1] = "Load";
|
|
63
|
-
EventType[EventType["FullSnapshot"] = 2] = "FullSnapshot";
|
|
64
|
-
EventType[EventType["IncrementalSnapshot"] = 3] = "IncrementalSnapshot";
|
|
65
|
-
EventType[EventType["Meta"] = 4] = "Meta";
|
|
66
|
-
EventType[EventType["Custom"] = 5] = "Custom";
|
|
67
|
-
EventType[EventType["Plugin"] = 6] = "Plugin";
|
|
68
|
-
})(EventType || (EventType = {}));
|
|
69
|
-
var IncrementalSource;
|
|
70
|
-
(function (IncrementalSource) {
|
|
71
|
-
IncrementalSource[IncrementalSource["Mutation"] = 0] = "Mutation";
|
|
72
|
-
IncrementalSource[IncrementalSource["MouseMove"] = 1] = "MouseMove";
|
|
73
|
-
IncrementalSource[IncrementalSource["MouseInteraction"] = 2] = "MouseInteraction";
|
|
74
|
-
IncrementalSource[IncrementalSource["Scroll"] = 3] = "Scroll";
|
|
75
|
-
IncrementalSource[IncrementalSource["ViewportResize"] = 4] = "ViewportResize";
|
|
76
|
-
IncrementalSource[IncrementalSource["Input"] = 5] = "Input";
|
|
77
|
-
IncrementalSource[IncrementalSource["TouchMove"] = 6] = "TouchMove";
|
|
78
|
-
IncrementalSource[IncrementalSource["MediaInteraction"] = 7] = "MediaInteraction";
|
|
79
|
-
IncrementalSource[IncrementalSource["StyleSheetRule"] = 8] = "StyleSheetRule";
|
|
80
|
-
IncrementalSource[IncrementalSource["CanvasMutation"] = 9] = "CanvasMutation";
|
|
81
|
-
IncrementalSource[IncrementalSource["Font"] = 10] = "Font";
|
|
82
|
-
IncrementalSource[IncrementalSource["Log"] = 11] = "Log";
|
|
83
|
-
IncrementalSource[IncrementalSource["Drag"] = 12] = "Drag";
|
|
84
|
-
IncrementalSource[IncrementalSource["StyleDeclaration"] = 13] = "StyleDeclaration";
|
|
85
|
-
})(IncrementalSource || (IncrementalSource = {}));
|
|
86
|
-
var MouseInteractions;
|
|
87
|
-
(function (MouseInteractions) {
|
|
88
|
-
MouseInteractions[MouseInteractions["MouseUp"] = 0] = "MouseUp";
|
|
89
|
-
MouseInteractions[MouseInteractions["MouseDown"] = 1] = "MouseDown";
|
|
90
|
-
MouseInteractions[MouseInteractions["Click"] = 2] = "Click";
|
|
91
|
-
MouseInteractions[MouseInteractions["ContextMenu"] = 3] = "ContextMenu";
|
|
92
|
-
MouseInteractions[MouseInteractions["DblClick"] = 4] = "DblClick";
|
|
93
|
-
MouseInteractions[MouseInteractions["Focus"] = 5] = "Focus";
|
|
94
|
-
MouseInteractions[MouseInteractions["Blur"] = 6] = "Blur";
|
|
95
|
-
MouseInteractions[MouseInteractions["TouchStart"] = 7] = "TouchStart";
|
|
96
|
-
MouseInteractions[MouseInteractions["TouchMove_Departed"] = 8] = "TouchMove_Departed";
|
|
97
|
-
MouseInteractions[MouseInteractions["TouchEnd"] = 9] = "TouchEnd";
|
|
98
|
-
MouseInteractions[MouseInteractions["TouchCancel"] = 10] = "TouchCancel";
|
|
99
|
-
})(MouseInteractions || (MouseInteractions = {}));
|
|
100
|
-
var CanvasContext;
|
|
101
|
-
(function (CanvasContext) {
|
|
102
|
-
CanvasContext[CanvasContext["2D"] = 0] = "2D";
|
|
103
|
-
CanvasContext[CanvasContext["WebGL"] = 1] = "WebGL";
|
|
104
|
-
CanvasContext[CanvasContext["WebGL2"] = 2] = "WebGL2";
|
|
105
|
-
})(CanvasContext || (CanvasContext = {}));
|
|
106
|
-
var MediaInteractions;
|
|
107
|
-
(function (MediaInteractions) {
|
|
108
|
-
MediaInteractions[MediaInteractions["Play"] = 0] = "Play";
|
|
109
|
-
MediaInteractions[MediaInteractions["Pause"] = 1] = "Pause";
|
|
110
|
-
MediaInteractions[MediaInteractions["Seeked"] = 2] = "Seeked";
|
|
111
|
-
MediaInteractions[MediaInteractions["VolumeChange"] = 3] = "VolumeChange";
|
|
112
|
-
})(MediaInteractions || (MediaInteractions = {}));
|
|
113
|
-
var ReplayerEvents;
|
|
114
|
-
(function (ReplayerEvents) {
|
|
115
|
-
ReplayerEvents["Start"] = "start";
|
|
116
|
-
ReplayerEvents["Pause"] = "pause";
|
|
117
|
-
ReplayerEvents["Resume"] = "resume";
|
|
118
|
-
ReplayerEvents["Resize"] = "resize";
|
|
119
|
-
ReplayerEvents["Finish"] = "finish";
|
|
120
|
-
ReplayerEvents["FullsnapshotRebuilded"] = "fullsnapshot-rebuilded";
|
|
121
|
-
ReplayerEvents["LoadStylesheetStart"] = "load-stylesheet-start";
|
|
122
|
-
ReplayerEvents["LoadStylesheetEnd"] = "load-stylesheet-end";
|
|
123
|
-
ReplayerEvents["SkipStart"] = "skip-start";
|
|
124
|
-
ReplayerEvents["SkipEnd"] = "skip-end";
|
|
125
|
-
ReplayerEvents["MouseInteraction"] = "mouse-interaction";
|
|
126
|
-
ReplayerEvents["EventCast"] = "event-cast";
|
|
127
|
-
ReplayerEvents["CustomEvent"] = "custom-event";
|
|
128
|
-
ReplayerEvents["Flush"] = "flush";
|
|
129
|
-
ReplayerEvents["StateChange"] = "state-change";
|
|
130
|
-
ReplayerEvents["PlayBack"] = "play-back";
|
|
131
|
-
})(ReplayerEvents || (ReplayerEvents = {}));
|
|
132
|
-
|
|
133
5
|
var NodeType;
|
|
134
6
|
(function (NodeType) {
|
|
135
7
|
NodeType[NodeType["Document"] = 0] = "Document";
|
|
@@ -140,149 +12,207 @@ var NodeType;
|
|
|
140
12
|
NodeType[NodeType["Comment"] = 5] = "Comment";
|
|
141
13
|
})(NodeType || (NodeType = {}));
|
|
142
14
|
|
|
143
|
-
|
|
144
|
-
'\r\n' +
|
|
145
|
-
'now you can use replayer.getMirror() to access the mirror instance of a replayer,' +
|
|
146
|
-
'\r\n' +
|
|
147
|
-
'or you can use record.mirror to access the mirror instance during recording.';
|
|
148
|
-
|
|
149
|
-
map: {},
|
|
150
|
-
getId
|
|
151
|
-
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
152
|
-
return -1;
|
|
153
|
-
},
|
|
154
|
-
getNode
|
|
155
|
-
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
156
|
-
return null;
|
|
157
|
-
},
|
|
158
|
-
removeNodeFromMap
|
|
159
|
-
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
160
|
-
},
|
|
161
|
-
has
|
|
162
|
-
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
163
|
-
return false;
|
|
164
|
-
},
|
|
165
|
-
reset
|
|
166
|
-
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
167
|
-
},
|
|
168
|
-
};
|
|
169
|
-
if (typeof window !== 'undefined' && window.Proxy && window.Reflect) {
|
|
170
|
-
_mirror = new Proxy(_mirror, {
|
|
171
|
-
get
|
|
172
|
-
if (prop === 'map') {
|
|
173
|
-
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
174
|
-
}
|
|
175
|
-
return Reflect.get(target, prop, receiver);
|
|
176
|
-
},
|
|
177
|
-
});
|
|
15
|
+
const DEPARTED_MIRROR_ACCESS_WARNING = 'Please stop import mirror directly. Instead of that,' +
|
|
16
|
+
'\r\n' +
|
|
17
|
+
'now you can use replayer.getMirror() to access the mirror instance of a replayer,' +
|
|
18
|
+
'\r\n' +
|
|
19
|
+
'or you can use record.mirror to access the mirror instance during recording.';
|
|
20
|
+
let _mirror = {
|
|
21
|
+
map: {},
|
|
22
|
+
getId() {
|
|
23
|
+
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
24
|
+
return -1;
|
|
25
|
+
},
|
|
26
|
+
getNode() {
|
|
27
|
+
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
28
|
+
return null;
|
|
29
|
+
},
|
|
30
|
+
removeNodeFromMap() {
|
|
31
|
+
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
32
|
+
},
|
|
33
|
+
has() {
|
|
34
|
+
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
35
|
+
return false;
|
|
36
|
+
},
|
|
37
|
+
reset() {
|
|
38
|
+
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
if (typeof window !== 'undefined' && window.Proxy && window.Reflect) {
|
|
42
|
+
_mirror = new Proxy(_mirror, {
|
|
43
|
+
get(target, prop, receiver) {
|
|
44
|
+
if (prop === 'map') {
|
|
45
|
+
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
46
|
+
}
|
|
47
|
+
return Reflect.get(target, prop, receiver);
|
|
48
|
+
},
|
|
49
|
+
});
|
|
178
50
|
}
|
|
179
51
|
|
|
180
|
-
|
|
52
|
+
const PLUGIN_NAME = 'rrweb/console@1';
|
|
181
53
|
|
|
182
|
-
var
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
]
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
54
|
+
var EventType;
|
|
55
|
+
(function (EventType) {
|
|
56
|
+
EventType[EventType["DomContentLoaded"] = 0] = "DomContentLoaded";
|
|
57
|
+
EventType[EventType["Load"] = 1] = "Load";
|
|
58
|
+
EventType[EventType["FullSnapshot"] = 2] = "FullSnapshot";
|
|
59
|
+
EventType[EventType["IncrementalSnapshot"] = 3] = "IncrementalSnapshot";
|
|
60
|
+
EventType[EventType["Meta"] = 4] = "Meta";
|
|
61
|
+
EventType[EventType["Custom"] = 5] = "Custom";
|
|
62
|
+
EventType[EventType["Plugin"] = 6] = "Plugin";
|
|
63
|
+
})(EventType || (EventType = {}));
|
|
64
|
+
var IncrementalSource;
|
|
65
|
+
(function (IncrementalSource) {
|
|
66
|
+
IncrementalSource[IncrementalSource["Mutation"] = 0] = "Mutation";
|
|
67
|
+
IncrementalSource[IncrementalSource["MouseMove"] = 1] = "MouseMove";
|
|
68
|
+
IncrementalSource[IncrementalSource["MouseInteraction"] = 2] = "MouseInteraction";
|
|
69
|
+
IncrementalSource[IncrementalSource["Scroll"] = 3] = "Scroll";
|
|
70
|
+
IncrementalSource[IncrementalSource["ViewportResize"] = 4] = "ViewportResize";
|
|
71
|
+
IncrementalSource[IncrementalSource["Input"] = 5] = "Input";
|
|
72
|
+
IncrementalSource[IncrementalSource["TouchMove"] = 6] = "TouchMove";
|
|
73
|
+
IncrementalSource[IncrementalSource["MediaInteraction"] = 7] = "MediaInteraction";
|
|
74
|
+
IncrementalSource[IncrementalSource["StyleSheetRule"] = 8] = "StyleSheetRule";
|
|
75
|
+
IncrementalSource[IncrementalSource["CanvasMutation"] = 9] = "CanvasMutation";
|
|
76
|
+
IncrementalSource[IncrementalSource["Font"] = 10] = "Font";
|
|
77
|
+
IncrementalSource[IncrementalSource["Log"] = 11] = "Log";
|
|
78
|
+
IncrementalSource[IncrementalSource["Drag"] = 12] = "Drag";
|
|
79
|
+
IncrementalSource[IncrementalSource["StyleDeclaration"] = 13] = "StyleDeclaration";
|
|
80
|
+
})(IncrementalSource || (IncrementalSource = {}));
|
|
81
|
+
var MouseInteractions;
|
|
82
|
+
(function (MouseInteractions) {
|
|
83
|
+
MouseInteractions[MouseInteractions["MouseUp"] = 0] = "MouseUp";
|
|
84
|
+
MouseInteractions[MouseInteractions["MouseDown"] = 1] = "MouseDown";
|
|
85
|
+
MouseInteractions[MouseInteractions["Click"] = 2] = "Click";
|
|
86
|
+
MouseInteractions[MouseInteractions["ContextMenu"] = 3] = "ContextMenu";
|
|
87
|
+
MouseInteractions[MouseInteractions["DblClick"] = 4] = "DblClick";
|
|
88
|
+
MouseInteractions[MouseInteractions["Focus"] = 5] = "Focus";
|
|
89
|
+
MouseInteractions[MouseInteractions["Blur"] = 6] = "Blur";
|
|
90
|
+
MouseInteractions[MouseInteractions["TouchStart"] = 7] = "TouchStart";
|
|
91
|
+
MouseInteractions[MouseInteractions["TouchMove_Departed"] = 8] = "TouchMove_Departed";
|
|
92
|
+
MouseInteractions[MouseInteractions["TouchEnd"] = 9] = "TouchEnd";
|
|
93
|
+
MouseInteractions[MouseInteractions["TouchCancel"] = 10] = "TouchCancel";
|
|
94
|
+
})(MouseInteractions || (MouseInteractions = {}));
|
|
95
|
+
var CanvasContext;
|
|
96
|
+
(function (CanvasContext) {
|
|
97
|
+
CanvasContext[CanvasContext["2D"] = 0] = "2D";
|
|
98
|
+
CanvasContext[CanvasContext["WebGL"] = 1] = "WebGL";
|
|
99
|
+
CanvasContext[CanvasContext["WebGL2"] = 2] = "WebGL2";
|
|
100
|
+
})(CanvasContext || (CanvasContext = {}));
|
|
101
|
+
var MediaInteractions;
|
|
102
|
+
(function (MediaInteractions) {
|
|
103
|
+
MediaInteractions[MediaInteractions["Play"] = 0] = "Play";
|
|
104
|
+
MediaInteractions[MediaInteractions["Pause"] = 1] = "Pause";
|
|
105
|
+
MediaInteractions[MediaInteractions["Seeked"] = 2] = "Seeked";
|
|
106
|
+
MediaInteractions[MediaInteractions["VolumeChange"] = 3] = "VolumeChange";
|
|
107
|
+
})(MediaInteractions || (MediaInteractions = {}));
|
|
108
|
+
var ReplayerEvents;
|
|
109
|
+
(function (ReplayerEvents) {
|
|
110
|
+
ReplayerEvents["Start"] = "start";
|
|
111
|
+
ReplayerEvents["Pause"] = "pause";
|
|
112
|
+
ReplayerEvents["Resume"] = "resume";
|
|
113
|
+
ReplayerEvents["Resize"] = "resize";
|
|
114
|
+
ReplayerEvents["Finish"] = "finish";
|
|
115
|
+
ReplayerEvents["FullsnapshotRebuilded"] = "fullsnapshot-rebuilded";
|
|
116
|
+
ReplayerEvents["LoadStylesheetStart"] = "load-stylesheet-start";
|
|
117
|
+
ReplayerEvents["LoadStylesheetEnd"] = "load-stylesheet-end";
|
|
118
|
+
ReplayerEvents["SkipStart"] = "skip-start";
|
|
119
|
+
ReplayerEvents["SkipEnd"] = "skip-end";
|
|
120
|
+
ReplayerEvents["MouseInteraction"] = "mouse-interaction";
|
|
121
|
+
ReplayerEvents["EventCast"] = "event-cast";
|
|
122
|
+
ReplayerEvents["CustomEvent"] = "custom-event";
|
|
123
|
+
ReplayerEvents["Flush"] = "flush";
|
|
124
|
+
ReplayerEvents["StateChange"] = "state-change";
|
|
125
|
+
ReplayerEvents["PlayBack"] = "play-back";
|
|
126
|
+
})(ReplayerEvents || (ReplayerEvents = {}));
|
|
127
|
+
|
|
128
|
+
const ORIGINAL_ATTRIBUTE_NAME = '__rrweb_original__';
|
|
129
|
+
const defaultLogConfig = {
|
|
130
|
+
level: [
|
|
131
|
+
'assert',
|
|
132
|
+
'clear',
|
|
133
|
+
'count',
|
|
134
|
+
'countReset',
|
|
135
|
+
'debug',
|
|
136
|
+
'dir',
|
|
137
|
+
'dirxml',
|
|
138
|
+
'error',
|
|
139
|
+
'group',
|
|
140
|
+
'groupCollapsed',
|
|
141
|
+
'groupEnd',
|
|
142
|
+
'info',
|
|
143
|
+
'log',
|
|
144
|
+
'table',
|
|
145
|
+
'time',
|
|
146
|
+
'timeEnd',
|
|
147
|
+
'timeLog',
|
|
148
|
+
'trace',
|
|
149
|
+
'warn',
|
|
150
|
+
],
|
|
151
|
+
replayLogger: undefined,
|
|
152
|
+
};
|
|
153
|
+
class LogReplayPlugin {
|
|
154
|
+
constructor(config) {
|
|
155
|
+
this.config = Object.assign(defaultLogConfig, config);
|
|
156
|
+
}
|
|
157
|
+
getConsoleLogger() {
|
|
158
|
+
const replayLogger = {};
|
|
159
|
+
for (const level of this.config.level) {
|
|
160
|
+
if (level === 'trace') {
|
|
161
|
+
replayLogger[level] = (data) => {
|
|
162
|
+
const logger = console.log[ORIGINAL_ATTRIBUTE_NAME]
|
|
163
|
+
? console.log[ORIGINAL_ATTRIBUTE_NAME]
|
|
164
|
+
: console.log;
|
|
165
|
+
logger(...data.payload.map((s) => JSON.parse(s)), this.formatMessage(data));
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
replayLogger[level] = (data) => {
|
|
170
|
+
const logger = console[level][ORIGINAL_ATTRIBUTE_NAME]
|
|
171
|
+
? console[level][ORIGINAL_ATTRIBUTE_NAME]
|
|
172
|
+
: console[level];
|
|
173
|
+
logger(...data.payload.map((s) => JSON.parse(s)), this.formatMessage(data));
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return replayLogger;
|
|
178
|
+
}
|
|
179
|
+
formatMessage(data) {
|
|
180
|
+
if (data.trace.length === 0) {
|
|
181
|
+
return '';
|
|
182
|
+
}
|
|
183
|
+
const stackPrefix = '\n\tat ';
|
|
184
|
+
let result = stackPrefix;
|
|
185
|
+
result += data.trace.join(stackPrefix);
|
|
186
|
+
return result;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
const getReplayConsolePlugin = (options) => {
|
|
190
|
+
const replayLogger = (options === null || options === void 0 ? void 0 : options.replayLogger) || new LogReplayPlugin(options).getConsoleLogger();
|
|
191
|
+
return {
|
|
192
|
+
handler(event, _isSync, context) {
|
|
193
|
+
let logData = null;
|
|
194
|
+
if (event.type === EventType.IncrementalSnapshot &&
|
|
195
|
+
event.data.source === IncrementalSource.Log) {
|
|
196
|
+
logData = event.data;
|
|
197
|
+
}
|
|
198
|
+
else if (event.type === EventType.Plugin &&
|
|
199
|
+
event.data.plugin === PLUGIN_NAME) {
|
|
200
|
+
logData = event.data.payload;
|
|
201
|
+
}
|
|
202
|
+
if (logData) {
|
|
203
|
+
try {
|
|
204
|
+
if (typeof replayLogger[logData.level] === 'function') {
|
|
205
|
+
replayLogger[logData.level](logData);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
catch (error) {
|
|
209
|
+
if (context.replayer.config.showWarning) {
|
|
210
|
+
console.warn(error);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
};
|
|
286
216
|
};
|
|
287
217
|
|
|
288
218
|
exports.getReplayConsolePlugin = getReplayConsolePlugin;
|
|
@@ -2,26 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
key: '_sid',
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
? Object.assign({}, defaultOptions, options)
|
|
12
|
-
: defaultOptions;
|
|
13
|
-
|
|
14
|
-
return {
|
|
15
|
-
name: PLUGIN_NAME,
|
|
16
|
-
eventProcessor
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
5
|
+
const defaultOptions = {
|
|
6
|
+
key: '_sid',
|
|
7
|
+
};
|
|
8
|
+
const PLUGIN_NAME = 'rrweb/sequential-id@1';
|
|
9
|
+
const getRecordSequentialIdPlugin = (options) => {
|
|
10
|
+
const _options = options
|
|
11
|
+
? Object.assign({}, defaultOptions, options)
|
|
12
|
+
: defaultOptions;
|
|
13
|
+
let id = 0;
|
|
14
|
+
return {
|
|
15
|
+
name: PLUGIN_NAME,
|
|
16
|
+
eventProcessor(event) {
|
|
17
|
+
Object.assign(event, {
|
|
18
|
+
[_options.key]: ++id,
|
|
19
|
+
});
|
|
20
|
+
return event;
|
|
21
|
+
},
|
|
22
|
+
options: _options,
|
|
23
|
+
};
|
|
25
24
|
};
|
|
26
25
|
|
|
27
26
|
exports.PLUGIN_NAME = PLUGIN_NAME;
|
|
@@ -2,31 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
key: '_sid',
|
|
7
|
-
warnOnMissingId: true,
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
? Object.assign({}, defaultOptions, options)
|
|
12
|
-
: defaultOptions
|
|
13
|
-
|
|
14
|
-
return {
|
|
15
|
-
handler
|
|
16
|
-
if (key in event) {
|
|
17
|
-
|
|
18
|
-
if (id !== currentId) {
|
|
19
|
-
console.error(
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
currentId++;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
else if (warnOnMissingId) {
|
|
26
|
-
console.warn(
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
};
|
|
5
|
+
const defaultOptions = {
|
|
6
|
+
key: '_sid',
|
|
7
|
+
warnOnMissingId: true,
|
|
8
|
+
};
|
|
9
|
+
const getReplaySequentialIdPlugin = (options) => {
|
|
10
|
+
const { key, warnOnMissingId } = options
|
|
11
|
+
? Object.assign({}, defaultOptions, options)
|
|
12
|
+
: defaultOptions;
|
|
13
|
+
let currentId = 1;
|
|
14
|
+
return {
|
|
15
|
+
handler(event) {
|
|
16
|
+
if (key in event) {
|
|
17
|
+
const id = event[key];
|
|
18
|
+
if (id !== currentId) {
|
|
19
|
+
console.error(`[sequential-id-plugin]: expect to get an id with value "${currentId}", but got "${id}"`);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
currentId++;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
else if (warnOnMissingId) {
|
|
26
|
+
console.warn(`[sequential-id-plugin]: failed to get id in key: "${key}"`);
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
exports.getReplaySequentialIdPlugin = getReplaySequentialIdPlugin;
|