@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/esm/View.js CHANGED
@@ -19,8 +19,8 @@ import 'react-bootstrap/Row';
19
19
  import 'react-bootstrap/Col';
20
20
  import { m as moment } from './moment-12415288.js';
21
21
  import { useRouter } from 'next/router';
22
- import './isSymbol-b7b7434f.js';
23
- import './debounce-048d9cb6.js';
22
+ import './isSymbol-47f5ff3b.js';
23
+ import './debounce-a0d9abca.js';
24
24
  import { I as InfiniteScroll } from './index.es-938a3a58.js';
25
25
  import 'react-dom';
26
26
  import './index-51a80699.js';
@@ -34,12 +34,13 @@ import './_set-species-6f64f1c1.js';
34
34
  import './beam-a25bd8fd.js';
35
35
  import DFPAdSlot from './AdSlot.js';
36
36
  import './lodash-17fdfebb.js';
37
+ import { A as AuthorComponent } from './AuthorComponent-357dbee9.js';
37
38
  import { B as BlockContent } from './BlockContent-a614acdf.js';
38
39
  import './smoothscroll-4b699764.js';
39
40
  import './GroupDeck.js';
40
41
  import 'react-bootstrap';
41
42
  import Button from 'react-bootstrap/Button';
42
- import { r as renderAuthor, g as getSerializers } from './index-80cb5ee6.js';
43
+ import { r as renderAuthor, g as getSerializers } from './index-91506c27.js';
43
44
  import './util-7700fc59.js';
44
45
  import './brightcove-react-player-loader.es-83f53e4e.js';
45
46
  import 'react-bootstrap/Pagination';
@@ -49,8 +50,8 @@ import SocialShare from './SocialShare.js';
49
50
  import Form from 'react-bootstrap/Form';
50
51
  import FormControl from 'react-bootstrap/FormControl';
51
52
  import { _ as _Object$keys } from './keys-04cdec91.js';
52
- import Dropdown from 'react-bootstrap/Dropdown';
53
- import { I as InscreenSensor } from './InscreenSensor-280b2b10.js';
53
+ import 'react-bootstrap/Dropdown';
54
+ import { I as InscreenSensor } from './InscreenSensor-beb2ec79.js';
54
55
  import getKeywords from './getKeywords.js';
55
56
  import getSeriesDetail from './getSeriesDetail.js';
56
57
  import 'nookies';
@@ -180,6 +181,89 @@ var findIndex = function findIndex(arr) {
180
181
  return indexes;
181
182
  };
182
183
 
184
+ function styleInject(css, ref) {
185
+ if ( ref === void 0 ) ref = {};
186
+ var insertAt = ref.insertAt;
187
+
188
+ if (!css || typeof document === 'undefined') { return; }
189
+
190
+ var head = document.head || document.getElementsByTagName('head')[0];
191
+ var style = document.createElement('style');
192
+ style.type = 'text/css';
193
+
194
+ if (insertAt === 'top') {
195
+ if (head.firstChild) {
196
+ head.insertBefore(style, head.firstChild);
197
+ } else {
198
+ head.appendChild(style);
199
+ }
200
+ } else {
201
+ head.appendChild(style);
202
+ }
203
+
204
+ if (style.styleSheet) {
205
+ style.styleSheet.cssText = css;
206
+ } else {
207
+ style.appendChild(document.createTextNode(css));
208
+ }
209
+ }
210
+
211
+ 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}";
212
+ 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" };
213
+ styleInject(css);
214
+
215
+ var RelatedArticle = function RelatedArticle(_ref) {
216
+ var articles = _ref.articles,
217
+ client = _ref.client;
218
+
219
+ if (!articles || articles.length == 0 || !articles[0]) {
220
+ return null;
221
+ }
222
+ return React__default.createElement(
223
+ 'div',
224
+ null,
225
+ articles.map(function (article, index) {
226
+ return React__default.createElement(
227
+ 'div',
228
+ { id: 'related-card', key: index, className: styles.mediaCard },
229
+ React__default.createElement(
230
+ 'a',
231
+ { className: styles.imgWrapper, href: '/view/' + (article.url ? article.url.current : '') },
232
+ article.thumbnail && React__default.createElement('img', {
233
+ style: { maxHeight: '135px', objectFit: 'cover', objectPosition: 'center' },
234
+ className: 'mr-3 img-fluid',
235
+ src: article.thumbnail && urlFor(client, article.thumbnail.asset).width(250).url(),
236
+ alt: article.title
237
+ })
238
+ ),
239
+ React__default.createElement(
240
+ 'div',
241
+ { className: styles.mediaBody },
242
+ React__default.createElement(
243
+ 'a',
244
+ { href: '/view/' + (article.url ? article.url.current : '') },
245
+ React__default.createElement(
246
+ 'h4',
247
+ { className: styles.cardTitle },
248
+ article.title
249
+ )
250
+ ),
251
+ React__default.createElement(
252
+ 'span',
253
+ { className: styles.cardDate },
254
+ moment(article.published).format('MMMM Do YYYY, h:mma')
255
+ ),
256
+ article.authorDetails && article.authorDetails.length > 0 && React__default.createElement(
257
+ 'div',
258
+ { className: 'author-listing' },
259
+ React__default.createElement(AuthorComponent, { index: index, authors: article.authorDetails })
260
+ )
261
+ )
262
+ );
263
+ })
264
+ );
265
+ };
266
+
183
267
  var Article = function Article(props) {
184
268
  var onVote = function () {
185
269
  var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(nodeKey, selectedChoice) {
@@ -232,7 +316,8 @@ var Article = function Article(props) {
232
316
  }();
233
317
 
234
318
  var article = props.article,
235
- Ads = props.Ads;
319
+ Ads = props.Ads,
320
+ showRelatedArticles = props.showRelatedArticles;
236
321
  var client = props.client,
237
322
  pageview = props.pageview,
238
323
  videoAccountIDs = props.videoAccountIDs,
@@ -276,6 +361,7 @@ var Article = function Article(props) {
276
361
  if (sponsoredFlag) {
277
362
  article.contextualVideoAD = false;
278
363
  article.contextualAD = false;
364
+ showRelatedArticles = false;
279
365
  }
280
366
  //This was being done in ArticleQueue2 which wasnt effecting articles excluded from infinite scroll, moved inside article component
281
367
  if (!sponsoredFlag && Ads.getVideoContextualAD) {
@@ -342,34 +428,55 @@ var Article = function Article(props) {
342
428
  return null;
343
429
  };
344
430
 
345
- var renderRelevantTopicsDropdown = function renderRelevantTopicsDropdown() {
431
+ var RelevantTopics = function RelevantTopics() {
346
432
  if (content_placement && content_placement.length > 0 || documentGroup) {
347
433
  return React__default.createElement(
348
- Dropdown,
349
- null,
434
+ 'div',
435
+ { style: { color: '#262626' } },
350
436
  React__default.createElement(
351
- Dropdown.Toggle,
352
- { variant: 'primary', id: 'partner-dropdown' },
353
- 'Relevant Topics'
437
+ 'p',
438
+ { className: 'mb-0' },
439
+ React__default.createElement(
440
+ 'b',
441
+ null,
442
+ 'Related Content:'
443
+ )
354
444
  ),
355
- React__default.createElement(
356
- Dropdown.Menu,
445
+ documentGroup && documentGroup.parent && React__default.createElement(
446
+ React__default.Fragment,
357
447
  null,
358
- documentGroup && documentGroup.parent && React__default.createElement(
359
- Dropdown.Item,
360
- { href: cpModificationRequired ? '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path : '/' + documentGroup.path },
361
- documentGroup.name
448
+ React__default.createElement(
449
+ 'span',
450
+ { className: '' },
451
+ React__default.createElement(
452
+ 'a',
453
+ {
454
+ className: 'related-links',
455
+ style: { color: 'blue' },
456
+ href: cpModificationRequired ? '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path : '/' + documentGroup.path },
457
+ documentGroup.name
458
+ )
362
459
  ),
363
- content_placement && content_placement.length > 0 ? content_placement.map(function (cp, index) {
364
- var cp_url = cpModificationRequired ? getContentPlacementUrl(cp) : cp.path;
365
- var href = '/' + cp_url;
366
- return React__default.createElement(
367
- Dropdown.Item,
368
- { key: index, href: href },
369
- cp.name
370
- );
371
- }) : null
372
- )
460
+ content_placement && content_placement.length ? ' | ' : null
461
+ ),
462
+ content_placement && content_placement.length > 0 ? content_placement.map(function (cp, index) {
463
+ var cp_url = cpModificationRequired ? getContentPlacementUrl(cp) : cp.path;
464
+ var href = '/' + cp_url;
465
+ return React__default.createElement(
466
+ React__default.Fragment,
467
+ { key: index },
468
+ React__default.createElement(
469
+ 'span',
470
+ null,
471
+ React__default.createElement(
472
+ 'a',
473
+ { className: 'related-links', key: index, href: href, style: { color: 'blue' } },
474
+ cp.name
475
+ )
476
+ ),
477
+ content_placement.length > index + 1 ? ' | ' : null
478
+ );
479
+ }) : null
373
480
  );
374
481
  }
375
482
  return null;
@@ -661,7 +768,7 @@ var Article = function Article(props) {
661
768
  ),
662
769
  React__default.createElement(
663
770
  'div',
664
- { className: 'mb-4 doc-group-container', style: { display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end' } },
771
+ { className: 'mb-3 doc-group-container', style: { display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end' } },
665
772
  React__default.createElement(
666
773
  'style',
667
774
  { jsx: 'true' },
@@ -708,6 +815,23 @@ var Article = function Article(props) {
708
815
  issue && React__default.createElement(
709
816
  'div',
710
817
  { className: 'volume-issue' },
818
+ issue.publication && issue.publication.name && React__default.createElement(
819
+ 'span',
820
+ { className: 'mb-0' },
821
+ React__default.createElement(
822
+ 'b',
823
+ null,
824
+ issue.publication.name
825
+ ),
826
+ ',',
827
+ ' '
828
+ ),
829
+ issue.name && React__default.createElement(
830
+ 'span',
831
+ { className: 'mb-0' },
832
+ issue.name,
833
+ ', '
834
+ ),
711
835
  issue.volume && React__default.createElement(
712
836
  'span',
713
837
  null,
@@ -741,8 +865,7 @@ var Article = function Article(props) {
741
865
  twitterSiteName: twitterSiteName,
742
866
  disableMeta: true
743
867
  })
744
- ),
745
- renderRelevantTopicsDropdown()
868
+ )
746
869
  ),
747
870
  React__default.createElement(
748
871
  'div',
@@ -785,6 +908,7 @@ var Article = function Article(props) {
785
908
  'div',
786
909
  { className: 'block-content mt-3' },
787
910
  renderBlockContent(article),
911
+ React__default.createElement('div', { className: 'clearfix' }),
788
912
  React__default.createElement(
789
913
  'noscript',
790
914
  null,
@@ -812,6 +936,17 @@ var Article = function Article(props) {
812
936
  'Download Issue : ',
813
937
  issue.name
814
938
  )
939
+ ),
940
+ React__default.createElement('div', { className: 'clearfix', style: { minHeight: '1px' } }),
941
+ React__default.createElement(
942
+ 'div',
943
+ null,
944
+ React__default.createElement(RelevantTopics, null)
945
+ ),
946
+ showRelatedArticles && React__default.createElement(
947
+ 'div',
948
+ { className: 'pt-2', style: { borderTop: '1px solid #eee' } },
949
+ React__default.createElement(RelatedArticle, { articles: article.relatedArticle, client: client })
815
950
  )
816
951
  ),
817
952
  renderIsiContent(props.article)
@@ -826,21 +961,21 @@ var Article = function Article(props) {
826
961
  );
827
962
  }
828
963
  }),
829
- React__default.createElement('div', { className: 'clearfix', style: { minHeight: '1px' } }),
830
- React__default.createElement('hr', { className: 'article-seperater my-5' }),
831
964
  React__default.createElement(
832
965
  'noscript',
833
966
  null,
834
- props.infiniteScroll && props.article.relatedArticle && props.article.relatedArticle.url && props.article.relatedArticle.url.current && React__default.createElement(
967
+ props.infiniteScroll && props.article.relatedArticle && props.article.relatedArticle[0] && props.article.relatedArticle[0].url && props.article.relatedArticle[0].url.current && React__default.createElement(
835
968
  'div',
836
969
  { style: { textAlign: 'center' } },
837
970
  React__default.createElement(
838
971
  'a',
839
- { href: '/view/' + props.article.relatedArticle.url.current },
840
- 'Related Article >>>'
972
+ { href: '/view/' + props.article.relatedArticle[0].url.current },
973
+ 'Related Article ',
974
+ '>>>'
841
975
  )
842
976
  )
843
- )
977
+ ),
978
+ React__default.createElement('hr', { className: 'article-seperater my-5' })
844
979
  );
845
980
  };
846
981
 
@@ -883,6 +1018,8 @@ exports.default = function (obj, key, value) {
883
1018
 
884
1019
  var _defineProperty = unwrapExports(defineProperty);
885
1020
 
1021
+ var _this = undefined;
1022
+
886
1023
  var ArticleQueue = function ArticleQueue(props) {
887
1024
  var _props$prevUrl = props.prevUrl,
888
1025
  prevUrl = _props$prevUrl === undefined ? '/' : _props$prevUrl,
@@ -893,7 +1030,8 @@ var ArticleQueue = function ArticleQueue(props) {
893
1030
  _props$cpModification = props.cpModificationRequired,
894
1031
  cpModificationRequired = _props$cpModification === undefined ? false : _props$cpModification,
895
1032
  _props$authorPrefix = props.authorPrefix,
896
- authorPrefix = _props$authorPrefix === undefined ? 'authors' : _props$authorPrefix;
1033
+ authorPrefix = _props$authorPrefix === undefined ? 'authors' : _props$authorPrefix,
1034
+ showRelatedArticles = props.showRelatedArticles;
897
1035
 
898
1036
 
899
1037
  var firstArticle = function firstArticle() {
@@ -998,13 +1136,43 @@ var ArticleQueue = function ArticleQueue(props) {
998
1136
  var params = props.params;
999
1137
  if (queueData && queueData.length < maxListLength) {
1000
1138
  params.index = queueData.length - 1;
1001
- props.client.fetch(query, params).then(function (article) {
1002
- if (article && article._id) {
1003
- var targeting = getTargeting({ article: article, cpModificationRequired: cpModificationRequired, prevUrl: prevUrl });
1004
- article.Ads = Ads.getRightItems(targeting);
1005
- setQueueData([].concat(_toConsumableArray(queueData), [article]));
1006
- }
1007
- });
1139
+ props.client.fetch(query, params).then(function () {
1140
+ var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(article) {
1141
+ var startingIndex, endingIndex, targeting;
1142
+ return regenerator.wrap(function _callee$(_context) {
1143
+ while (1) {
1144
+ switch (_context.prev = _context.next) {
1145
+ case 0:
1146
+ if (!(article && article._id)) {
1147
+ _context.next = 9;
1148
+ break;
1149
+ }
1150
+
1151
+ //query next 4 related article without repeating previous 4 related articles
1152
+ startingIndex = queueData.length;
1153
+ endingIndex = startingIndex + 3;
1154
+ _context.next = 5;
1155
+ return getRelatedArticle(null, props.client, article, prevUrl, startingIndex + '..' + endingIndex);
1156
+
1157
+ case 5:
1158
+ article.relatedArticle = _context.sent;
1159
+ targeting = getTargeting({ article: article, cpModificationRequired: cpModificationRequired, prevUrl: prevUrl });
1160
+
1161
+ article.Ads = Ads.getRightItems(targeting);
1162
+ setQueueData([].concat(_toConsumableArray(queueData), [article]));
1163
+
1164
+ case 9:
1165
+ case 'end':
1166
+ return _context.stop();
1167
+ }
1168
+ }
1169
+ }, _callee, _this);
1170
+ }));
1171
+
1172
+ return function (_x) {
1173
+ return _ref.apply(this, arguments);
1174
+ };
1175
+ }());
1008
1176
  }
1009
1177
  };
1010
1178
 
@@ -1069,7 +1237,8 @@ var ArticleQueue = function ArticleQueue(props) {
1069
1237
  article: article,
1070
1238
  cpModificationRequired: cpModificationRequired
1071
1239
  // Passing queueData to check for single article
1072
- , queueData: queueData
1240
+ , queueData: queueData,
1241
+ showRelatedArticles: showRelatedArticles
1073
1242
  }));
1074
1243
  })
1075
1244
  );
@@ -1142,7 +1311,7 @@ var Articles = function Articles(props) {
1142
1311
  }, _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));
1143
1312
  };
1144
1313
 
1145
- var _this = undefined;
1314
+ var _this$1 = undefined;
1146
1315
 
1147
1316
  var View = function View(props) {
1148
1317
  var router = useRouter();
@@ -1155,7 +1324,9 @@ var View = function View(props) {
1155
1324
  setCustomDimensions = props.setCustomDimensions,
1156
1325
  statusCode = props.statusCode,
1157
1326
  prevUrl = props.prevUrl,
1158
- pageview = props.pageview;
1327
+ pageview = props.pageview,
1328
+ _props$showRelatedArt = props.showRelatedArticles,
1329
+ showRelatedArticles = _props$showRelatedArt === undefined ? false : _props$showRelatedArt;
1159
1330
  var _props$article = props.article,
1160
1331
  _props$article$passwo = _props$article.passwordLock,
1161
1332
  passwordLock = _props$article$passwo === undefined ? false : _props$article$passwo,
@@ -1249,7 +1420,7 @@ var View = function View(props) {
1249
1420
  props.article.seriesDetail && props.article.seriesDetail.nextUrl && React__default.createElement('link', { rel: 'next', href: props.article.seriesDetail.nextUrl })
1250
1421
  )
1251
1422
  ),
1252
- !needInfiniteScroll ? React__default.createElement(Article, _extends({ infiniteScroll: false }, props)) : React__default.createElement(Articles, _extends({ infiniteScroll: true }, props))
1423
+ !needInfiniteScroll ? React__default.createElement(Article, _extends({ infiniteScroll: false, showRelatedArticles: showRelatedArticles }, props)) : React__default.createElement(Articles, _extends({ infiniteScroll: true, showRelatedArticles: showRelatedArticles }, props))
1253
1424
  );
1254
1425
  };
1255
1426
 
@@ -1296,7 +1467,7 @@ View.returnGetInitialProps = function () {
1296
1467
  }
1297
1468
 
1298
1469
  _context.next = 13;
1299
- return getRelatedArticle(context, client, article, prevUrl);
1470
+ return getRelatedArticle(context, client, article, prevUrl, '0..3');
1300
1471
 
1301
1472
  case 13:
1302
1473
  article.relatedArticle = _context.sent;
@@ -1317,7 +1488,7 @@ View.returnGetInitialProps = function () {
1317
1488
  return _context.stop();
1318
1489
  }
1319
1490
  }
1320
- }, _callee, _this);
1491
+ }, _callee, _this$1);
1321
1492
  }));
1322
1493
 
1323
1494
  return function (_x, _x2, _x3, _x4, _x5) {
@@ -10,7 +10,7 @@ import { i as imageUrlBuilder } from './index-51a80699.js';
10
10
  import { L as LazyLoad } from './index-5f9f807a.js';
11
11
  import { c as clean_html_1 } from './entities-7cc3bf45.js';
12
12
  import './slicedToArray-f1e40361.js';
13
- import { A as AuthorComponent } from './AuthorComponent-158226c9.js';
13
+ import { A as AuthorComponent } from './AuthorComponent-357dbee9.js';
14
14
 
15
15
  var YahooHero = function YahooHero(props) {
16
16
  var removeTimeStamp = props.removeTimeStamp;
@@ -1,4 +1,4 @@
1
- import { c as isObject_1, _ as _baseGetTag } from './isSymbol-b7b7434f.js';
1
+ import { d as isObject_1, _ as _baseGetTag } from './isSymbol-47f5ff3b.js';
2
2
 
3
3
  /**
4
4
  * Checks if `value` is classified as an `Array` object.
@@ -1,4 +1,4 @@
1
- import { a as _root, b as isSymbol_1, c as isObject_1 } from './isSymbol-b7b7434f.js';
1
+ import { a as _root, c as isSymbol_1, d as isObject_1 } from './isSymbol-47f5ff3b.js';
2
2
 
3
3
  /**
4
4
  * Gets the timestamp of the number of milliseconds that have elapsed since
@@ -1,5 +1,5 @@
1
- import { b as isSymbol_1, a as _root, c as isObject_1, d as _Symbol } from './isSymbol-b7b7434f.js';
2
- import { a as isArray_1, i as isFunction_1, _ as _arrayMap } from './_arrayMap-64cbe0e4.js';
1
+ import { c as isSymbol_1, a as _root, d as isObject_1, e as _Symbol } from './isSymbol-47f5ff3b.js';
2
+ import { a as isArray_1, i as isFunction_1, _ as _arrayMap } from './_arrayMap-818441dd.js';
3
3
 
4
4
  /** Used to match property names within property paths. */
5
5
  var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
@@ -1,16 +1,14 @@
1
- import './_commonjsHelpers-0c4b6f40.js';
2
- import './moment-12415288.js';
3
-
4
1
  var getQuery = function getQuery(type) {
5
2
  var conditions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
6
3
  var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
4
+ var articleCount = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
7
5
 
8
6
  //Added feature to include additional conditions and parameters for site level operations
9
7
  //Site level conditions should start with && (logical AND), and site level params should end with , (comma) in order to execute query
10
8
 
11
9
  switch (type) {
12
10
  case 'related':
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)[$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 }';
11
+ 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 }';
14
12
  case 'article':
15
13
  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 }';
16
14
  case 'publication':
@@ -4,7 +4,6 @@ import './core.get-iterator-method-f5c0d66a.js';
4
4
  import './_library-528f1934.js';
5
5
  import './_iter-detect-6e099a34.js';
6
6
  import './web.dom.iterable-46c95e52.js';
7
- import './moment-12415288.js';
8
7
  import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-0379e924.js';
9
8
  import './_set-species-6f64f1c1.js';
10
9
  import { parseCookies, setCookie } from 'nookies';
@@ -18,6 +17,7 @@ var getRelatedArticle = function () {
18
17
  var client = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
19
18
  var article = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
20
19
  var prevUrl = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '/';
20
+ var articleCount = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
21
21
 
22
22
  var taxonomyMapping, _article$url, url, content_placement, taxonomy, params, conditions, cookies, prevSlugs, relatedArticleQuery, relatedArticle;
23
23
 
@@ -42,7 +42,7 @@ var getRelatedArticle = function () {
42
42
  if (prev_url_to_check.includes('?')) {
43
43
  prev_url_to_check = prev_url_to_check.split('?')[0];
44
44
  }
45
- if (prev_url_to_check.endsWith(path)) taxonomy.push(_id);
45
+ if (prev_url_to_check.endsWith(path) && _id) taxonomy.push(_id);
46
46
  });
47
47
  }
48
48
 
@@ -53,11 +53,10 @@ var getRelatedArticle = function () {
53
53
  return _ref;
54
54
  });
55
55
  }
56
-
57
56
  params = {
58
57
  url: url,
59
58
  taxonomy: taxonomy,
60
- index: 0
59
+ index: articleCount
61
60
  };
62
61
  conditions = '';
63
62
 
@@ -70,8 +69,7 @@ var getRelatedArticle = function () {
70
69
  conditions = '&& !(url.current in [' + prevSlugs + '])';
71
70
  } else setCookie(ctx, 'prevSlugs', '"' + url + '"', {});
72
71
  }
73
-
74
- relatedArticleQuery = getQuery('related', conditions);
72
+ relatedArticleQuery = getQuery('related', conditions, '', articleCount);
75
73
  _context.next = 12;
76
74
  return client.fetch(relatedArticleQuery, params);
77
75
 
@@ -16,8 +16,8 @@ import 'react-bootstrap/Row';
16
16
  import 'react-bootstrap/Col';
17
17
  import './moment-12415288.js';
18
18
  import 'next/router';
19
- import './isSymbol-b7b7434f.js';
20
- import './debounce-048d9cb6.js';
19
+ import './isSymbol-47f5ff3b.js';
20
+ import './debounce-a0d9abca.js';
21
21
  import 'react-dom';
22
22
  import './index-51a80699.js';
23
23
  import './index-5f9f807a.js';
@@ -35,7 +35,7 @@ import './smoothscroll-4b699764.js';
35
35
  import './GroupDeck.js';
36
36
  import 'react-bootstrap';
37
37
  import 'react-bootstrap/Button';
38
- export { g as default } from './index-80cb5ee6.js';
38
+ export { g as default } from './index-91506c27.js';
39
39
  import './util-7700fc59.js';
40
40
  import './brightcove-react-player-loader.es-83f53e4e.js';
41
41
  import 'react-bootstrap/Pagination';
package/dist/esm/index.js CHANGED
@@ -21,8 +21,8 @@ import 'react-bootstrap/Col';
21
21
  import 'react-bootstrap/Card';
22
22
  import './moment-12415288.js';
23
23
  import 'next/router';
24
- import './isSymbol-b7b7434f.js';
25
- import './debounce-048d9cb6.js';
24
+ import './isSymbol-47f5ff3b.js';
25
+ import './debounce-a0d9abca.js';
26
26
  import './index.es-938a3a58.js';
27
27
  import 'react-dom';
28
28
  import './visibility-sensor-0baa4eea.js';
@@ -36,14 +36,14 @@ import './asyncToGenerator-0379e924.js';
36
36
  import './_set-species-6f64f1c1.js';
37
37
  export { B as Beam, S as Segment } from './beam-a25bd8fd.js';
38
38
  export { default as AdSlot } from './AdSlot.js';
39
- import './ADInfeed-c7dba95f.js';
39
+ import './ADInfeed-cecd42e8.js';
40
40
  export { default as DeckContent } from './DeckContent.js';
41
41
  import './lodash-17fdfebb.js';
42
- import './ADlgInfeed-8bfd6d58.js';
43
- import './_arrayMap-64cbe0e4.js';
44
- import './get-0eb56363.js';
42
+ import './ADlgInfeed-234ba767.js';
43
+ import './_arrayMap-818441dd.js';
44
+ import './get-58d2f7cc.js';
45
45
  export { default as AD } from './AD.js';
46
- import './AuthorComponent-158226c9.js';
46
+ import './AuthorComponent-357dbee9.js';
47
47
  export { default as GridContent } from './GridContent.js';
48
48
  export { default as DeckQueue } from './DeckQueue.js';
49
49
  import 'react-bootstrap/Media';
@@ -71,7 +71,7 @@ import './index-d2f90501.js';
71
71
  import './js.cookie-6874175c.js';
72
72
  export { default as EventsDeck } from './EventsDeck.js';
73
73
  export { default as CMEDeck } from './CMEDeck.js';
74
- export { g as getSerializers } from './index-80cb5ee6.js';
74
+ export { g as getSerializers } from './index-91506c27.js';
75
75
  import './util-7700fc59.js';
76
76
  import './brightcove-react-player-loader.es-83f53e4e.js';
77
77
  import 'react-bootstrap/Pagination';
@@ -139,7 +139,7 @@ export { default as IssueLanding } from './IssueLanding.js';
139
139
  import 'react-bootstrap/Modal';
140
140
  export { default as PopUpModal } from './PopUpModal.js';
141
141
  export { default as ArticleQueue } from './ArticleQueue.js';
142
- import './InscreenSensor-280b2b10.js';
142
+ import './InscreenSensor-beb2ec79.js';
143
143
  export { default as getKeywords } from './getKeywords.js';
144
144
  export { default as RelatedContent } from './RelatedContent.js';
145
145
  export { default as ForbesHero } from './ForbesHero.js';
@@ -200,4 +200,4 @@ function isSymbol(value) {
200
200
 
201
201
  var isSymbol_1 = isSymbol;
202
202
 
203
- export { _baseGetTag as _, _root as a, isSymbol_1 as b, isObject_1 as c, _Symbol as d, _freeGlobal as e, isObjectLike_1 as i };
203
+ export { _baseGetTag as _, _root as a, _freeGlobal as b, isSymbol_1 as c, isObject_1 as d, _Symbol as e, isObjectLike_1 as i };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.594",
3
+ "version": "1.0.596",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",