@mjhls/mjh-framework 1.0.463 → 1.0.465

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.
Files changed (66) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/AD300x250.js +1 -2
  3. package/dist/cjs/AD300x250x600.js +1 -2
  4. package/dist/cjs/AD728x90.js +1 -2
  5. package/dist/cjs/ADFloatingFooter.js +1 -2
  6. package/dist/cjs/ADGutter.js +1 -2
  7. package/dist/cjs/ADSponsoredResources.js +1 -2
  8. package/dist/cjs/ADWebcast.js +1 -2
  9. package/dist/cjs/ADWelcome.js +1 -2
  10. package/dist/cjs/AdSlot.js +1 -2
  11. package/dist/cjs/ArticleQueue.js +1 -2
  12. package/dist/cjs/Auth.js +1 -2
  13. package/dist/cjs/Beam.js +1 -2
  14. package/dist/cjs/CMEDeck.js +1 -2
  15. package/dist/cjs/Column3.js +1 -2
  16. package/dist/cjs/DeckContent.js +2 -3
  17. package/dist/cjs/GridContent.js +26 -16
  18. package/dist/cjs/IssueLanding.js +3 -4
  19. package/dist/cjs/LeftNav.js +1 -2
  20. package/dist/cjs/MasterDeck.js +124 -26
  21. package/dist/cjs/QueueDeckExpanded.js +14 -5
  22. package/dist/cjs/Segment.js +1 -2
  23. package/dist/cjs/TemplateNormal.js +1 -2
  24. package/dist/cjs/VideoSeriesFilter.js +1 -2
  25. package/dist/cjs/View.js +5 -6
  26. package/dist/cjs/{asyncToGenerator-db08763c.js → asyncToGenerator-8e707718.js} +536 -2
  27. package/dist/cjs/getSerializers.js +1 -2
  28. package/dist/cjs/{getTargeting-3ced038f.js → getTargeting-86e68d62.js} +7 -0
  29. package/dist/cjs/getTargeting.js +1 -1
  30. package/dist/cjs/index.js +4 -5
  31. package/dist/esm/AD300x250.js +1 -2
  32. package/dist/esm/AD300x250x600.js +1 -2
  33. package/dist/esm/AD728x90.js +1 -2
  34. package/dist/esm/ADFloatingFooter.js +1 -2
  35. package/dist/esm/ADGutter.js +1 -2
  36. package/dist/esm/ADSponsoredResources.js +1 -2
  37. package/dist/esm/ADWebcast.js +1 -2
  38. package/dist/esm/ADWelcome.js +1 -2
  39. package/dist/esm/AdSlot.js +1 -2
  40. package/dist/esm/ArticleQueue.js +1 -2
  41. package/dist/esm/Auth.js +1 -2
  42. package/dist/esm/Beam.js +1 -2
  43. package/dist/esm/CMEDeck.js +1 -2
  44. package/dist/esm/Column3.js +1 -2
  45. package/dist/esm/DeckContent.js +2 -3
  46. package/dist/esm/GridContent.js +26 -16
  47. package/dist/esm/IssueLanding.js +3 -4
  48. package/dist/esm/LeftNav.js +1 -2
  49. package/dist/esm/MasterDeck.js +123 -25
  50. package/dist/esm/QueueDeckExpanded.js +14 -5
  51. package/dist/esm/Segment.js +1 -2
  52. package/dist/esm/TemplateNormal.js +1 -2
  53. package/dist/esm/VideoSeriesFilter.js +1 -2
  54. package/dist/esm/View.js +5 -6
  55. package/dist/esm/{asyncToGenerator-204b5a5c.js → asyncToGenerator-0379e924.js} +536 -3
  56. package/dist/esm/getSerializers.js +1 -2
  57. package/dist/esm/{getTargeting-8f4bd5db.js → getTargeting-1f2c61e3.js} +7 -0
  58. package/dist/esm/getTargeting.js +1 -1
  59. package/dist/esm/index.js +4 -5
  60. package/package.json +1 -1
  61. package/dist/cjs/promise-074978a7.js +0 -540
  62. package/dist/esm/promise-53143c9a.js +0 -537
  63. /package/dist/cjs/{ADInfeed-5adbfbba.js → ADInfeed-4b904089.js} +0 -0
  64. /package/dist/cjs/{ADlgInfeed-028da9eb.js → ADlgInfeed-f540f438.js} +0 -0
  65. /package/dist/esm/{ADInfeed-08192400.js → ADInfeed-23148e88.js} +0 -0
  66. /package/dist/esm/{ADlgInfeed-a90cf553.js → ADlgInfeed-5460339b.js} +0 -0
@@ -12,9 +12,8 @@ import './debounce-8cd9e09c.js';
12
12
  import './main-adf6ec37.js';
13
13
  import { _ as _slicedToArray } from './slicedToArray-f1e40361.js';
14
14
  import './stringify-e30bc114.js';
15
- import './asyncToGenerator-204b5a5c.js';
15
+ import './asyncToGenerator-0379e924.js';
16
16
  import './_set-species-6f64f1c1.js';
17
- import './promise-53143c9a.js';
18
17
  import './Beam.js';
19
18
  import './Segment.js';
20
19
  import DFPAdSlot from './AdSlot.js';
@@ -12,9 +12,8 @@ import './debounce-8cd9e09c.js';
12
12
  import './main-adf6ec37.js';
13
13
  import { _ as _slicedToArray } from './slicedToArray-f1e40361.js';
14
14
  import './stringify-e30bc114.js';
15
- import './asyncToGenerator-204b5a5c.js';
15
+ import './asyncToGenerator-0379e924.js';
16
16
  import './_set-species-6f64f1c1.js';
17
- import './promise-53143c9a.js';
18
17
  import './Beam.js';
19
18
  import './Segment.js';
20
19
  import DFPAdSlot from './AdSlot.js';
@@ -12,9 +12,8 @@ import './debounce-8cd9e09c.js';
12
12
  import './main-adf6ec37.js';
13
13
  import { _ as _slicedToArray } from './slicedToArray-f1e40361.js';
14
14
  import './stringify-e30bc114.js';
15
- import './asyncToGenerator-204b5a5c.js';
15
+ import './asyncToGenerator-0379e924.js';
16
16
  import './_set-species-6f64f1c1.js';
17
- import './promise-53143c9a.js';
18
17
  import './Beam.js';
19
18
  import './Segment.js';
20
19
  import DFPAdSlot from './AdSlot.js';
@@ -12,9 +12,8 @@ import { d as debounce_1 } from './debounce-8cd9e09c.js';
12
12
  import { b as main_16 } from './main-adf6ec37.js';
13
13
  import { _ as _slicedToArray } from './slicedToArray-f1e40361.js';
14
14
  import './stringify-e30bc114.js';
15
- import './asyncToGenerator-204b5a5c.js';
15
+ import './asyncToGenerator-0379e924.js';
16
16
  import './_set-species-6f64f1c1.js';
17
- import './promise-53143c9a.js';
18
17
  import Beam from './Beam.js';
19
18
  import Segment from './Segment.js';
20
19
 
@@ -27,9 +27,8 @@ import { m as main_36 } from './main-adf6ec37.js';
27
27
  import './entities-7cc3bf45.js';
28
28
  import { _ as _slicedToArray, a as _getIterator } from './slicedToArray-f1e40361.js';
29
29
  import { _ as _JSON$stringify } from './stringify-e30bc114.js';
30
- import './asyncToGenerator-204b5a5c.js';
30
+ import './asyncToGenerator-0379e924.js';
31
31
  import './_set-species-6f64f1c1.js';
32
- import './promise-53143c9a.js';
33
32
  import './Beam.js';
34
33
  import './Segment.js';
35
34
  import DFPAdSlot from './AdSlot.js';
package/dist/esm/Auth.js CHANGED
@@ -10,9 +10,8 @@ import React__default, { useEffect, useState } from 'react';
10
10
  import Router from 'next/router';
11
11
  import { _ as _slicedToArray, a as _getIterator } from './slicedToArray-f1e40361.js';
12
12
  import { _ as _JSON$stringify } from './stringify-e30bc114.js';
13
- import { _ as _asyncToGenerator, r as regenerator } from './asyncToGenerator-204b5a5c.js';
13
+ import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-0379e924.js';
14
14
  import './_set-species-6f64f1c1.js';
15
- import './promise-53143c9a.js';
16
15
  import { Col, Form, Button, Spinner } from 'react-bootstrap';
17
16
  import { u as util } from './util-7700fc59.js';
18
17
  import useSWR from 'swr';
package/dist/esm/Beam.js CHANGED
@@ -5,9 +5,8 @@ import './_library-528f1934.js';
5
5
  import './_iter-detect-6e099a34.js';
6
6
  import './web.dom.iterable-46c95e52.js';
7
7
  import { _ as _JSON$stringify } from './stringify-e30bc114.js';
8
- import { _ as _asyncToGenerator, r as regenerator } from './asyncToGenerator-204b5a5c.js';
8
+ import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-0379e924.js';
9
9
  import './_set-species-6f64f1c1.js';
10
- import './promise-53143c9a.js';
11
10
 
12
11
  require("babel-polyfill");
13
12
  // server key for beam
@@ -20,9 +20,8 @@ import 'react-dom';
20
20
  import { V as VisibilitySensor } from './visibility-sensor-0baa4eea.js';
21
21
  import { m as main_36 } from './main-adf6ec37.js';
22
22
  import { _ as _slicedToArray } from './slicedToArray-f1e40361.js';
23
- import { _ as _asyncToGenerator, r as regenerator } from './asyncToGenerator-204b5a5c.js';
23
+ import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-0379e924.js';
24
24
  import './_set-species-6f64f1c1.js';
25
- import './promise-53143c9a.js';
26
25
  import { Spinner, Container, Row, Col } from 'react-bootstrap';
27
26
 
28
27
  var corsProxy = 'https://cors-anywhere.herokuapp.com/';
@@ -14,9 +14,8 @@ import './debounce-8cd9e09c.js';
14
14
  import { m as main_36 } from './main-adf6ec37.js';
15
15
  import './slicedToArray-f1e40361.js';
16
16
  import './stringify-e30bc114.js';
17
- import './asyncToGenerator-204b5a5c.js';
17
+ import './asyncToGenerator-0379e924.js';
18
18
  import './_set-species-6f64f1c1.js';
19
- import './promise-53143c9a.js';
20
19
  import './Beam.js';
21
20
  import './Segment.js';
22
21
  import './AdSlot.js';
@@ -32,13 +32,12 @@ import { m as main_36 } from './main-adf6ec37.js';
32
32
  import { c as clean_html_1 } from './entities-7cc3bf45.js';
33
33
  import './slicedToArray-f1e40361.js';
34
34
  import './stringify-e30bc114.js';
35
- import './asyncToGenerator-204b5a5c.js';
35
+ import './asyncToGenerator-0379e924.js';
36
36
  import './_set-species-6f64f1c1.js';
37
- import './promise-53143c9a.js';
38
37
  import './Beam.js';
39
38
  import './Segment.js';
40
39
  import './AdSlot.js';
41
- import { A as ADInfeed } from './ADInfeed-08192400.js';
40
+ import { A as ADInfeed } from './ADInfeed-23148e88.js';
42
41
 
43
42
  var DeckContent = function (_React$Component) {
44
43
  _inherits(DeckContent, _React$Component);
@@ -32,15 +32,14 @@ import { m as main_36 } from './main-adf6ec37.js';
32
32
  import { c as clean_html_1 } from './entities-7cc3bf45.js';
33
33
  import './slicedToArray-f1e40361.js';
34
34
  import './stringify-e30bc114.js';
35
- import './asyncToGenerator-204b5a5c.js';
35
+ import './asyncToGenerator-0379e924.js';
36
36
  import './_set-species-6f64f1c1.js';
37
- import './promise-53143c9a.js';
38
37
  import './Beam.js';
39
38
  import './Segment.js';
40
39
  import './AdSlot.js';
41
- import { A as ADInfeed } from './ADInfeed-08192400.js';
40
+ import { A as ADInfeed } from './ADInfeed-23148e88.js';
42
41
  import { l as lodash } from './lodash-17fdfebb.js';
43
- import { A as ADlgInfeed } from './ADlgInfeed-a90cf553.js';
42
+ import { A as ADlgInfeed } from './ADlgInfeed-5460339b.js';
44
43
  import './_arrayMap-a8dd2b2c.js';
45
44
  import { g as get_1 } from './get-ae817b75.js';
46
45
  import './AD.js';
@@ -411,20 +410,30 @@ var GridContent = function (_React$Component) {
411
410
  }
412
411
  }
413
412
  posts = firstThree.concat(posts);
414
- posts = posts.map(function (ele, i) {
415
- if (ele._type === 'lg-infeed') {
416
- // Setting pos as top2 for the first occurence of large infeed ad
417
- var _pos = posts.indexOf(posts.find(function (d) {
418
- return d._type === 'lg-infeed';
419
- })) === i ? 'top2' : 'lg-infeed_' + i;
420
- return _extends({}, ele, { slotId: 'lg-infeed_' + i, targeting: _extends({}, ele.targeting, { pos: _pos }) });
421
- } else {
422
- return ele;
423
- }
424
- });
425
413
  } else {
426
414
  posts = this.state.data;
427
415
  }
416
+
417
+ // 'articleCount' is New parameter to use instead of 'index' while passing to 'changePageNumber()'
418
+ // 'index' was including the indexes for infeed ads along with article count making the page number change before it reaches last article.
419
+ // 'articleCount' will be the indexes of only the articles in the deck.
420
+ var articleCount = -1;
421
+ posts = posts.map(function (ele, i) {
422
+ if (ele._type === 'lg-infeed') {
423
+ // Setting pos as top2 for the first occurence of large infeed ad
424
+ var _pos = posts.indexOf(posts.find(function (d) {
425
+ return d._type === 'lg-infeed';
426
+ })) === i ? 'top2' : 'lg-infeed_' + i;
427
+ return _extends({}, ele, { slotId: 'lg-infeed_' + i, targeting: _extends({}, ele.targeting, { pos: _pos }) });
428
+ } else if (ele._type === 'article') {
429
+ // incrementing 'articleCount' for each article.
430
+ ++articleCount;
431
+ return _extends({}, ele, { articleCount: articleCount });
432
+ } else {
433
+ return ele;
434
+ }
435
+ });
436
+
428
437
  var itemsPerPage = this.props.params && this.props.params.itemsPerPage ? this.props.params.itemsPerPage : 10;
429
438
  var heroContent = this.props.heroContent ? this.props.heroContent : 0;
430
439
  var featureCount = 0;
@@ -579,7 +588,8 @@ var GridContent = function (_React$Component) {
579
588
  VisibilitySensor,
580
589
  {
581
590
  onChange: function onChange(isVisible) {
582
- isVisible && _this2.changePageNumber(pageNumber, itemsPerPage, index);
591
+ // Passing 'articleCount' instead of index because index will be including the indexes of ads whereas articleCount will be having index of article only.
592
+ isVisible && _this2.changePageNumber(pageNumber, itemsPerPage, row.articleCount);
583
593
  } },
584
594
  React__default.createElement(
585
595
  'div',
@@ -25,15 +25,14 @@ import './main-adf6ec37.js';
25
25
  import './entities-7cc3bf45.js';
26
26
  import './slicedToArray-f1e40361.js';
27
27
  import './stringify-e30bc114.js';
28
- import './asyncToGenerator-204b5a5c.js';
28
+ import './asyncToGenerator-0379e924.js';
29
29
  import './_set-species-6f64f1c1.js';
30
- import './promise-53143c9a.js';
31
30
  import './Beam.js';
32
31
  import './Segment.js';
33
32
  import './AdSlot.js';
34
- import './ADInfeed-08192400.js';
33
+ import './ADInfeed-23148e88.js';
35
34
  import './lodash-17fdfebb.js';
36
- import './ADlgInfeed-a90cf553.js';
35
+ import './ADlgInfeed-5460339b.js';
37
36
  import './AuthorComponent-158226c9.js';
38
37
  import 'react-bootstrap';
39
38
  import QueueDeckExpanded from './QueueDeckExpanded.js';
@@ -12,9 +12,8 @@ import './debounce-8cd9e09c.js';
12
12
  import './main-adf6ec37.js';
13
13
  import './slicedToArray-f1e40361.js';
14
14
  import './stringify-e30bc114.js';
15
- import './asyncToGenerator-204b5a5c.js';
15
+ import './asyncToGenerator-0379e924.js';
16
16
  import './_set-species-6f64f1c1.js';
17
- import './promise-53143c9a.js';
18
17
  import './Beam.js';
19
18
  import './Segment.js';
20
19
  import './AdSlot.js';
@@ -28,8 +28,16 @@ import 'react-dom';
28
28
  import { V as VisibilitySensor } from './visibility-sensor-0baa4eea.js';
29
29
  import './index-51a80699.js';
30
30
  import { m as main_36 } from './main-adf6ec37.js';
31
+ import './slicedToArray-f1e40361.js';
32
+ import './stringify-e30bc114.js';
33
+ import { _ as _Promise } from './asyncToGenerator-0379e924.js';
31
34
  import './_set-species-6f64f1c1.js';
32
- import { _ as _Promise } from './promise-53143c9a.js';
35
+ import './Beam.js';
36
+ import './Segment.js';
37
+ import './AdSlot.js';
38
+ import { A as ADInfeed } from './ADInfeed-23148e88.js';
39
+ import { l as lodash } from './lodash-17fdfebb.js';
40
+ import { A as ADlgInfeed } from './ADlgInfeed-5460339b.js';
33
41
 
34
42
  var MasterDeck = function (_React$Component) {
35
43
  _inherits(MasterDeck, _React$Component);
@@ -200,35 +208,118 @@ var MasterDeck = function (_React$Component) {
200
208
  });
201
209
  }
202
210
  }
203
- }, _this.cardLoader = function (page, columns, variant) {
211
+ }, _this.cardLoader = function (page, columns, variant, brandInsightAd, showBI, lgInfeedAd) {
204
212
  var numberOfItemsBeforeAd = 6;
213
+ var data = _this.state.data;
214
+ var insertBrandInsightAd = function insertBrandInsightAd(arr, index, newElement) {
215
+ return [].concat(_toConsumableArray(arr.slice(0, index)), [newElement], _toConsumableArray(arr.slice(index)));
216
+ };
217
+
218
+ // Need to pass flag "lgInfeedAd={true}" along with brandInsightAd from site level for large infeed-ad to render
219
+ // Checking lgInfeedAd flag in desktop view ( window >= 1400px ).
220
+ // Integrating large infeed AD
221
+ if (lgInfeedAd && brandInsightAd && typeof window !== 'undefined' && window.innerWidth >= 1400) {
222
+ var lgInfeed = {
223
+ _type: 'lg-infeed',
224
+ adUnit: brandInsightAd.adUnit,
225
+ className: 'lg-infeed',
226
+ networkID: brandInsightAd.networkID,
227
+ sizes: [728, 90],
228
+ sizeMapping: [{
229
+ viewport: [1400, 0],
230
+ sizes: [[728, 90]]
231
+ }, { viewport: [0, 0], sizes: [] }],
232
+ targeting: {
233
+ content_placement: brandInsightAd.targeting.content_placement,
234
+ document_url: brandInsightAd.targeting.document_url
235
+ }
236
+ };
237
+
238
+ var chunks = lodash.chunk(data, 6).map(function (chunk) {
239
+ var set = lodash.chunk(chunk, 2);
240
+ for (var i = 0; i < set.length; i++) {
241
+ if (i !== set.length - 1) {
242
+ set[i].push(lgInfeed);
243
+ }
244
+ }
245
+ return lodash.flattenDeep(set);
246
+ });
247
+ data = lodash.flatten(chunks);
248
+ }
249
+
250
+ // Integrating infeed AD
251
+ if (showBI && brandInsightAd) {
252
+ // Checking lgInfeedAd flag in desktop view ( window >= 1400px ).
253
+ if (lgInfeedAd && typeof window !== 'undefined' && window.innerWidth >= 1400) brandInsightAd.interval = 8;
254
+ var pos = 0;
255
+ for (var i = 1; pos < data.length; i++) {
256
+ var inFeedAd = {
257
+ adUnit: brandInsightAd.adUnit,
258
+ className: brandInsightAd.className,
259
+ networkID: brandInsightAd.networkID,
260
+ sizes: brandInsightAd.sizes,
261
+ slotId: brandInsightAd.slotId + '_' + i,
262
+ targeting: {
263
+ pos: 'article' + i,
264
+ content_placement: brandInsightAd.targeting.content_placement,
265
+ document_url: brandInsightAd.targeting.document_url
266
+ },
267
+ _type: 'brandInsightAd'
268
+ };
269
+
270
+ data = insertBrandInsightAd(data, pos, inFeedAd);
271
+ pos += brandInsightAd.interval + 1;
272
+ }
273
+ }
274
+
275
+ // 'index' was including the indexes for infeed ads along with article count making the page number change before it reaches last article.
276
+ data = data.map(function (ele, i) {
277
+ if (ele._type === 'lg-infeed') {
278
+ // Setting pos as top2 for the first occurence of large infeed ad
279
+ var _pos = data.indexOf(data.find(function (d) {
280
+ return d._type === 'lg-infeed';
281
+ })) === i ? 'top2' : 'lg-infeed_' + i;
282
+ return _extends({}, ele, { slotId: 'lg-infeed_' + i, targeting: _extends({}, ele.targeting, { pos: _pos }) });
283
+ } else {
284
+ return ele;
285
+ }
286
+ });
287
+
205
288
  return React__default.createElement(
206
289
  'div',
207
290
  null,
208
- _this.state.data && _this.state.data.length > 0 ? _this.state.data.map(function (row, index) {
291
+ data && data.length > 0 ? data.map(function (row, index) {
209
292
  var pageNumber = row.pageNumber || _this.state.page;
210
-
211
- return React__default.createElement(
212
- React__default.Fragment,
213
- { key: index },
214
- React__default.createElement(
215
- VisibilitySensor,
216
- {
217
- onChange: function onChange(isVisible) {
218
- isVisible && _this.changePageNumber(pageNumber);
219
- } },
293
+ // Returning view for articles
294
+ if (row._type === 'article') {
295
+ return React__default.createElement(
296
+ React__default.Fragment,
297
+ { key: index },
220
298
  React__default.createElement(
221
- 'div',
222
- null,
223
- React__default.createElement(_this2.Deck, { data: row, variant: variant, index: index, client: _this.props.client, defaultImage: _this.defaultImage }),
224
- main_36 && _this.rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && React__default.createElement(
299
+ VisibilitySensor,
300
+ {
301
+ onChange: function onChange(isVisible) {
302
+ isVisible && _this.changePageNumber(pageNumber);
303
+ } },
304
+ React__default.createElement(
225
305
  'div',
226
- { className: 'ad-container', style: { margin: '0 auto' } },
227
- _this.renderMobileAd(index, numberOfItemsBeforeAd, _this.rightItems)
306
+ null,
307
+ React__default.createElement(_this2.Deck, { data: row, variant: variant, index: index, client: _this.props.client, defaultImage: _this.defaultImage }),
308
+ main_36 && _this.rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && React__default.createElement(
309
+ 'div',
310
+ { className: 'ad-container', style: { margin: '0 auto' } },
311
+ _this.renderMobileAd(index, numberOfItemsBeforeAd, _this.rightItems)
312
+ )
228
313
  )
229
314
  )
230
- )
231
- );
315
+ );
316
+ // Returning view for large infeed Ad
317
+ } else if (row._type === 'lg-infeed' && row.adUnit) {
318
+ return React__default.createElement(ADlgInfeed, _extends({ index: index }, row));
319
+ // Returning view for infeed Ad
320
+ } else if (row._type === 'brandInsightAd' && row.adUnit) {
321
+ return React__default.createElement(ADInfeed, { index: index, infeedAd: row });
322
+ }
232
323
  }) : React__default.createElement(
233
324
  'div',
234
325
  null,
@@ -293,17 +384,24 @@ var MasterDeck = function (_React$Component) {
293
384
  value: function componentDidMount() {
294
385
  // this.loadData();
295
386
  }
387
+ // Passing 'brandInsightAd','showBI' and 'lgInfeedAd'
388
+
296
389
  }, {
297
390
  key: 'render',
298
391
  value: function render() {
299
392
  var _this3 = this;
300
393
 
394
+ // Setting default value for 'showBI' and 'lgInfeedAd'
301
395
  var _props = this.props,
302
396
  columns = _props.columns,
303
397
  variant = _props.variant,
304
398
  autoScroll = _props.autoScroll,
305
- page = _props.page;
306
-
399
+ page = _props.page,
400
+ brandInsightAd = _props.brandInsightAd,
401
+ _props$showBI = _props.showBI,
402
+ showBI = _props$showBI === undefined ? false : _props$showBI,
403
+ _props$lgInfeedAd = _props.lgInfeedAd,
404
+ lgInfeedAd = _props$lgInfeedAd === undefined ? false : _props$lgInfeedAd;
307
405
 
308
406
  return React__default.createElement(
309
407
  'div',
@@ -317,7 +415,7 @@ var MasterDeck = function (_React$Component) {
317
415
  React__default.createElement(
318
416
  Container,
319
417
  null,
320
- this.cardLoader(page, columns, variant)
418
+ this.cardLoader(page, columns, variant, brandInsightAd, showBI, lgInfeedAd)
321
419
  )
322
420
  ),
323
421
  React__default.createElement(
@@ -331,7 +429,7 @@ var MasterDeck = function (_React$Component) {
331
429
  React__default.createElement(
332
430
  Container,
333
431
  null,
334
- this.cardLoader(page, columns, variant)
432
+ this.cardLoader(page, columns, variant, brandInsightAd, showBI, lgInfeedAd)
335
433
  ),
336
434
  React__default.createElement(
337
435
  'div',
@@ -25,15 +25,14 @@ import { m as main_36 } from './main-adf6ec37.js';
25
25
  import { c as clean_html_1 } from './entities-7cc3bf45.js';
26
26
  import { _ as _slicedToArray } from './slicedToArray-f1e40361.js';
27
27
  import './stringify-e30bc114.js';
28
- import './asyncToGenerator-204b5a5c.js';
28
+ import './asyncToGenerator-0379e924.js';
29
29
  import './_set-species-6f64f1c1.js';
30
- import './promise-53143c9a.js';
31
30
  import './Beam.js';
32
31
  import './Segment.js';
33
32
  import './AdSlot.js';
34
- import { A as ADInfeed } from './ADInfeed-08192400.js';
33
+ import { A as ADInfeed } from './ADInfeed-23148e88.js';
35
34
  import { l as lodash } from './lodash-17fdfebb.js';
36
- import { A as ADlgInfeed } from './ADlgInfeed-a90cf553.js';
35
+ import { A as ADlgInfeed } from './ADlgInfeed-5460339b.js';
37
36
  import { A as AuthorComponent } from './AuthorComponent-158226c9.js';
38
37
  import { Container, Media } from 'react-bootstrap';
39
38
 
@@ -209,6 +208,11 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
209
208
  pos += brandInsightAd.interval + 1;
210
209
  }
211
210
  }
211
+
212
+ // 'articleCount' is New parameter to use instead of 'index' while passing to 'changePageNumber()'
213
+ // 'index' was including the indexes for infeed ads along with article count making the page number change before it reaches last article.
214
+ // 'articleCount' will be the indexes of only the articles in the deck.
215
+ var articleCount = -1;
212
216
  data = data.map(function (ele, i) {
213
217
  if (ele._type === 'lg-infeed') {
214
218
  // Setting pos as top2 for the first occurence of large infeed ad
@@ -216,6 +220,10 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
216
220
  return d._type === 'lg-infeed';
217
221
  })) === i ? 'top2' : 'lg-infeed_' + i;
218
222
  return _extends({}, ele, { slotId: 'lg-infeed_' + i, targeting: _extends({}, ele.targeting, { pos: _pos }) });
223
+ } else if (ele._type === 'article') {
224
+ // incrementing 'articleCount' for each article.
225
+ ++articleCount;
226
+ return _extends({}, ele, { articleCount: articleCount });
219
227
  } else {
220
228
  return ele;
221
229
  }
@@ -449,7 +457,8 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
449
457
  {
450
458
  key: article._id ? article._id : index,
451
459
  onChange: function onChange(isVisible) {
452
- isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, index);
460
+ // Passing 'articleCount' instead of index because index will be including the indexes of ads whereas articleCount will be having index of artilce only.
461
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, article.articleCount);
453
462
  } },
454
463
  React__default.createElement(
455
464
  React__default.Fragment,
@@ -4,9 +4,8 @@ import './core.get-iterator-method-f5c0d66a.js';
4
4
  import './_library-528f1934.js';
5
5
  import './_iter-detect-6e099a34.js';
6
6
  import './web.dom.iterable-46c95e52.js';
7
- import { _ as _asyncToGenerator, r as regenerator } from './asyncToGenerator-204b5a5c.js';
7
+ import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-0379e924.js';
8
8
  import './_set-species-6f64f1c1.js';
9
- import './promise-53143c9a.js';
10
9
 
11
10
  require("babel-polyfill");
12
11
 
@@ -16,9 +16,8 @@ import './debounce-8cd9e09c.js';
16
16
  import './main-adf6ec37.js';
17
17
  import { _ as _slicedToArray } from './slicedToArray-f1e40361.js';
18
18
  import './stringify-e30bc114.js';
19
- import './asyncToGenerator-204b5a5c.js';
19
+ import './asyncToGenerator-0379e924.js';
20
20
  import './_set-species-6f64f1c1.js';
21
- import './promise-53143c9a.js';
22
21
  import './Beam.js';
23
22
  import './Segment.js';
24
23
  import './AdSlot.js';
@@ -8,9 +8,8 @@ import React__default, { useState, useEffect } from 'react';
8
8
  import { m as moment } from './moment-49ae13fa.js';
9
9
  import { withRouter } from 'next/router';
10
10
  import { _ as _slicedToArray } from './slicedToArray-f1e40361.js';
11
- import { _ as _asyncToGenerator, r as regenerator } from './asyncToGenerator-204b5a5c.js';
11
+ import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-0379e924.js';
12
12
  import './_set-species-6f64f1c1.js';
13
- import './promise-53143c9a.js';
14
13
  import { DropdownButton, Dropdown } from 'react-bootstrap';
15
14
 
16
15
  var _this = undefined;
package/dist/esm/View.js CHANGED
@@ -27,9 +27,8 @@ import { m as main_36 } from './main-adf6ec37.js';
27
27
  import './entities-7cc3bf45.js';
28
28
  import { a as _getIterator, _ as _slicedToArray } from './slicedToArray-f1e40361.js';
29
29
  import { _ as _JSON$stringify } from './stringify-e30bc114.js';
30
- import { _ as _asyncToGenerator, r as regenerator } from './asyncToGenerator-204b5a5c.js';
30
+ import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-0379e924.js';
31
31
  import './_set-species-6f64f1c1.js';
32
- import './promise-53143c9a.js';
33
32
  import './Beam.js';
34
33
  import './Segment.js';
35
34
  import DFPAdSlot from './AdSlot.js';
@@ -53,7 +52,7 @@ import './util-7700fc59.js';
53
52
  import 'react-bootstrap/Pagination';
54
53
  import 'next/dynamic';
55
54
  import getKeywords from './getKeywords.js';
56
- import { a as getContentPlacementUrl, g as getTargeting } from './getTargeting-8f4bd5db.js';
55
+ import { a as getContentPlacementUrl, g as getTargeting } from './getTargeting-1f2c61e3.js';
57
56
  import urlFor from './urlFor.js';
58
57
 
59
58
  var renderAuthor = function renderAuthor(authorName, authorURL, index, length) {
@@ -498,7 +497,7 @@ var Article = function Article(props) {
498
497
  contextualAD: _extends({}, payload.contextualAD, {
499
498
  slotId: (payload.contextualAD.slotId || 'native-ad') + '-' + payload._id,
500
499
  // Fetching new contextual targeting based on the current active article.
501
- targeting: props.getTargeting(props.article, 'native-ad'),
500
+ targeting: getTargeting(props, 'native-ad'),
502
501
  // Adding new ad size for large contextual ad for desktop screen width >= 1400
503
502
  sizes: lgContextAd ? [[728, 90], 'fluid', [300, 100]] : ['fluid', [300, 100]],
504
503
  sizeMapping: lgContextAd ? [{
@@ -1039,10 +1038,10 @@ var ArticleQueue = function ArticleQueue(props) {
1039
1038
  { dataLength: queueData.length, next: loadmore, scrollThreshold: '60%', hasMore: true, style: { overflow: 'hidden' } },
1040
1039
  queueData.map(function (article, index) {
1041
1040
  if (!checkSponseredArticle(article) && Ads.getVideoContextualAD) {
1042
- article.contextualVideoAD = Ads.getVideoContextualAD(getTargeting(props));
1041
+ article.contextualVideoAD = Ads.getVideoContextualAD(getTargeting(props, 'in-context_video'));
1043
1042
  }
1044
1043
  if (!checkSponseredArticle(article) && Ads.getNativeContextualAD) {
1045
- article.contextualAD = Ads.getNativeContextualAD(getTargeting(props));
1044
+ article.contextualAD = Ads.getNativeContextualAD(getTargeting(props, 'native-ad'));
1046
1045
  }
1047
1046
  return React__default.createElement(Article, _extends({
1048
1047
  key: index