@mjhls/mjh-framework 1.0.267 → 1.0.269

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 (44) hide show
  1. package/README.md +171 -171
  2. package/dist/cjs/ADInfeed-0da6acd4.js +47 -0
  3. package/dist/cjs/{AdSlot-1c436555.js → AdSlot-93d892f5.js} +5 -1
  4. package/dist/cjs/DeckContent.js +12 -27
  5. package/dist/cjs/DeckQueue.js +1 -1
  6. package/dist/cjs/{GridContent-e459f9e3.js → GridContent-524f2ad8.js} +4 -16
  7. package/dist/cjs/GridContent.js +4 -3
  8. package/dist/cjs/IssueContentDeck.js +1 -1
  9. package/dist/cjs/IssueDeck.js +1 -1
  10. package/dist/cjs/MasterDeck.js +9 -9
  11. package/dist/cjs/{Normal-8c148732.js → Normal-6c0b2764.js} +32 -32
  12. package/dist/cjs/PublicationDeck.js +1 -1
  13. package/dist/cjs/QueueDeckExpanded.js +1 -1
  14. package/dist/cjs/{TaxonomyCard-e3566492.js → TaxonomyCard-b5074d6e.js} +1 -1
  15. package/dist/cjs/TaxonomyCard.js +2 -2
  16. package/dist/cjs/TemplateNormal.js +2 -2
  17. package/dist/cjs/ThumbnailCard.js +1 -1
  18. package/dist/cjs/VideoSeriesListing.js +2 -1
  19. package/dist/cjs/{YoutubeGroup-94e6efea.js → YoutubeGroup-78e6bcc3.js} +5 -437
  20. package/dist/cjs/YoutubeGroup.js +2 -1
  21. package/dist/cjs/{index-be0c82be.js → index-39beccb3.js} +2 -1
  22. package/dist/cjs/index.js +558 -538
  23. package/dist/esm/ADInfeed-e546ea87.js +42 -0
  24. package/dist/esm/{AdSlot-5b019415.js → AdSlot-9b4ae186.js} +5 -1
  25. package/dist/esm/DeckContent.js +12 -27
  26. package/dist/esm/DeckQueue.js +1 -1
  27. package/dist/esm/{GridContent-be36b0aa.js → GridContent-f4fd38a7.js} +3 -15
  28. package/dist/esm/GridContent.js +4 -3
  29. package/dist/esm/IssueContentDeck.js +1 -1
  30. package/dist/esm/IssueDeck.js +1 -1
  31. package/dist/esm/MasterDeck.js +9 -9
  32. package/dist/esm/{Normal-3822b5a3.js → Normal-b7aa5dce.js} +32 -32
  33. package/dist/esm/PublicationDeck.js +1 -1
  34. package/dist/esm/QueueDeckExpanded.js +1 -1
  35. package/dist/esm/{TaxonomyCard-2d0ab635.js → TaxonomyCard-ee1a22ae.js} +1 -1
  36. package/dist/esm/TaxonomyCard.js +2 -2
  37. package/dist/esm/TemplateNormal.js +2 -2
  38. package/dist/esm/ThumbnailCard.js +1 -1
  39. package/dist/esm/VideoSeriesListing.js +2 -1
  40. package/dist/esm/{YoutubeGroup-f59297bb.js → YoutubeGroup-a87b8967.js} +5 -437
  41. package/dist/esm/YoutubeGroup.js +2 -1
  42. package/dist/esm/{index-73819142.js → index-3849e3fe.js} +2 -1
  43. package/dist/esm/index.js +562 -542
  44. package/package.json +103 -103
@@ -0,0 +1,42 @@
1
+ import React__default, { useState } from 'react';
2
+ import Card from 'react-bootstrap/Card';
3
+ import { _ as _slicedToArray } from './slicedToArray-d0a9593a.js';
4
+ import { D as DFPAdSlot } from './AdSlot-9b4ae186.js';
5
+
6
+ var ADInfeed = function ADInfeed(_ref) {
7
+ var index = _ref.index,
8
+ infeedAd = _ref.infeedAd;
9
+ var className = infeedAd.className,
10
+ slotId = infeedAd.slotId,
11
+ adUnit = infeedAd.adUnit,
12
+ _infeedAd$targeting = infeedAd.targeting,
13
+ targeting = _infeedAd$targeting === undefined ? {} : _infeedAd$targeting,
14
+ networkID = infeedAd.networkID,
15
+ sizes = infeedAd.sizes;
16
+
17
+ var _useState = useState(true),
18
+ _useState2 = _slicedToArray(_useState, 2),
19
+ showAd = _useState2[0],
20
+ setShowAd = _useState2[1];
21
+
22
+ return React__default.createElement(
23
+ React__default.Fragment,
24
+ null,
25
+ showAd && React__default.createElement(
26
+ 'div',
27
+ { className: 'brand-insight-wrapper', style: { display: 'flex', flex: '1 0 auto' } },
28
+ React__default.createElement(
29
+ Card,
30
+ { className: 'ad-wrapper', style: { display: 'block !important', flexDirection: index === 0 || index % 4 === 0 ? 'top' : 'row' } },
31
+ React__default.createElement(DFPAdSlot, { className: className, networkID: networkID, adUnit: adUnit, slotId: slotId, targeting: targeting, sizes: sizes, setShowAd: setShowAd })
32
+ ),
33
+ React__default.createElement(
34
+ 'style',
35
+ { jsx: 'true' },
36
+ ''
37
+ )
38
+ )
39
+ );
40
+ };
41
+
42
+ export { ADInfeed as A };
@@ -1108,6 +1108,10 @@ var DFPAdSlot = function DFPAdSlot(_ref) {
1108
1108
  }
1109
1109
  }, 500);
1110
1110
 
1111
+ var matchAd = function matchAd(element) {
1112
+ return slotId.includes(element);
1113
+ };
1114
+
1111
1115
  return React__default.createElement(
1112
1116
  'div',
1113
1117
  { className: className, style: { textAlign: 'center' } },
@@ -1118,7 +1122,7 @@ var DFPAdSlot = function DFPAdSlot(_ref) {
1118
1122
  sizeMapping: sizeMapping,
1119
1123
  targetingArguments: targeting,
1120
1124
  onSlotRender: function onSlotRender(eventData) {
1121
- if (slotId === 'floating-ad' && eventData && eventData.event && eventData.event.creativeId == null) {
1125
+ if (['floating-ad', 'infeed'].some(matchAd) && eventData && eventData.event && eventData.event.creativeId == null) {
1122
1126
  setShowAd(false);
1123
1127
  }
1124
1128
  setAdRendered(true);
@@ -18,12 +18,13 @@ import { V as VisibilitySensor, m as moment, I as InfiniteScroll } from './visib
18
18
  import 'next/link';
19
19
  import { withRouter } from 'next/router';
20
20
  import 'react-dom';
21
- import { i as imageUrlBuilder } from './index-73819142.js';
21
+ import { i as imageUrlBuilder } from './index-3849e3fe.js';
22
22
  import { L as LazyLoad } from './index-5f9f807a.js';
23
23
  import { c as clean_html_1 } from './entities-7cc3bf45.js';
24
24
  import './slicedToArray-d0a9593a.js';
25
- import { D as DFPAdSlot } from './AdSlot-5b019415.js';
25
+ import './AdSlot-9b4ae186.js';
26
26
  import './promise-683a9c54.js';
27
+ import { A as ADInfeed } from './ADInfeed-e546ea87.js';
27
28
 
28
29
  var DeckContent = function (_React$Component) {
29
30
  _inherits(DeckContent, _React$Component);
@@ -164,14 +165,14 @@ var DeckContent = function (_React$Component) {
164
165
  var newPath = pageNumber === 1 ? '' + path : path + '?page=' + pageNumber;
165
166
 
166
167
  // please leave this for later debug purpose : Yong Jun.
167
- /* console.log('page change reported', {
168
- currentPage: currentPage,
169
- pageNumber: pageNumber,
170
- pathname: pathname,
171
- path: path,
172
- newPath: newPath,
173
- firstPage: pageNumber === 1,
174
- queryString: queryString
168
+ /* console.log('page change reported', {
169
+ currentPage: currentPage,
170
+ pageNumber: pageNumber,
171
+ pathname: pathname,
172
+ path: path,
173
+ newPath: newPath,
174
+ firstPage: pageNumber === 1,
175
+ queryString: queryString
175
176
  }) */
176
177
 
177
178
  if (pageview) {
@@ -273,23 +274,7 @@ var DeckContent = function (_React$Component) {
273
274
  lgVar = 6;
274
275
  }
275
276
  if (row._type === 'BrandInsight' && row.adUnit) {
276
- return React__default.createElement(
277
- React__default.Fragment,
278
- { key: itemCounter },
279
- React__default.createElement(
280
- Col,
281
- { className: 'brand-insight-wrapper', sm: 12, counter: itemCounter++, style: { display: 'flex', flex: '1 0 auto' } },
282
- React__default.createElement(
283
- Card,
284
- { className: 'ad-wrapper', style: { flexDirection: index === 0 || index % 4 === 0 ? 'top' : 'row' } },
285
- React__default.createElement(
286
- 'div',
287
- { style: { width: '100%', height: 'auto' } },
288
- React__default.createElement(DFPAdSlot, { className: row.className, networkID: row.networkID, adUnit: row.adUnit, slotId: row.slotId, targeting: row.targeting, sizes: row.sizes })
289
- )
290
- )
291
- )
292
- );
277
+ return React__default.createElement(ADInfeed, { index: index, infeedAd: row });
293
278
  } else {
294
279
  var pageNumber = row.pageNumber || _this.state.page;
295
280
  var contentCategoryName = row.contentCategory && row.contentCategory.name && _this.mapping[row.contentCategory.name] ? row.contentCategory.name : 'Articles';
@@ -18,7 +18,7 @@ import { V as VisibilitySensor, m as moment, I as InfiniteScroll } from './visib
18
18
  import 'next/link';
19
19
  import { withRouter } from 'next/router';
20
20
  import 'react-dom';
21
- import { i as imageUrlBuilder } from './index-73819142.js';
21
+ import { i as imageUrlBuilder } from './index-3849e3fe.js';
22
22
  import { L as LazyLoad } from './index-5f9f807a.js';
23
23
  import { c as clean_html_1 } from './entities-7cc3bf45.js';
24
24
  import { g as get_1 } from './get-b2201dc8.js';
@@ -12,10 +12,10 @@ import Card from 'react-bootstrap/Card';
12
12
  import { m as moment, V as VisibilitySensor, I as InfiniteScroll } from './visibility-sensor-336093e1.js';
13
13
  import 'next/link';
14
14
  import { withRouter } from 'next/router';
15
- import { i as imageUrlBuilder } from './index-73819142.js';
15
+ import { i as imageUrlBuilder } from './index-3849e3fe.js';
16
16
  import { L as LazyLoad } from './index-5f9f807a.js';
17
17
  import { c as clean_html_1 } from './entities-7cc3bf45.js';
18
- import { D as DFPAdSlot } from './AdSlot-5b019415.js';
18
+ import { A as ADInfeed } from './ADInfeed-e546ea87.js';
19
19
  import { g as get_1 } from './get-b2201dc8.js';
20
20
 
21
21
  var Dfp = React__default.lazy(function () {
@@ -507,19 +507,7 @@ var GridContent = function (_React$Component) {
507
507
  );
508
508
  }
509
509
  } else if (row._type === 'BrandInsight' && row.adUnit) {
510
- return React__default.createElement(
511
- React__default.Fragment,
512
- { key: itemCounter },
513
- React__default.createElement(
514
- 'div',
515
- { className: 'brand-insight-wrapper', counter: itemCounter++, style: { display: 'flex', flex: '1 0 auto' } },
516
- React__default.createElement(
517
- Card,
518
- { className: 'ad-wrapper', style: { display: 'block !important', flexDirection: index === 0 || index % 4 === 0 ? 'top' : 'row' } },
519
- React__default.createElement(DFPAdSlot, { className: row.className, networkID: row.networkID, adUnit: row.adUnit, slotId: row.slotId, targeting: row.targeting, sizes: row.sizes })
520
- )
521
- )
522
- );
510
+ return React__default.createElement(ADInfeed, { index: index, infeedAd: row });
523
511
  }
524
512
  return React__default.createElement(
525
513
  React__default.Fragment,
@@ -18,11 +18,12 @@ import './visibility-sensor-336093e1.js';
18
18
  import 'next/link';
19
19
  import 'next/router';
20
20
  import 'react-dom';
21
- import './index-73819142.js';
21
+ import './index-3849e3fe.js';
22
22
  import './index-5f9f807a.js';
23
23
  import './entities-7cc3bf45.js';
24
24
  import './slicedToArray-d0a9593a.js';
25
- import './AdSlot-5b019415.js';
25
+ import './AdSlot-9b4ae186.js';
26
26
  import './promise-683a9c54.js';
27
+ import './ADInfeed-e546ea87.js';
27
28
  import './get-b2201dc8.js';
28
- export { G as default } from './GridContent-be36b0aa.js';
29
+ export { G as default } from './GridContent-f4fd38a7.js';
@@ -6,7 +6,7 @@ import Col from 'react-bootstrap/Col';
6
6
  import Card from 'react-bootstrap/Card';
7
7
  import 'next/link';
8
8
  import 'react-dom';
9
- import { i as imageUrlBuilder } from './index-73819142.js';
9
+ import { i as imageUrlBuilder } from './index-3849e3fe.js';
10
10
  import { L as LazyLoad } from './index-5f9f807a.js';
11
11
  import Badge from 'react-bootstrap/Badge';
12
12
 
@@ -6,7 +6,7 @@ import Col from 'react-bootstrap/Col';
6
6
  import Card from 'react-bootstrap/Card';
7
7
  import 'next/link';
8
8
  import 'react-dom';
9
- import { i as imageUrlBuilder } from './index-73819142.js';
9
+ import { i as imageUrlBuilder } from './index-3849e3fe.js';
10
10
  import { L as LazyLoad } from './index-5f9f807a.js';
11
11
  import Button from 'react-bootstrap/Button';
12
12
 
@@ -18,7 +18,7 @@ import { V as VisibilitySensor, I as InfiniteScroll } from './visibility-sensor-
18
18
  import 'next/link';
19
19
  import { withRouter } from 'next/router';
20
20
  import 'react-dom';
21
- import './index-73819142.js';
21
+ import './index-3849e3fe.js';
22
22
  import { _ as _Promise } from './promise-683a9c54.js';
23
23
 
24
24
  var MasterDeck = function (_React$Component) {
@@ -164,14 +164,14 @@ var MasterDeck = function (_React$Component) {
164
164
  var newPath = pageNumber === 1 ? '' + path : path + '?page=' + pageNumber;
165
165
 
166
166
  // please leave this for later debug purpose : Yong Jun.
167
- /* console.log('page change reported', {
168
- currentPage: currentPage,
169
- pageNumber: pageNumber,
170
- pathname: pathname,
171
- path: path,
172
- newPath: newPath,
173
- firstPage: pageNumber === 1,
174
- queryString: queryString
167
+ /* console.log('page change reported', {
168
+ currentPage: currentPage,
169
+ pageNumber: pageNumber,
170
+ pathname: pathname,
171
+ path: path,
172
+ newPath: newPath,
173
+ firstPage: pageNumber === 1,
174
+ queryString: queryString
175
175
  }) */
176
176
 
177
177
  if (pageview) {
@@ -8,7 +8,7 @@ import Row from 'react-bootstrap/Row';
8
8
  import Col from 'react-bootstrap/Col';
9
9
  import Link from 'next/link';
10
10
  import { _ as _slicedToArray } from './slicedToArray-d0a9593a.js';
11
- import { D as DFPAdSlot } from './AdSlot-5b019415.js';
11
+ import { D as DFPAdSlot } from './AdSlot-9b4ae186.js';
12
12
  import { g as get_1 } from './get-b2201dc8.js';
13
13
  import { Dropdown } from 'react-bootstrap';
14
14
  import { G as GenIcon, b as IoMdLogIn, c as IoIosHome } from './index.esm-536609db.js';
@@ -670,8 +670,8 @@ var renderLink = function renderLink(row) {
670
670
  };
671
671
 
672
672
  var SideFooter = function SideFooter(props) {
673
- /*
674
- useage example: <SideFooter cache={props.cache} logo='https://mjh-web.s3.amazonaws.com/_media/an_mjhls_brand_logo.png' />
673
+ /*
674
+ useage example: <SideFooter cache={props.cache} logo='https://mjh-web.s3.amazonaws.com/_media/an_mjhls_brand_logo.png' />
675
675
  */
676
676
  var _get = get_1(props, 'cache.siteSettingCache', {}),
677
677
  socialLinks = _get.socialLinks,
@@ -794,7 +794,7 @@ var Column2 = function Column2(props) {
794
794
  var LeftNav = function LeftNav(props) {
795
795
  var leftItems = props.leftItems,
796
796
  _props$fixedHeight = props.fixedHeight,
797
- fixedHeight = _props$fixedHeight === undefined ? true : _props$fixedHeight,
797
+ fixedHeight = _props$fixedHeight === undefined ? false : _props$fixedHeight,
798
798
  _props$SeeAll = props.SeeAll,
799
799
  SeeAll = _props$SeeAll === undefined ? true : _props$SeeAll;
800
800
 
@@ -949,7 +949,7 @@ var Column3 = function Column3(props) {
949
949
  var adRef = useRef(null);
950
950
 
951
951
  useEffect(function () {
952
- if (!main_36) {
952
+ if (!main_36 && window.innerWidth >= 768) {
953
953
  var navbar = document.querySelector('.navbar');
954
954
  var AdOffsetTop = adRef.current.getBoundingClientRect().top;
955
955
  window.addEventListener('scroll', function () {
@@ -1244,15 +1244,15 @@ var SocialNavFooter = function SocialNavFooter(props) {
1244
1244
  };
1245
1245
 
1246
1246
  var NavMagazine = function NavMagazine(props) {
1247
- /*
1248
- Example Nav with acceptable props
1249
- <MagazineNav
1250
- showLogin
1251
- logo={props.settings.logo}
1252
- dataObject={props.cache.mainNavCache}
1253
- website={website}
1254
- subNav={props.cache.subNavCache}
1255
- />
1247
+ /*
1248
+ Example Nav with acceptable props
1249
+ <MagazineNav
1250
+ showLogin
1251
+ logo={props.settings.logo}
1252
+ dataObject={props.cache.mainNavCache}
1253
+ website={website}
1254
+ subNav={props.cache.subNavCache}
1255
+ />
1256
1256
  */
1257
1257
 
1258
1258
  var logo = props.logo,
@@ -1566,15 +1566,15 @@ var NavMagazine = function NavMagazine(props) {
1566
1566
  var MagazineNav = React__default.memo(NavMagazine);
1567
1567
 
1568
1568
  var NavNative = function NavNative(props) {
1569
- /*
1570
- Example Nav with acceptable props
1571
- <MagazineNav
1572
- showLogin
1573
- logo={props.settings.logo}
1574
- dataObject={props.cache.mainNavCache}
1575
- website={website}
1576
- subNav={props.cache.subNavCache}
1577
- />
1569
+ /*
1570
+ Example Nav with acceptable props
1571
+ <MagazineNav
1572
+ showLogin
1573
+ logo={props.settings.logo}
1574
+ dataObject={props.cache.mainNavCache}
1575
+ website={website}
1576
+ subNav={props.cache.subNavCache}
1577
+ />
1578
1578
  */
1579
1579
 
1580
1580
  var logo = props.logo,
@@ -1968,15 +1968,15 @@ var NavDvm = function NavDvm(props) {
1968
1968
  };
1969
1969
 
1970
1970
  var HamMagazine = function HamMagazine(props) {
1971
- /*
1972
- Example Nav with acceptable props
1973
- <MagazineNav
1974
- showLogin
1975
- logo={props.settings.logo}
1976
- dataObject={props.cache.mainNavCache}
1977
- website={website}
1978
- subNav={props.cache.subNavCache}
1979
- />
1971
+ /*
1972
+ Example Nav with acceptable props
1973
+ <MagazineNav
1974
+ showLogin
1975
+ logo={props.settings.logo}
1976
+ dataObject={props.cache.mainNavCache}
1977
+ website={website}
1978
+ subNav={props.cache.subNavCache}
1979
+ />
1980
1980
  */
1981
1981
 
1982
1982
  var logo = props.logo,
@@ -6,7 +6,7 @@ import Col from 'react-bootstrap/Col';
6
6
  import Card from 'react-bootstrap/Card';
7
7
  import 'next/link';
8
8
  import 'react-dom';
9
- import { i as imageUrlBuilder } from './index-73819142.js';
9
+ import { i as imageUrlBuilder } from './index-3849e3fe.js';
10
10
  import { L as LazyLoad } from './index-5f9f807a.js';
11
11
  import Button from 'react-bootstrap/Button';
12
12
 
@@ -12,7 +12,7 @@ import { I as InfiniteScroll, V as VisibilitySensor, m as moment } from './visib
12
12
  import 'next/link';
13
13
  import { useRouter } from 'next/router';
14
14
  import 'react-dom';
15
- import { i as imageUrlBuilder } from './index-73819142.js';
15
+ import { i as imageUrlBuilder } from './index-3849e3fe.js';
16
16
  import { L as LazyLoad } from './index-5f9f807a.js';
17
17
  import { c as clean_html_1 } from './entities-7cc3bf45.js';
18
18
  import { _ as _slicedToArray } from './slicedToArray-d0a9593a.js';
@@ -5,7 +5,7 @@ import Container from 'react-bootstrap/Container';
5
5
  import Row from 'react-bootstrap/Row';
6
6
  import Col from 'react-bootstrap/Col';
7
7
  import Card from 'react-bootstrap/Card';
8
- import { n as node, i as imageUrlBuilder } from './index-73819142.js';
8
+ import { n as node, i as imageUrlBuilder } from './index-3849e3fe.js';
9
9
  import { L as LazyLoad } from './index-5f9f807a.js';
10
10
 
11
11
  /*
@@ -8,6 +8,6 @@ import 'react-bootstrap/Row';
8
8
  import 'react-bootstrap/Col';
9
9
  import 'react-bootstrap/Card';
10
10
  import 'react-dom';
11
- import './index-73819142.js';
11
+ import './index-3849e3fe.js';
12
12
  import './index-5f9f807a.js';
13
- export { T as default } from './TaxonomyCard-2d0ab635.js';
13
+ export { T as default } from './TaxonomyCard-ee1a22ae.js';
@@ -13,13 +13,13 @@ import 'react-bootstrap/Row';
13
13
  import 'react-bootstrap/Col';
14
14
  import 'next/link';
15
15
  import './slicedToArray-d0a9593a.js';
16
- import './AdSlot-5b019415.js';
16
+ import './AdSlot-9b4ae186.js';
17
17
  import './promise-683a9c54.js';
18
18
  import './get-b2201dc8.js';
19
19
  import 'react-bootstrap';
20
20
  import './index.esm-536609db.js';
21
21
  import 'react-bootstrap/Button';
22
- export { T as default } from './Normal-3822b5a3.js';
22
+ export { T as default } from './Normal-b7aa5dce.js';
23
23
  import 'react-bootstrap/ListGroup';
24
24
  import 'next/head';
25
25
  import 'react-bootstrap/Nav';
@@ -2,7 +2,7 @@ import './_commonjsHelpers-0c4b6f40.js';
2
2
  import React__default from 'react';
3
3
  import 'prop-types';
4
4
  import 'react-dom';
5
- import { i as imageUrlBuilder } from './index-73819142.js';
5
+ import { i as imageUrlBuilder } from './index-3849e3fe.js';
6
6
  import { L as LazyLoad } from './index-5f9f807a.js';
7
7
  import { c as clean_html_1 } from './entities-7cc3bf45.js';
8
8
  import Media$1 from 'react-bootstrap/Media';
@@ -13,7 +13,8 @@ import 'next/link';
13
13
  import { withRouter } from 'next/router';
14
14
  import 'react-dom';
15
15
  import './index-5f9f807a.js';
16
- import { Y as YoutubeGroup } from './YoutubeGroup-f59297bb.js';
16
+ import { Y as YoutubeGroup } from './YoutubeGroup-a87b8967.js';
17
+ import 'smoothscroll-polyfill';
17
18
  import { a as IoIosArrowForward } from './index.esm-536609db.js';
18
19
 
19
20
  var VideoSeriesListing = function (_React$Component) {