@guardian/commercial-core 5.1.0 → 5.1.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.
package/dist/cjs/event-timer.js
CHANGED
|
@@ -171,13 +171,7 @@ class EventTimer {
|
|
|
171
171
|
}
|
|
172
172
|
exports.EventTimer = EventTimer;
|
|
173
173
|
EventTimer._externallyDefinedEventNames = [
|
|
174
|
-
'cmp-
|
|
175
|
-
'cmp-
|
|
176
|
-
'cmp-
|
|
177
|
-
'cmp-ccpa-init',
|
|
178
|
-
'cmp-ccpa-ui-displayed',
|
|
179
|
-
'cmp-ccpa-got-consent',
|
|
180
|
-
'cmp-aus-init',
|
|
181
|
-
'cmp-aus-ui-displayed',
|
|
182
|
-
'cmp-aus-got-consent',
|
|
174
|
+
'cmp-init',
|
|
175
|
+
'cmp-ui-displayed',
|
|
176
|
+
'cmp-got-consent',
|
|
183
177
|
];
|
|
@@ -10,8 +10,9 @@ const findBreakpoint = (width) => {
|
|
|
10
10
|
return 'mobile';
|
|
11
11
|
};
|
|
12
12
|
const getViewportTargeting = ({ viewPortWidth, cmpBannerWillShow, }) => {
|
|
13
|
-
// Don’t show inskin if if a privacy message will be shown
|
|
14
|
-
const
|
|
13
|
+
// Don’t show inskin if if a privacy message will be shown or on preview
|
|
14
|
+
const isPreview = window.guardian.config.page.isPreview;
|
|
15
|
+
const inskin = cmpBannerWillShow || isPreview ? 'f' : 't';
|
|
15
16
|
return {
|
|
16
17
|
bp: findBreakpoint(viewPortWidth),
|
|
17
18
|
skinsize: viewPortWidth >= 1560 ? 'l' : 's',
|
package/dist/cjs/types.d.ts
CHANGED
|
@@ -32,16 +32,17 @@ export type GuardianWindowConfig = {
|
|
|
32
32
|
googleAnalytics?: GuardianAnalyticsConfig;
|
|
33
33
|
isDotcomRendering: boolean;
|
|
34
34
|
ophan: {
|
|
35
|
-
pageViewId: string;
|
|
36
35
|
browserId?: string;
|
|
36
|
+
pageViewId: string;
|
|
37
37
|
};
|
|
38
38
|
page: {
|
|
39
|
-
|
|
39
|
+
edition: Edition;
|
|
40
|
+
isPreview: boolean;
|
|
40
41
|
isSensitive: boolean;
|
|
41
42
|
pageId: string;
|
|
42
43
|
section: string;
|
|
44
|
+
sharedAdTargeting?: Record<string, string | string[]>;
|
|
43
45
|
videoDuration: number;
|
|
44
|
-
edition: Edition;
|
|
45
46
|
};
|
|
46
47
|
tests?: {
|
|
47
48
|
[key: `${string}Control`]: 'control';
|
package/dist/esm/event-timer.js
CHANGED
|
@@ -167,14 +167,8 @@ class EventTimer {
|
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
EventTimer._externallyDefinedEventNames = [
|
|
170
|
-
'cmp-
|
|
171
|
-
'cmp-
|
|
172
|
-
'cmp-
|
|
173
|
-
'cmp-ccpa-init',
|
|
174
|
-
'cmp-ccpa-ui-displayed',
|
|
175
|
-
'cmp-ccpa-got-consent',
|
|
176
|
-
'cmp-aus-init',
|
|
177
|
-
'cmp-aus-ui-displayed',
|
|
178
|
-
'cmp-aus-got-consent',
|
|
170
|
+
'cmp-init',
|
|
171
|
+
'cmp-ui-displayed',
|
|
172
|
+
'cmp-got-consent',
|
|
179
173
|
];
|
|
180
174
|
export { EventTimer };
|
|
@@ -7,8 +7,9 @@ const findBreakpoint = (width) => {
|
|
|
7
7
|
return 'mobile';
|
|
8
8
|
};
|
|
9
9
|
const getViewportTargeting = ({ viewPortWidth, cmpBannerWillShow, }) => {
|
|
10
|
-
// Don’t show inskin if if a privacy message will be shown
|
|
11
|
-
const
|
|
10
|
+
// Don’t show inskin if if a privacy message will be shown or on preview
|
|
11
|
+
const isPreview = window.guardian.config.page.isPreview;
|
|
12
|
+
const inskin = cmpBannerWillShow || isPreview ? 'f' : 't';
|
|
12
13
|
return {
|
|
13
14
|
bp: findBreakpoint(viewPortWidth),
|
|
14
15
|
skinsize: viewPortWidth >= 1560 ? 'l' : 's',
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -32,16 +32,17 @@ export type GuardianWindowConfig = {
|
|
|
32
32
|
googleAnalytics?: GuardianAnalyticsConfig;
|
|
33
33
|
isDotcomRendering: boolean;
|
|
34
34
|
ophan: {
|
|
35
|
-
pageViewId: string;
|
|
36
35
|
browserId?: string;
|
|
36
|
+
pageViewId: string;
|
|
37
37
|
};
|
|
38
38
|
page: {
|
|
39
|
-
|
|
39
|
+
edition: Edition;
|
|
40
|
+
isPreview: boolean;
|
|
40
41
|
isSensitive: boolean;
|
|
41
42
|
pageId: string;
|
|
42
43
|
section: string;
|
|
44
|
+
sharedAdTargeting?: Record<string, string | string[]>;
|
|
43
45
|
videoDuration: number;
|
|
44
|
-
edition: Edition;
|
|
45
46
|
};
|
|
46
47
|
tests?: {
|
|
47
48
|
[key: `${string}Control`]: 'control';
|