@highlight-run/rrweb 2.0.1 → 2.0.4
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 +408 -609
- 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 +142 -271
- 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 +23 -26
- 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 +26 -30
- 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 +63 -146
- 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 +3002 -3118
- 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.js +4354 -4054
- 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.js +4286 -3984
- package/dist/replay/rrweb-replay.min.js +5 -17
- package/dist/replay/rrweb-replay.min.js.map +1 -1
- package/dist/rrweb-all.js +7634 -7453
- package/dist/rrweb-all.min.js +16 -17
- package/dist/rrweb-all.min.js.map +1 -1
- package/dist/rrweb.js +7339 -7075
- 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/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 +195 -71
- 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 +2473 -2425
- package/lib/replay/rrweb-replay-unpack.js +3797 -3343
- package/lib/replay/rrweb-replay.js +3742 -3288
- package/lib/rrweb-all.js +6725 -6247
- package/lib/rrweb.js +6157 -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/dist/replay/rrweb-replay-unpack.min.css +0 -2
- package/dist/replay/rrweb-replay-unpack.min.css.map +0 -1
- package/dist/replay/rrweb-replay.min.css +0 -2
- package/dist/replay/rrweb-replay.min.css.map +0 -1
- package/dist/rrweb-all.min.css +0 -2
- package/dist/rrweb-all.min.css.map +0 -1
- package/dist/rrweb.min.css +0 -2
- package/dist/rrweb.min.css.map +0 -1
- 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
|
@@ -1,287 +1,158 @@
|
|
|
1
1
|
var rrwebConsoleReplay = (function (exports) {
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
/*! *****************************************************************************
|
|
5
|
-
Copyright (c) Microsoft Corporation.
|
|
6
|
-
|
|
7
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
8
|
-
purpose with or without fee is hereby granted.
|
|
9
|
-
|
|
10
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
11
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
12
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
13
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
14
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
15
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
16
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
17
|
-
***************************************************************************** */
|
|
18
|
-
|
|
19
|
-
function __values(o) {
|
|
20
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
21
|
-
if (m) return m.call(o);
|
|
22
|
-
if (o && typeof o.length === "number") return {
|
|
23
|
-
next: function () {
|
|
24
|
-
if (o && i >= o.length) o = void 0;
|
|
25
|
-
return { value: o && o[i++], done: !o };
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function __read(o, n) {
|
|
32
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
33
|
-
if (!m) return o;
|
|
34
|
-
var i = m.call(o), r, ar = [], e;
|
|
35
|
-
try {
|
|
36
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
37
|
-
}
|
|
38
|
-
catch (error) { e = { error: error }; }
|
|
39
|
-
finally {
|
|
40
|
-
try {
|
|
41
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
42
|
-
}
|
|
43
|
-
finally { if (e) throw e.error; }
|
|
44
|
-
}
|
|
45
|
-
return ar;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function __spreadArray(to, from, pack) {
|
|
49
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
50
|
-
if (ar || !(i in from)) {
|
|
51
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
52
|
-
ar[i] = from[i];
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
var EventType;
|
|
59
|
-
(function (EventType) {
|
|
60
|
-
EventType[EventType["DomContentLoaded"] = 0] = "DomContentLoaded";
|
|
61
|
-
EventType[EventType["Load"] = 1] = "Load";
|
|
62
|
-
EventType[EventType["FullSnapshot"] = 2] = "FullSnapshot";
|
|
63
|
-
EventType[EventType["IncrementalSnapshot"] = 3] = "IncrementalSnapshot";
|
|
64
|
-
EventType[EventType["Meta"] = 4] = "Meta";
|
|
65
|
-
EventType[EventType["Custom"] = 5] = "Custom";
|
|
66
|
-
EventType[EventType["Plugin"] = 6] = "Plugin";
|
|
67
|
-
})(EventType || (EventType = {}));
|
|
68
|
-
var IncrementalSource;
|
|
69
|
-
(function (IncrementalSource) {
|
|
70
|
-
IncrementalSource[IncrementalSource["Mutation"] = 0] = "Mutation";
|
|
71
|
-
IncrementalSource[IncrementalSource["MouseMove"] = 1] = "MouseMove";
|
|
72
|
-
IncrementalSource[IncrementalSource["MouseInteraction"] = 2] = "MouseInteraction";
|
|
73
|
-
IncrementalSource[IncrementalSource["Scroll"] = 3] = "Scroll";
|
|
74
|
-
IncrementalSource[IncrementalSource["ViewportResize"] = 4] = "ViewportResize";
|
|
75
|
-
IncrementalSource[IncrementalSource["Input"] = 5] = "Input";
|
|
76
|
-
IncrementalSource[IncrementalSource["TouchMove"] = 6] = "TouchMove";
|
|
77
|
-
IncrementalSource[IncrementalSource["MediaInteraction"] = 7] = "MediaInteraction";
|
|
78
|
-
IncrementalSource[IncrementalSource["StyleSheetRule"] = 8] = "StyleSheetRule";
|
|
79
|
-
IncrementalSource[IncrementalSource["CanvasMutation"] = 9] = "CanvasMutation";
|
|
80
|
-
IncrementalSource[IncrementalSource["Font"] = 10] = "Font";
|
|
81
|
-
IncrementalSource[IncrementalSource["Log"] = 11] = "Log";
|
|
82
|
-
IncrementalSource[IncrementalSource["Drag"] = 12] = "Drag";
|
|
83
|
-
IncrementalSource[IncrementalSource["StyleDeclaration"] = 13] = "StyleDeclaration";
|
|
84
|
-
})(IncrementalSource || (IncrementalSource = {}));
|
|
85
|
-
var MouseInteractions;
|
|
86
|
-
(function (MouseInteractions) {
|
|
87
|
-
MouseInteractions[MouseInteractions["MouseUp"] = 0] = "MouseUp";
|
|
88
|
-
MouseInteractions[MouseInteractions["MouseDown"] = 1] = "MouseDown";
|
|
89
|
-
MouseInteractions[MouseInteractions["Click"] = 2] = "Click";
|
|
90
|
-
MouseInteractions[MouseInteractions["ContextMenu"] = 3] = "ContextMenu";
|
|
91
|
-
MouseInteractions[MouseInteractions["DblClick"] = 4] = "DblClick";
|
|
92
|
-
MouseInteractions[MouseInteractions["Focus"] = 5] = "Focus";
|
|
93
|
-
MouseInteractions[MouseInteractions["Blur"] = 6] = "Blur";
|
|
94
|
-
MouseInteractions[MouseInteractions["TouchStart"] = 7] = "TouchStart";
|
|
95
|
-
MouseInteractions[MouseInteractions["TouchMove_Departed"] = 8] = "TouchMove_Departed";
|
|
96
|
-
MouseInteractions[MouseInteractions["TouchEnd"] = 9] = "TouchEnd";
|
|
97
|
-
MouseInteractions[MouseInteractions["TouchCancel"] = 10] = "TouchCancel";
|
|
98
|
-
})(MouseInteractions || (MouseInteractions = {}));
|
|
99
|
-
var CanvasContext;
|
|
100
|
-
(function (CanvasContext) {
|
|
101
|
-
CanvasContext[CanvasContext["2D"] = 0] = "2D";
|
|
102
|
-
CanvasContext[CanvasContext["WebGL"] = 1] = "WebGL";
|
|
103
|
-
CanvasContext[CanvasContext["WebGL2"] = 2] = "WebGL2";
|
|
104
|
-
})(CanvasContext || (CanvasContext = {}));
|
|
105
|
-
var MediaInteractions;
|
|
106
|
-
(function (MediaInteractions) {
|
|
107
|
-
MediaInteractions[MediaInteractions["Play"] = 0] = "Play";
|
|
108
|
-
MediaInteractions[MediaInteractions["Pause"] = 1] = "Pause";
|
|
109
|
-
MediaInteractions[MediaInteractions["Seeked"] = 2] = "Seeked";
|
|
110
|
-
MediaInteractions[MediaInteractions["VolumeChange"] = 3] = "VolumeChange";
|
|
111
|
-
})(MediaInteractions || (MediaInteractions = {}));
|
|
112
|
-
var ReplayerEvents;
|
|
113
|
-
(function (ReplayerEvents) {
|
|
114
|
-
ReplayerEvents["Start"] = "start";
|
|
115
|
-
ReplayerEvents["Pause"] = "pause";
|
|
116
|
-
ReplayerEvents["Resume"] = "resume";
|
|
117
|
-
ReplayerEvents["Resize"] = "resize";
|
|
118
|
-
ReplayerEvents["Finish"] = "finish";
|
|
119
|
-
ReplayerEvents["FullsnapshotRebuilded"] = "fullsnapshot-rebuilded";
|
|
120
|
-
ReplayerEvents["LoadStylesheetStart"] = "load-stylesheet-start";
|
|
121
|
-
ReplayerEvents["LoadStylesheetEnd"] = "load-stylesheet-end";
|
|
122
|
-
ReplayerEvents["SkipStart"] = "skip-start";
|
|
123
|
-
ReplayerEvents["SkipEnd"] = "skip-end";
|
|
124
|
-
ReplayerEvents["MouseInteraction"] = "mouse-interaction";
|
|
125
|
-
ReplayerEvents["EventCast"] = "event-cast";
|
|
126
|
-
ReplayerEvents["CustomEvent"] = "custom-event";
|
|
127
|
-
ReplayerEvents["Flush"] = "flush";
|
|
128
|
-
ReplayerEvents["StateChange"] = "state-change";
|
|
129
|
-
ReplayerEvents["PlayBack"] = "play-back";
|
|
130
|
-
})(ReplayerEvents || (ReplayerEvents = {}));
|
|
131
|
-
|
|
132
4
|
var NodeType;
|
|
133
|
-
(function
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
5
|
+
(function(NodeType2) {
|
|
6
|
+
NodeType2[NodeType2["Document"] = 0] = "Document";
|
|
7
|
+
NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
|
|
8
|
+
NodeType2[NodeType2["Element"] = 2] = "Element";
|
|
9
|
+
NodeType2[NodeType2["Text"] = 3] = "Text";
|
|
10
|
+
NodeType2[NodeType2["CDATA"] = 4] = "CDATA";
|
|
11
|
+
NodeType2[NodeType2["Comment"] = 5] = "Comment";
|
|
140
12
|
})(NodeType || (NodeType = {}));
|
|
141
13
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
},
|
|
164
|
-
reset: function () {
|
|
165
|
-
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
166
|
-
},
|
|
14
|
+
const DEPARTED_MIRROR_ACCESS_WARNING = "Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";
|
|
15
|
+
let _mirror = {
|
|
16
|
+
map: {},
|
|
17
|
+
getId() {
|
|
18
|
+
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
19
|
+
return -1;
|
|
20
|
+
},
|
|
21
|
+
getNode() {
|
|
22
|
+
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
23
|
+
return null;
|
|
24
|
+
},
|
|
25
|
+
removeNodeFromMap() {
|
|
26
|
+
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
27
|
+
},
|
|
28
|
+
has() {
|
|
29
|
+
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
30
|
+
return false;
|
|
31
|
+
},
|
|
32
|
+
reset() {
|
|
33
|
+
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
34
|
+
}
|
|
167
35
|
};
|
|
168
|
-
if (typeof window !==
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
36
|
+
if (typeof window !== "undefined" && window.Proxy && window.Reflect) {
|
|
37
|
+
_mirror = new Proxy(_mirror, {
|
|
38
|
+
get(target, prop, receiver) {
|
|
39
|
+
if (prop === "map") {
|
|
40
|
+
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
41
|
+
}
|
|
42
|
+
return Reflect.get(target, prop, receiver);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
177
45
|
}
|
|
178
46
|
|
|
179
|
-
|
|
47
|
+
const PLUGIN_NAME = "rrweb/console@1";
|
|
180
48
|
|
|
181
|
-
var
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
49
|
+
var EventType = /* @__PURE__ */ ((EventType2) => {
|
|
50
|
+
EventType2[EventType2["DomContentLoaded"] = 0] = "DomContentLoaded";
|
|
51
|
+
EventType2[EventType2["Load"] = 1] = "Load";
|
|
52
|
+
EventType2[EventType2["FullSnapshot"] = 2] = "FullSnapshot";
|
|
53
|
+
EventType2[EventType2["IncrementalSnapshot"] = 3] = "IncrementalSnapshot";
|
|
54
|
+
EventType2[EventType2["Meta"] = 4] = "Meta";
|
|
55
|
+
EventType2[EventType2["Custom"] = 5] = "Custom";
|
|
56
|
+
EventType2[EventType2["Plugin"] = 6] = "Plugin";
|
|
57
|
+
return EventType2;
|
|
58
|
+
})(EventType || {});
|
|
59
|
+
var IncrementalSource = /* @__PURE__ */ ((IncrementalSource2) => {
|
|
60
|
+
IncrementalSource2[IncrementalSource2["Mutation"] = 0] = "Mutation";
|
|
61
|
+
IncrementalSource2[IncrementalSource2["MouseMove"] = 1] = "MouseMove";
|
|
62
|
+
IncrementalSource2[IncrementalSource2["MouseInteraction"] = 2] = "MouseInteraction";
|
|
63
|
+
IncrementalSource2[IncrementalSource2["Scroll"] = 3] = "Scroll";
|
|
64
|
+
IncrementalSource2[IncrementalSource2["ViewportResize"] = 4] = "ViewportResize";
|
|
65
|
+
IncrementalSource2[IncrementalSource2["Input"] = 5] = "Input";
|
|
66
|
+
IncrementalSource2[IncrementalSource2["TouchMove"] = 6] = "TouchMove";
|
|
67
|
+
IncrementalSource2[IncrementalSource2["MediaInteraction"] = 7] = "MediaInteraction";
|
|
68
|
+
IncrementalSource2[IncrementalSource2["StyleSheetRule"] = 8] = "StyleSheetRule";
|
|
69
|
+
IncrementalSource2[IncrementalSource2["CanvasMutation"] = 9] = "CanvasMutation";
|
|
70
|
+
IncrementalSource2[IncrementalSource2["Font"] = 10] = "Font";
|
|
71
|
+
IncrementalSource2[IncrementalSource2["Log"] = 11] = "Log";
|
|
72
|
+
IncrementalSource2[IncrementalSource2["Drag"] = 12] = "Drag";
|
|
73
|
+
IncrementalSource2[IncrementalSource2["StyleDeclaration"] = 13] = "StyleDeclaration";
|
|
74
|
+
return IncrementalSource2;
|
|
75
|
+
})(IncrementalSource || {});
|
|
76
|
+
|
|
77
|
+
const ORIGINAL_ATTRIBUTE_NAME = "__rrweb_original__";
|
|
78
|
+
const defaultLogConfig = {
|
|
79
|
+
level: [
|
|
80
|
+
"assert",
|
|
81
|
+
"clear",
|
|
82
|
+
"count",
|
|
83
|
+
"countReset",
|
|
84
|
+
"debug",
|
|
85
|
+
"dir",
|
|
86
|
+
"dirxml",
|
|
87
|
+
"error",
|
|
88
|
+
"group",
|
|
89
|
+
"groupCollapsed",
|
|
90
|
+
"groupEnd",
|
|
91
|
+
"info",
|
|
92
|
+
"log",
|
|
93
|
+
"table",
|
|
94
|
+
"time",
|
|
95
|
+
"timeEnd",
|
|
96
|
+
"timeLog",
|
|
97
|
+
"trace",
|
|
98
|
+
"warn"
|
|
99
|
+
],
|
|
100
|
+
replayLogger: void 0
|
|
205
101
|
};
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}
|
|
223
|
-
else {
|
|
224
|
-
replayLogger[level] = function (data) {
|
|
225
|
-
var logger = console[level][ORIGINAL_ATTRIBUTE_NAME]
|
|
226
|
-
? console[level][ORIGINAL_ATTRIBUTE_NAME]
|
|
227
|
-
: console[level];
|
|
228
|
-
logger.apply(void 0, __spreadArray(__spreadArray([], __read(data.payload.map(function (s) { return JSON.parse(s); })), false), [_this.formatMessage(data)], false));
|
|
229
|
-
};
|
|
230
|
-
}
|
|
102
|
+
class LogReplayPlugin {
|
|
103
|
+
constructor(config) {
|
|
104
|
+
this.config = Object.assign(defaultLogConfig, config);
|
|
105
|
+
}
|
|
106
|
+
getConsoleLogger() {
|
|
107
|
+
const replayLogger = {};
|
|
108
|
+
for (const level of this.config.level) {
|
|
109
|
+
if (level === "trace") {
|
|
110
|
+
replayLogger[level] = (data) => {
|
|
111
|
+
const logger = console.log[ORIGINAL_ATTRIBUTE_NAME] ? console.log[ORIGINAL_ATTRIBUTE_NAME] : console.log;
|
|
112
|
+
logger(...data.payload.map((s) => JSON.parse(s)), this.formatMessage(data));
|
|
113
|
+
};
|
|
114
|
+
} else {
|
|
115
|
+
replayLogger[level] = (data) => {
|
|
116
|
+
const logger = console[level][ORIGINAL_ATTRIBUTE_NAME] ? console[level][ORIGINAL_ATTRIBUTE_NAME] : console[level];
|
|
117
|
+
logger(...data.payload.map((s) => JSON.parse(s)), this.formatMessage(data));
|
|
231
118
|
};
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return replayLogger;
|
|
122
|
+
}
|
|
123
|
+
formatMessage(data) {
|
|
124
|
+
if (data.trace.length === 0) {
|
|
125
|
+
return "";
|
|
126
|
+
}
|
|
127
|
+
const stackPrefix = "\n at ";
|
|
128
|
+
let result = stackPrefix;
|
|
129
|
+
result += data.trace.join(stackPrefix);
|
|
130
|
+
return result;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
const getReplayConsolePlugin = (options) => {
|
|
134
|
+
const replayLogger = (options == null ? void 0 : options.replayLogger) || new LogReplayPlugin(options).getConsoleLogger();
|
|
135
|
+
return {
|
|
136
|
+
handler(event, _isSync, context) {
|
|
137
|
+
let logData = null;
|
|
138
|
+
if (event.type === EventType.IncrementalSnapshot && event.data.source === IncrementalSource.Log) {
|
|
139
|
+
logData = event.data;
|
|
140
|
+
} else if (event.type === EventType.Plugin && event.data.plugin === PLUGIN_NAME) {
|
|
141
|
+
logData = event.data.payload;
|
|
142
|
+
}
|
|
143
|
+
if (logData) {
|
|
232
144
|
try {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
try {
|
|
241
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
242
|
-
}
|
|
243
|
-
finally { if (e_1) throw e_1.error; }
|
|
145
|
+
if (typeof replayLogger[logData.level] === "function") {
|
|
146
|
+
replayLogger[logData.level](logData);
|
|
147
|
+
}
|
|
148
|
+
} catch (error) {
|
|
149
|
+
if (context.replayer.config.showWarning) {
|
|
150
|
+
console.warn(error);
|
|
151
|
+
}
|
|
244
152
|
}
|
|
245
|
-
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
if (data.trace.length === 0) {
|
|
249
|
-
return '';
|
|
250
|
-
}
|
|
251
|
-
var stackPrefix = '\n\tat ';
|
|
252
|
-
var result = stackPrefix;
|
|
253
|
-
result += data.trace.join(stackPrefix);
|
|
254
|
-
return result;
|
|
255
|
-
};
|
|
256
|
-
return LogReplayPlugin;
|
|
257
|
-
}());
|
|
258
|
-
var getReplayConsolePlugin = function (options) {
|
|
259
|
-
var replayLogger = (options === null || options === void 0 ? void 0 : options.replayLogger) || new LogReplayPlugin(options).getConsoleLogger();
|
|
260
|
-
return {
|
|
261
|
-
handler: function (event, _isSync, context) {
|
|
262
|
-
var logData = null;
|
|
263
|
-
if (event.type === EventType.IncrementalSnapshot &&
|
|
264
|
-
event.data.source === IncrementalSource.Log) {
|
|
265
|
-
logData = event.data;
|
|
266
|
-
}
|
|
267
|
-
else if (event.type === EventType.Plugin &&
|
|
268
|
-
event.data.plugin === PLUGIN_NAME) {
|
|
269
|
-
logData = event.data.payload;
|
|
270
|
-
}
|
|
271
|
-
if (logData) {
|
|
272
|
-
try {
|
|
273
|
-
if (typeof replayLogger[logData.level] === 'function') {
|
|
274
|
-
replayLogger[logData.level](logData);
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
catch (error) {
|
|
278
|
-
if (context.replayer.config.showWarning) {
|
|
279
|
-
console.warn(error);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
},
|
|
284
|
-
};
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
};
|
|
285
156
|
};
|
|
286
157
|
|
|
287
158
|
exports.getReplayConsolePlugin = getReplayConsolePlugin;
|
|
@@ -290,4 +161,4 @@ var rrwebConsoleReplay = (function (exports) {
|
|
|
290
161
|
|
|
291
162
|
return exports;
|
|
292
163
|
|
|
293
|
-
}({})
|
|
164
|
+
})({});
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
var rrwebConsoleReplay=function(
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function o(e,o){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var n,r,a=t.call(e),l=[];try{for(;(void 0===o||o-- >0)&&!(n=a.next()).done;)l.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(t=a.return)&&t.call(a)}finally{if(r)throw r.error}}return l}function t(e,o,t){if(t||2===arguments.length)for(var n,r=0,a=o.length;r<a;r++)!n&&r in o||(n||(n=Array.prototype.slice.call(o,0,r)),n[r]=o[r]);return e.concat(n||Array.prototype.slice.call(o))}var n,r,a,l,i,u,c;!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin"}(n||(n={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration"}(r||(r={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel"}(a||(a={})),function(e){e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2"}(l||(l={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange"}(i||(i={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back"}(u||(u={})),function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(c||(c={}));var s="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",f={map:{},getId:function(){return console.error(s),-1},getNode:function(){return console.error(s),null},removeNodeFromMap:function(){console.error(s)},has:function(){return console.error(s),!1},reset:function(){console.error(s)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(f=new Proxy(f,{get:function(e,o,t){return"map"===o&&console.error(s),Reflect.get(e,o,t)}}));var p={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],replayLogger:void 0},d=function(){function e(e){this.config=Object.assign(p,e)}return e.prototype.getConsoleLogger=function(){var e,n,r=this,a={},l=function(e){a[e]="trace"===e?function(e){(console.log.__rrweb_original__?console.log.__rrweb_original__:console.log).apply(void 0,t(t([],o(e.payload.map((function(e){return JSON.parse(e)}))),!1),[r.formatMessage(e)],!1))}:function(n){(console[e].__rrweb_original__?console[e].__rrweb_original__:console[e]).apply(void 0,t(t([],o(n.payload.map((function(e){return JSON.parse(e)}))),!1),[r.formatMessage(n)],!1))}};try{for(var i=function(e){var o="function"==typeof Symbol&&Symbol.iterator,t=o&&e[o],n=0;if(t)return t.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.config.level),u=i.next();!u.done;u=i.next()){l(u.value)}}catch(o){e={error:o}}finally{try{u&&!u.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return a},e.prototype.formatMessage=function(e){if(0===e.trace.length)return"";var o="\n\tat ",t=o;return t+=e.trace.join(o)},e}();return e.getReplayConsolePlugin=function(e){var o=(null==e?void 0:e.replayLogger)||new d(e).getConsoleLogger();return{handler:function(e,t,a){var l=null;if(e.type===n.IncrementalSnapshot&&e.data.source===r.Log?l=e.data:e.type===n.Plugin&&"rrweb/console@1"===e.data.plugin&&(l=e.data.payload),l)try{"function"==typeof o[l.level]&&o[l.level](l)}catch(e){a.replayer.config.showWarning&&console.warn(e)}}}},Object.defineProperty(e,"__esModule",{value:!0}),e}({});
|
|
1
|
+
var rrwebConsoleReplay=function(c){"use strict";var i;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(i||(i={}));const r=`Please stop import mirror directly. Instead of that,\r
|
|
2
|
+
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
3
|
+
or you can use record.mirror to access the mirror instance during recording.`;let d={map:{},getId(){return console.error(r),-1},getNode(){return console.error(r),null},removeNodeFromMap(){console.error(r)},has(){return console.error(r),!1},reset(){console.error(r)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(d=new Proxy(d,{get(e,t,o){return t==="map"&&console.error(r),Reflect.get(e,t,o)}}));const g="rrweb/console@1";var u=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(u||{}),p=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e))(p||{}),m=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(m||{}),h=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(h||{}),y=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(y||{}),M=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e))(M||{});const s="__rrweb_original__",C={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],replayLogger:void 0};class S{constructor(t){this.config=Object.assign(C,t)}getConsoleLogger(){const t={};for(const o of this.config.level)o==="trace"?t[o]=n=>{(console.log[s]?console.log[s]:console.log)(...n.payload.map(l=>JSON.parse(l)),this.formatMessage(n))}:t[o]=n=>{(console[o][s]?console[o][s]:console[o])(...n.payload.map(l=>JSON.parse(l)),this.formatMessage(n))};return t}formatMessage(t){if(t.trace.length===0)return"";const o=`
|
|
4
|
+
at `;let n=o;return n+=t.trace.join(o),n}}const v=e=>{const t=e?.replayLogger||new S(e).getConsoleLogger();return{handler(o,n,l){let a=null;if(o.type===u.IncrementalSnapshot&&o.data.source===p.Log?a=o.data:o.type===u.Plugin&&o.data.plugin===g&&(a=o.data.payload),a)try{typeof t[a.level]=="function"&&t[a.level](a)}catch(f){l.replayer.config.showWarning&&console.warn(f)}}}};return c.getReplayConsolePlugin=v,Object.defineProperty(c,"__esModule",{value:!0}),c}({});
|
|
16
5
|
//# sourceMappingURL=console-replay.min.js.map
|