@mjhls/mjh-framework 1.0.683 → 1.0.684-beta.1
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 +1 -1
- package/dist/cjs/AD.js +1 -1
- package/dist/cjs/AD300x250.js +3 -3
- package/dist/cjs/AD300x250x600.js +3 -3
- package/dist/cjs/AD728x90.js +4 -4
- package/dist/cjs/ADFloatingFooter.js +2 -2
- package/dist/cjs/ADGutter.js +2 -2
- package/dist/cjs/ADSkyscraper.js +2 -2
- package/dist/cjs/ADSponsoredResources.js +2 -2
- package/dist/cjs/ADWebcast.js +2 -2
- package/dist/cjs/ADWelcome.js +2 -2
- package/dist/cjs/AdSlot.js +2 -2
- package/dist/cjs/AdSlotsProvider.js +1 -1
- package/dist/cjs/ArticleCarousel.js +1 -1
- package/dist/cjs/ArticleSeriesListing.js +4 -4
- package/dist/cjs/Auth.js +256 -507
- package/dist/cjs/{BlockContent-88f69acd.js → BlockContent-091a991f.js} +1 -1
- package/dist/cjs/BrowseVideosListing.js +1 -1
- package/dist/cjs/CMEDeck.js +5 -5
- package/dist/cjs/Column3.js +4 -4
- package/dist/cjs/ConferenceArticleCard.js +2 -2
- package/dist/cjs/DeckContent.js +7 -7
- package/dist/cjs/DeckQueue.js +6 -6
- package/dist/cjs/{Dfp-b2bc3b97.js → Dfp-f6a18ed2.js} +1 -1
- package/dist/cjs/EventsDeck.js +4 -4
- package/dist/cjs/ExternalResources.js +7 -7
- package/dist/cjs/Feature.js +3 -3
- package/dist/cjs/ForbesHero.js +2 -2
- package/dist/cjs/GridContent.js +10 -10
- package/dist/cjs/GridHero.js +2 -2
- package/dist/cjs/GroupDeck.js +1 -1
- package/dist/cjs/HamMagazine.js +4 -4
- package/dist/cjs/Hero.js +1 -1
- package/dist/cjs/HorizontalHero.js +2 -2
- package/dist/cjs/IssueContentDeck.js +2 -2
- package/dist/cjs/IssueDeck.js +2 -2
- package/dist/cjs/IssueLanding.js +8 -7
- package/dist/cjs/LeftNav.js +2 -2
- package/dist/cjs/MasterDeck.js +7 -7
- package/dist/cjs/NavMagazine.js +4 -4
- package/dist/cjs/NavNative.js +3 -3
- package/dist/cjs/OncliveHero.js +2 -2
- package/dist/cjs/OncliveLargeHero.js +2 -2
- package/dist/cjs/PartnerDetailListing.js +1213 -15
- package/dist/cjs/PublicationDeck.js +1 -1
- package/dist/cjs/QueueDeckExpanded.js +256 -18
- package/dist/cjs/RecentNews.js +2 -2
- package/dist/cjs/RelatedContent.js +2 -2
- package/dist/cjs/{SocialSearchComponent-6b5e5b47.js → SocialSearchComponent-9cd24578.js} +5 -5
- package/dist/cjs/TaxonomyCard.js +2 -2
- package/dist/cjs/TemplateNormal.js +3 -3
- package/dist/cjs/ThumbnailCard.js +1 -1
- package/dist/cjs/Ustream.js +2 -2
- package/dist/cjs/VerticalHero.js +2 -2
- package/dist/cjs/VideoSeriesCard.js +2 -2
- package/dist/cjs/VideoSeriesListing.js +3 -3
- package/dist/cjs/View.js +532 -137
- package/dist/cjs/YahooHero.js +2 -2
- package/dist/cjs/YoutubeGroup.js +1 -1
- package/dist/cjs/getQuery.js +2 -2
- package/dist/cjs/getRelatedArticle.js +354 -5
- package/dist/cjs/getSerializers.js +6 -6
- package/dist/cjs/{getTargeting-fee8c429.js → getTargeting-9af0ef69.js} +2 -2
- package/dist/cjs/getTargeting.js +1 -1
- package/dist/cjs/{index-5be2866f.js → index-3294d3bc.js} +1 -1
- package/dist/cjs/index-bd6c9f56.js +211 -0
- package/dist/cjs/{index-b5eb3ff8.js → index-be0c82be.js} +19 -20
- package/dist/cjs/{index-8c9e8ca7.js → index-c49c3b5e.js} +450 -462
- package/dist/cjs/{index-2d0a4911.js → index-fa8ed292.js} +27 -34
- package/dist/cjs/{index.es-ab3f2690.js → index.es-9110add6.js} +1 -3
- package/dist/cjs/index.js +16 -16
- package/dist/cjs/{main-b6c96c8d.js → main-a4cb15bb.js} +36 -67
- package/dist/cjs/{moment-66a6a284.js → moment-575fe24c.js} +1 -1
- package/dist/cjs/timeDifferenceCalc.js +41 -0
- package/dist/cjs/urlFor.js +1 -1
- package/dist/esm/AD.js +1 -1
- package/dist/esm/AD300x250.js +3 -3
- package/dist/esm/AD300x250x600.js +3 -3
- package/dist/esm/AD728x90.js +4 -4
- package/dist/esm/ADFloatingFooter.js +2 -2
- package/dist/esm/ADGutter.js +2 -2
- package/dist/esm/ADSkyscraper.js +2 -2
- package/dist/esm/ADSponsoredResources.js +2 -2
- package/dist/esm/ADWebcast.js +2 -2
- package/dist/esm/ADWelcome.js +2 -2
- package/dist/esm/AdSlot.js +2 -2
- package/dist/esm/AdSlotsProvider.js +1 -1
- package/dist/esm/ArticleCarousel.js +1 -1
- package/dist/esm/ArticleSeriesListing.js +4 -4
- package/dist/esm/Auth.js +248 -499
- package/dist/esm/{BlockContent-a614acdf.js → BlockContent-e9b4ddcf.js} +1 -1
- package/dist/esm/BrowseVideosListing.js +1 -1
- package/dist/esm/CMEDeck.js +5 -5
- package/dist/esm/Column3.js +4 -4
- package/dist/esm/ConferenceArticleCard.js +2 -2
- package/dist/esm/DeckContent.js +7 -7
- package/dist/esm/DeckQueue.js +6 -6
- package/dist/esm/{Dfp-8a8fca18.js → Dfp-96b49def.js} +1 -1
- package/dist/esm/EventsDeck.js +4 -4
- package/dist/esm/ExternalResources.js +7 -7
- package/dist/esm/Feature.js +3 -3
- package/dist/esm/ForbesHero.js +2 -2
- package/dist/esm/GridContent.js +10 -10
- package/dist/esm/GridHero.js +2 -2
- package/dist/esm/GroupDeck.js +1 -1
- package/dist/esm/HamMagazine.js +4 -4
- package/dist/esm/Hero.js +1 -1
- package/dist/esm/HorizontalHero.js +2 -2
- package/dist/esm/IssueContentDeck.js +2 -2
- package/dist/esm/IssueDeck.js +2 -2
- package/dist/esm/IssueLanding.js +8 -7
- package/dist/esm/LeftNav.js +2 -2
- package/dist/esm/MasterDeck.js +7 -7
- package/dist/esm/NavMagazine.js +4 -4
- package/dist/esm/NavNative.js +3 -3
- package/dist/esm/OncliveHero.js +2 -2
- package/dist/esm/OncliveLargeHero.js +2 -2
- package/dist/esm/PartnerDetailListing.js +1210 -13
- package/dist/esm/PublicationDeck.js +1 -1
- package/dist/esm/QueueDeckExpanded.js +256 -18
- package/dist/esm/RecentNews.js +2 -2
- package/dist/esm/RelatedContent.js +2 -2
- package/dist/esm/{SocialSearchComponent-7f14e0f3.js → SocialSearchComponent-93233334.js} +5 -5
- package/dist/esm/TaxonomyCard.js +2 -2
- package/dist/esm/TemplateNormal.js +3 -3
- package/dist/esm/ThumbnailCard.js +1 -1
- package/dist/esm/Ustream.js +2 -2
- package/dist/esm/VerticalHero.js +2 -2
- package/dist/esm/VideoSeriesCard.js +2 -2
- package/dist/esm/VideoSeriesListing.js +3 -3
- package/dist/esm/View.js +512 -117
- package/dist/esm/YahooHero.js +2 -2
- package/dist/esm/YoutubeGroup.js +1 -1
- package/dist/esm/getQuery.js +2 -2
- package/dist/esm/getRelatedArticle.js +354 -5
- package/dist/esm/getSerializers.js +6 -6
- package/dist/esm/{index-93ec3c59.js → index-0e45a0b2.js} +27 -34
- package/dist/esm/{index-51a80699.js → index-73819142.js} +19 -20
- package/dist/esm/{index-5505d4f9.js → index-85783f24.js} +450 -462
- package/dist/esm/index-db3bb315.js +207 -0
- package/dist/esm/{index-d2f90501.js → index-ef6d5dcf.js} +1 -1
- package/dist/esm/{index.es-938a3a58.js → index.es-29c1cef5.js} +1 -3
- package/dist/esm/index.js +14 -14
- package/dist/esm/{main-0465b2a0.js → main-5d1e4bd3.js} +34 -65
- package/dist/esm/{moment-12415288.js → moment-e2f9b20c.js} +1 -1
- package/dist/esm/timeDifferenceCalc.js +39 -0
- package/dist/esm/urlFor.js +1 -1
- package/package.json +1 -1
- /package/dist/cjs/{ADInfeed-c676389b.js → ADInfeed-f27bc4b5.js} +0 -0
- /package/dist/cjs/{ADlgInfeed-57d63c87.js → ADlgInfeed-8decfd9e.js} +0 -0
- /package/dist/esm/{ADInfeed-97b8cea7.js → ADInfeed-1e0ca5e0.js} +0 -0
- /package/dist/esm/{ADlgInfeed-3ab91c75.js → ADlgInfeed-979cf0d5.js} +0 -0
package/dist/esm/View.js
CHANGED
|
@@ -6,7 +6,7 @@ import './_iter-detect-59409a32.js';
|
|
|
6
6
|
import { _ as _toConsumableArray } from './toConsumableArray-725434a0.js';
|
|
7
7
|
import './core.get-iterator-method-54d2e411.js';
|
|
8
8
|
import './_object-pie-71ac75a4.js';
|
|
9
|
-
import {
|
|
9
|
+
import { a as _Object$assign, _ as _extends } from './extends-cc5da797.js';
|
|
10
10
|
import './_object-sap-4d59d5bd.js';
|
|
11
11
|
import './inherits-7ee3e0c1.js';
|
|
12
12
|
import './define-property-de3fc946.js';
|
|
@@ -14,19 +14,19 @@ import './web.dom.iterable-8956f9a5.js';
|
|
|
14
14
|
import { _ as _typeof } from './typeof-08f2c380.js';
|
|
15
15
|
import './_is-array-49698029.js';
|
|
16
16
|
import React__default, { useState, useRef, useEffect } from 'react';
|
|
17
|
-
import { l as lib_3 } from './index-
|
|
17
|
+
import { l as lib_3 } from './index-0e45a0b2.js';
|
|
18
18
|
import 'prop-types';
|
|
19
19
|
import 'react-bootstrap/Row';
|
|
20
20
|
import 'react-bootstrap/Col';
|
|
21
|
-
import { m as moment } from './moment-
|
|
21
|
+
import { m as moment } from './moment-e2f9b20c.js';
|
|
22
22
|
import { useRouter } from 'next/router';
|
|
23
23
|
import './isSymbol-807e927e.js';
|
|
24
24
|
import './debounce-1a993acf.js';
|
|
25
|
-
import { I as InfiniteScroll } from './index.es-
|
|
25
|
+
import { I as InfiniteScroll } from './index.es-29c1cef5.js';
|
|
26
26
|
import 'react-dom';
|
|
27
|
-
import './index-
|
|
27
|
+
import './index-73819142.js';
|
|
28
28
|
import './index-5f9f807a.js';
|
|
29
|
-
import { m as
|
|
29
|
+
import { m as main_36 } from './main-5d1e4bd3.js';
|
|
30
30
|
import './entities-7cc3bf45.js';
|
|
31
31
|
import { _ as _JSON$stringify } from './stringify-008c8802.js';
|
|
32
32
|
import { a as _getIterator, _ as _slicedToArray } from './slicedToArray-7021e5df.js';
|
|
@@ -34,7 +34,7 @@ import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-7c6
|
|
|
34
34
|
import './_set-species-cede29f8.js';
|
|
35
35
|
import './beam-681a9749.js';
|
|
36
36
|
import DFPAdSlot from './AdSlot.js';
|
|
37
|
-
import { B as BlockContent } from './BlockContent-
|
|
37
|
+
import { B as BlockContent } from './BlockContent-e9b4ddcf.js';
|
|
38
38
|
import './smoothscroll-4b699764.js';
|
|
39
39
|
import './GroupDeck.js';
|
|
40
40
|
import 'react-bootstrap';
|
|
@@ -42,7 +42,7 @@ import './iconBase-602d52fe.js';
|
|
|
42
42
|
import Button from 'react-bootstrap/Button';
|
|
43
43
|
import { _ as _defineProperty } from './defineProperty-b798470d.js';
|
|
44
44
|
import Form from 'react-bootstrap/Form';
|
|
45
|
-
import { I as InscreenSensor, r as renderAuthor, g as getSerializers } from './index-
|
|
45
|
+
import { I as InscreenSensor, r as renderAuthor, g as getSerializers } from './index-85783f24.js';
|
|
46
46
|
import './util-7700fc59.js';
|
|
47
47
|
import './brightcove-react-player-loader.es-83f53e4e.js';
|
|
48
48
|
import 'react-bootstrap/Pagination';
|
|
@@ -54,9 +54,9 @@ import { _ as _Object$keys } from './keys-fc2d4c34.js';
|
|
|
54
54
|
import 'react-bootstrap/Dropdown';
|
|
55
55
|
import { b as FaMinus, c as FaPlus } from './index.esm-cf08bf18.js';
|
|
56
56
|
import getSeriesDetail from './getSeriesDetail.js';
|
|
57
|
-
import '
|
|
58
|
-
import getQuery from './getQuery.js';
|
|
57
|
+
import './index-db3bb315.js';
|
|
59
58
|
import getRelatedArticle from './getRelatedArticle.js';
|
|
59
|
+
import getQuery from './getQuery.js';
|
|
60
60
|
import { g as getTargeting, a as getContentPlacementUrl } from './getTargeting-2acdec91.js';
|
|
61
61
|
import getKeywords from './getKeywords.js';
|
|
62
62
|
import urlFor from './urlFor.js';
|
|
@@ -137,9 +137,9 @@ var DocumentGroup = function DocumentGroup(_ref) {
|
|
|
137
137
|
style: { display: 'flex', flexDirection: 'column', padding: '0 1rem', justifyContent: thumbnailUrl ? 'center' : 'flex-start', alignItems: 'center' } },
|
|
138
138
|
thumbnailUrl && React__default.createElement('img', { style: { maxWidth: '220px', maxHeight: '100px', marginTop: '1rem' }, src: thumbnailUrl, alt: name }),
|
|
139
139
|
!thumbnailUrl && React__default.createElement('p', {
|
|
140
|
-
style: { maxWidth: '315px', margin: '0', color: 'var(--primary)', textAlign: thumbnailUrl ? 'center' :
|
|
140
|
+
style: { maxWidth: '315px', margin: '0', color: 'var(--primary)', textAlign: thumbnailUrl ? 'center' : main_36 ? 'left' : 'right', marginTop: '.25rem' },
|
|
141
141
|
dangerouslySetInnerHTML: { __html: name } }),
|
|
142
|
-
|
|
142
|
+
main_36 && !thumbnailUrl && React__default.createElement(
|
|
143
143
|
'style',
|
|
144
144
|
{ jsx: 'true' },
|
|
145
145
|
'\n a.doc-group {\n display: block !important;\n padding: 0!important;\n }\n '
|
|
@@ -246,7 +246,7 @@ var ISI = function ISI(props) {
|
|
|
246
246
|
);
|
|
247
247
|
};
|
|
248
248
|
|
|
249
|
-
var css = ".RelatedArticles-module_mediaContainer__10h9k {\r\n display: flex;\r\n flex-direction: row;\r\n flex-wrap: nowrap;\r\n margin: 0 -1rem;\r\n}\r\n.RelatedArticles-module_mediaCard__3wQbn {\r\n margin: 0 1rem 1rem;\r\n width: calc(33% - 1rem);\r\n display: column;\r\n flex-direction: row;\r\n margin-bottom: 0.75rem;\r\n
|
|
249
|
+
var css = ".RelatedArticles-module_mediaContainer__10h9k {\r\n display: flex;\r\n flex-direction: row;\r\n flex-wrap: nowrap;\r\n margin: 0 -1rem;\r\n}\r\n.RelatedArticles-module_mediaCard__3wQbn {\r\n margin: 0 1rem 1rem;\r\n width: calc(33% - 1rem);\r\n display: column;\r\n flex-direction: row;\r\n margin-bottom: 0.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: 15px;\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_imgWrapper__5Jx_4 {\r\n display: block;\r\n text-align: center;\r\n margin-bottom: 0.5rem;\r\n}\r\n.RelatedArticles-module_imgWrapper__5Jx_4 img {\r\n height: 135px;\r\n width: 100%;\r\n object-fit: cover;\r\n object-position: center;\r\n}\r\n@media screen and (max-width: 1064px) {\r\n}\r\n@media screen and (max-width: 968px) {\r\n .RelatedArticles-module_mediaContainer__10h9k {\r\n flex-wrap: wrap;\r\n }\r\n .RelatedArticles-module_mediaCard__3wQbn {\r\n width: 100%;\r\n background-color: #cccccc;\r\n margin-bottom: 0.5rem;\r\n padding: 0.5rem;\r\n border-radius: 0.25rem;\r\n }\r\n .RelatedArticles-module_imgWrapper__5Jx_4 {\r\n display: none;\r\n }\r\n}\r\n";
|
|
250
250
|
var styles = { "mediaContainer": "RelatedArticles-module_mediaContainer__10h9k", "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", "imgWrapper": "RelatedArticles-module_imgWrapper__5Jx_4" };
|
|
251
251
|
styleInject(css);
|
|
252
252
|
|
|
@@ -291,6 +291,22 @@ var RelatedArticle = function RelatedArticle(_ref) {
|
|
|
291
291
|
);
|
|
292
292
|
};
|
|
293
293
|
|
|
294
|
+
var defaults = { nonTextBehavior: 'remove' };
|
|
295
|
+
|
|
296
|
+
var blocksToText = function blocksToText(blocks) {
|
|
297
|
+
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
298
|
+
|
|
299
|
+
var options = _Object$assign({}, defaults, opts);
|
|
300
|
+
return blocks.map(function (block) {
|
|
301
|
+
if (block._type !== 'block' || !block.children) {
|
|
302
|
+
return options.nonTextBehavior === 'remove' ? '' : '[' + block._type + ' block]';
|
|
303
|
+
}
|
|
304
|
+
return block.children.map(function (child) {
|
|
305
|
+
return child.text;
|
|
306
|
+
}).join('');
|
|
307
|
+
}).join('\n\n');
|
|
308
|
+
};
|
|
309
|
+
|
|
294
310
|
var Article = function Article(props) {
|
|
295
311
|
var onVote = function () {
|
|
296
312
|
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(nodeKey, selectedChoice) {
|
|
@@ -482,10 +498,56 @@ var Article = function Article(props) {
|
|
|
482
498
|
};
|
|
483
499
|
|
|
484
500
|
var RelevantTopics = function RelevantTopics() {
|
|
485
|
-
if (content_placement && content_placement.length > 0 || documentGroupMapping) {
|
|
501
|
+
if (content_placement && content_placement.length > 0 || documentGroupMapping && documentGroupMapping.length > 0) {
|
|
502
|
+
var relatedLinks = [];
|
|
503
|
+
if (documentGroupMapping && documentGroupMapping.length > 0) {
|
|
504
|
+
documentGroupMapping.forEach(function (documentGroup) {
|
|
505
|
+
if (documentGroup.parent) {
|
|
506
|
+
relatedLinks = [].concat(_toConsumableArray(relatedLinks), [{ label: documentGroup.name, href: cpModificationRequired ? '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path : '/' + documentGroup.path }]);
|
|
507
|
+
}
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
if (content_placement && content_placement.length > 0) {
|
|
511
|
+
content_placement.filter(function (item) {
|
|
512
|
+
return item.path !== 'news';
|
|
513
|
+
}).forEach(function (cp) {
|
|
514
|
+
var cp_url = cpModificationRequired ? getContentPlacementUrl(cp) : cp.path;
|
|
515
|
+
var href = '/' + cp_url;
|
|
516
|
+
relatedLinks = [].concat(_toConsumableArray(relatedLinks), [{ label: cp.name, href: href }]);
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
if (relatedLinks && relatedLinks.length > 0) {
|
|
520
|
+
return React__default.createElement(
|
|
521
|
+
'div',
|
|
522
|
+
null,
|
|
523
|
+
relatedLinks.map(function (relatedLink, index) {
|
|
524
|
+
return React__default.createElement(
|
|
525
|
+
'span',
|
|
526
|
+
{ key: index, className: 'related-link' },
|
|
527
|
+
React__default.createElement(
|
|
528
|
+
'a',
|
|
529
|
+
{ className: 'related-links', style: { color: 'blue' }, href: relatedLink.href },
|
|
530
|
+
relatedLink.label
|
|
531
|
+
),
|
|
532
|
+
React__default.createElement(
|
|
533
|
+
'style',
|
|
534
|
+
{ jsx: 'true' },
|
|
535
|
+
'\n .related-link:not(:first-child):before {\n content: \' | \';\n }\n '
|
|
536
|
+
)
|
|
537
|
+
);
|
|
538
|
+
})
|
|
539
|
+
);
|
|
540
|
+
}
|
|
541
|
+
return null;
|
|
542
|
+
}
|
|
543
|
+
return null;
|
|
544
|
+
};
|
|
545
|
+
|
|
546
|
+
var RelatedContent = function RelatedContent() {
|
|
547
|
+
if (showRelatedArticles) {
|
|
486
548
|
return React__default.createElement(
|
|
487
|
-
'
|
|
488
|
-
{
|
|
549
|
+
'section',
|
|
550
|
+
{ className: 'related-content-section' },
|
|
489
551
|
React__default.createElement(
|
|
490
552
|
'p',
|
|
491
553
|
{ className: 'mb-0' },
|
|
@@ -495,47 +557,17 @@ var Article = function Article(props) {
|
|
|
495
557
|
'Related Content:'
|
|
496
558
|
)
|
|
497
559
|
),
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
'
|
|
508
|
-
|
|
509
|
-
React__default.createElement(
|
|
510
|
-
'a',
|
|
511
|
-
{
|
|
512
|
-
className: 'related-links',
|
|
513
|
-
style: { color: 'blue' },
|
|
514
|
-
href: cpModificationRequired ? '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path : '/' + documentGroup.path },
|
|
515
|
-
documentGroup.name
|
|
516
|
-
)
|
|
517
|
-
),
|
|
518
|
-
content_placement && content_placement.length ? ' | ' : null
|
|
519
|
-
);
|
|
520
|
-
}),
|
|
521
|
-
content_placement && content_placement.length > 0 ? content_placement.map(function (cp, index) {
|
|
522
|
-
var cp_url = cpModificationRequired ? getContentPlacementUrl(cp) : cp.path;
|
|
523
|
-
var href = '/' + cp_url;
|
|
524
|
-
return React__default.createElement(
|
|
525
|
-
React__default.Fragment,
|
|
526
|
-
{ key: index },
|
|
527
|
-
React__default.createElement(
|
|
528
|
-
'span',
|
|
529
|
-
null,
|
|
530
|
-
React__default.createElement(
|
|
531
|
-
'a',
|
|
532
|
-
{ className: 'related-links', key: index, href: href, style: { color: 'blue' } },
|
|
533
|
-
cp.name
|
|
534
|
-
)
|
|
535
|
-
),
|
|
536
|
-
content_placement.length > index + 1 ? ' | ' : null
|
|
537
|
-
);
|
|
538
|
-
}) : null
|
|
560
|
+
React__default.createElement(RelevantTopics, null),
|
|
561
|
+
React__default.createElement(
|
|
562
|
+
'div',
|
|
563
|
+
{ className: 'pt-2' },
|
|
564
|
+
React__default.createElement(RelatedArticle, { articles: article.relatedContentArticles, client: client })
|
|
565
|
+
),
|
|
566
|
+
React__default.createElement(
|
|
567
|
+
'style',
|
|
568
|
+
{ jsx: 'true' },
|
|
569
|
+
'\n .related-content-section {\n margin: 0.5rem 0 0.5rem 0;\n padding: 0.5rem;\n background-color: #e6e6e6;\n border-radius: 0.25rem;\n }\n '
|
|
570
|
+
)
|
|
539
571
|
);
|
|
540
572
|
}
|
|
541
573
|
return null;
|
|
@@ -624,14 +656,42 @@ var Article = function Article(props) {
|
|
|
624
656
|
setContextualADFlag(true);
|
|
625
657
|
}
|
|
626
658
|
};
|
|
659
|
+
|
|
660
|
+
//Start: Generating intemediate Section if available
|
|
661
|
+
var blockContentSection1 = articleBody.slice(0, selectedIndex);
|
|
662
|
+
var blockContentSection2 = articleBody.slice(selectedIndex);
|
|
663
|
+
var blockContentIntermediateSection = [];
|
|
664
|
+
var rearrangeSections = function rearrangeSections(arr, index) {
|
|
665
|
+
var item = arr[index];
|
|
666
|
+
if (item && item._type) {
|
|
667
|
+
if (item._type === 'block' && blocksToText([item]) === '') {
|
|
668
|
+
rearrangeSections(arr, index + 1);
|
|
669
|
+
}
|
|
670
|
+
if (item._type !== 'block') {
|
|
671
|
+
var _selectedIndex = arr.findIndex(function (item1) {
|
|
672
|
+
return item1._key === item._key;
|
|
673
|
+
});
|
|
674
|
+
blockContentIntermediateSection = [].concat(_toConsumableArray(blockContentIntermediateSection), _toConsumableArray(arr.slice(0, _selectedIndex + 1)));
|
|
675
|
+
blockContentSection2 = blockContentSection2.slice(_selectedIndex + 1);
|
|
676
|
+
rearrangeSections(blockContentSection2, 0);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
};
|
|
680
|
+
rearrangeSections(blockContentSection2, 0);
|
|
681
|
+
//End: Generating intemediate Section if available
|
|
682
|
+
|
|
627
683
|
return React__default.createElement(
|
|
628
684
|
React__default.Fragment,
|
|
629
685
|
null,
|
|
630
|
-
React__default.createElement(
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
686
|
+
React__default.createElement(
|
|
687
|
+
'div',
|
|
688
|
+
{ 'class': 'clearfix' },
|
|
689
|
+
React__default.createElement(BlockContent, _extends({
|
|
690
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting),
|
|
691
|
+
blocks: blockContentSection1,
|
|
692
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
693
|
+
}, client.config()))
|
|
694
|
+
),
|
|
635
695
|
React__default.createElement('span', { className: 'clearfix' }),
|
|
636
696
|
React__default.createElement(
|
|
637
697
|
'div',
|
|
@@ -644,11 +704,25 @@ var Article = function Article(props) {
|
|
|
644
704
|
{ id: 'contextual-video-ad-' + payload._id, className: 'contextual-video-ad' },
|
|
645
705
|
React__default.createElement(DFPAdSlot, _extends({}, payload.contextualVideoAD, { refreshFlag: false, checkIsAdFound: checkIsVideoAdFound }))
|
|
646
706
|
),
|
|
647
|
-
React__default.createElement(
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
707
|
+
blockContentIntermediateSection.length > 0 && React__default.createElement(
|
|
708
|
+
'div',
|
|
709
|
+
{ 'class': 'clearfix' },
|
|
710
|
+
React__default.createElement(BlockContent, _extends({
|
|
711
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting),
|
|
712
|
+
blocks: blockContentIntermediateSection,
|
|
713
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
714
|
+
}, client.config()))
|
|
715
|
+
),
|
|
716
|
+
React__default.createElement(RelatedContent, null),
|
|
717
|
+
React__default.createElement(
|
|
718
|
+
'div',
|
|
719
|
+
{ 'class': 'clearfix' },
|
|
720
|
+
React__default.createElement(BlockContent, _extends({
|
|
721
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, null, null, null, targeting),
|
|
722
|
+
blocks: blockContentSection2,
|
|
723
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
724
|
+
}, client.config()))
|
|
725
|
+
)
|
|
652
726
|
);
|
|
653
727
|
} else if (indexes.length >= 2 && body.length >= 3 && payload.contextualAD && !payload.contextualVideoAD) {
|
|
654
728
|
payload = _extends({}, payload, {
|
|
@@ -665,7 +739,7 @@ var Article = function Article(props) {
|
|
|
665
739
|
}, { viewport: [0, 0], sizes: ['fluid', [300, 100]] }] : { viewport: [0, 0], sizes: ['fluid', [300, 100]] }
|
|
666
740
|
})
|
|
667
741
|
});
|
|
668
|
-
var
|
|
742
|
+
var _selectedIndex2 = indexes[1] + 1;
|
|
669
743
|
|
|
670
744
|
var _checkIsAdFound = function _checkIsAdFound(isFound, adData) {
|
|
671
745
|
if (!isFound) {
|
|
@@ -696,14 +770,41 @@ var Article = function Article(props) {
|
|
|
696
770
|
}
|
|
697
771
|
};
|
|
698
772
|
|
|
773
|
+
//Start: Generating intemediate Section if available
|
|
774
|
+
var _blockContentSection = articleBody.slice(0, _selectedIndex2);
|
|
775
|
+
var _blockContentSection2 = articleBody.slice(_selectedIndex2);
|
|
776
|
+
var _blockContentIntermediateSection = [];
|
|
777
|
+
var _rearrangeSections = function _rearrangeSections(arr, index) {
|
|
778
|
+
var item = arr[index];
|
|
779
|
+
if (item && item._type) {
|
|
780
|
+
if (item._type === 'block' && blocksToText([item]) === '') {
|
|
781
|
+
_rearrangeSections(arr, index + 1);
|
|
782
|
+
}
|
|
783
|
+
if (item._type !== 'block') {
|
|
784
|
+
var _selectedIndex3 = arr.findIndex(function (item1) {
|
|
785
|
+
return item1._key === item._key;
|
|
786
|
+
});
|
|
787
|
+
_blockContentIntermediateSection = [].concat(_toConsumableArray(_blockContentIntermediateSection), _toConsumableArray(arr.slice(0, _selectedIndex3 + 1)));
|
|
788
|
+
_blockContentSection2 = _blockContentSection2.slice(_selectedIndex3 + 1);
|
|
789
|
+
_rearrangeSections(_blockContentSection2, 0);
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
};
|
|
793
|
+
_rearrangeSections(_blockContentSection2, 0);
|
|
794
|
+
//End: Generating intemediate Section if available
|
|
795
|
+
|
|
699
796
|
return React__default.createElement(
|
|
700
797
|
React__default.Fragment,
|
|
701
798
|
null,
|
|
702
|
-
React__default.createElement(
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
799
|
+
React__default.createElement(
|
|
800
|
+
'div',
|
|
801
|
+
{ 'class': 'clearfix' },
|
|
802
|
+
React__default.createElement(BlockContent, _extends({
|
|
803
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting),
|
|
804
|
+
blocks: _blockContentSection,
|
|
805
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
806
|
+
}, client.config()))
|
|
807
|
+
),
|
|
707
808
|
contextualADFlag && React__default.createElement('span', { className: 'clearfix' }),
|
|
708
809
|
(visibleFlag || queueData && queueData.length === 1 || !props.infiniteScroll) && React__default.createElement(
|
|
709
810
|
'div',
|
|
@@ -711,11 +812,25 @@ var Article = function Article(props) {
|
|
|
711
812
|
React__default.createElement(DFPAdSlot, _extends({}, payload.contextualAD, { refreshFlag: false, checkIsAdFound: previewAd ? null : _checkIsAdFound }))
|
|
712
813
|
),
|
|
713
814
|
contextualADFlag && React__default.createElement('span', { className: 'clearfix' }),
|
|
714
|
-
React__default.createElement(
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
815
|
+
_blockContentIntermediateSection.length > 0 && React__default.createElement(
|
|
816
|
+
'div',
|
|
817
|
+
{ 'class': 'clearfix' },
|
|
818
|
+
React__default.createElement(BlockContent, _extends({
|
|
819
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting),
|
|
820
|
+
blocks: _blockContentIntermediateSection,
|
|
821
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
822
|
+
}, client.config()))
|
|
823
|
+
),
|
|
824
|
+
React__default.createElement(RelatedContent, null),
|
|
825
|
+
React__default.createElement(
|
|
826
|
+
'div',
|
|
827
|
+
{ 'class': 'clearfix' },
|
|
828
|
+
React__default.createElement(BlockContent, _extends({
|
|
829
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, null, null, null, targeting),
|
|
830
|
+
blocks: _blockContentSection2,
|
|
831
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
832
|
+
}, client.config()))
|
|
833
|
+
)
|
|
719
834
|
);
|
|
720
835
|
} else if (indexes.length >= 2 && body.length > 3 && payload.contextualVideoAD && !payload.contextualAD) {
|
|
721
836
|
payload = _extends({}, payload, {
|
|
@@ -723,7 +838,7 @@ var Article = function Article(props) {
|
|
|
723
838
|
slotId: (payload.contextualVideoAD.slotId || 'in-context_video') + '-' + payload._id
|
|
724
839
|
})
|
|
725
840
|
});
|
|
726
|
-
var
|
|
841
|
+
var _selectedIndex4 = indexes[1] + 1;
|
|
727
842
|
|
|
728
843
|
var _checkIsAdFound2 = function _checkIsAdFound2(isFound) {
|
|
729
844
|
if (!isFound) {
|
|
@@ -739,25 +854,114 @@ var Article = function Article(props) {
|
|
|
739
854
|
}
|
|
740
855
|
};
|
|
741
856
|
|
|
857
|
+
//Start: Generating intemediate Section if available
|
|
858
|
+
var _blockContentSection3 = articleBody.slice(0, _selectedIndex4);
|
|
859
|
+
var _blockContentSection4 = articleBody.slice(_selectedIndex4);
|
|
860
|
+
var _blockContentIntermediateSection2 = [];
|
|
861
|
+
var _rearrangeSections2 = function _rearrangeSections2(arr, index) {
|
|
862
|
+
var item = arr[index];
|
|
863
|
+
if (item && item._type) {
|
|
864
|
+
if (item._type === 'block' && blocksToText([item]) === '') {
|
|
865
|
+
_rearrangeSections2(arr, index + 1);
|
|
866
|
+
}
|
|
867
|
+
if (item._type !== 'block') {
|
|
868
|
+
var _selectedIndex5 = arr.findIndex(function (item1) {
|
|
869
|
+
return item1._key === item._key;
|
|
870
|
+
});
|
|
871
|
+
_blockContentIntermediateSection2 = [].concat(_toConsumableArray(_blockContentIntermediateSection2), _toConsumableArray(arr.slice(0, _selectedIndex5 + 1)));
|
|
872
|
+
_blockContentSection4 = _blockContentSection4.slice(_selectedIndex5 + 1);
|
|
873
|
+
_rearrangeSections2(_blockContentSection4, 0);
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
};
|
|
877
|
+
_rearrangeSections2(_blockContentSection4, 0);
|
|
878
|
+
//End: Generating intemediate Section if available
|
|
879
|
+
|
|
742
880
|
return React__default.createElement(
|
|
743
881
|
React__default.Fragment,
|
|
744
882
|
null,
|
|
745
|
-
React__default.createElement(
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
883
|
+
React__default.createElement(
|
|
884
|
+
'div',
|
|
885
|
+
{ 'class': 'clearfix' },
|
|
886
|
+
React__default.createElement(BlockContent, _extends({
|
|
887
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting),
|
|
888
|
+
blocks: _blockContentSection3,
|
|
889
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
890
|
+
}, client.config()))
|
|
891
|
+
),
|
|
750
892
|
React__default.createElement('span', { className: 'clearfix' }),
|
|
751
893
|
React__default.createElement(
|
|
752
894
|
'div',
|
|
753
895
|
{ id: 'contextual-video-ad-' + payload._id, className: 'contextual-video-ad' },
|
|
754
896
|
React__default.createElement(DFPAdSlot, _extends({}, payload.contextualVideoAD, { refreshFlag: false, checkIsAdFound: _checkIsAdFound2 }))
|
|
755
897
|
),
|
|
756
|
-
React__default.createElement(
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
898
|
+
_blockContentIntermediateSection2.length > 0 && React__default.createElement(
|
|
899
|
+
'div',
|
|
900
|
+
{ 'class': 'clearfix' },
|
|
901
|
+
React__default.createElement(BlockContent, _extends({
|
|
902
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting),
|
|
903
|
+
blocks: _blockContentIntermediateSection2,
|
|
904
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
905
|
+
}, client.config()))
|
|
906
|
+
),
|
|
907
|
+
React__default.createElement(RelatedContent, null),
|
|
908
|
+
React__default.createElement(
|
|
909
|
+
'div',
|
|
910
|
+
{ 'class': 'clearfix' },
|
|
911
|
+
React__default.createElement(BlockContent, _extends({
|
|
912
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, null, null, null, targeting),
|
|
913
|
+
blocks: _blockContentSection4,
|
|
914
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
915
|
+
}, client.config()))
|
|
916
|
+
)
|
|
917
|
+
);
|
|
918
|
+
} else if (indexes.length >= 2 && body.length > 3 && showRelatedArticles) {
|
|
919
|
+
var _selectedIndex6 = indexes[1] + 1;
|
|
920
|
+
|
|
921
|
+
//Start: Rearranging sections
|
|
922
|
+
var _blockContentSection5 = articleBody.slice(0, _selectedIndex6);
|
|
923
|
+
var _blockContentSection6 = articleBody.slice(_selectedIndex6);
|
|
924
|
+
var _rearrangeSections3 = function _rearrangeSections3(arr, index) {
|
|
925
|
+
var item = arr[index];
|
|
926
|
+
if (item && item._type) {
|
|
927
|
+
if (item._type === 'block' && blocksToText([item]) === '') {
|
|
928
|
+
_rearrangeSections3(arr, index + 1);
|
|
929
|
+
}
|
|
930
|
+
if (item._type !== 'block') {
|
|
931
|
+
var _selectedIndex7 = arr.findIndex(function (item1) {
|
|
932
|
+
return item1._key === item._key;
|
|
933
|
+
});
|
|
934
|
+
_blockContentSection5 = [].concat(_toConsumableArray(_blockContentSection5), _toConsumableArray(arr.slice(0, _selectedIndex7 + 1)));
|
|
935
|
+
_blockContentSection6 = _blockContentSection6.slice(_selectedIndex7 + 1);
|
|
936
|
+
_rearrangeSections3(_blockContentSection6, 0);
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
};
|
|
940
|
+
_rearrangeSections3(_blockContentSection6, 0);
|
|
941
|
+
//End: Rearranging sections
|
|
942
|
+
|
|
943
|
+
return React__default.createElement(
|
|
944
|
+
React__default.Fragment,
|
|
945
|
+
null,
|
|
946
|
+
React__default.createElement(
|
|
947
|
+
'div',
|
|
948
|
+
{ 'class': 'clearfix' },
|
|
949
|
+
React__default.createElement(BlockContent, _extends({
|
|
950
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting),
|
|
951
|
+
blocks: _blockContentSection5,
|
|
952
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
953
|
+
}, client.config()))
|
|
954
|
+
),
|
|
955
|
+
React__default.createElement(RelatedContent, null),
|
|
956
|
+
React__default.createElement(
|
|
957
|
+
'div',
|
|
958
|
+
{ 'class': 'clearfix' },
|
|
959
|
+
React__default.createElement(BlockContent, _extends({
|
|
960
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, null, null, null, targeting),
|
|
961
|
+
blocks: _blockContentSection6,
|
|
962
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
963
|
+
}, client.config()))
|
|
964
|
+
)
|
|
761
965
|
);
|
|
762
966
|
} else {
|
|
763
967
|
return React__default.createElement(BlockContent, _extends({
|
|
@@ -946,7 +1150,7 @@ var Article = function Article(props) {
|
|
|
946
1150
|
React__default.createElement(
|
|
947
1151
|
'div',
|
|
948
1152
|
{ className: 'ad-box', style: { textAlign: 'center' } },
|
|
949
|
-
|
|
1153
|
+
main_36 && !sponsoredFlag && props.article.Ads && props.article.Ads.length > 0 && props.article.Ads.map(function (ad, index) {
|
|
950
1154
|
if (index === 0) {
|
|
951
1155
|
return React__default.createElement(
|
|
952
1156
|
'div',
|
|
@@ -998,21 +1202,7 @@ var Article = function Article(props) {
|
|
|
998
1202
|
issue.name
|
|
999
1203
|
)
|
|
1000
1204
|
),
|
|
1001
|
-
React__default.createElement('div', { className: 'clearfix', style: { minHeight: '1px' } })
|
|
1002
|
-
showRelatedArticles && !showIsi && React__default.createElement(
|
|
1003
|
-
React__default.Fragment,
|
|
1004
|
-
null,
|
|
1005
|
-
React__default.createElement(
|
|
1006
|
-
'div',
|
|
1007
|
-
null,
|
|
1008
|
-
React__default.createElement(RelevantTopics, null)
|
|
1009
|
-
),
|
|
1010
|
-
React__default.createElement(
|
|
1011
|
-
'div',
|
|
1012
|
-
{ className: 'pt-2' },
|
|
1013
|
-
React__default.createElement(RelatedArticle, { articles: article.relatedArticle, client: client })
|
|
1014
|
-
)
|
|
1015
|
-
)
|
|
1205
|
+
React__default.createElement('div', { className: 'clearfix', style: { minHeight: '1px' } })
|
|
1016
1206
|
),
|
|
1017
1207
|
renderIsiContent(props.article)
|
|
1018
1208
|
),
|
|
@@ -1025,7 +1215,7 @@ var Article = function Article(props) {
|
|
|
1025
1215
|
})
|
|
1026
1216
|
)
|
|
1027
1217
|
),
|
|
1028
|
-
|
|
1218
|
+
main_36 && !sponsoredFlag && props.article.Ads && props.article.Ads.length > 0 && props.article.Ads.map(function (ad, index) {
|
|
1029
1219
|
if (index > 0) {
|
|
1030
1220
|
return React__default.createElement(
|
|
1031
1221
|
'div',
|
|
@@ -1065,6 +1255,201 @@ var Article = function Article(props) {
|
|
|
1065
1255
|
|
|
1066
1256
|
var _this = undefined;
|
|
1067
1257
|
|
|
1258
|
+
var getRelatedContentArticles = function () {
|
|
1259
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
|
|
1260
|
+
var client = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
1261
|
+
var article = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1262
|
+
var prevUrl = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '/';
|
|
1263
|
+
var articleCount = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
1264
|
+
|
|
1265
|
+
var _article$url, url, content_placement, documentGroupMapping, issueGroup, references, params, articles, relatedContentQuery;
|
|
1266
|
+
|
|
1267
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
1268
|
+
while (1) {
|
|
1269
|
+
switch (_context.prev = _context.next) {
|
|
1270
|
+
case 0:
|
|
1271
|
+
_article$url = article.url;
|
|
1272
|
+
_article$url = _article$url === undefined ? {
|
|
1273
|
+
current: null
|
|
1274
|
+
} : _article$url;
|
|
1275
|
+
url = _article$url.current, content_placement = article.content_placement, documentGroupMapping = article.documentGroupMapping, issueGroup = article.issueGroup;
|
|
1276
|
+
references = [];
|
|
1277
|
+
|
|
1278
|
+
if (content_placement && content_placement.length > 0) {
|
|
1279
|
+
content_placement.forEach(function (_ref2) {
|
|
1280
|
+
var path = _ref2.path,
|
|
1281
|
+
_id = _ref2._id;
|
|
1282
|
+
|
|
1283
|
+
if (!_id || typeof _id == 'undefined') {
|
|
1284
|
+
return null;
|
|
1285
|
+
}
|
|
1286
|
+
var prev_url_to_check = prevUrl;
|
|
1287
|
+
if (prev_url_to_check.includes('?')) {
|
|
1288
|
+
prev_url_to_check = prev_url_to_check.split('?')[0];
|
|
1289
|
+
}
|
|
1290
|
+
if (prev_url_to_check.endsWith(path) && _id) references.push(_id);
|
|
1291
|
+
});
|
|
1292
|
+
if (references.length === 0) {
|
|
1293
|
+
content_placement.filter(function (_ref3) {
|
|
1294
|
+
var identifier = _ref3.identifier;
|
|
1295
|
+
return identifier !== 'news';
|
|
1296
|
+
}).forEach(function (_ref4) {
|
|
1297
|
+
var _id = _ref4._id;
|
|
1298
|
+
|
|
1299
|
+
if (_id) references.push(_id);
|
|
1300
|
+
});
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
if (documentGroupMapping && documentGroupMapping.length > 0) {
|
|
1305
|
+
documentGroupMapping.forEach(function (_ref5) {
|
|
1306
|
+
var _id = _ref5._id;
|
|
1307
|
+
|
|
1308
|
+
if (_id) references.push(_id);
|
|
1309
|
+
});
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
if (issueGroup && issueGroup._ref) {
|
|
1313
|
+
references.push(issueGroup._ref);
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
params = { url: url, references: references };
|
|
1317
|
+
articles = [];
|
|
1318
|
+
|
|
1319
|
+
if (!(params.references && params.references.length > 0)) {
|
|
1320
|
+
_context.next = 20;
|
|
1321
|
+
break;
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
relatedContentQuery = '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && passwordLock != true\n && taxonomyMapping[].disableAds != \'true\'\n && contentCategory.name != \'Poll\'\n && contentCategory.name != \'Slideshows\'\n \t&& contentCategory.disableAds != \'true\'\n && ExcludeFromInfiniteScroll != true\n && url.current != $url\n && !defined(body[].videos)\n && dateTime(published) <= dateTime(now())\n && references($references)\n ]| order(published desc)[' + articleCount + ']\n {\n title,\n url,\n thumbnail\n }';
|
|
1325
|
+
_context.prev = 11;
|
|
1326
|
+
_context.next = 14;
|
|
1327
|
+
return client.fetch(relatedContentQuery, params);
|
|
1328
|
+
|
|
1329
|
+
case 14:
|
|
1330
|
+
articles = _context.sent;
|
|
1331
|
+
_context.next = 20;
|
|
1332
|
+
break;
|
|
1333
|
+
|
|
1334
|
+
case 17:
|
|
1335
|
+
_context.prev = 17;
|
|
1336
|
+
_context.t0 = _context['catch'](11);
|
|
1337
|
+
|
|
1338
|
+
console.error(_context.t0);
|
|
1339
|
+
|
|
1340
|
+
case 20:
|
|
1341
|
+
return _context.abrupt('return', articles);
|
|
1342
|
+
|
|
1343
|
+
case 21:
|
|
1344
|
+
case 'end':
|
|
1345
|
+
return _context.stop();
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
}, _callee, _this, [[11, 17]]);
|
|
1349
|
+
}));
|
|
1350
|
+
|
|
1351
|
+
return function getRelatedContentArticles() {
|
|
1352
|
+
return _ref.apply(this, arguments);
|
|
1353
|
+
};
|
|
1354
|
+
}();
|
|
1355
|
+
|
|
1356
|
+
// const getRelatedContents = async (ctx = null, client = null, article = {}, prevUrl = '/', articleCount = 0) => {
|
|
1357
|
+
// const {
|
|
1358
|
+
// url: { current: url } = {
|
|
1359
|
+
// current: null
|
|
1360
|
+
// },
|
|
1361
|
+
// content_placement,
|
|
1362
|
+
// documentGroupMapping,
|
|
1363
|
+
// issueGroup
|
|
1364
|
+
// } = article
|
|
1365
|
+
// let params = { url }
|
|
1366
|
+
// let conditions = ''
|
|
1367
|
+
|
|
1368
|
+
// if (content_placement && content_placement.length > 0) {
|
|
1369
|
+
// let taxonomy = []
|
|
1370
|
+
// content_placement.forEach(({ path, _id }) => {
|
|
1371
|
+
// if (!_id || typeof _id == 'undefined') {
|
|
1372
|
+
// return null
|
|
1373
|
+
// }
|
|
1374
|
+
// let prev_url_to_check = prevUrl
|
|
1375
|
+
// if (prev_url_to_check.includes('?')) {
|
|
1376
|
+
// prev_url_to_check = prev_url_to_check.split('?')[0]
|
|
1377
|
+
// }
|
|
1378
|
+
// if (prev_url_to_check.endsWith(path) && _id) taxonomy.push(_id)
|
|
1379
|
+
// })
|
|
1380
|
+
// if (taxonomy.length === 0) {
|
|
1381
|
+
// content_placement
|
|
1382
|
+
// .filter(({ identifier }) => identifier !== 'news')
|
|
1383
|
+
// .forEach(({ _id }) => {
|
|
1384
|
+
// if (_id) taxonomy.push(_id)
|
|
1385
|
+
// })
|
|
1386
|
+
// }
|
|
1387
|
+
// if (taxonomy.length > 0) {
|
|
1388
|
+
// params = { ...params, taxonomy }
|
|
1389
|
+
// conditions = `&& taxonomyMapping[]._ref in $taxonomy`
|
|
1390
|
+
// }
|
|
1391
|
+
// }
|
|
1392
|
+
|
|
1393
|
+
// if (documentGroupMapping && documentGroupMapping.length > 0) {
|
|
1394
|
+
// let documentGroup = []
|
|
1395
|
+
// documentGroupMapping.forEach(({ _id }) => {
|
|
1396
|
+
// if (_id) documentGroup.push(_id)
|
|
1397
|
+
// })
|
|
1398
|
+
// if (params.taxonomy && documentGroup.length > 0) {
|
|
1399
|
+
// params = { ...params, documentGroup }
|
|
1400
|
+
// conditions = `&& (taxonomyMapping[]._ref in $taxonomy || documentGroupMapping[]._ref in $documentGroup)`
|
|
1401
|
+
// }
|
|
1402
|
+
// }
|
|
1403
|
+
|
|
1404
|
+
// if (issueGroup && issueGroup._ref) {
|
|
1405
|
+
// if (params.taxonomy && params.documentGroup) {
|
|
1406
|
+
// params = { ...params, issueAssociation: issueGroup._ref }
|
|
1407
|
+
// conditions = `&& (taxonomyMapping[]._ref in $taxonomy || documentGroupMapping[]._ref in $documentGroup || issueGroup._ref == $issueAssociation )`
|
|
1408
|
+
// } else if (params.taxonomy) {
|
|
1409
|
+
// params = { ...params, issueAssociation: issueGroup._ref }
|
|
1410
|
+
// conditions = `&& (taxonomyMapping[]._ref in $taxonomy || issueGroup._ref == $issueAssociation )`
|
|
1411
|
+
// }
|
|
1412
|
+
// }
|
|
1413
|
+
|
|
1414
|
+
// let articles = []
|
|
1415
|
+
// if (params.taxonomy && params.taxonomy.length > 0) {
|
|
1416
|
+
// const relatedContentQuery = `*[
|
|
1417
|
+
// _type == "article"
|
|
1418
|
+
// && defined(title)
|
|
1419
|
+
// && defined(url)
|
|
1420
|
+
// && !(_id in path("drafts.**"))
|
|
1421
|
+
// && is_visible == true
|
|
1422
|
+
// && passwordLock != true
|
|
1423
|
+
// && taxonomyMapping[].disableAds != 'true'
|
|
1424
|
+
// && contentCategory.name != 'Poll'
|
|
1425
|
+
// && contentCategory.name != 'Slideshows'
|
|
1426
|
+
// && contentCategory.disableAds != 'true'
|
|
1427
|
+
// && ExcludeFromInfiniteScroll != true
|
|
1428
|
+
// && url.current != $url
|
|
1429
|
+
// && !defined(body[].videos)
|
|
1430
|
+
// && published <= '${new Date().toISOString()}'
|
|
1431
|
+
// ${conditions}
|
|
1432
|
+
// ]| order(published desc)[${articleCount}]
|
|
1433
|
+
// {
|
|
1434
|
+
// title,
|
|
1435
|
+
// url,
|
|
1436
|
+
// thumbnail
|
|
1437
|
+
// }`
|
|
1438
|
+
|
|
1439
|
+
// try {
|
|
1440
|
+
// articles = await client.fetch(relatedContentQuery, params)
|
|
1441
|
+
// } catch (error) {
|
|
1442
|
+
// console.error(error)
|
|
1443
|
+
// }
|
|
1444
|
+
// }
|
|
1445
|
+
|
|
1446
|
+
// return articles
|
|
1447
|
+
// }
|
|
1448
|
+
|
|
1449
|
+
// export default getRelatedContents
|
|
1450
|
+
|
|
1451
|
+
var _this$1 = undefined;
|
|
1452
|
+
|
|
1068
1453
|
var ArticleQueue = function ArticleQueue(props) {
|
|
1069
1454
|
var _props$prevUrl = props.prevUrl,
|
|
1070
1455
|
prevUrl = _props$prevUrl === undefined ? '/' : _props$prevUrl,
|
|
@@ -1098,7 +1483,7 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1098
1483
|
});
|
|
1099
1484
|
var targeting = getTargeting({ article: activeArticle, cpModificationRequired: cpModificationRequired, position: props.position, prevUrl: prevUrl });
|
|
1100
1485
|
|
|
1101
|
-
if (!
|
|
1486
|
+
if (!main_36) {
|
|
1102
1487
|
lib_3.getGoogletag().then(function (googletag) {
|
|
1103
1488
|
if (window.googletag && googletag.pubadsReady) {
|
|
1104
1489
|
var slots = googletag.pubads().getSlots();
|
|
@@ -1116,7 +1501,7 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1116
1501
|
});
|
|
1117
1502
|
}
|
|
1118
1503
|
//Refresh leaderboard ad on mobile
|
|
1119
|
-
if (
|
|
1504
|
+
if (main_36) {
|
|
1120
1505
|
var leaderboardSlotId = '';
|
|
1121
1506
|
lib_3.getGoogletag().then(function (googletag) {
|
|
1122
1507
|
if (window.googletag && googletag.pubadsReady) {
|
|
@@ -1190,7 +1575,7 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1190
1575
|
switch (_context.prev = _context.next) {
|
|
1191
1576
|
case 0:
|
|
1192
1577
|
if (!(article && article._id)) {
|
|
1193
|
-
_context.next =
|
|
1578
|
+
_context.next = 12;
|
|
1194
1579
|
break;
|
|
1195
1580
|
}
|
|
1196
1581
|
|
|
@@ -1202,17 +1587,22 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1202
1587
|
|
|
1203
1588
|
case 5:
|
|
1204
1589
|
article.relatedArticle = _context.sent;
|
|
1590
|
+
_context.next = 8;
|
|
1591
|
+
return getRelatedContentArticles(null, props.client, article, prevUrl, startingIndex + '..' + endingIndex);
|
|
1592
|
+
|
|
1593
|
+
case 8:
|
|
1594
|
+
article.relatedContentArticles = _context.sent;
|
|
1205
1595
|
targeting = getTargeting({ article: article, cpModificationRequired: cpModificationRequired, prevUrl: prevUrl });
|
|
1206
1596
|
|
|
1207
1597
|
article.Ads = Ads.getRightItems(targeting);
|
|
1208
1598
|
setQueueData([].concat(_toConsumableArray(queueData), [article]));
|
|
1209
1599
|
|
|
1210
|
-
case
|
|
1600
|
+
case 12:
|
|
1211
1601
|
case 'end':
|
|
1212
1602
|
return _context.stop();
|
|
1213
1603
|
}
|
|
1214
1604
|
}
|
|
1215
|
-
}, _callee, _this);
|
|
1605
|
+
}, _callee, _this$1);
|
|
1216
1606
|
}));
|
|
1217
1607
|
|
|
1218
1608
|
return function (_x) {
|
|
@@ -1360,7 +1750,7 @@ var Articles = function Articles(props) {
|
|
|
1360
1750
|
}, _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), _defineProperty(_extends2, 'canonicalTag', canonicalTag), _extends2), props));
|
|
1361
1751
|
};
|
|
1362
1752
|
|
|
1363
|
-
var _this$
|
|
1753
|
+
var _this$2 = undefined;
|
|
1364
1754
|
|
|
1365
1755
|
var View = function View(props) {
|
|
1366
1756
|
var router = useRouter();
|
|
@@ -1619,12 +2009,12 @@ View.returnGetInitialProps = function () {
|
|
|
1619
2009
|
}
|
|
1620
2010
|
|
|
1621
2011
|
article.relatedArticle = null;
|
|
1622
|
-
_context.next =
|
|
2012
|
+
_context.next = 23;
|
|
1623
2013
|
break;
|
|
1624
2014
|
|
|
1625
2015
|
case 16:
|
|
1626
2016
|
if (!article) {
|
|
1627
|
-
_context.next =
|
|
2017
|
+
_context.next = 23;
|
|
1628
2018
|
break;
|
|
1629
2019
|
}
|
|
1630
2020
|
|
|
@@ -1633,8 +2023,13 @@ View.returnGetInitialProps = function () {
|
|
|
1633
2023
|
|
|
1634
2024
|
case 19:
|
|
1635
2025
|
article.relatedArticle = _context.sent;
|
|
2026
|
+
_context.next = 22;
|
|
2027
|
+
return getRelatedContentArticles(context, client, article, prevUrl, '0..2');
|
|
1636
2028
|
|
|
1637
|
-
case
|
|
2029
|
+
case 22:
|
|
2030
|
+
article.relatedContentArticles = _context.sent;
|
|
2031
|
+
|
|
2032
|
+
case 23:
|
|
1638
2033
|
return _context.abrupt('return', {
|
|
1639
2034
|
url: url,
|
|
1640
2035
|
sao: sao,
|
|
@@ -1645,12 +2040,12 @@ View.returnGetInitialProps = function () {
|
|
|
1645
2040
|
sponsoredFlag: sponsoredFlag
|
|
1646
2041
|
});
|
|
1647
2042
|
|
|
1648
|
-
case
|
|
2043
|
+
case 24:
|
|
1649
2044
|
case 'end':
|
|
1650
2045
|
return _context.stop();
|
|
1651
2046
|
}
|
|
1652
2047
|
}
|
|
1653
|
-
}, _callee, _this$
|
|
2048
|
+
}, _callee, _this$2);
|
|
1654
2049
|
}));
|
|
1655
2050
|
|
|
1656
2051
|
return function (_x, _x2, _x3, _x4, _x5) {
|