@mjhls/mjh-framework 1.0.225 → 1.0.226

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 (36) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/{AdSlot-d87cef08.js → AdSlot-1c1700a3.js} +1 -1
  3. package/dist/cjs/DeckContent.js +2 -2
  4. package/dist/cjs/DeckQueue.js +1 -1
  5. package/dist/cjs/{Dfp-c4f1f12a.js → Dfp-b6d403f8.js} +1 -1
  6. package/dist/cjs/{GridContent-1575c8db.js → GridContent-992851b4.js} +31 -7
  7. package/dist/cjs/GridContent.js +3 -3
  8. package/dist/cjs/MasterDeck.js +1 -1
  9. package/dist/cjs/{Normal-11ae4373.js → Normal-c3488266.js} +32 -3
  10. package/dist/cjs/QueueDeckExpanded.js +15 -3
  11. package/dist/cjs/{TaxonomyCard-d97685e2.js → TaxonomyCard-0d4ec68b.js} +1 -1
  12. package/dist/cjs/TaxonomyCard.js +2 -2
  13. package/dist/cjs/TemplateNormal.js +3 -3
  14. package/dist/cjs/{Ustream-0d3dd953.js → Ustream-5f595d09.js} +1 -1
  15. package/dist/cjs/Ustream.js +2 -2
  16. package/dist/cjs/VideoSeriesListing.js +1 -1
  17. package/dist/cjs/{_babelHelpers-f321c258.js → _babelHelpers-4a69caad.js} +30 -0
  18. package/dist/cjs/index.js +81 -68
  19. package/dist/esm/{AdSlot-b67f8534.js → AdSlot-748bc6ff.js} +1 -1
  20. package/dist/esm/DeckContent.js +2 -2
  21. package/dist/esm/DeckQueue.js +1 -1
  22. package/dist/esm/{Dfp-6731ac01.js → Dfp-ad9b4fbe.js} +1 -1
  23. package/dist/esm/{GridContent-e5cdc9da.js → GridContent-e1c38e7f.js} +31 -7
  24. package/dist/esm/GridContent.js +3 -3
  25. package/dist/esm/MasterDeck.js +1 -1
  26. package/dist/esm/{Normal-8e0aa5e8.js → Normal-088cf5cf.js} +32 -3
  27. package/dist/esm/QueueDeckExpanded.js +15 -3
  28. package/dist/esm/{TaxonomyCard-f9c93953.js → TaxonomyCard-92f9e327.js} +1 -1
  29. package/dist/esm/TaxonomyCard.js +2 -2
  30. package/dist/esm/TemplateNormal.js +3 -3
  31. package/dist/esm/{Ustream-6bb45fe7.js → Ustream-2bfb1813.js} +1 -1
  32. package/dist/esm/Ustream.js +2 -2
  33. package/dist/esm/VideoSeriesListing.js +1 -1
  34. package/dist/esm/{_babelHelpers-67c05996.js → _babelHelpers-c212c59c.js} +30 -1
  35. package/dist/esm/index.js +85 -72
  36. package/package.json +1 -1
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- # mjh-framework v. 1.0.225
2
+ # mjh-framework v. 1.0.226
3
3
 
4
4
 
5
5
 
@@ -7,7 +7,7 @@ var React__default = _interopDefault(React);
7
7
  var index = require('./index-0322e486.js');
8
8
  var PropTypes = _interopDefault(require('prop-types'));
9
9
  var debounce = require('./debounce-a963b136.js');
10
- var _babelHelpers = require('./_babelHelpers-f321c258.js');
10
+ var _babelHelpers = require('./_babelHelpers-4a69caad.js');
11
11
 
12
12
  var DFPAdSlot = function DFPAdSlot(_ref) {
13
13
  var adUnit = _ref.adUnit,
@@ -21,8 +21,8 @@ var index$1 = require('./index-a4c53ff4.js');
21
21
  var index$2 = require('./index-0d0efcfa.js');
22
22
  var main = require('./main-58839f4e.js');
23
23
  var entities = require('./entities-3e0b4a16.js');
24
- var _babelHelpers = require('./_babelHelpers-f321c258.js');
25
- var AdSlot = require('./AdSlot-d87cef08.js');
24
+ var _babelHelpers = require('./_babelHelpers-4a69caad.js');
25
+ var AdSlot = require('./AdSlot-1c1700a3.js');
26
26
 
27
27
  var DeckContent = function (_React$Component) {
28
28
  _babelHelpers.inherits(DeckContent, _React$Component);
@@ -21,7 +21,7 @@ var index$1 = require('./index-a4c53ff4.js');
21
21
  var index$2 = require('./index-0d0efcfa.js');
22
22
  var main = require('./main-58839f4e.js');
23
23
  var entities = require('./entities-3e0b4a16.js');
24
- var _babelHelpers = require('./_babelHelpers-f321c258.js');
24
+ var _babelHelpers = require('./_babelHelpers-4a69caad.js');
25
25
  var get$1 = require('./get-126b1712.js');
26
26
 
27
27
  var DeckQueue = function (_React$Component) {
@@ -10,7 +10,7 @@ var PropTypes = _interopDefault(require('prop-types'));
10
10
  var visibilitySensor = require('./visibility-sensor-bea3105d.js');
11
11
  var debounce = require('./debounce-a963b136.js');
12
12
  require('react-dom');
13
- var _babelHelpers = require('./_babelHelpers-f321c258.js');
13
+ var _babelHelpers = require('./_babelHelpers-4a69caad.js');
14
14
 
15
15
  var AD = function AD(_ref) {
16
16
  var networkID = _ref.networkID,
@@ -18,12 +18,12 @@ var index$1 = require('./index-a4c53ff4.js');
18
18
  var index$2 = require('./index-0d0efcfa.js');
19
19
  var main = require('./main-58839f4e.js');
20
20
  var entities = require('./entities-3e0b4a16.js');
21
- var _babelHelpers = require('./_babelHelpers-f321c258.js');
22
- var AdSlot = require('./AdSlot-d87cef08.js');
21
+ var _babelHelpers = require('./_babelHelpers-4a69caad.js');
22
+ var AdSlot = require('./AdSlot-1c1700a3.js');
23
23
  var get$1 = require('./get-126b1712.js');
24
24
 
25
25
  var Dfp = React__default.lazy(function () {
26
- return new Promise(function (resolve) { resolve(require('./Dfp-c4f1f12a.js')); });
26
+ return new Promise(function (resolve) { resolve(require('./Dfp-b6d403f8.js')); });
27
27
  });
28
28
 
29
29
  var AD = function AD(props) {
@@ -274,7 +274,7 @@ var GridContent = function (_React$Component) {
274
274
  return React__default.createElement(
275
275
  Row,
276
276
  null,
277
- this.state.data && this.state.data.map(function (row, index) {
277
+ this.state.data && this.state.data.length > 0 ? this.state.data.map(function (row, index) {
278
278
  // const thumbnailURL = get(row, 'thumbnail.asset.url', this.props.defaultImage)
279
279
  return React__default.createElement(
280
280
  Col,
@@ -331,7 +331,19 @@ var GridContent = function (_React$Component) {
331
331
  )
332
332
  )
333
333
  );
334
- })
334
+ }) : React__default.createElement(
335
+ 'div',
336
+ null,
337
+ React__default.createElement(
338
+ 'h5',
339
+ null,
340
+ React__default.createElement(
341
+ 'em',
342
+ null,
343
+ 'New content coming soon, please check back later.'
344
+ )
345
+ )
346
+ )
335
347
  );
336
348
  }
337
349
 
@@ -368,7 +380,7 @@ var GridContent = function (_React$Component) {
368
380
  return React__default.createElement(
369
381
  'div',
370
382
  { className: 'grid-container' },
371
- posts && posts.map(function (row, index) {
383
+ posts && posts.length > 0 ? posts.map(function (row, index) {
372
384
  var pageNumber = row.pageNumber || _this2.state.page;
373
385
  var contentCategoryName = row.contentCategory && row.contentCategory.name && _this2.mapping[row.contentCategory.name] ? row.contentCategory.name : 'Articles';
374
386
  var linkHref = row.url && row.url.current ? _this2.mapping[contentCategoryName] + '/' + row.url.current : '';
@@ -571,7 +583,19 @@ var GridContent = function (_React$Component) {
571
583
  showVideo && (posts.length < numberOfItemsBeforeVideo || index + 1 === numberOfItemsBeforeVideo) && React__default.createElement(VideoPlayer, null),
572
584
  main.main_36 && _this2.props.rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && _this2.renderMobileAd(index, numberOfItemsBeforeAd)
573
585
  );
574
- })
586
+ }) : React__default.createElement(
587
+ 'div',
588
+ null,
589
+ React__default.createElement(
590
+ 'h5',
591
+ null,
592
+ React__default.createElement(
593
+ 'em',
594
+ null,
595
+ 'New content coming soon, please check back later.'
596
+ )
597
+ )
598
+ )
575
599
  );
576
600
  }
577
601
  }, {
@@ -17,10 +17,10 @@ require('./index-a4c53ff4.js');
17
17
  require('./index-0d0efcfa.js');
18
18
  require('./main-58839f4e.js');
19
19
  require('./entities-3e0b4a16.js');
20
- require('./_babelHelpers-f321c258.js');
21
- require('./AdSlot-d87cef08.js');
20
+ require('./_babelHelpers-4a69caad.js');
21
+ require('./AdSlot-1c1700a3.js');
22
22
  require('./get-126b1712.js');
23
- var GridContent = require('./GridContent-1575c8db.js');
23
+ var GridContent = require('./GridContent-992851b4.js');
24
24
 
25
25
 
26
26
 
@@ -19,7 +19,7 @@ var debounce = require('./debounce-a963b136.js');
19
19
  require('react-dom');
20
20
  require('./index-a4c53ff4.js');
21
21
  var main = require('./main-58839f4e.js');
22
- var _babelHelpers = require('./_babelHelpers-f321c258.js');
22
+ var _babelHelpers = require('./_babelHelpers-4a69caad.js');
23
23
 
24
24
  var MasterDeck = function (_React$Component) {
25
25
  _babelHelpers.inherits(MasterDeck, _React$Component);
@@ -11,8 +11,8 @@ var Row = _interopDefault(require('react-bootstrap/Row'));
11
11
  var Col = _interopDefault(require('react-bootstrap/Col'));
12
12
  var Link = _interopDefault(require('next/link'));
13
13
  var main = require('./main-58839f4e.js');
14
- var _babelHelpers = require('./_babelHelpers-f321c258.js');
15
- var AdSlot = require('./AdSlot-d87cef08.js');
14
+ var _babelHelpers = require('./_babelHelpers-4a69caad.js');
15
+ var AdSlot = require('./AdSlot-1c1700a3.js');
16
16
  var get$1 = require('./get-126b1712.js');
17
17
  var reactBootstrap = require('react-bootstrap');
18
18
  var index_esm = require('./index.esm-340d3792.js');
@@ -1294,6 +1294,32 @@ var NavMagazine = function NavMagazine(props) {
1294
1294
  setScreenWidth(parseInt(window.innerWidth));
1295
1295
  }, []);
1296
1296
 
1297
+ React.useEffect(function () {
1298
+ var navOffsetTop = navRef.current.getBoundingClientRect().top;
1299
+ var navOffsetHeight = navRef.current.getBoundingClientRect().height;
1300
+ var adSection = document.querySelector('.AD728x90');
1301
+ var stickyNav = window.addEventListener('scroll', function () {
1302
+ if (window.pageYOffset > navOffsetTop) {
1303
+ if (navRef.current && navRef.current.style) {
1304
+ navRef.current.style.position = 'fixed';
1305
+ navRef.current.style.top = 0;
1306
+ navRef.current.style.width = '100%';
1307
+ navRef.current.style.zIndex = '9999';
1308
+ adSection.style.marginTop = navOffsetHeight + 'px';
1309
+ }
1310
+ } else {
1311
+ if (navRef.current && navRef.current.style) {
1312
+ navRef.current.style.position = 'relative';
1313
+ navRef.current.style.top = '';
1314
+ adSection.style.marginTop = '';
1315
+ }
1316
+ }
1317
+ });
1318
+ return function () {
1319
+ window.removeEventListener('scroll', stickyNav);
1320
+ };
1321
+ }, []);
1322
+
1297
1323
  var trackScrolling = function trackScrolling() {
1298
1324
  var offsetTop = navRef.current.getBoundingClientRect().top;
1299
1325
 
@@ -2004,7 +2030,7 @@ var HamMagazine = function HamMagazine(props) {
2004
2030
  var navOffsetTop = navRef.current.getBoundingClientRect().top;
2005
2031
  var navOffsetHeight = navRef.current.getBoundingClientRect().height;
2006
2032
  var adSection = document.querySelector('.AD728x90');
2007
- window.addEventListener('scroll', function () {
2033
+ var stickyNav = window.addEventListener('scroll', function () {
2008
2034
  if (window.pageYOffset > navOffsetTop) {
2009
2035
  if (navRef.current && navRef.current.style) {
2010
2036
  navRef.current.style.position = 'fixed';
@@ -2021,6 +2047,9 @@ var HamMagazine = function HamMagazine(props) {
2021
2047
  }
2022
2048
  }
2023
2049
  });
2050
+ return function () {
2051
+ window.removeEventListener('scroll', stickyNav);
2052
+ };
2024
2053
  }, []);
2025
2054
 
2026
2055
  var trackScrolling = function trackScrolling() {
@@ -16,7 +16,7 @@ var index$1 = require('./index-a4c53ff4.js');
16
16
  var index$2 = require('./index-0d0efcfa.js');
17
17
  var main = require('./main-58839f4e.js');
18
18
  var entities = require('./entities-3e0b4a16.js');
19
- var _babelHelpers = require('./_babelHelpers-f321c258.js');
19
+ var _babelHelpers = require('./_babelHelpers-4a69caad.js');
20
20
  var reactBootstrap = require('react-bootstrap');
21
21
 
22
22
  var urlFor = function urlFor(source, builder) {
@@ -172,7 +172,7 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
172
172
  return React__default.createElement(
173
173
  'div',
174
174
  null,
175
- data && data.map(function (article, index) {
175
+ data && data.length > 0 ? data.map(function (article, index) {
176
176
  var pageNumber = article.pageNumber || values.page;
177
177
  var contentCategoryName = article.contentCategory ? article.contentCategory.name : 'Articles';
178
178
 
@@ -398,7 +398,19 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
398
398
  ),
399
399
  main.main_36 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index, numberOfItemsBeforeAd, rightItems)
400
400
  );
401
- }),
401
+ }) : React__default.createElement(
402
+ 'div',
403
+ null,
404
+ React__default.createElement(
405
+ 'h5',
406
+ null,
407
+ React__default.createElement(
408
+ 'em',
409
+ null,
410
+ 'New content coming soon, please check back later.'
411
+ )
412
+ )
413
+ ),
402
414
  React__default.createElement(
403
415
  'style',
404
416
  { jsx: 'true' },
@@ -11,7 +11,7 @@ var Col = _interopDefault(require('react-bootstrap/Col'));
11
11
  var Card = _interopDefault(require('react-bootstrap/Card'));
12
12
  var index$1 = require('./index-a4c53ff4.js');
13
13
  var index$2 = require('./index-0d0efcfa.js');
14
- var _babelHelpers = require('./_babelHelpers-f321c258.js');
14
+ var _babelHelpers = require('./_babelHelpers-4a69caad.js');
15
15
 
16
16
  /*
17
17
  object-assign
@@ -10,8 +10,8 @@ require('react-bootstrap/Card');
10
10
  require('react-dom');
11
11
  require('./index-a4c53ff4.js');
12
12
  require('./index-0d0efcfa.js');
13
- require('./_babelHelpers-f321c258.js');
14
- var TaxonomyCard = require('./TaxonomyCard-d97685e2.js');
13
+ require('./_babelHelpers-4a69caad.js');
14
+ var TaxonomyCard = require('./TaxonomyCard-0d4ec68b.js');
15
15
 
16
16
 
17
17
 
@@ -10,13 +10,13 @@ require('react-bootstrap/Col');
10
10
  require('next/link');
11
11
  require('./debounce-a963b136.js');
12
12
  require('./main-58839f4e.js');
13
- require('./_babelHelpers-f321c258.js');
14
- require('./AdSlot-d87cef08.js');
13
+ require('./_babelHelpers-4a69caad.js');
14
+ require('./AdSlot-1c1700a3.js');
15
15
  require('./get-126b1712.js');
16
16
  require('react-bootstrap');
17
17
  require('./index.esm-340d3792.js');
18
18
  require('react-bootstrap/Button');
19
- var TemplateNormal = require('./Normal-11ae4373.js');
19
+ var TemplateNormal = require('./Normal-c3488266.js');
20
20
  require('react-bootstrap/ListGroup');
21
21
  require('next/head');
22
22
  require('react-bootstrap/Nav');
@@ -4,7 +4,7 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
4
4
 
5
5
  var React = require('react');
6
6
  var React__default = _interopDefault(React);
7
- var _babelHelpers = require('./_babelHelpers-f321c258.js');
7
+ var _babelHelpers = require('./_babelHelpers-4a69caad.js');
8
8
  var index_esm = require('./index.esm-340d3792.js');
9
9
 
10
10
  // THIS FILE IS AUTO GENERATED
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  require('react');
4
- require('./_babelHelpers-f321c258.js');
4
+ require('./_babelHelpers-4a69caad.js');
5
5
  require('./index.esm-340d3792.js');
6
- var Ustream = require('./Ustream-0d3dd953.js');
6
+ var Ustream = require('./Ustream-5f595d09.js');
7
7
 
8
8
 
9
9
 
@@ -15,7 +15,7 @@ var Router__default = _interopDefault(Router);
15
15
  var debounce = require('./debounce-a963b136.js');
16
16
  require('react-dom');
17
17
  require('./index-0d0efcfa.js');
18
- var _babelHelpers = require('./_babelHelpers-f321c258.js');
18
+ var _babelHelpers = require('./_babelHelpers-4a69caad.js');
19
19
  var YoutubeGroup = require('./YoutubeGroup-ad994d02.js');
20
20
  var index_esm = require('./index.esm-340d3792.js');
21
21
 
@@ -1,5 +1,34 @@
1
1
  'use strict';
2
2
 
3
+ var asyncToGenerator = function (fn) {
4
+ return function () {
5
+ var gen = fn.apply(this, arguments);
6
+ return new Promise(function (resolve, reject) {
7
+ function step(key, arg) {
8
+ try {
9
+ var info = gen[key](arg);
10
+ var value = info.value;
11
+ } catch (error) {
12
+ reject(error);
13
+ return;
14
+ }
15
+
16
+ if (info.done) {
17
+ resolve(value);
18
+ } else {
19
+ return Promise.resolve(value).then(function (value) {
20
+ step("next", value);
21
+ }, function (err) {
22
+ step("throw", err);
23
+ });
24
+ }
25
+ }
26
+
27
+ return step("next");
28
+ });
29
+ };
30
+ };
31
+
3
32
  var classCallCheck = function (instance, Constructor) {
4
33
  if (!(instance instanceof Constructor)) {
5
34
  throw new TypeError("Cannot call a class as a function");
@@ -111,6 +140,7 @@ var toConsumableArray = function (arr) {
111
140
  };
112
141
 
113
142
  exports._extends = _extends;
143
+ exports.asyncToGenerator = asyncToGenerator;
114
144
  exports.classCallCheck = classCallCheck;
115
145
  exports.createClass = createClass;
116
146
  exports.inherits = inherits;
package/dist/cjs/index.js CHANGED
@@ -23,15 +23,15 @@ var index$1 = require('./index-a4c53ff4.js');
23
23
  require('./index-0d0efcfa.js');
24
24
  var main = require('./main-58839f4e.js');
25
25
  var entities = require('./entities-3e0b4a16.js');
26
- var _babelHelpers = require('./_babelHelpers-f321c258.js');
27
- var AdSlot = require('./AdSlot-d87cef08.js');
26
+ var _babelHelpers = require('./_babelHelpers-4a69caad.js');
27
+ var AdSlot = require('./AdSlot-1c1700a3.js');
28
28
  var DeckContent = require('./DeckContent.js');
29
29
  require('./get-126b1712.js');
30
- var GridContent = require('./GridContent-1575c8db.js');
30
+ var GridContent = require('./GridContent-992851b4.js');
31
31
  var DeckQueue = require('./DeckQueue.js');
32
32
  require('react-bootstrap/Media');
33
33
  var ThumbnailCard = require('./ThumbnailCard.js');
34
- var TaxonomyCard = require('./TaxonomyCard-d97685e2.js');
34
+ var TaxonomyCard = require('./TaxonomyCard-0d4ec68b.js');
35
35
  var GroupDeck = require('./GroupDeck.js');
36
36
  var YoutubeGroup = require('./YoutubeGroup-ad994d02.js');
37
37
  var reactBootstrap = require('react-bootstrap');
@@ -44,7 +44,7 @@ var PublicationDeck = require('./PublicationDeck.js');
44
44
  var IssueDeck = require('./IssueDeck.js');
45
45
  require('react-bootstrap/Badge');
46
46
  var IssueContentDeck = require('./IssueContentDeck.js');
47
- var TemplateNormal = require('./Normal-11ae4373.js');
47
+ var TemplateNormal = require('./Normal-c3488266.js');
48
48
  require('react-bootstrap/ListGroup');
49
49
  var Head = _interopDefault(require('next/head'));
50
50
  var Accordion = _interopDefault(require('react-bootstrap/Accordion'));
@@ -60,7 +60,7 @@ var Carousel = _interopDefault(require('react-bootstrap/Carousel'));
60
60
  var Breadcrumb = _interopDefault(require('react-bootstrap/Breadcrumb'));
61
61
  var DropdownButton = _interopDefault(require('react-bootstrap/DropdownButton'));
62
62
  var Dropdown = _interopDefault(require('react-bootstrap/Dropdown'));
63
- var Ustream = require('./Ustream-0d3dd953.js');
63
+ var Ustream = require('./Ustream-5f595d09.js');
64
64
 
65
65
  var AccordionPanel = function AccordionPanel(props) {
66
66
  var accordionClassName = props.accordionClassName,
@@ -12366,8 +12366,9 @@ var ArticleQueue = function (_React$Component) {
12366
12366
  title: _this.props.article.title,
12367
12367
  summary: metaDescription,
12368
12368
  queueData: [article],
12369
- relatedArticles: [],
12370
- keywords: []
12369
+ keywords: [],
12370
+ maxListLength: 10,
12371
+ loading: false
12371
12372
  }, _this.preVscroll = 0;
12372
12373
  _this.isScrollDown = true;
12373
12374
 
@@ -12379,25 +12380,6 @@ var ArticleQueue = function (_React$Component) {
12379
12380
  value: function componentDidMount() {
12380
12381
  window.addEventListener('scroll', this.scrollDirectionDetect);
12381
12382
  }
12382
- }, {
12383
- key: 'componentDidUpdate',
12384
- value: function componentDidUpdate(prevProps) {
12385
- var _this2 = this;
12386
-
12387
- if (prevProps.relatedArticles != this.props.relatedArticles) {
12388
- var relatedArticles = this.props.relatedArticles.map(function (article) {
12389
- var targeting = _this2.getTargeting(_this2.props.article);
12390
- var Ads = _this2.props.Ads.getRightItems(targeting);
12391
- return _babelHelpers._extends({}, article, { Ads: Ads });
12392
- });
12393
- var queueData = [].concat(_babelHelpers.toConsumableArray(this.state.queueData));
12394
- if (prevProps.relatedArticles.length == 0) {
12395
- queueData.push(relatedArticles.shift());
12396
- this.setState({ queueData: queueData });
12397
- }
12398
- this.setState({ relatedArticles: relatedArticles });
12399
- }
12400
- }
12401
12383
  }, {
12402
12384
  key: 'componentWillUnmount',
12403
12385
  value: function componentWillUnmount() {
@@ -12408,7 +12390,7 @@ var ArticleQueue = function (_React$Component) {
12408
12390
  }, {
12409
12391
  key: 'render',
12410
12392
  value: function render() {
12411
- var _this3 = this;
12393
+ var _this2 = this;
12412
12394
 
12413
12395
  var _state = this.state,
12414
12396
  config = _state.config,
@@ -12431,12 +12413,12 @@ var ArticleQueue = function (_React$Component) {
12431
12413
  queueData.map(function (article, index) {
12432
12414
  return React__default.createElement(Article, _babelHelpers._extends({
12433
12415
  key: index,
12434
- urlFor: _this3.urlFor,
12435
- isCutomPage: _this3.isCutomPage,
12436
- renderIsiContent: _this3.renderIsiContent
12437
- }, _this3.props, {
12416
+ urlFor: _this2.urlFor,
12417
+ isCutomPage: _this2.isCutomPage,
12418
+ renderIsiContent: _this2.renderIsiContent
12419
+ }, _this2.props, {
12438
12420
  shareOptions: shareOptions,
12439
- changeUrl: _this3.changeUrl,
12421
+ changeUrl: _this2.changeUrl,
12440
12422
  article: article
12441
12423
  }));
12442
12424
  })
@@ -12448,37 +12430,68 @@ var ArticleQueue = function (_React$Component) {
12448
12430
  }(React__default.Component);
12449
12431
 
12450
12432
  var _initialiseProps = function _initialiseProps() {
12451
- var _this4 = this;
12433
+ var _this3 = this;
12452
12434
 
12453
12435
  this.scrollDirectionDetect = function (e) {
12454
12436
  var window = e.currentTarget;
12455
- var isScrollDown = _this4.isScrollDown;
12437
+ var isScrollDown = _this3.isScrollDown;
12456
12438
 
12457
12439
 
12458
- if (_this4.preVscroll > window.scrollY) {
12440
+ if (_this3.preVscroll > window.scrollY) {
12459
12441
  if (!isScrollDown) {
12460
- _this4.isScrollDown = true;
12442
+ _this3.isScrollDown = true;
12461
12443
  }
12462
- } else if (_this4.preVscroll < window.scrollY) {
12444
+ } else if (_this3.preVscroll < window.scrollY) {
12463
12445
  if (isScrollDown) {
12464
- _this4.isScrollDown = false;
12446
+ _this3.isScrollDown = false;
12465
12447
  }
12466
12448
  }
12467
- _this4.preVscroll = window.scrollY;
12449
+ _this3.preVscroll = window.scrollY;
12468
12450
  };
12469
12451
 
12470
- this.loadmore = function () {
12471
- var queueData = [].concat(_babelHelpers.toConsumableArray(_this4.state.queueData));
12472
- var relatedArticles = [].concat(_babelHelpers.toConsumableArray(_this4.state.relatedArticles));
12473
- if (relatedArticles.length > 0) {
12474
- queueData.push(relatedArticles.shift());
12475
- _this4.setState({ queueData: queueData, relatedArticles: relatedArticles });
12476
- }
12477
- };
12452
+ this.loadmore = _babelHelpers.asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
12453
+ var maxListLength, queueData, query, params, article, targeting;
12454
+ return regeneratorRuntime.wrap(function _callee$(_context) {
12455
+ while (1) {
12456
+ switch (_context.prev = _context.next) {
12457
+ case 0:
12458
+ maxListLength = _this3.props.maxListLength ? _this3.props.maxListLength : _this3.state.maxListLength;
12459
+ queueData = [].concat(_babelHelpers.toConsumableArray(_this3.state.queueData));
12460
+ query = _this3.props.relatedArticleQuery;
12461
+ params = _this3.props.params;
12462
+
12463
+ if (!(queueData.length < maxListLength)) {
12464
+ _context.next = 10;
12465
+ break;
12466
+ }
12467
+
12468
+ params.index = queueData.length - 1;
12469
+
12470
+ _context.next = 8;
12471
+ return _this3.props.client.fetch(query, params);
12472
+
12473
+ case 8:
12474
+ article = _context.sent;
12475
+
12476
+ if (article) {
12477
+ targeting = _this3.getTargeting(article);
12478
+
12479
+ article.Ads = _this3.props.Ads.getRightItems(targeting);
12480
+ queueData.push(article);
12481
+ _this3.setState({ queueData: queueData });
12482
+ }
12483
+
12484
+ case 10:
12485
+ case 'end':
12486
+ return _context.stop();
12487
+ }
12488
+ }
12489
+ }, _callee, _this3);
12490
+ }));
12478
12491
 
12479
12492
  this.isCutomPage = function (article) {
12480
12493
  var url = article.url.current;
12481
- var _props2 = _this4.props,
12494
+ var _props2 = _this3.props,
12482
12495
  regionalPages = _props2.regionalPages,
12483
12496
  nationalPage = _props2.nationalPage;
12484
12497
 
@@ -12486,7 +12499,7 @@ var _initialiseProps = function _initialiseProps() {
12486
12499
  };
12487
12500
 
12488
12501
  this.urlFor = function (source) {
12489
- return index$1.imageUrlBuilder(_this4.props.client).image(source);
12502
+ return index$1.imageUrlBuilder(_this3.props.client).image(source);
12490
12503
  };
12491
12504
 
12492
12505
  this.getTargeting = function (article) {
@@ -12511,7 +12524,7 @@ var _initialiseProps = function _initialiseProps() {
12511
12524
  content_placement = article.content_placement;
12512
12525
 
12513
12526
  var context = url;
12514
- var localHistory = _this4.props.historyCookie ? JSON.parse(_this4.props.historyCookie) : [];
12527
+ var localHistory = _this3.props.historyCookie ? JSON.parse(_this3.props.historyCookie) : [];
12515
12528
  if (!context && localHistory) {
12516
12529
  context = localHistory[localHistory.length - 1];
12517
12530
  }
@@ -12550,7 +12563,7 @@ var _initialiseProps = function _initialiseProps() {
12550
12563
  var _article$taxonomyMapp = article.taxonomyMapping,
12551
12564
  taxonomyMapping = _article$taxonomyMapp === undefined ? [] : _article$taxonomyMapp;
12552
12565
 
12553
- if (_this4.props.checkSponsered) {
12566
+ if (_this3.props.checkSponsered) {
12554
12567
 
12555
12568
  return taxonomyMapping.some(function (item) {
12556
12569
  return item._ref === 'ict_taxonomy_735_sponsoredresources';
@@ -12562,7 +12575,7 @@ var _initialiseProps = function _initialiseProps() {
12562
12575
 
12563
12576
  this.renderIsiContent = function (article) {
12564
12577
  var url = article.url.current;
12565
- var _props3 = _this4.props,
12578
+ var _props3 = _this3.props,
12566
12579
  ISIContent = _props3.iSIContent,
12567
12580
  regionalPages = _props3.regionalPages,
12568
12581
  nationalPage = _props3.nationalPage;
@@ -12596,7 +12609,7 @@ var _initialiseProps = function _initialiseProps() {
12596
12609
  };
12597
12610
 
12598
12611
  this.refreshAdd = function (path) {
12599
- var article = _this4.state.queueData.find(function (item) {
12612
+ var article = _this3.state.queueData.find(function (item) {
12600
12613
  return item.url.current == path;
12601
12614
  });
12602
12615
  var title = article.title,
@@ -12616,20 +12629,20 @@ var _initialiseProps = function _initialiseProps() {
12616
12629
  var description = _article$seo.meta_description;
12617
12630
 
12618
12631
  var keywords = [].concat(_babelHelpers.toConsumableArray(internalTag), _babelHelpers.toConsumableArray(userDefinedTag), _babelHelpers.toConsumableArray(SponsorshipTag), _babelHelpers.toConsumableArray(seoTag));
12619
- var config = _babelHelpers._extends({}, _this4.state.config);
12620
- var targeting = _this4.getTargeting(article);
12632
+ var config = _babelHelpers._extends({}, _this3.state.config);
12633
+ var targeting = _this3.getTargeting(article);
12621
12634
  var rightItems = [];
12622
12635
 
12623
- if (_this4.checkSponseredArticle(article)) {
12636
+ if (_this3.checkSponseredArticle(article)) {
12624
12637
  rightItems = [];
12625
12638
  } else {
12626
- rightItems = _this4.props.Ads.getRightItems(targeting);
12639
+ rightItems = _this3.props.Ads.getRightItems(targeting);
12627
12640
  }
12628
- var horizontalAD = _this4.props.Ads.getHorizontal(targeting);
12641
+ var horizontalAD = _this3.props.Ads.getHorizontal(targeting);
12629
12642
  config.rightItems = rightItems;
12630
12643
  config.horizontalAD = horizontalAD;
12631
- var metaDescription = description ? description : summary ? summary : _this4.getFirstLine(article);
12632
- _this4.setState({ config: config, title: title, summary: metaDescription }, function () {
12644
+ var metaDescription = description ? description : summary ? summary : _this3.getFirstLine(article);
12645
+ _this3.setState({ config: config, title: title, summary: metaDescription }, function () {
12633
12646
  if (!main.main_36) {
12634
12647
  index.lib_3.refresh();
12635
12648
  }
@@ -12637,28 +12650,28 @@ var _initialiseProps = function _initialiseProps() {
12637
12650
  };
12638
12651
 
12639
12652
  this.changeUrl = function (path, visibility) {
12640
- var isScrollDown = _this4.isScrollDown;
12653
+ var isScrollDown = _this3.isScrollDown;
12641
12654
 
12642
12655
  var newPath = '/view/' + path;
12643
12656
  if (!isScrollDown) {
12644
12657
  if (visibility == 'top') {
12645
12658
  // Router.push('/view/[url]', newPath, {shallow:true})
12646
12659
  window.history.pushState({ page: path }, path, newPath);
12647
- if (_this4.props.pageview) {
12648
- _this4.props.pageview(newPath);
12660
+ if (_this3.props.pageview) {
12661
+ _this3.props.pageview(newPath);
12649
12662
  }
12650
12663
 
12651
- _this4.refreshAdd(path);
12664
+ _this3.refreshAdd(path);
12652
12665
  }
12653
12666
  } else {
12654
12667
  if (visibility == 'bottom') {
12655
12668
  // Router.push('/view/[url]', newPath, {shallow:true})
12656
12669
  window.history.pushState({ page: path }, path, newPath);
12657
- if (_this4.props.pageview) {
12658
- _this4.props.pageview(newPath);
12670
+ if (_this3.props.pageview) {
12671
+ _this3.props.pageview(newPath);
12659
12672
  }
12660
12673
 
12661
- _this4.refreshAdd(path);
12674
+ _this3.refreshAdd(path);
12662
12675
  }
12663
12676
  }
12664
12677
  };