@mjhls/mjh-framework 1.0.373 → 1.0.375

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.
package/dist/esm/index.js CHANGED
@@ -20,13 +20,13 @@ import { i as imageUrlBuilder } from './index-51a80699.js';
20
20
  import { L as LazyLoad } from './index-5f9f807a.js';
21
21
  import { c as clean_html_1, h as html_decode_1 } from './entities-7cc3bf45.js';
22
22
  import { _ as _slicedToArray, a as _getIterator } from './slicedToArray-a47a84a4.js';
23
- import { _ as _JSON$stringify, a as _asyncToGenerator, r as regenerator, D as DFPAdSlot, B as Beam } from './AdSlot-8946358f.js';
24
- export { D as AdSlot, B as Beam } from './AdSlot-8946358f.js';
23
+ import { _ as _JSON$stringify, a as _asyncToGenerator, r as regenerator, D as DFPAdSlot, B as Beam } from './AdSlot-1cc6bdb0.js';
24
+ export { D as AdSlot, B as Beam } from './AdSlot-1cc6bdb0.js';
25
25
  import './promise-86cb8313.js';
26
- import { A as ADInfeed } from './ADInfeed-ca26fca6.js';
26
+ import { A as ADInfeed } from './ADInfeed-c65835b9.js';
27
27
  export { default as DeckContent } from './DeckContent.js';
28
28
  import { i as isFunction_1, a as isArray_1, _ as _arrayMap } from './get-36d03764.js';
29
- export { A as AD, G as GridContent } from './GridContent-e2b1de22.js';
29
+ export { A as AD, G as GridContent } from './GridContent-6aafc29f.js';
30
30
  export { default as DeckQueue } from './DeckQueue.js';
31
31
  import 'react-bootstrap/Media';
32
32
  export { default as ThumbnailCard } from './ThumbnailCard.js';
@@ -48,8 +48,8 @@ export { default as IssueDeck } from './IssueDeck.js';
48
48
  import 'react-bootstrap/Badge';
49
49
  export { default as IssueContentDeck } from './IssueContentDeck.js';
50
50
  import Spinner from 'react-bootstrap/Spinner';
51
- import { M as MdPictureAsPdf } from './Normal-13c85a50.js';
52
- 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-13c85a50.js';
51
+ import { M as MdPictureAsPdf } from './Normal-308179a5.js';
52
+ 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-308179a5.js';
53
53
  import 'react-bootstrap/ListGroup';
54
54
  import Head from 'next/head';
55
55
  import Accordion from 'react-bootstrap/Accordion';
@@ -225,7 +225,7 @@ var checkExternalUrl = function checkExternalUrl(url) {
225
225
  return new RegExp(['http', 'https'].join('|')).test(url);
226
226
  };
227
227
 
228
- var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth, rightItems, brandInsightAd, showBI, itemsPerPage) {
228
+ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth, rightItems, brandInsightAd, showBI, itemsPerPage, heroContent) {
229
229
  var numberOfItemsBeforeAd = 6;
230
230
 
231
231
  var insertBrandInsightAd = function insertBrandInsightAd(arr, index, newElement) {
@@ -253,6 +253,8 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
253
253
  }
254
254
  }
255
255
 
256
+ var featureCount = 0;
257
+
256
258
  return React__default.createElement(
257
259
  'div',
258
260
  null,
@@ -262,6 +264,7 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
262
264
  var contentCategoryName = article.contentCategory ? article.contentCategory.name : 'Articles';
263
265
 
264
266
  if (article._type === 'feature') {
267
+ featureCount++;
265
268
  if (article.blank || checkExternalUrl(article.url.current)) {
266
269
  return React__default.createElement(
267
270
  React__default.Fragment,
@@ -426,82 +429,84 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
426
429
  return React__default.createElement(ADInfeed, { index: index, infeedAd: article });
427
430
  }
428
431
 
429
- return React__default.createElement(
430
- React__default.Fragment,
431
- { key: article._id ? article._id : index },
432
- React__default.createElement(
433
- VisibilitySensor,
434
- {
435
- key: article._id ? article._id : index,
436
- onChange: function onChange(isVisible) {
437
- isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, parseInt(index));
438
- } },
432
+ if (index + 1 > heroContent + featureCount) {
433
+ return React__default.createElement(
434
+ React__default.Fragment,
435
+ { key: article._id ? article._id : index },
439
436
  React__default.createElement(
440
- React__default.Fragment,
441
- null,
437
+ VisibilitySensor,
438
+ {
439
+ key: article._id ? article._id : index,
440
+ onChange: function onChange(isVisible) {
441
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, parseInt(index));
442
+ } },
442
443
  React__default.createElement(
443
- Media$1,
444
- {
445
- key: article._id ? article._id : index,
446
- style: { flexDirection: 'row', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
447
- (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
448
- 'a',
449
- { href: mapping[contentCategoryName] + '/' + article.url.current, className: 'img-wrapper' },
450
- React__default.createElement(
451
- LazyLoad,
452
- { height: imageHeight },
453
- article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'mr-3 img-fluid', src: renderCardImage(article, builder, imageHeight, imageWidth), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
454
- )
455
- ),
444
+ React__default.Fragment,
445
+ null,
456
446
  React__default.createElement(
457
- Media$1.Body,
458
- null,
459
- React__default.createElement(
447
+ Media$1,
448
+ {
449
+ key: article._id ? article._id : index,
450
+ style: { flexDirection: 'row', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
451
+ (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
460
452
  'a',
461
- { href: mapping[contentCategoryName] + '/' + article.url.current },
462
- article.title && React__default.createElement(
463
- 'h4',
464
- { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
465
- article.title
453
+ { href: mapping[contentCategoryName] + '/' + article.url.current, className: 'img-wrapper' },
454
+ React__default.createElement(
455
+ LazyLoad,
456
+ { height: imageHeight },
457
+ article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'mr-3 img-fluid', src: renderCardImage(article, builder, imageHeight, imageWidth), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
466
458
  )
467
459
  ),
468
- showPublished && article.published && React__default.createElement(
469
- 'p',
470
- { className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
471
- moment(article.published).format('MMMM DD, YYYY')
472
- ),
473
- showAuthor && article.authorMapping && article.authorMapping.length > 0 && article.authorMapping.map(function (authorDetail, index) {
474
- return renderAuthor(authorDetail, index, article.authorMapping.length);
475
- }),
476
- article.source && React__default.createElement(
477
- 'p',
478
- { className: 'p-0 mb-1' },
479
- article.source
480
- ),
481
- showCategory && article.contentCategory && React__default.createElement(
482
- 'p',
483
- {
484
- style: {
485
- background: '#3FB618',
486
- color: '#ffffff',
487
- marginBottom: '.25rem',
488
- display: 'inline-block',
489
- padding: '0 .25rem',
490
- fontSize: '.8rem'
491
- } },
492
- article.contentCategory.name.slice(0, article.contentCategory.name.length - 1)
493
- ),
494
- article.summary && React__default.createElement(
495
- 'p',
496
- { className: 'pt-2 card-text' },
497
- clean_html_1(article.summary)
460
+ React__default.createElement(
461
+ Media$1.Body,
462
+ null,
463
+ React__default.createElement(
464
+ 'a',
465
+ { href: mapping[contentCategoryName] + '/' + article.url.current },
466
+ article.title && React__default.createElement(
467
+ 'h4',
468
+ { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
469
+ article.title
470
+ )
471
+ ),
472
+ showPublished && article.published && React__default.createElement(
473
+ 'p',
474
+ { className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
475
+ moment(article.published).format('MMMM DD, YYYY')
476
+ ),
477
+ showAuthor && article.authorMapping && article.authorMapping.length > 0 && article.authorMapping.map(function (authorDetail, index) {
478
+ return renderAuthor(authorDetail, index, article.authorMapping.length);
479
+ }),
480
+ article.source && React__default.createElement(
481
+ 'p',
482
+ { className: 'p-0 mb-1' },
483
+ article.source
484
+ ),
485
+ showCategory && article.contentCategory && React__default.createElement(
486
+ 'p',
487
+ {
488
+ style: {
489
+ background: '#3FB618',
490
+ color: '#ffffff',
491
+ marginBottom: '.25rem',
492
+ display: 'inline-block',
493
+ padding: '0 .25rem',
494
+ fontSize: '.8rem'
495
+ } },
496
+ article.contentCategory.name.slice(0, article.contentCategory.name.length - 1)
497
+ ),
498
+ article.summary && React__default.createElement(
499
+ 'p',
500
+ { className: 'pt-2 card-text' },
501
+ clean_html_1(article.summary)
502
+ )
498
503
  )
499
504
  )
500
505
  )
501
- )
502
- ),
503
- main_39 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index, numberOfItemsBeforeAd, rightItems)
504
- );
506
+ ),
507
+ main_39 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index, numberOfItemsBeforeAd, rightItems)
508
+ );
509
+ } else return null;
505
510
  }) : React__default.createElement(
506
511
  'div',
507
512
  null,
@@ -577,7 +582,9 @@ var InfiniteScrollDeck = function InfiniteScrollDeck(props) {
577
582
  rightItems = props.rightItems,
578
583
  brandInsightAd = props.brandInsightAd,
579
584
  _props$showBI = props.showBI,
580
- showBI = _props$showBI === undefined ? false : _props$showBI;
585
+ showBI = _props$showBI === undefined ? false : _props$showBI,
586
+ _props$heroContent = props.heroContent,
587
+ heroContent = _props$heroContent === undefined ? 0 : _props$heroContent;
581
588
  var initialCurrentPage = props.currentPage,
582
589
  showPublished = props.showPublished;
583
590
 
@@ -652,7 +659,7 @@ var InfiniteScrollDeck = function InfiniteScrollDeck(props) {
652
659
  React__default.createElement(
653
660
  Container,
654
661
  null,
655
- cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth, rightItems, brandInsightAd, showBI, itemsPerPage)
662
+ cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth, rightItems, brandInsightAd, showBI, itemsPerPage, heroContent)
656
663
  )
657
664
  ),
658
665
  React__default.createElement(
@@ -666,7 +673,7 @@ var InfiniteScrollDeck = function InfiniteScrollDeck(props) {
666
673
  React__default.createElement(
667
674
  Container,
668
675
  null,
669
- cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, rightItems, brandInsightAd, showBI, itemsPerPage)
676
+ cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, rightItems, brandInsightAd, showBI, itemsPerPage, heroContent)
670
677
  ),
671
678
  React__default.createElement(
672
679
  'div',
@@ -8906,14 +8913,88 @@ var Video = function Video(_ref) {
8906
8913
  playlistID = node.playlistID,
8907
8914
  experienceID = node.experienceID;
8908
8915
 
8916
+
8917
+ var onVideoSuccess = function onVideoSuccess(success) {
8918
+ //console.log('success:', success.ref)
8919
+ var player = success.ref;
8920
+
8921
+ // this is video ready
8922
+ player.on('loadedmetadata', function (evt) {
8923
+ //console.log('loadedmetadata:', evt)
8924
+ console.log('mediainfo:', player.mediainfo); // get the duration from here
8925
+ var duration = player.mediainfo.duration;
8926
+ var current = player.currentTime();
8927
+ var queue = Math.floor(duration / 10);
8928
+ var segment = Math.floor(current / queue);
8929
+
8930
+ Beam.report_beam_video('Ready', deviceType, duration, current, segment, 'BrightCove', chapter.playerID, chapter.accountID, chapter.mediaID);
8931
+ });
8932
+
8933
+ // play
8934
+ player.on('play', function (evt) {
8935
+ var duration = player.mediainfo.duration;
8936
+ var current = player.currentTime();
8937
+ var queue = Math.floor(duration / 10);
8938
+ var segment = Math.floor(current / queue);
8939
+ Beam.report_beam_video('Play', deviceType, duration, current, segment, 'BrightCove', chapter.playerID, chapter.accountID, chapter.mediaID);
8940
+ });
8941
+
8942
+ // pause
8943
+ player.on('pause', function (evt) {
8944
+ var duration = player.mediainfo.duration;
8945
+ var current = player.currentTime();
8946
+ var queue = Math.floor(duration / 10);
8947
+ var segment = Math.floor(current / queue);
8948
+ Beam.report_beam_video('Pause', deviceType, duration, current, segment, 'BrightCove', chapter.playerID, chapter.accountID, chapter.mediaID);
8949
+ });
8950
+
8951
+ // end
8952
+ player.on('ended', function (evt) {
8953
+ var duration = player.mediainfo.duration;
8954
+ var current = player.currentTime();
8955
+ var queue = Math.floor(duration / 10);
8956
+ var segment = Math.floor(current / queue);
8957
+ Beam.report_beam_video('End', deviceType, duration, current, segment, 'BrightCove', chapter.playerID, chapter.accountID, chapter.mediaID);
8958
+ });
8959
+
8960
+ player.on('timeupdate', function (evt) {
8961
+ var duration = player.mediainfo.duration;
8962
+ var current = player.currentTime();
8963
+ var queue = Math.floor(duration / 10);
8964
+ var segment = Math.floor(current / queue);
8965
+ if (!queueProgress.includes(segment)) {
8966
+ Beam.report_beam_video('Segment', deviceType, duration, current, segment, 'BrightCove', chapter.playerID, chapter.accountID, chapter.mediaID);
8967
+ queueProgress.push(segment);
8968
+ }
8969
+ });
8970
+
8971
+ // ad impression
8972
+ player.on('ads-ad-started', function (evt) {
8973
+ var duration = player.ads.ad.duration;
8974
+ var id = player.ads.ad.id;
8975
+ var adType = 'Bright Cove: ' + player.ads.ad.type;
8976
+
8977
+ Beam.report_beam_ad('AD Started', deviceType, '', '', '', '', '', adType, duration, id);
8978
+ });
8979
+
8980
+ // ad ended
8981
+ player.on('ads-ad-ended', function (evt) {
8982
+ var duration = player.ads.ad.duration;
8983
+ var id = player.ads.ad.id;
8984
+ var adType = 'Bright Cove: ' + player.ads.ad.type;
8985
+ Beam.report_beam_ad('AD Ended', deviceType, '', '', '', '', '', adType, duration, id);
8986
+ });
8987
+ };
8988
+
8909
8989
  if (source === 'brightcove' && accountIDs.brightcove) {
8910
8990
  if (videoID) {
8911
- return React__default.createElement(ReactPlayerLoader, { accountId: accountIDs.brightcove.accountId, videoId: videoID, playerId: accountIDs.brightcove.playerId, attrs: { className: 'brightcove' } });
8991
+ return React__default.createElement(ReactPlayerLoader, { onSuccess: onVideoSuccess, accountId: accountIDs.brightcove.accountId, videoId: videoID, playerId: accountIDs.brightcove.playerId, attrs: { className: 'brightcove' } });
8912
8992
  } else if (playlistID) {
8913
8993
  return React__default.createElement(ReactPlayerLoader, {
8914
8994
  accountId: accountIDs.brightcove.accountId,
8915
8995
  playlistId: playlistID,
8916
8996
  playerId: accountIDs.brightcove.playerId,
8997
+ onSuccess: onVideoSuccess,
8917
8998
  attrs: { className: 'brightcove brightcove-playlist' }
8918
8999
  });
8919
9000
  } else if (experienceID) {
@@ -16899,14 +16980,22 @@ var renderAuthor$1 = function renderAuthor(authorName, authorURL, index, length)
16899
16980
  'a',
16900
16981
  { href: '/authors/' + authorURL.current, key: index },
16901
16982
  authorName,
16902
- length !== index + 1 && React__default.createElement('br', null)
16983
+ length !== index + 1 && React__default.createElement(
16984
+ 'span',
16985
+ { style: { paddingLeft: 7, paddingRight: 7 } },
16986
+ '|'
16987
+ )
16903
16988
  );
16904
16989
  } else if (authorName) {
16905
16990
  return React__default.createElement(
16906
16991
  'span',
16907
16992
  { key: index },
16908
16993
  authorName,
16909
- length !== index + 1 && React__default.createElement('br', null)
16994
+ length !== index + 1 && React__default.createElement(
16995
+ 'span',
16996
+ { style: { paddingLeft: 7, paddingRight: 7 } },
16997
+ '|'
16998
+ )
16910
16999
  );
16911
17000
  }
16912
17001
  };
@@ -17192,7 +17281,7 @@ var Article = function Article(props) {
17192
17281
  { className: 'mb-3' },
17193
17282
  authorDetails && authorDetails.map(function (authorDetail, index) {
17194
17283
  return React__default.createElement(
17195
- 'div',
17284
+ 'span',
17196
17285
  { key: index },
17197
17286
  renderAuthor$1(authorDetail.displayName, authorDetail.url, index, authorDetails.length)
17198
17287
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.373",
3
+ "version": "1.0.375",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",