@highlight-run/rrweb 1.0.8 → 1.1.3

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.
@@ -0,0 +1,2 @@
1
+ import { blockClass, canvasMutationCallback, IWindow, listenerHandler, Mirror } from '../../../types';
2
+ export default function initCanvas2DMutationObserver(cb: canvasMutationCallback, win: IWindow, blockClass: blockClass, mirror: Mirror): listenerHandler;
@@ -0,0 +1,2 @@
1
+ import { blockClass, IWindow, listenerHandler } from '../../../types';
2
+ export default function initCanvasContextObserver(win: IWindow, blockClass: blockClass): listenerHandler;
@@ -0,0 +1,5 @@
1
+ import { IWindow, SerializedWebGlArg } from '../../../types';
2
+ export declare function serializeArg(value: any, win: IWindow): SerializedWebGlArg;
3
+ export declare const serializeArgs: (args: Array<any>, win: IWindow) => SerializedWebGlArg[];
4
+ export declare const isInstanceOfWebGLObject: (value: any, win: IWindow) => value is WebGLShader | WebGLProgram | WebGLActiveInfo | WebGLBuffer | WebGLFramebuffer | WebGLRenderbuffer | WebGLShaderPrecisionFormat | WebGLTexture | WebGLUniformLocation | WebGLVertexArrayObject;
5
+ export declare const saveWebGLVar: (value: any, win: IWindow) => number | void;
@@ -0,0 +1,2 @@
1
+ import { blockClass, canvasMutationCallback, IWindow, listenerHandler, Mirror } from '../../../types';
2
+ export default function initCanvasWebGLMutationObserver(cb: canvasMutationCallback, win: IWindow, blockClass: blockClass, mirror: Mirror): listenerHandler;
@@ -0,0 +1,9 @@
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;
@@ -0,0 +1,9 @@
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;
@@ -0,0 +1,10 @@
1
+ import { Replayer } from '../';
2
+ import { canvasMutationData, SerializedWebGlArg } from '../../types';
3
+ export declare function variableListFor(ctor: string): any[];
4
+ export declare function deserializeArg(imageMap: Replayer['imageMap']): (arg: SerializedWebGlArg) => any;
5
+ export default function webglMutation({ mutation, target, imageMap, errorHandler, }: {
6
+ mutation: canvasMutationData;
7
+ target: HTMLCanvasElement;
8
+ imageMap: Replayer['imageMap'];
9
+ errorHandler: Replayer['warnCanvasMutationFailed'];
10
+ }): void;
@@ -13,6 +13,7 @@ export declare class Replayer {
13
13
  private mouseTail;
14
14
  private tailPositions;
15
15
  private emitter;
16
+ private nextUserInteractionEvent;
16
17
  private activityIntervals;
17
18
  private inactiveEndTimestamp;
18
19
  private legacy_missingNodeRetryMap;
@@ -22,7 +23,6 @@ export declare class Replayer {
22
23
  private virtualStyleRulesMap;
23
24
  private cache;
24
25
  private imageMap;
25
- private nextUserInteractionEvent;
26
26
  private mirror;
27
27
  private firstFullSnapshot;
28
28
  private newDocumentQueue;
@@ -55,6 +55,8 @@ export declare class Replayer {
55
55
  private attachDocumentToIframe;
56
56
  private collectIframeAndAttachDocument;
57
57
  private waitForStylesheetLoad;
58
+ private hasImageArg;
59
+ private getImageArgs;
58
60
  private preloadAllImages;
59
61
  private applyIncremental;
60
62
  private applyMutation;
@@ -15,4 +15,7 @@ export declare class Timer {
15
15
  isActive(): boolean;
16
16
  private findActionIndex;
17
17
  }
18
- export declare function addDelay(event: eventWithTime, baselineTime: number): number;
18
+ export declare type LastDelay = {
19
+ at: number | null;
20
+ };
21
+ export declare function addDelay(event: eventWithTime, baselineTime: number, lastDelay?: LastDelay): number;
@@ -55,6 +55,9 @@ export declare type tagMap = {
55
55
  export interface INode extends Node {
56
56
  __sn: serializedNodeWithId;
57
57
  }
58
+ export interface ICanvas extends HTMLCanvasElement {
59
+ __context: string;
60
+ }
58
61
  export declare type idNodeMap = {
59
62
  [key: number]: INode;
60
63
  };
package/dist/types.d.ts CHANGED
@@ -288,6 +288,24 @@ export declare enum MouseInteractions {
288
288
  TouchEnd = 9,
289
289
  TouchCancel = 10
290
290
  }
291
+ export declare enum CanvasContext {
292
+ '2D' = 0,
293
+ WebGL = 1,
294
+ WebGL2 = 2
295
+ }
296
+ export declare type SerializedWebGlArg = {
297
+ rr_type: 'ArrayBuffer';
298
+ base64: string;
299
+ } | {
300
+ rr_type: string;
301
+ src: string;
302
+ } | {
303
+ rr_type: string;
304
+ args: Array<SerializedWebGlArg>;
305
+ } | {
306
+ rr_type: string;
307
+ index: number;
308
+ } | string | number | boolean | null | SerializedWebGlArg[];
291
309
  declare type mouseInteractionParam = {
292
310
  type: MouseInteractions;
293
311
  id: number;
@@ -330,9 +348,11 @@ export declare type styleDeclarationCallback = (s: styleDeclarationParam) => voi
330
348
  export declare type canvasMutationCallback = (p: canvasMutationParam) => void;
331
349
  export declare type canvasMutationParam = {
332
350
  id: number;
351
+ type: CanvasContext;
333
352
  property: string;
334
353
  args: Array<unknown>;
335
354
  setter?: true;
355
+ newFrame?: true;
336
356
  };
337
357
  export declare type fontParam = {
338
358
  family: string;
@@ -430,6 +450,7 @@ export declare type missingNodeMap = {
430
450
  export declare type actionWithDelay = {
431
451
  doAction: () => void;
432
452
  delay: number;
453
+ newFrame: boolean;
433
454
  };
434
455
  export declare type Handler = (event?: unknown) => void;
435
456
  export declare type Emitter = {
package/dist/utils.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { Mirror, throttleOptions, listenerHandler, hookResetter, blockClass, addedNodeMutation, removedNodeMutation, textMutation, attributeMutation, mutationData, scrollData, inputData, DocumentDimension } from './types';
1
+ import { Mirror, throttleOptions, listenerHandler, hookResetter, blockClass, addedNodeMutation, removedNodeMutation, textMutation, attributeMutation, mutationData, scrollData, inputData, DocumentDimension, IWindow } from './types';
2
2
  import { INode, serializedNodeWithId } from './snapshot';
3
- export declare function on(type: string, fn: EventListenerOrEventListenerObject, target?: Document | Window): listenerHandler;
3
+ export declare function on(type: string, fn: EventListenerOrEventListenerObject, target?: Document | IWindow): listenerHandler;
4
4
  export declare function createMirror(): Mirror;
5
5
  export declare let _mirror: Mirror;
6
6
  export declare function throttle<T>(func: (arg: T) => void, wait: number, options?: throttleOptions): (arg: T) => void;
7
- export declare function hookSetter<T>(target: T, key: string | number | symbol, d: PropertyDescriptor, isRevoked?: boolean, win?: Window & typeof globalThis): hookResetter;
7
+ export declare function hookSetter<T>(target: T, key: string | number | symbol, d: PropertyDescriptor, isRevoked?: boolean, win?: IWindow): hookResetter;
8
8
  export declare function patch(source: {
9
9
  [key: string]: any;
10
10
  }, name: string, replacement: (...args: any[]) => any): () => void;
@@ -14,7 +14,7 @@ export declare function isBlocked(node: Node | null, blockClass: blockClass): bo
14
14
  export declare function isIgnored(n: Node | INode): boolean;
15
15
  export declare function isAncestorRemoved(target: INode, mirror: Mirror): boolean;
16
16
  export declare function isTouchEvent(event: MouseEvent | TouchEvent): event is TouchEvent;
17
- export declare function polyfill(win?: Window & typeof globalThis): void;
17
+ export declare function polyfill(win?: IWindow): void;
18
18
  export declare type TreeNode = {
19
19
  id: number;
20
20
  mutation: addedNodeMutation;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@highlight-run/rrweb",
3
- "version": "1.0.8",
3
+ "version": "1.1.3",
4
4
  "description": "record and replay the web",
5
5
  "scripts": {
6
6
  "test": "npm run bundle:browser && cross-env TS_NODE_CACHE=false TS_NODE_FILES=true mocha -r ts-node/register -r ignore-styles -r jsdom-global/register test/**.test.ts",
@@ -43,13 +43,13 @@
43
43
  "chai": "^4.2.0",
44
44
  "cross-env": "^5.2.0",
45
45
  "css-loader": "^5.0.1",
46
- "mini-css-extract-plugin": "^1.3.8",
47
46
  "fast-mhtml": "^1.1.9",
48
47
  "ignore-styles": "^5.0.1",
49
48
  "inquirer": "^6.2.1",
50
49
  "jest-snapshot": "^23.6.0",
51
50
  "jsdom": "^16.6.0",
52
51
  "jsdom-global": "^3.0.2",
52
+ "mini-css-extract-plugin": "^1.3.8",
53
53
  "mocha": "^5.2.0",
54
54
  "node-libtidy": "^0.4.0",
55
55
  "prettier": "2.2.1",
@@ -76,7 +76,9 @@
76
76
  "dependencies": {
77
77
  "@types/css-font-loading-module": "0.0.4",
78
78
  "@xstate/fsm": "^1.4.0",
79
+ "base64-arraybuffer": "^1.0.1",
79
80
  "fflate": "^0.4.4",
81
+ "identity-obj-proxy": "^3.0.0",
80
82
  "mitt": "^1.1.3"
81
83
  }
82
84
  }