@highlight-run/rrweb 2.0.0-lambda.7 → 2.0.0-lambda.9
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 +916 -76
- package/dist/rrweb.cjs.map +1 -1
- package/dist/rrweb.d.cts +179 -1
- package/dist/rrweb.d.ts +179 -1
- package/dist/rrweb.js +916 -76
- package/dist/rrweb.js.map +1 -1
- package/dist/rrweb.umd.cjs +908 -76
- package/dist/rrweb.umd.cjs.map +4 -4
- package/dist/rrweb.umd.min.cjs +57 -47
- package/dist/rrweb.umd.min.cjs.map +4 -4
- package/package.json +5 -5
- package/umd/rrweb.js +908 -76
- package/umd/rrweb.min.js +57 -47
package/dist/rrweb.d.cts
CHANGED
|
@@ -9,6 +9,7 @@ import { Emitter } from '../../../../node_modules/@highlight-run/rrweb-types/dis
|
|
|
9
9
|
import { EventType } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
10
10
|
import { eventWithTime } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
11
11
|
import { eventWithTime as eventWithTime_2 } from '../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
12
|
+
import { eventWithTime as eventWithTime_3 } from '../../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
12
13
|
import { Handler } from '../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
13
14
|
import { hookResetter } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
14
15
|
import { hooksParam } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
@@ -29,6 +30,7 @@ import { MouseInteractions } from '../../../node_modules/@highlight-run/rrweb-ty
|
|
|
29
30
|
import { nowTimestamp } from '../../../node_modules/@highlight-run/rrweb-utils/dist/rrweb-utils.js';
|
|
30
31
|
import { PackFn } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
31
32
|
import { playerMetaData } from '../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
33
|
+
import { playerMetaData as playerMetaData_2 } from '../../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
32
34
|
import { RecordPlugin } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
33
35
|
import { ReplayerEvents } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
34
36
|
import { RRDocument } from '../../../../node_modules/@highlight-run/rrdom/dist/rrdom.js';
|
|
@@ -36,6 +38,7 @@ import { RRIFrameElement } from '../../../node_modules/@highlight-run/rrdom/dist
|
|
|
36
38
|
import { RRNode } from '../../../node_modules/@highlight-run/rrdom/dist/rrdom.js';
|
|
37
39
|
import { SamplingStrategy } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
38
40
|
import { SessionInterval } from '../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
41
|
+
import { SessionInterval as SessionInterval_2 } from '../../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
39
42
|
import { SlimDOMOptions } from '../../../node_modules/@highlight-run/rrweb-snapshot/dist/rrweb-snapshot.js';
|
|
40
43
|
import { StateMachine } from '@xstate/fsm';
|
|
41
44
|
import { textMutation } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
@@ -49,13 +52,16 @@ declare type AppendedIframe = {
|
|
|
49
52
|
builtNode: HTMLIFrameElement | RRIFrameElement;
|
|
50
53
|
};
|
|
51
54
|
|
|
52
|
-
export declare function
|
|
55
|
+
export declare function buildHostDocument(options: HostDocumentOptions): string;
|
|
56
|
+
|
|
57
|
+
export declare function canvasMutation({ event, mutation, target, imageMap, canvasEventMap, errorHandler, enforceCanvasArgAllowlist, }: {
|
|
53
58
|
event: Parameters<Replayer['applyIncremental']>[0];
|
|
54
59
|
mutation: canvasMutationData;
|
|
55
60
|
target: HTMLCanvasElement;
|
|
56
61
|
imageMap: Replayer['imageMap'];
|
|
57
62
|
canvasEventMap: Replayer['canvasEventMap'];
|
|
58
63
|
errorHandler: Replayer['warnCanvasMutationFailed'];
|
|
64
|
+
enforceCanvasArgAllowlist?: boolean;
|
|
59
65
|
}): Promise<void>;
|
|
60
66
|
|
|
61
67
|
declare function closestElementOfNode(node: Node | null): HTMLElement | null;
|
|
@@ -64,6 +70,84 @@ declare function createPlayerService(context: PlayerContext, { getCastFn, applyE
|
|
|
64
70
|
|
|
65
71
|
declare function createSpeedService(context: SpeedContext): StateMachine.Service<SpeedContext, SpeedEvent, SpeedState>;
|
|
66
72
|
|
|
73
|
+
export declare class EmbeddedReplayerClient {
|
|
74
|
+
private readonly iframe;
|
|
75
|
+
private readonly hostOrigin;
|
|
76
|
+
private readonly listeners;
|
|
77
|
+
private metadata;
|
|
78
|
+
private activityIntervals;
|
|
79
|
+
private dimensions;
|
|
80
|
+
private lastCurrentTime;
|
|
81
|
+
private ready;
|
|
82
|
+
private readyResolvers;
|
|
83
|
+
private disposed;
|
|
84
|
+
private pending;
|
|
85
|
+
constructor(iframe: HTMLIFrameElement, options?: EmbeddedReplayerClientOptions);
|
|
86
|
+
whenReady(): Promise<void>;
|
|
87
|
+
init(events: eventWithTime_3[], config?: SerializableReplayerConfig, autoplay?: boolean): void;
|
|
88
|
+
play(timeOffset?: number): void;
|
|
89
|
+
pause(timeOffset?: number): void;
|
|
90
|
+
resume(timeOffset?: number): void;
|
|
91
|
+
setConfig(config: SerializableReplayerConfig): void;
|
|
92
|
+
setLayout(scale: number, anchor?: ReplayAnchor): void;
|
|
93
|
+
replaceEvents(events: eventWithTime_3[]): void;
|
|
94
|
+
addEvent(event: eventWithTime_3): void;
|
|
95
|
+
enableInteract(): void;
|
|
96
|
+
disableInteract(): void;
|
|
97
|
+
destroy(): void;
|
|
98
|
+
on(event: string, listener: Listener): void;
|
|
99
|
+
off(event: string, listener: Listener): void;
|
|
100
|
+
getCurrentTime(): number;
|
|
101
|
+
getMetaData(): playerMetaData_2 | null;
|
|
102
|
+
getActivityIntervals(): SessionInterval_2[];
|
|
103
|
+
getDimensions(): ReplayDimensions | null;
|
|
104
|
+
private send;
|
|
105
|
+
private postToHost;
|
|
106
|
+
private flushPending;
|
|
107
|
+
private probe;
|
|
108
|
+
private onMessage;
|
|
109
|
+
private handle;
|
|
110
|
+
private emit;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export declare interface EmbeddedReplayerClientOptions {
|
|
114
|
+
hostOrigin?: string;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export declare class EmbeddedReplayerHost {
|
|
118
|
+
private readonly root;
|
|
119
|
+
private readonly parentWindow;
|
|
120
|
+
private readonly timeUpdateIntervalMs;
|
|
121
|
+
private readonly expectedParentOrigin;
|
|
122
|
+
private replayer;
|
|
123
|
+
private playing;
|
|
124
|
+
private timer;
|
|
125
|
+
private started;
|
|
126
|
+
private layout;
|
|
127
|
+
constructor(options?: EmbeddedReplayerHostOptions);
|
|
128
|
+
start(): void;
|
|
129
|
+
stop(): void;
|
|
130
|
+
private onMessage;
|
|
131
|
+
private handle;
|
|
132
|
+
private init;
|
|
133
|
+
private applyLayout;
|
|
134
|
+
private postDimensions;
|
|
135
|
+
private postInitialized;
|
|
136
|
+
private wireEvents;
|
|
137
|
+
private setPlaying;
|
|
138
|
+
private startTimePump;
|
|
139
|
+
private postTime;
|
|
140
|
+
private stopTimePump;
|
|
141
|
+
private post;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export declare interface EmbeddedReplayerHostOptions {
|
|
145
|
+
expectedParentOrigin?: string;
|
|
146
|
+
root?: HTMLElement;
|
|
147
|
+
parentWindow?: Window;
|
|
148
|
+
timeUpdateIntervalMs?: number;
|
|
149
|
+
}
|
|
150
|
+
|
|
67
151
|
declare type ErrorHandler = (error: unknown) => void | boolean;
|
|
68
152
|
|
|
69
153
|
export { EventType }
|
|
@@ -100,6 +184,73 @@ declare function hasShadowRoot<T extends Node | RRNode>(n: T): n is T & {
|
|
|
100
184
|
|
|
101
185
|
declare function hookSetter<T>(target: T, key: string | number | symbol, d: PropertyDescriptor, isRevoked?: boolean, win?: Window & typeof globalThis): hookResetter;
|
|
102
186
|
|
|
187
|
+
export declare type HostCommand = {
|
|
188
|
+
type: 'ping';
|
|
189
|
+
} | {
|
|
190
|
+
type: 'init';
|
|
191
|
+
events: eventWithTime_3[];
|
|
192
|
+
config?: SerializableReplayerConfig;
|
|
193
|
+
autoplay?: boolean;
|
|
194
|
+
} | {
|
|
195
|
+
type: 'setLayout';
|
|
196
|
+
scale: number;
|
|
197
|
+
anchor?: ReplayAnchor;
|
|
198
|
+
} | {
|
|
199
|
+
type: 'play';
|
|
200
|
+
timeOffset?: number;
|
|
201
|
+
} | {
|
|
202
|
+
type: 'pause';
|
|
203
|
+
timeOffset?: number;
|
|
204
|
+
} | {
|
|
205
|
+
type: 'resume';
|
|
206
|
+
timeOffset?: number;
|
|
207
|
+
} | {
|
|
208
|
+
type: 'setConfig';
|
|
209
|
+
config: SerializableReplayerConfig;
|
|
210
|
+
} | {
|
|
211
|
+
type: 'replaceEvents';
|
|
212
|
+
events: eventWithTime_3[];
|
|
213
|
+
} | {
|
|
214
|
+
type: 'addEvent';
|
|
215
|
+
event: eventWithTime_3;
|
|
216
|
+
} | {
|
|
217
|
+
type: 'enableInteract';
|
|
218
|
+
} | {
|
|
219
|
+
type: 'disableInteract';
|
|
220
|
+
} | {
|
|
221
|
+
type: 'destroy';
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
export declare interface HostDocumentOptions {
|
|
225
|
+
scriptUrl: string;
|
|
226
|
+
styleUrl?: string;
|
|
227
|
+
extraStyleSources?: string[];
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export declare type HostMessage = {
|
|
231
|
+
type: 'ready';
|
|
232
|
+
} | {
|
|
233
|
+
type: 'initialized';
|
|
234
|
+
metadata: playerMetaData_2;
|
|
235
|
+
activityIntervals: SessionInterval_2[];
|
|
236
|
+
} | {
|
|
237
|
+
type: 'replayer-event';
|
|
238
|
+
event: string;
|
|
239
|
+
payload?: unknown;
|
|
240
|
+
} | {
|
|
241
|
+
type: 'time';
|
|
242
|
+
currentTime: number;
|
|
243
|
+
} | {
|
|
244
|
+
type: 'dimensions';
|
|
245
|
+
width: number;
|
|
246
|
+
height: number;
|
|
247
|
+
top: number;
|
|
248
|
+
left: number;
|
|
249
|
+
} | {
|
|
250
|
+
type: 'error';
|
|
251
|
+
message: string;
|
|
252
|
+
};
|
|
253
|
+
|
|
103
254
|
export { IncrementalSource }
|
|
104
255
|
|
|
105
256
|
declare function inDom(n: Node): boolean;
|
|
@@ -122,12 +273,16 @@ declare function iterateResolveTree(tree: ResolveTree, cb: (mutation: addedNodeM
|
|
|
122
273
|
|
|
123
274
|
declare function legacy_isTouchEvent(event: MouseEvent | TouchEvent | PointerEvent): event is TouchEvent;
|
|
124
275
|
|
|
276
|
+
declare type Listener = (payload?: unknown) => void;
|
|
277
|
+
|
|
125
278
|
export declare let mirror: DeprecatedMirror;
|
|
126
279
|
|
|
127
280
|
export { MouseInteractions }
|
|
128
281
|
|
|
129
282
|
declare function on(type: string, fn: EventListenerOrEventListenerObject, target?: Document | IWindow): listenerHandler_2;
|
|
130
283
|
|
|
284
|
+
export declare function pickSerializableConfig(config: unknown): SerializableReplayerConfig;
|
|
285
|
+
|
|
131
286
|
declare type PlayerAssets = {
|
|
132
287
|
emitter: Emitter;
|
|
133
288
|
applyEventsSynchronously(events: Array<eventWithTime_2>): void;
|
|
@@ -148,6 +303,7 @@ export declare type playerConfig = {
|
|
|
148
303
|
insertStyleRules: string[];
|
|
149
304
|
triggerFocus: boolean;
|
|
150
305
|
UNSAFE_replayCanvas: boolean;
|
|
306
|
+
enforceCanvasArgAllowlist: boolean;
|
|
151
307
|
cspContent?: string;
|
|
152
308
|
pauseAnimation?: boolean;
|
|
153
309
|
mouseTail: boolean | {
|
|
@@ -251,6 +407,7 @@ export declare type recordOptions<T> = {
|
|
|
251
407
|
maskTextFn?: MaskTextFn;
|
|
252
408
|
slimDOMOptions?: SlimDOMOptions | 'all' | true;
|
|
253
409
|
ignoreCSSAttributes?: Set<string>;
|
|
410
|
+
styleSheetResyncInterval?: number;
|
|
254
411
|
inlineStylesheet?: boolean;
|
|
255
412
|
hooks?: hooksParam;
|
|
256
413
|
packFn?: PackFn;
|
|
@@ -275,6 +432,15 @@ export declare type recordOptions<T> = {
|
|
|
275
432
|
};
|
|
276
433
|
};
|
|
277
434
|
|
|
435
|
+
export declare type ReplayAnchor = 'top' | 'center';
|
|
436
|
+
|
|
437
|
+
export declare interface ReplayDimensions {
|
|
438
|
+
width: number;
|
|
439
|
+
height: number;
|
|
440
|
+
top: number;
|
|
441
|
+
left: number;
|
|
442
|
+
}
|
|
443
|
+
|
|
278
444
|
export declare class Replayer {
|
|
279
445
|
wrapper: HTMLDivElement;
|
|
280
446
|
iframe: HTMLIFrameElement;
|
|
@@ -383,6 +549,16 @@ declare type ResolveTree = {
|
|
|
383
549
|
parent: ResolveTree | null;
|
|
384
550
|
};
|
|
385
551
|
|
|
552
|
+
export declare const RRWEB_EMBEDDED_CHANNEL: "rrweb-embedded";
|
|
553
|
+
|
|
554
|
+
export declare const RRWEB_EMBEDDED_PROTOCOL_VERSION: 1;
|
|
555
|
+
|
|
556
|
+
declare const SERIALIZABLE_CONFIG_KEYS: readonly ["speed", "maxSpeed", "loadTimeout", "skipInactive", "inactivePeriodThreshold", "showWarning", "showDebug", "blockClass", "liveMode", "insertStyleRules", "triggerFocus", "UNSAFE_replayCanvas", "enforceCanvasArgAllowlist", "cspContent", "pauseAnimation", "mouseTail", "useVirtualDom", "inactiveThreshold", "inactiveSkipTime"];
|
|
557
|
+
|
|
558
|
+
declare type SerializableConfigKey = (typeof SERIALIZABLE_CONFIG_KEYS)[number];
|
|
559
|
+
|
|
560
|
+
export declare type SerializableReplayerConfig = Partial<Pick<playerConfig, SerializableConfigKey>>;
|
|
561
|
+
|
|
386
562
|
declare function shadowHostInDom(n: Node): boolean;
|
|
387
563
|
|
|
388
564
|
declare type SpeedContext = {
|
|
@@ -414,6 +590,8 @@ declare type SpeedState = {
|
|
|
414
590
|
context: SpeedContext;
|
|
415
591
|
};
|
|
416
592
|
|
|
593
|
+
export declare function startEmbeddedReplayerHost(options?: EmbeddedReplayerHostOptions): EmbeddedReplayerHost;
|
|
594
|
+
|
|
417
595
|
declare class StyleSheetMirror {
|
|
418
596
|
private id;
|
|
419
597
|
private styleIDMap;
|
package/dist/rrweb.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { Emitter } from '../../../../node_modules/@highlight-run/rrweb-types/dis
|
|
|
9
9
|
import { EventType } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
10
10
|
import { eventWithTime } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
11
11
|
import { eventWithTime as eventWithTime_2 } from '../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
12
|
+
import { eventWithTime as eventWithTime_3 } from '../../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
12
13
|
import { Handler } from '../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
13
14
|
import { hookResetter } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
14
15
|
import { hooksParam } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
@@ -29,6 +30,7 @@ import { MouseInteractions } from '../../../node_modules/@highlight-run/rrweb-ty
|
|
|
29
30
|
import { nowTimestamp } from '../../../node_modules/@highlight-run/rrweb-utils/dist/rrweb-utils.js';
|
|
30
31
|
import { PackFn } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
31
32
|
import { playerMetaData } from '../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
33
|
+
import { playerMetaData as playerMetaData_2 } from '../../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
32
34
|
import { RecordPlugin } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
33
35
|
import { ReplayerEvents } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
34
36
|
import { RRDocument } from '../../../../node_modules/@highlight-run/rrdom/dist/rrdom.js';
|
|
@@ -36,6 +38,7 @@ import { RRIFrameElement } from '../../../node_modules/@highlight-run/rrdom/dist
|
|
|
36
38
|
import { RRNode } from '../../../node_modules/@highlight-run/rrdom/dist/rrdom.js';
|
|
37
39
|
import { SamplingStrategy } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
38
40
|
import { SessionInterval } from '../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
41
|
+
import { SessionInterval as SessionInterval_2 } from '../../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
39
42
|
import { SlimDOMOptions } from '../../../node_modules/@highlight-run/rrweb-snapshot/dist/rrweb-snapshot.js';
|
|
40
43
|
import { StateMachine } from '@xstate/fsm';
|
|
41
44
|
import { textMutation } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
|
|
@@ -49,13 +52,16 @@ declare type AppendedIframe = {
|
|
|
49
52
|
builtNode: HTMLIFrameElement | RRIFrameElement;
|
|
50
53
|
};
|
|
51
54
|
|
|
52
|
-
export declare function
|
|
55
|
+
export declare function buildHostDocument(options: HostDocumentOptions): string;
|
|
56
|
+
|
|
57
|
+
export declare function canvasMutation({ event, mutation, target, imageMap, canvasEventMap, errorHandler, enforceCanvasArgAllowlist, }: {
|
|
53
58
|
event: Parameters<Replayer['applyIncremental']>[0];
|
|
54
59
|
mutation: canvasMutationData;
|
|
55
60
|
target: HTMLCanvasElement;
|
|
56
61
|
imageMap: Replayer['imageMap'];
|
|
57
62
|
canvasEventMap: Replayer['canvasEventMap'];
|
|
58
63
|
errorHandler: Replayer['warnCanvasMutationFailed'];
|
|
64
|
+
enforceCanvasArgAllowlist?: boolean;
|
|
59
65
|
}): Promise<void>;
|
|
60
66
|
|
|
61
67
|
declare function closestElementOfNode(node: Node | null): HTMLElement | null;
|
|
@@ -64,6 +70,84 @@ declare function createPlayerService(context: PlayerContext, { getCastFn, applyE
|
|
|
64
70
|
|
|
65
71
|
declare function createSpeedService(context: SpeedContext): StateMachine.Service<SpeedContext, SpeedEvent, SpeedState>;
|
|
66
72
|
|
|
73
|
+
export declare class EmbeddedReplayerClient {
|
|
74
|
+
private readonly iframe;
|
|
75
|
+
private readonly hostOrigin;
|
|
76
|
+
private readonly listeners;
|
|
77
|
+
private metadata;
|
|
78
|
+
private activityIntervals;
|
|
79
|
+
private dimensions;
|
|
80
|
+
private lastCurrentTime;
|
|
81
|
+
private ready;
|
|
82
|
+
private readyResolvers;
|
|
83
|
+
private disposed;
|
|
84
|
+
private pending;
|
|
85
|
+
constructor(iframe: HTMLIFrameElement, options?: EmbeddedReplayerClientOptions);
|
|
86
|
+
whenReady(): Promise<void>;
|
|
87
|
+
init(events: eventWithTime_3[], config?: SerializableReplayerConfig, autoplay?: boolean): void;
|
|
88
|
+
play(timeOffset?: number): void;
|
|
89
|
+
pause(timeOffset?: number): void;
|
|
90
|
+
resume(timeOffset?: number): void;
|
|
91
|
+
setConfig(config: SerializableReplayerConfig): void;
|
|
92
|
+
setLayout(scale: number, anchor?: ReplayAnchor): void;
|
|
93
|
+
replaceEvents(events: eventWithTime_3[]): void;
|
|
94
|
+
addEvent(event: eventWithTime_3): void;
|
|
95
|
+
enableInteract(): void;
|
|
96
|
+
disableInteract(): void;
|
|
97
|
+
destroy(): void;
|
|
98
|
+
on(event: string, listener: Listener): void;
|
|
99
|
+
off(event: string, listener: Listener): void;
|
|
100
|
+
getCurrentTime(): number;
|
|
101
|
+
getMetaData(): playerMetaData_2 | null;
|
|
102
|
+
getActivityIntervals(): SessionInterval_2[];
|
|
103
|
+
getDimensions(): ReplayDimensions | null;
|
|
104
|
+
private send;
|
|
105
|
+
private postToHost;
|
|
106
|
+
private flushPending;
|
|
107
|
+
private probe;
|
|
108
|
+
private onMessage;
|
|
109
|
+
private handle;
|
|
110
|
+
private emit;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export declare interface EmbeddedReplayerClientOptions {
|
|
114
|
+
hostOrigin?: string;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export declare class EmbeddedReplayerHost {
|
|
118
|
+
private readonly root;
|
|
119
|
+
private readonly parentWindow;
|
|
120
|
+
private readonly timeUpdateIntervalMs;
|
|
121
|
+
private readonly expectedParentOrigin;
|
|
122
|
+
private replayer;
|
|
123
|
+
private playing;
|
|
124
|
+
private timer;
|
|
125
|
+
private started;
|
|
126
|
+
private layout;
|
|
127
|
+
constructor(options?: EmbeddedReplayerHostOptions);
|
|
128
|
+
start(): void;
|
|
129
|
+
stop(): void;
|
|
130
|
+
private onMessage;
|
|
131
|
+
private handle;
|
|
132
|
+
private init;
|
|
133
|
+
private applyLayout;
|
|
134
|
+
private postDimensions;
|
|
135
|
+
private postInitialized;
|
|
136
|
+
private wireEvents;
|
|
137
|
+
private setPlaying;
|
|
138
|
+
private startTimePump;
|
|
139
|
+
private postTime;
|
|
140
|
+
private stopTimePump;
|
|
141
|
+
private post;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export declare interface EmbeddedReplayerHostOptions {
|
|
145
|
+
expectedParentOrigin?: string;
|
|
146
|
+
root?: HTMLElement;
|
|
147
|
+
parentWindow?: Window;
|
|
148
|
+
timeUpdateIntervalMs?: number;
|
|
149
|
+
}
|
|
150
|
+
|
|
67
151
|
declare type ErrorHandler = (error: unknown) => void | boolean;
|
|
68
152
|
|
|
69
153
|
export { EventType }
|
|
@@ -100,6 +184,73 @@ declare function hasShadowRoot<T extends Node | RRNode>(n: T): n is T & {
|
|
|
100
184
|
|
|
101
185
|
declare function hookSetter<T>(target: T, key: string | number | symbol, d: PropertyDescriptor, isRevoked?: boolean, win?: Window & typeof globalThis): hookResetter;
|
|
102
186
|
|
|
187
|
+
export declare type HostCommand = {
|
|
188
|
+
type: 'ping';
|
|
189
|
+
} | {
|
|
190
|
+
type: 'init';
|
|
191
|
+
events: eventWithTime_3[];
|
|
192
|
+
config?: SerializableReplayerConfig;
|
|
193
|
+
autoplay?: boolean;
|
|
194
|
+
} | {
|
|
195
|
+
type: 'setLayout';
|
|
196
|
+
scale: number;
|
|
197
|
+
anchor?: ReplayAnchor;
|
|
198
|
+
} | {
|
|
199
|
+
type: 'play';
|
|
200
|
+
timeOffset?: number;
|
|
201
|
+
} | {
|
|
202
|
+
type: 'pause';
|
|
203
|
+
timeOffset?: number;
|
|
204
|
+
} | {
|
|
205
|
+
type: 'resume';
|
|
206
|
+
timeOffset?: number;
|
|
207
|
+
} | {
|
|
208
|
+
type: 'setConfig';
|
|
209
|
+
config: SerializableReplayerConfig;
|
|
210
|
+
} | {
|
|
211
|
+
type: 'replaceEvents';
|
|
212
|
+
events: eventWithTime_3[];
|
|
213
|
+
} | {
|
|
214
|
+
type: 'addEvent';
|
|
215
|
+
event: eventWithTime_3;
|
|
216
|
+
} | {
|
|
217
|
+
type: 'enableInteract';
|
|
218
|
+
} | {
|
|
219
|
+
type: 'disableInteract';
|
|
220
|
+
} | {
|
|
221
|
+
type: 'destroy';
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
export declare interface HostDocumentOptions {
|
|
225
|
+
scriptUrl: string;
|
|
226
|
+
styleUrl?: string;
|
|
227
|
+
extraStyleSources?: string[];
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export declare type HostMessage = {
|
|
231
|
+
type: 'ready';
|
|
232
|
+
} | {
|
|
233
|
+
type: 'initialized';
|
|
234
|
+
metadata: playerMetaData_2;
|
|
235
|
+
activityIntervals: SessionInterval_2[];
|
|
236
|
+
} | {
|
|
237
|
+
type: 'replayer-event';
|
|
238
|
+
event: string;
|
|
239
|
+
payload?: unknown;
|
|
240
|
+
} | {
|
|
241
|
+
type: 'time';
|
|
242
|
+
currentTime: number;
|
|
243
|
+
} | {
|
|
244
|
+
type: 'dimensions';
|
|
245
|
+
width: number;
|
|
246
|
+
height: number;
|
|
247
|
+
top: number;
|
|
248
|
+
left: number;
|
|
249
|
+
} | {
|
|
250
|
+
type: 'error';
|
|
251
|
+
message: string;
|
|
252
|
+
};
|
|
253
|
+
|
|
103
254
|
export { IncrementalSource }
|
|
104
255
|
|
|
105
256
|
declare function inDom(n: Node): boolean;
|
|
@@ -122,12 +273,16 @@ declare function iterateResolveTree(tree: ResolveTree, cb: (mutation: addedNodeM
|
|
|
122
273
|
|
|
123
274
|
declare function legacy_isTouchEvent(event: MouseEvent | TouchEvent | PointerEvent): event is TouchEvent;
|
|
124
275
|
|
|
276
|
+
declare type Listener = (payload?: unknown) => void;
|
|
277
|
+
|
|
125
278
|
export declare let mirror: DeprecatedMirror;
|
|
126
279
|
|
|
127
280
|
export { MouseInteractions }
|
|
128
281
|
|
|
129
282
|
declare function on(type: string, fn: EventListenerOrEventListenerObject, target?: Document | IWindow): listenerHandler_2;
|
|
130
283
|
|
|
284
|
+
export declare function pickSerializableConfig(config: unknown): SerializableReplayerConfig;
|
|
285
|
+
|
|
131
286
|
declare type PlayerAssets = {
|
|
132
287
|
emitter: Emitter;
|
|
133
288
|
applyEventsSynchronously(events: Array<eventWithTime_2>): void;
|
|
@@ -148,6 +303,7 @@ export declare type playerConfig = {
|
|
|
148
303
|
insertStyleRules: string[];
|
|
149
304
|
triggerFocus: boolean;
|
|
150
305
|
UNSAFE_replayCanvas: boolean;
|
|
306
|
+
enforceCanvasArgAllowlist: boolean;
|
|
151
307
|
cspContent?: string;
|
|
152
308
|
pauseAnimation?: boolean;
|
|
153
309
|
mouseTail: boolean | {
|
|
@@ -251,6 +407,7 @@ export declare type recordOptions<T> = {
|
|
|
251
407
|
maskTextFn?: MaskTextFn;
|
|
252
408
|
slimDOMOptions?: SlimDOMOptions | 'all' | true;
|
|
253
409
|
ignoreCSSAttributes?: Set<string>;
|
|
410
|
+
styleSheetResyncInterval?: number;
|
|
254
411
|
inlineStylesheet?: boolean;
|
|
255
412
|
hooks?: hooksParam;
|
|
256
413
|
packFn?: PackFn;
|
|
@@ -275,6 +432,15 @@ export declare type recordOptions<T> = {
|
|
|
275
432
|
};
|
|
276
433
|
};
|
|
277
434
|
|
|
435
|
+
export declare type ReplayAnchor = 'top' | 'center';
|
|
436
|
+
|
|
437
|
+
export declare interface ReplayDimensions {
|
|
438
|
+
width: number;
|
|
439
|
+
height: number;
|
|
440
|
+
top: number;
|
|
441
|
+
left: number;
|
|
442
|
+
}
|
|
443
|
+
|
|
278
444
|
export declare class Replayer {
|
|
279
445
|
wrapper: HTMLDivElement;
|
|
280
446
|
iframe: HTMLIFrameElement;
|
|
@@ -383,6 +549,16 @@ declare type ResolveTree = {
|
|
|
383
549
|
parent: ResolveTree | null;
|
|
384
550
|
};
|
|
385
551
|
|
|
552
|
+
export declare const RRWEB_EMBEDDED_CHANNEL: "rrweb-embedded";
|
|
553
|
+
|
|
554
|
+
export declare const RRWEB_EMBEDDED_PROTOCOL_VERSION: 1;
|
|
555
|
+
|
|
556
|
+
declare const SERIALIZABLE_CONFIG_KEYS: readonly ["speed", "maxSpeed", "loadTimeout", "skipInactive", "inactivePeriodThreshold", "showWarning", "showDebug", "blockClass", "liveMode", "insertStyleRules", "triggerFocus", "UNSAFE_replayCanvas", "enforceCanvasArgAllowlist", "cspContent", "pauseAnimation", "mouseTail", "useVirtualDom", "inactiveThreshold", "inactiveSkipTime"];
|
|
557
|
+
|
|
558
|
+
declare type SerializableConfigKey = (typeof SERIALIZABLE_CONFIG_KEYS)[number];
|
|
559
|
+
|
|
560
|
+
export declare type SerializableReplayerConfig = Partial<Pick<playerConfig, SerializableConfigKey>>;
|
|
561
|
+
|
|
386
562
|
declare function shadowHostInDom(n: Node): boolean;
|
|
387
563
|
|
|
388
564
|
declare type SpeedContext = {
|
|
@@ -414,6 +590,8 @@ declare type SpeedState = {
|
|
|
414
590
|
context: SpeedContext;
|
|
415
591
|
};
|
|
416
592
|
|
|
593
|
+
export declare function startEmbeddedReplayerHost(options?: EmbeddedReplayerHostOptions): EmbeddedReplayerHost;
|
|
594
|
+
|
|
417
595
|
declare class StyleSheetMirror {
|
|
418
596
|
private id;
|
|
419
597
|
private styleIDMap;
|