clarity-js 0.8.12 → 0.8.14
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/build/clarity.extended.js +1 -1
- package/build/clarity.insight.js +1 -1
- package/build/clarity.js +4609 -4762
- package/build/clarity.min.js +1 -1
- package/build/clarity.module.js +4609 -4762
- package/build/clarity.performance.js +1 -1
- package/package.json +69 -76
- package/rollup.config.ts +88 -84
- package/src/clarity.ts +29 -35
- package/src/core/api.ts +1 -8
- package/src/core/config.ts +2 -2
- package/src/core/event.ts +32 -36
- package/src/core/hash.ts +6 -5
- package/src/core/history.ts +11 -10
- package/src/core/index.ts +11 -21
- package/src/core/measure.ts +5 -9
- package/src/core/report.ts +6 -10
- package/src/core/scrub.ts +27 -30
- package/src/core/task.ts +45 -73
- package/src/core/time.ts +3 -3
- package/src/core/timeout.ts +2 -2
- package/src/core/version.ts +1 -1
- package/src/data/baseline.ts +55 -60
- package/src/data/consent.ts +22 -4
- package/src/data/custom.ts +13 -8
- package/src/data/dimension.ts +7 -11
- package/src/data/encode.ts +38 -36
- package/src/data/envelope.ts +38 -38
- package/src/data/extract.ts +77 -86
- package/src/data/index.ts +9 -11
- package/src/data/limit.ts +1 -1
- package/src/data/metadata.ts +319 -305
- package/src/data/metric.ts +8 -18
- package/src/data/ping.ts +4 -8
- package/src/data/signal.ts +18 -18
- package/src/data/summary.ts +4 -6
- package/src/data/token.ts +8 -10
- package/src/data/upgrade.ts +3 -7
- package/src/data/upload.ts +49 -100
- package/src/data/variable.ts +20 -27
- package/src/diagnostic/encode.ts +2 -2
- package/src/diagnostic/fraud.ts +4 -3
- package/src/diagnostic/internal.ts +5 -11
- package/src/diagnostic/script.ts +8 -12
- package/src/global.ts +1 -1
- package/src/insight/blank.ts +4 -4
- package/src/insight/encode.ts +17 -23
- package/src/insight/snapshot.ts +37 -57
- package/src/interaction/change.ts +6 -9
- package/src/interaction/click.ts +28 -34
- package/src/interaction/clipboard.ts +2 -2
- package/src/interaction/encode.ts +31 -35
- package/src/interaction/input.ts +9 -11
- package/src/interaction/pointer.ts +30 -41
- package/src/interaction/resize.ts +5 -5
- package/src/interaction/scroll.ts +17 -20
- package/src/interaction/selection.ts +8 -12
- package/src/interaction/submit.ts +2 -2
- package/src/interaction/timeline.ts +9 -13
- package/src/interaction/unload.ts +1 -1
- package/src/interaction/visibility.ts +2 -2
- package/src/layout/animation.ts +41 -47
- package/src/layout/discover.ts +5 -5
- package/src/layout/document.ts +19 -31
- package/src/layout/dom.ts +91 -141
- package/src/layout/encode.ts +37 -52
- package/src/layout/mutation.ts +318 -321
- package/src/layout/node.ts +81 -104
- package/src/layout/offset.ts +6 -7
- package/src/layout/region.ts +43 -66
- package/src/layout/schema.ts +8 -15
- package/src/layout/selector.ts +25 -47
- package/src/layout/style.ts +37 -45
- package/src/layout/target.ts +10 -14
- package/src/layout/traverse.ts +11 -17
- package/src/performance/blank.ts +1 -1
- package/src/performance/encode.ts +4 -4
- package/src/performance/interaction.ts +70 -58
- package/src/performance/navigation.ts +2 -2
- package/src/performance/observer.ts +26 -59
- package/src/queue.ts +9 -16
- package/tsconfig.json +1 -1
- package/tslint.json +32 -25
- package/types/core.d.ts +13 -13
- package/types/data.d.ts +48 -32
- package/types/diagnostic.d.ts +1 -1
- package/types/index.d.ts +1 -0
- package/types/interaction.d.ts +4 -5
- package/types/layout.d.ts +21 -36
- package/types/performance.d.ts +5 -6
- package/.lintstagedrc.yml +0 -3
- package/biome.json +0 -43
package/types/layout.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Privacy } from "@clarity-types/core";
|
|
2
2
|
|
|
3
3
|
/* Enum */
|
|
4
4
|
|
|
@@ -8,27 +8,27 @@ export const enum AnimationOperation {
|
|
|
8
8
|
Pause = 2,
|
|
9
9
|
Cancel = 3,
|
|
10
10
|
Finish = 4,
|
|
11
|
-
CommitStyles = 5
|
|
11
|
+
CommitStyles = 5
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export const enum Source {
|
|
15
|
-
Discover
|
|
16
|
-
ChildListAdd
|
|
17
|
-
ChildListRemove
|
|
18
|
-
Attributes
|
|
19
|
-
CharacterData
|
|
15
|
+
Discover,
|
|
16
|
+
ChildListAdd,
|
|
17
|
+
ChildListRemove,
|
|
18
|
+
Attributes,
|
|
19
|
+
CharacterData
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export const enum Selector {
|
|
23
23
|
Alpha = 0,
|
|
24
24
|
Beta = 1,
|
|
25
|
-
Default = 1
|
|
25
|
+
Default = 1
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export const enum InteractionState {
|
|
29
29
|
None = 16,
|
|
30
30
|
Clicked = 20,
|
|
31
|
-
Input = 30
|
|
31
|
+
Input = 30
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
export interface AnimationState {
|
|
@@ -49,14 +49,14 @@ export interface AnimationData {
|
|
|
49
49
|
export const enum RegionVisibility {
|
|
50
50
|
Rendered = 0,
|
|
51
51
|
Visible = 10,
|
|
52
|
-
ScrolledToEnd = 13
|
|
52
|
+
ScrolledToEnd = 13
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
export const enum Mask {
|
|
56
56
|
Text = "address,password,contact",
|
|
57
57
|
Disable = "radio,checkbox,range,button,reset,submit",
|
|
58
58
|
Exclude = "password,secret,pass,social,ssn,code,hidden",
|
|
59
|
-
Tags = "INPUT,SELECT,TEXTAREA"
|
|
59
|
+
Tags = "INPUT,SELECT,TEXTAREA"
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
export const enum Constant {
|
|
@@ -124,10 +124,10 @@ export const enum Constant {
|
|
|
124
124
|
ogTitle = "og:title",
|
|
125
125
|
SvgStyle = "svg:style",
|
|
126
126
|
ExcludeClassNames = "load,active,fixed,visible,focus,show,collaps,animat",
|
|
127
|
-
StyleSheet = "stylesheet"
|
|
127
|
+
StyleSheet = "stylesheet"
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
export const enum JsonLD {
|
|
130
|
+
export const enum JsonLD {
|
|
131
131
|
Type = "@type",
|
|
132
132
|
Recipe = "recipe",
|
|
133
133
|
Product = "product",
|
|
@@ -150,7 +150,7 @@ export const enum JsonLD {
|
|
|
150
150
|
Article = "article",
|
|
151
151
|
Posting = "posting",
|
|
152
152
|
Headline = "headline",
|
|
153
|
-
Creator = "creator"
|
|
153
|
+
Creator = "creator"
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
export const enum Setting {
|
|
@@ -165,25 +165,10 @@ export const enum StyleSheetOperation {
|
|
|
165
165
|
Create = 0,
|
|
166
166
|
Replace = 1,
|
|
167
167
|
ReplaceSync = 2,
|
|
168
|
-
SetAdoptedStyles = 3
|
|
168
|
+
SetAdoptedStyles = 3
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
/* Helper Interfaces */
|
|
172
|
-
export interface IWindowWithOverrides {
|
|
173
|
-
clarityOverrides?: {
|
|
174
|
-
DeleteRule?: typeof CSSMediaRule.prototype.deleteRule;
|
|
175
|
-
MediaDeleteRule?: typeof CSSMediaRule.prototype.deleteRule;
|
|
176
|
-
AttachShadow?: typeof Element.prototype.attachShadow;
|
|
177
|
-
MediaInsertRule?: typeof CSSMediaRule.prototype.insertRule;
|
|
178
|
-
InsertRule?: typeof CSSStyleSheet.prototype.insertRule;
|
|
179
|
-
replace?: typeof CSSStyleSheet.prototype.replace;
|
|
180
|
-
replaceSync?: typeof CSSStyleSheet.prototype.replaceSync;
|
|
181
|
-
};
|
|
182
|
-
CSSStyleSheet?: typeof CSSStyleSheet;
|
|
183
|
-
CSSMediaRule?: typeof CSSMediaRule;
|
|
184
|
-
Element?: typeof Element;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
172
|
export interface Box {
|
|
188
173
|
x: number; // Left
|
|
189
174
|
y: number; // Top
|
|
@@ -238,7 +223,7 @@ export interface MutationQueue {
|
|
|
238
223
|
export interface MutationRecordWithTime {
|
|
239
224
|
timestamp: number;
|
|
240
225
|
mutation: MutationRecord;
|
|
241
|
-
}
|
|
226
|
+
}
|
|
242
227
|
|
|
243
228
|
export interface MutationHistory {
|
|
244
229
|
[key: string]: [/* Count */ number, /* Instance */ number, /* Remove Nodes Buffer */ NodeList?];
|
|
@@ -256,8 +241,8 @@ export interface RegionState {
|
|
|
256
241
|
|
|
257
242
|
export interface StyleSheetState {
|
|
258
243
|
time: number;
|
|
259
|
-
event: number
|
|
260
|
-
data: StyleSheetData
|
|
244
|
+
event: number,
|
|
245
|
+
data: StyleSheetData
|
|
261
246
|
}
|
|
262
247
|
|
|
263
248
|
/* Event Data */
|
|
@@ -271,7 +256,7 @@ export interface RegionData {
|
|
|
271
256
|
id: number;
|
|
272
257
|
visibility: RegionVisibility;
|
|
273
258
|
interaction: InteractionState;
|
|
274
|
-
name: string;
|
|
259
|
+
name: string;
|
|
275
260
|
}
|
|
276
261
|
|
|
277
262
|
export interface TargetMetadata {
|
|
@@ -284,5 +269,5 @@ export interface StyleSheetData {
|
|
|
284
269
|
id: number | string;
|
|
285
270
|
operation: StyleSheetOperation;
|
|
286
271
|
cssRules?: string;
|
|
287
|
-
newIds?: string[]
|
|
288
|
-
}
|
|
272
|
+
newIds?: string[]
|
|
273
|
+
}
|
package/types/performance.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { BooleanFlag, Target } from "./data";
|
|
2
|
+
|
|
1
3
|
/* Helper Interface */
|
|
2
4
|
|
|
5
|
+
|
|
3
6
|
// Reference: https://wicg.github.io/netinfo/#networkinformation-interface
|
|
4
7
|
export interface NavigatorConnection extends EventTarget {
|
|
5
8
|
effectiveType: string;
|
|
@@ -56,11 +59,7 @@ export const enum FunctionNames {
|
|
|
56
59
|
RegionCompute = 24,
|
|
57
60
|
PerformanceStart = 25,
|
|
58
61
|
ObserverObserve = 26,
|
|
59
|
-
ObserverHandle = 27
|
|
62
|
+
ObserverHandle = 27
|
|
60
63
|
}
|
|
61
64
|
|
|
62
|
-
declare global {
|
|
63
|
-
interface Function {
|
|
64
|
-
dn?: FunctionNames;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
65
|
+
declare global { interface Function { dn?: FunctionNames; } }
|
package/.lintstagedrc.yml
DELETED
package/biome.json
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
|
|
3
|
-
"organizeImports": {
|
|
4
|
-
"enabled": true
|
|
5
|
-
},
|
|
6
|
-
"linter": {
|
|
7
|
-
"enabled": true,
|
|
8
|
-
"rules": {
|
|
9
|
-
"recommended": true,
|
|
10
|
-
"style": {
|
|
11
|
-
"noUselessElse": "off",
|
|
12
|
-
"useDefaultParameterLast": {
|
|
13
|
-
"level": "error",
|
|
14
|
-
"fix": "none"
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
"a11y": {
|
|
18
|
-
"noNoninteractiveTabindex": {
|
|
19
|
-
"level": "error",
|
|
20
|
-
"fix": "none"
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
"suspicious": {
|
|
24
|
-
"noConsoleLog": "error",
|
|
25
|
-
"noConstEnum": "off"
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
"formatter": {
|
|
30
|
-
"enabled": true,
|
|
31
|
-
"indentStyle": "space",
|
|
32
|
-
"lineWidth": 140,
|
|
33
|
-
"indentWidth": 4,
|
|
34
|
-
"lineEnding": "crlf",
|
|
35
|
-
"ignore": ["yarn.lock"]
|
|
36
|
-
},
|
|
37
|
-
"vcs": {
|
|
38
|
-
"enabled": true,
|
|
39
|
-
"clientKind": "git",
|
|
40
|
-
"defaultBranch": "origin/master",
|
|
41
|
-
"useIgnoreFile": true
|
|
42
|
-
}
|
|
43
|
-
}
|