clarity-js 0.8.1 → 0.8.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.
Files changed (102) hide show
  1. package/README.md +26 -26
  2. package/build/clarity.extended.js +1 -1
  3. package/build/clarity.insight.js +1 -1
  4. package/build/clarity.js +5537 -5537
  5. package/build/clarity.min.js +1 -1
  6. package/build/clarity.module.js +5537 -5537
  7. package/build/clarity.performance.js +1 -1
  8. package/package.json +70 -70
  9. package/rollup.config.ts +98 -98
  10. package/src/clarity.ts +60 -60
  11. package/src/core/api.ts +8 -8
  12. package/src/core/config.ts +32 -32
  13. package/src/core/copy.ts +3 -3
  14. package/src/core/event.ts +53 -53
  15. package/src/core/hash.ts +19 -19
  16. package/src/core/history.ts +73 -73
  17. package/src/core/index.ts +83 -83
  18. package/src/core/measure.ts +19 -19
  19. package/src/core/report.ts +28 -28
  20. package/src/core/scrub.ts +196 -196
  21. package/src/core/task.ts +180 -180
  22. package/src/core/time.ts +19 -19
  23. package/src/core/timeout.ts +10 -10
  24. package/src/core/version.ts +2 -2
  25. package/src/data/baseline.ts +155 -155
  26. package/src/data/compress.ts +31 -31
  27. package/src/data/consent.ts +20 -20
  28. package/src/data/custom.ts +23 -23
  29. package/src/data/dimension.ts +53 -53
  30. package/src/data/encode.ts +140 -140
  31. package/src/data/envelope.ts +53 -53
  32. package/src/data/extract.ts +211 -211
  33. package/src/data/index.ts +46 -46
  34. package/src/data/limit.ts +44 -44
  35. package/src/data/metadata.ts +356 -356
  36. package/src/data/metric.ts +51 -51
  37. package/src/data/ping.ts +36 -36
  38. package/src/data/signal.ts +30 -30
  39. package/src/data/summary.ts +34 -34
  40. package/src/data/token.ts +39 -39
  41. package/src/data/upgrade.ts +37 -37
  42. package/src/data/upload.ts +283 -283
  43. package/src/data/variable.ts +83 -83
  44. package/src/diagnostic/encode.ts +40 -40
  45. package/src/diagnostic/fraud.ts +36 -36
  46. package/src/diagnostic/index.ts +15 -15
  47. package/src/diagnostic/internal.ts +28 -28
  48. package/src/diagnostic/script.ts +37 -37
  49. package/src/global.ts +6 -6
  50. package/src/index.ts +9 -9
  51. package/src/insight/blank.ts +14 -14
  52. package/src/insight/encode.ts +60 -60
  53. package/src/insight/snapshot.ts +114 -114
  54. package/src/interaction/change.ts +40 -40
  55. package/src/interaction/click.ts +162 -162
  56. package/src/interaction/clipboard.ts +34 -34
  57. package/src/interaction/encode.ts +193 -193
  58. package/src/interaction/index.ts +59 -59
  59. package/src/interaction/input.ts +59 -59
  60. package/src/interaction/pointer.ts +139 -139
  61. package/src/interaction/resize.ts +47 -47
  62. package/src/interaction/scroll.ts +124 -124
  63. package/src/interaction/selection.ts +68 -68
  64. package/src/interaction/submit.ts +32 -32
  65. package/src/interaction/timeline.ts +65 -65
  66. package/src/interaction/unload.ts +28 -28
  67. package/src/interaction/visibility.ts +26 -26
  68. package/src/layout/animation.ts +133 -133
  69. package/src/layout/discover.ts +31 -31
  70. package/src/layout/document.ts +48 -48
  71. package/src/layout/dom.ts +437 -437
  72. package/src/layout/encode.ts +147 -147
  73. package/src/layout/index.ts +41 -41
  74. package/src/layout/mutation.ts +409 -409
  75. package/src/layout/node.ts +292 -292
  76. package/src/layout/offset.ts +19 -19
  77. package/src/layout/region.ts +153 -153
  78. package/src/layout/schema.ts +63 -63
  79. package/src/layout/selector.ts +82 -82
  80. package/src/layout/style.ts +150 -150
  81. package/src/layout/target.ts +32 -32
  82. package/src/layout/traverse.ts +27 -27
  83. package/src/performance/blank.ts +7 -7
  84. package/src/performance/encode.ts +31 -31
  85. package/src/performance/index.ts +14 -14
  86. package/src/performance/interaction.ts +125 -125
  87. package/src/performance/navigation.ts +31 -31
  88. package/src/performance/observer.ts +108 -108
  89. package/src/queue.ts +33 -33
  90. package/test/core.test.ts +139 -139
  91. package/test/helper.ts +162 -162
  92. package/test/html/core.html +27 -27
  93. package/test/tsconfig.test.json +5 -5
  94. package/tsconfig.json +21 -21
  95. package/tslint.json +32 -32
  96. package/types/core.d.ts +153 -153
  97. package/types/data.d.ts +510 -510
  98. package/types/diagnostic.d.ts +24 -24
  99. package/types/index.d.ts +39 -39
  100. package/types/interaction.d.ts +165 -165
  101. package/types/layout.d.ts +272 -272
  102. package/types/performance.d.ts +64 -64
@@ -1,27 +1,27 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Core Tests</title>
5
- <style>input, textarea, select { margin: 10px; display: block; }</style>
6
- </head>
7
- <body>
8
- <div>
9
- <h1 id="one">Thanks for your order #2AB700GH</h1>
10
- <p id="two" class="address-details">1 Microsoft Way, Redmond, WA - 98052</p>
11
- </div>
12
- <div id="mask">
13
- <span id="child">Hello Wor1d</span>
14
- </div>
15
- <form name="login">
16
- <input type="email" id="eml" title="Email" value="random@email.test">
17
- <input type="password" id="pwd" title="Password" maxlength="16" value="passw0rd">
18
- <input type="search" id="search" title="Search" value="hello w0rld">
19
- <input type="text" id="cardnum" title="CC" value="1234">
20
- <textarea id="textarea" autocapitalize="off" role="combobox" rows="5" placeholder="" spellcheck="false">Hell0 World</textarea>
21
- <select id="select" ng-options="origin.code" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false">
22
- <option id="option1" label="Halifax" value="string:YHZ">Halifax</option>
23
- <option id="option2" label="Montréal" value="string:YUL" selected="selected">Montréal</option>
24
- </select>
25
- </form>
26
- </body>
27
- </html>
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Core Tests</title>
5
+ <style>input, textarea, select { margin: 10px; display: block; }</style>
6
+ </head>
7
+ <body>
8
+ <div>
9
+ <h1 id="one">Thanks for your order #2AB700GH</h1>
10
+ <p id="two" class="address-details">1 Microsoft Way, Redmond, WA - 98052</p>
11
+ </div>
12
+ <div id="mask">
13
+ <span id="child">Hello Wor1d</span>
14
+ </div>
15
+ <form name="login">
16
+ <input type="email" id="eml" title="Email" value="random@email.test">
17
+ <input type="password" id="pwd" title="Password" maxlength="16" value="passw0rd">
18
+ <input type="search" id="search" title="Search" value="hello w0rld">
19
+ <input type="text" id="cardnum" title="CC" value="1234">
20
+ <textarea id="textarea" autocapitalize="off" role="combobox" rows="5" placeholder="" spellcheck="false">Hell0 World</textarea>
21
+ <select id="select" ng-options="origin.code" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false">
22
+ <option id="option1" label="Halifax" value="string:YHZ">Halifax</option>
23
+ <option id="option2" label="Montréal" value="string:YUL" selected="selected">Montréal</option>
24
+ </select>
25
+ </form>
26
+ </body>
27
+ </html>
@@ -1,6 +1,6 @@
1
- {
2
- "extends": "../tsconfig.json",
3
- "compilerOptions": {
4
- "module": "commonjs"
5
- }
1
+ {
2
+ "extends": "../tsconfig.json",
3
+ "compilerOptions": {
4
+ "module": "commonjs"
5
+ }
6
6
  }
package/tsconfig.json CHANGED
@@ -1,21 +1,21 @@
1
- {
2
- "compilerOptions": {
3
- "module": "esnext",
4
- "target": "es5",
5
- "lib": ["es6", "dom", "es2016", "es2017"],
6
- "moduleResolution": "node",
7
- "forceConsistentCasingInFileNames": true,
8
- "noImplicitReturns": true,
9
- "noUnusedLocals": true,
10
- "noUnusedParameters": true,
11
- "resolveJsonModule": true,
12
- "esModuleInterop": true,
13
- "baseUrl": ".",
14
- "paths": {
15
- "@src/*": ["src/*"],
16
- "@clarity-types/*": ["types/*"]
17
- }
18
- },
19
- "include":["src/**/*.ts","types/**/*.d.ts", "rollup.config.ts"],
20
- "exclude": ["test", "node_modules", "build"]
21
- }
1
+ {
2
+ "compilerOptions": {
3
+ "module": "esnext",
4
+ "target": "es5",
5
+ "lib": ["es6", "dom", "es2016", "es2017"],
6
+ "moduleResolution": "node",
7
+ "forceConsistentCasingInFileNames": true,
8
+ "noImplicitReturns": true,
9
+ "noUnusedLocals": true,
10
+ "noUnusedParameters": true,
11
+ "resolveJsonModule": true,
12
+ "esModuleInterop": true,
13
+ "baseUrl": ".",
14
+ "paths": {
15
+ "@src/*": ["src/*"],
16
+ "@clarity-types/*": ["types/*"]
17
+ }
18
+ },
19
+ "include":["src/**/*.ts","types/**/*.d.ts", "rollup.config.ts"],
20
+ "exclude": ["test", "node_modules", "build"]
21
+ }
package/tslint.json CHANGED
@@ -1,33 +1,33 @@
1
- {
2
- "extends": "tslint:recommended",
3
- "rules": {
4
- "max-line-length": [
5
- true,
6
- 140
7
- ],
8
- "no-console": [
9
- false
10
- ],
11
- "no-string-literal": false,
12
- "prefer-const": false,
13
- "prefer-for-of": false,
14
- "object-literal-sort-keys": false,
15
- "one-variable-per-declaration": false,
16
- "trailing-comma": [
17
- false
18
- ],
19
- "variable-name": false,
20
- "interface-name": false,
21
- "interface-over-type-literal": false,
22
- "only-arrow-functions": false,
23
- "typedef": [
24
- true,
25
- "call-signature",
26
- "parameter",
27
- "property-declaration",
28
- "member-variable-declaration",
29
- "object-destructuring",
30
- "array-destructuring"
31
- ]
32
- }
1
+ {
2
+ "extends": "tslint:recommended",
3
+ "rules": {
4
+ "max-line-length": [
5
+ true,
6
+ 140
7
+ ],
8
+ "no-console": [
9
+ false
10
+ ],
11
+ "no-string-literal": false,
12
+ "prefer-const": false,
13
+ "prefer-for-of": false,
14
+ "object-literal-sort-keys": false,
15
+ "one-variable-per-declaration": false,
16
+ "trailing-comma": [
17
+ false
18
+ ],
19
+ "variable-name": false,
20
+ "interface-name": false,
21
+ "interface-over-type-literal": false,
22
+ "only-arrow-functions": false,
23
+ "typedef": [
24
+ true,
25
+ "call-signature",
26
+ "parameter",
27
+ "property-declaration",
28
+ "member-variable-declaration",
29
+ "object-destructuring",
30
+ "array-destructuring"
31
+ ]
32
+ }
33
33
  }
package/types/core.d.ts CHANGED
@@ -1,153 +1,153 @@
1
- import * as Data from "./data";
2
-
3
- type TaskFunction = () => Promise<void>;
4
- type TaskResolve = () => void;
5
- type UploadCallback = (data: string) => void;
6
- type Region = [number /* RegionId */, string /* Query Selector */];
7
- type Checksum = [number /* FraudId */, string /* Query Selector */];
8
-
9
- /* Enum */
10
-
11
- export const enum Priority {
12
- Normal = 0,
13
- High = 1
14
- }
15
-
16
- export const enum Time {
17
- Second = 1000,
18
- Minute = 60 * 1000,
19
- Hour = 60 * 60 * 1000,
20
- Day = 24 * 60 * 60 * 1000
21
- }
22
-
23
- export const enum Task {
24
- Wait = 0,
25
- Run = 1,
26
- Stop = 2
27
- }
28
-
29
- export const enum ExtractSource {
30
- Javascript = 0,
31
- Cookie = 1,
32
- Text = 2,
33
- Fragment = 3,
34
- Hash = 4
35
- }
36
-
37
- export const enum Type {
38
- Array = 1,
39
- Object = 2,
40
- Simple = 3
41
- }
42
-
43
- export type Syntax = {
44
- name: string,
45
- type: Type,
46
- condition: string
47
- }
48
-
49
- export const enum Privacy {
50
- None = 0,
51
- Sensitive = 1,
52
- Text = 2,
53
- TextImage = 3,
54
- Exclude = 4,
55
- Snapshot = 5
56
- }
57
-
58
- /* Helper Interfaces */
59
-
60
- export interface Module {
61
- start: () => void;
62
- stop: () => void;
63
- }
64
-
65
- export interface Tasks {
66
- [key: number]: TaskInfo;
67
- }
68
-
69
- export interface TaskInfo {
70
- start: number;
71
- calls: number;
72
- yield: number;
73
- }
74
-
75
- export interface Timer {
76
- id: string;
77
- cost: Data.Metric;
78
- }
79
-
80
- export interface RequestIdleCallbackOptions {
81
- timeout: number;
82
- }
83
-
84
- export interface RequestIdleCallbackDeadline {
85
- didTimeout: boolean;
86
- timeRemaining: (() => number);
87
- }
88
-
89
- export interface AsyncTask {
90
- task: TaskFunction;
91
- resolve: TaskResolve;
92
- id: string;
93
- }
94
-
95
- export interface OffsetDistance {
96
- x: number;
97
- y: number;
98
- }
99
-
100
- export interface BrowserEvent {
101
- event: string;
102
- listener: EventListener;
103
- options: {
104
- capture: boolean;
105
- passive: boolean;
106
- };
107
- }
108
-
109
- export interface Report {
110
- v: string; // Version
111
- p: string; // Project Id
112
- u: string; // User Id
113
- s: string; // Session Id
114
- n: number; // Page Number
115
- m?: string; // Message, optional
116
- e?: string; // Error Stack, optional
117
- }
118
-
119
- export interface Config {
120
- projectId?: string;
121
- delay?: number;
122
- lean?: boolean;
123
- track?: boolean;
124
- content?: boolean;
125
- drop?: string[];
126
- mask?: string[];
127
- unmask?: string[];
128
- regions?: Region[];
129
- cookies?: string[];
130
- fraud?: boolean;
131
- checksum?: Checksum[];
132
- report?: string;
133
- upload?: string | UploadCallback;
134
- fallback?: string;
135
- upgrade?: (key: string) => void;
136
- action?: (key: string) => void;
137
- dob?: number;
138
- delayDom?: boolean;
139
- throttleDom?: boolean;
140
- conversions?: boolean;
141
- includeSubdomains?: boolean;
142
- throttleMutations?: boolean;
143
- dropMutations?: boolean;
144
- criticalMs?: number;
145
- discard?: string[];
146
- }
147
-
148
- export const enum Constant {
149
- Zone = "Zone",
150
- Symbol = "__symbol__",
151
- AddEventListener = "addEventListener",
152
- RemoveEventListener = "removeEventListener"
153
- }
1
+ import * as Data from "./data";
2
+
3
+ type TaskFunction = () => Promise<void>;
4
+ type TaskResolve = () => void;
5
+ type UploadCallback = (data: string) => void;
6
+ type Region = [number /* RegionId */, string /* Query Selector */];
7
+ type Checksum = [number /* FraudId */, string /* Query Selector */];
8
+
9
+ /* Enum */
10
+
11
+ export const enum Priority {
12
+ Normal = 0,
13
+ High = 1
14
+ }
15
+
16
+ export const enum Time {
17
+ Second = 1000,
18
+ Minute = 60 * 1000,
19
+ Hour = 60 * 60 * 1000,
20
+ Day = 24 * 60 * 60 * 1000
21
+ }
22
+
23
+ export const enum Task {
24
+ Wait = 0,
25
+ Run = 1,
26
+ Stop = 2
27
+ }
28
+
29
+ export const enum ExtractSource {
30
+ Javascript = 0,
31
+ Cookie = 1,
32
+ Text = 2,
33
+ Fragment = 3,
34
+ Hash = 4
35
+ }
36
+
37
+ export const enum Type {
38
+ Array = 1,
39
+ Object = 2,
40
+ Simple = 3
41
+ }
42
+
43
+ export type Syntax = {
44
+ name: string,
45
+ type: Type,
46
+ condition: string
47
+ }
48
+
49
+ export const enum Privacy {
50
+ None = 0,
51
+ Sensitive = 1,
52
+ Text = 2,
53
+ TextImage = 3,
54
+ Exclude = 4,
55
+ Snapshot = 5
56
+ }
57
+
58
+ /* Helper Interfaces */
59
+
60
+ export interface Module {
61
+ start: () => void;
62
+ stop: () => void;
63
+ }
64
+
65
+ export interface Tasks {
66
+ [key: number]: TaskInfo;
67
+ }
68
+
69
+ export interface TaskInfo {
70
+ start: number;
71
+ calls: number;
72
+ yield: number;
73
+ }
74
+
75
+ export interface Timer {
76
+ id: string;
77
+ cost: Data.Metric;
78
+ }
79
+
80
+ export interface RequestIdleCallbackOptions {
81
+ timeout: number;
82
+ }
83
+
84
+ export interface RequestIdleCallbackDeadline {
85
+ didTimeout: boolean;
86
+ timeRemaining: (() => number);
87
+ }
88
+
89
+ export interface AsyncTask {
90
+ task: TaskFunction;
91
+ resolve: TaskResolve;
92
+ id: string;
93
+ }
94
+
95
+ export interface OffsetDistance {
96
+ x: number;
97
+ y: number;
98
+ }
99
+
100
+ export interface BrowserEvent {
101
+ event: string;
102
+ listener: EventListener;
103
+ options: {
104
+ capture: boolean;
105
+ passive: boolean;
106
+ };
107
+ }
108
+
109
+ export interface Report {
110
+ v: string; // Version
111
+ p: string; // Project Id
112
+ u: string; // User Id
113
+ s: string; // Session Id
114
+ n: number; // Page Number
115
+ m?: string; // Message, optional
116
+ e?: string; // Error Stack, optional
117
+ }
118
+
119
+ export interface Config {
120
+ projectId?: string;
121
+ delay?: number;
122
+ lean?: boolean;
123
+ track?: boolean;
124
+ content?: boolean;
125
+ drop?: string[];
126
+ mask?: string[];
127
+ unmask?: string[];
128
+ regions?: Region[];
129
+ cookies?: string[];
130
+ fraud?: boolean;
131
+ checksum?: Checksum[];
132
+ report?: string;
133
+ upload?: string | UploadCallback;
134
+ fallback?: string;
135
+ upgrade?: (key: string) => void;
136
+ action?: (key: string) => void;
137
+ dob?: number;
138
+ delayDom?: boolean;
139
+ throttleDom?: boolean;
140
+ conversions?: boolean;
141
+ includeSubdomains?: boolean;
142
+ throttleMutations?: boolean;
143
+ dropMutations?: boolean;
144
+ criticalMs?: number;
145
+ discard?: string[];
146
+ }
147
+
148
+ export const enum Constant {
149
+ Zone = "Zone",
150
+ Symbol = "__symbol__",
151
+ AddEventListener = "addEventListener",
152
+ RemoveEventListener = "removeEventListener"
153
+ }