@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
@@ -2,7 +2,7 @@ import React__default, { useState } from 'react';
2
2
  import { b as lib_2 } from './index-6a79dad6.js';
3
3
  import PropTypes from 'prop-types';
4
4
  import { d as debounce_1 } from './debounce-dc0c02e5.js';
5
- import { s as slicedToArray } from './_babelHelpers-67c05996.js';
5
+ import { s as slicedToArray } from './_babelHelpers-c212c59c.js';
6
6
 
7
7
  var DFPAdSlot = function DFPAdSlot(_ref) {
8
8
  var adUnit = _ref.adUnit,
@@ -15,8 +15,8 @@ import { i as imageUrlBuilder } from './index-ca4ff5cb.js';
15
15
  import { L as LazyLoad } from './index-3c1ee9ab.js';
16
16
  import { a as main_36 } from './main-dea495b7.js';
17
17
  import { c as clean_html_1 } from './entities-e85d3a4a.js';
18
- import { i as inherits, c as createClass, a as classCallCheck, p as possibleConstructorReturn, _ as _extends, t as toConsumableArray } from './_babelHelpers-67c05996.js';
19
- import { D as DFPAdSlot } from './AdSlot-b67f8534.js';
18
+ import { i as inherits, c as createClass, a as classCallCheck, p as possibleConstructorReturn, _ as _extends, t as toConsumableArray } from './_babelHelpers-c212c59c.js';
19
+ import { D as DFPAdSlot } from './AdSlot-748bc6ff.js';
20
20
 
21
21
  var DeckContent = function (_React$Component) {
22
22
  inherits(DeckContent, _React$Component);
@@ -15,7 +15,7 @@ import { i as imageUrlBuilder } from './index-ca4ff5cb.js';
15
15
  import { L as LazyLoad } from './index-3c1ee9ab.js';
16
16
  import { a as main_36 } from './main-dea495b7.js';
17
17
  import { c as clean_html_1 } from './entities-e85d3a4a.js';
18
- import { i as inherits, c as createClass, a as classCallCheck, p as possibleConstructorReturn, _ as _extends, t as toConsumableArray } from './_babelHelpers-67c05996.js';
18
+ import { i as inherits, c as createClass, a as classCallCheck, p as possibleConstructorReturn, _ as _extends, t as toConsumableArray } from './_babelHelpers-c212c59c.js';
19
19
  import { g as get_1 } from './get-b074314b.js';
20
20
 
21
21
  var DeckQueue = function (_React$Component) {
@@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
5
5
  import { V as VisibilitySensor } from './visibility-sensor-675d3fa1.js';
6
6
  import { d as debounce_1 } from './debounce-dc0c02e5.js';
7
7
  import 'react-dom';
8
- import { s as slicedToArray } from './_babelHelpers-67c05996.js';
8
+ import { s as slicedToArray } from './_babelHelpers-c212c59c.js';
9
9
 
10
10
  var AD = function AD(_ref) {
11
11
  var networkID = _ref.networkID,
@@ -12,12 +12,12 @@ import { i as imageUrlBuilder } from './index-ca4ff5cb.js';
12
12
  import { L as LazyLoad } from './index-3c1ee9ab.js';
13
13
  import { a as main_36 } from './main-dea495b7.js';
14
14
  import { c as clean_html_1 } from './entities-e85d3a4a.js';
15
- import { i as inherits, c as createClass, t as toConsumableArray, a as classCallCheck, p as possibleConstructorReturn, _ as _extends } from './_babelHelpers-67c05996.js';
16
- import { D as DFPAdSlot } from './AdSlot-b67f8534.js';
15
+ import { i as inherits, c as createClass, t as toConsumableArray, a as classCallCheck, p as possibleConstructorReturn, _ as _extends } from './_babelHelpers-c212c59c.js';
16
+ import { D as DFPAdSlot } from './AdSlot-748bc6ff.js';
17
17
  import { g as get_1 } from './get-b074314b.js';
18
18
 
19
19
  var Dfp = React__default.lazy(function () {
20
- return import('./Dfp-6731ac01.js');
20
+ return import('./Dfp-ad9b4fbe.js');
21
21
  });
22
22
 
23
23
  var AD = function AD(props) {
@@ -268,7 +268,7 @@ var GridContent = function (_React$Component) {
268
268
  return React__default.createElement(
269
269
  Row,
270
270
  null,
271
- this.state.data && this.state.data.map(function (row, index) {
271
+ this.state.data && this.state.data.length > 0 ? this.state.data.map(function (row, index) {
272
272
  // const thumbnailURL = get(row, 'thumbnail.asset.url', this.props.defaultImage)
273
273
  return React__default.createElement(
274
274
  Col,
@@ -325,7 +325,19 @@ var GridContent = function (_React$Component) {
325
325
  )
326
326
  )
327
327
  );
328
- })
328
+ }) : React__default.createElement(
329
+ 'div',
330
+ null,
331
+ React__default.createElement(
332
+ 'h5',
333
+ null,
334
+ React__default.createElement(
335
+ 'em',
336
+ null,
337
+ 'New content coming soon, please check back later.'
338
+ )
339
+ )
340
+ )
329
341
  );
330
342
  }
331
343
 
@@ -362,7 +374,7 @@ var GridContent = function (_React$Component) {
362
374
  return React__default.createElement(
363
375
  'div',
364
376
  { className: 'grid-container' },
365
- posts && posts.map(function (row, index) {
377
+ posts && posts.length > 0 ? posts.map(function (row, index) {
366
378
  var pageNumber = row.pageNumber || _this2.state.page;
367
379
  var contentCategoryName = row.contentCategory && row.contentCategory.name && _this2.mapping[row.contentCategory.name] ? row.contentCategory.name : 'Articles';
368
380
  var linkHref = row.url && row.url.current ? _this2.mapping[contentCategoryName] + '/' + row.url.current : '';
@@ -565,7 +577,19 @@ var GridContent = function (_React$Component) {
565
577
  showVideo && (posts.length < numberOfItemsBeforeVideo || index + 1 === numberOfItemsBeforeVideo) && React__default.createElement(VideoPlayer, null),
566
578
  main_36 && _this2.props.rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && _this2.renderMobileAd(index, numberOfItemsBeforeAd)
567
579
  );
568
- })
580
+ }) : React__default.createElement(
581
+ 'div',
582
+ null,
583
+ React__default.createElement(
584
+ 'h5',
585
+ null,
586
+ React__default.createElement(
587
+ 'em',
588
+ null,
589
+ 'New content coming soon, please check back later.'
590
+ )
591
+ )
592
+ )
569
593
  );
570
594
  }
571
595
  }, {
@@ -15,7 +15,7 @@ import './index-ca4ff5cb.js';
15
15
  import './index-3c1ee9ab.js';
16
16
  import './main-dea495b7.js';
17
17
  import './entities-e85d3a4a.js';
18
- import './_babelHelpers-67c05996.js';
19
- import './AdSlot-b67f8534.js';
18
+ import './_babelHelpers-c212c59c.js';
19
+ import './AdSlot-748bc6ff.js';
20
20
  import './get-b074314b.js';
21
- export { G as default } from './GridContent-e5cdc9da.js';
21
+ export { G as default } from './GridContent-e1c38e7f.js';
@@ -13,7 +13,7 @@ import { d as debounce_1 } from './debounce-dc0c02e5.js';
13
13
  import 'react-dom';
14
14
  import './index-ca4ff5cb.js';
15
15
  import { a as main_36 } from './main-dea495b7.js';
16
- import { i as inherits, c as createClass, a as classCallCheck, p as possibleConstructorReturn, _ as _extends, t as toConsumableArray } from './_babelHelpers-67c05996.js';
16
+ import { i as inherits, c as createClass, a as classCallCheck, p as possibleConstructorReturn, _ as _extends, t as toConsumableArray } from './_babelHelpers-c212c59c.js';
17
17
 
18
18
  var MasterDeck = function (_React$Component) {
19
19
  inherits(MasterDeck, _React$Component);
@@ -6,8 +6,8 @@ import Row from 'react-bootstrap/Row';
6
6
  import Col from 'react-bootstrap/Col';
7
7
  import Link from 'next/link';
8
8
  import { a as main_36, b as main_37 } from './main-dea495b7.js';
9
- import { s as slicedToArray } from './_babelHelpers-67c05996.js';
10
- import { D as DFPAdSlot } from './AdSlot-b67f8534.js';
9
+ import { s as slicedToArray } from './_babelHelpers-c212c59c.js';
10
+ import { D as DFPAdSlot } from './AdSlot-748bc6ff.js';
11
11
  import { g as get_1 } from './get-b074314b.js';
12
12
  import { Dropdown } from 'react-bootstrap';
13
13
  import { G as GenIcon, b as IoMdLogIn, c as IoIosHome } from './index.esm-536609db.js';
@@ -1289,6 +1289,32 @@ var NavMagazine = function NavMagazine(props) {
1289
1289
  setScreenWidth(parseInt(window.innerWidth));
1290
1290
  }, []);
1291
1291
 
1292
+ useEffect(function () {
1293
+ var navOffsetTop = navRef.current.getBoundingClientRect().top;
1294
+ var navOffsetHeight = navRef.current.getBoundingClientRect().height;
1295
+ var adSection = document.querySelector('.AD728x90');
1296
+ var stickyNav = window.addEventListener('scroll', function () {
1297
+ if (window.pageYOffset > navOffsetTop) {
1298
+ if (navRef.current && navRef.current.style) {
1299
+ navRef.current.style.position = 'fixed';
1300
+ navRef.current.style.top = 0;
1301
+ navRef.current.style.width = '100%';
1302
+ navRef.current.style.zIndex = '9999';
1303
+ adSection.style.marginTop = navOffsetHeight + 'px';
1304
+ }
1305
+ } else {
1306
+ if (navRef.current && navRef.current.style) {
1307
+ navRef.current.style.position = 'relative';
1308
+ navRef.current.style.top = '';
1309
+ adSection.style.marginTop = '';
1310
+ }
1311
+ }
1312
+ });
1313
+ return function () {
1314
+ window.removeEventListener('scroll', stickyNav);
1315
+ };
1316
+ }, []);
1317
+
1292
1318
  var trackScrolling = function trackScrolling() {
1293
1319
  var offsetTop = navRef.current.getBoundingClientRect().top;
1294
1320
 
@@ -1999,7 +2025,7 @@ var HamMagazine = function HamMagazine(props) {
1999
2025
  var navOffsetTop = navRef.current.getBoundingClientRect().top;
2000
2026
  var navOffsetHeight = navRef.current.getBoundingClientRect().height;
2001
2027
  var adSection = document.querySelector('.AD728x90');
2002
- window.addEventListener('scroll', function () {
2028
+ var stickyNav = window.addEventListener('scroll', function () {
2003
2029
  if (window.pageYOffset > navOffsetTop) {
2004
2030
  if (navRef.current && navRef.current.style) {
2005
2031
  navRef.current.style.position = 'fixed';
@@ -2016,6 +2042,9 @@ var HamMagazine = function HamMagazine(props) {
2016
2042
  }
2017
2043
  }
2018
2044
  });
2045
+ return function () {
2046
+ window.removeEventListener('scroll', stickyNav);
2047
+ };
2019
2048
  }, []);
2020
2049
 
2021
2050
  var trackScrolling = function trackScrolling() {
@@ -10,7 +10,7 @@ import { i as imageUrlBuilder } from './index-ca4ff5cb.js';
10
10
  import { L as LazyLoad } from './index-3c1ee9ab.js';
11
11
  import { a as main_36 } from './main-dea495b7.js';
12
12
  import { c as clean_html_1 } from './entities-e85d3a4a.js';
13
- import { s as slicedToArray, _ as _extends, t as toConsumableArray } from './_babelHelpers-67c05996.js';
13
+ import { s as slicedToArray, _ as _extends, t as toConsumableArray } from './_babelHelpers-c212c59c.js';
14
14
  import { Container, Media } from 'react-bootstrap';
15
15
 
16
16
  var urlFor = function urlFor(source, builder) {
@@ -166,7 +166,7 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
166
166
  return React__default.createElement(
167
167
  'div',
168
168
  null,
169
- data && data.map(function (article, index) {
169
+ data && data.length > 0 ? data.map(function (article, index) {
170
170
  var pageNumber = article.pageNumber || values.page;
171
171
  var contentCategoryName = article.contentCategory ? article.contentCategory.name : 'Articles';
172
172
 
@@ -392,7 +392,19 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
392
392
  ),
393
393
  main_36 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index, numberOfItemsBeforeAd, rightItems)
394
394
  );
395
- }),
395
+ }) : React__default.createElement(
396
+ 'div',
397
+ null,
398
+ React__default.createElement(
399
+ 'h5',
400
+ null,
401
+ React__default.createElement(
402
+ 'em',
403
+ null,
404
+ 'New content coming soon, please check back later.'
405
+ )
406
+ )
407
+ ),
396
408
  React__default.createElement(
397
409
  'style',
398
410
  { jsx: 'true' },
@@ -6,7 +6,7 @@ import Col from 'react-bootstrap/Col';
6
6
  import Card from 'react-bootstrap/Card';
7
7
  import { n as node, i as imageUrlBuilder } from './index-ca4ff5cb.js';
8
8
  import { L as LazyLoad } from './index-3c1ee9ab.js';
9
- import { _ as _extends } from './_babelHelpers-67c05996.js';
9
+ import { _ as _extends } from './_babelHelpers-c212c59c.js';
10
10
 
11
11
  /*
12
12
  object-assign
@@ -8,5 +8,5 @@ import 'react-bootstrap/Card';
8
8
  import 'react-dom';
9
9
  import './index-ca4ff5cb.js';
10
10
  import './index-3c1ee9ab.js';
11
- import './_babelHelpers-67c05996.js';
12
- export { T as default } from './TaxonomyCard-f9c93953.js';
11
+ import './_babelHelpers-c212c59c.js';
12
+ export { T as default } from './TaxonomyCard-92f9e327.js';
@@ -8,13 +8,13 @@ import 'react-bootstrap/Col';
8
8
  import 'next/link';
9
9
  import './debounce-dc0c02e5.js';
10
10
  import './main-dea495b7.js';
11
- import './_babelHelpers-67c05996.js';
12
- import './AdSlot-b67f8534.js';
11
+ import './_babelHelpers-c212c59c.js';
12
+ import './AdSlot-748bc6ff.js';
13
13
  import './get-b074314b.js';
14
14
  import 'react-bootstrap';
15
15
  import './index.esm-536609db.js';
16
16
  import 'react-bootstrap/Button';
17
- export { T as default } from './Normal-8e0aa5e8.js';
17
+ export { T as default } from './Normal-088cf5cf.js';
18
18
  import 'react-bootstrap/ListGroup';
19
19
  import 'next/head';
20
20
  import 'react-bootstrap/Nav';
@@ -1,5 +1,5 @@
1
1
  import React__default, { useState, useRef, useEffect } from 'react';
2
- import { s as slicedToArray } from './_babelHelpers-67c05996.js';
2
+ import { s as slicedToArray } from './_babelHelpers-c212c59c.js';
3
3
  import { G as GenIcon, d as IoIosOpen } from './index.esm-536609db.js';
4
4
 
5
5
  // THIS FILE IS AUTO GENERATED
@@ -1,4 +1,4 @@
1
1
  import 'react';
2
- import './_babelHelpers-67c05996.js';
2
+ import './_babelHelpers-c212c59c.js';
3
3
  import './index.esm-536609db.js';
4
- export { U as default } from './Ustream-6bb45fe7.js';
4
+ export { U as default } from './Ustream-2bfb1813.js';
@@ -9,7 +9,7 @@ import { withRouter } from 'next/router';
9
9
  import { d as debounce_1 } from './debounce-dc0c02e5.js';
10
10
  import 'react-dom';
11
11
  import './index-3c1ee9ab.js';
12
- import { i as inherits, c as createClass, a as classCallCheck, p as possibleConstructorReturn, _ as _extends } from './_babelHelpers-67c05996.js';
12
+ import { i as inherits, c as createClass, a as classCallCheck, p as possibleConstructorReturn, _ as _extends } from './_babelHelpers-c212c59c.js';
13
13
  import { Y as YoutubeGroup } from './YoutubeGroup-1368335c.js';
14
14
  import { a as IoIosArrowForward } from './index.esm-536609db.js';
15
15
 
@@ -1,3 +1,32 @@
1
+ var asyncToGenerator = function (fn) {
2
+ return function () {
3
+ var gen = fn.apply(this, arguments);
4
+ return new Promise(function (resolve, reject) {
5
+ function step(key, arg) {
6
+ try {
7
+ var info = gen[key](arg);
8
+ var value = info.value;
9
+ } catch (error) {
10
+ reject(error);
11
+ return;
12
+ }
13
+
14
+ if (info.done) {
15
+ resolve(value);
16
+ } else {
17
+ return Promise.resolve(value).then(function (value) {
18
+ step("next", value);
19
+ }, function (err) {
20
+ step("throw", err);
21
+ });
22
+ }
23
+ }
24
+
25
+ return step("next");
26
+ });
27
+ };
28
+ };
29
+
1
30
  var classCallCheck = function (instance, Constructor) {
2
31
  if (!(instance instanceof Constructor)) {
3
32
  throw new TypeError("Cannot call a class as a function");
@@ -108,4 +137,4 @@ var toConsumableArray = function (arr) {
108
137
  }
109
138
  };
110
139
 
111
- export { _extends as _, classCallCheck as a, createClass as c, inherits as i, possibleConstructorReturn as p, slicedToArray as s, toConsumableArray as t };
140
+ export { _extends as _, classCallCheck as a, asyncToGenerator as b, createClass as c, inherits as i, possibleConstructorReturn as p, slicedToArray as s, toConsumableArray as t };
package/dist/esm/index.js CHANGED
@@ -15,17 +15,17 @@ import { i as imageUrlBuilder } from './index-ca4ff5cb.js';
15
15
  import './index-3c1ee9ab.js';
16
16
  import { m as main_35, a as main_36 } from './main-dea495b7.js';
17
17
  import { h as html_decode_1, c as clean_html_1 } from './entities-e85d3a4a.js';
18
- import { s as slicedToArray, _ as _extends$2, t as toConsumableArray, i as inherits$2, c as createClass, a as classCallCheck, p as possibleConstructorReturn } from './_babelHelpers-67c05996.js';
19
- import { D as DFPAdSlot } from './AdSlot-b67f8534.js';
20
- export { D as AdSlot } from './AdSlot-b67f8534.js';
18
+ import { s as slicedToArray, _ as _extends$2, t as toConsumableArray, i as inherits$2, c as createClass, a as classCallCheck, p as possibleConstructorReturn, b as asyncToGenerator } from './_babelHelpers-c212c59c.js';
19
+ import { D as DFPAdSlot } from './AdSlot-748bc6ff.js';
20
+ export { D as AdSlot } from './AdSlot-748bc6ff.js';
21
21
  export { default as DeckContent } from './DeckContent.js';
22
22
  import './get-b074314b.js';
23
- export { A as AD, G as GridContent } from './GridContent-e5cdc9da.js';
23
+ export { A as AD, G as GridContent } from './GridContent-e1c38e7f.js';
24
24
  export { default as DeckQueue } from './DeckQueue.js';
25
25
  import 'react-bootstrap/Media';
26
26
  export { default as ThumbnailCard } from './ThumbnailCard.js';
27
- import { B as BlockContent } from './TaxonomyCard-f9c93953.js';
28
- export { T as TaxonomyCard } from './TaxonomyCard-f9c93953.js';
27
+ import { B as BlockContent } from './TaxonomyCard-92f9e327.js';
28
+ export { T as TaxonomyCard } from './TaxonomyCard-92f9e327.js';
29
29
  import GroupDeck from './GroupDeck.js';
30
30
  export { default as GroupDeck } from './GroupDeck.js';
31
31
  import { g as getYoutubeId } from './YoutubeGroup-1368335c.js';
@@ -40,8 +40,8 @@ export { default as PublicationDeck } from './PublicationDeck.js';
40
40
  export { default as IssueDeck } from './IssueDeck.js';
41
41
  import 'react-bootstrap/Badge';
42
42
  export { default as IssueContentDeck } from './IssueContentDeck.js';
43
- import { M as MdPictureAsPdf, T as TemplateNormal } from './Normal-8e0aa5e8.js';
44
- export { A as AD728x90, C as Column1, a as Column2, b as Column3, f as HamMagazine, H as Header, L as LeftNav, e as NavDvm, c as NavMagazine, N as NavNative, d as NavNormal, P as PageFilter, S as Search, g as SideFooter, T as TemplateNormal } from './Normal-8e0aa5e8.js';
43
+ import { M as MdPictureAsPdf, T as TemplateNormal } from './Normal-088cf5cf.js';
44
+ export { A as AD728x90, C as Column1, a as Column2, b as Column3, f as HamMagazine, H as Header, L as LeftNav, e as NavDvm, c as NavMagazine, N as NavNative, d as NavNormal, P as PageFilter, S as Search, g as SideFooter, T as TemplateNormal } from './Normal-088cf5cf.js';
45
45
  import 'react-bootstrap/ListGroup';
46
46
  import Head from 'next/head';
47
47
  import Accordion from 'react-bootstrap/Accordion';
@@ -57,8 +57,8 @@ import Carousel$1 from 'react-bootstrap/Carousel';
57
57
  import Breadcrumb from 'react-bootstrap/Breadcrumb';
58
58
  import DropdownButton from 'react-bootstrap/DropdownButton';
59
59
  import Dropdown from 'react-bootstrap/Dropdown';
60
- import { F as FaLongArrowAltRight } from './Ustream-6bb45fe7.js';
61
- export { U as Ustream } from './Ustream-6bb45fe7.js';
60
+ import { F as FaLongArrowAltRight } from './Ustream-2bfb1813.js';
61
+ export { U as Ustream } from './Ustream-2bfb1813.js';
62
62
 
63
63
  var AccordionPanel = function AccordionPanel(props) {
64
64
  var accordionClassName = props.accordionClassName,
@@ -12364,8 +12364,9 @@ var ArticleQueue = function (_React$Component) {
12364
12364
  title: _this.props.article.title,
12365
12365
  summary: metaDescription,
12366
12366
  queueData: [article],
12367
- relatedArticles: [],
12368
- keywords: []
12367
+ keywords: [],
12368
+ maxListLength: 10,
12369
+ loading: false
12369
12370
  }, _this.preVscroll = 0;
12370
12371
  _this.isScrollDown = true;
12371
12372
 
@@ -12377,25 +12378,6 @@ var ArticleQueue = function (_React$Component) {
12377
12378
  value: function componentDidMount() {
12378
12379
  window.addEventListener('scroll', this.scrollDirectionDetect);
12379
12380
  }
12380
- }, {
12381
- key: 'componentDidUpdate',
12382
- value: function componentDidUpdate(prevProps) {
12383
- var _this2 = this;
12384
-
12385
- if (prevProps.relatedArticles != this.props.relatedArticles) {
12386
- var relatedArticles = this.props.relatedArticles.map(function (article) {
12387
- var targeting = _this2.getTargeting(_this2.props.article);
12388
- var Ads = _this2.props.Ads.getRightItems(targeting);
12389
- return _extends$2({}, article, { Ads: Ads });
12390
- });
12391
- var queueData = [].concat(toConsumableArray(this.state.queueData));
12392
- if (prevProps.relatedArticles.length == 0) {
12393
- queueData.push(relatedArticles.shift());
12394
- this.setState({ queueData: queueData });
12395
- }
12396
- this.setState({ relatedArticles: relatedArticles });
12397
- }
12398
- }
12399
12381
  }, {
12400
12382
  key: 'componentWillUnmount',
12401
12383
  value: function componentWillUnmount() {
@@ -12406,7 +12388,7 @@ var ArticleQueue = function (_React$Component) {
12406
12388
  }, {
12407
12389
  key: 'render',
12408
12390
  value: function render() {
12409
- var _this3 = this;
12391
+ var _this2 = this;
12410
12392
 
12411
12393
  var _state = this.state,
12412
12394
  config = _state.config,
@@ -12429,12 +12411,12 @@ var ArticleQueue = function (_React$Component) {
12429
12411
  queueData.map(function (article, index) {
12430
12412
  return React__default.createElement(Article, _extends$2({
12431
12413
  key: index,
12432
- urlFor: _this3.urlFor,
12433
- isCutomPage: _this3.isCutomPage,
12434
- renderIsiContent: _this3.renderIsiContent
12435
- }, _this3.props, {
12414
+ urlFor: _this2.urlFor,
12415
+ isCutomPage: _this2.isCutomPage,
12416
+ renderIsiContent: _this2.renderIsiContent
12417
+ }, _this2.props, {
12436
12418
  shareOptions: shareOptions,
12437
- changeUrl: _this3.changeUrl,
12419
+ changeUrl: _this2.changeUrl,
12438
12420
  article: article
12439
12421
  }));
12440
12422
  })
@@ -12446,37 +12428,68 @@ var ArticleQueue = function (_React$Component) {
12446
12428
  }(React__default.Component);
12447
12429
 
12448
12430
  var _initialiseProps = function _initialiseProps() {
12449
- var _this4 = this;
12431
+ var _this3 = this;
12450
12432
 
12451
12433
  this.scrollDirectionDetect = function (e) {
12452
12434
  var window = e.currentTarget;
12453
- var isScrollDown = _this4.isScrollDown;
12435
+ var isScrollDown = _this3.isScrollDown;
12454
12436
 
12455
12437
 
12456
- if (_this4.preVscroll > window.scrollY) {
12438
+ if (_this3.preVscroll > window.scrollY) {
12457
12439
  if (!isScrollDown) {
12458
- _this4.isScrollDown = true;
12440
+ _this3.isScrollDown = true;
12459
12441
  }
12460
- } else if (_this4.preVscroll < window.scrollY) {
12442
+ } else if (_this3.preVscroll < window.scrollY) {
12461
12443
  if (isScrollDown) {
12462
- _this4.isScrollDown = false;
12444
+ _this3.isScrollDown = false;
12463
12445
  }
12464
12446
  }
12465
- _this4.preVscroll = window.scrollY;
12447
+ _this3.preVscroll = window.scrollY;
12466
12448
  };
12467
12449
 
12468
- this.loadmore = function () {
12469
- var queueData = [].concat(toConsumableArray(_this4.state.queueData));
12470
- var relatedArticles = [].concat(toConsumableArray(_this4.state.relatedArticles));
12471
- if (relatedArticles.length > 0) {
12472
- queueData.push(relatedArticles.shift());
12473
- _this4.setState({ queueData: queueData, relatedArticles: relatedArticles });
12474
- }
12475
- };
12450
+ this.loadmore = asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
12451
+ var maxListLength, queueData, query, params, article, targeting;
12452
+ return regeneratorRuntime.wrap(function _callee$(_context) {
12453
+ while (1) {
12454
+ switch (_context.prev = _context.next) {
12455
+ case 0:
12456
+ maxListLength = _this3.props.maxListLength ? _this3.props.maxListLength : _this3.state.maxListLength;
12457
+ queueData = [].concat(toConsumableArray(_this3.state.queueData));
12458
+ query = _this3.props.relatedArticleQuery;
12459
+ params = _this3.props.params;
12460
+
12461
+ if (!(queueData.length < maxListLength)) {
12462
+ _context.next = 10;
12463
+ break;
12464
+ }
12465
+
12466
+ params.index = queueData.length - 1;
12467
+
12468
+ _context.next = 8;
12469
+ return _this3.props.client.fetch(query, params);
12470
+
12471
+ case 8:
12472
+ article = _context.sent;
12473
+
12474
+ if (article) {
12475
+ targeting = _this3.getTargeting(article);
12476
+
12477
+ article.Ads = _this3.props.Ads.getRightItems(targeting);
12478
+ queueData.push(article);
12479
+ _this3.setState({ queueData: queueData });
12480
+ }
12481
+
12482
+ case 10:
12483
+ case 'end':
12484
+ return _context.stop();
12485
+ }
12486
+ }
12487
+ }, _callee, _this3);
12488
+ }));
12476
12489
 
12477
12490
  this.isCutomPage = function (article) {
12478
12491
  var url = article.url.current;
12479
- var _props2 = _this4.props,
12492
+ var _props2 = _this3.props,
12480
12493
  regionalPages = _props2.regionalPages,
12481
12494
  nationalPage = _props2.nationalPage;
12482
12495
 
@@ -12484,7 +12497,7 @@ var _initialiseProps = function _initialiseProps() {
12484
12497
  };
12485
12498
 
12486
12499
  this.urlFor = function (source) {
12487
- return imageUrlBuilder(_this4.props.client).image(source);
12500
+ return imageUrlBuilder(_this3.props.client).image(source);
12488
12501
  };
12489
12502
 
12490
12503
  this.getTargeting = function (article) {
@@ -12509,7 +12522,7 @@ var _initialiseProps = function _initialiseProps() {
12509
12522
  content_placement = article.content_placement;
12510
12523
 
12511
12524
  var context = url;
12512
- var localHistory = _this4.props.historyCookie ? JSON.parse(_this4.props.historyCookie) : [];
12525
+ var localHistory = _this3.props.historyCookie ? JSON.parse(_this3.props.historyCookie) : [];
12513
12526
  if (!context && localHistory) {
12514
12527
  context = localHistory[localHistory.length - 1];
12515
12528
  }
@@ -12548,7 +12561,7 @@ var _initialiseProps = function _initialiseProps() {
12548
12561
  var _article$taxonomyMapp = article.taxonomyMapping,
12549
12562
  taxonomyMapping = _article$taxonomyMapp === undefined ? [] : _article$taxonomyMapp;
12550
12563
 
12551
- if (_this4.props.checkSponsered) {
12564
+ if (_this3.props.checkSponsered) {
12552
12565
 
12553
12566
  return taxonomyMapping.some(function (item) {
12554
12567
  return item._ref === 'ict_taxonomy_735_sponsoredresources';
@@ -12560,7 +12573,7 @@ var _initialiseProps = function _initialiseProps() {
12560
12573
 
12561
12574
  this.renderIsiContent = function (article) {
12562
12575
  var url = article.url.current;
12563
- var _props3 = _this4.props,
12576
+ var _props3 = _this3.props,
12564
12577
  ISIContent = _props3.iSIContent,
12565
12578
  regionalPages = _props3.regionalPages,
12566
12579
  nationalPage = _props3.nationalPage;
@@ -12594,7 +12607,7 @@ var _initialiseProps = function _initialiseProps() {
12594
12607
  };
12595
12608
 
12596
12609
  this.refreshAdd = function (path) {
12597
- var article = _this4.state.queueData.find(function (item) {
12610
+ var article = _this3.state.queueData.find(function (item) {
12598
12611
  return item.url.current == path;
12599
12612
  });
12600
12613
  var title = article.title,
@@ -12614,20 +12627,20 @@ var _initialiseProps = function _initialiseProps() {
12614
12627
  var description = _article$seo.meta_description;
12615
12628
 
12616
12629
  var keywords = [].concat(toConsumableArray(internalTag), toConsumableArray(userDefinedTag), toConsumableArray(SponsorshipTag), toConsumableArray(seoTag));
12617
- var config = _extends$2({}, _this4.state.config);
12618
- var targeting = _this4.getTargeting(article);
12630
+ var config = _extends$2({}, _this3.state.config);
12631
+ var targeting = _this3.getTargeting(article);
12619
12632
  var rightItems = [];
12620
12633
 
12621
- if (_this4.checkSponseredArticle(article)) {
12634
+ if (_this3.checkSponseredArticle(article)) {
12622
12635
  rightItems = [];
12623
12636
  } else {
12624
- rightItems = _this4.props.Ads.getRightItems(targeting);
12637
+ rightItems = _this3.props.Ads.getRightItems(targeting);
12625
12638
  }
12626
- var horizontalAD = _this4.props.Ads.getHorizontal(targeting);
12639
+ var horizontalAD = _this3.props.Ads.getHorizontal(targeting);
12627
12640
  config.rightItems = rightItems;
12628
12641
  config.horizontalAD = horizontalAD;
12629
- var metaDescription = description ? description : summary ? summary : _this4.getFirstLine(article);
12630
- _this4.setState({ config: config, title: title, summary: metaDescription }, function () {
12642
+ var metaDescription = description ? description : summary ? summary : _this3.getFirstLine(article);
12643
+ _this3.setState({ config: config, title: title, summary: metaDescription }, function () {
12631
12644
  if (!main_36) {
12632
12645
  lib_3.refresh();
12633
12646
  }
@@ -12635,28 +12648,28 @@ var _initialiseProps = function _initialiseProps() {
12635
12648
  };
12636
12649
 
12637
12650
  this.changeUrl = function (path, visibility) {
12638
- var isScrollDown = _this4.isScrollDown;
12651
+ var isScrollDown = _this3.isScrollDown;
12639
12652
 
12640
12653
  var newPath = '/view/' + path;
12641
12654
  if (!isScrollDown) {
12642
12655
  if (visibility == 'top') {
12643
12656
  // Router.push('/view/[url]', newPath, {shallow:true})
12644
12657
  window.history.pushState({ page: path }, path, newPath);
12645
- if (_this4.props.pageview) {
12646
- _this4.props.pageview(newPath);
12658
+ if (_this3.props.pageview) {
12659
+ _this3.props.pageview(newPath);
12647
12660
  }
12648
12661
 
12649
- _this4.refreshAdd(path);
12662
+ _this3.refreshAdd(path);
12650
12663
  }
12651
12664
  } else {
12652
12665
  if (visibility == 'bottom') {
12653
12666
  // Router.push('/view/[url]', newPath, {shallow:true})
12654
12667
  window.history.pushState({ page: path }, path, newPath);
12655
- if (_this4.props.pageview) {
12656
- _this4.props.pageview(newPath);
12668
+ if (_this3.props.pageview) {
12669
+ _this3.props.pageview(newPath);
12657
12670
  }
12658
12671
 
12659
- _this4.refreshAdd(path);
12672
+ _this3.refreshAdd(path);
12660
12673
  }
12661
12674
  }
12662
12675
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.225",
3
+ "version": "1.0.226",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",