@highlight-run/rrweb 1.2.1 → 2.0.0-lambda.1
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/CHANGELOG.md +359 -19
- package/README.md +147 -34
- package/dist/assets/image-bitmap-data-url-worker-DwtK8A0z.js.map +1 -0
- package/dist/rrweb.cjs +17806 -0
- package/dist/rrweb.cjs.map +1 -0
- package/dist/rrweb.d.cts +509 -0
- package/dist/rrweb.d.ts +509 -0
- package/dist/rrweb.js +17807 -0
- package/dist/rrweb.js.map +1 -0
- package/dist/rrweb.umd.cjs +17810 -0
- package/dist/rrweb.umd.cjs.map +7 -0
- package/dist/rrweb.umd.min.cjs +90 -0
- package/dist/rrweb.umd.min.cjs.map +7 -0
- package/dist/{index.css → style.css} +23 -14
- package/dist/style.min.css +2 -0
- package/dist/style.min.css.map +7 -0
- package/package.json +67 -61
- package/rrweb-record/package.json +4 -0
- package/rrweb-replay/package.json +4 -0
- package/README.zh_CN.md +0 -122
- package/dist/entries/all.d.ts +0 -4
- package/dist/entries/record-pack.d.ts +0 -2
- package/dist/entries/replay-unpack.d.ts +0 -2
- package/dist/index.css.map +0 -1
- package/dist/index.d.ts +0 -9
- package/dist/index.js +0 -3
- package/dist/index.js.LICENSE.txt +0 -14
- package/dist/index.js.map +0 -1
- package/dist/packer/base.d.ts +0 -7
- package/dist/packer/index.d.ts +0 -2
- package/dist/packer/pack.d.ts +0 -2
- package/dist/packer/unpack.d.ts +0 -2
- package/dist/plugins/console/record/error-stack-parser.d.ts +0 -37
- package/dist/plugins/console/record/index.d.ts +0 -41
- package/dist/plugins/console/record/stringify.d.ts +0 -2
- package/dist/plugins/console/replay/index.d.ts +0 -9
- package/dist/plugins/console-record.min.js +0 -16
- package/dist/plugins/console-record.min.js.map +0 -1
- package/dist/plugins/entries/all.d.ts +0 -4
- package/dist/plugins/entries/record-pack.d.ts +0 -2
- package/dist/plugins/entries/replay-unpack.d.ts +0 -2
- package/dist/plugins/index.d.ts +0 -9
- package/dist/plugins/packer/base.d.ts +0 -7
- package/dist/plugins/packer/index.d.ts +0 -2
- package/dist/plugins/packer/pack.d.ts +0 -2
- package/dist/plugins/packer/unpack.d.ts +0 -2
- package/dist/plugins/plugins/console/record/error-stack-parser.d.ts +0 -37
- package/dist/plugins/plugins/console/record/index.d.ts +0 -41
- package/dist/plugins/plugins/console/record/stringify.d.ts +0 -2
- package/dist/plugins/plugins/console/replay/index.d.ts +0 -9
- package/dist/plugins/plugins/sequential-id/record/index.d.ts +0 -6
- package/dist/plugins/plugins/sequential-id/replay/index.d.ts +0 -7
- package/dist/plugins/record/iframe-manager.d.ts +0 -13
- package/dist/plugins/record/index.d.ts +0 -9
- package/dist/plugins/record/mutation.d.ts +0 -45
- package/dist/plugins/record/observer.d.ts +0 -11
- package/dist/plugins/record/observers/canvas/2d.d.ts +0 -2
- package/dist/plugins/record/observers/canvas/canvas-manager.d.ts +0 -32
- package/dist/plugins/record/observers/canvas/canvas.d.ts +0 -2
- package/dist/plugins/record/observers/canvas/serialize-args.d.ts +0 -6
- package/dist/plugins/record/observers/canvas/webgl.d.ts +0 -2
- package/dist/plugins/record/shadow-dom-manager.d.ts +0 -34
- package/dist/plugins/replay/canvas/2d.d.ts +0 -9
- package/dist/plugins/replay/canvas/index.d.ts +0 -9
- package/dist/plugins/replay/canvas/webgl.d.ts +0 -11
- package/dist/plugins/replay/index.d.ts +0 -82
- package/dist/plugins/replay/machine.d.ts +0 -85
- package/dist/plugins/replay/smoothscroll.d.ts +0 -1
- package/dist/plugins/replay/styles/inject-style.d.ts +0 -2
- package/dist/plugins/replay/timer.d.ts +0 -19
- package/dist/plugins/replay/virtual-styles.d.ts +0 -43
- package/dist/plugins/rrdom/index.d.ts +0 -1
- package/dist/plugins/rrdom/tree-node.d.ts +0 -20
- package/dist/plugins/sequential-id/record/index.d.ts +0 -6
- package/dist/plugins/sequential-id/replay/index.d.ts +0 -7
- package/dist/plugins/snapshot/css.d.ts +0 -92
- package/dist/plugins/snapshot/index.d.ts +0 -5
- package/dist/plugins/snapshot/rebuild.d.ts +0 -19
- package/dist/plugins/snapshot/snapshot.d.ts +0 -49
- package/dist/plugins/snapshot/types.d.ts +0 -99
- package/dist/plugins/snapshot/utils.d.ts +0 -11
- package/dist/plugins/types.d.ts +0 -509
- package/dist/plugins/utils.d.ts +0 -71
- package/dist/record/iframe-manager.d.ts +0 -13
- package/dist/record/index.d.ts +0 -9
- package/dist/record/mutation.d.ts +0 -45
- package/dist/record/observer.d.ts +0 -11
- package/dist/record/observers/canvas/2d.d.ts +0 -2
- package/dist/record/observers/canvas/canvas-manager.d.ts +0 -32
- package/dist/record/observers/canvas/canvas.d.ts +0 -2
- package/dist/record/observers/canvas/serialize-args.d.ts +0 -6
- package/dist/record/observers/canvas/webgl.d.ts +0 -2
- package/dist/record/shadow-dom-manager.d.ts +0 -34
- package/dist/replay/canvas/2d.d.ts +0 -9
- package/dist/replay/canvas/index.d.ts +0 -9
- package/dist/replay/canvas/webgl.d.ts +0 -11
- package/dist/replay/index.d.ts +0 -82
- package/dist/replay/machine.d.ts +0 -85
- package/dist/replay/smoothscroll.d.ts +0 -1
- package/dist/replay/styles/inject-style.d.ts +0 -2
- package/dist/replay/timer.d.ts +0 -19
- package/dist/replay/virtual-styles.d.ts +0 -43
- package/dist/rrdom/index.d.ts +0 -1
- package/dist/rrdom/tree-node.d.ts +0 -20
- package/dist/rrweb.min.js +0 -30
- package/dist/rrweb.min.js.map +0 -1
- package/dist/snapshot/css.d.ts +0 -92
- package/dist/snapshot/index.d.ts +0 -5
- package/dist/snapshot/rebuild.d.ts +0 -19
- package/dist/snapshot/snapshot.d.ts +0 -49
- package/dist/snapshot/types.d.ts +0 -99
- package/dist/snapshot/utils.d.ts +0 -11
- package/dist/types.d.ts +0 -509
- package/dist/utils.d.ts +0 -71
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { blockClass, canvasMutationCallback, IWindow, Mirror } from '../../../types';
|
|
2
|
-
export declare type RafStamps = {
|
|
3
|
-
latestId: number;
|
|
4
|
-
invokeId: number | null;
|
|
5
|
-
};
|
|
6
|
-
export declare class CanvasManager {
|
|
7
|
-
private pendingCanvasMutations;
|
|
8
|
-
private rafStamps;
|
|
9
|
-
private mirror;
|
|
10
|
-
private mutationCb;
|
|
11
|
-
private resetObservers?;
|
|
12
|
-
private frozen;
|
|
13
|
-
private locked;
|
|
14
|
-
reset(): void;
|
|
15
|
-
freeze(): void;
|
|
16
|
-
unfreeze(): void;
|
|
17
|
-
lock(): void;
|
|
18
|
-
unlock(): void;
|
|
19
|
-
constructor(options: {
|
|
20
|
-
recordCanvas: boolean | number;
|
|
21
|
-
mutationCb: canvasMutationCallback;
|
|
22
|
-
win: IWindow;
|
|
23
|
-
blockClass: blockClass;
|
|
24
|
-
mirror: Mirror;
|
|
25
|
-
});
|
|
26
|
-
private processMutation;
|
|
27
|
-
private initCanvasMutationObserver;
|
|
28
|
-
private startPendingCanvasMutationFlusher;
|
|
29
|
-
private startRAFTimestamping;
|
|
30
|
-
flushPendingCanvasMutations(): void;
|
|
31
|
-
flushPendingCanvasMutationFor(canvas: HTMLCanvasElement, id: number): void;
|
|
32
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { IWindow, SerializedWebGlArg } from '../../../types';
|
|
2
|
-
export declare function variableListFor(ctx: WebGLRenderingContext | WebGL2RenderingContext, ctor: string): any[];
|
|
3
|
-
export declare const saveWebGLVar: (value: any, win: IWindow, ctx: WebGL2RenderingContext | WebGLRenderingContext) => number | void;
|
|
4
|
-
export declare function serializeArg(value: any, win: IWindow, ctx: WebGL2RenderingContext | WebGLRenderingContext): SerializedWebGlArg;
|
|
5
|
-
export declare const serializeArgs: (args: Array<any>, win: IWindow, ctx: WebGLRenderingContext | WebGL2RenderingContext) => SerializedWebGlArg[];
|
|
6
|
-
export declare const isInstanceOfWebGLObject: (value: any, win: IWindow) => value is WebGLActiveInfo | WebGLBuffer | WebGLFramebuffer | WebGLProgram | WebGLRenderbuffer | WebGLShader | WebGLShaderPrecisionFormat | WebGLTexture | WebGLUniformLocation | WebGLVertexArrayObject;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { mutationCallBack, blockClass, maskTextClass, Mirror, scrollCallback, SamplingStrategy } from '../types';
|
|
2
|
-
import { MaskInputOptions, SlimDOMOptions, MaskTextFn, MaskInputFn } from '../snapshot';
|
|
3
|
-
import { IframeManager } from './iframe-manager';
|
|
4
|
-
import { CanvasManager } from './observers/canvas/canvas-manager';
|
|
5
|
-
declare type BypassOptions = {
|
|
6
|
-
blockClass: blockClass;
|
|
7
|
-
blockSelector: string | null;
|
|
8
|
-
maskTextClass: maskTextClass;
|
|
9
|
-
maskTextSelector: string | null;
|
|
10
|
-
inlineStylesheet: boolean;
|
|
11
|
-
maskInputOptions: MaskInputOptions;
|
|
12
|
-
maskTextFn: MaskTextFn | undefined;
|
|
13
|
-
maskInputFn: MaskInputFn | undefined;
|
|
14
|
-
recordCanvas: boolean;
|
|
15
|
-
sampling: SamplingStrategy;
|
|
16
|
-
slimDOMOptions: SlimDOMOptions;
|
|
17
|
-
iframeManager: IframeManager;
|
|
18
|
-
canvasManager: CanvasManager;
|
|
19
|
-
enableStrictPrivacy: boolean;
|
|
20
|
-
};
|
|
21
|
-
export declare class ShadowDomManager {
|
|
22
|
-
private mutationCb;
|
|
23
|
-
private scrollCb;
|
|
24
|
-
private bypassOptions;
|
|
25
|
-
private mirror;
|
|
26
|
-
constructor(options: {
|
|
27
|
-
mutationCb: mutationCallBack;
|
|
28
|
-
scrollCb: scrollCallback;
|
|
29
|
-
bypassOptions: BypassOptions;
|
|
30
|
-
mirror: Mirror;
|
|
31
|
-
});
|
|
32
|
-
addShadowRoot(shadowRoot: ShadowRoot, doc: Document): void;
|
|
33
|
-
}
|
|
34
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Replayer } from '../';
|
|
2
|
-
import { canvasMutationCommand } from '../../types';
|
|
3
|
-
export default function canvasMutation({ event, mutation, target, imageMap, errorHandler, }: {
|
|
4
|
-
event: Parameters<Replayer['applyIncremental']>[0];
|
|
5
|
-
mutation: canvasMutationCommand;
|
|
6
|
-
target: HTMLCanvasElement;
|
|
7
|
-
imageMap: Replayer['imageMap'];
|
|
8
|
-
errorHandler: Replayer['warnCanvasMutationFailed'];
|
|
9
|
-
}): void;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Replayer } from '..';
|
|
2
|
-
import { canvasMutationData } from '../../types';
|
|
3
|
-
export default function canvasMutation({ event, mutation, target, imageMap, errorHandler, }: {
|
|
4
|
-
event: Parameters<Replayer['applyIncremental']>[0];
|
|
5
|
-
mutation: canvasMutationData;
|
|
6
|
-
target: HTMLCanvasElement;
|
|
7
|
-
imageMap: Replayer['imageMap'];
|
|
8
|
-
errorHandler: Replayer['warnCanvasMutationFailed'];
|
|
9
|
-
}): void;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Replayer } from '../';
|
|
2
|
-
import { CanvasContext, canvasMutationCommand, SerializedWebGlArg } from '../../types';
|
|
3
|
-
export declare function variableListFor(ctx: WebGLRenderingContext | WebGL2RenderingContext, ctor: string): any[];
|
|
4
|
-
export declare function deserializeArg(imageMap: Replayer['imageMap'], ctx: WebGLRenderingContext | WebGL2RenderingContext): (arg: SerializedWebGlArg) => any;
|
|
5
|
-
export default function webglMutation({ mutation, target, type, imageMap, errorHandler, }: {
|
|
6
|
-
mutation: canvasMutationCommand;
|
|
7
|
-
target: HTMLCanvasElement;
|
|
8
|
-
type: CanvasContext;
|
|
9
|
-
imageMap: Replayer['imageMap'];
|
|
10
|
-
errorHandler: Replayer['warnCanvasMutationFailed'];
|
|
11
|
-
}): void;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { Timer } from './timer';
|
|
2
|
-
import { createPlayerService, createSpeedService } from './machine';
|
|
3
|
-
import { eventWithTime, playerConfig, playerMetaData, Handler, Mirror, SessionInterval } from '../types';
|
|
4
|
-
import './styles/style.css';
|
|
5
|
-
export declare class Replayer {
|
|
6
|
-
wrapper: HTMLDivElement;
|
|
7
|
-
iframe: HTMLIFrameElement;
|
|
8
|
-
service: ReturnType<typeof createPlayerService>;
|
|
9
|
-
speedService: ReturnType<typeof createSpeedService>;
|
|
10
|
-
get timer(): Timer;
|
|
11
|
-
config: playerConfig;
|
|
12
|
-
private mouse;
|
|
13
|
-
private mouseTail;
|
|
14
|
-
private tailPositions;
|
|
15
|
-
private emitter;
|
|
16
|
-
private nextUserInteractionEvent;
|
|
17
|
-
private activityIntervals;
|
|
18
|
-
private inactiveEndTimestamp;
|
|
19
|
-
private legacy_missingNodeRetryMap;
|
|
20
|
-
private treeIndex;
|
|
21
|
-
private fragmentParentMap;
|
|
22
|
-
private elementStateMap;
|
|
23
|
-
private virtualStyleRulesMap;
|
|
24
|
-
private cache;
|
|
25
|
-
private imageMap;
|
|
26
|
-
private mirror;
|
|
27
|
-
private firstFullSnapshot;
|
|
28
|
-
private newDocumentQueue;
|
|
29
|
-
private mousePos;
|
|
30
|
-
private touchActive;
|
|
31
|
-
constructor(events: Array<eventWithTime | string>, config?: Partial<playerConfig>);
|
|
32
|
-
on(event: string, handler: Handler): this;
|
|
33
|
-
off(event: string, handler: Handler): this;
|
|
34
|
-
setConfig(config: Partial<playerConfig>): void;
|
|
35
|
-
getActivityIntervals(): Array<SessionInterval>;
|
|
36
|
-
getMetaData(): playerMetaData;
|
|
37
|
-
getCurrentTime(): number;
|
|
38
|
-
getTimeOffset(): number;
|
|
39
|
-
getMirror(): Mirror;
|
|
40
|
-
play(timeOffset?: number): void;
|
|
41
|
-
pause(timeOffset?: number): void;
|
|
42
|
-
resume(timeOffset?: number): void;
|
|
43
|
-
startLive(baselineTime?: number): void;
|
|
44
|
-
addEvent(rawEvent: eventWithTime | string): void;
|
|
45
|
-
replaceEvents(events: eventWithTime[]): void;
|
|
46
|
-
enableInteract(): void;
|
|
47
|
-
disableInteract(): void;
|
|
48
|
-
resetCache(): void;
|
|
49
|
-
private setupDom;
|
|
50
|
-
private handleResize;
|
|
51
|
-
private applyEventsSynchronously;
|
|
52
|
-
private getCastFn;
|
|
53
|
-
private handleInactivity;
|
|
54
|
-
private rebuildFullSnapshot;
|
|
55
|
-
private insertStyleRules;
|
|
56
|
-
private attachDocumentToIframe;
|
|
57
|
-
private collectIframeAndAttachDocument;
|
|
58
|
-
private waitForStylesheetLoad;
|
|
59
|
-
private hasImageArg;
|
|
60
|
-
private getImageArgs;
|
|
61
|
-
private preloadAllImages;
|
|
62
|
-
private preloadImages;
|
|
63
|
-
private applyIncremental;
|
|
64
|
-
private applyMutation;
|
|
65
|
-
private applyScroll;
|
|
66
|
-
private applyInput;
|
|
67
|
-
private legacy_resolveMissingNode;
|
|
68
|
-
private moveAndHover;
|
|
69
|
-
private drawMouseTail;
|
|
70
|
-
private hoverElements;
|
|
71
|
-
private isUserInteraction;
|
|
72
|
-
private backToNormal;
|
|
73
|
-
private restoreRealParent;
|
|
74
|
-
private storeState;
|
|
75
|
-
private restoreState;
|
|
76
|
-
private restoreNodeSheet;
|
|
77
|
-
private warnNodeNotFound;
|
|
78
|
-
private warnCanvasMutationFailed;
|
|
79
|
-
private debugNodeNotFound;
|
|
80
|
-
private warn;
|
|
81
|
-
private debug;
|
|
82
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { StateMachine } from '@xstate/fsm';
|
|
2
|
-
import { playerConfig, eventWithTime, Emitter } from '../types';
|
|
3
|
-
import { Timer } from './timer';
|
|
4
|
-
export declare type PlayerContext = {
|
|
5
|
-
events: eventWithTime[];
|
|
6
|
-
timer: Timer;
|
|
7
|
-
timeOffset: number;
|
|
8
|
-
baselineTime: number;
|
|
9
|
-
lastPlayedEvent: eventWithTime | null;
|
|
10
|
-
};
|
|
11
|
-
export declare type PlayerEvent = {
|
|
12
|
-
type: 'PLAY';
|
|
13
|
-
payload: {
|
|
14
|
-
timeOffset: number;
|
|
15
|
-
};
|
|
16
|
-
} | {
|
|
17
|
-
type: 'CAST_EVENT';
|
|
18
|
-
payload: {
|
|
19
|
-
event: eventWithTime;
|
|
20
|
-
};
|
|
21
|
-
} | {
|
|
22
|
-
type: 'PAUSE';
|
|
23
|
-
} | {
|
|
24
|
-
type: 'TO_LIVE';
|
|
25
|
-
payload: {
|
|
26
|
-
baselineTime?: number;
|
|
27
|
-
};
|
|
28
|
-
} | {
|
|
29
|
-
type: 'ADD_EVENT';
|
|
30
|
-
payload: {
|
|
31
|
-
event: eventWithTime;
|
|
32
|
-
};
|
|
33
|
-
} | {
|
|
34
|
-
type: 'REPLACE_EVENTS';
|
|
35
|
-
payload: {
|
|
36
|
-
events: eventWithTime[];
|
|
37
|
-
};
|
|
38
|
-
} | {
|
|
39
|
-
type: 'END';
|
|
40
|
-
};
|
|
41
|
-
export declare type PlayerState = {
|
|
42
|
-
value: 'playing';
|
|
43
|
-
context: PlayerContext;
|
|
44
|
-
} | {
|
|
45
|
-
value: 'paused';
|
|
46
|
-
context: PlayerContext;
|
|
47
|
-
} | {
|
|
48
|
-
value: 'live';
|
|
49
|
-
context: PlayerContext;
|
|
50
|
-
};
|
|
51
|
-
export declare function discardPriorSnapshots(events: eventWithTime[], baselineTime: number): eventWithTime[];
|
|
52
|
-
declare type PlayerAssets = {
|
|
53
|
-
emitter: Emitter;
|
|
54
|
-
applyEventsSynchronously(events: Array<eventWithTime>): void;
|
|
55
|
-
getCastFn(event: eventWithTime, isSync: boolean): () => void;
|
|
56
|
-
};
|
|
57
|
-
export declare function createPlayerService(context: PlayerContext, { getCastFn, applyEventsSynchronously, emitter }: PlayerAssets): StateMachine.Service<PlayerContext, PlayerEvent, PlayerState>;
|
|
58
|
-
export declare type SpeedContext = {
|
|
59
|
-
normalSpeed: playerConfig['speed'];
|
|
60
|
-
timer: Timer;
|
|
61
|
-
};
|
|
62
|
-
export declare type SpeedEvent = {
|
|
63
|
-
type: 'FAST_FORWARD';
|
|
64
|
-
payload: {
|
|
65
|
-
speed: playerConfig['speed'];
|
|
66
|
-
};
|
|
67
|
-
} | {
|
|
68
|
-
type: 'BACK_TO_NORMAL';
|
|
69
|
-
} | {
|
|
70
|
-
type: 'SET_SPEED';
|
|
71
|
-
payload: {
|
|
72
|
-
speed: playerConfig['speed'];
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
export declare type SpeedState = {
|
|
76
|
-
value: 'normal';
|
|
77
|
-
context: SpeedContext;
|
|
78
|
-
} | {
|
|
79
|
-
value: 'skipping';
|
|
80
|
-
context: SpeedContext;
|
|
81
|
-
};
|
|
82
|
-
export declare function createSpeedService(context: SpeedContext): StateMachine.Service<SpeedContext, SpeedEvent, SpeedState>;
|
|
83
|
-
export declare type PlayerMachineState = StateMachine.State<PlayerContext, PlayerEvent, PlayerState>;
|
|
84
|
-
export declare type SpeedMachineState = StateMachine.State<SpeedContext, SpeedEvent, SpeedState>;
|
|
85
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function polyfill(w?: Window, d?: Document): void;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { actionWithDelay, eventWithTime } from '../types';
|
|
2
|
-
export declare class Timer {
|
|
3
|
-
timeOffset: number;
|
|
4
|
-
speed: number;
|
|
5
|
-
private actions;
|
|
6
|
-
private raf;
|
|
7
|
-
private liveMode;
|
|
8
|
-
constructor(actions: actionWithDelay[] | undefined, speed: number);
|
|
9
|
-
addAction(action: actionWithDelay): void;
|
|
10
|
-
addActions(actions: actionWithDelay[]): void;
|
|
11
|
-
replaceActions(actions: actionWithDelay[]): void;
|
|
12
|
-
start(): void;
|
|
13
|
-
clear(): void;
|
|
14
|
-
setSpeed(speed: number): void;
|
|
15
|
-
toggleLiveMode(mode: boolean): void;
|
|
16
|
-
isActive(): boolean;
|
|
17
|
-
private findActionIndex;
|
|
18
|
-
}
|
|
19
|
-
export declare function addDelay(event: eventWithTime, baselineTime: number): number;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { INode } from '../snapshot';
|
|
2
|
-
export declare enum StyleRuleType {
|
|
3
|
-
Insert = 0,
|
|
4
|
-
Remove = 1,
|
|
5
|
-
Snapshot = 2,
|
|
6
|
-
SetProperty = 3,
|
|
7
|
-
RemoveProperty = 4
|
|
8
|
-
}
|
|
9
|
-
declare type InsertRule = {
|
|
10
|
-
cssText: string;
|
|
11
|
-
type: StyleRuleType.Insert;
|
|
12
|
-
index?: number | number[];
|
|
13
|
-
};
|
|
14
|
-
declare type RemoveRule = {
|
|
15
|
-
type: StyleRuleType.Remove;
|
|
16
|
-
index: number | number[];
|
|
17
|
-
};
|
|
18
|
-
declare type SnapshotRule = {
|
|
19
|
-
type: StyleRuleType.Snapshot;
|
|
20
|
-
cssTexts: string[];
|
|
21
|
-
};
|
|
22
|
-
declare type SetPropertyRule = {
|
|
23
|
-
type: StyleRuleType.SetProperty;
|
|
24
|
-
index: number[];
|
|
25
|
-
property: string;
|
|
26
|
-
value: string | null;
|
|
27
|
-
priority: string | undefined;
|
|
28
|
-
};
|
|
29
|
-
declare type RemovePropertyRule = {
|
|
30
|
-
type: StyleRuleType.RemoveProperty;
|
|
31
|
-
index: number[];
|
|
32
|
-
property: string;
|
|
33
|
-
};
|
|
34
|
-
export declare type VirtualStyleRules = Array<InsertRule | RemoveRule | SnapshotRule | SetPropertyRule | RemovePropertyRule>;
|
|
35
|
-
export declare type VirtualStyleRulesMap = Map<INode, VirtualStyleRules>;
|
|
36
|
-
export declare function getNestedRule(rules: CSSRuleList, position: number[]): CSSGroupingRule;
|
|
37
|
-
export declare function getPositionsAndIndex(nestedIndex: number[]): {
|
|
38
|
-
positions: number[];
|
|
39
|
-
index: number | undefined;
|
|
40
|
-
};
|
|
41
|
-
export declare function applyVirtualStyleRulesToNode(storedRules: VirtualStyleRules, styleNode: HTMLStyleElement): void;
|
|
42
|
-
export declare function storeCSSRules(parentElement: HTMLStyleElement, virtualStyleRulesMap: VirtualStyleRulesMap): void;
|
|
43
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export declare type AnyObject = {
|
|
2
|
-
[key: string]: any;
|
|
3
|
-
__rrdom__?: RRdomTreeNode;
|
|
4
|
-
};
|
|
5
|
-
export declare class RRdomTreeNode implements AnyObject {
|
|
6
|
-
parent: AnyObject | null;
|
|
7
|
-
previousSibling: AnyObject | null;
|
|
8
|
-
nextSibling: AnyObject | null;
|
|
9
|
-
firstChild: AnyObject | null;
|
|
10
|
-
lastChild: AnyObject | null;
|
|
11
|
-
childrenVersion: number;
|
|
12
|
-
childIndexCachedUpTo: AnyObject | null;
|
|
13
|
-
cachedIndex: number;
|
|
14
|
-
cachedIndexVersion: number;
|
|
15
|
-
get isAttached(): boolean;
|
|
16
|
-
get hasChildren(): boolean;
|
|
17
|
-
childrenChanged(): void;
|
|
18
|
-
getCachedIndex(parentNode: AnyObject): number;
|
|
19
|
-
setCachedIndex(parentNode: AnyObject, index: number): void;
|
|
20
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { RecordPlugin } from '../../../types';
|
|
2
|
-
export declare type SequentialIdOptions = {
|
|
3
|
-
key: string;
|
|
4
|
-
};
|
|
5
|
-
export declare const PLUGIN_NAME = "rrweb/sequential-id@1";
|
|
6
|
-
export declare const getRecordSequentialIdPlugin: (options?: Partial<SequentialIdOptions>) => RecordPlugin;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SequentialIdOptions } from '../record';
|
|
2
|
-
import { ReplayPlugin } from '../../../types';
|
|
3
|
-
declare type Options = SequentialIdOptions & {
|
|
4
|
-
warnOnMissingId: boolean;
|
|
5
|
-
};
|
|
6
|
-
export declare const getReplaySequentialIdPlugin: (options?: Partial<Options>) => ReplayPlugin;
|
|
7
|
-
export {};
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
export interface ParserOptions {
|
|
2
|
-
silent?: boolean;
|
|
3
|
-
source?: string;
|
|
4
|
-
}
|
|
5
|
-
export interface ParserError {
|
|
6
|
-
message?: string;
|
|
7
|
-
reason?: string;
|
|
8
|
-
filename?: string;
|
|
9
|
-
line?: number;
|
|
10
|
-
column?: number;
|
|
11
|
-
source?: string;
|
|
12
|
-
}
|
|
13
|
-
export interface Loc {
|
|
14
|
-
line?: number;
|
|
15
|
-
column?: number;
|
|
16
|
-
}
|
|
17
|
-
export interface Node {
|
|
18
|
-
type?: string;
|
|
19
|
-
parent?: Node;
|
|
20
|
-
position?: {
|
|
21
|
-
start?: Loc;
|
|
22
|
-
end?: Loc;
|
|
23
|
-
source?: string;
|
|
24
|
-
content?: string;
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
export interface Rule extends Node {
|
|
28
|
-
selectors?: string[];
|
|
29
|
-
declarations?: Array<Declaration | Comment>;
|
|
30
|
-
}
|
|
31
|
-
export interface Declaration extends Node {
|
|
32
|
-
property?: string;
|
|
33
|
-
value?: string;
|
|
34
|
-
}
|
|
35
|
-
export interface Comment extends Node {
|
|
36
|
-
comment?: string;
|
|
37
|
-
}
|
|
38
|
-
export interface Charset extends Node {
|
|
39
|
-
charset?: string;
|
|
40
|
-
}
|
|
41
|
-
export interface CustomMedia extends Node {
|
|
42
|
-
name?: string;
|
|
43
|
-
media?: string;
|
|
44
|
-
}
|
|
45
|
-
export interface Document extends Node {
|
|
46
|
-
document?: string;
|
|
47
|
-
vendor?: string;
|
|
48
|
-
rules?: Array<Rule | Comment | AtRule>;
|
|
49
|
-
}
|
|
50
|
-
export interface FontFace extends Node {
|
|
51
|
-
declarations?: Array<Declaration | Comment>;
|
|
52
|
-
}
|
|
53
|
-
export interface Host extends Node {
|
|
54
|
-
rules?: Array<Rule | Comment | AtRule>;
|
|
55
|
-
}
|
|
56
|
-
export interface Import extends Node {
|
|
57
|
-
import?: string;
|
|
58
|
-
}
|
|
59
|
-
export interface KeyFrames extends Node {
|
|
60
|
-
name?: string;
|
|
61
|
-
vendor?: string;
|
|
62
|
-
keyframes?: Array<KeyFrame | Comment>;
|
|
63
|
-
}
|
|
64
|
-
export interface KeyFrame extends Node {
|
|
65
|
-
values?: string[];
|
|
66
|
-
declarations?: Array<Declaration | Comment>;
|
|
67
|
-
}
|
|
68
|
-
export interface Media extends Node {
|
|
69
|
-
media?: string;
|
|
70
|
-
rules?: Array<Rule | Comment | AtRule>;
|
|
71
|
-
}
|
|
72
|
-
export interface Namespace extends Node {
|
|
73
|
-
namespace?: string;
|
|
74
|
-
}
|
|
75
|
-
export interface Page extends Node {
|
|
76
|
-
selectors?: string[];
|
|
77
|
-
declarations?: Array<Declaration | Comment>;
|
|
78
|
-
}
|
|
79
|
-
export interface Supports extends Node {
|
|
80
|
-
supports?: string;
|
|
81
|
-
rules?: Array<Rule | Comment | AtRule>;
|
|
82
|
-
}
|
|
83
|
-
export declare type AtRule = Charset | CustomMedia | Document | FontFace | Host | Import | KeyFrames | Media | Namespace | Page | Supports;
|
|
84
|
-
export interface StyleRules {
|
|
85
|
-
source?: string;
|
|
86
|
-
rules: Array<Rule | Comment | AtRule>;
|
|
87
|
-
parsingErrors?: ParserError[];
|
|
88
|
-
}
|
|
89
|
-
export interface Stylesheet extends Node {
|
|
90
|
-
stylesheet?: StyleRules;
|
|
91
|
-
}
|
|
92
|
-
export declare function parse(css: string, options?: ParserOptions): Stylesheet;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import snapshot, { serializeNodeWithId, transformAttribute, visitSnapshot, cleanupSnapshot, needMaskingText, IGNORED_NODE } from './snapshot';
|
|
2
|
-
import rebuild, { buildNodeWithSN, addHoverClass, createCache } from './rebuild';
|
|
3
|
-
export * from './types';
|
|
4
|
-
export * from './utils';
|
|
5
|
-
export { snapshot, serializeNodeWithId, rebuild, buildNodeWithSN, addHoverClass, createCache, transformAttribute, visitSnapshot, cleanupSnapshot, needMaskingText, IGNORED_NODE, };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { serializedNodeWithId, idNodeMap, INode, BuildCache } from './types';
|
|
2
|
-
export declare function addHoverClass(cssText: string, cache: BuildCache): string;
|
|
3
|
-
export declare function createCache(): BuildCache;
|
|
4
|
-
export declare function buildNodeWithSN(n: serializedNodeWithId, options: {
|
|
5
|
-
doc: Document;
|
|
6
|
-
map: idNodeMap;
|
|
7
|
-
skipChild?: boolean;
|
|
8
|
-
hackCss: boolean;
|
|
9
|
-
afterAppend?: (n: INode) => unknown;
|
|
10
|
-
cache: BuildCache;
|
|
11
|
-
}): INode | null;
|
|
12
|
-
declare function rebuild(n: serializedNodeWithId, options: {
|
|
13
|
-
doc: Document;
|
|
14
|
-
onVisit?: (node: INode) => unknown;
|
|
15
|
-
hackCss?: boolean;
|
|
16
|
-
afterAppend?: (n: INode) => unknown;
|
|
17
|
-
cache: BuildCache;
|
|
18
|
-
}): [Node | null, idNodeMap];
|
|
19
|
-
export default rebuild;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { serializedNodeWithId, INode, idNodeMap, MaskInputOptions, SlimDOMOptions, MaskTextFn, MaskInputFn, KeepIframeSrcFn } from './types';
|
|
2
|
-
export declare const IGNORED_NODE = -2;
|
|
3
|
-
export declare function absoluteToStylesheet(cssText: string | null, href: string): string;
|
|
4
|
-
export declare function absoluteToDoc(doc: Document, attributeValue: string): string;
|
|
5
|
-
export declare function transformAttribute(doc: Document, tagName: string, name: string, value: string): string;
|
|
6
|
-
export declare function _isBlockedElement(element: HTMLElement, blockClass: string | RegExp, blockSelector: string | null): boolean;
|
|
7
|
-
export declare function needMaskingText(node: Node | null, maskTextClass: string | RegExp, maskTextSelector: string | null): boolean;
|
|
8
|
-
export declare function serializeNodeWithId(n: Node | INode, options: {
|
|
9
|
-
doc: Document;
|
|
10
|
-
map: idNodeMap;
|
|
11
|
-
blockClass: string | RegExp;
|
|
12
|
-
blockSelector: string | null;
|
|
13
|
-
maskTextClass: string | RegExp;
|
|
14
|
-
maskTextSelector: string | null;
|
|
15
|
-
skipChild: boolean;
|
|
16
|
-
inlineStylesheet: boolean;
|
|
17
|
-
maskInputOptions?: MaskInputOptions;
|
|
18
|
-
maskTextFn: MaskTextFn | undefined;
|
|
19
|
-
maskInputFn: MaskInputFn | undefined;
|
|
20
|
-
slimDOMOptions: SlimDOMOptions;
|
|
21
|
-
keepIframeSrcFn?: KeepIframeSrcFn;
|
|
22
|
-
recordCanvas?: boolean;
|
|
23
|
-
preserveWhiteSpace?: boolean;
|
|
24
|
-
onSerialize?: (n: INode) => unknown;
|
|
25
|
-
onIframeLoad?: (iframeINode: INode, node: serializedNodeWithId) => unknown;
|
|
26
|
-
iframeLoadTimeout?: number;
|
|
27
|
-
enableStrictPrivacy: boolean;
|
|
28
|
-
}): serializedNodeWithId | null;
|
|
29
|
-
declare function snapshot(n: Document, options?: {
|
|
30
|
-
blockClass?: string | RegExp;
|
|
31
|
-
blockSelector?: string | null;
|
|
32
|
-
maskTextClass?: string | RegExp;
|
|
33
|
-
maskTextSelector?: string | null;
|
|
34
|
-
inlineStylesheet?: boolean;
|
|
35
|
-
maskAllInputs?: boolean | MaskInputOptions;
|
|
36
|
-
maskTextFn?: MaskTextFn;
|
|
37
|
-
maskInputFn?: MaskTextFn;
|
|
38
|
-
slimDOM?: boolean | SlimDOMOptions;
|
|
39
|
-
recordCanvas?: boolean;
|
|
40
|
-
preserveWhiteSpace?: boolean;
|
|
41
|
-
onSerialize?: (n: INode) => unknown;
|
|
42
|
-
onIframeLoad?: (iframeINode: INode, node: serializedNodeWithId) => unknown;
|
|
43
|
-
iframeLoadTimeout?: number;
|
|
44
|
-
keepIframeSrcFn?: KeepIframeSrcFn;
|
|
45
|
-
enableStrictPrivacy: boolean;
|
|
46
|
-
}): [serializedNodeWithId | null, idNodeMap];
|
|
47
|
-
export declare function visitSnapshot(node: serializedNodeWithId, onVisit: (node: serializedNodeWithId) => unknown): void;
|
|
48
|
-
export declare function cleanupSnapshot(): void;
|
|
49
|
-
export default snapshot;
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
export declare enum NodeType {
|
|
2
|
-
Document = 0,
|
|
3
|
-
DocumentType = 1,
|
|
4
|
-
Element = 2,
|
|
5
|
-
Text = 3,
|
|
6
|
-
CDATA = 4,
|
|
7
|
-
Comment = 5
|
|
8
|
-
}
|
|
9
|
-
export declare type documentNode = {
|
|
10
|
-
type: NodeType.Document;
|
|
11
|
-
childNodes: serializedNodeWithId[];
|
|
12
|
-
compatMode?: string;
|
|
13
|
-
};
|
|
14
|
-
export declare type documentTypeNode = {
|
|
15
|
-
type: NodeType.DocumentType;
|
|
16
|
-
name: string;
|
|
17
|
-
publicId: string;
|
|
18
|
-
systemId: string;
|
|
19
|
-
};
|
|
20
|
-
export declare type attributes = {
|
|
21
|
-
[key: string]: string | number | boolean;
|
|
22
|
-
};
|
|
23
|
-
export declare type elementNode = {
|
|
24
|
-
type: NodeType.Element;
|
|
25
|
-
tagName: string;
|
|
26
|
-
attributes: attributes;
|
|
27
|
-
childNodes: serializedNodeWithId[];
|
|
28
|
-
isSVG?: true;
|
|
29
|
-
needBlock?: boolean;
|
|
30
|
-
};
|
|
31
|
-
export declare type textNode = {
|
|
32
|
-
type: NodeType.Text;
|
|
33
|
-
textContent: string;
|
|
34
|
-
isStyle?: true;
|
|
35
|
-
};
|
|
36
|
-
export declare type cdataNode = {
|
|
37
|
-
type: NodeType.CDATA;
|
|
38
|
-
textContent: '';
|
|
39
|
-
};
|
|
40
|
-
export declare type commentNode = {
|
|
41
|
-
type: NodeType.Comment;
|
|
42
|
-
textContent: string;
|
|
43
|
-
};
|
|
44
|
-
export declare type serializedNode = (documentNode | documentTypeNode | elementNode | textNode | cdataNode | commentNode) & {
|
|
45
|
-
rootId?: number;
|
|
46
|
-
isShadowHost?: boolean;
|
|
47
|
-
isShadow?: boolean;
|
|
48
|
-
};
|
|
49
|
-
export declare type serializedNodeWithId = serializedNode & {
|
|
50
|
-
id: number;
|
|
51
|
-
};
|
|
52
|
-
export declare type tagMap = {
|
|
53
|
-
[key: string]: string;
|
|
54
|
-
};
|
|
55
|
-
export interface INode extends Node {
|
|
56
|
-
__sn: serializedNodeWithId;
|
|
57
|
-
}
|
|
58
|
-
export interface ICanvas extends HTMLCanvasElement {
|
|
59
|
-
__context: string;
|
|
60
|
-
}
|
|
61
|
-
export declare type idNodeMap = {
|
|
62
|
-
[key: number]: INode;
|
|
63
|
-
};
|
|
64
|
-
export declare type MaskInputOptions = Partial<{
|
|
65
|
-
color: boolean;
|
|
66
|
-
date: boolean;
|
|
67
|
-
'datetime-local': boolean;
|
|
68
|
-
email: boolean;
|
|
69
|
-
month: boolean;
|
|
70
|
-
number: boolean;
|
|
71
|
-
range: boolean;
|
|
72
|
-
search: boolean;
|
|
73
|
-
tel: boolean;
|
|
74
|
-
text: boolean;
|
|
75
|
-
time: boolean;
|
|
76
|
-
url: boolean;
|
|
77
|
-
week: boolean;
|
|
78
|
-
textarea: boolean;
|
|
79
|
-
select: boolean;
|
|
80
|
-
password: boolean;
|
|
81
|
-
}>;
|
|
82
|
-
export declare type SlimDOMOptions = Partial<{
|
|
83
|
-
script: boolean;
|
|
84
|
-
comment: boolean;
|
|
85
|
-
headFavicon: boolean;
|
|
86
|
-
headWhitespace: boolean;
|
|
87
|
-
headMetaDescKeywords: boolean;
|
|
88
|
-
headMetaSocial: boolean;
|
|
89
|
-
headMetaRobots: boolean;
|
|
90
|
-
headMetaHttpEquiv: boolean;
|
|
91
|
-
headMetaAuthorship: boolean;
|
|
92
|
-
headMetaVerification: boolean;
|
|
93
|
-
}>;
|
|
94
|
-
export declare type MaskTextFn = (text: string) => string;
|
|
95
|
-
export declare type MaskInputFn = (text: string) => string;
|
|
96
|
-
export declare type KeepIframeSrcFn = (src: string) => boolean;
|
|
97
|
-
export declare type BuildCache = {
|
|
98
|
-
stylesWithHoverClass: Map<string, string>;
|
|
99
|
-
};
|