@guardian/commercial-core 5.0.0 → 5.1.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.
@@ -27,8 +27,8 @@ declare class AdSize extends Array<number> {
27
27
  get width(): number;
28
28
  get height(): number;
29
29
  }
30
- type SizeKeys = '160x600' | '300x1050' | '300x250' | '300x600' | '728x90' | '970x250' | 'billboard' | 'empty' | 'fabric' | 'fluid' | 'googleCard' | 'halfPage' | 'inlineMerchandising' | 'leaderboard' | 'merchandising' | 'merchandisingHigh' | 'merchandisingHighAdFeature' | 'mobilesticky' | 'mpu' | 'outOfPage' | 'outstreamDesktop' | 'outstreamGoogleDesktop' | 'outstreamMobile' | 'portrait' | 'skyscraper' | 'cascade';
31
- type SlotName = 'right' | 'comments' | 'top-above-nav' | 'mostpop' | 'merchandising' | 'merchandising-high' | 'merchandising-high-lucky' | 'survey' | 'im' | 'inline' | 'mostpop' | 'comments' | 'top-above-nav' | 'carrot' | 'epic' | 'mobile-sticky' | 'crossword-banner';
30
+ type SizeKeys = '160x600' | '300x1050' | '300x250' | '300x600' | '728x90' | '970x250' | 'billboard' | 'cascade' | 'empty' | 'fabric' | 'fluid' | 'googleCard' | 'halfPage' | 'inlineMerchandising' | 'leaderboard' | 'merchandising' | 'merchandisingHigh' | 'merchandisingHighAdFeature' | 'mobilesticky' | 'mpu' | 'outOfPage' | 'outstreamDesktop' | 'outstreamGoogleDesktop' | 'outstreamMobile' | 'portrait' | 'portraitInterstitial' | 'skyscraper';
31
+ type SlotName = 'right' | 'comments' | 'top-above-nav' | 'mostpop' | 'merchandising' | 'merchandising-high' | 'merchandising-high-lucky' | 'survey' | 'im' | 'inline' | 'mostpop' | 'comments' | 'top-above-nav' | 'carrot' | 'epic' | 'mobile-sticky' | 'crossword-banner' | 'exclusion';
32
32
  type SizeMapping = Partial<Record<Breakpoint, AdSize[]>>;
33
33
  type SlotSizeMappings = Record<SlotName, SizeMapping>;
34
34
  declare const createAdSize: (width: number, height: number) => AdSize;
@@ -61,6 +61,7 @@ const namedStandardAdSizes = {
61
61
  portrait: createAdSize(300, 1050),
62
62
  skyscraper: createAdSize(160, 600),
63
63
  cascade: createAdSize(940, 230),
64
+ portraitInterstitial: createAdSize(320, 480),
64
65
  };
65
66
  const standardAdSizes = {
66
67
  '970x250': namedStandardAdSizes.billboard,
@@ -77,11 +78,17 @@ const outstreamSizes = {
77
78
  outstreamMobile: createAdSize(300, 197),
78
79
  };
79
80
  exports.outstreamSizes = outstreamSizes;
80
- const dfpProprietaryAdSizes = {
81
+ /**
82
+ * Ad sizes commonly associated with third parties
83
+ */
84
+ const proprietaryAdSizes = {
81
85
  fluid: createAdSize(0, 0),
82
86
  googleCard: createAdSize(300, 274),
83
87
  outOfPage: createAdSize(1, 1),
84
88
  };
89
+ /**
90
+ * Ad sizes associated with in-house formats
91
+ */
85
92
  const guardianProprietaryAdSizes = {
86
93
  empty: createAdSize(2, 2),
87
94
  fabric: createAdSize(88, 71),
@@ -94,7 +101,7 @@ const adSizes = {
94
101
  ...namedStandardAdSizes,
95
102
  ...standardAdSizes,
96
103
  ...outstreamSizes,
97
- ...dfpProprietaryAdSizes,
104
+ ...proprietaryAdSizes,
98
105
  ...guardianProprietaryAdSizes,
99
106
  };
100
107
  exports.adSizes = adSizes;
@@ -112,6 +119,7 @@ const slotSizeMappings = {
112
119
  adSizes.mpu,
113
120
  adSizes.googleCard,
114
121
  adSizes.fluid,
122
+ adSizes.portraitInterstitial,
115
123
  ],
116
124
  phablet: [
117
125
  adSizes.outOfPage,
@@ -272,6 +280,11 @@ const slotSizeMappings = {
272
280
  tablet: [adSizes.outOfPage, adSizes.empty, adSizes.leaderboard],
273
281
  phablet: [adSizes.outOfPage, adSizes.empty, adSizes.leaderboard],
274
282
  },
283
+ exclusion: {
284
+ mobile: [adSizes.empty],
285
+ phablet: [adSizes.empty],
286
+ desktop: [adSizes.empty],
287
+ },
275
288
  };
276
289
  exports.slotSizeMappings = slotSizeMappings;
277
290
  const getAdSize = (size) => adSizes[size];
@@ -27,8 +27,8 @@ declare class AdSize extends Array<number> {
27
27
  get width(): number;
28
28
  get height(): number;
29
29
  }
30
- type SizeKeys = '160x600' | '300x1050' | '300x250' | '300x600' | '728x90' | '970x250' | 'billboard' | 'empty' | 'fabric' | 'fluid' | 'googleCard' | 'halfPage' | 'inlineMerchandising' | 'leaderboard' | 'merchandising' | 'merchandisingHigh' | 'merchandisingHighAdFeature' | 'mobilesticky' | 'mpu' | 'outOfPage' | 'outstreamDesktop' | 'outstreamGoogleDesktop' | 'outstreamMobile' | 'portrait' | 'skyscraper' | 'cascade';
31
- type SlotName = 'right' | 'comments' | 'top-above-nav' | 'mostpop' | 'merchandising' | 'merchandising-high' | 'merchandising-high-lucky' | 'survey' | 'im' | 'inline' | 'mostpop' | 'comments' | 'top-above-nav' | 'carrot' | 'epic' | 'mobile-sticky' | 'crossword-banner';
30
+ type SizeKeys = '160x600' | '300x1050' | '300x250' | '300x600' | '728x90' | '970x250' | 'billboard' | 'cascade' | 'empty' | 'fabric' | 'fluid' | 'googleCard' | 'halfPage' | 'inlineMerchandising' | 'leaderboard' | 'merchandising' | 'merchandisingHigh' | 'merchandisingHighAdFeature' | 'mobilesticky' | 'mpu' | 'outOfPage' | 'outstreamDesktop' | 'outstreamGoogleDesktop' | 'outstreamMobile' | 'portrait' | 'portraitInterstitial' | 'skyscraper';
31
+ type SlotName = 'right' | 'comments' | 'top-above-nav' | 'mostpop' | 'merchandising' | 'merchandising-high' | 'merchandising-high-lucky' | 'survey' | 'im' | 'inline' | 'mostpop' | 'comments' | 'top-above-nav' | 'carrot' | 'epic' | 'mobile-sticky' | 'crossword-banner' | 'exclusion';
32
32
  type SizeMapping = Partial<Record<Breakpoint, AdSize[]>>;
33
33
  type SlotSizeMappings = Record<SlotName, SizeMapping>;
34
34
  declare const createAdSize: (width: number, height: number) => AdSize;
@@ -57,6 +57,7 @@ const namedStandardAdSizes = {
57
57
  portrait: createAdSize(300, 1050),
58
58
  skyscraper: createAdSize(160, 600),
59
59
  cascade: createAdSize(940, 230),
60
+ portraitInterstitial: createAdSize(320, 480),
60
61
  };
61
62
  const standardAdSizes = {
62
63
  '970x250': namedStandardAdSizes.billboard,
@@ -71,11 +72,17 @@ const outstreamSizes = {
71
72
  outstreamGoogleDesktop: createAdSize(550, 310),
72
73
  outstreamMobile: createAdSize(300, 197),
73
74
  };
74
- const dfpProprietaryAdSizes = {
75
+ /**
76
+ * Ad sizes commonly associated with third parties
77
+ */
78
+ const proprietaryAdSizes = {
75
79
  fluid: createAdSize(0, 0),
76
80
  googleCard: createAdSize(300, 274),
77
81
  outOfPage: createAdSize(1, 1),
78
82
  };
83
+ /**
84
+ * Ad sizes associated with in-house formats
85
+ */
79
86
  const guardianProprietaryAdSizes = {
80
87
  empty: createAdSize(2, 2),
81
88
  fabric: createAdSize(88, 71),
@@ -88,7 +95,7 @@ const adSizes = {
88
95
  ...namedStandardAdSizes,
89
96
  ...standardAdSizes,
90
97
  ...outstreamSizes,
91
- ...dfpProprietaryAdSizes,
98
+ ...proprietaryAdSizes,
92
99
  ...guardianProprietaryAdSizes,
93
100
  };
94
101
  /**
@@ -105,6 +112,7 @@ const slotSizeMappings = {
105
112
  adSizes.mpu,
106
113
  adSizes.googleCard,
107
114
  adSizes.fluid,
115
+ adSizes.portraitInterstitial,
108
116
  ],
109
117
  phablet: [
110
118
  adSizes.outOfPage,
@@ -265,6 +273,11 @@ const slotSizeMappings = {
265
273
  tablet: [adSizes.outOfPage, adSizes.empty, adSizes.leaderboard],
266
274
  phablet: [adSizes.outOfPage, adSizes.empty, adSizes.leaderboard],
267
275
  },
276
+ exclusion: {
277
+ mobile: [adSizes.empty],
278
+ phablet: [adSizes.empty],
279
+ desktop: [adSizes.empty],
280
+ },
268
281
  };
269
282
  const getAdSize = (size) => adSizes[size];
270
283
  // Export for testing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guardian/commercial-core",
3
- "version": "5.0.0",
3
+ "version": "5.1.0",
4
4
  "description": "Guardian advertising business logic",
5
5
  "homepage": "https://github.com/guardian/commercial-core#readme",
6
6
  "bugs": {