@posthog/rrweb-snapshot 0.0.54 → 0.0.55
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/record-BhFABPFv.js +1016 -0
- package/dist/record-BhFABPFv.js.map +1 -0
- package/dist/record-Rc5ocxPN.cjs +1015 -0
- package/dist/record-Rc5ocxPN.cjs.map +1 -0
- package/dist/record-Rc5ocxPN.umd.cjs +1593 -0
- package/dist/record-Rc5ocxPN.umd.cjs.map +7 -0
- package/dist/record-Rc5ocxPN.umd.min.cjs +20 -0
- package/dist/record-Rc5ocxPN.umd.min.cjs.map +7 -0
- package/dist/record.cjs +13 -1012
- package/dist/record.cjs.map +1 -1
- package/dist/record.d.cts +273 -5
- package/dist/record.d.ts +273 -5
- package/dist/record.js +29 -1029
- package/dist/record.js.map +1 -1
- package/dist/record.umd.cjs +976 -955
- package/dist/record.umd.cjs.map +3 -3
- package/dist/record.umd.min.cjs +1 -1
- package/dist/record.umd.min.cjs.map +4 -4
- package/dist/replay.d.cts +219 -5
- package/dist/replay.d.ts +219 -5
- package/dist/rrweb-snapshot.cjs +1 -1
- package/dist/rrweb-snapshot.d.cts +299 -1
- package/dist/rrweb-snapshot.d.ts +299 -1
- package/dist/rrweb-snapshot.js +26 -26
- package/dist/rrweb-snapshot.umd.cjs +4 -26
- package/dist/rrweb-snapshot.umd.cjs.map +2 -2
- package/dist/rrweb-snapshot.umd.min.cjs +10 -10
- package/dist/rrweb-snapshot.umd.min.cjs.map +2 -2
- package/package.json +3 -3
- package/dist/css.d.cts +0 -5
- package/dist/css.d.ts +0 -5
- package/dist/index.d.cts +0 -6
- package/dist/index.d.ts +0 -6
- package/dist/rebuild.d.cts +0 -23
- package/dist/rebuild.d.ts +0 -23
- package/dist/snapshot.d.cts +0 -71
- package/dist/snapshot.d.ts +0 -71
- package/dist/types.d.cts +0 -103
- package/dist/types.d.ts +0 -103
- package/dist/utils.d.cts +0 -51
- package/dist/utils.d.ts +0 -51
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@posthog/rrweb-snapshot",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.55",
|
|
4
4
|
"description": "rrweb's component to take a snapshot of DOM, aka DOM serializer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"vite": "^6.2.0",
|
|
61
61
|
"vite-plugin-dts": "^3.9.1",
|
|
62
62
|
"vitest": "^1.4.0",
|
|
63
|
-
"@posthog/rrweb-types": "0.0.
|
|
64
|
-
"@posthog/rrweb-utils": "0.0.
|
|
63
|
+
"@posthog/rrweb-types": "0.0.55",
|
|
64
|
+
"@posthog/rrweb-utils": "0.0.55"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@types/postcss-safe-parser": "^5.0.4",
|
package/dist/css.d.cts
DELETED
package/dist/css.d.ts
DELETED
package/dist/index.d.cts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { default as snapshot, serializeNodeWithId, transformAttribute, ignoreAttribute, visitSnapshot, cleanupSnapshot, needMaskingText, classMatchesRegex, slimDOMDefaults, IGNORED_NODE, DEFAULT_MAX_DEPTH, wasMaxDepthReached, resetMaxDepthState, genId } from './snapshot';
|
|
2
|
-
import { default as rebuild, buildNodeWithSN, adaptCssForReplay, createCache } from './rebuild';
|
|
3
|
-
|
|
4
|
-
export * from './types';
|
|
5
|
-
export * from './utils';
|
|
6
|
-
export { snapshot, serializeNodeWithId, rebuild, buildNodeWithSN, adaptCssForReplay, createCache, transformAttribute, ignoreAttribute, visitSnapshot, cleanupSnapshot, needMaskingText, classMatchesRegex, slimDOMDefaults, IGNORED_NODE, DEFAULT_MAX_DEPTH, wasMaxDepthReached, resetMaxDepthState, genId, };
|
package/dist/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { default as snapshot, serializeNodeWithId, transformAttribute, ignoreAttribute, visitSnapshot, cleanupSnapshot, needMaskingText, classMatchesRegex, slimDOMDefaults, IGNORED_NODE, DEFAULT_MAX_DEPTH, wasMaxDepthReached, resetMaxDepthState, genId } from './snapshot';
|
|
2
|
-
import { default as rebuild, buildNodeWithSN, adaptCssForReplay, createCache } from './rebuild';
|
|
3
|
-
|
|
4
|
-
export * from './types';
|
|
5
|
-
export * from './utils';
|
|
6
|
-
export { snapshot, serializeNodeWithId, rebuild, buildNodeWithSN, adaptCssForReplay, createCache, transformAttribute, ignoreAttribute, visitSnapshot, cleanupSnapshot, needMaskingText, classMatchesRegex, slimDOMDefaults, IGNORED_NODE, DEFAULT_MAX_DEPTH, wasMaxDepthReached, resetMaxDepthState, genId, };
|
package/dist/rebuild.d.cts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { serializedNodeWithId } from '@posthog/rrweb-types';
|
|
2
|
-
import { BuildCache } from './types';
|
|
3
|
-
import { Mirror } from './utils';
|
|
4
|
-
|
|
5
|
-
export declare function adaptCssForReplay(cssText: string, cache: BuildCache): string;
|
|
6
|
-
export declare function createCache(): BuildCache;
|
|
7
|
-
export declare function buildNodeWithSN(n: serializedNodeWithId, options: {
|
|
8
|
-
doc: Document;
|
|
9
|
-
mirror: Mirror;
|
|
10
|
-
skipChild?: boolean;
|
|
11
|
-
hackCss: boolean;
|
|
12
|
-
afterAppend?: (n: Node, id: number) => unknown;
|
|
13
|
-
cache: BuildCache;
|
|
14
|
-
}): Node | null;
|
|
15
|
-
declare function rebuild(n: serializedNodeWithId, options: {
|
|
16
|
-
doc: Document;
|
|
17
|
-
onVisit?: (node: Node) => unknown;
|
|
18
|
-
hackCss?: boolean;
|
|
19
|
-
afterAppend?: (n: Node, id: number) => unknown;
|
|
20
|
-
cache: BuildCache;
|
|
21
|
-
mirror: Mirror;
|
|
22
|
-
}): Node | null;
|
|
23
|
-
export default rebuild;
|
package/dist/rebuild.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { serializedNodeWithId } from '@posthog/rrweb-types';
|
|
2
|
-
import { BuildCache } from './types';
|
|
3
|
-
import { Mirror } from './utils';
|
|
4
|
-
|
|
5
|
-
export declare function adaptCssForReplay(cssText: string, cache: BuildCache): string;
|
|
6
|
-
export declare function createCache(): BuildCache;
|
|
7
|
-
export declare function buildNodeWithSN(n: serializedNodeWithId, options: {
|
|
8
|
-
doc: Document;
|
|
9
|
-
mirror: Mirror;
|
|
10
|
-
skipChild?: boolean;
|
|
11
|
-
hackCss: boolean;
|
|
12
|
-
afterAppend?: (n: Node, id: number) => unknown;
|
|
13
|
-
cache: BuildCache;
|
|
14
|
-
}): Node | null;
|
|
15
|
-
declare function rebuild(n: serializedNodeWithId, options: {
|
|
16
|
-
doc: Document;
|
|
17
|
-
onVisit?: (node: Node) => unknown;
|
|
18
|
-
hackCss?: boolean;
|
|
19
|
-
afterAppend?: (n: Node, id: number) => unknown;
|
|
20
|
-
cache: BuildCache;
|
|
21
|
-
mirror: Mirror;
|
|
22
|
-
}): Node | null;
|
|
23
|
-
export default rebuild;
|
package/dist/snapshot.d.cts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { MaskInputOptions, SlimDOMOptions, MaskTextFn, MaskInputFn, KeepIframeSrcFn } from './types';
|
|
2
|
-
import { serializedNodeWithId, serializedElementNodeWithId, DataURLOptions } from '@posthog/rrweb-types';
|
|
3
|
-
import { Mirror } from './utils';
|
|
4
|
-
|
|
5
|
-
export declare const IGNORED_NODE = -2;
|
|
6
|
-
export declare function genId(): number;
|
|
7
|
-
export declare function absoluteToDoc(doc: Document, attributeValue: string): string;
|
|
8
|
-
export declare function transformAttribute(doc: Document, tagName: Lowercase<string>, name: Lowercase<string>, value: string | null, element?: HTMLElement, dataURLOptions?: DataURLOptions): string | null;
|
|
9
|
-
export declare function ignoreAttribute(tagName: string, name: string, _value: unknown): boolean;
|
|
10
|
-
export declare function _isBlockedElement(element: HTMLElement, blockClass: string | RegExp, blockSelector: string | null): boolean;
|
|
11
|
-
export declare function classMatchesRegex(node: Node | null, regex: RegExp, checkAncestors: boolean): boolean;
|
|
12
|
-
export declare function needMaskingText(node: Node, maskTextClass: string | RegExp, maskTextSelector: string | null, checkAncestors: boolean): boolean;
|
|
13
|
-
export declare const DEFAULT_MAX_DEPTH = 50;
|
|
14
|
-
export declare function wasMaxDepthReached(): boolean;
|
|
15
|
-
export declare function resetMaxDepthState(): void;
|
|
16
|
-
export declare function serializeNodeWithId(n: Node, options: {
|
|
17
|
-
doc: Document;
|
|
18
|
-
mirror: Mirror;
|
|
19
|
-
blockClass: string | RegExp;
|
|
20
|
-
blockSelector: string | null;
|
|
21
|
-
maskTextClass: string | RegExp;
|
|
22
|
-
maskTextSelector: string | null;
|
|
23
|
-
skipChild: boolean;
|
|
24
|
-
inlineStylesheet: boolean;
|
|
25
|
-
newlyAddedElement?: boolean;
|
|
26
|
-
maskInputOptions?: MaskInputOptions;
|
|
27
|
-
needsMask?: boolean;
|
|
28
|
-
maskTextFn: MaskTextFn | undefined;
|
|
29
|
-
maskInputFn: MaskInputFn | undefined;
|
|
30
|
-
slimDOMOptions: SlimDOMOptions;
|
|
31
|
-
dataURLOptions?: DataURLOptions;
|
|
32
|
-
keepIframeSrcFn?: KeepIframeSrcFn;
|
|
33
|
-
inlineImages?: boolean;
|
|
34
|
-
recordCanvas?: boolean;
|
|
35
|
-
preserveWhiteSpace?: boolean;
|
|
36
|
-
onSerialize?: (n: Node) => unknown;
|
|
37
|
-
onIframeLoad?: (iframeNode: HTMLIFrameElement, node: serializedElementNodeWithId) => unknown;
|
|
38
|
-
iframeLoadTimeout?: number;
|
|
39
|
-
onStylesheetLoad?: (linkNode: HTMLLinkElement, node: serializedElementNodeWithId) => unknown;
|
|
40
|
-
stylesheetLoadTimeout?: number;
|
|
41
|
-
depth?: number;
|
|
42
|
-
maxDepth?: number;
|
|
43
|
-
onMaxDepthReached?: () => void;
|
|
44
|
-
}): serializedNodeWithId | null;
|
|
45
|
-
export declare function slimDOMDefaults(slimDOM: 'all' | boolean | SlimDOMOptions): SlimDOMOptions;
|
|
46
|
-
declare function snapshot(n: Document, options?: {
|
|
47
|
-
mirror?: Mirror;
|
|
48
|
-
blockClass?: string | RegExp;
|
|
49
|
-
blockSelector?: string | null;
|
|
50
|
-
maskTextClass?: string | RegExp;
|
|
51
|
-
maskTextSelector?: string | null;
|
|
52
|
-
inlineStylesheet?: boolean;
|
|
53
|
-
maskAllInputs?: boolean | MaskInputOptions;
|
|
54
|
-
maskTextFn?: MaskTextFn;
|
|
55
|
-
maskInputFn?: MaskInputFn;
|
|
56
|
-
slimDOM?: 'all' | boolean | SlimDOMOptions;
|
|
57
|
-
dataURLOptions?: DataURLOptions;
|
|
58
|
-
inlineImages?: boolean;
|
|
59
|
-
recordCanvas?: boolean;
|
|
60
|
-
preserveWhiteSpace?: boolean;
|
|
61
|
-
onSerialize?: (n: Node) => unknown;
|
|
62
|
-
onIframeLoad?: (iframeNode: HTMLIFrameElement, node: serializedElementNodeWithId) => unknown;
|
|
63
|
-
iframeLoadTimeout?: number;
|
|
64
|
-
onStylesheetLoad?: (linkNode: HTMLLinkElement, node: serializedElementNodeWithId) => unknown;
|
|
65
|
-
stylesheetLoadTimeout?: number;
|
|
66
|
-
keepIframeSrcFn?: KeepIframeSrcFn;
|
|
67
|
-
maxDepth?: number;
|
|
68
|
-
}): serializedNodeWithId | null;
|
|
69
|
-
export declare function visitSnapshot(node: serializedNodeWithId, onVisit: (node: serializedNodeWithId) => unknown): void;
|
|
70
|
-
export declare function cleanupSnapshot(): void;
|
|
71
|
-
export default snapshot;
|
package/dist/snapshot.d.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { MaskInputOptions, SlimDOMOptions, MaskTextFn, MaskInputFn, KeepIframeSrcFn } from './types';
|
|
2
|
-
import { serializedNodeWithId, serializedElementNodeWithId, DataURLOptions } from '@posthog/rrweb-types';
|
|
3
|
-
import { Mirror } from './utils';
|
|
4
|
-
|
|
5
|
-
export declare const IGNORED_NODE = -2;
|
|
6
|
-
export declare function genId(): number;
|
|
7
|
-
export declare function absoluteToDoc(doc: Document, attributeValue: string): string;
|
|
8
|
-
export declare function transformAttribute(doc: Document, tagName: Lowercase<string>, name: Lowercase<string>, value: string | null, element?: HTMLElement, dataURLOptions?: DataURLOptions): string | null;
|
|
9
|
-
export declare function ignoreAttribute(tagName: string, name: string, _value: unknown): boolean;
|
|
10
|
-
export declare function _isBlockedElement(element: HTMLElement, blockClass: string | RegExp, blockSelector: string | null): boolean;
|
|
11
|
-
export declare function classMatchesRegex(node: Node | null, regex: RegExp, checkAncestors: boolean): boolean;
|
|
12
|
-
export declare function needMaskingText(node: Node, maskTextClass: string | RegExp, maskTextSelector: string | null, checkAncestors: boolean): boolean;
|
|
13
|
-
export declare const DEFAULT_MAX_DEPTH = 50;
|
|
14
|
-
export declare function wasMaxDepthReached(): boolean;
|
|
15
|
-
export declare function resetMaxDepthState(): void;
|
|
16
|
-
export declare function serializeNodeWithId(n: Node, options: {
|
|
17
|
-
doc: Document;
|
|
18
|
-
mirror: Mirror;
|
|
19
|
-
blockClass: string | RegExp;
|
|
20
|
-
blockSelector: string | null;
|
|
21
|
-
maskTextClass: string | RegExp;
|
|
22
|
-
maskTextSelector: string | null;
|
|
23
|
-
skipChild: boolean;
|
|
24
|
-
inlineStylesheet: boolean;
|
|
25
|
-
newlyAddedElement?: boolean;
|
|
26
|
-
maskInputOptions?: MaskInputOptions;
|
|
27
|
-
needsMask?: boolean;
|
|
28
|
-
maskTextFn: MaskTextFn | undefined;
|
|
29
|
-
maskInputFn: MaskInputFn | undefined;
|
|
30
|
-
slimDOMOptions: SlimDOMOptions;
|
|
31
|
-
dataURLOptions?: DataURLOptions;
|
|
32
|
-
keepIframeSrcFn?: KeepIframeSrcFn;
|
|
33
|
-
inlineImages?: boolean;
|
|
34
|
-
recordCanvas?: boolean;
|
|
35
|
-
preserveWhiteSpace?: boolean;
|
|
36
|
-
onSerialize?: (n: Node) => unknown;
|
|
37
|
-
onIframeLoad?: (iframeNode: HTMLIFrameElement, node: serializedElementNodeWithId) => unknown;
|
|
38
|
-
iframeLoadTimeout?: number;
|
|
39
|
-
onStylesheetLoad?: (linkNode: HTMLLinkElement, node: serializedElementNodeWithId) => unknown;
|
|
40
|
-
stylesheetLoadTimeout?: number;
|
|
41
|
-
depth?: number;
|
|
42
|
-
maxDepth?: number;
|
|
43
|
-
onMaxDepthReached?: () => void;
|
|
44
|
-
}): serializedNodeWithId | null;
|
|
45
|
-
export declare function slimDOMDefaults(slimDOM: 'all' | boolean | SlimDOMOptions): SlimDOMOptions;
|
|
46
|
-
declare function snapshot(n: Document, options?: {
|
|
47
|
-
mirror?: Mirror;
|
|
48
|
-
blockClass?: string | RegExp;
|
|
49
|
-
blockSelector?: string | null;
|
|
50
|
-
maskTextClass?: string | RegExp;
|
|
51
|
-
maskTextSelector?: string | null;
|
|
52
|
-
inlineStylesheet?: boolean;
|
|
53
|
-
maskAllInputs?: boolean | MaskInputOptions;
|
|
54
|
-
maskTextFn?: MaskTextFn;
|
|
55
|
-
maskInputFn?: MaskInputFn;
|
|
56
|
-
slimDOM?: 'all' | boolean | SlimDOMOptions;
|
|
57
|
-
dataURLOptions?: DataURLOptions;
|
|
58
|
-
inlineImages?: boolean;
|
|
59
|
-
recordCanvas?: boolean;
|
|
60
|
-
preserveWhiteSpace?: boolean;
|
|
61
|
-
onSerialize?: (n: Node) => unknown;
|
|
62
|
-
onIframeLoad?: (iframeNode: HTMLIFrameElement, node: serializedElementNodeWithId) => unknown;
|
|
63
|
-
iframeLoadTimeout?: number;
|
|
64
|
-
onStylesheetLoad?: (linkNode: HTMLLinkElement, node: serializedElementNodeWithId) => unknown;
|
|
65
|
-
stylesheetLoadTimeout?: number;
|
|
66
|
-
keepIframeSrcFn?: KeepIframeSrcFn;
|
|
67
|
-
maxDepth?: number;
|
|
68
|
-
}): serializedNodeWithId | null;
|
|
69
|
-
export declare function visitSnapshot(node: serializedNodeWithId, onVisit: (node: serializedNodeWithId) => unknown): void;
|
|
70
|
-
export declare function cleanupSnapshot(): void;
|
|
71
|
-
export default snapshot;
|
package/dist/types.d.cts
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { serializedNodeWithId } from '@posthog/rrweb-types';
|
|
2
|
-
export declare enum NodeType {
|
|
3
|
-
Document = 0,
|
|
4
|
-
DocumentType = 1,
|
|
5
|
-
Element = 2,
|
|
6
|
-
Text = 3,
|
|
7
|
-
CDATA = 4,
|
|
8
|
-
Comment = 5
|
|
9
|
-
}
|
|
10
|
-
export type documentNode = {
|
|
11
|
-
type: NodeType.Document;
|
|
12
|
-
childNodes: serializedNodeWithId[];
|
|
13
|
-
compatMode?: string;
|
|
14
|
-
};
|
|
15
|
-
export type documentTypeNode = {
|
|
16
|
-
type: NodeType.DocumentType;
|
|
17
|
-
name: string;
|
|
18
|
-
publicId: string;
|
|
19
|
-
systemId: string;
|
|
20
|
-
};
|
|
21
|
-
export type attributes = {
|
|
22
|
-
[key: string]: string | number | true | null;
|
|
23
|
-
};
|
|
24
|
-
export type legacyAttributes = {
|
|
25
|
-
selected: false;
|
|
26
|
-
};
|
|
27
|
-
export type elementNode = {
|
|
28
|
-
type: NodeType.Element;
|
|
29
|
-
tagName: string;
|
|
30
|
-
attributes: attributes;
|
|
31
|
-
childNodes: serializedNodeWithId[];
|
|
32
|
-
isSVG?: true;
|
|
33
|
-
needBlock?: boolean;
|
|
34
|
-
isCustom?: true;
|
|
35
|
-
};
|
|
36
|
-
export type textNode = {
|
|
37
|
-
type: NodeType.Text;
|
|
38
|
-
textContent: string;
|
|
39
|
-
isStyle?: true;
|
|
40
|
-
};
|
|
41
|
-
export type cdataNode = {
|
|
42
|
-
type: NodeType.CDATA;
|
|
43
|
-
textContent: '';
|
|
44
|
-
};
|
|
45
|
-
export type commentNode = {
|
|
46
|
-
type: NodeType.Comment;
|
|
47
|
-
textContent: string;
|
|
48
|
-
};
|
|
49
|
-
export type serializedNode = (documentNode | documentTypeNode | elementNode | textNode | cdataNode | commentNode) & {
|
|
50
|
-
rootId?: number;
|
|
51
|
-
isShadowHost?: boolean;
|
|
52
|
-
isShadow?: boolean;
|
|
53
|
-
};
|
|
54
|
-
export type serializedElementNodeWithId = Extract<serializedNodeWithId, Record<'type', NodeType.Element>>;
|
|
55
|
-
export type tagMap = {
|
|
56
|
-
[key: string]: string;
|
|
57
|
-
};
|
|
58
|
-
export type DialogAttributes = {
|
|
59
|
-
open: string;
|
|
60
|
-
rr_open_mode: 'modal' | 'non-modal';
|
|
61
|
-
};
|
|
62
|
-
export interface ICanvas extends HTMLCanvasElement {
|
|
63
|
-
__context: string;
|
|
64
|
-
}
|
|
65
|
-
export type idNodeMap = Map<number, Node>;
|
|
66
|
-
export type nodeMetaMap = WeakMap<Node, serializedNodeWithId>;
|
|
67
|
-
export type MaskInputOptions = Partial<{
|
|
68
|
-
color: boolean;
|
|
69
|
-
date: boolean;
|
|
70
|
-
'datetime-local': boolean;
|
|
71
|
-
email: boolean;
|
|
72
|
-
month: boolean;
|
|
73
|
-
number: boolean;
|
|
74
|
-
range: boolean;
|
|
75
|
-
search: boolean;
|
|
76
|
-
tel: boolean;
|
|
77
|
-
text: boolean;
|
|
78
|
-
time: boolean;
|
|
79
|
-
url: boolean;
|
|
80
|
-
week: boolean;
|
|
81
|
-
textarea: boolean;
|
|
82
|
-
select: boolean;
|
|
83
|
-
password: boolean;
|
|
84
|
-
}>;
|
|
85
|
-
export type SlimDOMOptions = Partial<{
|
|
86
|
-
script: boolean;
|
|
87
|
-
comment: boolean;
|
|
88
|
-
headFavicon: boolean;
|
|
89
|
-
headWhitespace: boolean;
|
|
90
|
-
headMetaDescKeywords: boolean;
|
|
91
|
-
headMetaSocial: boolean;
|
|
92
|
-
headMetaRobots: boolean;
|
|
93
|
-
headMetaHttpEquiv: boolean;
|
|
94
|
-
headMetaAuthorship: boolean;
|
|
95
|
-
headMetaVerification: boolean;
|
|
96
|
-
headTitleMutations: boolean;
|
|
97
|
-
}>;
|
|
98
|
-
export type MaskTextFn = (text: string, element: HTMLElement | null) => string;
|
|
99
|
-
export type MaskInputFn = (text: string, element: HTMLElement) => string;
|
|
100
|
-
export type KeepIframeSrcFn = (src: string) => boolean;
|
|
101
|
-
export type BuildCache = {
|
|
102
|
-
stylesWithHoverClass: Map<string, string>;
|
|
103
|
-
};
|
package/dist/types.d.ts
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { serializedNodeWithId } from '@posthog/rrweb-types';
|
|
2
|
-
export declare enum NodeType {
|
|
3
|
-
Document = 0,
|
|
4
|
-
DocumentType = 1,
|
|
5
|
-
Element = 2,
|
|
6
|
-
Text = 3,
|
|
7
|
-
CDATA = 4,
|
|
8
|
-
Comment = 5
|
|
9
|
-
}
|
|
10
|
-
export type documentNode = {
|
|
11
|
-
type: NodeType.Document;
|
|
12
|
-
childNodes: serializedNodeWithId[];
|
|
13
|
-
compatMode?: string;
|
|
14
|
-
};
|
|
15
|
-
export type documentTypeNode = {
|
|
16
|
-
type: NodeType.DocumentType;
|
|
17
|
-
name: string;
|
|
18
|
-
publicId: string;
|
|
19
|
-
systemId: string;
|
|
20
|
-
};
|
|
21
|
-
export type attributes = {
|
|
22
|
-
[key: string]: string | number | true | null;
|
|
23
|
-
};
|
|
24
|
-
export type legacyAttributes = {
|
|
25
|
-
selected: false;
|
|
26
|
-
};
|
|
27
|
-
export type elementNode = {
|
|
28
|
-
type: NodeType.Element;
|
|
29
|
-
tagName: string;
|
|
30
|
-
attributes: attributes;
|
|
31
|
-
childNodes: serializedNodeWithId[];
|
|
32
|
-
isSVG?: true;
|
|
33
|
-
needBlock?: boolean;
|
|
34
|
-
isCustom?: true;
|
|
35
|
-
};
|
|
36
|
-
export type textNode = {
|
|
37
|
-
type: NodeType.Text;
|
|
38
|
-
textContent: string;
|
|
39
|
-
isStyle?: true;
|
|
40
|
-
};
|
|
41
|
-
export type cdataNode = {
|
|
42
|
-
type: NodeType.CDATA;
|
|
43
|
-
textContent: '';
|
|
44
|
-
};
|
|
45
|
-
export type commentNode = {
|
|
46
|
-
type: NodeType.Comment;
|
|
47
|
-
textContent: string;
|
|
48
|
-
};
|
|
49
|
-
export type serializedNode = (documentNode | documentTypeNode | elementNode | textNode | cdataNode | commentNode) & {
|
|
50
|
-
rootId?: number;
|
|
51
|
-
isShadowHost?: boolean;
|
|
52
|
-
isShadow?: boolean;
|
|
53
|
-
};
|
|
54
|
-
export type serializedElementNodeWithId = Extract<serializedNodeWithId, Record<'type', NodeType.Element>>;
|
|
55
|
-
export type tagMap = {
|
|
56
|
-
[key: string]: string;
|
|
57
|
-
};
|
|
58
|
-
export type DialogAttributes = {
|
|
59
|
-
open: string;
|
|
60
|
-
rr_open_mode: 'modal' | 'non-modal';
|
|
61
|
-
};
|
|
62
|
-
export interface ICanvas extends HTMLCanvasElement {
|
|
63
|
-
__context: string;
|
|
64
|
-
}
|
|
65
|
-
export type idNodeMap = Map<number, Node>;
|
|
66
|
-
export type nodeMetaMap = WeakMap<Node, serializedNodeWithId>;
|
|
67
|
-
export type MaskInputOptions = Partial<{
|
|
68
|
-
color: boolean;
|
|
69
|
-
date: boolean;
|
|
70
|
-
'datetime-local': boolean;
|
|
71
|
-
email: boolean;
|
|
72
|
-
month: boolean;
|
|
73
|
-
number: boolean;
|
|
74
|
-
range: boolean;
|
|
75
|
-
search: boolean;
|
|
76
|
-
tel: boolean;
|
|
77
|
-
text: boolean;
|
|
78
|
-
time: boolean;
|
|
79
|
-
url: boolean;
|
|
80
|
-
week: boolean;
|
|
81
|
-
textarea: boolean;
|
|
82
|
-
select: boolean;
|
|
83
|
-
password: boolean;
|
|
84
|
-
}>;
|
|
85
|
-
export type SlimDOMOptions = Partial<{
|
|
86
|
-
script: boolean;
|
|
87
|
-
comment: boolean;
|
|
88
|
-
headFavicon: boolean;
|
|
89
|
-
headWhitespace: boolean;
|
|
90
|
-
headMetaDescKeywords: boolean;
|
|
91
|
-
headMetaSocial: boolean;
|
|
92
|
-
headMetaRobots: boolean;
|
|
93
|
-
headMetaHttpEquiv: boolean;
|
|
94
|
-
headMetaAuthorship: boolean;
|
|
95
|
-
headMetaVerification: boolean;
|
|
96
|
-
headTitleMutations: boolean;
|
|
97
|
-
}>;
|
|
98
|
-
export type MaskTextFn = (text: string, element: HTMLElement | null) => string;
|
|
99
|
-
export type MaskInputFn = (text: string, element: HTMLElement) => string;
|
|
100
|
-
export type KeepIframeSrcFn = (src: string) => boolean;
|
|
101
|
-
export type BuildCache = {
|
|
102
|
-
stylesWithHoverClass: Map<string, string>;
|
|
103
|
-
};
|
package/dist/utils.d.cts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { MaskInputFn, MaskInputOptions } from './types';
|
|
2
|
-
import { IMirror, serializedNodeWithId, serializedNode } from '@posthog/rrweb-types';
|
|
3
|
-
|
|
4
|
-
export declare function isElement(n: Node): n is Element;
|
|
5
|
-
export declare function isShadowRoot(n: Node): n is ShadowRoot;
|
|
6
|
-
export declare function isNativeShadowDom(shadowRoot: ShadowRoot): boolean;
|
|
7
|
-
declare interface CSSImportRule extends CSSRule {
|
|
8
|
-
readonly href: string;
|
|
9
|
-
readonly layerName: string | null;
|
|
10
|
-
readonly media: MediaList;
|
|
11
|
-
readonly styleSheet: CSSStyleSheet;
|
|
12
|
-
readonly supportsText?: string | null;
|
|
13
|
-
}
|
|
14
|
-
export declare function escapeImportStatement(rule: CSSImportRule): string;
|
|
15
|
-
export declare function stringifyStylesheet(s: CSSStyleSheet): string | null;
|
|
16
|
-
export declare function stringifyRule(rule: CSSRule, sheetHref: string | null): string;
|
|
17
|
-
export declare function fixSafariColons(cssStringified: string): string;
|
|
18
|
-
export declare function isCSSImportRule(rule: CSSRule): rule is CSSImportRule;
|
|
19
|
-
export declare function isCSSStyleRule(rule: CSSRule): rule is CSSStyleRule;
|
|
20
|
-
export declare class Mirror implements IMirror<Node> {
|
|
21
|
-
private idNodeMap;
|
|
22
|
-
private nodeMetaMap;
|
|
23
|
-
getId(n: Node | undefined | null): number;
|
|
24
|
-
getNode(id: number): Node | null;
|
|
25
|
-
getIds(): number[];
|
|
26
|
-
getMeta(n: Node): serializedNodeWithId | null;
|
|
27
|
-
removeNodeFromMap(n: Node): void;
|
|
28
|
-
has(id: number): boolean;
|
|
29
|
-
hasNode(node: Node): boolean;
|
|
30
|
-
add(n: Node, meta: serializedNodeWithId): void;
|
|
31
|
-
replace(id: number, n: Node): void;
|
|
32
|
-
reset(): void;
|
|
33
|
-
}
|
|
34
|
-
export declare function createMirror(): Mirror;
|
|
35
|
-
export declare function maskInputValue({ element, maskInputOptions, tagName, type, value, maskInputFn, }: {
|
|
36
|
-
element: HTMLElement;
|
|
37
|
-
maskInputOptions: MaskInputOptions;
|
|
38
|
-
tagName: string;
|
|
39
|
-
type: string | null;
|
|
40
|
-
value: string | null;
|
|
41
|
-
maskInputFn?: MaskInputFn;
|
|
42
|
-
}): string;
|
|
43
|
-
export declare function toLowerCase<T extends string>(str: T): Lowercase<T>;
|
|
44
|
-
export declare function is2DCanvasBlank(canvas: HTMLCanvasElement): boolean;
|
|
45
|
-
export declare function isNodeMetaEqual(a: serializedNode, b: serializedNode): boolean;
|
|
46
|
-
export declare function getInputType(element: HTMLElement): Lowercase<string> | null;
|
|
47
|
-
export declare function extractFileExtension(path: string, baseURL?: string): string | null;
|
|
48
|
-
export declare function absolutifyURLs(cssText: string | null, href: string): string;
|
|
49
|
-
export declare function recompressBase64Image(img: HTMLImageElement, dataURL: string, type?: string, quality?: number): string;
|
|
50
|
-
export declare function checkDataURLSize(dataURL: string, maxLength: number | undefined): string;
|
|
51
|
-
export {};
|
package/dist/utils.d.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { MaskInputFn, MaskInputOptions } from './types';
|
|
2
|
-
import { IMirror, serializedNodeWithId, serializedNode } from '@posthog/rrweb-types';
|
|
3
|
-
|
|
4
|
-
export declare function isElement(n: Node): n is Element;
|
|
5
|
-
export declare function isShadowRoot(n: Node): n is ShadowRoot;
|
|
6
|
-
export declare function isNativeShadowDom(shadowRoot: ShadowRoot): boolean;
|
|
7
|
-
declare interface CSSImportRule extends CSSRule {
|
|
8
|
-
readonly href: string;
|
|
9
|
-
readonly layerName: string | null;
|
|
10
|
-
readonly media: MediaList;
|
|
11
|
-
readonly styleSheet: CSSStyleSheet;
|
|
12
|
-
readonly supportsText?: string | null;
|
|
13
|
-
}
|
|
14
|
-
export declare function escapeImportStatement(rule: CSSImportRule): string;
|
|
15
|
-
export declare function stringifyStylesheet(s: CSSStyleSheet): string | null;
|
|
16
|
-
export declare function stringifyRule(rule: CSSRule, sheetHref: string | null): string;
|
|
17
|
-
export declare function fixSafariColons(cssStringified: string): string;
|
|
18
|
-
export declare function isCSSImportRule(rule: CSSRule): rule is CSSImportRule;
|
|
19
|
-
export declare function isCSSStyleRule(rule: CSSRule): rule is CSSStyleRule;
|
|
20
|
-
export declare class Mirror implements IMirror<Node> {
|
|
21
|
-
private idNodeMap;
|
|
22
|
-
private nodeMetaMap;
|
|
23
|
-
getId(n: Node | undefined | null): number;
|
|
24
|
-
getNode(id: number): Node | null;
|
|
25
|
-
getIds(): number[];
|
|
26
|
-
getMeta(n: Node): serializedNodeWithId | null;
|
|
27
|
-
removeNodeFromMap(n: Node): void;
|
|
28
|
-
has(id: number): boolean;
|
|
29
|
-
hasNode(node: Node): boolean;
|
|
30
|
-
add(n: Node, meta: serializedNodeWithId): void;
|
|
31
|
-
replace(id: number, n: Node): void;
|
|
32
|
-
reset(): void;
|
|
33
|
-
}
|
|
34
|
-
export declare function createMirror(): Mirror;
|
|
35
|
-
export declare function maskInputValue({ element, maskInputOptions, tagName, type, value, maskInputFn, }: {
|
|
36
|
-
element: HTMLElement;
|
|
37
|
-
maskInputOptions: MaskInputOptions;
|
|
38
|
-
tagName: string;
|
|
39
|
-
type: string | null;
|
|
40
|
-
value: string | null;
|
|
41
|
-
maskInputFn?: MaskInputFn;
|
|
42
|
-
}): string;
|
|
43
|
-
export declare function toLowerCase<T extends string>(str: T): Lowercase<T>;
|
|
44
|
-
export declare function is2DCanvasBlank(canvas: HTMLCanvasElement): boolean;
|
|
45
|
-
export declare function isNodeMetaEqual(a: serializedNode, b: serializedNode): boolean;
|
|
46
|
-
export declare function getInputType(element: HTMLElement): Lowercase<string> | null;
|
|
47
|
-
export declare function extractFileExtension(path: string, baseURL?: string): string | null;
|
|
48
|
-
export declare function absolutifyURLs(cssText: string | null, href: string): string;
|
|
49
|
-
export declare function recompressBase64Image(img: HTMLImageElement, dataURL: string, type?: string, quality?: number): string;
|
|
50
|
-
export declare function checkDataURLSize(dataURL: string, maxLength: number | undefined): string;
|
|
51
|
-
export {};
|