@highlight-run/rrweb 1.2.0 → 2.0.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.
Files changed (185) hide show
  1. package/dist/plugins/console-record.js +655 -0
  2. package/dist/plugins/console-record.min.js +1 -1
  3. package/dist/plugins/console-record.min.js.map +1 -1
  4. package/dist/plugins/console-replay.js +293 -0
  5. package/dist/plugins/console-replay.min.js +16 -0
  6. package/dist/plugins/console-replay.min.js.map +1 -0
  7. package/dist/plugins/sequential-id-record.js +33 -0
  8. package/dist/plugins/sequential-id-record.min.js +2 -0
  9. package/dist/plugins/sequential-id-record.min.js.map +1 -0
  10. package/dist/plugins/sequential-id-replay.js +37 -0
  11. package/dist/plugins/sequential-id-replay.min.js +2 -0
  12. package/dist/plugins/sequential-id-replay.min.js.map +1 -0
  13. package/dist/record/rrweb-record-pack.js +747 -0
  14. package/dist/record/rrweb-record-pack.min.js +16 -0
  15. package/dist/record/rrweb-record-pack.min.js.map +1 -0
  16. package/dist/record/rrweb-record.js +3318 -0
  17. package/dist/record/rrweb-record.min.js +16 -0
  18. package/dist/record/rrweb-record.min.js.map +1 -0
  19. package/dist/replay/rrweb-replay-unpack.js +4626 -0
  20. package/dist/replay/rrweb-replay-unpack.min.css +2 -0
  21. package/dist/replay/rrweb-replay-unpack.min.css.map +1 -0
  22. package/dist/replay/rrweb-replay-unpack.min.js +30 -0
  23. package/dist/replay/rrweb-replay-unpack.min.js.map +1 -0
  24. package/dist/replay/rrweb-replay.js +4216 -0
  25. package/dist/replay/rrweb-replay.min.css +2 -0
  26. package/dist/replay/rrweb-replay.min.css.map +1 -0
  27. package/dist/replay/rrweb-replay.min.js +30 -0
  28. package/dist/replay/rrweb-replay.min.js.map +1 -0
  29. package/dist/rrweb-all.js +8708 -0
  30. package/dist/rrweb-all.min.css +2 -0
  31. package/dist/rrweb-all.min.css.map +1 -0
  32. package/dist/rrweb-all.min.js +30 -0
  33. package/dist/rrweb-all.min.js.map +1 -0
  34. package/dist/rrweb.js +7294 -0
  35. package/dist/rrweb.min.css +2 -0
  36. package/dist/rrweb.min.css.map +1 -0
  37. package/dist/rrweb.min.js +2 -2
  38. package/dist/rrweb.min.js.map +1 -1
  39. package/es/rrweb/ext/@xstate/fsm/es/index.js +17 -0
  40. package/es/rrweb/ext/base64-arraybuffer/dist/base64-arraybuffer.es5.js +49 -0
  41. package/es/rrweb/ext/fflate/esm/browser.js +777 -0
  42. package/es/rrweb/ext/mitt/dist/mitt.es.js +63 -0
  43. package/es/rrweb/packages/rrweb/ext/tslib/tslib.es6.js +78 -0
  44. package/es/rrweb/packages/rrweb/src/entries/all.js +13 -0
  45. package/es/rrweb/packages/rrweb/src/index.js +12 -0
  46. package/es/rrweb/packages/rrweb/src/packer/base.js +3 -0
  47. package/es/rrweb/packages/rrweb/src/packer/pack.js +10 -0
  48. package/es/rrweb/packages/rrweb/src/packer/unpack.js +29 -0
  49. package/es/rrweb/packages/rrweb/src/plugins/console/record/error-stack-parser.js +179 -0
  50. package/es/rrweb/packages/rrweb/src/plugins/console/record/index.js +134 -0
  51. package/es/rrweb/packages/rrweb/src/plugins/console/record/stringify.js +141 -0
  52. package/es/rrweb/packages/rrweb/src/plugins/console/replay/index.js +111 -0
  53. package/es/rrweb/packages/rrweb/src/plugins/sequential-id/record/index.js +23 -0
  54. package/es/rrweb/packages/rrweb/src/plugins/sequential-id/replay/index.js +28 -0
  55. package/es/rrweb/packages/rrweb/src/record/iframe-manager.js +32 -0
  56. package/es/rrweb/packages/rrweb/src/record/index.js +381 -0
  57. package/es/rrweb/packages/rrweb/src/record/mutation.js +532 -0
  58. package/es/rrweb/packages/rrweb/src/record/observer.js +665 -0
  59. package/es/rrweb/packages/rrweb/src/record/observers/canvas/2d.js +78 -0
  60. package/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas-manager.js +93 -0
  61. package/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas.js +30 -0
  62. package/es/rrweb/packages/rrweb/src/record/observers/canvas/serialize-args.js +116 -0
  63. package/es/rrweb/packages/rrweb/src/record/observers/canvas/webgl.js +78 -0
  64. package/es/rrweb/packages/rrweb/src/record/shadow-dom-manager.js +45 -0
  65. package/es/rrweb/packages/rrweb/src/replay/canvas/2d.js +25 -0
  66. package/es/rrweb/packages/rrweb/src/replay/canvas/index.js +35 -0
  67. package/es/rrweb/packages/rrweb/src/replay/canvas/webgl.js +124 -0
  68. package/es/rrweb/packages/rrweb/src/replay/index.js +1864 -0
  69. package/es/rrweb/packages/rrweb/src/replay/machine.js +321 -0
  70. package/es/rrweb/packages/rrweb/src/replay/smoothscroll.js +221 -0
  71. package/es/rrweb/packages/rrweb/src/replay/styles/inject-style.js +8 -0
  72. package/es/rrweb/packages/rrweb/src/replay/timer.js +96 -0
  73. package/es/rrweb/packages/rrweb/src/replay/virtual-styles.js +121 -0
  74. package/es/rrweb/packages/rrweb/src/types.js +75 -0
  75. package/es/rrweb/packages/rrweb/src/utils.js +509 -0
  76. package/es/rrweb/packages/rrweb-snapshot/es/rrweb-snapshot.js +1697 -0
  77. package/lib/plugins/console-record.js +650 -0
  78. package/lib/plugins/console-replay.js +288 -0
  79. package/lib/plugins/sequential-id-record.js +28 -0
  80. package/lib/plugins/sequential-id-replay.js +32 -0
  81. package/lib/record/rrweb-record-pack.js +742 -0
  82. package/lib/record/rrweb-record.js +3315 -0
  83. package/lib/replay/rrweb-replay-unpack.js +4621 -0
  84. package/lib/replay/rrweb-replay.js +4211 -0
  85. package/lib/rrweb-all.js +8703 -0
  86. package/lib/rrweb.js +7289 -0
  87. package/package.json +41 -43
  88. package/typings/entries/all.d.ts +6 -0
  89. package/{dist → typings}/entries/record-pack.d.ts +0 -0
  90. package/{dist → typings}/entries/replay-unpack.d.ts +0 -0
  91. package/{dist → typings}/index.d.ts +1 -2
  92. package/{dist → typings}/packer/base.d.ts +0 -0
  93. package/{dist → typings}/packer/index.d.ts +0 -0
  94. package/{dist → typings}/packer/pack.d.ts +0 -0
  95. package/{dist → typings}/packer/unpack.d.ts +0 -0
  96. package/{dist → typings}/plugins/console/record/error-stack-parser.d.ts +0 -0
  97. package/{dist → typings}/plugins/console/record/index.d.ts +3 -2
  98. package/{dist → typings}/plugins/console/record/stringify.d.ts +0 -0
  99. package/{dist → typings}/plugins/console/replay/index.d.ts +2 -2
  100. package/{dist → typings}/plugins/sequential-id/record/index.d.ts +0 -0
  101. package/{dist → typings}/plugins/sequential-id/replay/index.d.ts +0 -0
  102. package/{dist → typings}/record/iframe-manager.d.ts +1 -1
  103. package/{dist → typings}/record/index.d.ts +0 -0
  104. package/{dist → typings}/record/mutation.d.ts +5 -8
  105. package/typings/record/observer.d.ts +7 -0
  106. package/{dist → typings}/record/observers/canvas/2d.d.ts +0 -0
  107. package/{dist → typings}/record/observers/canvas/canvas-manager.d.ts +0 -0
  108. package/{dist → typings}/record/observers/canvas/canvas.d.ts +0 -0
  109. package/{dist → typings}/record/observers/canvas/serialize-args.d.ts +1 -1
  110. package/{dist → typings}/record/observers/canvas/webgl.d.ts +0 -0
  111. package/typings/record/observers/canvas/webgl2.d.ts +2 -0
  112. package/typings/record/shadow-dom-manager.d.ts +21 -0
  113. package/{dist → typings}/replay/canvas/2d.d.ts +0 -0
  114. package/{dist → typings}/replay/canvas/index.d.ts +0 -0
  115. package/{dist → typings}/replay/canvas/webgl.d.ts +0 -0
  116. package/{dist → typings}/replay/index.d.ts +1 -0
  117. package/{dist → typings}/replay/machine.d.ts +0 -0
  118. package/{dist → typings}/replay/smoothscroll.d.ts +0 -0
  119. package/{dist → typings}/replay/styles/inject-style.d.ts +0 -0
  120. package/{dist → typings}/replay/timer.d.ts +0 -0
  121. package/{dist → typings}/replay/virtual-styles.d.ts +1 -1
  122. package/{dist → typings}/rrdom/index.d.ts +0 -0
  123. package/{dist → typings}/rrdom/tree-node.d.ts +0 -0
  124. package/{dist → typings}/types.d.ts +7 -8
  125. package/{dist → typings}/utils.d.ts +3 -4
  126. package/CHANGELOG.md +0 -26
  127. package/README.md +0 -124
  128. package/README.zh_CN.md +0 -122
  129. package/dist/entries/all.d.ts +0 -4
  130. package/dist/index.css +0 -82
  131. package/dist/index.css.map +0 -1
  132. package/dist/index.js +0 -3
  133. package/dist/index.js.LICENSE.txt +0 -14
  134. package/dist/index.js.map +0 -1
  135. package/dist/plugins/entries/all.d.ts +0 -4
  136. package/dist/plugins/entries/record-pack.d.ts +0 -2
  137. package/dist/plugins/entries/replay-unpack.d.ts +0 -2
  138. package/dist/plugins/index.d.ts +0 -9
  139. package/dist/plugins/packer/base.d.ts +0 -7
  140. package/dist/plugins/packer/index.d.ts +0 -2
  141. package/dist/plugins/packer/pack.d.ts +0 -2
  142. package/dist/plugins/packer/unpack.d.ts +0 -2
  143. package/dist/plugins/plugins/console/record/error-stack-parser.d.ts +0 -37
  144. package/dist/plugins/plugins/console/record/index.d.ts +0 -41
  145. package/dist/plugins/plugins/console/record/stringify.d.ts +0 -2
  146. package/dist/plugins/plugins/console/replay/index.d.ts +0 -9
  147. package/dist/plugins/plugins/sequential-id/record/index.d.ts +0 -6
  148. package/dist/plugins/plugins/sequential-id/replay/index.d.ts +0 -7
  149. package/dist/plugins/record/iframe-manager.d.ts +0 -13
  150. package/dist/plugins/record/index.d.ts +0 -9
  151. package/dist/plugins/record/mutation.d.ts +0 -45
  152. package/dist/plugins/record/observer.d.ts +0 -11
  153. package/dist/plugins/record/observers/canvas/2d.d.ts +0 -2
  154. package/dist/plugins/record/observers/canvas/canvas-manager.d.ts +0 -32
  155. package/dist/plugins/record/observers/canvas/canvas.d.ts +0 -2
  156. package/dist/plugins/record/observers/canvas/serialize-args.d.ts +0 -6
  157. package/dist/plugins/record/observers/canvas/webgl.d.ts +0 -2
  158. package/dist/plugins/record/shadow-dom-manager.d.ts +0 -34
  159. package/dist/plugins/replay/canvas/2d.d.ts +0 -9
  160. package/dist/plugins/replay/canvas/index.d.ts +0 -9
  161. package/dist/plugins/replay/canvas/webgl.d.ts +0 -11
  162. package/dist/plugins/replay/index.d.ts +0 -82
  163. package/dist/plugins/replay/machine.d.ts +0 -85
  164. package/dist/plugins/replay/smoothscroll.d.ts +0 -1
  165. package/dist/plugins/replay/styles/inject-style.d.ts +0 -2
  166. package/dist/plugins/replay/timer.d.ts +0 -19
  167. package/dist/plugins/replay/virtual-styles.d.ts +0 -43
  168. package/dist/plugins/rrdom/index.d.ts +0 -1
  169. package/dist/plugins/rrdom/tree-node.d.ts +0 -20
  170. package/dist/plugins/snapshot/css.d.ts +0 -92
  171. package/dist/plugins/snapshot/index.d.ts +0 -5
  172. package/dist/plugins/snapshot/rebuild.d.ts +0 -19
  173. package/dist/plugins/snapshot/snapshot.d.ts +0 -49
  174. package/dist/plugins/snapshot/types.d.ts +0 -99
  175. package/dist/plugins/snapshot/utils.d.ts +0 -11
  176. package/dist/plugins/types.d.ts +0 -509
  177. package/dist/plugins/utils.d.ts +0 -71
  178. package/dist/record/observer.d.ts +0 -11
  179. package/dist/record/shadow-dom-manager.d.ts +0 -34
  180. package/dist/snapshot/css.d.ts +0 -92
  181. package/dist/snapshot/index.d.ts +0 -5
  182. package/dist/snapshot/rebuild.d.ts +0 -19
  183. package/dist/snapshot/snapshot.d.ts +0 -49
  184. package/dist/snapshot/types.d.ts +0 -99
  185. package/dist/snapshot/utils.d.ts +0 -11
package/package.json CHANGED
@@ -1,32 +1,38 @@
1
1
  {
2
2
  "name": "@highlight-run/rrweb",
3
- "version": "1.2.0",
3
+ "version": "2.0.1",
4
4
  "description": "record and replay the web",
5
5
  "scripts": {
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",
7
- "test:headless": "npm run bundle:browser && cross-env TS_NODE_CACHE=false TS_NODE_FILES=true PUPPETEER_HEADLESS=true mocha -r ts-node/register -r ignore-styles -r jsdom-global/register test/**.test.ts",
8
- "test:watch": "PUPPETEER_HEADLESS=true npm run test -- --watch --watch-extensions js,ts",
9
- "repl": "npm run bundle:browser && cross-env TS_NODE_CACHE=false TS_NODE_FILES=true ts-node scripts/repl.ts",
6
+ "prepare": "npm run prepack",
7
+ "prepack": "npm run bundle",
8
+ "test": "npm run bundle:browser && jest",
9
+ "test:headless": "npm run bundle:browser && PUPPETEER_HEADLESS=true jest",
10
+ "test:watch": "PUPPETEER_HEADLESS=true npm run test -- --watch",
11
+ "repl": "npm run bundle:browser && node scripts/repl.js",
12
+ "dev": "yarn bundle:browser --watch",
10
13
  "bundle:browser": "cross-env BROWSER_ONLY=true rollup --config",
11
14
  "bundle": "rollup --config",
12
- "bundle:dev": "rollup --config --watch",
13
15
  "typings": "tsc -d --declarationDir typings",
14
- "dev": "webpack --watch",
15
- "bundle:highlight": "webpack --mode=production",
16
- "analyze": "mkdir -p dist && webpack --mode=production --profile --json > dist/stats.json && yarn webpack-bundle-analyzer dist/stats.json"
16
+ "check-types": "tsc -noEmit",
17
+ "prepublish": "npm run typings && npm run bundle"
17
18
  },
18
19
  "repository": {
19
20
  "type": "git",
20
- "url": "git+ssh://git@github.com/highlight-run/rrweb.git"
21
+ "url": "git+ssh://git@github.com/rrweb-io/rrweb.git"
21
22
  },
22
23
  "keywords": [
23
24
  "rrweb"
24
25
  ],
25
- "main": "dist/index.js",
26
+ "main": "lib/rrweb-all.js",
27
+ "module": "es/rrweb/packages/rrweb/src/entries/all.js",
26
28
  "unpkg": "dist/rrweb.js",
27
29
  "sideEffects": false,
30
+ "typings": "typings/entries/all.d.ts",
28
31
  "files": [
29
- "dist"
32
+ "dist",
33
+ "lib",
34
+ "es",
35
+ "typings"
30
36
  ],
31
37
  "author": "yanzhen@smartx.com",
32
38
  "license": "MIT",
@@ -35,53 +41,45 @@
35
41
  },
36
42
  "homepage": "https://github.com/rrweb-io/rrweb#readme",
37
43
  "devDependencies": {
38
- "@rollup/plugin-node-resolve": "^13.1.3",
44
+ "@rollup/plugin-node-resolve": "^7.0.0",
45
+ "@rollup/plugin-typescript": "^8.3.1",
39
46
  "@types/chai": "^4.1.6",
40
47
  "@types/inquirer": "0.0.43",
41
- "@types/jsdom": "^16.2.12",
42
- "@types/mocha": "^5.2.5",
43
- "@types/node": "^10.11.7",
44
- "@types/puppeteer": "^5.4.3",
45
- "chai": "^4.2.0",
48
+ "@types/jest": "^27.4.1",
49
+ "@types/jest-image-snapshot": "^4.3.1",
50
+ "@types/jsdom": "^16.2.14",
51
+ "@types/node": "^17.0.21",
52
+ "@types/prettier": "^2.3.2",
53
+ "@types/puppeteer": "^5.4.4",
46
54
  "cross-env": "^5.2.0",
47
- "css-loader": "^5.0.1",
48
55
  "fast-mhtml": "^1.1.9",
56
+ "identity-obj-proxy": "^3.0.0",
49
57
  "ignore-styles": "^5.0.1",
50
58
  "inquirer": "^6.2.1",
59
+ "jest": "^27.5.1",
60
+ "jest-image-snapshot": "^4.5.1",
51
61
  "jest-snapshot": "^23.6.0",
52
- "jsdom": "^16.6.0",
62
+ "jsdom": "^17.0.0",
53
63
  "jsdom-global": "^3.0.2",
54
- "mini-css-extract-plugin": "^1.3.8",
55
- "mocha": "^5.2.0",
56
- "node-libtidy": "^0.4.0",
57
64
  "prettier": "2.2.1",
58
65
  "puppeteer": "^9.1.1",
59
- "rollup": "^2.3.3",
60
- "rollup-plugin-commonjs": "^9.2.0",
61
- "rollup-plugin-node-resolve": "^3.4.0",
66
+ "rollup": "^2.45.2",
62
67
  "rollup-plugin-postcss": "^3.1.1",
63
68
  "rollup-plugin-rename-node-modules": "^1.1.0",
64
- "rollup-plugin-terser": "^5.3.0",
65
- "rollup-plugin-typescript2": "^0.31.2",
66
- "rollup-plugin-web-worker-loader": "^1.6.1",
67
- "style-loader": "^2.0.0",
68
- "ts-loader": "^8.0.14",
69
- "ts-node": "^7.0.1",
70
- "tslib": "^1.9.3",
71
- "tslint": "^4.5.1",
72
- "typescript": "^3.9.5",
73
- "webpack": "^5.10.1",
74
- "webpack-bundle-analyzer": "^4.4.2",
75
- "webpack-cli": "^4.2.0",
76
- "webpack-dev-server": "^3.11.0",
77
- "webpack-merge": "^5.7.0"
69
+ "rollup-plugin-terser": "^7.0.2",
70
+ "ts-jest": "^27.1.3",
71
+ "ts-node": "^10.7.0",
72
+ "tslib": "^2.3.1",
73
+ "tslint": "^6.1.3",
74
+ "typescript": "^4.6.2"
78
75
  },
79
76
  "dependencies": {
80
- "@types/css-font-loading-module": "0.0.4",
77
+ "@highlight-run/rrweb-snapshot": "^1.1.15",
78
+ "@types/css-font-loading-module": "0.0.7",
81
79
  "@xstate/fsm": "^1.4.0",
82
80
  "base64-arraybuffer": "^1.0.1",
83
81
  "fflate": "^0.4.4",
84
- "identity-obj-proxy": "^3.0.0",
85
82
  "mitt": "^1.1.3"
86
- }
83
+ },
84
+ "gitHead": "0a154a620f994a625f3689b0d851ca03c214a2c0"
87
85
  }
@@ -0,0 +1,6 @@
1
+ export * from '../index';
2
+ export * from '../packer';
3
+ export * from '../plugins/console/record';
4
+ export * from '../plugins/console/replay';
5
+ export { getRecordSequentialIdPlugin } from '../plugins/sequential-id/record';
6
+ export { getReplaySequentialIdPlugin } from '../plugins/sequential-id/replay';
File without changes
File without changes
@@ -2,8 +2,7 @@ import record from './record';
2
2
  import { Replayer } from './replay';
3
3
  import { _mirror } from './utils';
4
4
  import * as utils from './utils';
5
- export { EventType, IncrementalSource, MouseInteractions, ReplayerEvents, HighlightConfiguration, } from './types';
5
+ export { EventType, IncrementalSource, MouseInteractions, ReplayerEvents, } from './types';
6
6
  declare const addCustomEvent: <T>(tag: string, payload: T) => void;
7
7
  declare const freezePage: () => void;
8
8
  export { record, addCustomEvent, freezePage, Replayer, _mirror as mirror, utils, };
9
- export { getRecordSequentialIdPlugin } from './plugins/sequential-id/record';
File without changes
File without changes
File without changes
File without changes
@@ -2,12 +2,13 @@ import { RecordPlugin } from '../../../types';
2
2
  export declare type StringifyOptions = {
3
3
  stringLengthLimit?: number;
4
4
  numOfKeysLimit: number;
5
+ depthOfLimit: number;
5
6
  };
6
7
  declare type LogRecordOptions = {
7
- level?: LogLevel[] | undefined;
8
+ level?: LogLevel[];
8
9
  lengthThreshold?: number;
9
10
  stringifyOptions?: StringifyOptions;
10
- logger?: Logger | string;
11
+ logger?: Logger | 'console';
11
12
  };
12
13
  export declare type LogData = {
13
14
  level: LogLevel;
@@ -2,8 +2,8 @@ import { LogLevel, LogData } from '../record';
2
2
  import { ReplayPlugin } from '../../../types';
3
3
  declare type ReplayLogger = Partial<Record<LogLevel, (data: LogData) => void>>;
4
4
  declare type LogReplayConfig = {
5
- level?: LogLevel[] | undefined;
6
- replayLogger: ReplayLogger | undefined;
5
+ level?: LogLevel[];
6
+ replayLogger?: ReplayLogger;
7
7
  };
8
8
  export declare const getReplayConsolePlugin: (options?: LogReplayConfig) => ReplayPlugin;
9
9
  export {};
@@ -1,4 +1,4 @@
1
- import { serializedNodeWithId, INode } from '../snapshot';
1
+ import { serializedNodeWithId, INode } from '@highlight-run/rrweb-snapshot';
2
2
  import { mutationCallBack } from '../types';
3
3
  export declare class IframeManager {
4
4
  private iframes;
File without changes
@@ -1,8 +1,4 @@
1
- import { MaskInputOptions, SlimDOMOptions, MaskTextFn, MaskInputFn } from '../snapshot';
2
- import { mutationRecord, blockClass, maskTextClass, mutationCallBack, Mirror } from '../types';
3
- import { IframeManager } from './iframe-manager';
4
- import { CanvasManager } from './observers/canvas/canvas-manager';
5
- import { ShadowDomManager } from './shadow-dom-manager';
1
+ import { mutationRecord, MutationBufferParam } from '../types';
6
2
  export default class MutationBuffer {
7
3
  private frozen;
8
4
  private locked;
@@ -14,7 +10,7 @@ export default class MutationBuffer {
14
10
  private addedSet;
15
11
  private movedSet;
16
12
  private droppedSet;
17
- private emissionCallback;
13
+ private mutationCb;
18
14
  private blockClass;
19
15
  private blockSelector;
20
16
  private maskTextClass;
@@ -24,14 +20,15 @@ export default class MutationBuffer {
24
20
  private maskTextFn;
25
21
  private maskInputFn;
26
22
  private recordCanvas;
27
- private enableStrictPrivacy;
23
+ private inlineImages;
28
24
  private slimDOMOptions;
29
25
  private doc;
30
26
  private mirror;
31
27
  private iframeManager;
32
28
  private shadowDomManager;
33
29
  private canvasManager;
34
- init(cb: mutationCallBack, blockClass: blockClass, blockSelector: string | null, maskTextClass: maskTextClass, maskTextSelector: string | null, inlineStylesheet: boolean, maskInputOptions: MaskInputOptions, maskTextFn: MaskTextFn | undefined, maskInputFn: MaskInputFn | undefined, recordCanvas: boolean, slimDOMOptions: SlimDOMOptions, doc: Document, mirror: Mirror, iframeManager: IframeManager, shadowDomManager: ShadowDomManager, canvasManager: CanvasManager, enableStrictPrivacy: boolean): void;
30
+ private enableStrictPrivacy;
31
+ init(options: MutationBufferParam): void;
35
32
  freeze(): void;
36
33
  unfreeze(): void;
37
34
  isFrozen(): boolean;
@@ -0,0 +1,7 @@
1
+ import { observerParam, listenerHandler, hooksParam, MutationBufferParam } from '../types';
2
+ import MutationBuffer from './mutation';
3
+ export declare const mutationBuffers: MutationBuffer[];
4
+ export declare function initMutationObserver(options: MutationBufferParam, rootEl: Node): MutationObserver;
5
+ export declare function initScrollObserver({ scrollCb, doc, mirror, blockClass, sampling, }: Pick<observerParam, 'scrollCb' | 'doc' | 'mirror' | 'blockClass' | 'sampling'>): listenerHandler;
6
+ export declare const INPUT_TAGS: string[];
7
+ export declare function initObservers(o: observerParam, hooks?: hooksParam): listenerHandler;
@@ -3,4 +3,4 @@ export declare function variableListFor(ctx: WebGLRenderingContext | WebGL2Rende
3
3
  export declare const saveWebGLVar: (value: any, win: IWindow, ctx: WebGL2RenderingContext | WebGLRenderingContext) => number | void;
4
4
  export declare function serializeArg(value: any, win: IWindow, ctx: WebGL2RenderingContext | WebGLRenderingContext): SerializedWebGlArg;
5
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 WebGLShader | WebGLProgram | WebGLActiveInfo | WebGLBuffer | WebGLFramebuffer | WebGLRenderbuffer | WebGLShaderPrecisionFormat | WebGLTexture | WebGLUniformLocation | WebGLVertexArrayObject;
6
+ export declare const isInstanceOfWebGLObject: (value: any, win: IWindow) => value is WebGLTexture | WebGLShader | WebGLBuffer | WebGLVertexArrayObject | WebGLProgram | WebGLActiveInfo | WebGLUniformLocation | WebGLFramebuffer | WebGLRenderbuffer | WebGLShaderPrecisionFormat;
@@ -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,21 @@
1
+ import { mutationCallBack, Mirror, scrollCallback, MutationBufferParam, SamplingStrategy } from '../types';
2
+ declare type BypassOptions = Omit<MutationBufferParam, 'doc' | 'mutationCb' | 'mirror' | 'shadowDomManager'> & {
3
+ sampling: SamplingStrategy;
4
+ };
5
+ export declare class ShadowDomManager {
6
+ private mutationCb;
7
+ private scrollCb;
8
+ private bypassOptions;
9
+ private mirror;
10
+ private restorePatches;
11
+ constructor(options: {
12
+ mutationCb: mutationCallBack;
13
+ scrollCb: scrollCallback;
14
+ bypassOptions: BypassOptions;
15
+ mirror: Mirror;
16
+ });
17
+ addShadowRoot(shadowRoot: ShadowRoot, doc: Document): void;
18
+ observeAttachShadow(iframeElement: HTMLIFrameElement): void;
19
+ reset(): void;
20
+ }
21
+ export {};
File without changes
File without changes
File without changes
@@ -64,6 +64,7 @@ export declare class Replayer {
64
64
  private applyMutation;
65
65
  private applyScroll;
66
66
  private applyInput;
67
+ private applyText;
67
68
  private legacy_resolveMissingNode;
68
69
  private moveAndHover;
69
70
  private drawMouseTail;
File without changes
File without changes
File without changes
@@ -1,4 +1,4 @@
1
- import { INode } from '../snapshot';
1
+ import { INode } from '@highlight-run/rrweb-snapshot';
2
2
  export declare enum StyleRuleType {
3
3
  Insert = 0,
4
4
  Remove = 1,
File without changes
File without changes
@@ -1,6 +1,5 @@
1
- import { serializedNodeWithId, idNodeMap, INode, MaskInputOptions, SlimDOMOptions, MaskInputFn, MaskTextFn } from './snapshot';
1
+ import { serializedNodeWithId, idNodeMap, INode, MaskInputOptions, SlimDOMOptions, MaskInputFn, MaskTextFn } from '@highlight-run/rrweb-snapshot';
2
2
  import { PackFn, UnpackFn } from './packer/base';
3
- import { FontFaceDescriptors } from 'css-font-loading-module';
4
3
  import { IframeManager } from './record/iframe-manager';
5
4
  import { ShadowDomManager } from './record/shadow-dom-manager';
6
5
  import type { Replayer } from './replay';
@@ -159,6 +158,7 @@ export declare type recordOptions<T> = {
159
158
  recordCanvas?: boolean;
160
159
  userTriggeredOnInput?: boolean;
161
160
  collectFonts?: boolean;
161
+ inlineImages?: boolean;
162
162
  plugins?: RecordPlugin[];
163
163
  mousemoveWait?: number;
164
164
  keepIframeSrcFn?: KeepIframeSrcFn;
@@ -187,6 +187,7 @@ export declare type observerParam = {
187
187
  fontCb: fontCallback;
188
188
  sampling: SamplingStrategy;
189
189
  recordCanvas: boolean;
190
+ inlineImages: boolean;
190
191
  userTriggeredOnInput: boolean;
191
192
  collectFonts: boolean;
192
193
  slimDOMOptions: SlimDOMOptions;
@@ -195,13 +196,14 @@ export declare type observerParam = {
195
196
  iframeManager: IframeManager;
196
197
  shadowDomManager: ShadowDomManager;
197
198
  canvasManager: CanvasManager;
199
+ enableStrictPrivacy: boolean;
198
200
  plugins: Array<{
199
201
  observer: Function;
200
202
  callback: Function;
201
203
  options: unknown;
202
204
  }>;
203
- enableStrictPrivacy: boolean;
204
205
  };
206
+ export declare type MutationBufferParam = Pick<observerParam, 'mutationCb' | 'blockClass' | 'blockSelector' | 'maskTextClass' | 'maskTextSelector' | 'inlineStylesheet' | 'maskInputOptions' | 'maskTextFn' | 'maskInputFn' | 'recordCanvas' | 'inlineImages' | 'slimDOMOptions' | 'doc' | 'mirror' | 'iframeManager' | 'shadowDomManager' | 'canvasManager' | 'enableStrictPrivacy'>;
205
207
  export declare type hooksParam = {
206
208
  mutation?: mutationCallBack;
207
209
  mousemove?: mousemoveCallBack;
@@ -305,7 +307,7 @@ export declare type SerializedWebGlArg = {
305
307
  src: string;
306
308
  } | {
307
309
  rr_type: string;
308
- args: Array<SerializedWebGlArg>;
310
+ args: SerializedWebGlArg[];
309
311
  } | {
310
312
  rr_type: string;
311
313
  index: number;
@@ -496,14 +498,11 @@ export declare type ElementState = {
496
498
  scroll?: [number, number];
497
499
  };
498
500
  export declare type KeepIframeSrcFn = (src: string) => boolean;
499
- export interface HighlightConfiguration {
500
- enableOnHoverClass?: boolean;
501
- }
502
501
  declare global {
503
502
  interface Window {
504
- HIG_CONFIGURATION: HighlightConfiguration;
505
503
  FontFace: typeof FontFace;
506
504
  }
507
505
  }
508
506
  export declare type IWindow = Window & typeof globalThis;
507
+ export declare type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
509
508
  export {};
@@ -1,10 +1,10 @@
1
1
  import { Mirror, throttleOptions, listenerHandler, hookResetter, blockClass, addedNodeMutation, removedNodeMutation, textMutation, attributeMutation, mutationData, scrollData, inputData, DocumentDimension, IWindow } from './types';
2
- import { INode, serializedNodeWithId } from './snapshot';
2
+ import { INode, serializedNodeWithId } from '@highlight-run/rrweb-snapshot';
3
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?: IWindow): hookResetter;
7
+ export declare function hookSetter<T>(target: T, key: string | number | symbol, d: PropertyDescriptor, isRevoked?: boolean, win?: Window & typeof globalThis): hookResetter;
8
8
  export declare function patch(source: {
9
9
  [key: string]: any;
10
10
  }, name: string, replacement: (...args: any[]) => any): () => void;
@@ -15,7 +15,7 @@ export declare function isBlocked(node: Node | null, blockClass: blockClass): bo
15
15
  export declare function isIgnored(n: Node | INode): boolean;
16
16
  export declare function isAncestorRemoved(target: INode, mirror: Mirror): boolean;
17
17
  export declare function isTouchEvent(event: MouseEvent | TouchEvent): event is TouchEvent;
18
- export declare function polyfill(win?: IWindow): void;
18
+ export declare function polyfill(win?: Window & typeof globalThis): void;
19
19
  export declare type TreeNode = {
20
20
  id: number;
21
21
  mutation: addedNodeMutation;
@@ -67,5 +67,4 @@ export declare function getBaseDimension(node: Node, rootIframe: Node): Document
67
67
  export declare function hasShadowRoot<T extends Node>(n: T): n is T & {
68
68
  shadowRoot: ShadowRoot;
69
69
  };
70
- export declare function obfuscateText(text: string): string;
71
70
  export {};
package/CHANGELOG.md DELETED
@@ -1,26 +0,0 @@
1
- # Changelog
2
-
3
- ## v1.0.0
4
-
5
- ### Featrues & Improvements
6
-
7
- - Support record same-origin non-sandboxed iframe.
8
- - Support record open-mode shadow DOM.
9
- - Implement the plugin API.
10
- - Export `record.takeFullSnapshot` as a public API
11
- - Record and replay drag events.
12
- - Add options to mask texts (#540).
13
-
14
- ### Fixes
15
-
16
- - Get the original MutationObserver when Angular patched it.
17
- - Fix RangeError: Maximum call stack size exceeded (#479).
18
- - Fix the linked-list implementation in the recorder.
19
- - Don't perform newly added actions if the player is paused (#539).
20
- - Fix inaccurate mouse position (#522)
21
-
22
- ### Breaking Changes
23
-
24
- - Deprecated the usage of `rrweb.mirror`. Please use `record.mirror` and `replayer.getMirror()` instead.
25
- - Deprecated the record option `recordLog `. See the new plugin API [here](./docs/recipes/console.md).
26
- - Deprecated the replay option ` `. See the new plugin API [here](./docs/recipes/console.md).
package/README.md DELETED
@@ -1,124 +0,0 @@
1
- <p align="center">
2
- <img width="100px" height="100px" src="https://www.rrweb.io/favicon.png">
3
- </p>
4
- <p align="center">
5
- <a href="https://www.rrweb.io/" style="font-weight: bold">Try rrweb</a>
6
- </p>
7
-
8
- # rrweb
9
-
10
- **[The new adventure of the rrweb community](http://www.myriptide.com/rrweb-community/)**
11
-
12
- [![Join the chat at slack](https://img.shields.io/badge/slack-@rrweb-teal.svg?logo=slack)](https://join.slack.com/t/rrweb/shared_invite/zt-siwoc6hx-uWay3s2wyG8t5GpZVb8rWg)
13
- ![total gzip size](https://img.badgesize.io/https://cdn.jsdelivr.net/npm/rrweb@latest/dist/rrweb.min.js?compression=gzip&label=total%20gzip%20size)
14
- ![recorder gzip size](https://img.badgesize.io/https://cdn.jsdelivr.net/npm/rrweb@latest/dist/record/rrweb-record.min.js?compression=gzip&label=recorder%20gzip%20size)
15
- [![](https://data.jsdelivr.com/v1/package/npm/rrweb/badge)](https://www.jsdelivr.com/package/npm/rrweb)
16
-
17
- [中文文档](./README.zh_CN.md)
18
-
19
- > I have joined Github Sponsors and highly appreciate your sponsorship.
20
-
21
- rrweb refers to 'record and replay the web', which is a tool for recording and replaying users' interactions on the web.
22
-
23
- ## Guide
24
-
25
- [**📚 Read the rrweb guide here. 📚**](./guide.md)
26
-
27
- [**🍳 Recipes 🍳**](./docs/recipes/index.md)
28
-
29
- ## Project Structure
30
-
31
- rrweb is mainly composed of 3 parts:
32
-
33
- - **[rrweb-snapshot](https://github.com/rrweb-io/rrweb-snapshot)**, including both snapshot and rebuilding features. The snapshot is used to convert the DOM and its state into a serializable data structure with a unique identifier; the rebuilding feature is to rebuild the snapshot into corresponding DOM.
34
- - **[rrweb](https://github.com/rrweb-io/rrweb)**, including two functions, record and replay. The record function is used to record all the mutations in the DOM; the replay is to replay the recorded mutations one by one according to the corresponding timestamp.
35
- - **[rrweb-player](https://github.com/rrweb-io/rrweb-player)**, is a player UI for rrweb, providing GUI-based functions like pause, fast-forward, drag and drop to play at any time.
36
-
37
- ## Roadmap
38
-
39
- - rrdom: an ad-hoc DOM for rrweb session data [#419](https://github.com/rrweb-io/rrweb/issues/419)
40
- - storage engine: do deduplication on a large number of rrweb sessions
41
- - more end-to-end tests
42
- - compact mutation data in common patterns
43
- - provide plugins via the new plugin API, including:
44
- - XHR plugin
45
- - fetch plugin
46
- - GraphQL plugin
47
- - ...
48
-
49
- ## Internal Design
50
-
51
- - [serialization](./docs/serialization.md)
52
- - [incremental snapshot](./docs/observer.md)
53
- - [replay](./docs/replay.md)
54
- - [sandbox](./docs/sandbox.md)
55
-
56
- ## Contribute Guide
57
-
58
- Since we want the record and replay sides to share a strongly typed data structure, rrweb is developed with typescript which provides stronger type support.
59
-
60
- [Typescript handbook](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html)
61
-
62
- 1. Fork the rrweb component repository you want to patch.
63
- 2. Run `npm install` to install required dependencies.
64
- 3. Patch the code and pass all the tests.
65
- 4. Push the code and create a pull request.
66
-
67
- In addition to adding integration tests and unit tests, rrweb also provides a REPL testing tool.
68
-
69
- [Using the REPL tool](./guide.md#REPL-tool)
70
-
71
- ## Core Team Members
72
-
73
- <table>
74
- <tr>
75
- <td align="center">
76
- <a href="https://github.com/Yuyz0112">
77
- <img
78
- src="https://avatars.githubusercontent.com/u/13651389?s=100"
79
- width="100px;"
80
- alt=""
81
- />
82
- <br /><sub><b>Yuyz0112</b></sub>
83
- </a>
84
- </td>
85
- <td align="center">
86
- <a href="https://github.com/Mark-Fenng">
87
- <img
88
- src="https://avatars.githubusercontent.com/u/27533910?s=100"
89
- width="100px;"
90
- alt=""
91
- />
92
- <br /><sub><b>Mark-Fenng</b></sub>
93
- </a>
94
- </td>
95
- <td align="center">
96
- <a href="https://github.com/eoghanmurray">
97
- <img
98
- src="https://avatars.githubusercontent.com/u/156780?s=100"
99
- width="100px;"
100
- alt=""
101
- />
102
- <br /><sub><b>eoghanmurray</b></sub>
103
- </a>
104
- </td>
105
- <td align="center">
106
- <a href="https://github.com/Juice10">
107
- <img
108
- src="https://avatars.githubusercontent.com/u/4106?s=100"
109
- width="100px;"
110
- alt=""
111
- />
112
- <br /><sub><b>Juice10</b></sub>
113
- </a>
114
- </td>
115
- </tr>
116
- </table>
117
-
118
- ## Who's using rrweb
119
-
120
- <p align="center">
121
- <a href="http://www.smartx.com/" target="_blank">
122
- <img width="260px" src="https://www.rrweb.io/logos/smartx.png">
123
- </a>
124
- </p>