@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/cjs/View.js
CHANGED
|
@@ -10,29 +10,29 @@ require('./_iter-detect-60b2f026.js');
|
|
|
10
10
|
var toConsumableArray = require('./toConsumableArray-9a3476fe.js');
|
|
11
11
|
require('./core.get-iterator-method-f62321d4.js');
|
|
12
12
|
require('./_object-pie-68c5bcbc.js');
|
|
13
|
-
var _extends = require('./extends-60837c34.js');
|
|
13
|
+
var _extends$1 = require('./extends-60837c34.js');
|
|
14
14
|
require('./_object-sap-5e74ba08.js');
|
|
15
15
|
require('./inherits-513d81cd.js');
|
|
16
16
|
require('./define-property-f4d12f4e.js');
|
|
17
17
|
require('./web.dom.iterable-a0e279c1.js');
|
|
18
|
-
var _typeof
|
|
18
|
+
var _typeof = require('./typeof-725500bc.js');
|
|
19
19
|
require('./_is-array-754e012d.js');
|
|
20
20
|
var React = require('react');
|
|
21
21
|
var React__default = _interopDefault(React);
|
|
22
|
-
var index = require('./index-
|
|
22
|
+
var index = require('./index-fa8ed292.js');
|
|
23
23
|
require('prop-types');
|
|
24
24
|
require('react-bootstrap/Row');
|
|
25
25
|
require('react-bootstrap/Col');
|
|
26
|
-
var moment = require('./moment-
|
|
26
|
+
var moment = require('./moment-575fe24c.js');
|
|
27
27
|
var Router = require('next/router');
|
|
28
28
|
var Router__default = _interopDefault(Router);
|
|
29
29
|
require('./isSymbol-04666465.js');
|
|
30
30
|
require('./debounce-eb287781.js');
|
|
31
|
-
var index_es = require('./index.es-
|
|
31
|
+
var index_es = require('./index.es-9110add6.js');
|
|
32
32
|
require('react-dom');
|
|
33
|
-
require('./index-
|
|
33
|
+
require('./index-be0c82be.js');
|
|
34
34
|
require('./index-da796b8c.js');
|
|
35
|
-
var main = require('./main-
|
|
35
|
+
var main = require('./main-a4cb15bb.js');
|
|
36
36
|
require('./entities-310b46ee.js');
|
|
37
37
|
var stringify = require('./stringify-7c5aff47.js');
|
|
38
38
|
var slicedToArray = require('./slicedToArray-8f385299.js');
|
|
@@ -40,7 +40,7 @@ var asyncToGenerator = require('./asyncToGenerator-533d476a.js');
|
|
|
40
40
|
require('./_set-species-f92c67c5.js');
|
|
41
41
|
require('./beam-7217b7e7.js');
|
|
42
42
|
var AdSlot = require('./AdSlot.js');
|
|
43
|
-
var BlockContent = require('./BlockContent-
|
|
43
|
+
var BlockContent = require('./BlockContent-091a991f.js');
|
|
44
44
|
require('./smoothscroll-95231a70.js');
|
|
45
45
|
require('./GroupDeck.js');
|
|
46
46
|
require('react-bootstrap');
|
|
@@ -48,7 +48,7 @@ require('./iconBase-68959171.js');
|
|
|
48
48
|
var Button = _interopDefault(require('react-bootstrap/Button'));
|
|
49
49
|
var defineProperty$1 = require('./defineProperty-55548b25.js');
|
|
50
50
|
var Form = _interopDefault(require('react-bootstrap/Form'));
|
|
51
|
-
var getSerializers = require('./index-
|
|
51
|
+
var getSerializers = require('./index-c49c3b5e.js');
|
|
52
52
|
require('./util-f2c1b65b.js');
|
|
53
53
|
require('./brightcove-react-player-loader.es-156bd4d6.js');
|
|
54
54
|
require('react-bootstrap/Pagination');
|
|
@@ -60,10 +60,10 @@ var keys = require('./keys-a586b7a0.js');
|
|
|
60
60
|
require('react-bootstrap/Dropdown');
|
|
61
61
|
var index_esm$3 = require('./index.esm-ff47db6f.js');
|
|
62
62
|
var getSeriesDetail = require('./getSeriesDetail.js');
|
|
63
|
-
require('
|
|
64
|
-
var getQuery = require('./getQuery.js');
|
|
63
|
+
require('./index-bd6c9f56.js');
|
|
65
64
|
var getRelatedArticle = require('./getRelatedArticle.js');
|
|
66
|
-
var
|
|
65
|
+
var getQuery = require('./getQuery.js');
|
|
66
|
+
var getTargeting = require('./getTargeting-9af0ef69.js');
|
|
67
67
|
var getKeywords = require('./getKeywords.js');
|
|
68
68
|
var urlFor = require('./urlFor.js');
|
|
69
69
|
var styleInject_es = require('./style-inject.es-dcee06b6.js');
|
|
@@ -143,9 +143,9 @@ var DocumentGroup = function DocumentGroup(_ref) {
|
|
|
143
143
|
style: { display: 'flex', flexDirection: 'column', padding: '0 1rem', justifyContent: thumbnailUrl ? 'center' : 'flex-start', alignItems: 'center' } },
|
|
144
144
|
thumbnailUrl && React__default.createElement('img', { style: { maxWidth: '220px', maxHeight: '100px', marginTop: '1rem' }, src: thumbnailUrl, alt: name }),
|
|
145
145
|
!thumbnailUrl && React__default.createElement('p', {
|
|
146
|
-
style: { maxWidth: '315px', margin: '0', color: 'var(--primary)', textAlign: thumbnailUrl ? 'center' : main.
|
|
146
|
+
style: { maxWidth: '315px', margin: '0', color: 'var(--primary)', textAlign: thumbnailUrl ? 'center' : main.main_36 ? 'left' : 'right', marginTop: '.25rem' },
|
|
147
147
|
dangerouslySetInnerHTML: { __html: name } }),
|
|
148
|
-
main.
|
|
148
|
+
main.main_36 && !thumbnailUrl && React__default.createElement(
|
|
149
149
|
'style',
|
|
150
150
|
{ jsx: 'true' },
|
|
151
151
|
'\n a.doc-group {\n display: block !important;\n padding: 0!important;\n }\n '
|
|
@@ -155,7 +155,7 @@ var DocumentGroup = function DocumentGroup(_ref) {
|
|
|
155
155
|
|
|
156
156
|
var findIndex = function findIndex(arr) {
|
|
157
157
|
var indexes = [];
|
|
158
|
-
if ((typeof arr === 'undefined' ? 'undefined' : _typeof
|
|
158
|
+
if ((typeof arr === 'undefined' ? 'undefined' : _typeof._typeof(arr)) === 'object') {
|
|
159
159
|
var _iteratorNormalCompletion = true;
|
|
160
160
|
var _didIteratorError = false;
|
|
161
161
|
var _iteratorError = undefined;
|
|
@@ -252,7 +252,7 @@ var ISI = function ISI(props) {
|
|
|
252
252
|
);
|
|
253
253
|
};
|
|
254
254
|
|
|
255
|
-
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
|
|
255
|
+
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";
|
|
256
256
|
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" };
|
|
257
257
|
styleInject_es.styleInject(css);
|
|
258
258
|
|
|
@@ -297,6 +297,22 @@ var RelatedArticle = function RelatedArticle(_ref) {
|
|
|
297
297
|
);
|
|
298
298
|
};
|
|
299
299
|
|
|
300
|
+
var defaults = { nonTextBehavior: 'remove' };
|
|
301
|
+
|
|
302
|
+
var blocksToText = function blocksToText(blocks) {
|
|
303
|
+
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
304
|
+
|
|
305
|
+
var options = _extends$1._Object$assign({}, defaults, opts);
|
|
306
|
+
return blocks.map(function (block) {
|
|
307
|
+
if (block._type !== 'block' || !block.children) {
|
|
308
|
+
return options.nonTextBehavior === 'remove' ? '' : '[' + block._type + ' block]';
|
|
309
|
+
}
|
|
310
|
+
return block.children.map(function (child) {
|
|
311
|
+
return child.text;
|
|
312
|
+
}).join('');
|
|
313
|
+
}).join('\n\n');
|
|
314
|
+
};
|
|
315
|
+
|
|
300
316
|
var Article = function Article(props) {
|
|
301
317
|
var onVote = function () {
|
|
302
318
|
var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(nodeKey, selectedChoice) {
|
|
@@ -470,7 +486,7 @@ var Article = function Article(props) {
|
|
|
470
486
|
};
|
|
471
487
|
var renderAuthorBiography = function renderAuthorBiography(biography) {
|
|
472
488
|
if (biography) {
|
|
473
|
-
return React__default.createElement(BlockContent.BlockContent, _extends._extends({
|
|
489
|
+
return React__default.createElement(BlockContent.BlockContent, _extends$1._extends({
|
|
474
490
|
serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag),
|
|
475
491
|
blocks: [biography]
|
|
476
492
|
}, client.config()));
|
|
@@ -488,10 +504,56 @@ var Article = function Article(props) {
|
|
|
488
504
|
};
|
|
489
505
|
|
|
490
506
|
var RelevantTopics = function RelevantTopics() {
|
|
491
|
-
if (content_placement && content_placement.length > 0 || documentGroupMapping) {
|
|
507
|
+
if (content_placement && content_placement.length > 0 || documentGroupMapping && documentGroupMapping.length > 0) {
|
|
508
|
+
var relatedLinks = [];
|
|
509
|
+
if (documentGroupMapping && documentGroupMapping.length > 0) {
|
|
510
|
+
documentGroupMapping.forEach(function (documentGroup) {
|
|
511
|
+
if (documentGroup.parent) {
|
|
512
|
+
relatedLinks = [].concat(toConsumableArray._toConsumableArray(relatedLinks), [{ label: documentGroup.name, href: cpModificationRequired ? '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path : '/' + documentGroup.path }]);
|
|
513
|
+
}
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
if (content_placement && content_placement.length > 0) {
|
|
517
|
+
content_placement.filter(function (item) {
|
|
518
|
+
return item.path !== 'news';
|
|
519
|
+
}).forEach(function (cp) {
|
|
520
|
+
var cp_url = cpModificationRequired ? getTargeting.getContentPlacementUrl(cp) : cp.path;
|
|
521
|
+
var href = '/' + cp_url;
|
|
522
|
+
relatedLinks = [].concat(toConsumableArray._toConsumableArray(relatedLinks), [{ label: cp.name, href: href }]);
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
if (relatedLinks && relatedLinks.length > 0) {
|
|
526
|
+
return React__default.createElement(
|
|
527
|
+
'div',
|
|
528
|
+
null,
|
|
529
|
+
relatedLinks.map(function (relatedLink, index) {
|
|
530
|
+
return React__default.createElement(
|
|
531
|
+
'span',
|
|
532
|
+
{ key: index, className: 'related-link' },
|
|
533
|
+
React__default.createElement(
|
|
534
|
+
'a',
|
|
535
|
+
{ className: 'related-links', style: { color: 'blue' }, href: relatedLink.href },
|
|
536
|
+
relatedLink.label
|
|
537
|
+
),
|
|
538
|
+
React__default.createElement(
|
|
539
|
+
'style',
|
|
540
|
+
{ jsx: 'true' },
|
|
541
|
+
'\n .related-link:not(:first-child):before {\n content: \' | \';\n }\n '
|
|
542
|
+
)
|
|
543
|
+
);
|
|
544
|
+
})
|
|
545
|
+
);
|
|
546
|
+
}
|
|
547
|
+
return null;
|
|
548
|
+
}
|
|
549
|
+
return null;
|
|
550
|
+
};
|
|
551
|
+
|
|
552
|
+
var RelatedContent = function RelatedContent() {
|
|
553
|
+
if (showRelatedArticles) {
|
|
492
554
|
return React__default.createElement(
|
|
493
|
-
'
|
|
494
|
-
{
|
|
555
|
+
'section',
|
|
556
|
+
{ className: 'related-content-section' },
|
|
495
557
|
React__default.createElement(
|
|
496
558
|
'p',
|
|
497
559
|
{ className: 'mb-0' },
|
|
@@ -501,47 +563,17 @@ var Article = function Article(props) {
|
|
|
501
563
|
'Related Content:'
|
|
502
564
|
)
|
|
503
565
|
),
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
'
|
|
514
|
-
|
|
515
|
-
React__default.createElement(
|
|
516
|
-
'a',
|
|
517
|
-
{
|
|
518
|
-
className: 'related-links',
|
|
519
|
-
style: { color: 'blue' },
|
|
520
|
-
href: cpModificationRequired ? '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path : '/' + documentGroup.path },
|
|
521
|
-
documentGroup.name
|
|
522
|
-
)
|
|
523
|
-
),
|
|
524
|
-
content_placement && content_placement.length ? ' | ' : null
|
|
525
|
-
);
|
|
526
|
-
}),
|
|
527
|
-
content_placement && content_placement.length > 0 ? content_placement.map(function (cp, index) {
|
|
528
|
-
var cp_url = cpModificationRequired ? getTargeting.getContentPlacementUrl(cp) : cp.path;
|
|
529
|
-
var href = '/' + cp_url;
|
|
530
|
-
return React__default.createElement(
|
|
531
|
-
React__default.Fragment,
|
|
532
|
-
{ key: index },
|
|
533
|
-
React__default.createElement(
|
|
534
|
-
'span',
|
|
535
|
-
null,
|
|
536
|
-
React__default.createElement(
|
|
537
|
-
'a',
|
|
538
|
-
{ className: 'related-links', key: index, href: href, style: { color: 'blue' } },
|
|
539
|
-
cp.name
|
|
540
|
-
)
|
|
541
|
-
),
|
|
542
|
-
content_placement.length > index + 1 ? ' | ' : null
|
|
543
|
-
);
|
|
544
|
-
}) : null
|
|
566
|
+
React__default.createElement(RelevantTopics, null),
|
|
567
|
+
React__default.createElement(
|
|
568
|
+
'div',
|
|
569
|
+
{ className: 'pt-2' },
|
|
570
|
+
React__default.createElement(RelatedArticle, { articles: article.relatedContentArticles, client: client })
|
|
571
|
+
),
|
|
572
|
+
React__default.createElement(
|
|
573
|
+
'style',
|
|
574
|
+
{ jsx: 'true' },
|
|
575
|
+
'\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 '
|
|
576
|
+
)
|
|
545
577
|
);
|
|
546
578
|
}
|
|
547
579
|
return null;
|
|
@@ -595,11 +627,11 @@ var Article = function Article(props) {
|
|
|
595
627
|
var indexes = findIndex(body);
|
|
596
628
|
|
|
597
629
|
if (indexes.length >= 2 && body.length > 3 && payload.contextualAD && payload.contextualVideoAD) {
|
|
598
|
-
payload = _extends._extends({}, payload, {
|
|
599
|
-
contextualAD: _extends._extends({}, payload.contextualAD, {
|
|
630
|
+
payload = _extends$1._extends({}, payload, {
|
|
631
|
+
contextualAD: _extends$1._extends({}, payload.contextualAD, {
|
|
600
632
|
slotId: (payload.contextualAD.slotId || 'contextual_ad') + '-' + payload._id
|
|
601
633
|
}),
|
|
602
|
-
contextualVideoAD: _extends._extends({}, payload.contextualVideoAD, {
|
|
634
|
+
contextualVideoAD: _extends$1._extends({}, payload.contextualVideoAD, {
|
|
603
635
|
slotId: (payload.contextualVideoAD.slotId || 'in-context_video') + '-' + payload._id
|
|
604
636
|
})
|
|
605
637
|
});
|
|
@@ -630,35 +662,70 @@ var Article = function Article(props) {
|
|
|
630
662
|
setContextualADFlag(true);
|
|
631
663
|
}
|
|
632
664
|
};
|
|
665
|
+
|
|
666
|
+
//Start: Generating intemediate Section if available
|
|
667
|
+
var blockContentSection1 = articleBody.slice(0, selectedIndex);
|
|
668
|
+
var blockContentSection2 = articleBody.slice(selectedIndex);
|
|
669
|
+
var blockContentIntermediateSection = [];
|
|
670
|
+
var rearrangeSections = function rearrangeSections(arr, index) {
|
|
671
|
+
var item = arr[index];
|
|
672
|
+
if (item && item._type) {
|
|
673
|
+
if (item._type === 'block' && blocksToText([item]) === '') {
|
|
674
|
+
rearrangeSections(arr, index + 1);
|
|
675
|
+
}
|
|
676
|
+
if (item._type !== 'block') {
|
|
677
|
+
var _selectedIndex = arr.findIndex(function (item1) {
|
|
678
|
+
return item1._key === item._key;
|
|
679
|
+
});
|
|
680
|
+
blockContentIntermediateSection = [].concat(toConsumableArray._toConsumableArray(blockContentIntermediateSection), toConsumableArray._toConsumableArray(arr.slice(0, _selectedIndex + 1)));
|
|
681
|
+
blockContentSection2 = blockContentSection2.slice(_selectedIndex + 1);
|
|
682
|
+
rearrangeSections(blockContentSection2, 0);
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
};
|
|
686
|
+
rearrangeSections(blockContentSection2, 0);
|
|
687
|
+
//End: Generating intemediate Section if available
|
|
688
|
+
|
|
633
689
|
return React__default.createElement(
|
|
634
690
|
React__default.Fragment,
|
|
635
691
|
null,
|
|
636
|
-
React__default.createElement(BlockContent.BlockContent, _extends._extends({
|
|
692
|
+
React__default.createElement(BlockContent.BlockContent, _extends$1._extends({
|
|
637
693
|
serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting),
|
|
638
|
-
blocks:
|
|
694
|
+
blocks: blockContentSection1,
|
|
639
695
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
640
696
|
}, client.config())),
|
|
641
697
|
React__default.createElement('span', { className: 'clearfix' }),
|
|
642
698
|
React__default.createElement(
|
|
643
699
|
'div',
|
|
644
700
|
{ id: 'contextual-native-ad-' + payload._id, className: 'contextual-native-ad' },
|
|
645
|
-
React__default.createElement(AdSlot, _extends._extends({}, payload.contextualAD, { refreshFlag: false, checkIsAdFound: previewAd ? null : checkIsAdFound }))
|
|
701
|
+
React__default.createElement(AdSlot, _extends$1._extends({}, payload.contextualAD, { refreshFlag: false, checkIsAdFound: previewAd ? null : checkIsAdFound }))
|
|
646
702
|
),
|
|
647
703
|
React__default.createElement('span', { className: 'clearfix' }),
|
|
648
704
|
React__default.createElement(
|
|
649
705
|
'div',
|
|
650
706
|
{ id: 'contextual-video-ad-' + payload._id, className: 'contextual-video-ad' },
|
|
651
|
-
React__default.createElement(AdSlot, _extends._extends({}, payload.contextualVideoAD, { refreshFlag: false, checkIsAdFound: checkIsVideoAdFound }))
|
|
707
|
+
React__default.createElement(AdSlot, _extends$1._extends({}, payload.contextualVideoAD, { refreshFlag: false, checkIsAdFound: checkIsVideoAdFound }))
|
|
708
|
+
),
|
|
709
|
+
blockContentIntermediateSection.length > 0 && React__default.createElement(
|
|
710
|
+
React__default.Fragment,
|
|
711
|
+
null,
|
|
712
|
+
React__default.createElement(BlockContent.BlockContent, _extends$1._extends({
|
|
713
|
+
serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting),
|
|
714
|
+
blocks: blockContentIntermediateSection,
|
|
715
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
716
|
+
}, client.config())),
|
|
717
|
+
React__default.createElement('span', { className: 'clearfix' })
|
|
652
718
|
),
|
|
653
|
-
React__default.createElement(
|
|
719
|
+
React__default.createElement(RelatedContent, null),
|
|
720
|
+
React__default.createElement(BlockContent.BlockContent, _extends$1._extends({
|
|
654
721
|
serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, null, null, null, targeting),
|
|
655
|
-
blocks:
|
|
722
|
+
blocks: blockContentSection2,
|
|
656
723
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
657
724
|
}, client.config()))
|
|
658
725
|
);
|
|
659
726
|
} else if (indexes.length >= 2 && body.length >= 3 && payload.contextualAD && !payload.contextualVideoAD) {
|
|
660
|
-
payload = _extends._extends({}, payload, {
|
|
661
|
-
contextualAD: _extends._extends({}, payload.contextualAD, {
|
|
727
|
+
payload = _extends$1._extends({}, payload, {
|
|
728
|
+
contextualAD: _extends$1._extends({}, payload.contextualAD, {
|
|
662
729
|
slotId: (payload.contextualAD.slotId || 'contextual_ad') + '-' + payload._id,
|
|
663
730
|
className: 'ADFluid',
|
|
664
731
|
// Fetching new contextual targeting based on the current active article.
|
|
@@ -671,7 +738,7 @@ var Article = function Article(props) {
|
|
|
671
738
|
}, { viewport: [0, 0], sizes: ['fluid', [300, 100]] }] : { viewport: [0, 0], sizes: ['fluid', [300, 100]] }
|
|
672
739
|
})
|
|
673
740
|
});
|
|
674
|
-
var
|
|
741
|
+
var _selectedIndex2 = indexes[1] + 1;
|
|
675
742
|
|
|
676
743
|
var _checkIsAdFound = function _checkIsAdFound(isFound, adData) {
|
|
677
744
|
if (!isFound) {
|
|
@@ -702,34 +769,68 @@ var Article = function Article(props) {
|
|
|
702
769
|
}
|
|
703
770
|
};
|
|
704
771
|
|
|
772
|
+
//Start: Generating intemediate Section if available
|
|
773
|
+
var _blockContentSection = articleBody.slice(0, _selectedIndex2);
|
|
774
|
+
var _blockContentSection2 = articleBody.slice(_selectedIndex2);
|
|
775
|
+
var _blockContentIntermediateSection = [];
|
|
776
|
+
var _rearrangeSections = function _rearrangeSections(arr, index) {
|
|
777
|
+
var item = arr[index];
|
|
778
|
+
if (item && item._type) {
|
|
779
|
+
if (item._type === 'block' && blocksToText([item]) === '') {
|
|
780
|
+
_rearrangeSections(arr, index + 1);
|
|
781
|
+
}
|
|
782
|
+
if (item._type !== 'block') {
|
|
783
|
+
var _selectedIndex3 = arr.findIndex(function (item1) {
|
|
784
|
+
return item1._key === item._key;
|
|
785
|
+
});
|
|
786
|
+
_blockContentIntermediateSection = [].concat(toConsumableArray._toConsumableArray(_blockContentIntermediateSection), toConsumableArray._toConsumableArray(arr.slice(0, _selectedIndex3 + 1)));
|
|
787
|
+
_blockContentSection2 = _blockContentSection2.slice(_selectedIndex3 + 1);
|
|
788
|
+
_rearrangeSections(_blockContentSection2, 0);
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
};
|
|
792
|
+
_rearrangeSections(_blockContentSection2, 0);
|
|
793
|
+
//End: Generating intemediate Section if available
|
|
794
|
+
|
|
705
795
|
return React__default.createElement(
|
|
706
796
|
React__default.Fragment,
|
|
707
797
|
null,
|
|
708
|
-
React__default.createElement(BlockContent.BlockContent, _extends._extends({
|
|
798
|
+
React__default.createElement(BlockContent.BlockContent, _extends$1._extends({
|
|
709
799
|
serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting),
|
|
710
|
-
blocks:
|
|
800
|
+
blocks: _blockContentSection,
|
|
711
801
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
712
802
|
}, client.config())),
|
|
713
803
|
contextualADFlag && React__default.createElement('span', { className: 'clearfix' }),
|
|
714
804
|
(visibleFlag || queueData && queueData.length === 1 || !props.infiniteScroll) && React__default.createElement(
|
|
715
805
|
'div',
|
|
716
806
|
{ id: 'contextual-native-ad-' + payload._id, className: 'contextual-native-ad' },
|
|
717
|
-
React__default.createElement(AdSlot, _extends._extends({}, payload.contextualAD, { refreshFlag: false, checkIsAdFound: previewAd ? null : _checkIsAdFound }))
|
|
807
|
+
React__default.createElement(AdSlot, _extends$1._extends({}, payload.contextualAD, { refreshFlag: false, checkIsAdFound: previewAd ? null : _checkIsAdFound }))
|
|
718
808
|
),
|
|
719
809
|
contextualADFlag && React__default.createElement('span', { className: 'clearfix' }),
|
|
720
|
-
React__default.createElement(
|
|
810
|
+
_blockContentIntermediateSection.length > 0 && React__default.createElement(
|
|
811
|
+
React__default.Fragment,
|
|
812
|
+
null,
|
|
813
|
+
React__default.createElement(BlockContent.BlockContent, _extends$1._extends({
|
|
814
|
+
serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting),
|
|
815
|
+
blocks: _blockContentIntermediateSection,
|
|
816
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
817
|
+
}, client.config())),
|
|
818
|
+
React__default.createElement('span', { className: 'clearfix' })
|
|
819
|
+
),
|
|
820
|
+
React__default.createElement(RelatedContent, null),
|
|
821
|
+
React__default.createElement(BlockContent.BlockContent, _extends$1._extends({
|
|
721
822
|
serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, null, null, null, targeting),
|
|
722
|
-
blocks:
|
|
823
|
+
blocks: _blockContentSection2,
|
|
723
824
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
724
825
|
}, client.config()))
|
|
725
826
|
);
|
|
726
827
|
} else if (indexes.length >= 2 && body.length > 3 && payload.contextualVideoAD && !payload.contextualAD) {
|
|
727
|
-
payload = _extends._extends({}, payload, {
|
|
728
|
-
contextualVideoAD: _extends._extends({}, payload.contextualVideoAD, {
|
|
828
|
+
payload = _extends$1._extends({}, payload, {
|
|
829
|
+
contextualVideoAD: _extends$1._extends({}, payload.contextualVideoAD, {
|
|
729
830
|
slotId: (payload.contextualVideoAD.slotId || 'in-context_video') + '-' + payload._id
|
|
730
831
|
})
|
|
731
832
|
});
|
|
732
|
-
var
|
|
833
|
+
var _selectedIndex4 = indexes[1] + 1;
|
|
733
834
|
|
|
734
835
|
var _checkIsAdFound2 = function _checkIsAdFound2(isFound) {
|
|
735
836
|
if (!isFound) {
|
|
@@ -745,28 +846,103 @@ var Article = function Article(props) {
|
|
|
745
846
|
}
|
|
746
847
|
};
|
|
747
848
|
|
|
849
|
+
//Start: Generating intemediate Section if available
|
|
850
|
+
var _blockContentSection3 = articleBody.slice(0, _selectedIndex4);
|
|
851
|
+
var _blockContentSection4 = articleBody.slice(_selectedIndex4);
|
|
852
|
+
var _blockContentIntermediateSection2 = [];
|
|
853
|
+
var _rearrangeSections2 = function _rearrangeSections2(arr, index) {
|
|
854
|
+
var item = arr[index];
|
|
855
|
+
if (item && item._type) {
|
|
856
|
+
if (item._type === 'block' && blocksToText([item]) === '') {
|
|
857
|
+
_rearrangeSections2(arr, index + 1);
|
|
858
|
+
}
|
|
859
|
+
if (item._type !== 'block') {
|
|
860
|
+
var _selectedIndex5 = arr.findIndex(function (item1) {
|
|
861
|
+
return item1._key === item._key;
|
|
862
|
+
});
|
|
863
|
+
_blockContentIntermediateSection2 = [].concat(toConsumableArray._toConsumableArray(_blockContentIntermediateSection2), toConsumableArray._toConsumableArray(arr.slice(0, _selectedIndex5 + 1)));
|
|
864
|
+
_blockContentSection4 = _blockContentSection4.slice(_selectedIndex5 + 1);
|
|
865
|
+
_rearrangeSections2(_blockContentSection4, 0);
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
};
|
|
869
|
+
_rearrangeSections2(_blockContentSection4, 0);
|
|
870
|
+
//End: Generating intemediate Section if available
|
|
871
|
+
|
|
748
872
|
return React__default.createElement(
|
|
749
873
|
React__default.Fragment,
|
|
750
874
|
null,
|
|
751
|
-
React__default.createElement(BlockContent.BlockContent, _extends._extends({
|
|
875
|
+
React__default.createElement(BlockContent.BlockContent, _extends$1._extends({
|
|
752
876
|
serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting),
|
|
753
|
-
blocks:
|
|
877
|
+
blocks: _blockContentSection3,
|
|
754
878
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
755
879
|
}, client.config())),
|
|
756
880
|
React__default.createElement('span', { className: 'clearfix' }),
|
|
757
881
|
React__default.createElement(
|
|
758
882
|
'div',
|
|
759
883
|
{ id: 'contextual-video-ad-' + payload._id, className: 'contextual-video-ad' },
|
|
760
|
-
React__default.createElement(AdSlot, _extends._extends({}, payload.contextualVideoAD, { refreshFlag: false, checkIsAdFound: _checkIsAdFound2 }))
|
|
884
|
+
React__default.createElement(AdSlot, _extends$1._extends({}, payload.contextualVideoAD, { refreshFlag: false, checkIsAdFound: _checkIsAdFound2 }))
|
|
885
|
+
),
|
|
886
|
+
_blockContentIntermediateSection2.length > 0 && React__default.createElement(
|
|
887
|
+
React__default.Fragment,
|
|
888
|
+
null,
|
|
889
|
+
React__default.createElement(BlockContent.BlockContent, _extends$1._extends({
|
|
890
|
+
serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting),
|
|
891
|
+
blocks: _blockContentIntermediateSection2,
|
|
892
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
893
|
+
}, client.config())),
|
|
894
|
+
React__default.createElement('span', { className: 'clearfix' })
|
|
761
895
|
),
|
|
762
|
-
React__default.createElement(
|
|
896
|
+
React__default.createElement(RelatedContent, null),
|
|
897
|
+
React__default.createElement(BlockContent.BlockContent, _extends$1._extends({
|
|
898
|
+
serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, null, null, null, targeting),
|
|
899
|
+
blocks: _blockContentSection4,
|
|
900
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
901
|
+
}, client.config()))
|
|
902
|
+
);
|
|
903
|
+
} else if (indexes.length >= 2 && body.length > 3 && showRelatedArticles) {
|
|
904
|
+
var _selectedIndex6 = indexes[1] + 1;
|
|
905
|
+
|
|
906
|
+
//Start: Rearranging sections
|
|
907
|
+
var _blockContentSection5 = articleBody.slice(0, _selectedIndex6);
|
|
908
|
+
var _blockContentSection6 = articleBody.slice(_selectedIndex6);
|
|
909
|
+
var _rearrangeSections3 = function _rearrangeSections3(arr, index) {
|
|
910
|
+
var item = arr[index];
|
|
911
|
+
if (item && item._type) {
|
|
912
|
+
if (item._type === 'block' && blocksToText([item]) === '') {
|
|
913
|
+
_rearrangeSections3(arr, index + 1);
|
|
914
|
+
}
|
|
915
|
+
if (item._type !== 'block') {
|
|
916
|
+
var _selectedIndex7 = arr.findIndex(function (item1) {
|
|
917
|
+
return item1._key === item._key;
|
|
918
|
+
});
|
|
919
|
+
_blockContentSection5 = [].concat(toConsumableArray._toConsumableArray(_blockContentSection5), toConsumableArray._toConsumableArray(arr.slice(0, _selectedIndex7 + 1)));
|
|
920
|
+
_blockContentSection6 = _blockContentSection6.slice(_selectedIndex7 + 1);
|
|
921
|
+
_rearrangeSections3(_blockContentSection6, 0);
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
};
|
|
925
|
+
_rearrangeSections3(_blockContentSection6, 0);
|
|
926
|
+
//End: Rearranging sections
|
|
927
|
+
|
|
928
|
+
return React__default.createElement(
|
|
929
|
+
React__default.Fragment,
|
|
930
|
+
null,
|
|
931
|
+
React__default.createElement(BlockContent.BlockContent, _extends$1._extends({
|
|
932
|
+
serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting),
|
|
933
|
+
blocks: _blockContentSection5,
|
|
934
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
935
|
+
}, client.config())),
|
|
936
|
+
React__default.createElement('span', { className: 'clearfix' }),
|
|
937
|
+
React__default.createElement(RelatedContent, null),
|
|
938
|
+
React__default.createElement(BlockContent.BlockContent, _extends$1._extends({
|
|
763
939
|
serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, null, null, null, targeting),
|
|
764
|
-
blocks:
|
|
940
|
+
blocks: _blockContentSection6,
|
|
765
941
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
766
942
|
}, client.config()))
|
|
767
943
|
);
|
|
768
944
|
} else {
|
|
769
|
-
return React__default.createElement(BlockContent.BlockContent, _extends._extends({
|
|
945
|
+
return React__default.createElement(BlockContent.BlockContent, _extends$1._extends({
|
|
770
946
|
serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, false, null, props.article.Ads, targeting),
|
|
771
947
|
blocks: articleBody,
|
|
772
948
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
@@ -952,7 +1128,7 @@ var Article = function Article(props) {
|
|
|
952
1128
|
React__default.createElement(
|
|
953
1129
|
'div',
|
|
954
1130
|
{ className: 'ad-box', style: { textAlign: 'center' } },
|
|
955
|
-
main.
|
|
1131
|
+
main.main_36 && !sponsoredFlag && props.article.Ads && props.article.Ads.length > 0 && props.article.Ads.map(function (ad, index) {
|
|
956
1132
|
if (index === 0) {
|
|
957
1133
|
return React__default.createElement(
|
|
958
1134
|
'div',
|
|
@@ -1004,21 +1180,7 @@ var Article = function Article(props) {
|
|
|
1004
1180
|
issue.name
|
|
1005
1181
|
)
|
|
1006
1182
|
),
|
|
1007
|
-
React__default.createElement('div', { className: 'clearfix', style: { minHeight: '1px' } })
|
|
1008
|
-
showRelatedArticles && !showIsi && React__default.createElement(
|
|
1009
|
-
React__default.Fragment,
|
|
1010
|
-
null,
|
|
1011
|
-
React__default.createElement(
|
|
1012
|
-
'div',
|
|
1013
|
-
null,
|
|
1014
|
-
React__default.createElement(RelevantTopics, null)
|
|
1015
|
-
),
|
|
1016
|
-
React__default.createElement(
|
|
1017
|
-
'div',
|
|
1018
|
-
{ className: 'pt-2' },
|
|
1019
|
-
React__default.createElement(RelatedArticle, { articles: article.relatedArticle, client: client })
|
|
1020
|
-
)
|
|
1021
|
-
)
|
|
1183
|
+
React__default.createElement('div', { className: 'clearfix', style: { minHeight: '1px' } })
|
|
1022
1184
|
),
|
|
1023
1185
|
renderIsiContent(props.article)
|
|
1024
1186
|
),
|
|
@@ -1031,7 +1193,7 @@ var Article = function Article(props) {
|
|
|
1031
1193
|
})
|
|
1032
1194
|
)
|
|
1033
1195
|
),
|
|
1034
|
-
main.
|
|
1196
|
+
main.main_36 && !sponsoredFlag && props.article.Ads && props.article.Ads.length > 0 && props.article.Ads.map(function (ad, index) {
|
|
1035
1197
|
if (index > 0) {
|
|
1036
1198
|
return React__default.createElement(
|
|
1037
1199
|
'div',
|
|
@@ -1071,6 +1233,201 @@ var Article = function Article(props) {
|
|
|
1071
1233
|
|
|
1072
1234
|
var _this = undefined;
|
|
1073
1235
|
|
|
1236
|
+
var getRelatedContentArticles = function () {
|
|
1237
|
+
var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee() {
|
|
1238
|
+
var client = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
1239
|
+
var article = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1240
|
+
var prevUrl = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '/';
|
|
1241
|
+
var articleCount = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
1242
|
+
|
|
1243
|
+
var _article$url, url, content_placement, documentGroupMapping, issueGroup, references, params, articles, relatedContentQuery;
|
|
1244
|
+
|
|
1245
|
+
return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
|
|
1246
|
+
while (1) {
|
|
1247
|
+
switch (_context.prev = _context.next) {
|
|
1248
|
+
case 0:
|
|
1249
|
+
_article$url = article.url;
|
|
1250
|
+
_article$url = _article$url === undefined ? {
|
|
1251
|
+
current: null
|
|
1252
|
+
} : _article$url;
|
|
1253
|
+
url = _article$url.current, content_placement = article.content_placement, documentGroupMapping = article.documentGroupMapping, issueGroup = article.issueGroup;
|
|
1254
|
+
references = [];
|
|
1255
|
+
|
|
1256
|
+
if (content_placement && content_placement.length > 0) {
|
|
1257
|
+
content_placement.forEach(function (_ref2) {
|
|
1258
|
+
var path = _ref2.path,
|
|
1259
|
+
_id = _ref2._id;
|
|
1260
|
+
|
|
1261
|
+
if (!_id || typeof _id == 'undefined') {
|
|
1262
|
+
return null;
|
|
1263
|
+
}
|
|
1264
|
+
var prev_url_to_check = prevUrl;
|
|
1265
|
+
if (prev_url_to_check.includes('?')) {
|
|
1266
|
+
prev_url_to_check = prev_url_to_check.split('?')[0];
|
|
1267
|
+
}
|
|
1268
|
+
if (prev_url_to_check.endsWith(path) && _id) references.push(_id);
|
|
1269
|
+
});
|
|
1270
|
+
if (references.length === 0) {
|
|
1271
|
+
content_placement.filter(function (_ref3) {
|
|
1272
|
+
var identifier = _ref3.identifier;
|
|
1273
|
+
return identifier !== 'news';
|
|
1274
|
+
}).forEach(function (_ref4) {
|
|
1275
|
+
var _id = _ref4._id;
|
|
1276
|
+
|
|
1277
|
+
if (_id) references.push(_id);
|
|
1278
|
+
});
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
if (documentGroupMapping && documentGroupMapping.length > 0) {
|
|
1283
|
+
documentGroupMapping.forEach(function (_ref5) {
|
|
1284
|
+
var _id = _ref5._id;
|
|
1285
|
+
|
|
1286
|
+
if (_id) references.push(_id);
|
|
1287
|
+
});
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
if (issueGroup && issueGroup._ref) {
|
|
1291
|
+
references.push(issueGroup._ref);
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
params = { url: url, references: references };
|
|
1295
|
+
articles = [];
|
|
1296
|
+
|
|
1297
|
+
if (!(params.references && params.references.length > 0)) {
|
|
1298
|
+
_context.next = 20;
|
|
1299
|
+
break;
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
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 }';
|
|
1303
|
+
_context.prev = 11;
|
|
1304
|
+
_context.next = 14;
|
|
1305
|
+
return client.fetch(relatedContentQuery, params);
|
|
1306
|
+
|
|
1307
|
+
case 14:
|
|
1308
|
+
articles = _context.sent;
|
|
1309
|
+
_context.next = 20;
|
|
1310
|
+
break;
|
|
1311
|
+
|
|
1312
|
+
case 17:
|
|
1313
|
+
_context.prev = 17;
|
|
1314
|
+
_context.t0 = _context['catch'](11);
|
|
1315
|
+
|
|
1316
|
+
console.error(_context.t0);
|
|
1317
|
+
|
|
1318
|
+
case 20:
|
|
1319
|
+
return _context.abrupt('return', articles);
|
|
1320
|
+
|
|
1321
|
+
case 21:
|
|
1322
|
+
case 'end':
|
|
1323
|
+
return _context.stop();
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
}, _callee, _this, [[11, 17]]);
|
|
1327
|
+
}));
|
|
1328
|
+
|
|
1329
|
+
return function getRelatedContentArticles() {
|
|
1330
|
+
return _ref.apply(this, arguments);
|
|
1331
|
+
};
|
|
1332
|
+
}();
|
|
1333
|
+
|
|
1334
|
+
// const getRelatedContents = async (ctx = null, client = null, article = {}, prevUrl = '/', articleCount = 0) => {
|
|
1335
|
+
// const {
|
|
1336
|
+
// url: { current: url } = {
|
|
1337
|
+
// current: null
|
|
1338
|
+
// },
|
|
1339
|
+
// content_placement,
|
|
1340
|
+
// documentGroupMapping,
|
|
1341
|
+
// issueGroup
|
|
1342
|
+
// } = article
|
|
1343
|
+
// let params = { url }
|
|
1344
|
+
// let conditions = ''
|
|
1345
|
+
|
|
1346
|
+
// if (content_placement && content_placement.length > 0) {
|
|
1347
|
+
// let taxonomy = []
|
|
1348
|
+
// content_placement.forEach(({ path, _id }) => {
|
|
1349
|
+
// if (!_id || typeof _id == 'undefined') {
|
|
1350
|
+
// return null
|
|
1351
|
+
// }
|
|
1352
|
+
// let prev_url_to_check = prevUrl
|
|
1353
|
+
// if (prev_url_to_check.includes('?')) {
|
|
1354
|
+
// prev_url_to_check = prev_url_to_check.split('?')[0]
|
|
1355
|
+
// }
|
|
1356
|
+
// if (prev_url_to_check.endsWith(path) && _id) taxonomy.push(_id)
|
|
1357
|
+
// })
|
|
1358
|
+
// if (taxonomy.length === 0) {
|
|
1359
|
+
// content_placement
|
|
1360
|
+
// .filter(({ identifier }) => identifier !== 'news')
|
|
1361
|
+
// .forEach(({ _id }) => {
|
|
1362
|
+
// if (_id) taxonomy.push(_id)
|
|
1363
|
+
// })
|
|
1364
|
+
// }
|
|
1365
|
+
// if (taxonomy.length > 0) {
|
|
1366
|
+
// params = { ...params, taxonomy }
|
|
1367
|
+
// conditions = `&& taxonomyMapping[]._ref in $taxonomy`
|
|
1368
|
+
// }
|
|
1369
|
+
// }
|
|
1370
|
+
|
|
1371
|
+
// if (documentGroupMapping && documentGroupMapping.length > 0) {
|
|
1372
|
+
// let documentGroup = []
|
|
1373
|
+
// documentGroupMapping.forEach(({ _id }) => {
|
|
1374
|
+
// if (_id) documentGroup.push(_id)
|
|
1375
|
+
// })
|
|
1376
|
+
// if (params.taxonomy && documentGroup.length > 0) {
|
|
1377
|
+
// params = { ...params, documentGroup }
|
|
1378
|
+
// conditions = `&& (taxonomyMapping[]._ref in $taxonomy || documentGroupMapping[]._ref in $documentGroup)`
|
|
1379
|
+
// }
|
|
1380
|
+
// }
|
|
1381
|
+
|
|
1382
|
+
// if (issueGroup && issueGroup._ref) {
|
|
1383
|
+
// if (params.taxonomy && params.documentGroup) {
|
|
1384
|
+
// params = { ...params, issueAssociation: issueGroup._ref }
|
|
1385
|
+
// conditions = `&& (taxonomyMapping[]._ref in $taxonomy || documentGroupMapping[]._ref in $documentGroup || issueGroup._ref == $issueAssociation )`
|
|
1386
|
+
// } else if (params.taxonomy) {
|
|
1387
|
+
// params = { ...params, issueAssociation: issueGroup._ref }
|
|
1388
|
+
// conditions = `&& (taxonomyMapping[]._ref in $taxonomy || issueGroup._ref == $issueAssociation )`
|
|
1389
|
+
// }
|
|
1390
|
+
// }
|
|
1391
|
+
|
|
1392
|
+
// let articles = []
|
|
1393
|
+
// if (params.taxonomy && params.taxonomy.length > 0) {
|
|
1394
|
+
// const relatedContentQuery = `*[
|
|
1395
|
+
// _type == "article"
|
|
1396
|
+
// && defined(title)
|
|
1397
|
+
// && defined(url)
|
|
1398
|
+
// && !(_id in path("drafts.**"))
|
|
1399
|
+
// && is_visible == true
|
|
1400
|
+
// && passwordLock != true
|
|
1401
|
+
// && taxonomyMapping[].disableAds != 'true'
|
|
1402
|
+
// && contentCategory.name != 'Poll'
|
|
1403
|
+
// && contentCategory.name != 'Slideshows'
|
|
1404
|
+
// && contentCategory.disableAds != 'true'
|
|
1405
|
+
// && ExcludeFromInfiniteScroll != true
|
|
1406
|
+
// && url.current != $url
|
|
1407
|
+
// && !defined(body[].videos)
|
|
1408
|
+
// && published <= '${new Date().toISOString()}'
|
|
1409
|
+
// ${conditions}
|
|
1410
|
+
// ]| order(published desc)[${articleCount}]
|
|
1411
|
+
// {
|
|
1412
|
+
// title,
|
|
1413
|
+
// url,
|
|
1414
|
+
// thumbnail
|
|
1415
|
+
// }`
|
|
1416
|
+
|
|
1417
|
+
// try {
|
|
1418
|
+
// articles = await client.fetch(relatedContentQuery, params)
|
|
1419
|
+
// } catch (error) {
|
|
1420
|
+
// console.error(error)
|
|
1421
|
+
// }
|
|
1422
|
+
// }
|
|
1423
|
+
|
|
1424
|
+
// return articles
|
|
1425
|
+
// }
|
|
1426
|
+
|
|
1427
|
+
// export default getRelatedContents
|
|
1428
|
+
|
|
1429
|
+
var _this$1 = undefined;
|
|
1430
|
+
|
|
1074
1431
|
var ArticleQueue = function ArticleQueue(props) {
|
|
1075
1432
|
var _props$prevUrl = props.prevUrl,
|
|
1076
1433
|
prevUrl = _props$prevUrl === undefined ? '/' : _props$prevUrl,
|
|
@@ -1087,7 +1444,7 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1087
1444
|
|
|
1088
1445
|
|
|
1089
1446
|
var firstArticle = function firstArticle() {
|
|
1090
|
-
var article = _extends._Object$assign({}, props.article);
|
|
1447
|
+
var article = _extends$1._Object$assign({}, props.article);
|
|
1091
1448
|
var targeting = getTargeting.getTargeting(props);
|
|
1092
1449
|
article.Ads = Ads.getRightItems(targeting);
|
|
1093
1450
|
return article;
|
|
@@ -1104,7 +1461,7 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1104
1461
|
});
|
|
1105
1462
|
var targeting = getTargeting.getTargeting({ article: activeArticle, cpModificationRequired: cpModificationRequired, position: props.position, prevUrl: prevUrl });
|
|
1106
1463
|
|
|
1107
|
-
if (!main.
|
|
1464
|
+
if (!main.main_36) {
|
|
1108
1465
|
index.lib_3.getGoogletag().then(function (googletag) {
|
|
1109
1466
|
if (window.googletag && googletag.pubadsReady) {
|
|
1110
1467
|
var slots = googletag.pubads().getSlots();
|
|
@@ -1122,7 +1479,7 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1122
1479
|
});
|
|
1123
1480
|
}
|
|
1124
1481
|
//Refresh leaderboard ad on mobile
|
|
1125
|
-
if (main.
|
|
1482
|
+
if (main.main_36) {
|
|
1126
1483
|
var leaderboardSlotId = '';
|
|
1127
1484
|
index.lib_3.getGoogletag().then(function (googletag) {
|
|
1128
1485
|
if (window.googletag && googletag.pubadsReady) {
|
|
@@ -1196,7 +1553,7 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1196
1553
|
switch (_context.prev = _context.next) {
|
|
1197
1554
|
case 0:
|
|
1198
1555
|
if (!(article && article._id)) {
|
|
1199
|
-
_context.next =
|
|
1556
|
+
_context.next = 12;
|
|
1200
1557
|
break;
|
|
1201
1558
|
}
|
|
1202
1559
|
|
|
@@ -1208,17 +1565,22 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1208
1565
|
|
|
1209
1566
|
case 5:
|
|
1210
1567
|
article.relatedArticle = _context.sent;
|
|
1568
|
+
_context.next = 8;
|
|
1569
|
+
return getRelatedContentArticles(null, props.client, article, prevUrl, startingIndex + '..' + endingIndex);
|
|
1570
|
+
|
|
1571
|
+
case 8:
|
|
1572
|
+
article.relatedContentArticles = _context.sent;
|
|
1211
1573
|
targeting = getTargeting.getTargeting({ article: article, cpModificationRequired: cpModificationRequired, prevUrl: prevUrl });
|
|
1212
1574
|
|
|
1213
1575
|
article.Ads = Ads.getRightItems(targeting);
|
|
1214
1576
|
setQueueData([].concat(toConsumableArray._toConsumableArray(queueData), [article]));
|
|
1215
1577
|
|
|
1216
|
-
case
|
|
1578
|
+
case 12:
|
|
1217
1579
|
case 'end':
|
|
1218
1580
|
return _context.stop();
|
|
1219
1581
|
}
|
|
1220
1582
|
}
|
|
1221
|
-
}, _callee, _this);
|
|
1583
|
+
}, _callee, _this$1);
|
|
1222
1584
|
}));
|
|
1223
1585
|
|
|
1224
1586
|
return function (_x) {
|
|
@@ -1283,7 +1645,7 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1283
1645
|
index_es.InfiniteScroll,
|
|
1284
1646
|
{ dataLength: queueData.length, next: loadmore, scrollThreshold: '60%', hasMore: true, style: { overflow: 'hidden' } },
|
|
1285
1647
|
queueData.map(function (article, index) {
|
|
1286
|
-
return React__default.createElement(Article, _extends._extends({
|
|
1648
|
+
return React__default.createElement(Article, _extends$1._extends({
|
|
1287
1649
|
key: index
|
|
1288
1650
|
}, props, {
|
|
1289
1651
|
onChangeArticle: onChangeArticle,
|
|
@@ -1352,7 +1714,7 @@ var Articles = function Articles(props) {
|
|
|
1352
1714
|
index: 0
|
|
1353
1715
|
};
|
|
1354
1716
|
|
|
1355
|
-
return React__default.createElement(ArticleQueue, _extends._extends((_extends2 = {
|
|
1717
|
+
return React__default.createElement(ArticleQueue, _extends$1._extends((_extends2 = {
|
|
1356
1718
|
client: client,
|
|
1357
1719
|
params: params,
|
|
1358
1720
|
relatedArticleQuery: relatedArticleQuery,
|
|
@@ -1366,7 +1728,7 @@ var Articles = function Articles(props) {
|
|
|
1366
1728
|
}, defineProperty$1._defineProperty(_extends2, 'pageview', pageview), defineProperty$1._defineProperty(_extends2, 'onVote', function onVote() {}), defineProperty$1._defineProperty(_extends2, 'ISIContent', ISIContent), defineProperty$1._defineProperty(_extends2, 'videoAccountIDs', videoAccountIDs), defineProperty$1._defineProperty(_extends2, 'sponsoredTaxonomies', []), defineProperty$1._defineProperty(_extends2, 'cpModificationRequired', cpModificationRequired), defineProperty$1._defineProperty(_extends2, 'Settings', Settings), defineProperty$1._defineProperty(_extends2, 'canonicalTag', canonicalTag), _extends2), props));
|
|
1367
1729
|
};
|
|
1368
1730
|
|
|
1369
|
-
var _this$
|
|
1731
|
+
var _this$2 = undefined;
|
|
1370
1732
|
|
|
1371
1733
|
var View = function View(props) {
|
|
1372
1734
|
var router = Router.useRouter();
|
|
@@ -1544,7 +1906,7 @@ var View = function View(props) {
|
|
|
1544
1906
|
props.article.seriesDetail && props.article.seriesDetail.nextUrl && React__default.createElement('link', { rel: 'next', href: props.article.seriesDetail.nextUrl })
|
|
1545
1907
|
)
|
|
1546
1908
|
),
|
|
1547
|
-
!needInfiniteScroll ? React__default.createElement(Article, _extends._extends({ infiniteScroll: false, showRelatedArticles: showRelatedArticles }, props)) : React__default.createElement(Articles, _extends._extends({ infiniteScroll: true, showRelatedArticles: showRelatedArticles, canonicalTag: canonicalTag }, props))
|
|
1909
|
+
!needInfiniteScroll ? React__default.createElement(Article, _extends$1._extends({ infiniteScroll: false, showRelatedArticles: showRelatedArticles }, props)) : React__default.createElement(Articles, _extends$1._extends({ infiniteScroll: true, showRelatedArticles: showRelatedArticles, canonicalTag: canonicalTag }, props))
|
|
1548
1910
|
);
|
|
1549
1911
|
};
|
|
1550
1912
|
|
|
@@ -1625,12 +1987,12 @@ View.returnGetInitialProps = function () {
|
|
|
1625
1987
|
}
|
|
1626
1988
|
|
|
1627
1989
|
article.relatedArticle = null;
|
|
1628
|
-
_context.next =
|
|
1990
|
+
_context.next = 23;
|
|
1629
1991
|
break;
|
|
1630
1992
|
|
|
1631
1993
|
case 16:
|
|
1632
1994
|
if (!article) {
|
|
1633
|
-
_context.next =
|
|
1995
|
+
_context.next = 23;
|
|
1634
1996
|
break;
|
|
1635
1997
|
}
|
|
1636
1998
|
|
|
@@ -1639,8 +2001,13 @@ View.returnGetInitialProps = function () {
|
|
|
1639
2001
|
|
|
1640
2002
|
case 19:
|
|
1641
2003
|
article.relatedArticle = _context.sent;
|
|
2004
|
+
_context.next = 22;
|
|
2005
|
+
return getRelatedContentArticles(context, client, article, prevUrl, '0..2');
|
|
1642
2006
|
|
|
1643
|
-
case
|
|
2007
|
+
case 22:
|
|
2008
|
+
article.relatedContentArticles = _context.sent;
|
|
2009
|
+
|
|
2010
|
+
case 23:
|
|
1644
2011
|
return _context.abrupt('return', {
|
|
1645
2012
|
url: url,
|
|
1646
2013
|
sao: sao,
|
|
@@ -1651,12 +2018,12 @@ View.returnGetInitialProps = function () {
|
|
|
1651
2018
|
sponsoredFlag: sponsoredFlag
|
|
1652
2019
|
});
|
|
1653
2020
|
|
|
1654
|
-
case
|
|
2021
|
+
case 24:
|
|
1655
2022
|
case 'end':
|
|
1656
2023
|
return _context.stop();
|
|
1657
2024
|
}
|
|
1658
2025
|
}
|
|
1659
|
-
}, _callee, _this$
|
|
2026
|
+
}, _callee, _this$2);
|
|
1660
2027
|
}));
|
|
1661
2028
|
|
|
1662
2029
|
return function (_x, _x2, _x3, _x4, _x5) {
|