@highlight-run/rrweb 2.0.4 → 2.0.5
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 -454
- package/dist/plugins/console-record.min.js.map +1 -1
- package/dist/plugins/console-replay.js +4 -164
- package/dist/plugins/console-replay.min.js.map +1 -1
- package/dist/plugins/sequential-id-record.js +1 -30
- package/dist/plugins/sequential-id-replay.js +1 -33
- package/dist/record/rrweb-record-pack.js +3 -664
- package/dist/record/rrweb-record-pack.min.js.map +1 -1
- package/dist/record/rrweb-record.js +4 -3202
- package/dist/record/rrweb-record.min.js +3 -3
- 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 -4914
- package/dist/replay/rrweb-replay-unpack.min.css +2 -0
- package/dist/replay/rrweb-replay-unpack.min.css.map +1 -0
- package/dist/replay/rrweb-replay-unpack.min.js +1 -1
- 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 -4506
- package/dist/replay/rrweb-replay.min.css +2 -0
- package/dist/replay/rrweb-replay.min.css.map +1 -0
- package/dist/replay/rrweb-replay.min.js +1 -1
- package/dist/replay/rrweb-replay.min.js.map +1 -1
- package/dist/rrweb-all.css +1 -0
- package/dist/rrweb-all.js +16 -8877
- package/dist/rrweb-all.min.css +2 -0
- package/dist/rrweb-all.min.css.map +1 -0
- package/dist/rrweb-all.min.js +1 -1
- package/dist/rrweb-all.min.js.map +1 -1
- package/dist/rrweb.css +1 -0
- package/dist/rrweb.js +6 -7546
- package/dist/rrweb.min.css +2 -0
- package/dist/rrweb.min.css.map +1 -0
- package/dist/rrweb.min.js +1 -1
- package/dist/rrweb.min.js.map +1 -1
- package/es/rrweb/all.css +1 -0
- package/es/rrweb/packages/rrweb-snapshot/es/rrweb-snapshot.js +1 -1
- package/lib/replay/rrweb-replay-unpack.css +1 -0
- package/lib/replay/rrweb-replay-unpack.js +1 -1
- package/lib/replay/rrweb-replay.css +1 -0
- package/lib/replay/rrweb-replay.js +1 -1
- package/lib/rrweb-all.css +1 -0
- package/lib/rrweb-all.js +1 -1
- package/lib/rrweb.css +1 -0
- package/lib/rrweb.js +1 -1
- package/package.json +4 -4
|
@@ -1,164 +1,4 @@
|
|
|
1
|
-
var rrwebConsoleReplay
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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";
|
|
12
|
-
})(NodeType || (NodeType = {}));
|
|
13
|
-
|
|
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
|
-
}
|
|
35
|
-
};
|
|
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
|
-
});
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const PLUGIN_NAME = "rrweb/console@1";
|
|
48
|
-
|
|
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
|
|
101
|
-
};
|
|
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));
|
|
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) {
|
|
144
|
-
try {
|
|
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
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
exports.getReplayConsolePlugin = getReplayConsolePlugin;
|
|
159
|
-
|
|
160
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
161
|
-
|
|
162
|
-
return exports;
|
|
163
|
-
|
|
164
|
-
})({});
|
|
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}({});
|