clarity-js 0.7.42 → 0.7.43

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.
@@ -1,2 +1,2 @@
1
- let version = "0.7.42";
1
+ let version = "0.7.43";
2
2
  export default version;
@@ -17,6 +17,9 @@ let rootDomain = null;
17
17
  export function start(): void {
18
18
  rootDomain = null;
19
19
  const ua = navigator && "userAgent" in navigator ? navigator.userAgent : Constant.Empty;
20
+ const timezone = Intl?.DateTimeFormat()?.resolvedOptions()?.timeZone ?? '';
21
+ const timezoneOffset = new Date().getTimezoneOffset().toString();
22
+ const ancestorOrigins = window.location.ancestorOrigins ? Array.from(window.location.ancestorOrigins).toString() : '';
20
23
  const title = document && document.title ? document.title : Constant.Empty;
21
24
  electron = ua.indexOf(Constant.Electron) > 0 ? BooleanFlag.True : BooleanFlag.False;
22
25
 
@@ -41,6 +44,9 @@ export function start(): void {
41
44
  dimension.log(Dimension.DevicePixelRatio, `${window.devicePixelRatio}`);
42
45
  dimension.log(Dimension.Dob, u.dob.toString());
43
46
  dimension.log(Dimension.CookieVersion, u.version.toString());
47
+ dimension.log(Dimension.AncestorOrigins, ancestorOrigins);
48
+ dimension.log(Dimension.Timezone, timezone);
49
+ dimension.log(Dimension.TimezoneOffset, timezoneOffset);
44
50
 
45
51
  // Capture additional metadata as metrics
46
52
  metric.max(Metric.ClientTimestamp, s.ts);
@@ -9,7 +9,7 @@ import * as internal from "@src/diagnostic/internal";
9
9
  import * as navigation from "@src/performance/navigation";
10
10
 
11
11
  let observer: PerformanceObserver;
12
- const types: string[] = [Constant.Navigation, Constant.Resource, Constant.LongTask, Constant.FID, Constant.CLS, Constant.LCP];
12
+ const types: string[] = [Constant.Navigation, Constant.Resource, Constant.LongTask, Constant.FID, Constant.CLS, Constant.LCP, Constant.PerformanceEventTiming];
13
13
 
14
14
  export function start(): void {
15
15
  // Capture connection properties, if available
@@ -72,6 +72,9 @@ function process(entries: PerformanceEntryList): void {
72
72
  case Constant.FID:
73
73
  if (visible) { metric.max(Metric.FirstInputDelay, entry["processingStart"] - entry.startTime); }
74
74
  break;
75
+ case Constant.PerformanceEventTiming:
76
+ if (visible) { metric.max(Metric.InteractionNextPaint, entry.duration); }
77
+ break;
75
78
  case Constant.CLS:
76
79
  // Scale the value to avoid sending back floating point number
77
80
  if (visible && !entry["hadRecentInput"]) { metric.sum(Metric.CumulativeLayoutShift, entry["value"] * 1000); }
package/types/data.d.ts CHANGED
@@ -111,7 +111,8 @@ export const enum Metric {
111
111
  HardwareConcurrency = 33,
112
112
  DeviceMemory = 34,
113
113
  Electron = 35,
114
- ConstructedStyles = 36
114
+ ConstructedStyles = 36,
115
+ InteractionNextPaint = 37,
115
116
  }
116
117
 
117
118
  export const enum Dimension {
@@ -147,7 +148,10 @@ export const enum Dimension {
147
148
  CookieVersion = 29,
148
149
  DeviceFamily = 30, // Allows iOS SDK to override the DeviceFamily value parsed from UserAgent.
149
150
  InitialScrollTop = 31,
150
- InitialScrollBottom = 32
151
+ InitialScrollBottom = 32,
152
+ AncestorOrigins = 33,
153
+ Timezone = 34,
154
+ TimezoneOffset = 35
151
155
  }
152
156
 
153
157
  export const enum Check {
@@ -299,6 +303,7 @@ export const enum Constant {
299
303
  FID = "first-input",
300
304
  CLS = "layout-shift",
301
305
  LCP = "largest-contentful-paint",
306
+ PerformanceEventTiming = "event",
302
307
  HTTPS = "https://",
303
308
  CompressionStream = "CompressionStream",
304
309
  Accept = "Accept",