@guardian/commercial-core 5.2.1 → 5.3.0
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/cjs/event-timer.d.ts +1 -0
- package/dist/cjs/event-timer.js +9 -14
- package/dist/cjs/global.d.ts +2 -1
- package/dist/cjs/send-commercial-metrics.d.ts +1 -0
- package/dist/esm/event-timer.d.ts +1 -0
- package/dist/esm/event-timer.js +9 -14
- package/dist/esm/global.d.ts +2 -1
- package/dist/esm/send-commercial-metrics.d.ts +1 -0
- package/package.json +1 -1
package/dist/cjs/event-timer.js
CHANGED
|
@@ -93,20 +93,15 @@ class EventTimer {
|
|
|
93
93
|
},
|
|
94
94
|
],
|
|
95
95
|
};
|
|
96
|
-
this.properties =
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
effectiveType: 'effectiveType' in window.navigator.connection
|
|
106
|
-
? window.navigator.connection.effectiveType
|
|
107
|
-
: undefined,
|
|
108
|
-
}
|
|
109
|
-
: {};
|
|
96
|
+
this.properties = {
|
|
97
|
+
offlineCount: window.guardian.offlineCount,
|
|
98
|
+
};
|
|
99
|
+
if (window.navigator.connection) {
|
|
100
|
+
this.properties.type = window.navigator.connection.type;
|
|
101
|
+
this.properties.downlink = window.navigator.connection.downlink;
|
|
102
|
+
this.properties.effectiveType =
|
|
103
|
+
window.navigator.connection.effectiveType;
|
|
104
|
+
}
|
|
110
105
|
}
|
|
111
106
|
/**
|
|
112
107
|
* Adds an event timer property
|
package/dist/cjs/global.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { GoogleTagParams, GoogleTrackConversionObject, GuardianWindowConfig
|
|
|
3
3
|
import type { EventTimer } from '.';
|
|
4
4
|
declare global {
|
|
5
5
|
interface Navigator {
|
|
6
|
-
readonly connection
|
|
6
|
+
readonly connection?: NetworkInformation;
|
|
7
7
|
}
|
|
8
8
|
interface Window {
|
|
9
9
|
google_trackConversion?: (arg0: GoogleTrackConversionObject) => void;
|
|
@@ -15,6 +15,7 @@ declare global {
|
|
|
15
15
|
guardian: {
|
|
16
16
|
commercialTimer?: EventTimer;
|
|
17
17
|
config: GuardianWindowConfig;
|
|
18
|
+
offlineCount?: number;
|
|
18
19
|
};
|
|
19
20
|
ga: UniversalAnalytics.ga | null;
|
|
20
21
|
readonly navigator: Navigator;
|
package/dist/esm/event-timer.js
CHANGED
|
@@ -90,20 +90,15 @@ class EventTimer {
|
|
|
90
90
|
},
|
|
91
91
|
],
|
|
92
92
|
};
|
|
93
|
-
this.properties =
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
effectiveType: 'effectiveType' in window.navigator.connection
|
|
103
|
-
? window.navigator.connection.effectiveType
|
|
104
|
-
: undefined,
|
|
105
|
-
}
|
|
106
|
-
: {};
|
|
93
|
+
this.properties = {
|
|
94
|
+
offlineCount: window.guardian.offlineCount,
|
|
95
|
+
};
|
|
96
|
+
if (window.navigator.connection) {
|
|
97
|
+
this.properties.type = window.navigator.connection.type;
|
|
98
|
+
this.properties.downlink = window.navigator.connection.downlink;
|
|
99
|
+
this.properties.effectiveType =
|
|
100
|
+
window.navigator.connection.effectiveType;
|
|
101
|
+
}
|
|
107
102
|
}
|
|
108
103
|
/**
|
|
109
104
|
* Adds an event timer property
|
package/dist/esm/global.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { GoogleTagParams, GoogleTrackConversionObject, GuardianWindowConfig
|
|
|
3
3
|
import type { EventTimer } from '.';
|
|
4
4
|
declare global {
|
|
5
5
|
interface Navigator {
|
|
6
|
-
readonly connection
|
|
6
|
+
readonly connection?: NetworkInformation;
|
|
7
7
|
}
|
|
8
8
|
interface Window {
|
|
9
9
|
google_trackConversion?: (arg0: GoogleTrackConversionObject) => void;
|
|
@@ -15,6 +15,7 @@ declare global {
|
|
|
15
15
|
guardian: {
|
|
16
16
|
commercialTimer?: EventTimer;
|
|
17
17
|
config: GuardianWindowConfig;
|
|
18
|
+
offlineCount?: number;
|
|
18
19
|
};
|
|
19
20
|
ga: UniversalAnalytics.ga | null;
|
|
20
21
|
readonly navigator: Navigator;
|