@mjhls/mjh-framework 1.0.683 → 1.0.684-beta.0
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 +486 -119
- 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 +460 -93
- 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,12 +656,36 @@ 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
686
|
React__default.createElement(BlockContent, _extends({
|
|
631
687
|
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting),
|
|
632
|
-
blocks:
|
|
688
|
+
blocks: blockContentSection1,
|
|
633
689
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
634
690
|
}, client.config())),
|
|
635
691
|
React__default.createElement('span', { className: 'clearfix' }),
|
|
@@ -644,9 +700,20 @@ var Article = function Article(props) {
|
|
|
644
700
|
{ id: 'contextual-video-ad-' + payload._id, className: 'contextual-video-ad' },
|
|
645
701
|
React__default.createElement(DFPAdSlot, _extends({}, payload.contextualVideoAD, { refreshFlag: false, checkIsAdFound: checkIsVideoAdFound }))
|
|
646
702
|
),
|
|
703
|
+
blockContentIntermediateSection.length > 0 && React__default.createElement(
|
|
704
|
+
React__default.Fragment,
|
|
705
|
+
null,
|
|
706
|
+
React__default.createElement(BlockContent, _extends({
|
|
707
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting),
|
|
708
|
+
blocks: blockContentIntermediateSection,
|
|
709
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
710
|
+
}, client.config())),
|
|
711
|
+
React__default.createElement('span', { className: 'clearfix' })
|
|
712
|
+
),
|
|
713
|
+
React__default.createElement(RelatedContent, null),
|
|
647
714
|
React__default.createElement(BlockContent, _extends({
|
|
648
715
|
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, null, null, null, targeting),
|
|
649
|
-
blocks:
|
|
716
|
+
blocks: blockContentSection2,
|
|
650
717
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
651
718
|
}, client.config()))
|
|
652
719
|
);
|
|
@@ -665,7 +732,7 @@ var Article = function Article(props) {
|
|
|
665
732
|
}, { viewport: [0, 0], sizes: ['fluid', [300, 100]] }] : { viewport: [0, 0], sizes: ['fluid', [300, 100]] }
|
|
666
733
|
})
|
|
667
734
|
});
|
|
668
|
-
var
|
|
735
|
+
var _selectedIndex2 = indexes[1] + 1;
|
|
669
736
|
|
|
670
737
|
var _checkIsAdFound = function _checkIsAdFound(isFound, adData) {
|
|
671
738
|
if (!isFound) {
|
|
@@ -696,12 +763,35 @@ var Article = function Article(props) {
|
|
|
696
763
|
}
|
|
697
764
|
};
|
|
698
765
|
|
|
766
|
+
//Start: Generating intemediate Section if available
|
|
767
|
+
var _blockContentSection = articleBody.slice(0, _selectedIndex2);
|
|
768
|
+
var _blockContentSection2 = articleBody.slice(_selectedIndex2);
|
|
769
|
+
var _blockContentIntermediateSection = [];
|
|
770
|
+
var _rearrangeSections = function _rearrangeSections(arr, index) {
|
|
771
|
+
var item = arr[index];
|
|
772
|
+
if (item && item._type) {
|
|
773
|
+
if (item._type === 'block' && blocksToText([item]) === '') {
|
|
774
|
+
_rearrangeSections(arr, index + 1);
|
|
775
|
+
}
|
|
776
|
+
if (item._type !== 'block') {
|
|
777
|
+
var _selectedIndex3 = arr.findIndex(function (item1) {
|
|
778
|
+
return item1._key === item._key;
|
|
779
|
+
});
|
|
780
|
+
_blockContentIntermediateSection = [].concat(_toConsumableArray(_blockContentIntermediateSection), _toConsumableArray(arr.slice(0, _selectedIndex3 + 1)));
|
|
781
|
+
_blockContentSection2 = _blockContentSection2.slice(_selectedIndex3 + 1);
|
|
782
|
+
_rearrangeSections(_blockContentSection2, 0);
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
};
|
|
786
|
+
_rearrangeSections(_blockContentSection2, 0);
|
|
787
|
+
//End: Generating intemediate Section if available
|
|
788
|
+
|
|
699
789
|
return React__default.createElement(
|
|
700
790
|
React__default.Fragment,
|
|
701
791
|
null,
|
|
702
792
|
React__default.createElement(BlockContent, _extends({
|
|
703
793
|
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting),
|
|
704
|
-
blocks:
|
|
794
|
+
blocks: _blockContentSection,
|
|
705
795
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
706
796
|
}, client.config())),
|
|
707
797
|
contextualADFlag && React__default.createElement('span', { className: 'clearfix' }),
|
|
@@ -711,9 +801,20 @@ var Article = function Article(props) {
|
|
|
711
801
|
React__default.createElement(DFPAdSlot, _extends({}, payload.contextualAD, { refreshFlag: false, checkIsAdFound: previewAd ? null : _checkIsAdFound }))
|
|
712
802
|
),
|
|
713
803
|
contextualADFlag && React__default.createElement('span', { className: 'clearfix' }),
|
|
804
|
+
_blockContentIntermediateSection.length > 0 && React__default.createElement(
|
|
805
|
+
React__default.Fragment,
|
|
806
|
+
null,
|
|
807
|
+
React__default.createElement(BlockContent, _extends({
|
|
808
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting),
|
|
809
|
+
blocks: _blockContentIntermediateSection,
|
|
810
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
811
|
+
}, client.config())),
|
|
812
|
+
React__default.createElement('span', { className: 'clearfix' })
|
|
813
|
+
),
|
|
814
|
+
React__default.createElement(RelatedContent, null),
|
|
714
815
|
React__default.createElement(BlockContent, _extends({
|
|
715
816
|
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, null, null, null, targeting),
|
|
716
|
-
blocks:
|
|
817
|
+
blocks: _blockContentSection2,
|
|
717
818
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
718
819
|
}, client.config()))
|
|
719
820
|
);
|
|
@@ -723,7 +824,7 @@ var Article = function Article(props) {
|
|
|
723
824
|
slotId: (payload.contextualVideoAD.slotId || 'in-context_video') + '-' + payload._id
|
|
724
825
|
})
|
|
725
826
|
});
|
|
726
|
-
var
|
|
827
|
+
var _selectedIndex4 = indexes[1] + 1;
|
|
727
828
|
|
|
728
829
|
var _checkIsAdFound2 = function _checkIsAdFound2(isFound) {
|
|
729
830
|
if (!isFound) {
|
|
@@ -739,12 +840,35 @@ var Article = function Article(props) {
|
|
|
739
840
|
}
|
|
740
841
|
};
|
|
741
842
|
|
|
843
|
+
//Start: Generating intemediate Section if available
|
|
844
|
+
var _blockContentSection3 = articleBody.slice(0, _selectedIndex4);
|
|
845
|
+
var _blockContentSection4 = articleBody.slice(_selectedIndex4);
|
|
846
|
+
var _blockContentIntermediateSection2 = [];
|
|
847
|
+
var _rearrangeSections2 = function _rearrangeSections2(arr, index) {
|
|
848
|
+
var item = arr[index];
|
|
849
|
+
if (item && item._type) {
|
|
850
|
+
if (item._type === 'block' && blocksToText([item]) === '') {
|
|
851
|
+
_rearrangeSections2(arr, index + 1);
|
|
852
|
+
}
|
|
853
|
+
if (item._type !== 'block') {
|
|
854
|
+
var _selectedIndex5 = arr.findIndex(function (item1) {
|
|
855
|
+
return item1._key === item._key;
|
|
856
|
+
});
|
|
857
|
+
_blockContentIntermediateSection2 = [].concat(_toConsumableArray(_blockContentIntermediateSection2), _toConsumableArray(arr.slice(0, _selectedIndex5 + 1)));
|
|
858
|
+
_blockContentSection4 = _blockContentSection4.slice(_selectedIndex5 + 1);
|
|
859
|
+
_rearrangeSections2(_blockContentSection4, 0);
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
};
|
|
863
|
+
_rearrangeSections2(_blockContentSection4, 0);
|
|
864
|
+
//End: Generating intemediate Section if available
|
|
865
|
+
|
|
742
866
|
return React__default.createElement(
|
|
743
867
|
React__default.Fragment,
|
|
744
868
|
null,
|
|
745
869
|
React__default.createElement(BlockContent, _extends({
|
|
746
870
|
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting),
|
|
747
|
-
blocks:
|
|
871
|
+
blocks: _blockContentSection3,
|
|
748
872
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
749
873
|
}, client.config())),
|
|
750
874
|
React__default.createElement('span', { className: 'clearfix' }),
|
|
@@ -753,9 +877,61 @@ var Article = function Article(props) {
|
|
|
753
877
|
{ id: 'contextual-video-ad-' + payload._id, className: 'contextual-video-ad' },
|
|
754
878
|
React__default.createElement(DFPAdSlot, _extends({}, payload.contextualVideoAD, { refreshFlag: false, checkIsAdFound: _checkIsAdFound2 }))
|
|
755
879
|
),
|
|
880
|
+
_blockContentIntermediateSection2.length > 0 && React__default.createElement(
|
|
881
|
+
React__default.Fragment,
|
|
882
|
+
null,
|
|
883
|
+
React__default.createElement(BlockContent, _extends({
|
|
884
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting),
|
|
885
|
+
blocks: _blockContentIntermediateSection2,
|
|
886
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
887
|
+
}, client.config())),
|
|
888
|
+
React__default.createElement('span', { className: 'clearfix' })
|
|
889
|
+
),
|
|
890
|
+
React__default.createElement(RelatedContent, null),
|
|
891
|
+
React__default.createElement(BlockContent, _extends({
|
|
892
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, null, null, null, targeting),
|
|
893
|
+
blocks: _blockContentSection4,
|
|
894
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
895
|
+
}, client.config()))
|
|
896
|
+
);
|
|
897
|
+
} else if (indexes.length >= 2 && body.length > 3 && showRelatedArticles) {
|
|
898
|
+
var _selectedIndex6 = indexes[1] + 1;
|
|
899
|
+
|
|
900
|
+
//Start: Rearranging sections
|
|
901
|
+
var _blockContentSection5 = articleBody.slice(0, _selectedIndex6);
|
|
902
|
+
var _blockContentSection6 = articleBody.slice(_selectedIndex6);
|
|
903
|
+
var _rearrangeSections3 = function _rearrangeSections3(arr, index) {
|
|
904
|
+
var item = arr[index];
|
|
905
|
+
if (item && item._type) {
|
|
906
|
+
if (item._type === 'block' && blocksToText([item]) === '') {
|
|
907
|
+
_rearrangeSections3(arr, index + 1);
|
|
908
|
+
}
|
|
909
|
+
if (item._type !== 'block') {
|
|
910
|
+
var _selectedIndex7 = arr.findIndex(function (item1) {
|
|
911
|
+
return item1._key === item._key;
|
|
912
|
+
});
|
|
913
|
+
_blockContentSection5 = [].concat(_toConsumableArray(_blockContentSection5), _toConsumableArray(arr.slice(0, _selectedIndex7 + 1)));
|
|
914
|
+
_blockContentSection6 = _blockContentSection6.slice(_selectedIndex7 + 1);
|
|
915
|
+
_rearrangeSections3(_blockContentSection6, 0);
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
};
|
|
919
|
+
_rearrangeSections3(_blockContentSection6, 0);
|
|
920
|
+
//End: Rearranging sections
|
|
921
|
+
|
|
922
|
+
return React__default.createElement(
|
|
923
|
+
React__default.Fragment,
|
|
924
|
+
null,
|
|
925
|
+
React__default.createElement(BlockContent, _extends({
|
|
926
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting),
|
|
927
|
+
blocks: _blockContentSection5,
|
|
928
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
929
|
+
}, client.config())),
|
|
930
|
+
React__default.createElement('span', { className: 'clearfix' }),
|
|
931
|
+
React__default.createElement(RelatedContent, null),
|
|
756
932
|
React__default.createElement(BlockContent, _extends({
|
|
757
933
|
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, null, null, null, targeting),
|
|
758
|
-
blocks:
|
|
934
|
+
blocks: _blockContentSection6,
|
|
759
935
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
760
936
|
}, client.config()))
|
|
761
937
|
);
|
|
@@ -946,7 +1122,7 @@ var Article = function Article(props) {
|
|
|
946
1122
|
React__default.createElement(
|
|
947
1123
|
'div',
|
|
948
1124
|
{ className: 'ad-box', style: { textAlign: 'center' } },
|
|
949
|
-
|
|
1125
|
+
main_36 && !sponsoredFlag && props.article.Ads && props.article.Ads.length > 0 && props.article.Ads.map(function (ad, index) {
|
|
950
1126
|
if (index === 0) {
|
|
951
1127
|
return React__default.createElement(
|
|
952
1128
|
'div',
|
|
@@ -998,21 +1174,7 @@ var Article = function Article(props) {
|
|
|
998
1174
|
issue.name
|
|
999
1175
|
)
|
|
1000
1176
|
),
|
|
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
|
-
)
|
|
1177
|
+
React__default.createElement('div', { className: 'clearfix', style: { minHeight: '1px' } })
|
|
1016
1178
|
),
|
|
1017
1179
|
renderIsiContent(props.article)
|
|
1018
1180
|
),
|
|
@@ -1025,7 +1187,7 @@ var Article = function Article(props) {
|
|
|
1025
1187
|
})
|
|
1026
1188
|
)
|
|
1027
1189
|
),
|
|
1028
|
-
|
|
1190
|
+
main_36 && !sponsoredFlag && props.article.Ads && props.article.Ads.length > 0 && props.article.Ads.map(function (ad, index) {
|
|
1029
1191
|
if (index > 0) {
|
|
1030
1192
|
return React__default.createElement(
|
|
1031
1193
|
'div',
|
|
@@ -1065,6 +1227,201 @@ var Article = function Article(props) {
|
|
|
1065
1227
|
|
|
1066
1228
|
var _this = undefined;
|
|
1067
1229
|
|
|
1230
|
+
var getRelatedContentArticles = function () {
|
|
1231
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
|
|
1232
|
+
var client = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
1233
|
+
var article = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1234
|
+
var prevUrl = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '/';
|
|
1235
|
+
var articleCount = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
1236
|
+
|
|
1237
|
+
var _article$url, url, content_placement, documentGroupMapping, issueGroup, references, params, articles, relatedContentQuery;
|
|
1238
|
+
|
|
1239
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
1240
|
+
while (1) {
|
|
1241
|
+
switch (_context.prev = _context.next) {
|
|
1242
|
+
case 0:
|
|
1243
|
+
_article$url = article.url;
|
|
1244
|
+
_article$url = _article$url === undefined ? {
|
|
1245
|
+
current: null
|
|
1246
|
+
} : _article$url;
|
|
1247
|
+
url = _article$url.current, content_placement = article.content_placement, documentGroupMapping = article.documentGroupMapping, issueGroup = article.issueGroup;
|
|
1248
|
+
references = [];
|
|
1249
|
+
|
|
1250
|
+
if (content_placement && content_placement.length > 0) {
|
|
1251
|
+
content_placement.forEach(function (_ref2) {
|
|
1252
|
+
var path = _ref2.path,
|
|
1253
|
+
_id = _ref2._id;
|
|
1254
|
+
|
|
1255
|
+
if (!_id || typeof _id == 'undefined') {
|
|
1256
|
+
return null;
|
|
1257
|
+
}
|
|
1258
|
+
var prev_url_to_check = prevUrl;
|
|
1259
|
+
if (prev_url_to_check.includes('?')) {
|
|
1260
|
+
prev_url_to_check = prev_url_to_check.split('?')[0];
|
|
1261
|
+
}
|
|
1262
|
+
if (prev_url_to_check.endsWith(path) && _id) references.push(_id);
|
|
1263
|
+
});
|
|
1264
|
+
if (references.length === 0) {
|
|
1265
|
+
content_placement.filter(function (_ref3) {
|
|
1266
|
+
var identifier = _ref3.identifier;
|
|
1267
|
+
return identifier !== 'news';
|
|
1268
|
+
}).forEach(function (_ref4) {
|
|
1269
|
+
var _id = _ref4._id;
|
|
1270
|
+
|
|
1271
|
+
if (_id) references.push(_id);
|
|
1272
|
+
});
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
if (documentGroupMapping && documentGroupMapping.length > 0) {
|
|
1277
|
+
documentGroupMapping.forEach(function (_ref5) {
|
|
1278
|
+
var _id = _ref5._id;
|
|
1279
|
+
|
|
1280
|
+
if (_id) references.push(_id);
|
|
1281
|
+
});
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
if (issueGroup && issueGroup._ref) {
|
|
1285
|
+
references.push(issueGroup._ref);
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
params = { url: url, references: references };
|
|
1289
|
+
articles = [];
|
|
1290
|
+
|
|
1291
|
+
if (!(params.references && params.references.length > 0)) {
|
|
1292
|
+
_context.next = 20;
|
|
1293
|
+
break;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
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 }';
|
|
1297
|
+
_context.prev = 11;
|
|
1298
|
+
_context.next = 14;
|
|
1299
|
+
return client.fetch(relatedContentQuery, params);
|
|
1300
|
+
|
|
1301
|
+
case 14:
|
|
1302
|
+
articles = _context.sent;
|
|
1303
|
+
_context.next = 20;
|
|
1304
|
+
break;
|
|
1305
|
+
|
|
1306
|
+
case 17:
|
|
1307
|
+
_context.prev = 17;
|
|
1308
|
+
_context.t0 = _context['catch'](11);
|
|
1309
|
+
|
|
1310
|
+
console.error(_context.t0);
|
|
1311
|
+
|
|
1312
|
+
case 20:
|
|
1313
|
+
return _context.abrupt('return', articles);
|
|
1314
|
+
|
|
1315
|
+
case 21:
|
|
1316
|
+
case 'end':
|
|
1317
|
+
return _context.stop();
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
}, _callee, _this, [[11, 17]]);
|
|
1321
|
+
}));
|
|
1322
|
+
|
|
1323
|
+
return function getRelatedContentArticles() {
|
|
1324
|
+
return _ref.apply(this, arguments);
|
|
1325
|
+
};
|
|
1326
|
+
}();
|
|
1327
|
+
|
|
1328
|
+
// const getRelatedContents = async (ctx = null, client = null, article = {}, prevUrl = '/', articleCount = 0) => {
|
|
1329
|
+
// const {
|
|
1330
|
+
// url: { current: url } = {
|
|
1331
|
+
// current: null
|
|
1332
|
+
// },
|
|
1333
|
+
// content_placement,
|
|
1334
|
+
// documentGroupMapping,
|
|
1335
|
+
// issueGroup
|
|
1336
|
+
// } = article
|
|
1337
|
+
// let params = { url }
|
|
1338
|
+
// let conditions = ''
|
|
1339
|
+
|
|
1340
|
+
// if (content_placement && content_placement.length > 0) {
|
|
1341
|
+
// let taxonomy = []
|
|
1342
|
+
// content_placement.forEach(({ path, _id }) => {
|
|
1343
|
+
// if (!_id || typeof _id == 'undefined') {
|
|
1344
|
+
// return null
|
|
1345
|
+
// }
|
|
1346
|
+
// let prev_url_to_check = prevUrl
|
|
1347
|
+
// if (prev_url_to_check.includes('?')) {
|
|
1348
|
+
// prev_url_to_check = prev_url_to_check.split('?')[0]
|
|
1349
|
+
// }
|
|
1350
|
+
// if (prev_url_to_check.endsWith(path) && _id) taxonomy.push(_id)
|
|
1351
|
+
// })
|
|
1352
|
+
// if (taxonomy.length === 0) {
|
|
1353
|
+
// content_placement
|
|
1354
|
+
// .filter(({ identifier }) => identifier !== 'news')
|
|
1355
|
+
// .forEach(({ _id }) => {
|
|
1356
|
+
// if (_id) taxonomy.push(_id)
|
|
1357
|
+
// })
|
|
1358
|
+
// }
|
|
1359
|
+
// if (taxonomy.length > 0) {
|
|
1360
|
+
// params = { ...params, taxonomy }
|
|
1361
|
+
// conditions = `&& taxonomyMapping[]._ref in $taxonomy`
|
|
1362
|
+
// }
|
|
1363
|
+
// }
|
|
1364
|
+
|
|
1365
|
+
// if (documentGroupMapping && documentGroupMapping.length > 0) {
|
|
1366
|
+
// let documentGroup = []
|
|
1367
|
+
// documentGroupMapping.forEach(({ _id }) => {
|
|
1368
|
+
// if (_id) documentGroup.push(_id)
|
|
1369
|
+
// })
|
|
1370
|
+
// if (params.taxonomy && documentGroup.length > 0) {
|
|
1371
|
+
// params = { ...params, documentGroup }
|
|
1372
|
+
// conditions = `&& (taxonomyMapping[]._ref in $taxonomy || documentGroupMapping[]._ref in $documentGroup)`
|
|
1373
|
+
// }
|
|
1374
|
+
// }
|
|
1375
|
+
|
|
1376
|
+
// if (issueGroup && issueGroup._ref) {
|
|
1377
|
+
// if (params.taxonomy && params.documentGroup) {
|
|
1378
|
+
// params = { ...params, issueAssociation: issueGroup._ref }
|
|
1379
|
+
// conditions = `&& (taxonomyMapping[]._ref in $taxonomy || documentGroupMapping[]._ref in $documentGroup || issueGroup._ref == $issueAssociation )`
|
|
1380
|
+
// } else if (params.taxonomy) {
|
|
1381
|
+
// params = { ...params, issueAssociation: issueGroup._ref }
|
|
1382
|
+
// conditions = `&& (taxonomyMapping[]._ref in $taxonomy || issueGroup._ref == $issueAssociation )`
|
|
1383
|
+
// }
|
|
1384
|
+
// }
|
|
1385
|
+
|
|
1386
|
+
// let articles = []
|
|
1387
|
+
// if (params.taxonomy && params.taxonomy.length > 0) {
|
|
1388
|
+
// const relatedContentQuery = `*[
|
|
1389
|
+
// _type == "article"
|
|
1390
|
+
// && defined(title)
|
|
1391
|
+
// && defined(url)
|
|
1392
|
+
// && !(_id in path("drafts.**"))
|
|
1393
|
+
// && is_visible == true
|
|
1394
|
+
// && passwordLock != true
|
|
1395
|
+
// && taxonomyMapping[].disableAds != 'true'
|
|
1396
|
+
// && contentCategory.name != 'Poll'
|
|
1397
|
+
// && contentCategory.name != 'Slideshows'
|
|
1398
|
+
// && contentCategory.disableAds != 'true'
|
|
1399
|
+
// && ExcludeFromInfiniteScroll != true
|
|
1400
|
+
// && url.current != $url
|
|
1401
|
+
// && !defined(body[].videos)
|
|
1402
|
+
// && published <= '${new Date().toISOString()}'
|
|
1403
|
+
// ${conditions}
|
|
1404
|
+
// ]| order(published desc)[${articleCount}]
|
|
1405
|
+
// {
|
|
1406
|
+
// title,
|
|
1407
|
+
// url,
|
|
1408
|
+
// thumbnail
|
|
1409
|
+
// }`
|
|
1410
|
+
|
|
1411
|
+
// try {
|
|
1412
|
+
// articles = await client.fetch(relatedContentQuery, params)
|
|
1413
|
+
// } catch (error) {
|
|
1414
|
+
// console.error(error)
|
|
1415
|
+
// }
|
|
1416
|
+
// }
|
|
1417
|
+
|
|
1418
|
+
// return articles
|
|
1419
|
+
// }
|
|
1420
|
+
|
|
1421
|
+
// export default getRelatedContents
|
|
1422
|
+
|
|
1423
|
+
var _this$1 = undefined;
|
|
1424
|
+
|
|
1068
1425
|
var ArticleQueue = function ArticleQueue(props) {
|
|
1069
1426
|
var _props$prevUrl = props.prevUrl,
|
|
1070
1427
|
prevUrl = _props$prevUrl === undefined ? '/' : _props$prevUrl,
|
|
@@ -1098,7 +1455,7 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1098
1455
|
});
|
|
1099
1456
|
var targeting = getTargeting({ article: activeArticle, cpModificationRequired: cpModificationRequired, position: props.position, prevUrl: prevUrl });
|
|
1100
1457
|
|
|
1101
|
-
if (!
|
|
1458
|
+
if (!main_36) {
|
|
1102
1459
|
lib_3.getGoogletag().then(function (googletag) {
|
|
1103
1460
|
if (window.googletag && googletag.pubadsReady) {
|
|
1104
1461
|
var slots = googletag.pubads().getSlots();
|
|
@@ -1116,7 +1473,7 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1116
1473
|
});
|
|
1117
1474
|
}
|
|
1118
1475
|
//Refresh leaderboard ad on mobile
|
|
1119
|
-
if (
|
|
1476
|
+
if (main_36) {
|
|
1120
1477
|
var leaderboardSlotId = '';
|
|
1121
1478
|
lib_3.getGoogletag().then(function (googletag) {
|
|
1122
1479
|
if (window.googletag && googletag.pubadsReady) {
|
|
@@ -1190,7 +1547,7 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1190
1547
|
switch (_context.prev = _context.next) {
|
|
1191
1548
|
case 0:
|
|
1192
1549
|
if (!(article && article._id)) {
|
|
1193
|
-
_context.next =
|
|
1550
|
+
_context.next = 12;
|
|
1194
1551
|
break;
|
|
1195
1552
|
}
|
|
1196
1553
|
|
|
@@ -1202,17 +1559,22 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1202
1559
|
|
|
1203
1560
|
case 5:
|
|
1204
1561
|
article.relatedArticle = _context.sent;
|
|
1562
|
+
_context.next = 8;
|
|
1563
|
+
return getRelatedContentArticles(null, props.client, article, prevUrl, startingIndex + '..' + endingIndex);
|
|
1564
|
+
|
|
1565
|
+
case 8:
|
|
1566
|
+
article.relatedContentArticles = _context.sent;
|
|
1205
1567
|
targeting = getTargeting({ article: article, cpModificationRequired: cpModificationRequired, prevUrl: prevUrl });
|
|
1206
1568
|
|
|
1207
1569
|
article.Ads = Ads.getRightItems(targeting);
|
|
1208
1570
|
setQueueData([].concat(_toConsumableArray(queueData), [article]));
|
|
1209
1571
|
|
|
1210
|
-
case
|
|
1572
|
+
case 12:
|
|
1211
1573
|
case 'end':
|
|
1212
1574
|
return _context.stop();
|
|
1213
1575
|
}
|
|
1214
1576
|
}
|
|
1215
|
-
}, _callee, _this);
|
|
1577
|
+
}, _callee, _this$1);
|
|
1216
1578
|
}));
|
|
1217
1579
|
|
|
1218
1580
|
return function (_x) {
|
|
@@ -1360,7 +1722,7 @@ var Articles = function Articles(props) {
|
|
|
1360
1722
|
}, _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
1723
|
};
|
|
1362
1724
|
|
|
1363
|
-
var _this$
|
|
1725
|
+
var _this$2 = undefined;
|
|
1364
1726
|
|
|
1365
1727
|
var View = function View(props) {
|
|
1366
1728
|
var router = useRouter();
|
|
@@ -1619,12 +1981,12 @@ View.returnGetInitialProps = function () {
|
|
|
1619
1981
|
}
|
|
1620
1982
|
|
|
1621
1983
|
article.relatedArticle = null;
|
|
1622
|
-
_context.next =
|
|
1984
|
+
_context.next = 23;
|
|
1623
1985
|
break;
|
|
1624
1986
|
|
|
1625
1987
|
case 16:
|
|
1626
1988
|
if (!article) {
|
|
1627
|
-
_context.next =
|
|
1989
|
+
_context.next = 23;
|
|
1628
1990
|
break;
|
|
1629
1991
|
}
|
|
1630
1992
|
|
|
@@ -1633,8 +1995,13 @@ View.returnGetInitialProps = function () {
|
|
|
1633
1995
|
|
|
1634
1996
|
case 19:
|
|
1635
1997
|
article.relatedArticle = _context.sent;
|
|
1998
|
+
_context.next = 22;
|
|
1999
|
+
return getRelatedContentArticles(context, client, article, prevUrl, '0..2');
|
|
1636
2000
|
|
|
1637
|
-
case
|
|
2001
|
+
case 22:
|
|
2002
|
+
article.relatedContentArticles = _context.sent;
|
|
2003
|
+
|
|
2004
|
+
case 23:
|
|
1638
2005
|
return _context.abrupt('return', {
|
|
1639
2006
|
url: url,
|
|
1640
2007
|
sao: sao,
|
|
@@ -1645,12 +2012,12 @@ View.returnGetInitialProps = function () {
|
|
|
1645
2012
|
sponsoredFlag: sponsoredFlag
|
|
1646
2013
|
});
|
|
1647
2014
|
|
|
1648
|
-
case
|
|
2015
|
+
case 24:
|
|
1649
2016
|
case 'end':
|
|
1650
2017
|
return _context.stop();
|
|
1651
2018
|
}
|
|
1652
2019
|
}
|
|
1653
|
-
}, _callee, _this$
|
|
2020
|
+
}, _callee, _this$2);
|
|
1654
2021
|
}));
|
|
1655
2022
|
|
|
1656
2023
|
return function (_x, _x2, _x3, _x4, _x5) {
|