@appsurify-testmap/rrweb-snapshot 2.1.3-alpha.4 → 3.1.1-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.cts +29 -6
- package/dist/index.d.ts +29 -6
- package/dist/rrweb-snapshot.cjs +3140 -1521
- package/dist/rrweb-snapshot.cjs.map +1 -1
- package/dist/rrweb-snapshot.js +3087 -1468
- package/dist/rrweb-snapshot.js.map +1 -1
- package/dist/rrweb-snapshot.umd.cjs +3248 -1600
- package/dist/rrweb-snapshot.umd.cjs.map +4 -4
- package/dist/rrweb-snapshot.umd.min.cjs +30 -31
- package/dist/rrweb-snapshot.umd.min.cjs.map +4 -4
- package/package.json +5 -3
package/dist/index.d.cts
CHANGED
|
@@ -21,10 +21,6 @@ export declare function buildNodeWithSN(n: serializedNodeWithId, options: {
|
|
|
21
21
|
cache: BuildCache;
|
|
22
22
|
}): Node | null;
|
|
23
23
|
|
|
24
|
-
export declare function buildSelector(node: Node): string | null;
|
|
25
|
-
|
|
26
|
-
export declare function buildXPath(node: Node): string;
|
|
27
|
-
|
|
28
24
|
export declare function classMatchesRegex(node: Node | null, regex: RegExp, checkAncestors: boolean): boolean;
|
|
29
25
|
|
|
30
26
|
export declare function cleanupSnapshot(): void;
|
|
@@ -82,7 +78,7 @@ export declare function isElementInteractive(n: Node): boolean;
|
|
|
82
78
|
|
|
83
79
|
export declare function isElementVisible(el: Element): boolean;
|
|
84
80
|
|
|
85
|
-
export declare function isExcludeAttribute(name: string, exclude: string | RegExp): boolean;
|
|
81
|
+
export declare function isExcludeAttribute(name: string, exclude: string | RegExp | undefined): boolean;
|
|
86
82
|
|
|
87
83
|
export declare function isNativeShadowDom(shadowRoot: ShadowRoot): boolean;
|
|
88
84
|
|
|
@@ -131,6 +127,7 @@ export declare type MaskTextFn = (text: string, element: HTMLElement | null) =>
|
|
|
131
127
|
export declare class Mirror implements IMirror<Node> {
|
|
132
128
|
private idNodeMap;
|
|
133
129
|
private nodeMetaMap;
|
|
130
|
+
private selectorNodeMap;
|
|
134
131
|
getId(n: Node | undefined | null): number;
|
|
135
132
|
getNode(id: number): Node | null;
|
|
136
133
|
getIds(): number[];
|
|
@@ -141,6 +138,9 @@ export declare class Mirror implements IMirror<Node> {
|
|
|
141
138
|
add(n: Node, meta: serializedNodeWithId): void;
|
|
142
139
|
replace(id: number, n: Node): void;
|
|
143
140
|
reset(): void;
|
|
141
|
+
getNodeBySelector(selector: string): Node | null;
|
|
142
|
+
getNodesBySelector(selector: string): Node[];
|
|
143
|
+
hasSelector(selector: string): boolean;
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
export declare function needMaskingText(node: Node, maskTextClass: string | RegExp, maskTextSelector: string | null, checkAncestors: boolean): boolean;
|
|
@@ -158,6 +158,13 @@ export declare function rebuild(n: serializedNodeWithId, options: {
|
|
|
158
158
|
mirror: Mirror;
|
|
159
159
|
}): Node | null;
|
|
160
160
|
|
|
161
|
+
export declare type SelectorOptions = {
|
|
162
|
+
preferShortPath?: boolean;
|
|
163
|
+
useLevel4?: boolean;
|
|
164
|
+
includeDataAttributes?: boolean;
|
|
165
|
+
includeAriaAttributes?: boolean;
|
|
166
|
+
};
|
|
167
|
+
|
|
161
168
|
export declare function serializeNodeWithId(n: Node, options: {
|
|
162
169
|
doc: Document;
|
|
163
170
|
mirror: Mirror;
|
|
@@ -165,7 +172,7 @@ export declare function serializeNodeWithId(n: Node, options: {
|
|
|
165
172
|
blockSelector: string | null;
|
|
166
173
|
maskTextClass: string | RegExp;
|
|
167
174
|
maskTextSelector: string | null;
|
|
168
|
-
excludeAttribute
|
|
175
|
+
excludeAttribute?: string | RegExp;
|
|
169
176
|
skipChild: boolean;
|
|
170
177
|
inlineStylesheet: boolean;
|
|
171
178
|
newlyAddedElement?: boolean;
|
|
@@ -185,6 +192,11 @@ export declare function serializeNodeWithId(n: Node, options: {
|
|
|
185
192
|
onStylesheetLoad?: (linkNode: HTMLLinkElement, node: serializedElementNodeWithId) => unknown;
|
|
186
193
|
stylesheetLoadTimeout?: number;
|
|
187
194
|
cssCaptured?: boolean;
|
|
195
|
+
selectorOptions?: {
|
|
196
|
+
maxPathDepth: number;
|
|
197
|
+
enableSvgFingerprint?: boolean;
|
|
198
|
+
fallbackToBody?: boolean;
|
|
199
|
+
} | null;
|
|
188
200
|
}): serializedNodeWithId | null;
|
|
189
201
|
|
|
190
202
|
export declare type SlimDOMOptions = Partial<{
|
|
@@ -223,6 +235,12 @@ export declare function snapshot(n: Document, options?: {
|
|
|
223
235
|
onStylesheetLoad?: (linkNode: HTMLLinkElement, node: serializedElementNodeWithId) => unknown;
|
|
224
236
|
stylesheetLoadTimeout?: number;
|
|
225
237
|
keepIframeSrcFn?: KeepIframeSrcFn;
|
|
238
|
+
selector?: boolean | {
|
|
239
|
+
maxPathDepth?: number;
|
|
240
|
+
enableSvgFingerprint?: boolean;
|
|
241
|
+
confidenceThreshold?: number;
|
|
242
|
+
fallbackToBody?: boolean;
|
|
243
|
+
};
|
|
226
244
|
}): serializedNodeWithId | null;
|
|
227
245
|
|
|
228
246
|
export declare function splitCssText(cssText: string, style: HTMLStyleElement, _testNoPxNorm?: boolean): string[];
|
|
@@ -241,4 +259,9 @@ export declare function transformAttribute(doc: Document, tagName: Lowercase<str
|
|
|
241
259
|
|
|
242
260
|
export declare function visitSnapshot(node: serializedNodeWithId, onVisit: (node: serializedNodeWithId) => unknown): void;
|
|
243
261
|
|
|
262
|
+
export declare type XPathOptions = {
|
|
263
|
+
preferShortPath?: boolean;
|
|
264
|
+
includeNamespaces?: boolean;
|
|
265
|
+
};
|
|
266
|
+
|
|
244
267
|
export { }
|
package/dist/index.d.ts
CHANGED
|
@@ -21,10 +21,6 @@ export declare function buildNodeWithSN(n: serializedNodeWithId, options: {
|
|
|
21
21
|
cache: BuildCache;
|
|
22
22
|
}): Node | null;
|
|
23
23
|
|
|
24
|
-
export declare function buildSelector(node: Node): string | null;
|
|
25
|
-
|
|
26
|
-
export declare function buildXPath(node: Node): string;
|
|
27
|
-
|
|
28
24
|
export declare function classMatchesRegex(node: Node | null, regex: RegExp, checkAncestors: boolean): boolean;
|
|
29
25
|
|
|
30
26
|
export declare function cleanupSnapshot(): void;
|
|
@@ -82,7 +78,7 @@ export declare function isElementInteractive(n: Node): boolean;
|
|
|
82
78
|
|
|
83
79
|
export declare function isElementVisible(el: Element): boolean;
|
|
84
80
|
|
|
85
|
-
export declare function isExcludeAttribute(name: string, exclude: string | RegExp): boolean;
|
|
81
|
+
export declare function isExcludeAttribute(name: string, exclude: string | RegExp | undefined): boolean;
|
|
86
82
|
|
|
87
83
|
export declare function isNativeShadowDom(shadowRoot: ShadowRoot): boolean;
|
|
88
84
|
|
|
@@ -131,6 +127,7 @@ export declare type MaskTextFn = (text: string, element: HTMLElement | null) =>
|
|
|
131
127
|
export declare class Mirror implements IMirror<Node> {
|
|
132
128
|
private idNodeMap;
|
|
133
129
|
private nodeMetaMap;
|
|
130
|
+
private selectorNodeMap;
|
|
134
131
|
getId(n: Node | undefined | null): number;
|
|
135
132
|
getNode(id: number): Node | null;
|
|
136
133
|
getIds(): number[];
|
|
@@ -141,6 +138,9 @@ export declare class Mirror implements IMirror<Node> {
|
|
|
141
138
|
add(n: Node, meta: serializedNodeWithId): void;
|
|
142
139
|
replace(id: number, n: Node): void;
|
|
143
140
|
reset(): void;
|
|
141
|
+
getNodeBySelector(selector: string): Node | null;
|
|
142
|
+
getNodesBySelector(selector: string): Node[];
|
|
143
|
+
hasSelector(selector: string): boolean;
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
export declare function needMaskingText(node: Node, maskTextClass: string | RegExp, maskTextSelector: string | null, checkAncestors: boolean): boolean;
|
|
@@ -158,6 +158,13 @@ export declare function rebuild(n: serializedNodeWithId, options: {
|
|
|
158
158
|
mirror: Mirror;
|
|
159
159
|
}): Node | null;
|
|
160
160
|
|
|
161
|
+
export declare type SelectorOptions = {
|
|
162
|
+
preferShortPath?: boolean;
|
|
163
|
+
useLevel4?: boolean;
|
|
164
|
+
includeDataAttributes?: boolean;
|
|
165
|
+
includeAriaAttributes?: boolean;
|
|
166
|
+
};
|
|
167
|
+
|
|
161
168
|
export declare function serializeNodeWithId(n: Node, options: {
|
|
162
169
|
doc: Document;
|
|
163
170
|
mirror: Mirror;
|
|
@@ -165,7 +172,7 @@ export declare function serializeNodeWithId(n: Node, options: {
|
|
|
165
172
|
blockSelector: string | null;
|
|
166
173
|
maskTextClass: string | RegExp;
|
|
167
174
|
maskTextSelector: string | null;
|
|
168
|
-
excludeAttribute
|
|
175
|
+
excludeAttribute?: string | RegExp;
|
|
169
176
|
skipChild: boolean;
|
|
170
177
|
inlineStylesheet: boolean;
|
|
171
178
|
newlyAddedElement?: boolean;
|
|
@@ -185,6 +192,11 @@ export declare function serializeNodeWithId(n: Node, options: {
|
|
|
185
192
|
onStylesheetLoad?: (linkNode: HTMLLinkElement, node: serializedElementNodeWithId) => unknown;
|
|
186
193
|
stylesheetLoadTimeout?: number;
|
|
187
194
|
cssCaptured?: boolean;
|
|
195
|
+
selectorOptions?: {
|
|
196
|
+
maxPathDepth: number;
|
|
197
|
+
enableSvgFingerprint?: boolean;
|
|
198
|
+
fallbackToBody?: boolean;
|
|
199
|
+
} | null;
|
|
188
200
|
}): serializedNodeWithId | null;
|
|
189
201
|
|
|
190
202
|
export declare type SlimDOMOptions = Partial<{
|
|
@@ -223,6 +235,12 @@ export declare function snapshot(n: Document, options?: {
|
|
|
223
235
|
onStylesheetLoad?: (linkNode: HTMLLinkElement, node: serializedElementNodeWithId) => unknown;
|
|
224
236
|
stylesheetLoadTimeout?: number;
|
|
225
237
|
keepIframeSrcFn?: KeepIframeSrcFn;
|
|
238
|
+
selector?: boolean | {
|
|
239
|
+
maxPathDepth?: number;
|
|
240
|
+
enableSvgFingerprint?: boolean;
|
|
241
|
+
confidenceThreshold?: number;
|
|
242
|
+
fallbackToBody?: boolean;
|
|
243
|
+
};
|
|
226
244
|
}): serializedNodeWithId | null;
|
|
227
245
|
|
|
228
246
|
export declare function splitCssText(cssText: string, style: HTMLStyleElement, _testNoPxNorm?: boolean): string[];
|
|
@@ -241,4 +259,9 @@ export declare function transformAttribute(doc: Document, tagName: Lowercase<str
|
|
|
241
259
|
|
|
242
260
|
export declare function visitSnapshot(node: serializedNodeWithId, onVisit: (node: serializedNodeWithId) => unknown): void;
|
|
243
261
|
|
|
262
|
+
export declare type XPathOptions = {
|
|
263
|
+
preferShortPath?: boolean;
|
|
264
|
+
includeNamespaces?: boolean;
|
|
265
|
+
};
|
|
266
|
+
|
|
244
267
|
export { }
|