@mjhls/mjh-framework 1.0.347 → 1.0.348

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/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- # mjh-framework v. 1.0.347
2
+ # mjh-framework v. 1.0.348
3
3
 
4
4
 
5
5
  > Foundation Framework
package/dist/cjs/index.js CHANGED
@@ -2112,7 +2112,7 @@ var EventsDeck = function EventsDeck(_ref) {
2112
2112
  )
2113
2113
  )
2114
2114
  ),
2115
- venues && venues.length && React__default.createElement(
2115
+ venues && venues.length && venues[0].name && React__default.createElement(
2116
2116
  Row,
2117
2117
  null,
2118
2118
  React__default.createElement(
@@ -2121,7 +2121,7 @@ var EventsDeck = function EventsDeck(_ref) {
2121
2121
  React__default.createElement(
2122
2122
  'p',
2123
2123
  { className: 'venue', style: { padding: 0, margin: 0 } },
2124
- venues[0].address.country
2124
+ venues[0].name
2125
2125
  )
2126
2126
  )
2127
2127
  ),
@@ -8314,11 +8314,19 @@ var Video = function Video(_ref) {
8314
8314
  accountIDs = _ref.accountIDs;
8315
8315
  var source = node.source,
8316
8316
  videoID = node.videoID,
8317
+ playlistID = node.playlistID,
8317
8318
  experienceID = node.experienceID;
8318
8319
 
8319
8320
  if (source === 'brightcove' && accountIDs.brightcove) {
8320
8321
  if (videoID) {
8321
8322
  return React__default.createElement(ReactPlayerLoader, { accountId: accountIDs.brightcove.accountId, videoId: videoID, playerId: accountIDs.brightcove.playerId, attrs: { className: 'brightcove' } });
8323
+ } else if (playlistID) {
8324
+ return React__default.createElement(ReactPlayerLoader, {
8325
+ accountId: accountIDs.brightcove.accountId,
8326
+ playlistId: playlistID,
8327
+ playerId: accountIDs.brightcove.playerId,
8328
+ attrs: { className: 'brightcove brightcove-playlist' }
8329
+ });
8322
8330
  } else if (experienceID) {
8323
8331
  return React__default.createElement(
8324
8332
  'div',
@@ -13416,11 +13424,13 @@ var numberOfPaginations = main.main_38 ? 4 : 10;
13416
13424
 
13417
13425
  var Quiz = function Quiz(_ref) {
13418
13426
  var quizzes = _ref.quizzes,
13419
- getSerializers = _ref.getSerializers;
13427
+ getSerializers = _ref.getSerializers,
13428
+ pageview = _ref.pageview,
13429
+ pageNumberFromURL = _ref.currentPage;
13420
13430
 
13421
13431
  var pageCount = quizzes.length;
13422
13432
 
13423
- var _useState = React.useState(1),
13433
+ var _useState = React.useState(pageNumberFromURL ? parseInt(pageNumberFromURL) : 1),
13424
13434
  _useState2 = slicedToArray._slicedToArray(_useState, 2),
13425
13435
  currentPage = _useState2[0],
13426
13436
  setCurrentPage = _useState2[1];
@@ -13459,16 +13469,25 @@ var Quiz = function Quiz(_ref) {
13459
13469
 
13460
13470
  var changePage = function changePage(control) {
13461
13471
  setShowAnswer(false);
13472
+ var newPath = '';
13462
13473
  switch (control) {
13463
13474
  case 'first':
13464
13475
  setCurrentPage(1);
13465
13476
  setStartIndex(0);
13466
13477
  setEndIndex(numberOfPaginations - 1);
13478
+ newPath = window.location.pathname;
13479
+ window.history.pushState(null, null, newPath);
13480
+ debounce.lib_3.refresh();
13481
+ if (pageview) pageview(newPath);
13467
13482
  break;
13468
13483
  case 'last':
13469
13484
  setCurrentPage(pageCount);
13470
13485
  setStartIndex(pageCount - pageCount % numberOfPaginations);
13471
13486
  setEndIndex(pageCount - pageCount % numberOfPaginations + numberOfPaginations - 1);
13487
+ newPath = window.location.pathname + '?page=' + pageCount;
13488
+ window.history.pushState(null, null, newPath);
13489
+ debounce.lib_3.refresh();
13490
+ if (pageview) pageview(newPath);
13472
13491
  break;
13473
13492
  case 'next':
13474
13493
  setCurrentPage(currentPage + 1);
@@ -13476,6 +13495,10 @@ var Quiz = function Quiz(_ref) {
13476
13495
  setStartIndex(startIndex + numberOfPaginations);
13477
13496
  setEndIndex(endIndex + numberOfPaginations);
13478
13497
  }
13498
+ newPath = window.location.pathname + '?page=' + (currentPage + 1);
13499
+ window.history.pushState(null, null, newPath);
13500
+ debounce.lib_3.refresh();
13501
+ if (pageview) pageview(newPath);
13479
13502
  break;
13480
13503
  case 'prev':
13481
13504
  setCurrentPage(currentPage - 1);
@@ -13483,9 +13506,17 @@ var Quiz = function Quiz(_ref) {
13483
13506
  setStartIndex(startIndex - numberOfPaginations);
13484
13507
  setEndIndex(endIndex - numberOfPaginations);
13485
13508
  }
13509
+ newPath = window.location.pathname + '?page=' + (currentPage - 1);
13510
+ window.history.pushState(null, null, newPath);
13511
+ debounce.lib_3.refresh();
13512
+ if (pageview) pageview(newPath);
13486
13513
  break;
13487
13514
  default:
13488
13515
  setCurrentPage(control);
13516
+ newPath = window.location.pathname + '?page=' + control;
13517
+ window.history.pushState(null, null, newPath);
13518
+ debounce.lib_3.refresh();
13519
+ if (pageview) pageview(newPath);
13489
13520
  }
13490
13521
  };
13491
13522
 
@@ -13707,7 +13738,8 @@ var getSerializers = function getSerializers() {
13707
13738
  videoAccountIDs = props[2],
13708
13739
  onVote = props[3],
13709
13740
  showVotes = props[4],
13710
- drupalLeadSettings = props[5];
13741
+ drupalLeadSettings = props[5],
13742
+ currentPage = props[6];
13711
13743
 
13712
13744
  return {
13713
13745
  types: {
@@ -13779,7 +13811,7 @@ var getSerializers = function getSerializers() {
13779
13811
  var node = _ref12.node;
13780
13812
  var quizzes = node.quizzes;
13781
13813
 
13782
- return React__default.createElement(Quiz, { quizzes: quizzes, getSerializers: getSerializers(props) });
13814
+ return React__default.createElement(Quiz, { quizzes: quizzes, getSerializers: getSerializers(props), pageview: pageview, currentPage: currentPage });
13783
13815
  },
13784
13816
  leads: function leads(_ref13) {
13785
13817
  var node = _ref13.node;
@@ -16323,6 +16355,7 @@ var Article = function Article(props) {
16323
16355
  pageview = props.pageview,
16324
16356
  videoAccountIDs = props.videoAccountIDs,
16325
16357
  drupalLeadSettings = props.drupalLeadSettings,
16358
+ currentPage = props.currentPage,
16326
16359
  _props$article = props.article,
16327
16360
  title = _props$article.title,
16328
16361
  passwordLock = _props$article.passwordLock,
@@ -16460,7 +16493,7 @@ var Article = function Article(props) {
16460
16493
  React__default.Fragment,
16461
16494
  null,
16462
16495
  React__default.createElement(TaxonomyCard.BlockContent, _extends$2._extends({
16463
- serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings),
16496
+ serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings, currentPage),
16464
16497
  blocks: [].concat(toConsumableArray._toConsumableArray(body.slice(0, selectedIndex))),
16465
16498
  imageOptions: { w: 320, h: 240, fit: 'max' }
16466
16499
  }, client.config())),
@@ -16470,7 +16503,7 @@ var Article = function Article(props) {
16470
16503
  React__default.createElement(AdSlot.DFPAdSlot, _extends$2._extends({}, payload.contextualAD, { refreshFlag: false, checkIsAdFound: checkIsAdFound }))
16471
16504
  ),
16472
16505
  React__default.createElement(TaxonomyCard.BlockContent, _extends$2._extends({
16473
- serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings),
16506
+ serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings, currentPage),
16474
16507
  blocks: [].concat(toConsumableArray._toConsumableArray(body.slice(selectedIndex))),
16475
16508
  imageOptions: { w: 320, h: 240, fit: 'max' }
16476
16509
  }, client.config()))
@@ -16681,7 +16714,7 @@ var ArticleQueue = function ArticleQueue(props) {
16681
16714
  cpModificationRequired = _props$cpModification === undefined ? false : _props$cpModification;
16682
16715
 
16683
16716
 
16684
- var getTargeting = function getTargeting(article) {
16717
+ var getTargeting = function getTargeting(article, position) {
16685
16718
  var _article$internalTag = article.internalTag,
16686
16719
  internalTag = _article$internalTag === undefined ? [] : _article$internalTag,
16687
16720
  _article$userDefinedT = article.userDefinedTag,
@@ -16751,6 +16784,9 @@ var ArticleQueue = function ArticleQueue(props) {
16751
16784
  targeting = _extends$2._extends({}, targeting, { campaign_id: props.cache.hyperTargeting });
16752
16785
  }
16753
16786
 
16787
+ if (position && position.length) {
16788
+ targeting['pos'] = position;
16789
+ }
16754
16790
  return targeting;
16755
16791
  };
16756
16792
 
@@ -16884,7 +16920,7 @@ var ArticleQueue = function ArticleQueue(props) {
16884
16920
  { dataLength: queueData.length, next: loadmore, scrollThreshold: '60%', hasMore: true },
16885
16921
  queueData.map(function (article, index) {
16886
16922
  if (!checkSponseredArticle(article) && Ads.getNativeContextualAD) {
16887
- article.contextualAD = Ads.getNativeContextualAD(getTargeting(article));
16923
+ article.contextualAD = Ads.getNativeContextualAD(getTargeting(article, 'native-ad'));
16888
16924
  }
16889
16925
  return React__default.createElement(Article, _extends$2._extends({ key: index }, props, { changeUrl: changeUrl, article: article, cpModificationRequired: cpModificationRequired }));
16890
16926
  })
package/dist/esm/index.js CHANGED
@@ -2109,7 +2109,7 @@ var EventsDeck = function EventsDeck(_ref) {
2109
2109
  )
2110
2110
  )
2111
2111
  ),
2112
- venues && venues.length && React__default.createElement(
2112
+ venues && venues.length && venues[0].name && React__default.createElement(
2113
2113
  Row,
2114
2114
  null,
2115
2115
  React__default.createElement(
@@ -2118,7 +2118,7 @@ var EventsDeck = function EventsDeck(_ref) {
2118
2118
  React__default.createElement(
2119
2119
  'p',
2120
2120
  { className: 'venue', style: { padding: 0, margin: 0 } },
2121
- venues[0].address.country
2121
+ venues[0].name
2122
2122
  )
2123
2123
  )
2124
2124
  ),
@@ -8311,11 +8311,19 @@ var Video = function Video(_ref) {
8311
8311
  accountIDs = _ref.accountIDs;
8312
8312
  var source = node.source,
8313
8313
  videoID = node.videoID,
8314
+ playlistID = node.playlistID,
8314
8315
  experienceID = node.experienceID;
8315
8316
 
8316
8317
  if (source === 'brightcove' && accountIDs.brightcove) {
8317
8318
  if (videoID) {
8318
8319
  return React__default.createElement(ReactPlayerLoader, { accountId: accountIDs.brightcove.accountId, videoId: videoID, playerId: accountIDs.brightcove.playerId, attrs: { className: 'brightcove' } });
8320
+ } else if (playlistID) {
8321
+ return React__default.createElement(ReactPlayerLoader, {
8322
+ accountId: accountIDs.brightcove.accountId,
8323
+ playlistId: playlistID,
8324
+ playerId: accountIDs.brightcove.playerId,
8325
+ attrs: { className: 'brightcove brightcove-playlist' }
8326
+ });
8319
8327
  } else if (experienceID) {
8320
8328
  return React__default.createElement(
8321
8329
  'div',
@@ -13413,11 +13421,13 @@ var numberOfPaginations = main_38 ? 4 : 10;
13413
13421
 
13414
13422
  var Quiz = function Quiz(_ref) {
13415
13423
  var quizzes = _ref.quizzes,
13416
- getSerializers = _ref.getSerializers;
13424
+ getSerializers = _ref.getSerializers,
13425
+ pageview = _ref.pageview,
13426
+ pageNumberFromURL = _ref.currentPage;
13417
13427
 
13418
13428
  var pageCount = quizzes.length;
13419
13429
 
13420
- var _useState = useState(1),
13430
+ var _useState = useState(pageNumberFromURL ? parseInt(pageNumberFromURL) : 1),
13421
13431
  _useState2 = _slicedToArray(_useState, 2),
13422
13432
  currentPage = _useState2[0],
13423
13433
  setCurrentPage = _useState2[1];
@@ -13456,16 +13466,25 @@ var Quiz = function Quiz(_ref) {
13456
13466
 
13457
13467
  var changePage = function changePage(control) {
13458
13468
  setShowAnswer(false);
13469
+ var newPath = '';
13459
13470
  switch (control) {
13460
13471
  case 'first':
13461
13472
  setCurrentPage(1);
13462
13473
  setStartIndex(0);
13463
13474
  setEndIndex(numberOfPaginations - 1);
13475
+ newPath = window.location.pathname;
13476
+ window.history.pushState(null, null, newPath);
13477
+ lib_3.refresh();
13478
+ if (pageview) pageview(newPath);
13464
13479
  break;
13465
13480
  case 'last':
13466
13481
  setCurrentPage(pageCount);
13467
13482
  setStartIndex(pageCount - pageCount % numberOfPaginations);
13468
13483
  setEndIndex(pageCount - pageCount % numberOfPaginations + numberOfPaginations - 1);
13484
+ newPath = window.location.pathname + '?page=' + pageCount;
13485
+ window.history.pushState(null, null, newPath);
13486
+ lib_3.refresh();
13487
+ if (pageview) pageview(newPath);
13469
13488
  break;
13470
13489
  case 'next':
13471
13490
  setCurrentPage(currentPage + 1);
@@ -13473,6 +13492,10 @@ var Quiz = function Quiz(_ref) {
13473
13492
  setStartIndex(startIndex + numberOfPaginations);
13474
13493
  setEndIndex(endIndex + numberOfPaginations);
13475
13494
  }
13495
+ newPath = window.location.pathname + '?page=' + (currentPage + 1);
13496
+ window.history.pushState(null, null, newPath);
13497
+ lib_3.refresh();
13498
+ if (pageview) pageview(newPath);
13476
13499
  break;
13477
13500
  case 'prev':
13478
13501
  setCurrentPage(currentPage - 1);
@@ -13480,9 +13503,17 @@ var Quiz = function Quiz(_ref) {
13480
13503
  setStartIndex(startIndex - numberOfPaginations);
13481
13504
  setEndIndex(endIndex - numberOfPaginations);
13482
13505
  }
13506
+ newPath = window.location.pathname + '?page=' + (currentPage - 1);
13507
+ window.history.pushState(null, null, newPath);
13508
+ lib_3.refresh();
13509
+ if (pageview) pageview(newPath);
13483
13510
  break;
13484
13511
  default:
13485
13512
  setCurrentPage(control);
13513
+ newPath = window.location.pathname + '?page=' + control;
13514
+ window.history.pushState(null, null, newPath);
13515
+ lib_3.refresh();
13516
+ if (pageview) pageview(newPath);
13486
13517
  }
13487
13518
  };
13488
13519
 
@@ -13704,7 +13735,8 @@ var getSerializers = function getSerializers() {
13704
13735
  videoAccountIDs = props[2],
13705
13736
  onVote = props[3],
13706
13737
  showVotes = props[4],
13707
- drupalLeadSettings = props[5];
13738
+ drupalLeadSettings = props[5],
13739
+ currentPage = props[6];
13708
13740
 
13709
13741
  return {
13710
13742
  types: {
@@ -13776,7 +13808,7 @@ var getSerializers = function getSerializers() {
13776
13808
  var node = _ref12.node;
13777
13809
  var quizzes = node.quizzes;
13778
13810
 
13779
- return React__default.createElement(Quiz, { quizzes: quizzes, getSerializers: getSerializers(props) });
13811
+ return React__default.createElement(Quiz, { quizzes: quizzes, getSerializers: getSerializers(props), pageview: pageview, currentPage: currentPage });
13780
13812
  },
13781
13813
  leads: function leads(_ref13) {
13782
13814
  var node = _ref13.node;
@@ -16320,6 +16352,7 @@ var Article = function Article(props) {
16320
16352
  pageview = props.pageview,
16321
16353
  videoAccountIDs = props.videoAccountIDs,
16322
16354
  drupalLeadSettings = props.drupalLeadSettings,
16355
+ currentPage = props.currentPage,
16323
16356
  _props$article = props.article,
16324
16357
  title = _props$article.title,
16325
16358
  passwordLock = _props$article.passwordLock,
@@ -16457,7 +16490,7 @@ var Article = function Article(props) {
16457
16490
  React__default.Fragment,
16458
16491
  null,
16459
16492
  React__default.createElement(BlockContent, _extends$2({
16460
- serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings),
16493
+ serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings, currentPage),
16461
16494
  blocks: [].concat(_toConsumableArray(body.slice(0, selectedIndex))),
16462
16495
  imageOptions: { w: 320, h: 240, fit: 'max' }
16463
16496
  }, client.config())),
@@ -16467,7 +16500,7 @@ var Article = function Article(props) {
16467
16500
  React__default.createElement(DFPAdSlot, _extends$2({}, payload.contextualAD, { refreshFlag: false, checkIsAdFound: checkIsAdFound }))
16468
16501
  ),
16469
16502
  React__default.createElement(BlockContent, _extends$2({
16470
- serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings),
16503
+ serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings, currentPage),
16471
16504
  blocks: [].concat(_toConsumableArray(body.slice(selectedIndex))),
16472
16505
  imageOptions: { w: 320, h: 240, fit: 'max' }
16473
16506
  }, client.config()))
@@ -16678,7 +16711,7 @@ var ArticleQueue = function ArticleQueue(props) {
16678
16711
  cpModificationRequired = _props$cpModification === undefined ? false : _props$cpModification;
16679
16712
 
16680
16713
 
16681
- var getTargeting = function getTargeting(article) {
16714
+ var getTargeting = function getTargeting(article, position) {
16682
16715
  var _article$internalTag = article.internalTag,
16683
16716
  internalTag = _article$internalTag === undefined ? [] : _article$internalTag,
16684
16717
  _article$userDefinedT = article.userDefinedTag,
@@ -16748,6 +16781,9 @@ var ArticleQueue = function ArticleQueue(props) {
16748
16781
  targeting = _extends$2({}, targeting, { campaign_id: props.cache.hyperTargeting });
16749
16782
  }
16750
16783
 
16784
+ if (position && position.length) {
16785
+ targeting['pos'] = position;
16786
+ }
16751
16787
  return targeting;
16752
16788
  };
16753
16789
 
@@ -16881,7 +16917,7 @@ var ArticleQueue = function ArticleQueue(props) {
16881
16917
  { dataLength: queueData.length, next: loadmore, scrollThreshold: '60%', hasMore: true },
16882
16918
  queueData.map(function (article, index) {
16883
16919
  if (!checkSponseredArticle(article) && Ads.getNativeContextualAD) {
16884
- article.contextualAD = Ads.getNativeContextualAD(getTargeting(article));
16920
+ article.contextualAD = Ads.getNativeContextualAD(getTargeting(article, 'native-ad'));
16885
16921
  }
16886
16922
  return React__default.createElement(Article, _extends$2({ key: index }, props, { changeUrl: changeUrl, article: article, cpModificationRequired: cpModificationRequired }));
16887
16923
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.347",
3
+ "version": "1.0.348",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",