@mjhls/mjh-framework 1.0.594 → 1.0.596

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 (69) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/ArticleQueue.js +286 -16
  3. package/dist/cjs/{AuthorComponent-cb8b8128.js → AuthorComponent-3c79e1ab.js} +2 -2
  4. package/dist/cjs/ForbesHero.js +1 -1
  5. package/dist/cjs/GridContent.js +1 -1
  6. package/dist/cjs/GridHero.js +1 -1
  7. package/dist/cjs/InscreenSensor-e45e95e3.js +85 -0
  8. package/dist/cjs/IssueContentDeck.js +1 -1
  9. package/dist/cjs/IssueLanding.js +1 -1
  10. package/dist/cjs/OncliveLargeHero.js +1 -1
  11. package/dist/cjs/PartnerDetailListing.js +1 -1
  12. package/dist/cjs/QueueDeckExpanded.js +1 -1
  13. package/dist/cjs/RecentNews.js +93 -0
  14. package/dist/cjs/View.js +219 -48
  15. package/dist/cjs/YahooHero.js +1 -1
  16. package/dist/cjs/getQuery.js +2 -4
  17. package/dist/cjs/getRelatedArticle.js +4 -6
  18. package/dist/cjs/index.js +2 -2
  19. package/dist/esm/AD.js +1 -1
  20. package/dist/esm/AD300x250.js +2 -2
  21. package/dist/esm/AD300x250x600.js +2 -2
  22. package/dist/esm/AD728x90.js +2 -2
  23. package/dist/esm/ADFloatingFooter.js +2 -2
  24. package/dist/esm/ADGutter.js +2 -2
  25. package/dist/esm/ADSkyscraper.js +2 -2
  26. package/dist/esm/ADSponsoredResources.js +2 -2
  27. package/dist/esm/ADWebcast.js +2 -2
  28. package/dist/esm/ADWelcome.js +2 -2
  29. package/dist/esm/AdSlot.js +2 -2
  30. package/dist/esm/ArticleQueue.js +286 -16
  31. package/dist/esm/{AuthorComponent-158226c9.js → AuthorComponent-357dbee9.js} +2 -2
  32. package/dist/esm/CMEDeck.js +2 -2
  33. package/dist/esm/Column2.js +3 -3
  34. package/dist/esm/Column3.js +4 -4
  35. package/dist/esm/DeckContent.js +3 -3
  36. package/dist/esm/DeckQueue.js +4 -4
  37. package/dist/esm/{Dfp-ae9336e2.js → Dfp-56444b73.js} +2 -2
  38. package/dist/esm/ExternalResources.js +3 -3
  39. package/dist/esm/ForbesHero.js +1 -1
  40. package/dist/esm/GridContent.js +7 -7
  41. package/dist/esm/GridHero.js +1 -1
  42. package/dist/esm/InscreenSensor-beb2ec79.js +80 -0
  43. package/dist/esm/IssueContentDeck.js +1 -1
  44. package/dist/esm/IssueLanding.js +5 -5
  45. package/dist/esm/LeftNav.js +2 -2
  46. package/dist/esm/MasterDeck.js +4 -4
  47. package/dist/esm/OncliveLargeHero.js +1 -1
  48. package/dist/esm/PartnerDetailListing.js +6 -6
  49. package/dist/esm/QueueDeckExpanded.js +5 -5
  50. package/dist/esm/RecentNews.js +88 -0
  51. package/dist/esm/SideFooter.js +3 -3
  52. package/dist/esm/TemplateNormal.js +4 -4
  53. package/dist/esm/VideoSeriesListing.js +2 -2
  54. package/dist/esm/View.js +222 -51
  55. package/dist/esm/YahooHero.js +1 -1
  56. package/dist/esm/{_arrayMap-64cbe0e4.js → _arrayMap-818441dd.js} +1 -1
  57. package/dist/esm/{debounce-048d9cb6.js → debounce-a0d9abca.js} +1 -1
  58. package/dist/esm/{get-0eb56363.js → get-58d2f7cc.js} +2 -2
  59. package/dist/esm/getQuery.js +2 -4
  60. package/dist/esm/getRelatedArticle.js +4 -6
  61. package/dist/esm/getSerializers.js +3 -3
  62. package/dist/esm/index.js +9 -9
  63. package/dist/esm/{isSymbol-b7b7434f.js → isSymbol-47f5ff3b.js} +1 -1
  64. package/package.json +1 -1
  65. package/dist/cjs/InscreenSensor-e7f3579f.js +0 -361
  66. package/dist/esm/InscreenSensor-280b2b10.js +0 -352
  67. /package/dist/esm/{ADInfeed-c7dba95f.js → ADInfeed-cecd42e8.js} +0 -0
  68. /package/dist/esm/{ADlgInfeed-8bfd6d58.js → ADlgInfeed-234ba767.js} +0 -0
  69. /package/dist/esm/{index-80cb5ee6.js → index-91506c27.js} +0 -0
package/dist/cjs/View.js CHANGED
@@ -40,6 +40,7 @@ require('./_set-species-4458e975.js');
40
40
  require('./beam-d22818d3.js');
41
41
  var AdSlot = require('./AdSlot.js');
42
42
  require('./lodash-fc2922d0.js');
43
+ var AuthorComponent = require('./AuthorComponent-3c79e1ab.js');
43
44
  var BlockContent = require('./BlockContent-f942392e.js');
44
45
  require('./smoothscroll-95231a70.js');
45
46
  require('./GroupDeck.js');
@@ -55,8 +56,8 @@ var SocialShare = require('./SocialShare.js');
55
56
  var Form = _interopDefault(require('react-bootstrap/Form'));
56
57
  var FormControl = _interopDefault(require('react-bootstrap/FormControl'));
57
58
  var keys$1 = require('./keys-a586b7a0.js');
58
- var Dropdown = _interopDefault(require('react-bootstrap/Dropdown'));
59
- var InscreenSensor = require('./InscreenSensor-e7f3579f.js');
59
+ require('react-bootstrap/Dropdown');
60
+ var InscreenSensor = require('./InscreenSensor-e45e95e3.js');
60
61
  var getKeywords = require('./getKeywords.js');
61
62
  var getSeriesDetail = require('./getSeriesDetail.js');
62
63
  require('nookies');
@@ -186,6 +187,89 @@ var findIndex = function findIndex(arr) {
186
187
  return indexes;
187
188
  };
188
189
 
190
+ function styleInject(css, ref) {
191
+ if ( ref === void 0 ) ref = {};
192
+ var insertAt = ref.insertAt;
193
+
194
+ if (!css || typeof document === 'undefined') { return; }
195
+
196
+ var head = document.head || document.getElementsByTagName('head')[0];
197
+ var style = document.createElement('style');
198
+ style.type = 'text/css';
199
+
200
+ if (insertAt === 'top') {
201
+ if (head.firstChild) {
202
+ head.insertBefore(style, head.firstChild);
203
+ } else {
204
+ head.appendChild(style);
205
+ }
206
+ } else {
207
+ head.appendChild(style);
208
+ }
209
+
210
+ if (style.styleSheet) {
211
+ style.styleSheet.cssText = css;
212
+ } else {
213
+ style.appendChild(document.createTextNode(css));
214
+ }
215
+ }
216
+
217
+ var css = ".RelatedArticles-module_mediaCard__3wQbn {\r\n display: flex;\r\n flex-direction: row;\r\n margin-bottom: .75rem;\r\n padding-bottom: .75rem;\r\n border-bottom: none;\r\n}\r\n.RelatedArticles-module_mediaCard__3wQbn:last-child {\r\n border-bottom: none;\r\n}\r\n.RelatedArticles-module_cardTitle__3P-Ib {\r\n font-weight: bold;\r\n color: #252525;\r\n margin-bottom: 0.25rem;\r\n font-size: 19px;\r\n}\r\n.RelatedArticles-module_authorListing__1EFg4 span.RelatedArticles-module_text-muted__3b0zX {\r\n color: #000;\r\n font-weight: bold;\r\n}\r\n.RelatedArticles-module_cardDate__1wOR5 {\r\n color: var(--dark);\r\n display: block;\r\n background: #fff!important;\r\n margin-bottom: 0;\r\n}\r\n.RelatedArticles-module_mediaCard__3wQbn a img {\r\n width: 175px;\r\n min-width: 175px;\r\n height: auto;\r\n object-fit: contain;\r\n}\r\n@media screen and (max-width: 1064px) {\r\n .RelatedArticles-module_cardTitle__3P-Ib {\r\n font-size: 1.1rem;\r\n }\r\n}\r\n@media screen and (max-width: 768px) {\r\n .RelatedArticles-module_mediaCard__3wQbn {\r\n flex-direction: column;\r\n }\r\n .RelatedArticles-module_mediaCard__3wQbn a img {\r\n width: 100%;\r\n height: auto;\r\n max-height: 175px;\r\n object-fit: contain;\r\n margin-bottom: 1rem;\r\n }\r\n}";
218
+ var styles = { "mediaCard": "RelatedArticles-module_mediaCard__3wQbn", "cardTitle": "RelatedArticles-module_cardTitle__3P-Ib", "authorListing": "RelatedArticles-module_authorListing__1EFg4", "text-muted": "RelatedArticles-module_text-muted__3b0zX", "cardDate": "RelatedArticles-module_cardDate__1wOR5" };
219
+ styleInject(css);
220
+
221
+ var RelatedArticle = function RelatedArticle(_ref) {
222
+ var articles = _ref.articles,
223
+ client = _ref.client;
224
+
225
+ if (!articles || articles.length == 0 || !articles[0]) {
226
+ return null;
227
+ }
228
+ return React__default.createElement(
229
+ 'div',
230
+ null,
231
+ articles.map(function (article, index) {
232
+ return React__default.createElement(
233
+ 'div',
234
+ { id: 'related-card', key: index, className: styles.mediaCard },
235
+ React__default.createElement(
236
+ 'a',
237
+ { className: styles.imgWrapper, href: '/view/' + (article.url ? article.url.current : '') },
238
+ article.thumbnail && React__default.createElement('img', {
239
+ style: { maxHeight: '135px', objectFit: 'cover', objectPosition: 'center' },
240
+ className: 'mr-3 img-fluid',
241
+ src: article.thumbnail && urlFor(client, article.thumbnail.asset).width(250).url(),
242
+ alt: article.title
243
+ })
244
+ ),
245
+ React__default.createElement(
246
+ 'div',
247
+ { className: styles.mediaBody },
248
+ React__default.createElement(
249
+ 'a',
250
+ { href: '/view/' + (article.url ? article.url.current : '') },
251
+ React__default.createElement(
252
+ 'h4',
253
+ { className: styles.cardTitle },
254
+ article.title
255
+ )
256
+ ),
257
+ React__default.createElement(
258
+ 'span',
259
+ { className: styles.cardDate },
260
+ moment.moment(article.published).format('MMMM Do YYYY, h:mma')
261
+ ),
262
+ article.authorDetails && article.authorDetails.length > 0 && React__default.createElement(
263
+ 'div',
264
+ { className: 'author-listing' },
265
+ React__default.createElement(AuthorComponent.AuthorComponent, { index: index, authors: article.authorDetails })
266
+ )
267
+ )
268
+ );
269
+ })
270
+ );
271
+ };
272
+
189
273
  var Article = function Article(props) {
190
274
  var onVote = function () {
191
275
  var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(nodeKey, selectedChoice) {
@@ -238,7 +322,8 @@ var Article = function Article(props) {
238
322
  }();
239
323
 
240
324
  var article = props.article,
241
- Ads = props.Ads;
325
+ Ads = props.Ads,
326
+ showRelatedArticles = props.showRelatedArticles;
242
327
  var client = props.client,
243
328
  pageview = props.pageview,
244
329
  videoAccountIDs = props.videoAccountIDs,
@@ -282,6 +367,7 @@ var Article = function Article(props) {
282
367
  if (sponsoredFlag) {
283
368
  article.contextualVideoAD = false;
284
369
  article.contextualAD = false;
370
+ showRelatedArticles = false;
285
371
  }
286
372
  //This was being done in ArticleQueue2 which wasnt effecting articles excluded from infinite scroll, moved inside article component
287
373
  if (!sponsoredFlag && Ads.getVideoContextualAD) {
@@ -348,34 +434,55 @@ var Article = function Article(props) {
348
434
  return null;
349
435
  };
350
436
 
351
- var renderRelevantTopicsDropdown = function renderRelevantTopicsDropdown() {
437
+ var RelevantTopics = function RelevantTopics() {
352
438
  if (content_placement && content_placement.length > 0 || documentGroup) {
353
439
  return React__default.createElement(
354
- Dropdown,
355
- null,
440
+ 'div',
441
+ { style: { color: '#262626' } },
356
442
  React__default.createElement(
357
- Dropdown.Toggle,
358
- { variant: 'primary', id: 'partner-dropdown' },
359
- 'Relevant Topics'
443
+ 'p',
444
+ { className: 'mb-0' },
445
+ React__default.createElement(
446
+ 'b',
447
+ null,
448
+ 'Related Content:'
449
+ )
360
450
  ),
361
- React__default.createElement(
362
- Dropdown.Menu,
451
+ documentGroup && documentGroup.parent && React__default.createElement(
452
+ React__default.Fragment,
363
453
  null,
364
- documentGroup && documentGroup.parent && React__default.createElement(
365
- Dropdown.Item,
366
- { href: cpModificationRequired ? '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path : '/' + documentGroup.path },
367
- documentGroup.name
454
+ React__default.createElement(
455
+ 'span',
456
+ { className: '' },
457
+ React__default.createElement(
458
+ 'a',
459
+ {
460
+ className: 'related-links',
461
+ style: { color: 'blue' },
462
+ href: cpModificationRequired ? '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path : '/' + documentGroup.path },
463
+ documentGroup.name
464
+ )
368
465
  ),
369
- content_placement && content_placement.length > 0 ? content_placement.map(function (cp, index) {
370
- var cp_url = cpModificationRequired ? getTargeting.getContentPlacementUrl(cp) : cp.path;
371
- var href = '/' + cp_url;
372
- return React__default.createElement(
373
- Dropdown.Item,
374
- { key: index, href: href },
375
- cp.name
376
- );
377
- }) : null
378
- )
466
+ content_placement && content_placement.length ? ' | ' : null
467
+ ),
468
+ content_placement && content_placement.length > 0 ? content_placement.map(function (cp, index) {
469
+ var cp_url = cpModificationRequired ? getTargeting.getContentPlacementUrl(cp) : cp.path;
470
+ var href = '/' + cp_url;
471
+ return React__default.createElement(
472
+ React__default.Fragment,
473
+ { key: index },
474
+ React__default.createElement(
475
+ 'span',
476
+ null,
477
+ React__default.createElement(
478
+ 'a',
479
+ { className: 'related-links', key: index, href: href, style: { color: 'blue' } },
480
+ cp.name
481
+ )
482
+ ),
483
+ content_placement.length > index + 1 ? ' | ' : null
484
+ );
485
+ }) : null
379
486
  );
380
487
  }
381
488
  return null;
@@ -667,7 +774,7 @@ var Article = function Article(props) {
667
774
  ),
668
775
  React__default.createElement(
669
776
  'div',
670
- { className: 'mb-4 doc-group-container', style: { display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end' } },
777
+ { className: 'mb-3 doc-group-container', style: { display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end' } },
671
778
  React__default.createElement(
672
779
  'style',
673
780
  { jsx: 'true' },
@@ -714,6 +821,23 @@ var Article = function Article(props) {
714
821
  issue && React__default.createElement(
715
822
  'div',
716
823
  { className: 'volume-issue' },
824
+ issue.publication && issue.publication.name && React__default.createElement(
825
+ 'span',
826
+ { className: 'mb-0' },
827
+ React__default.createElement(
828
+ 'b',
829
+ null,
830
+ issue.publication.name
831
+ ),
832
+ ',',
833
+ ' '
834
+ ),
835
+ issue.name && React__default.createElement(
836
+ 'span',
837
+ { className: 'mb-0' },
838
+ issue.name,
839
+ ', '
840
+ ),
717
841
  issue.volume && React__default.createElement(
718
842
  'span',
719
843
  null,
@@ -747,8 +871,7 @@ var Article = function Article(props) {
747
871
  twitterSiteName: twitterSiteName,
748
872
  disableMeta: true
749
873
  })
750
- ),
751
- renderRelevantTopicsDropdown()
874
+ )
752
875
  ),
753
876
  React__default.createElement(
754
877
  'div',
@@ -791,6 +914,7 @@ var Article = function Article(props) {
791
914
  'div',
792
915
  { className: 'block-content mt-3' },
793
916
  renderBlockContent(article),
917
+ React__default.createElement('div', { className: 'clearfix' }),
794
918
  React__default.createElement(
795
919
  'noscript',
796
920
  null,
@@ -818,6 +942,17 @@ var Article = function Article(props) {
818
942
  'Download Issue : ',
819
943
  issue.name
820
944
  )
945
+ ),
946
+ React__default.createElement('div', { className: 'clearfix', style: { minHeight: '1px' } }),
947
+ React__default.createElement(
948
+ 'div',
949
+ null,
950
+ React__default.createElement(RelevantTopics, null)
951
+ ),
952
+ showRelatedArticles && React__default.createElement(
953
+ 'div',
954
+ { className: 'pt-2', style: { borderTop: '1px solid #eee' } },
955
+ React__default.createElement(RelatedArticle, { articles: article.relatedArticle, client: client })
821
956
  )
822
957
  ),
823
958
  renderIsiContent(props.article)
@@ -832,21 +967,21 @@ var Article = function Article(props) {
832
967
  );
833
968
  }
834
969
  }),
835
- React__default.createElement('div', { className: 'clearfix', style: { minHeight: '1px' } }),
836
- React__default.createElement('hr', { className: 'article-seperater my-5' }),
837
970
  React__default.createElement(
838
971
  'noscript',
839
972
  null,
840
- props.infiniteScroll && props.article.relatedArticle && props.article.relatedArticle.url && props.article.relatedArticle.url.current && React__default.createElement(
973
+ props.infiniteScroll && props.article.relatedArticle && props.article.relatedArticle[0] && props.article.relatedArticle[0].url && props.article.relatedArticle[0].url.current && React__default.createElement(
841
974
  'div',
842
975
  { style: { textAlign: 'center' } },
843
976
  React__default.createElement(
844
977
  'a',
845
- { href: '/view/' + props.article.relatedArticle.url.current },
846
- 'Related Article >>>'
978
+ { href: '/view/' + props.article.relatedArticle[0].url.current },
979
+ 'Related Article ',
980
+ '>>>'
847
981
  )
848
982
  )
849
- )
983
+ ),
984
+ React__default.createElement('hr', { className: 'article-seperater my-5' })
850
985
  );
851
986
  };
852
987
 
@@ -889,6 +1024,8 @@ exports.default = function (obj, key, value) {
889
1024
 
890
1025
  var _defineProperty = _commonjsHelpers.unwrapExports(defineProperty);
891
1026
 
1027
+ var _this = undefined;
1028
+
892
1029
  var ArticleQueue = function ArticleQueue(props) {
893
1030
  var _props$prevUrl = props.prevUrl,
894
1031
  prevUrl = _props$prevUrl === undefined ? '/' : _props$prevUrl,
@@ -899,7 +1036,8 @@ var ArticleQueue = function ArticleQueue(props) {
899
1036
  _props$cpModification = props.cpModificationRequired,
900
1037
  cpModificationRequired = _props$cpModification === undefined ? false : _props$cpModification,
901
1038
  _props$authorPrefix = props.authorPrefix,
902
- authorPrefix = _props$authorPrefix === undefined ? 'authors' : _props$authorPrefix;
1039
+ authorPrefix = _props$authorPrefix === undefined ? 'authors' : _props$authorPrefix,
1040
+ showRelatedArticles = props.showRelatedArticles;
903
1041
 
904
1042
 
905
1043
  var firstArticle = function firstArticle() {
@@ -1004,13 +1142,43 @@ var ArticleQueue = function ArticleQueue(props) {
1004
1142
  var params = props.params;
1005
1143
  if (queueData && queueData.length < maxListLength) {
1006
1144
  params.index = queueData.length - 1;
1007
- props.client.fetch(query, params).then(function (article) {
1008
- if (article && article._id) {
1009
- var targeting = getTargeting.getTargeting({ article: article, cpModificationRequired: cpModificationRequired, prevUrl: prevUrl });
1010
- article.Ads = Ads.getRightItems(targeting);
1011
- setQueueData([].concat(toConsumableArray._toConsumableArray(queueData), [article]));
1012
- }
1013
- });
1145
+ props.client.fetch(query, params).then(function () {
1146
+ var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(article) {
1147
+ var startingIndex, endingIndex, targeting;
1148
+ return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
1149
+ while (1) {
1150
+ switch (_context.prev = _context.next) {
1151
+ case 0:
1152
+ if (!(article && article._id)) {
1153
+ _context.next = 9;
1154
+ break;
1155
+ }
1156
+
1157
+ //query next 4 related article without repeating previous 4 related articles
1158
+ startingIndex = queueData.length;
1159
+ endingIndex = startingIndex + 3;
1160
+ _context.next = 5;
1161
+ return getRelatedArticle(null, props.client, article, prevUrl, startingIndex + '..' + endingIndex);
1162
+
1163
+ case 5:
1164
+ article.relatedArticle = _context.sent;
1165
+ targeting = getTargeting.getTargeting({ article: article, cpModificationRequired: cpModificationRequired, prevUrl: prevUrl });
1166
+
1167
+ article.Ads = Ads.getRightItems(targeting);
1168
+ setQueueData([].concat(toConsumableArray._toConsumableArray(queueData), [article]));
1169
+
1170
+ case 9:
1171
+ case 'end':
1172
+ return _context.stop();
1173
+ }
1174
+ }
1175
+ }, _callee, _this);
1176
+ }));
1177
+
1178
+ return function (_x) {
1179
+ return _ref.apply(this, arguments);
1180
+ };
1181
+ }());
1014
1182
  }
1015
1183
  };
1016
1184
 
@@ -1075,7 +1243,8 @@ var ArticleQueue = function ArticleQueue(props) {
1075
1243
  article: article,
1076
1244
  cpModificationRequired: cpModificationRequired
1077
1245
  // Passing queueData to check for single article
1078
- , queueData: queueData
1246
+ , queueData: queueData,
1247
+ showRelatedArticles: showRelatedArticles
1079
1248
  }));
1080
1249
  })
1081
1250
  );
@@ -1148,7 +1317,7 @@ var Articles = function Articles(props) {
1148
1317
  }, _defineProperty(_extends2, 'pageview', pageview), _defineProperty(_extends2, 'onVote', function onVote() {}), _defineProperty(_extends2, 'ISIContent', ISIContent), _defineProperty(_extends2, 'videoAccountIDs', videoAccountIDs), _defineProperty(_extends2, 'sponsoredTaxonomies', []), _defineProperty(_extends2, 'cpModificationRequired', cpModificationRequired), _defineProperty(_extends2, 'Settings', Settings), _extends2), props));
1149
1318
  };
1150
1319
 
1151
- var _this = undefined;
1320
+ var _this$1 = undefined;
1152
1321
 
1153
1322
  var View = function View(props) {
1154
1323
  var router = Router.useRouter();
@@ -1161,7 +1330,9 @@ var View = function View(props) {
1161
1330
  setCustomDimensions = props.setCustomDimensions,
1162
1331
  statusCode = props.statusCode,
1163
1332
  prevUrl = props.prevUrl,
1164
- pageview = props.pageview;
1333
+ pageview = props.pageview,
1334
+ _props$showRelatedArt = props.showRelatedArticles,
1335
+ showRelatedArticles = _props$showRelatedArt === undefined ? false : _props$showRelatedArt;
1165
1336
  var _props$article = props.article,
1166
1337
  _props$article$passwo = _props$article.passwordLock,
1167
1338
  passwordLock = _props$article$passwo === undefined ? false : _props$article$passwo,
@@ -1255,7 +1426,7 @@ var View = function View(props) {
1255
1426
  props.article.seriesDetail && props.article.seriesDetail.nextUrl && React__default.createElement('link', { rel: 'next', href: props.article.seriesDetail.nextUrl })
1256
1427
  )
1257
1428
  ),
1258
- !needInfiniteScroll ? React__default.createElement(Article, _extends._extends({ infiniteScroll: false }, props)) : React__default.createElement(Articles, _extends._extends({ infiniteScroll: true }, props))
1429
+ !needInfiniteScroll ? React__default.createElement(Article, _extends._extends({ infiniteScroll: false, showRelatedArticles: showRelatedArticles }, props)) : React__default.createElement(Articles, _extends._extends({ infiniteScroll: true, showRelatedArticles: showRelatedArticles }, props))
1259
1430
  );
1260
1431
  };
1261
1432
 
@@ -1302,7 +1473,7 @@ View.returnGetInitialProps = function () {
1302
1473
  }
1303
1474
 
1304
1475
  _context.next = 13;
1305
- return getRelatedArticle(context, client, article, prevUrl);
1476
+ return getRelatedArticle(context, client, article, prevUrl, '0..3');
1306
1477
 
1307
1478
  case 13:
1308
1479
  article.relatedArticle = _context.sent;
@@ -1323,7 +1494,7 @@ View.returnGetInitialProps = function () {
1323
1494
  return _context.stop();
1324
1495
  }
1325
1496
  }
1326
- }, _callee, _this);
1497
+ }, _callee, _this$1);
1327
1498
  }));
1328
1499
 
1329
1500
  return function (_x, _x2, _x3, _x4, _x5) {
@@ -15,7 +15,7 @@ var index$1 = require('./index-b5eb3ff8.js');
15
15
  var index$2 = require('./index-fa0fb52c.js');
16
16
  var entities = require('./entities-310b46ee.js');
17
17
  require('./slicedToArray-8063ee51.js');
18
- var AuthorComponent = require('./AuthorComponent-cb8b8128.js');
18
+ var AuthorComponent = require('./AuthorComponent-3c79e1ab.js');
19
19
 
20
20
  var YahooHero = function YahooHero(props) {
21
21
  var removeTimeStamp = props.removeTimeStamp;
@@ -1,18 +1,16 @@
1
1
  'use strict';
2
2
 
3
- require('./_commonjsHelpers-06173234.js');
4
- require('./moment-66a6a284.js');
5
-
6
3
  var getQuery = function getQuery(type) {
7
4
  var conditions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
8
5
  var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
6
+ var articleCount = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
9
7
 
10
8
  //Added feature to include additional conditions and parameters for site level operations
11
9
  //Site level conditions should start with && (logical AND), and site level params should end with , (comma) in order to execute query
12
10
 
13
11
  switch (type) {
14
12
  case 'related':
15
- return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && published <= now()\n && passwordLock!=true\n && taxonomyMapping[]._ref in $taxonomy\n && taxonomyMapping[].disableAds != \'true\'\n && contentCategory->.name != \'Poll\'\n && contentCategory->.name != \'Slideshows\'\n && contentCategory->.disableAds != \'true\'\n && ExcludeFromInfiniteScroll !=true\n && url.current != $url\n && !defined(body[].videos)\n ' + conditions + '\n ]| order(published desc)[$index]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n disableAds\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n }';
13
+ return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && published <= now()\n && passwordLock!=true\n && taxonomyMapping[]._ref in $taxonomy\n && taxonomyMapping[].disableAds != \'true\'\n && contentCategory->.name != \'Poll\'\n && contentCategory->.name != \'Slideshows\'\n && contentCategory->.disableAds != \'true\'\n && ExcludeFromInfiniteScroll !=true\n && url.current != $url\n && !defined(body[].videos)\n ' + conditions + '\n ]| order(published desc)[' + (articleCount ? articleCount : '$index') + ']{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n disableAds\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n }';
16
14
  case 'article':
17
15
  return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n medias[]{ \n ...,\n upload_doc { \n _type,\n asset-> \n } \n },\n articles[]{\n ...,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n \'category\':contentCategory->{\n name,\n disableAds\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n volume,\n \'issueNumber\': number,\n \'articleSource\': source,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n\n }';
18
16
  case 'publication':
@@ -6,7 +6,6 @@ require('./core.get-iterator-method-41e87ec1.js');
6
6
  require('./_library-dd23b178.js');
7
7
  require('./_iter-detect-4d0352f8.js');
8
8
  require('./web.dom.iterable-43c3e277.js');
9
- require('./moment-66a6a284.js');
10
9
  var asyncToGenerator = require('./asyncToGenerator-8e707718.js');
11
10
  require('./_set-species-4458e975.js');
12
11
  var nookies = require('nookies');
@@ -20,6 +19,7 @@ var getRelatedArticle = function () {
20
19
  var client = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
21
20
  var article = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
22
21
  var prevUrl = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '/';
22
+ var articleCount = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
23
23
 
24
24
  var taxonomyMapping, _article$url, url, content_placement, taxonomy, params, conditions, cookies, prevSlugs, relatedArticleQuery, relatedArticle;
25
25
 
@@ -44,7 +44,7 @@ var getRelatedArticle = function () {
44
44
  if (prev_url_to_check.includes('?')) {
45
45
  prev_url_to_check = prev_url_to_check.split('?')[0];
46
46
  }
47
- if (prev_url_to_check.endsWith(path)) taxonomy.push(_id);
47
+ if (prev_url_to_check.endsWith(path) && _id) taxonomy.push(_id);
48
48
  });
49
49
  }
50
50
 
@@ -55,11 +55,10 @@ var getRelatedArticle = function () {
55
55
  return _ref;
56
56
  });
57
57
  }
58
-
59
58
  params = {
60
59
  url: url,
61
60
  taxonomy: taxonomy,
62
- index: 0
61
+ index: articleCount
63
62
  };
64
63
  conditions = '';
65
64
 
@@ -72,8 +71,7 @@ var getRelatedArticle = function () {
72
71
  conditions = '&& !(url.current in [' + prevSlugs + '])';
73
72
  } else nookies.setCookie(ctx, 'prevSlugs', '"' + url + '"', {});
74
73
  }
75
-
76
- relatedArticleQuery = getQuery('related', conditions);
74
+ relatedArticleQuery = getQuery('related', conditions, '', articleCount);
77
75
  _context.next = 12;
78
76
  return client.fetch(relatedArticleQuery, params);
79
77
 
package/dist/cjs/index.js CHANGED
@@ -47,7 +47,7 @@ require('./ADlgInfeed-070d911c.js');
47
47
  require('./_arrayMap-3b4a0f75.js');
48
48
  require('./get-5dfcdc33.js');
49
49
  var AD = require('./AD.js');
50
- require('./AuthorComponent-cb8b8128.js');
50
+ require('./AuthorComponent-3c79e1ab.js');
51
51
  var GridContent = require('./GridContent.js');
52
52
  var DeckQueue = require('./DeckQueue.js');
53
53
  require('react-bootstrap/Media');
@@ -143,7 +143,7 @@ var IssueLanding = require('./IssueLanding.js');
143
143
  require('react-bootstrap/Modal');
144
144
  var PopUpModal = require('./PopUpModal.js');
145
145
  var ArticleQueue = require('./ArticleQueue.js');
146
- require('./InscreenSensor-e7f3579f.js');
146
+ require('./InscreenSensor-e45e95e3.js');
147
147
  var getKeywords = require('./getKeywords.js');
148
148
  var RelatedContent = require('./RelatedContent.js');
149
149
  var ForbesHero = require('./ForbesHero.js');
package/dist/esm/AD.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import React__default, { Suspense } from 'react';
2
2
 
3
3
  var Dfp = React__default.lazy(function () {
4
- return import('./Dfp-ae9336e2.js');
4
+ return import('./Dfp-56444b73.js');
5
5
  });
6
6
 
7
7
  var AD = function AD(props) {
@@ -7,8 +7,8 @@ import './web.dom.iterable-46c95e52.js';
7
7
  import React__default from 'react';
8
8
  import './index-93ec3c59.js';
9
9
  import 'prop-types';
10
- import './isSymbol-b7b7434f.js';
11
- import './debounce-048d9cb6.js';
10
+ import './isSymbol-47f5ff3b.js';
11
+ import './debounce-a0d9abca.js';
12
12
  import { m as main_39 } from './main-7255814e.js';
13
13
  import './slicedToArray-f1e40361.js';
14
14
  import { _ as _JSON$stringify } from './stringify-e30bc114.js';
@@ -7,8 +7,8 @@ import './web.dom.iterable-46c95e52.js';
7
7
  import React__default from 'react';
8
8
  import './index-93ec3c59.js';
9
9
  import 'prop-types';
10
- import './isSymbol-b7b7434f.js';
11
- import './debounce-048d9cb6.js';
10
+ import './isSymbol-47f5ff3b.js';
11
+ import './debounce-a0d9abca.js';
12
12
  import { m as main_39 } from './main-7255814e.js';
13
13
  import './slicedToArray-f1e40361.js';
14
14
  import { _ as _JSON$stringify } from './stringify-e30bc114.js';
@@ -7,8 +7,8 @@ import './web.dom.iterable-46c95e52.js';
7
7
  import React__default from 'react';
8
8
  import './index-93ec3c59.js';
9
9
  import 'prop-types';
10
- import './isSymbol-b7b7434f.js';
11
- import './debounce-048d9cb6.js';
10
+ import './isSymbol-47f5ff3b.js';
11
+ import './debounce-a0d9abca.js';
12
12
  import { m as main_39 } from './main-7255814e.js';
13
13
  import './slicedToArray-f1e40361.js';
14
14
  import './stringify-e30bc114.js';
@@ -7,8 +7,8 @@ import './web.dom.iterable-46c95e52.js';
7
7
  import React__default, { useState, useEffect } from 'react';
8
8
  import './index-93ec3c59.js';
9
9
  import 'prop-types';
10
- import './isSymbol-b7b7434f.js';
11
- import './debounce-048d9cb6.js';
10
+ import './isSymbol-47f5ff3b.js';
11
+ import './debounce-a0d9abca.js';
12
12
  import './main-7255814e.js';
13
13
  import { _ as _slicedToArray } from './slicedToArray-f1e40361.js';
14
14
  import { _ as _JSON$stringify } from './stringify-e30bc114.js';
@@ -7,8 +7,8 @@ import './web.dom.iterable-46c95e52.js';
7
7
  import React__default, { useState, useEffect } from 'react';
8
8
  import './index-93ec3c59.js';
9
9
  import 'prop-types';
10
- import './isSymbol-b7b7434f.js';
11
- import './debounce-048d9cb6.js';
10
+ import './isSymbol-47f5ff3b.js';
11
+ import './debounce-a0d9abca.js';
12
12
  import './main-7255814e.js';
13
13
  import { _ as _slicedToArray } from './slicedToArray-f1e40361.js';
14
14
  import './stringify-e30bc114.js';
@@ -7,8 +7,8 @@ import './web.dom.iterable-46c95e52.js';
7
7
  import React__default, { useState, useEffect } from 'react';
8
8
  import './index-93ec3c59.js';
9
9
  import 'prop-types';
10
- import './isSymbol-b7b7434f.js';
11
- import './debounce-048d9cb6.js';
10
+ import './isSymbol-47f5ff3b.js';
11
+ import './debounce-a0d9abca.js';
12
12
  import './main-7255814e.js';
13
13
  import { _ as _slicedToArray } from './slicedToArray-f1e40361.js';
14
14
  import './stringify-e30bc114.js';
@@ -7,8 +7,8 @@ import './web.dom.iterable-46c95e52.js';
7
7
  import React__default, { useState, useEffect } from 'react';
8
8
  import './index-93ec3c59.js';
9
9
  import 'prop-types';
10
- import './isSymbol-b7b7434f.js';
11
- import './debounce-048d9cb6.js';
10
+ import './isSymbol-47f5ff3b.js';
11
+ import './debounce-a0d9abca.js';
12
12
  import './main-7255814e.js';
13
13
  import { _ as _slicedToArray } from './slicedToArray-f1e40361.js';
14
14
  import './stringify-e30bc114.js';
@@ -7,8 +7,8 @@ import './web.dom.iterable-46c95e52.js';
7
7
  import React__default, { useState, useEffect } from 'react';
8
8
  import './index-93ec3c59.js';
9
9
  import 'prop-types';
10
- import './isSymbol-b7b7434f.js';
11
- import './debounce-048d9cb6.js';
10
+ import './isSymbol-47f5ff3b.js';
11
+ import './debounce-a0d9abca.js';
12
12
  import './main-7255814e.js';
13
13
  import { _ as _slicedToArray } from './slicedToArray-f1e40361.js';
14
14
  import './stringify-e30bc114.js';