@highlight-run/rrweb 1.2.1 → 2.0.4

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 (191) hide show
  1. package/dist/plugins/console-record.js +454 -0
  2. package/dist/plugins/console-record.min.js +12 -15
  3. package/dist/plugins/console-record.min.js.map +1 -1
  4. package/dist/plugins/console-replay.js +164 -0
  5. package/dist/plugins/console-replay.min.js +5 -0
  6. package/dist/plugins/console-replay.min.js.map +1 -0
  7. package/dist/plugins/sequential-id-record.js +30 -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 +33 -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 +664 -0
  14. package/dist/record/rrweb-record-pack.min.js +4 -0
  15. package/dist/record/rrweb-record-pack.min.js.map +1 -0
  16. package/dist/record/rrweb-record.js +3202 -0
  17. package/dist/record/rrweb-record.min.js +5 -0
  18. package/dist/record/rrweb-record.min.js.map +1 -0
  19. package/dist/replay/rrweb-replay-unpack.js +4926 -0
  20. package/dist/replay/rrweb-replay-unpack.min.js +18 -0
  21. package/dist/replay/rrweb-replay-unpack.min.js.map +1 -0
  22. package/dist/replay/rrweb-replay.js +4518 -0
  23. package/dist/replay/rrweb-replay.min.js +18 -0
  24. package/dist/replay/rrweb-replay.min.js.map +1 -0
  25. package/dist/rrweb-all.js +8889 -0
  26. package/dist/rrweb-all.min.js +29 -0
  27. package/dist/rrweb-all.min.js.map +1 -0
  28. package/dist/rrweb.js +7558 -0
  29. package/dist/rrweb.min.js +6 -17
  30. package/dist/rrweb.min.js.map +1 -1
  31. package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__auto__createBase64WorkerFactory.js +12 -0
  32. package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__auto__isNodeJS.js +7 -0
  33. package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js +31 -0
  34. package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__node__WorkerClass.js +11 -0
  35. package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__node__createBase64WorkerFactory.js +18 -0
  36. package/es/rrweb/_virtual/image-bitmap-data-url-worker.js +6 -0
  37. package/es/rrweb/ext/@xstate/fsm/es/index.js +17 -0
  38. package/es/rrweb/ext/base64-arraybuffer/dist/base64-arraybuffer.es5.js +49 -0
  39. package/es/rrweb/ext/fflate/esm/browser.js +777 -0
  40. package/es/rrweb/ext/mitt/dist/mitt.es.js +63 -0
  41. package/es/rrweb/ext/tslib/tslib.es6.js +38 -0
  42. package/es/rrweb/packages/rrdom/es/virtual-dom.js +1099 -0
  43. package/es/rrweb/packages/rrweb/src/entries/all.js +13 -0
  44. package/es/rrweb/packages/rrweb/src/index.js +14 -0
  45. package/es/rrweb/packages/rrweb/src/packer/base.js +3 -0
  46. package/es/rrweb/packages/rrweb/src/packer/pack.js +9 -0
  47. package/es/rrweb/packages/rrweb/src/packer/unpack.js +29 -0
  48. package/es/rrweb/packages/rrweb/src/plugins/console/record/error-stack-parser.js +178 -0
  49. package/es/rrweb/packages/rrweb/src/plugins/console/record/index.js +115 -0
  50. package/es/rrweb/packages/rrweb/src/plugins/console/record/stringify.js +128 -0
  51. package/es/rrweb/packages/rrweb/src/plugins/console/replay/index.js +94 -0
  52. package/es/rrweb/packages/rrweb/src/plugins/sequential-id/record/index.js +22 -0
  53. package/es/rrweb/packages/rrweb/src/plugins/sequential-id/replay/index.js +28 -0
  54. package/es/rrweb/packages/rrweb/src/record/iframe-manager.js +31 -0
  55. package/es/rrweb/packages/rrweb/src/record/index.js +356 -0
  56. package/es/rrweb/packages/rrweb/src/record/mutation.js +491 -0
  57. package/es/rrweb/packages/rrweb/src/record/observer.js +590 -0
  58. package/es/rrweb/packages/rrweb/src/record/observers/canvas/2d.js +49 -0
  59. package/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas-manager.js +172 -0
  60. package/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas.js +25 -0
  61. package/es/rrweb/packages/rrweb/src/record/observers/canvas/serialize-args.js +123 -0
  62. package/es/rrweb/packages/rrweb/src/record/observers/canvas/webgl.js +59 -0
  63. package/es/rrweb/packages/rrweb/src/record/shadow-dom-manager.js +43 -0
  64. package/es/rrweb/packages/rrweb/src/record/stylesheet-manager.js +31 -0
  65. package/es/rrweb/packages/rrweb/src/replay/canvas/2d.js +29 -0
  66. package/es/rrweb/packages/rrweb/src/replay/canvas/deserialize-args.js +67 -0
  67. package/es/rrweb/packages/rrweb/src/replay/canvas/index.js +43 -0
  68. package/es/rrweb/packages/rrweb/src/replay/canvas/webgl.js +62 -0
  69. package/es/rrweb/packages/rrweb/src/replay/index.js +1555 -0
  70. package/es/rrweb/packages/rrweb/src/replay/machine.js +281 -0
  71. package/es/rrweb/packages/rrweb/src/replay/smoothscroll.js +219 -0
  72. package/es/rrweb/packages/rrweb/src/replay/styles/inject-style.js +8 -0
  73. package/es/rrweb/packages/rrweb/src/replay/timer.js +92 -0
  74. package/es/rrweb/packages/rrweb/src/types.js +75 -0
  75. package/es/rrweb/packages/rrweb/src/utils.js +315 -0
  76. package/es/rrweb/packages/rrweb-snapshot/es/rrweb-snapshot.js +1821 -0
  77. package/lib/plugins/console-record.js +492 -0
  78. package/lib/plugins/console-replay.js +218 -0
  79. package/lib/plugins/sequential-id-record.js +27 -0
  80. package/lib/plugins/sequential-id-replay.js +32 -0
  81. package/lib/record/rrweb-record-pack.js +787 -0
  82. package/lib/record/rrweb-record.js +3363 -0
  83. package/lib/replay/rrweb-replay-unpack.js +5075 -0
  84. package/lib/replay/rrweb-replay.js +4665 -0
  85. package/lib/rrweb-all.js +9181 -0
  86. package/lib/rrweb.js +7814 -0
  87. package/package.json +41 -42
  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 +1 -1
  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 +4 -3
  98. package/{dist → typings}/plugins/console/record/stringify.d.ts +1 -1
  99. package/{dist → typings}/plugins/console/replay/index.d.ts +2 -2
  100. package/{dist → typings}/plugins/sequential-id/record/index.d.ts +1 -1
  101. package/{dist → typings}/plugins/sequential-id/replay/index.d.ts +1 -1
  102. package/{dist → typings}/record/iframe-manager.d.ts +3 -3
  103. package/{dist/plugins → typings}/record/index.d.ts +9 -9
  104. package/{dist → typings}/record/mutation.d.ts +6 -8
  105. package/typings/record/observer.d.ts +7 -0
  106. package/{dist/plugins → typings}/record/observers/canvas/2d.d.ts +3 -2
  107. package/{dist → typings}/record/observers/canvas/canvas-manager.d.ts +5 -2
  108. package/{dist/plugins → typings}/record/observers/canvas/canvas.d.ts +2 -2
  109. package/typings/record/observers/canvas/serialize-args.d.ts +6 -0
  110. package/{dist/plugins → typings}/record/observers/canvas/webgl.d.ts +3 -2
  111. package/typings/record/observers/canvas/webgl2.d.ts +2 -0
  112. package/typings/record/shadow-dom-manager.d.ts +22 -0
  113. package/typings/record/stylesheet-manager.d.ts +12 -0
  114. package/typings/record/workers/image-bitmap-data-url-worker.d.ts +5 -0
  115. package/{dist → typings}/replay/canvas/2d.d.ts +3 -3
  116. package/typings/replay/canvas/deserialize-args.d.ts +7 -0
  117. package/{dist/plugins → typings}/replay/canvas/index.d.ts +10 -9
  118. package/typings/replay/canvas/webgl.d.ts +9 -0
  119. package/{dist → typings}/replay/index.d.ts +7 -9
  120. package/{dist → typings}/replay/machine.d.ts +0 -0
  121. package/{dist → typings}/replay/smoothscroll.d.ts +0 -0
  122. package/{dist → typings}/replay/styles/inject-style.d.ts +0 -0
  123. package/{dist → typings}/replay/timer.d.ts +0 -0
  124. package/{dist → typings}/rrdom/index.d.ts +0 -0
  125. package/{dist → typings}/rrdom/tree-node.d.ts +0 -0
  126. package/{dist/plugins → typings}/types.d.ts +536 -509
  127. package/typings/utils.d.ts +43 -0
  128. package/CHANGELOG.md +0 -26
  129. package/README.md +0 -124
  130. package/README.zh_CN.md +0 -122
  131. package/dist/entries/all.d.ts +0 -4
  132. package/dist/index.css +0 -82
  133. package/dist/index.css.map +0 -1
  134. package/dist/index.js +0 -3
  135. package/dist/index.js.LICENSE.txt +0 -14
  136. package/dist/index.js.map +0 -1
  137. package/dist/plugins/entries/all.d.ts +0 -4
  138. package/dist/plugins/entries/record-pack.d.ts +0 -2
  139. package/dist/plugins/entries/replay-unpack.d.ts +0 -2
  140. package/dist/plugins/index.d.ts +0 -9
  141. package/dist/plugins/packer/base.d.ts +0 -7
  142. package/dist/plugins/packer/index.d.ts +0 -2
  143. package/dist/plugins/packer/pack.d.ts +0 -2
  144. package/dist/plugins/packer/unpack.d.ts +0 -2
  145. package/dist/plugins/plugins/console/record/error-stack-parser.d.ts +0 -37
  146. package/dist/plugins/plugins/console/record/index.d.ts +0 -41
  147. package/dist/plugins/plugins/console/record/stringify.d.ts +0 -2
  148. package/dist/plugins/plugins/console/replay/index.d.ts +0 -9
  149. package/dist/plugins/plugins/sequential-id/record/index.d.ts +0 -6
  150. package/dist/plugins/plugins/sequential-id/replay/index.d.ts +0 -7
  151. package/dist/plugins/record/iframe-manager.d.ts +0 -13
  152. package/dist/plugins/record/mutation.d.ts +0 -45
  153. package/dist/plugins/record/observer.d.ts +0 -11
  154. package/dist/plugins/record/observers/canvas/canvas-manager.d.ts +0 -32
  155. package/dist/plugins/record/observers/canvas/serialize-args.d.ts +0 -6
  156. package/dist/plugins/record/shadow-dom-manager.d.ts +0 -34
  157. package/dist/plugins/replay/canvas/2d.d.ts +0 -9
  158. package/dist/plugins/replay/canvas/webgl.d.ts +0 -11
  159. package/dist/plugins/replay/index.d.ts +0 -82
  160. package/dist/plugins/replay/machine.d.ts +0 -85
  161. package/dist/plugins/replay/smoothscroll.d.ts +0 -1
  162. package/dist/plugins/replay/styles/inject-style.d.ts +0 -2
  163. package/dist/plugins/replay/timer.d.ts +0 -19
  164. package/dist/plugins/replay/virtual-styles.d.ts +0 -43
  165. package/dist/plugins/rrdom/index.d.ts +0 -1
  166. package/dist/plugins/rrdom/tree-node.d.ts +0 -20
  167. package/dist/plugins/snapshot/css.d.ts +0 -92
  168. package/dist/plugins/snapshot/index.d.ts +0 -5
  169. package/dist/plugins/snapshot/rebuild.d.ts +0 -19
  170. package/dist/plugins/snapshot/snapshot.d.ts +0 -49
  171. package/dist/plugins/snapshot/types.d.ts +0 -99
  172. package/dist/plugins/snapshot/utils.d.ts +0 -11
  173. package/dist/plugins/utils.d.ts +0 -71
  174. package/dist/record/index.d.ts +0 -9
  175. package/dist/record/observer.d.ts +0 -11
  176. package/dist/record/observers/canvas/2d.d.ts +0 -2
  177. package/dist/record/observers/canvas/canvas.d.ts +0 -2
  178. package/dist/record/observers/canvas/serialize-args.d.ts +0 -6
  179. package/dist/record/observers/canvas/webgl.d.ts +0 -2
  180. package/dist/record/shadow-dom-manager.d.ts +0 -34
  181. package/dist/replay/canvas/index.d.ts +0 -9
  182. package/dist/replay/canvas/webgl.d.ts +0 -11
  183. package/dist/replay/virtual-styles.d.ts +0 -43
  184. package/dist/snapshot/css.d.ts +0 -92
  185. package/dist/snapshot/index.d.ts +0 -5
  186. package/dist/snapshot/rebuild.d.ts +0 -19
  187. package/dist/snapshot/snapshot.d.ts +0 -49
  188. package/dist/snapshot/types.d.ts +0 -99
  189. package/dist/snapshot/utils.d.ts +0 -11
  190. package/dist/types.d.ts +0 -509
  191. package/dist/utils.d.ts +0 -71
@@ -0,0 +1,43 @@
1
+ import type { throttleOptions, listenerHandler, hookResetter, blockClass, addedNodeMutation, DocumentDimension, IWindow, DeprecatedMirror, textMutation } from './types';
2
+ import type { IMirror, Mirror } from '@highlight-run/rrweb-snapshot';
3
+ import type { RRNode, RRIFrameElement } from '@highlight-run/rrdom/es/virtual-dom';
4
+ export declare function on(type: string, fn: EventListenerOrEventListenerObject, target?: Document | IWindow): listenerHandler;
5
+ export declare let _mirror: DeprecatedMirror;
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;
8
+ export declare function patch(source: {
9
+ [key: string]: any;
10
+ }, name: string, replacement: (...args: any[]) => any): () => void;
11
+ export declare function getWindowHeight(): number;
12
+ export declare function getWindowWidth(): number;
13
+ export declare const isCanvasNode: (node: Node | null) => boolean;
14
+ export declare function isBlocked(node: Node | null, blockClass: blockClass): boolean;
15
+ export declare function isSerialized(n: Node, mirror: Mirror): boolean;
16
+ export declare function isIgnored(n: Node, mirror: Mirror): boolean;
17
+ export declare function isAncestorRemoved(target: Node, mirror: Mirror): boolean;
18
+ export declare function isTouchEvent(event: MouseEvent | TouchEvent): event is TouchEvent;
19
+ export declare function polyfill(win?: Window & typeof globalThis): void;
20
+ declare type ResolveTree = {
21
+ value: addedNodeMutation;
22
+ children: ResolveTree[];
23
+ parent: ResolveTree | null;
24
+ };
25
+ export declare function queueToResolveTrees(queue: addedNodeMutation[]): ResolveTree[];
26
+ export declare function iterateResolveTree(tree: ResolveTree, cb: (mutation: addedNodeMutation) => unknown): void;
27
+ export declare type AppendedIframe = {
28
+ mutationInQueue: addedNodeMutation;
29
+ builtNode: HTMLIFrameElement | RRIFrameElement;
30
+ };
31
+ export declare function isSerializedIframe<TNode extends Node | RRNode>(n: TNode, mirror: IMirror<TNode>): boolean;
32
+ export declare function isSerializedStylesheet<TNode extends Node | RRNode>(n: TNode, mirror: IMirror<TNode>): boolean;
33
+ export declare function getBaseDimension(node: Node, rootIframe: Node): DocumentDimension;
34
+ export declare function hasShadowRoot<T extends Node | RRNode>(n: T): n is T & {
35
+ shadowRoot: ShadowRoot;
36
+ };
37
+ export declare function getNestedRule(rules: CSSRuleList, position: number[]): CSSGroupingRule;
38
+ export declare function getPositionsAndIndex(nestedIndex: number[]): {
39
+ positions: number[];
40
+ index: number | undefined;
41
+ };
42
+ export declare function uniqueTextMutations(mutations: textMutation[]): textMutation[];
43
+ 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>
package/README.zh_CN.md DELETED
@@ -1,122 +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
- **[rrweb 社区新的征程](http://www.myriptide.com/rrweb-community-cn/)**
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
- > 我已开通 Github Sponsor, 您可以通过赞助的形式帮助 rrweb 的开发。
18
-
19
- rrweb 是 'record and replay the web' 的简写,旨在利用现代浏览器所提供的强大 API 录制并回放任意 web 界面中的用户操作。
20
-
21
- ## 指南
22
-
23
- [**📚 rrweb 使用指南 📚**](./guide.zh_CN.md)
24
-
25
- [**🍳 场景示例 🍳**](./docs/recipes/index.zh_CN.md)
26
-
27
- ## 项目结构
28
-
29
- rrweb 主要由 3 部分组成:
30
-
31
- - **[rrweb-snapshot](https://github.com/rrweb-io/rrweb-snapshot)**,包含 snapshot 和 rebuild 两个功能。snapshot 用于将 DOM 及其状态转化为可序列化的数据结构并添加唯一标识;rebuild 则是将 snapshot 记录的数据结构重建为对应的 DOM。
32
- - **[rrweb](https://github.com/rrweb-io/rrweb)**,包含 record 和 replay 两个功能。record 用于记录 DOM 中的所有变更(mutation);replay 则是将记录的变更按照对应的时间一一重放。
33
- - **[rrweb-player](https://github.com/rrweb-io/rrweb-player)**,为 rrweb 提供一套 UI 控件,提供基于 GUI 的暂停、快进、拖拽至任意时间点播放等功能。
34
-
35
- ## Roadmap
36
-
37
- - rrdom: rrweb 数据专用的 DOM 实现 [#419](https://github.com/rrweb-io/rrweb/issues/419)
38
- - storage engine: 对大规模 rrweb 数据进行去重
39
- - 更多的 E2E 测试
40
- - 在常见场景下对 mutation 数据进行压缩
41
- - 基于新的插件 API 提供更多插件,包括:
42
- - XHR 插件
43
- - fetch 插件
44
- - GraphQL 插件
45
- - ...
46
-
47
- ## Internal Design
48
-
49
- - [序列化](./docs/serialization.zh_CN.md)
50
- - [增量快照](./docs/observer.zh_CN.md)
51
- - [回放](./docs/replay.zh_CN.md)
52
- - [沙盒](./docs/sandbox.zh_CN.md)
53
-
54
- ## Contribute Guide
55
-
56
- 为了保证录制和回放时可以对应到一致的数据结构,rrweb 采用 typescript 开发以提供更强的类型支持。
57
-
58
- [Typescript 手册](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html)
59
-
60
- 1. Fork 需要修改的 rrweb 组件仓库
61
- 2. `npm install` 安装所需依赖
62
- 3. 修改代码并通过测试
63
- 4. 提交代码,创建 pull request
64
-
65
- 除了添加集成测试和单元测试之外,rrweb 还提供了交互式的测试工具。
66
-
67
- [使用 REPL 工具](./guide.zh_CN.md#REPL-工具)
68
-
69
- ## Core Team Members
70
-
71
- <table>
72
- <tr>
73
- <td align="center">
74
- <a href="https://github.com/Yuyz0112">
75
- <img
76
- src="https://avatars.githubusercontent.com/u/13651389?s=100"
77
- width="100px;"
78
- alt=""
79
- />
80
- <br /><sub><b>Yuyz0112</b></sub>
81
- </a>
82
- </td>
83
- <td align="center">
84
- <a href="https://github.com/Mark-Fenng">
85
- <img
86
- src="https://avatars.githubusercontent.com/u/27533910?s=100"
87
- width="100px;"
88
- alt=""
89
- />
90
- <br /><sub><b>Mark-Fenng</b></sub>
91
- </a>
92
- </td>
93
- <td align="center">
94
- <a href="https://github.com/eoghanmurray">
95
- <img
96
- src="https://avatars.githubusercontent.com/u/156780?s=100"
97
- width="100px;"
98
- alt=""
99
- />
100
- <br /><sub><b>eoghanmurray</b></sub>
101
- </a>
102
- </td>
103
- <td align="center">
104
- <a href="https://github.com/Juice10">
105
- <img
106
- src="https://avatars.githubusercontent.com/u/4106?s=100"
107
- width="100px;"
108
- alt=""
109
- />
110
- <br /><sub><b>Juice10</b></sub>
111
- </a>
112
- </td>
113
- </tr>
114
- </table>
115
-
116
- ## Who's using rrweb
117
-
118
- <p align="center">
119
- <a href="http://www.smartx.com/" target="_blank">
120
- <img width="260px" src="https://www.rrweb.io/logos/smartx.png">
121
- </a>
122
- </p>
@@ -1,4 +0,0 @@
1
- export * from '../index';
2
- export * from '../packer';
3
- export * from '../plugins/console/record';
4
- export * from '../plugins/console/replay';
package/dist/index.css DELETED
@@ -1,82 +0,0 @@
1
- .replayer-wrapper {
2
- position: relative;
3
- }
4
- .replayer-mouse {
5
- position: absolute;
6
- width: 20px;
7
- height: 20px;
8
- transition: left 0.05s linear, top 0.05s linear;
9
- background-size: contain;
10
- background-position: center center;
11
- background-repeat: no-repeat;
12
- background-image: url('data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCINCgkgdmlld0JveD0iNyA1IDE4IDE4IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAyOCAyOCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgaGVpZ2h0PSIzMDBweCIgd2lkdGg9IjMwMHB4Ij4NCjxwb2x5Z29uIGZpbGw9IiNGRkZGRkYiIHBvaW50cz0iOC4yLDIwLjkgOC4yLDQuOSAxOS44LDE2LjUgMTMsMTYuNSAxMi42LDE2LjYgIi8+DQo8cG9seWdvbiBmaWxsPSIjRkZGRkZGIiBwb2ludHM9IjE3LjMsMjEuNiAxMy43LDIzLjEgOSwxMiAxMi43LDEwLjUgIi8+DQo8cmVjdCB4PSIxMi41IiB5PSIxMy42IiB0cmFuc2Zvcm09Im1hdHJpeCgwLjkyMjEgLTAuMzg3MSAwLjM4NzEgMC45MjIxIC01Ljc2MDUgNi41OTA5KSIgd2lkdGg9IjIiIGhlaWdodD0iOCIvPg0KPHBvbHlnb24gcG9pbnRzPSI5LjIsNy4zIDkuMiwxOC41IDEyLjIsMTUuNiAxMi42LDE1LjUgMTcuNCwxNS41ICIvPg0KPC9zdmc+DQo=');
13
- border-color: transparent; /* otherwise we transition from black when .touch-device class is added */
14
- }
15
-
16
- .replayer-mouse::after {
17
- background: transparent;
18
- }
19
-
20
- .replayer-mouse.active::after {
21
- animation: click 0.2s ease-in-out 1;
22
- }
23
- .replayer-mouse.touch-device {
24
- background-image: none; /* there's no passive cursor on touch-only screens */
25
- width: 70px;
26
- height: 70px;
27
- border-width: 4px;
28
- border-style: solid;
29
- border-radius: 100%;
30
- margin-left: -37px;
31
- margin-top: -37px;
32
- border-color: rgba(73, 80, 246, 0);
33
- transition: left 0s linear, top 0s linear, border-color 0.2s ease-in-out;
34
- }
35
- .replayer-mouse.touch-device.touch-active {
36
- border-color: rgba(73, 80, 246, 1);
37
- transition: left 0.25s linear, top 0.25s linear, border-color 0.2s ease-in-out;
38
- }
39
- .replayer-mouse.touch-device::after {
40
- opacity: 0; /* there's no passive cursor on touch-only screens */
41
- }
42
- .replayer-mouse.touch-device.active::after {
43
- animation: touch-click 0.2s ease-in-out 1;
44
- }
45
- .replayer-mouse-tail {
46
- position: absolute;
47
- pointer-events: none;
48
- }
49
-
50
- @keyframes click {
51
- 0% {
52
- opacity: 0.3;
53
- width: 20px;
54
- height: 20px;
55
- background: transparent;
56
- }
57
- 75% {
58
- width: 24px;
59
- height: 24px;
60
- opacity: 0.8;
61
- background: #dc2626;
62
- }
63
- 100% {
64
- background: transparent;
65
- }
66
- }
67
-
68
- @keyframes touch-click {
69
- 0% {
70
- opacity: 0;
71
- width: 20px;
72
- height: 20px;
73
- }
74
- 50% {
75
- opacity: 0.5;
76
- width: 10px;
77
- height: 10px;
78
- }
79
- }
80
-
81
-
82
- /*# sourceMappingURL=index.css.map*/
@@ -1 +0,0 @@
1
- {"version":3,"sources":["webpack://highlightLib/./src/replay/styles/style.css"],"names":[],"mappings":"AAAA;EACE,kBAAkB;AACpB;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,+CAA+C;EAC/C,wBAAwB;EACxB,kCAAkC;EAClC,4BAA4B;EAC5B,uzBAAuzB;EACvzB,yBAAyB,EAAE,yEAAyE;AACtG;;AAEA;EACE,uBAAuB;AACzB;;AAEA;EACE,mCAAmC;AACrC;AACA;EACE,sBAAsB,EAAE,oDAAoD;EAC5E,WAAW;EACX,YAAY;EACZ,iBAAiB;EACjB,mBAAmB;EACnB,mBAAmB;EACnB,kBAAkB;EAClB,iBAAiB;EACjB,kCAAkC;EAClC,wEAAwE;AAC1E;AACA;EACE,kCAAkC;EAClC,8EAA8E;AAChF;AACA;EACE,UAAU,EAAE,oDAAoD;AAClE;AACA;EACE,yCAAyC;AAC3C;AACA;EACE,kBAAkB;EAClB,oBAAoB;AACtB;;AAEA;EACE;IACE,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,uBAAuB;EACzB;EACA;IACE,WAAW;IACX,YAAY;IACZ,YAAY;IACZ,mBAAmB;EACrB;EACA;IACE,uBAAuB;EACzB;AACF;;AAEA;EACE;IACE,UAAU;IACV,WAAW;IACX,YAAY;EACd;EACA;IACE,YAAY;IACZ,WAAW;IACX,YAAY;EACd;AACF","file":"index.css","sourcesContent":[".replayer-wrapper {\n position: relative;\n}\n.replayer-mouse {\n position: absolute;\n width: 20px;\n height: 20px;\n transition: left 0.05s linear, top 0.05s linear;\n background-size: contain;\n background-position: center center;\n background-repeat: no-repeat;\n background-image: url('data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCINCgkgdmlld0JveD0iNyA1IDE4IDE4IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAyOCAyOCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgaGVpZ2h0PSIzMDBweCIgd2lkdGg9IjMwMHB4Ij4NCjxwb2x5Z29uIGZpbGw9IiNGRkZGRkYiIHBvaW50cz0iOC4yLDIwLjkgOC4yLDQuOSAxOS44LDE2LjUgMTMsMTYuNSAxMi42LDE2LjYgIi8+DQo8cG9seWdvbiBmaWxsPSIjRkZGRkZGIiBwb2ludHM9IjE3LjMsMjEuNiAxMy43LDIzLjEgOSwxMiAxMi43LDEwLjUgIi8+DQo8cmVjdCB4PSIxMi41IiB5PSIxMy42IiB0cmFuc2Zvcm09Im1hdHJpeCgwLjkyMjEgLTAuMzg3MSAwLjM4NzEgMC45MjIxIC01Ljc2MDUgNi41OTA5KSIgd2lkdGg9IjIiIGhlaWdodD0iOCIvPg0KPHBvbHlnb24gcG9pbnRzPSI5LjIsNy4zIDkuMiwxOC41IDEyLjIsMTUuNiAxMi42LDE1LjUgMTcuNCwxNS41ICIvPg0KPC9zdmc+DQo=');\n border-color: transparent; /* otherwise we transition from black when .touch-device class is added */\n}\n\n.replayer-mouse::after {\n background: transparent;\n}\n\n.replayer-mouse.active::after {\n animation: click 0.2s ease-in-out 1;\n}\n.replayer-mouse.touch-device {\n background-image: none; /* there's no passive cursor on touch-only screens */\n width: 70px;\n height: 70px;\n border-width: 4px;\n border-style: solid;\n border-radius: 100%;\n margin-left: -37px;\n margin-top: -37px;\n border-color: rgba(73, 80, 246, 0);\n transition: left 0s linear, top 0s linear, border-color 0.2s ease-in-out;\n}\n.replayer-mouse.touch-device.touch-active {\n border-color: rgba(73, 80, 246, 1);\n transition: left 0.25s linear, top 0.25s linear, border-color 0.2s ease-in-out;\n}\n.replayer-mouse.touch-device::after {\n opacity: 0; /* there's no passive cursor on touch-only screens */\n}\n.replayer-mouse.touch-device.active::after {\n animation: touch-click 0.2s ease-in-out 1;\n}\n.replayer-mouse-tail {\n position: absolute;\n pointer-events: none;\n}\n\n@keyframes click {\n 0% {\n opacity: 0.3;\n width: 20px;\n height: 20px;\n background: transparent;\n }\n 75% {\n width: 24px;\n height: 24px;\n opacity: 0.8;\n background: #dc2626;\n }\n 100% {\n background: transparent;\n }\n}\n\n@keyframes touch-click {\n 0% {\n opacity: 0;\n width: 20px;\n height: 20px;\n }\n 50% {\n opacity: 0.5;\n width: 10px;\n height: 10px;\n }\n}\n"],"sourceRoot":""}