@mjhls/mjh-framework 1.0.684-beta.0 → 1.0.684
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/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 +507 -256
- package/dist/cjs/{BlockContent-091a991f.js → BlockContent-88f69acd.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-f6a18ed2.js → Dfp-b2bc3b97.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 +7 -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 +15 -1212
- package/dist/cjs/PublicationDeck.js +1 -1
- package/dist/cjs/QueueDeckExpanded.js +9 -9
- package/dist/cjs/RecentNews.js +2 -2
- package/dist/cjs/RelatedContent.js +2 -2
- package/dist/cjs/{SocialSearchComponent-9cd24578.js → SocialSearchComponent-6b5e5b47.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 +119 -486
- 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 +5 -354
- package/dist/cjs/getSerializers.js +6 -6
- package/dist/cjs/{getTargeting-9af0ef69.js → getTargeting-fee8c429.js} +2 -2
- package/dist/cjs/getTargeting.js +1 -1
- package/dist/cjs/{index-fa8ed292.js → index-2d0a4911.js} +34 -27
- package/dist/cjs/{index-3294d3bc.js → index-5be2866f.js} +1 -1
- package/dist/cjs/{index-c49c3b5e.js → index-8c9e8ca7.js} +462 -450
- package/dist/cjs/{index-be0c82be.js → index-b5eb3ff8.js} +20 -19
- package/dist/cjs/{index.es-9110add6.js → index.es-ab3f2690.js} +3 -1
- package/dist/cjs/index.js +16 -15
- package/dist/cjs/{main-a4cb15bb.js → main-b6c96c8d.js} +67 -36
- package/dist/cjs/{moment-575fe24c.js → moment-66a6a284.js} +1 -1
- package/dist/cjs/timeDifferenceCalc.js +1 -1
- 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 +499 -248
- package/dist/esm/{BlockContent-e9b4ddcf.js → BlockContent-a614acdf.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-96b49def.js → Dfp-8a8fca18.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 +7 -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 +13 -1209
- package/dist/esm/PublicationDeck.js +1 -1
- package/dist/esm/QueueDeckExpanded.js +9 -9
- package/dist/esm/RecentNews.js +2 -2
- package/dist/esm/RelatedContent.js +2 -2
- package/dist/esm/{SocialSearchComponent-93233334.js → SocialSearchComponent-7f14e0f3.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 +93 -460
- 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 +5 -354
- package/dist/esm/getSerializers.js +6 -6
- package/dist/esm/{index-73819142.js → index-51a80699.js} +20 -19
- package/dist/esm/{index-85783f24.js → index-5505d4f9.js} +462 -450
- package/dist/esm/{index-0e45a0b2.js → index-93ec3c59.js} +34 -27
- package/dist/esm/{index-ef6d5dcf.js → index-d2f90501.js} +1 -1
- package/dist/esm/{index.es-29c1cef5.js → index.es-938a3a58.js} +3 -1
- package/dist/esm/index.js +14 -13
- package/dist/esm/{main-5d1e4bd3.js → main-0465b2a0.js} +65 -34
- package/dist/esm/{moment-e2f9b20c.js → moment-12415288.js} +1 -1
- package/dist/esm/timeDifferenceCalc.js +1 -1
- package/dist/esm/urlFor.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/index-bd6c9f56.js +0 -211
- package/dist/esm/index-db3bb315.js +0 -207
- /package/dist/cjs/{ADInfeed-f27bc4b5.js → ADInfeed-c676389b.js} +0 -0
- /package/dist/cjs/{ADlgInfeed-8decfd9e.js → ADlgInfeed-57d63c87.js} +0 -0
- /package/dist/esm/{ADInfeed-1e0ca5e0.js → ADInfeed-97b8cea7.js} +0 -0
- /package/dist/esm/{ADlgInfeed-979cf0d5.js → ADlgInfeed-3ab91c75.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 { _ as _extends, a as _Object$assign } 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-93ec3c59.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-12415288.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-938a3a58.js';
|
|
26
26
|
import 'react-dom';
|
|
27
|
-
import './index-
|
|
27
|
+
import './index-51a80699.js';
|
|
28
28
|
import './index-5f9f807a.js';
|
|
29
|
-
import { m as
|
|
29
|
+
import { m as main_39 } from './main-0465b2a0.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-a614acdf.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-5505d4f9.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 getRelatedArticle from './getRelatedArticle.js';
|
|
57
|
+
import 'nookies';
|
|
59
58
|
import getQuery from './getQuery.js';
|
|
59
|
+
import getRelatedArticle from './getRelatedArticle.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_39 ? 'left' : 'right', marginTop: '.25rem' },
|
|
141
141
|
dangerouslySetInnerHTML: { __html: name } }),
|
|
142
|
-
|
|
142
|
+
main_39 && !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 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
|
|
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 padding-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 }\r\n .RelatedArticles-module_imgWrapper__5Jx_4 img {\r\n width: 100%;\r\n height: auto;\r\n\r\n max-height: 175px;\r\n object-fit: contain;\r\n margin-bottom: 1rem;\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,22 +291,6 @@ 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
|
-
|
|
310
294
|
var Article = function Article(props) {
|
|
311
295
|
var onVote = function () {
|
|
312
296
|
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(nodeKey, selectedChoice) {
|
|
@@ -498,56 +482,10 @@ var Article = function Article(props) {
|
|
|
498
482
|
};
|
|
499
483
|
|
|
500
484
|
var RelevantTopics = function RelevantTopics() {
|
|
501
|
-
if (content_placement && content_placement.length > 0 || documentGroupMapping
|
|
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) {
|
|
485
|
+
if (content_placement && content_placement.length > 0 || documentGroupMapping) {
|
|
548
486
|
return React__default.createElement(
|
|
549
|
-
'
|
|
550
|
-
{
|
|
487
|
+
'div',
|
|
488
|
+
{ style: { color: '#262626' } },
|
|
551
489
|
React__default.createElement(
|
|
552
490
|
'p',
|
|
553
491
|
{ className: 'mb-0' },
|
|
@@ -557,17 +495,47 @@ var Article = function Article(props) {
|
|
|
557
495
|
'Related Content:'
|
|
558
496
|
)
|
|
559
497
|
),
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
498
|
+
documentGroupMapping && documentGroupMapping.map(function (documentGroup) {
|
|
499
|
+
if (!documentGroup.parent) {
|
|
500
|
+
return null;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
return React__default.createElement(
|
|
504
|
+
React__default.Fragment,
|
|
505
|
+
null,
|
|
506
|
+
React__default.createElement(
|
|
507
|
+
'span',
|
|
508
|
+
{ className: '' },
|
|
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
|
|
571
539
|
);
|
|
572
540
|
}
|
|
573
541
|
return null;
|
|
@@ -656,36 +624,12 @@ var Article = function Article(props) {
|
|
|
656
624
|
setContextualADFlag(true);
|
|
657
625
|
}
|
|
658
626
|
};
|
|
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
|
-
|
|
683
627
|
return React__default.createElement(
|
|
684
628
|
React__default.Fragment,
|
|
685
629
|
null,
|
|
686
630
|
React__default.createElement(BlockContent, _extends({
|
|
687
631
|
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting),
|
|
688
|
-
blocks:
|
|
632
|
+
blocks: [].concat(_toConsumableArray(articleBody.slice(0, selectedIndex))),
|
|
689
633
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
690
634
|
}, client.config())),
|
|
691
635
|
React__default.createElement('span', { className: 'clearfix' }),
|
|
@@ -700,20 +644,9 @@ var Article = function Article(props) {
|
|
|
700
644
|
{ id: 'contextual-video-ad-' + payload._id, className: 'contextual-video-ad' },
|
|
701
645
|
React__default.createElement(DFPAdSlot, _extends({}, payload.contextualVideoAD, { refreshFlag: false, checkIsAdFound: checkIsVideoAdFound }))
|
|
702
646
|
),
|
|
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),
|
|
714
647
|
React__default.createElement(BlockContent, _extends({
|
|
715
648
|
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, null, null, null, targeting),
|
|
716
|
-
blocks:
|
|
649
|
+
blocks: [].concat(_toConsumableArray(articleBody.slice(selectedIndex))),
|
|
717
650
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
718
651
|
}, client.config()))
|
|
719
652
|
);
|
|
@@ -732,7 +665,7 @@ var Article = function Article(props) {
|
|
|
732
665
|
}, { viewport: [0, 0], sizes: ['fluid', [300, 100]] }] : { viewport: [0, 0], sizes: ['fluid', [300, 100]] }
|
|
733
666
|
})
|
|
734
667
|
});
|
|
735
|
-
var
|
|
668
|
+
var _selectedIndex = indexes[1] + 1;
|
|
736
669
|
|
|
737
670
|
var _checkIsAdFound = function _checkIsAdFound(isFound, adData) {
|
|
738
671
|
if (!isFound) {
|
|
@@ -763,35 +696,12 @@ var Article = function Article(props) {
|
|
|
763
696
|
}
|
|
764
697
|
};
|
|
765
698
|
|
|
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
|
-
|
|
789
699
|
return React__default.createElement(
|
|
790
700
|
React__default.Fragment,
|
|
791
701
|
null,
|
|
792
702
|
React__default.createElement(BlockContent, _extends({
|
|
793
703
|
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting),
|
|
794
|
-
blocks:
|
|
704
|
+
blocks: [].concat(_toConsumableArray(articleBody.slice(0, _selectedIndex))),
|
|
795
705
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
796
706
|
}, client.config())),
|
|
797
707
|
contextualADFlag && React__default.createElement('span', { className: 'clearfix' }),
|
|
@@ -801,20 +711,9 @@ var Article = function Article(props) {
|
|
|
801
711
|
React__default.createElement(DFPAdSlot, _extends({}, payload.contextualAD, { refreshFlag: false, checkIsAdFound: previewAd ? null : _checkIsAdFound }))
|
|
802
712
|
),
|
|
803
713
|
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),
|
|
815
714
|
React__default.createElement(BlockContent, _extends({
|
|
816
715
|
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, null, null, null, targeting),
|
|
817
|
-
blocks:
|
|
716
|
+
blocks: [].concat(_toConsumableArray(articleBody.slice(_selectedIndex))),
|
|
818
717
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
819
718
|
}, client.config()))
|
|
820
719
|
);
|
|
@@ -824,7 +723,7 @@ var Article = function Article(props) {
|
|
|
824
723
|
slotId: (payload.contextualVideoAD.slotId || 'in-context_video') + '-' + payload._id
|
|
825
724
|
})
|
|
826
725
|
});
|
|
827
|
-
var
|
|
726
|
+
var _selectedIndex2 = indexes[1] + 1;
|
|
828
727
|
|
|
829
728
|
var _checkIsAdFound2 = function _checkIsAdFound2(isFound) {
|
|
830
729
|
if (!isFound) {
|
|
@@ -840,35 +739,12 @@ var Article = function Article(props) {
|
|
|
840
739
|
}
|
|
841
740
|
};
|
|
842
741
|
|
|
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
|
-
|
|
866
742
|
return React__default.createElement(
|
|
867
743
|
React__default.Fragment,
|
|
868
744
|
null,
|
|
869
745
|
React__default.createElement(BlockContent, _extends({
|
|
870
746
|
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting),
|
|
871
|
-
blocks:
|
|
747
|
+
blocks: [].concat(_toConsumableArray(articleBody.slice(0, _selectedIndex2))),
|
|
872
748
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
873
749
|
}, client.config())),
|
|
874
750
|
React__default.createElement('span', { className: 'clearfix' }),
|
|
@@ -877,61 +753,9 @@ var Article = function Article(props) {
|
|
|
877
753
|
{ id: 'contextual-video-ad-' + payload._id, className: 'contextual-video-ad' },
|
|
878
754
|
React__default.createElement(DFPAdSlot, _extends({}, payload.contextualVideoAD, { refreshFlag: false, checkIsAdFound: _checkIsAdFound2 }))
|
|
879
755
|
),
|
|
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),
|
|
932
756
|
React__default.createElement(BlockContent, _extends({
|
|
933
757
|
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, null, null, null, targeting),
|
|
934
|
-
blocks:
|
|
758
|
+
blocks: [].concat(_toConsumableArray(articleBody.slice(_selectedIndex2))),
|
|
935
759
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
936
760
|
}, client.config()))
|
|
937
761
|
);
|
|
@@ -1122,7 +946,7 @@ var Article = function Article(props) {
|
|
|
1122
946
|
React__default.createElement(
|
|
1123
947
|
'div',
|
|
1124
948
|
{ className: 'ad-box', style: { textAlign: 'center' } },
|
|
1125
|
-
|
|
949
|
+
main_39 && !sponsoredFlag && props.article.Ads && props.article.Ads.length > 0 && props.article.Ads.map(function (ad, index) {
|
|
1126
950
|
if (index === 0) {
|
|
1127
951
|
return React__default.createElement(
|
|
1128
952
|
'div',
|
|
@@ -1174,7 +998,21 @@ var Article = function Article(props) {
|
|
|
1174
998
|
issue.name
|
|
1175
999
|
)
|
|
1176
1000
|
),
|
|
1177
|
-
React__default.createElement('div', { className: 'clearfix', style: { minHeight: '1px' } })
|
|
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
|
+
)
|
|
1178
1016
|
),
|
|
1179
1017
|
renderIsiContent(props.article)
|
|
1180
1018
|
),
|
|
@@ -1187,7 +1025,7 @@ var Article = function Article(props) {
|
|
|
1187
1025
|
})
|
|
1188
1026
|
)
|
|
1189
1027
|
),
|
|
1190
|
-
|
|
1028
|
+
main_39 && !sponsoredFlag && props.article.Ads && props.article.Ads.length > 0 && props.article.Ads.map(function (ad, index) {
|
|
1191
1029
|
if (index > 0) {
|
|
1192
1030
|
return React__default.createElement(
|
|
1193
1031
|
'div',
|
|
@@ -1227,201 +1065,6 @@ var Article = function Article(props) {
|
|
|
1227
1065
|
|
|
1228
1066
|
var _this = undefined;
|
|
1229
1067
|
|
|
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
|
-
|
|
1425
1068
|
var ArticleQueue = function ArticleQueue(props) {
|
|
1426
1069
|
var _props$prevUrl = props.prevUrl,
|
|
1427
1070
|
prevUrl = _props$prevUrl === undefined ? '/' : _props$prevUrl,
|
|
@@ -1455,7 +1098,7 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1455
1098
|
});
|
|
1456
1099
|
var targeting = getTargeting({ article: activeArticle, cpModificationRequired: cpModificationRequired, position: props.position, prevUrl: prevUrl });
|
|
1457
1100
|
|
|
1458
|
-
if (!
|
|
1101
|
+
if (!main_39) {
|
|
1459
1102
|
lib_3.getGoogletag().then(function (googletag) {
|
|
1460
1103
|
if (window.googletag && googletag.pubadsReady) {
|
|
1461
1104
|
var slots = googletag.pubads().getSlots();
|
|
@@ -1473,7 +1116,7 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1473
1116
|
});
|
|
1474
1117
|
}
|
|
1475
1118
|
//Refresh leaderboard ad on mobile
|
|
1476
|
-
if (
|
|
1119
|
+
if (main_39) {
|
|
1477
1120
|
var leaderboardSlotId = '';
|
|
1478
1121
|
lib_3.getGoogletag().then(function (googletag) {
|
|
1479
1122
|
if (window.googletag && googletag.pubadsReady) {
|
|
@@ -1547,7 +1190,7 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1547
1190
|
switch (_context.prev = _context.next) {
|
|
1548
1191
|
case 0:
|
|
1549
1192
|
if (!(article && article._id)) {
|
|
1550
|
-
_context.next =
|
|
1193
|
+
_context.next = 9;
|
|
1551
1194
|
break;
|
|
1552
1195
|
}
|
|
1553
1196
|
|
|
@@ -1559,22 +1202,17 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1559
1202
|
|
|
1560
1203
|
case 5:
|
|
1561
1204
|
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;
|
|
1567
1205
|
targeting = getTargeting({ article: article, cpModificationRequired: cpModificationRequired, prevUrl: prevUrl });
|
|
1568
1206
|
|
|
1569
1207
|
article.Ads = Ads.getRightItems(targeting);
|
|
1570
1208
|
setQueueData([].concat(_toConsumableArray(queueData), [article]));
|
|
1571
1209
|
|
|
1572
|
-
case
|
|
1210
|
+
case 9:
|
|
1573
1211
|
case 'end':
|
|
1574
1212
|
return _context.stop();
|
|
1575
1213
|
}
|
|
1576
1214
|
}
|
|
1577
|
-
}, _callee, _this
|
|
1215
|
+
}, _callee, _this);
|
|
1578
1216
|
}));
|
|
1579
1217
|
|
|
1580
1218
|
return function (_x) {
|
|
@@ -1722,7 +1360,7 @@ var Articles = function Articles(props) {
|
|
|
1722
1360
|
}, _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));
|
|
1723
1361
|
};
|
|
1724
1362
|
|
|
1725
|
-
var _this$
|
|
1363
|
+
var _this$1 = undefined;
|
|
1726
1364
|
|
|
1727
1365
|
var View = function View(props) {
|
|
1728
1366
|
var router = useRouter();
|
|
@@ -1981,12 +1619,12 @@ View.returnGetInitialProps = function () {
|
|
|
1981
1619
|
}
|
|
1982
1620
|
|
|
1983
1621
|
article.relatedArticle = null;
|
|
1984
|
-
_context.next =
|
|
1622
|
+
_context.next = 20;
|
|
1985
1623
|
break;
|
|
1986
1624
|
|
|
1987
1625
|
case 16:
|
|
1988
1626
|
if (!article) {
|
|
1989
|
-
_context.next =
|
|
1627
|
+
_context.next = 20;
|
|
1990
1628
|
break;
|
|
1991
1629
|
}
|
|
1992
1630
|
|
|
@@ -1995,13 +1633,8 @@ View.returnGetInitialProps = function () {
|
|
|
1995
1633
|
|
|
1996
1634
|
case 19:
|
|
1997
1635
|
article.relatedArticle = _context.sent;
|
|
1998
|
-
_context.next = 22;
|
|
1999
|
-
return getRelatedContentArticles(context, client, article, prevUrl, '0..2');
|
|
2000
|
-
|
|
2001
|
-
case 22:
|
|
2002
|
-
article.relatedContentArticles = _context.sent;
|
|
2003
1636
|
|
|
2004
|
-
case
|
|
1637
|
+
case 20:
|
|
2005
1638
|
return _context.abrupt('return', {
|
|
2006
1639
|
url: url,
|
|
2007
1640
|
sao: sao,
|
|
@@ -2012,12 +1645,12 @@ View.returnGetInitialProps = function () {
|
|
|
2012
1645
|
sponsoredFlag: sponsoredFlag
|
|
2013
1646
|
});
|
|
2014
1647
|
|
|
2015
|
-
case
|
|
1648
|
+
case 21:
|
|
2016
1649
|
case 'end':
|
|
2017
1650
|
return _context.stop();
|
|
2018
1651
|
}
|
|
2019
1652
|
}
|
|
2020
|
-
}, _callee, _this$
|
|
1653
|
+
}, _callee, _this$1);
|
|
2021
1654
|
}));
|
|
2022
1655
|
|
|
2023
1656
|
return function (_x, _x2, _x3, _x4, _x5) {
|