clarity-js 0.8.23 → 0.8.25
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 +162 -140
- package/build/clarity.min.js +1 -1
- package/build/clarity.module.js +162 -140
- package/build/clarity.performance.js +1 -1
- package/package.json +1 -1
- package/src/clarity.ts +6 -2
- package/src/core/dynamic.ts +41 -0
- package/src/core/history.ts +0 -2
- package/src/core/index.ts +0 -2
- package/src/core/measure.ts +1 -3
- package/src/core/version.ts +1 -1
- package/src/data/metadata.ts +2 -2
- package/src/data/upload.ts +7 -5
- package/src/diagnostic/index.ts +0 -2
- package/src/diagnostic/script.ts +0 -2
- package/src/interaction/change.ts +0 -2
- package/src/interaction/click.ts +0 -2
- package/src/interaction/clipboard.ts +0 -2
- package/src/interaction/encode.ts +1 -0
- package/src/interaction/index.ts +0 -2
- package/src/interaction/input.ts +2 -4
- package/src/interaction/pointer.ts +0 -3
- package/src/interaction/resize.ts +0 -2
- package/src/interaction/scroll.ts +0 -3
- package/src/interaction/selection.ts +0 -2
- package/src/interaction/submit.ts +0 -2
- package/src/interaction/unload.ts +0 -2
- package/src/interaction/visibility.ts +0 -2
- package/src/layout/document.ts +0 -2
- package/src/layout/index.ts +0 -2
- package/src/layout/mutation.ts +0 -4
- package/src/layout/region.ts +0 -2
- package/src/performance/index.ts +0 -2
- package/src/performance/observer.ts +0 -3
- package/types/data.d.ts +2 -1
- package/types/interaction.d.ts +1 -0
- package/types/performance.d.ts +0 -34
package/src/layout/mutation.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Priority, Task, Timer } from "@clarity-types/core";
|
|
2
2
|
import { Code, Event, Metric, Severity } from "@clarity-types/data";
|
|
3
3
|
import { Constant, MutationHistory, MutationRecordWithTime, MutationQueue, Setting, Source } from "@clarity-types/layout";
|
|
4
|
-
import { FunctionNames } from "@clarity-types/performance";
|
|
5
4
|
import api from "@src/core/api";
|
|
6
5
|
import * as core from "@src/core";
|
|
7
6
|
import * as event from "@src/core/event";
|
|
@@ -35,7 +34,6 @@ let observedNodes: WeakMap<Node, MutationObserver> = new WeakMap<Node, MutationO
|
|
|
35
34
|
const IGNORED_ATTRIBUTES = ["data-google-query-id", "data-load-complete", "data-google-container-id"];
|
|
36
35
|
|
|
37
36
|
export function start(): void {
|
|
38
|
-
start.dn = FunctionNames.MutationStart;
|
|
39
37
|
observers = new Set();
|
|
40
38
|
queue = [];
|
|
41
39
|
timeout = null;
|
|
@@ -107,7 +105,6 @@ export function disconnect(n: Node): void {
|
|
|
107
105
|
}
|
|
108
106
|
|
|
109
107
|
function handle(m: MutationRecord[]): void {
|
|
110
|
-
handle.dn = FunctionNames.MutationHandle;
|
|
111
108
|
// Queue up mutation records for asynchronous processing
|
|
112
109
|
let now = time();
|
|
113
110
|
summary.track(Event.Mutation, now);
|
|
@@ -328,7 +325,6 @@ function trigger(): void {
|
|
|
328
325
|
}
|
|
329
326
|
|
|
330
327
|
function generate(target: Node, type: MutationRecordType): void {
|
|
331
|
-
generate.dn = FunctionNames.MutationGenerate;
|
|
332
328
|
measure(handle)([
|
|
333
329
|
{
|
|
334
330
|
addedNodes: [target],
|
package/src/layout/region.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Event, Setting } from "@clarity-types/data";
|
|
2
2
|
import { InteractionState, RegionData, RegionState, RegionQueue, RegionVisibility } from "@clarity-types/layout";
|
|
3
|
-
import { FunctionNames } from "@clarity-types/performance";
|
|
4
3
|
import { time } from "@src/core/time";
|
|
5
4
|
import * as dom from "@src/layout/dom";
|
|
6
5
|
import encode from "@src/layout/encode";
|
|
@@ -60,7 +59,6 @@ export function track(id: number, event: Event): void {
|
|
|
60
59
|
}
|
|
61
60
|
|
|
62
61
|
export function compute(): void {
|
|
63
|
-
compute.dn = FunctionNames.RegionCompute;
|
|
64
62
|
// Process any regions where we couldn't resolve an "id" for at the time of last intersection observer event
|
|
65
63
|
// This could happen in cases where elements are not yet processed by Clarity's virtual DOM but browser reports a change, regardless.
|
|
66
64
|
// For those cases we add them to the queue and re-process them below
|
package/src/performance/index.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { FunctionNames } from "@clarity-types/performance";
|
|
2
1
|
import * as navigation from "@src/performance/navigation";
|
|
3
2
|
import * as observer from "@src/performance/observer";
|
|
4
3
|
|
|
5
4
|
export function start(): void {
|
|
6
|
-
start.dn = FunctionNames.PerformanceStart;
|
|
7
5
|
navigation.reset();
|
|
8
6
|
observer.start();
|
|
9
7
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Code, Constant, Dimension, Metric, Severity, PerformanceEventTiming } from "@clarity-types/data";
|
|
2
|
-
import { FunctionNames } from "@clarity-types/performance";
|
|
3
2
|
import config from "@src/core/config";
|
|
4
3
|
import { bind } from "@src/core/event";
|
|
5
4
|
import measure from "@src/core/measure";
|
|
@@ -31,7 +30,6 @@ export function start(): void {
|
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
function observe(): void {
|
|
34
|
-
observe.dn = FunctionNames.ObserverObserve;
|
|
35
33
|
// Some browsers will throw an error for unsupported entryType, e.g. "layout-shift"
|
|
36
34
|
// In those cases, we log it as a warning and continue with rest of the Clarity processing
|
|
37
35
|
try {
|
|
@@ -53,7 +51,6 @@ function observe(): void {
|
|
|
53
51
|
}
|
|
54
52
|
|
|
55
53
|
function handle(entries: PerformanceObserverEntryList): void {
|
|
56
|
-
handle.dn = FunctionNames.ObserverHandle;
|
|
57
54
|
process(entries.getEntries());
|
|
58
55
|
}
|
|
59
56
|
|
package/types/data.d.ts
CHANGED
|
@@ -84,6 +84,7 @@ export const enum Event {
|
|
|
84
84
|
BackGesture = 105,
|
|
85
85
|
WebViewStatus = 106,
|
|
86
86
|
AppInstallReferrer = 107
|
|
87
|
+
// 200-300 reserved for internal use
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
export const enum Metric {
|
|
@@ -320,6 +321,7 @@ export const enum Constant {
|
|
|
320
321
|
Signal = "SIGNAL",
|
|
321
322
|
Extract = "EXTRACT",
|
|
322
323
|
Snapshot = "SNAPSHOT",
|
|
324
|
+
Module = "MODULE",
|
|
323
325
|
UserHint = "userHint",
|
|
324
326
|
UserType = "userType",
|
|
325
327
|
UserId = "userId",
|
|
@@ -353,7 +355,6 @@ export const enum Constant {
|
|
|
353
355
|
Caret = "^",
|
|
354
356
|
Granted = "granted",
|
|
355
357
|
Denied = "denied",
|
|
356
|
-
BeaconError = "BeaconError",
|
|
357
358
|
}
|
|
358
359
|
|
|
359
360
|
export const enum XMLReadyState {
|
package/types/interaction.d.ts
CHANGED
package/types/performance.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { BooleanFlag, Target } from "./data";
|
|
2
|
-
|
|
3
1
|
/* Helper Interface */
|
|
4
2
|
|
|
5
3
|
|
|
@@ -31,35 +29,3 @@ export interface NavigationData {
|
|
|
31
29
|
encodedSize: number;
|
|
32
30
|
decodedSize: number;
|
|
33
31
|
}
|
|
34
|
-
|
|
35
|
-
export const enum FunctionNames {
|
|
36
|
-
HistoryCompute = 1,
|
|
37
|
-
Restart = 2,
|
|
38
|
-
DiagnosticStart = 3,
|
|
39
|
-
ScriptHandler = 4,
|
|
40
|
-
ChangeRecompute = 5,
|
|
41
|
-
ClickHandler = 6,
|
|
42
|
-
ClipboardRecompute = 7,
|
|
43
|
-
InteractionStart = 8,
|
|
44
|
-
InputRecompute = 9,
|
|
45
|
-
PointerMouse = 10,
|
|
46
|
-
PointerTouch = 11,
|
|
47
|
-
ResizeRecompute = 12,
|
|
48
|
-
ScrollRecompute = 13,
|
|
49
|
-
ScrollCompute = 14,
|
|
50
|
-
SelectionRecompute = 15,
|
|
51
|
-
SubmitRecompute = 16,
|
|
52
|
-
UnloadRecompute = 17,
|
|
53
|
-
VisibilityRecompute = 18,
|
|
54
|
-
DocumentCompute = 19,
|
|
55
|
-
LayoutStart = 20,
|
|
56
|
-
MutationStart = 21,
|
|
57
|
-
MutationHandle = 22,
|
|
58
|
-
MutationGenerate = 23,
|
|
59
|
-
RegionCompute = 24,
|
|
60
|
-
PerformanceStart = 25,
|
|
61
|
-
ObserverObserve = 26,
|
|
62
|
-
ObserverHandle = 27
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
declare global { interface Function { dn?: FunctionNames; } }
|