@mjhls/mjh-framework 1.0.444 → 1.0.446
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 +32 -0
- package/dist/cjs/AD300x250.js +60 -0
- package/dist/cjs/AD300x250x600.js +60 -0
- package/dist/cjs/AD728x90.js +134 -0
- package/dist/cjs/ADFloatingFooter.js +139 -0
- package/dist/cjs/ADFooter.js +45 -0
- package/dist/cjs/ADGutter.js +88 -0
- package/dist/cjs/{ADInfeed-ae1f348d.js → ADInfeed-7609d929.js} +2 -2
- package/dist/cjs/ADSponsoredResources.js +106 -0
- package/dist/cjs/ADWelcome.js +150 -0
- package/dist/cjs/{ADlgInfeed-f4c4a1bf.js → ADlgInfeed-700551ef.js} +2 -2
- package/dist/cjs/AccordionPanel.js +95 -0
- package/dist/cjs/AdSlot.js +166 -0
- package/dist/cjs/AdSlotsProvider.js +31 -0
- package/dist/cjs/AlphabeticList.js +137 -0
- package/dist/cjs/ArticleQueue.js +863 -0
- package/dist/cjs/Auth.js +3950 -0
- package/dist/cjs/{AuthorComponent-b44bb44e.js → AuthorComponent-5bb8f868.js} +1 -1
- package/dist/cjs/Beam.js +347 -0
- package/dist/cjs/{TaxonomyCard-fa09aac1.js → BlockContent-80608595.js} +0 -236
- package/dist/cjs/Breadcrumbs.js +108 -0
- package/dist/cjs/CMEDeck.js +454 -0
- package/dist/cjs/Column1.js +39 -0
- package/dist/cjs/Column2.js +67 -0
- package/dist/cjs/Column3.js +141 -0
- package/dist/cjs/ConferenceArticleCard.js +91 -0
- package/dist/cjs/ConferenceBanner-6c9e718a.js +24 -0
- package/dist/cjs/DeckContent.js +24 -13
- package/dist/cjs/DeckQueue.js +17 -10
- package/dist/cjs/{Dfp-d7639f4c.js → Dfp-19f10ad4.js} +8 -5
- package/dist/cjs/EventsDeck.js +1999 -0
- package/dist/cjs/Feature.js +120 -0
- package/dist/cjs/{Figure-cc919c38.js → Figure-ce37247b.js} +3 -2
- package/dist/cjs/ForbesHero.js +140 -0
- package/dist/cjs/GridContent.js +721 -33
- package/dist/cjs/GridHero.js +145 -0
- package/dist/cjs/GroupDeck.js +5 -3
- package/dist/cjs/HamMagazine.js +477 -0
- package/dist/cjs/Header.js +37 -0
- package/dist/cjs/Hero.js +56 -0
- package/dist/cjs/HighlightenVideo.js +69 -0
- package/dist/cjs/HorizontalHero.js +109 -0
- package/dist/cjs/InscreenSensor-04a70c60.js +864 -0
- package/dist/cjs/IssueContentDeck.js +4 -3
- package/dist/cjs/IssueDeck.js +6 -4
- package/dist/cjs/IssueLanding.js +115 -0
- package/dist/cjs/KMTracker.js +27 -0
- package/dist/cjs/LeftNav.js +99 -0
- package/dist/cjs/MasterDeck.js +15 -8
- package/dist/cjs/NavDvm.js +223 -0
- package/dist/cjs/NavFooter-3dcd99a8.js +66 -0
- package/dist/cjs/NavMagazine.js +436 -0
- package/dist/cjs/NavNative.js +278 -0
- package/dist/cjs/NavNormal.js +109 -0
- package/dist/cjs/OncliveHero.js +78 -0
- package/dist/cjs/OncliveLargeHero.js +243 -0
- package/dist/cjs/PageFilter.js +73 -0
- package/dist/cjs/PdfDownload.js +28 -0
- package/dist/cjs/PopUpModal.js +59 -0
- package/dist/cjs/PublicationLanding.js +556 -0
- package/dist/cjs/QueueDeckExpanded.js +29 -28
- package/dist/cjs/RelatedContent.js +107 -0
- package/dist/cjs/RelatedTopicsDropdown.js +90 -0
- package/dist/cjs/Search.js +67 -0
- package/dist/cjs/Segment.js +225 -0
- package/dist/cjs/SetCookie.js +10 -0
- package/dist/cjs/SideFooter.js +103 -0
- package/dist/cjs/SocialNavFooter-d9ab4d17.js +83 -0
- package/dist/cjs/SocialShare.js +72 -0
- package/dist/cjs/TaxonomyCard.js +241 -11
- package/dist/cjs/TemplateNormal.js +175 -13
- package/dist/cjs/Ustream.js +107 -6
- package/dist/cjs/VerticalHero.js +75 -0
- package/dist/cjs/VideoSeriesFilter.js +133 -0
- package/dist/cjs/VideoSeriesListing.js +13 -7
- package/dist/cjs/View.js +1156 -0
- package/dist/cjs/YahooHero.js +129 -0
- package/dist/cjs/YoutubeGroup.js +5 -3
- package/dist/cjs/_arrayMap-3b4a0f75.js +91 -0
- package/dist/cjs/_is-array-754e012d.js +74 -0
- package/dist/cjs/{_iter-detect-234453c3.js → _iter-detect-4d0352f8.js} +4 -4
- package/dist/cjs/_object-sap-5e74ba08.js +16 -0
- package/dist/cjs/_set-species-4458e975.js +56 -0
- package/dist/cjs/{AdSlot-257d8d4e.js → asyncToGenerator-db08763c.js} +1 -710
- package/dist/cjs/brightcove-react-player-loader.es-4ba0d3d5.js +2231 -0
- package/dist/cjs/{web.dom.iterable-5c889cf1.js → core.get-iterator-method-41e87ec1.js} +0 -46
- package/dist/cjs/debounce-32e57002.js +280 -0
- package/dist/cjs/{toConsumableArray-25d0e2a3.js → from-ea347372.js} +4 -29
- package/dist/cjs/{get-7a75c563.js → get-5dfcdc33.js} +14 -100
- package/dist/cjs/getKeywords.js +31 -0
- package/dist/cjs/getQuery.js +20 -0
- package/dist/cjs/getSerializers.js +8032 -0
- package/dist/cjs/getSeriesDetail.js +38 -0
- package/dist/cjs/getTargeting-3ced038f.js +108 -0
- package/dist/cjs/getTargeting.js +15 -0
- package/dist/cjs/iconBase-637d3f1e.js +83 -0
- package/dist/cjs/{debounce-420ff8a8.js → index-b2448ff6.js} +0 -483
- package/dist/cjs/index.esm-25423c2f.js +16 -0
- package/dist/cjs/index.esm-c0d8b44b.js +21 -0
- package/dist/cjs/index.esm-fcdbd2c6.js +31 -0
- package/dist/cjs/index.js +190 -23083
- package/dist/cjs/{inherits-b4036c94.js → inherits-4a2f1cc3.js} +6 -17
- package/dist/cjs/isSymbol-488934a7.js +211 -0
- package/dist/cjs/js.cookie-a511c430.js +160 -0
- package/dist/cjs/keys-a586b7a0.js +25 -0
- package/dist/cjs/{promise-0a493c7a.js → promise-074978a7.js} +15 -62
- package/dist/cjs/{slicedToArray-419d467a.js → slicedToArray-8063ee51.js} +5 -4
- package/dist/cjs/stringify-7c5aff47.js +17 -0
- package/dist/cjs/toConsumableArray-ca04303b.js +31 -0
- package/dist/cjs/{typeof-0d86b91c.js → typeof-583cdc4b.js} +20 -87
- package/dist/cjs/urlFor.js +10 -0
- package/dist/cjs/util-f2c1b65b.js +576 -0
- package/dist/cjs/web.dom.iterable-43c3e277.js +51 -0
- package/dist/esm/AD.js +26 -0
- package/dist/esm/AD300x250.js +54 -0
- package/dist/esm/AD300x250x600.js +54 -0
- package/dist/esm/AD728x90.js +128 -0
- package/dist/esm/ADFloatingFooter.js +133 -0
- package/dist/esm/ADFooter.js +39 -0
- package/dist/esm/ADGutter.js +82 -0
- package/dist/esm/{ADInfeed-dff74bbe.js → ADInfeed-1c17dc0e.js} +1 -1
- package/dist/esm/ADSponsoredResources.js +100 -0
- package/dist/esm/ADWelcome.js +144 -0
- package/dist/esm/{ADlgInfeed-7b29db85.js → ADlgInfeed-94d7f5dd.js} +1 -1
- package/dist/esm/AccordionPanel.js +88 -0
- package/dist/esm/AdSlot.js +159 -0
- package/dist/esm/AdSlotsProvider.js +25 -0
- package/dist/esm/AlphabeticList.js +131 -0
- package/dist/esm/ArticleQueue.js +855 -0
- package/dist/esm/Auth.js +3930 -0
- package/dist/esm/{AuthorComponent-4f5f15ed.js → AuthorComponent-f67cb027.js} +1 -1
- package/dist/esm/Beam.js +345 -0
- package/dist/esm/{TaxonomyCard-b22a742f.js → BlockContent-4af2feb9.js} +2 -233
- package/dist/esm/Breadcrumbs.js +101 -0
- package/dist/esm/CMEDeck.js +448 -0
- package/dist/esm/Column1.js +29 -0
- package/dist/esm/Column2.js +57 -0
- package/dist/esm/Column3.js +131 -0
- package/dist/esm/ConferenceArticleCard.js +85 -0
- package/dist/esm/ConferenceBanner-9162d0ca.js +18 -0
- package/dist/esm/DeckContent.js +24 -13
- package/dist/esm/DeckQueue.js +17 -10
- package/dist/esm/{Dfp-994cd0ab.js → Dfp-7addbfb1.js} +7 -4
- package/dist/esm/EventsDeck.js +1987 -0
- package/dist/esm/Feature.js +113 -0
- package/dist/esm/{Figure-1c55ebf0.js → Figure-408929f3.js} +4 -3
- package/dist/esm/ForbesHero.js +134 -0
- package/dist/esm/GridContent.js +714 -30
- package/dist/esm/GridHero.js +139 -0
- package/dist/esm/GroupDeck.js +6 -4
- package/dist/esm/HamMagazine.js +465 -0
- package/dist/esm/Header.js +28 -0
- package/dist/esm/Hero.js +50 -0
- package/dist/esm/HighlightenVideo.js +63 -0
- package/dist/esm/HorizontalHero.js +103 -0
- package/dist/esm/InscreenSensor-b7f931bf.js +857 -0
- package/dist/esm/IssueContentDeck.js +5 -4
- package/dist/esm/IssueDeck.js +8 -6
- package/dist/esm/IssueLanding.js +109 -0
- package/dist/esm/KMTracker.js +25 -0
- package/dist/esm/LeftNav.js +90 -0
- package/dist/esm/MasterDeck.js +17 -10
- package/dist/esm/NavDvm.js +211 -0
- package/dist/esm/NavFooter-c29526b7.js +60 -0
- package/dist/esm/NavMagazine.js +424 -0
- package/dist/esm/NavNative.js +266 -0
- package/dist/esm/NavNormal.js +97 -0
- package/dist/esm/OncliveHero.js +72 -0
- package/dist/esm/OncliveLargeHero.js +237 -0
- package/dist/esm/PageFilter.js +67 -0
- package/dist/esm/PdfDownload.js +22 -0
- package/dist/esm/PopUpModal.js +52 -0
- package/dist/esm/PublicationLanding.js +546 -0
- package/dist/esm/QueueDeckExpanded.js +31 -30
- package/dist/esm/RelatedContent.js +101 -0
- package/dist/esm/RelatedTopicsDropdown.js +82 -0
- package/dist/esm/Search.js +58 -0
- package/dist/esm/Segment.js +223 -0
- package/dist/esm/SetCookie.js +8 -0
- package/dist/esm/SideFooter.js +97 -0
- package/dist/esm/SocialNavFooter-1a531144.js +77 -0
- package/dist/esm/SocialShare.js +65 -0
- package/dist/esm/TaxonomyCard.js +237 -11
- package/dist/esm/TemplateNormal.js +175 -14
- package/dist/esm/Ustream.js +107 -6
- package/dist/esm/VerticalHero.js +69 -0
- package/dist/esm/VideoSeriesFilter.js +127 -0
- package/dist/esm/VideoSeriesListing.js +14 -8
- package/dist/esm/View.js +1145 -0
- package/dist/esm/YahooHero.js +123 -0
- package/dist/esm/YoutubeGroup.js +6 -4
- package/dist/esm/_arrayMap-a8dd2b2c.js +87 -0
- package/dist/esm/_is-array-dd5523d6.js +71 -0
- package/dist/esm/{_iter-detect-7c281f0a.js → _iter-detect-6e099a34.js} +2 -2
- package/dist/esm/_object-sap-56bb8073.js +14 -0
- package/dist/esm/_set-species-6f64f1c1.js +51 -0
- package/dist/esm/{_to-object-1b1f7766.js → _to-object-16fd8b46.js} +1 -1
- package/dist/esm/{AdSlot-362a1c30.js → asyncToGenerator-204b5a5c.js} +3 -703
- package/dist/esm/brightcove-react-player-loader.es-e1c6b0f2.js +2225 -0
- package/dist/esm/{web.dom.iterable-e6bf2bf6.js → core.get-iterator-method-f5c0d66a.js} +2 -47
- package/dist/esm/debounce-8cd9e09c.js +277 -0
- package/dist/esm/{extends-92072fff.js → extends-6e00b262.js} +1 -1
- package/dist/esm/{toConsumableArray-c5e2fde8.js → from-2c0a5f49.js} +4 -29
- package/dist/esm/{get-bc6cf9fb.js → get-ae817b75.js} +3 -86
- package/dist/esm/getKeywords.js +29 -0
- package/dist/esm/getQuery.js +18 -0
- package/dist/esm/getSerializers.js +8021 -0
- package/dist/esm/getSeriesDetail.js +36 -0
- package/dist/esm/getTargeting-8f4bd5db.js +105 -0
- package/dist/esm/getTargeting.js +9 -0
- package/dist/esm/iconBase-6ee2f2fb.js +81 -0
- package/dist/esm/{debounce-42a7f724.js → index-fb49124c.js} +2 -476
- package/dist/esm/index.esm-9d6faf80.js +17 -0
- package/dist/esm/index.esm-a7ad65ba.js +13 -0
- package/dist/esm/{index.esm-536609db.js → index.esm-b97cf389.js} +2 -80
- package/dist/esm/index.js +137 -23014
- package/dist/esm/{inherits-bbec2f34.js → inherits-2758cc14.js} +5 -15
- package/dist/esm/isSymbol-c1b9be80.js +203 -0
- package/dist/esm/js.cookie-6874175c.js +158 -0
- package/dist/esm/keys-04cdec91.js +23 -0
- package/dist/esm/{main-cf4930f0.js → main-8c8784b8.js} +1 -1
- package/dist/esm/{promise-2592a80a.js → promise-53143c9a.js} +6 -49
- package/dist/esm/{slicedToArray-04e02710.js → slicedToArray-f1e40361.js} +3 -2
- package/dist/esm/stringify-e30bc114.js +15 -0
- package/dist/esm/toConsumableArray-8712d678.js +29 -0
- package/dist/esm/{typeof-09bf9211.js → typeof-7e72fee0.js} +5 -70
- package/dist/esm/urlFor.js +8 -0
- package/dist/esm/util-7700fc59.js +574 -0
- package/dist/esm/web.dom.iterable-46c95e52.js +49 -0
- package/package.json +1 -1
- package/dist/cjs/GridContent-0df16724.js +0 -735
- package/dist/cjs/Normal-430e8e61.js +0 -2315
- package/dist/cjs/Ustream-46288bdf.js +0 -119
- package/dist/cjs/index.esm-340d3792.js +0 -110
- package/dist/esm/GridContent-2173a84c.js +0 -724
- package/dist/esm/Normal-6efd92da.js +0 -2282
- package/dist/esm/Ustream-c4f281a3.js +0 -112
package/dist/esm/View.js
ADDED
|
@@ -0,0 +1,1145 @@
|
|
|
1
|
+
import { c as createCommonjsModule, u as unwrapExports } from './_commonjsHelpers-0c4b6f40.js';
|
|
2
|
+
import './_to-object-16fd8b46.js';
|
|
3
|
+
import './core.get-iterator-method-f5c0d66a.js';
|
|
4
|
+
import './_library-528f1934.js';
|
|
5
|
+
import './_iter-detect-6e099a34.js';
|
|
6
|
+
import './from-2c0a5f49.js';
|
|
7
|
+
import { _ as _toConsumableArray } from './toConsumableArray-8712d678.js';
|
|
8
|
+
import './_object-pie-33c40e79.js';
|
|
9
|
+
import { _ as _extends, a as _Object$assign } from './extends-6e00b262.js';
|
|
10
|
+
import './_object-sap-56bb8073.js';
|
|
11
|
+
import { e as defineProperty$1 } from './inherits-2758cc14.js';
|
|
12
|
+
import './web.dom.iterable-46c95e52.js';
|
|
13
|
+
import './typeof-7e72fee0.js';
|
|
14
|
+
import './_is-array-dd5523d6.js';
|
|
15
|
+
import React, { useState, useEffect } from 'react';
|
|
16
|
+
import { l as lib_3 } from './index-fb49124c.js';
|
|
17
|
+
import 'prop-types';
|
|
18
|
+
import { m as moment } from './moment-12415288.js';
|
|
19
|
+
import 'next/router';
|
|
20
|
+
import './isSymbol-c1b9be80.js';
|
|
21
|
+
import './debounce-8cd9e09c.js';
|
|
22
|
+
import { I as InfiniteScroll } from './index.es-27d0bae9.js';
|
|
23
|
+
import 'react-dom';
|
|
24
|
+
import './index-73819142.js';
|
|
25
|
+
import './index-c5fd0af5.js';
|
|
26
|
+
import { m as main_36 } from './main-8c8784b8.js';
|
|
27
|
+
import './entities-7cc3bf45.js';
|
|
28
|
+
import { _ as _slicedToArray, a as _getIterator } from './slicedToArray-f1e40361.js';
|
|
29
|
+
import { _ as _JSON$stringify } from './stringify-e30bc114.js';
|
|
30
|
+
import { _ as _asyncToGenerator, r as regenerator } from './asyncToGenerator-204b5a5c.js';
|
|
31
|
+
import './_set-species-6f64f1c1.js';
|
|
32
|
+
import './promise-53143c9a.js';
|
|
33
|
+
import './Beam.js';
|
|
34
|
+
import './Segment.js';
|
|
35
|
+
import DFPAdSlot from './AdSlot.js';
|
|
36
|
+
import './_arrayMap-a8dd2b2c.js';
|
|
37
|
+
import { B as BlockContent } from './BlockContent-4af2feb9.js';
|
|
38
|
+
import './smoothscroll-4b699764.js';
|
|
39
|
+
import './GroupDeck.js';
|
|
40
|
+
import 'react-bootstrap';
|
|
41
|
+
import Button from 'react-bootstrap/Button';
|
|
42
|
+
import Head from 'next/head';
|
|
43
|
+
import 'react-share';
|
|
44
|
+
import SocialShare from './SocialShare.js';
|
|
45
|
+
import Form from 'react-bootstrap/Form';
|
|
46
|
+
import FormControl from 'react-bootstrap/FormControl';
|
|
47
|
+
import { _ as _Object$keys } from './keys-04cdec91.js';
|
|
48
|
+
import Dropdown from 'react-bootstrap/Dropdown';
|
|
49
|
+
import './brightcove-react-player-loader.es-e1c6b0f2.js';
|
|
50
|
+
import { I as InscreenSensor, i as includes_1 } from './InscreenSensor-b7f931bf.js';
|
|
51
|
+
import getSerializers from './getSerializers.js';
|
|
52
|
+
import './util-7700fc59.js';
|
|
53
|
+
import 'react-bootstrap/Pagination';
|
|
54
|
+
import 'next/dynamic';
|
|
55
|
+
import { a as getContentPlacementUrl, g as getTargeting } from './getTargeting-8f4bd5db.js';
|
|
56
|
+
import urlFor from './urlFor.js';
|
|
57
|
+
|
|
58
|
+
var renderAuthor = function renderAuthor(authorName, authorURL, index, length) {
|
|
59
|
+
var defaultUrl = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'authors';
|
|
60
|
+
|
|
61
|
+
if (authorName && authorURL) {
|
|
62
|
+
return React.createElement(
|
|
63
|
+
'span',
|
|
64
|
+
null,
|
|
65
|
+
React.createElement(
|
|
66
|
+
'a',
|
|
67
|
+
{ href: '/' + defaultUrl + '/' + authorURL.current, key: index },
|
|
68
|
+
authorName
|
|
69
|
+
),
|
|
70
|
+
length !== index + 1 && ' , '
|
|
71
|
+
);
|
|
72
|
+
} else if (authorName) {
|
|
73
|
+
return React.createElement(
|
|
74
|
+
'span',
|
|
75
|
+
{ key: index },
|
|
76
|
+
authorName,
|
|
77
|
+
length !== index + 1 && ' , '
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
var getArticleSummary = function getArticleSummary(article) {
|
|
83
|
+
if (article.summary && article.summary.length > 0) {
|
|
84
|
+
return article.summary;
|
|
85
|
+
} else {
|
|
86
|
+
var _article$body = article.body,
|
|
87
|
+
body = _article$body === undefined ? [] : _article$body;
|
|
88
|
+
|
|
89
|
+
var desc = '';
|
|
90
|
+
body.some(function (children) {
|
|
91
|
+
children.children && children.children.some(function (item) {
|
|
92
|
+
if (item.text && String(item.text).trim().length > 0 && desc === '') {
|
|
93
|
+
desc = String(item.text);
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
if (desc !== '') {
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
return desc;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
var getDocumentGroupUrl = function getDocumentGroupUrl(docGroup) {
|
|
106
|
+
if (!docGroup) {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
var url = void 0;
|
|
110
|
+
if (docGroup.path.includes('/')) {
|
|
111
|
+
return "/" + docGroup.path;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (docGroup.parent) {
|
|
115
|
+
url = '/' + docGroup.parent.identifier.current;
|
|
116
|
+
if (docGroup.parent.parent && docGroup.parent.parent.name) {
|
|
117
|
+
url = '/' + docGroup.parent.parent.identifier.current + url;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (!docGroup.thumbnail) ;
|
|
122
|
+
url = url + '/' + docGroup.path;
|
|
123
|
+
|
|
124
|
+
return url;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
var getDocumentGroupName = function getDocumentGroupName(docGroup) {
|
|
128
|
+
var name = void 0;
|
|
129
|
+
if (!docGroup) {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (docGroup.parent) {
|
|
134
|
+
name = docGroup.parent.name;
|
|
135
|
+
|
|
136
|
+
if (docGroup.parent.parent && docGroup.parent.parent.name) {
|
|
137
|
+
name = docGroup.parent.parent.name + ' | ' + name;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (!docGroup.thumbnail) {
|
|
142
|
+
name = name + ' | <b>' + docGroup.name + '</b>';
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return name;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
var DocumentGroup = function DocumentGroup(_ref) {
|
|
149
|
+
var article = _ref.article,
|
|
150
|
+
client = _ref.client;
|
|
151
|
+
|
|
152
|
+
if (!article.documentGroup) {
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
var name = getDocumentGroupName(article.documentGroup);
|
|
156
|
+
var url = getDocumentGroupUrl(article.documentGroup);
|
|
157
|
+
var thumbnailUrl = false;
|
|
158
|
+
|
|
159
|
+
if (article.documentGroup.thumbnail) {
|
|
160
|
+
thumbnailUrl = urlFor(client, article.documentGroup.thumbnail).url();
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return React.createElement(
|
|
164
|
+
'a',
|
|
165
|
+
{
|
|
166
|
+
href: url,
|
|
167
|
+
className: 'doc-group',
|
|
168
|
+
style: { display: 'flex', flexDirection: 'column', padding: '0 1rem', justifyContent: thumbnailUrl ? 'center' : 'flex-start', alignItems: 'center' } },
|
|
169
|
+
thumbnailUrl && React.createElement('img', { style: { maxWidth: '220px', maxHeight: '100px', marginTop: '1rem' }, src: thumbnailUrl, alt: name }),
|
|
170
|
+
React.createElement('p', {
|
|
171
|
+
style: { maxWidth: '315px', margin: '0', color: 'var(--primary)', textAlign: thumbnailUrl ? 'center' : main_36 ? 'left' : 'right', marginTop: '.25rem' },
|
|
172
|
+
dangerouslySetInnerHTML: { __html: name } }),
|
|
173
|
+
main_36 && !thumbnailUrl && React.createElement(
|
|
174
|
+
'style',
|
|
175
|
+
{ jsx: 'true' },
|
|
176
|
+
'\n a.doc-group {\n display: block !important;\n padding: 0!important;\n }\n '
|
|
177
|
+
)
|
|
178
|
+
);
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
var Article = function Article(props) {
|
|
182
|
+
var onVote = function () {
|
|
183
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(nodeKey, selectedChoice) {
|
|
184
|
+
var response, result;
|
|
185
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
186
|
+
while (1) {
|
|
187
|
+
switch (_context.prev = _context.next) {
|
|
188
|
+
case 0:
|
|
189
|
+
_context.next = 2;
|
|
190
|
+
return fetch('/api/polls/vote', {
|
|
191
|
+
method: 'POST',
|
|
192
|
+
headers: { 'Content-Type': 'application/json' },
|
|
193
|
+
body: _JSON$stringify({ articleId: props.article._id, nodeKey: nodeKey, selectedChoice: selectedChoice, body: articleBody })
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
case 2:
|
|
197
|
+
response = _context.sent;
|
|
198
|
+
|
|
199
|
+
if (!response.ok) {
|
|
200
|
+
_context.next = 11;
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
_context.next = 6;
|
|
205
|
+
return response.json();
|
|
206
|
+
|
|
207
|
+
case 6:
|
|
208
|
+
result = _context.sent;
|
|
209
|
+
|
|
210
|
+
setShowVotes(true);
|
|
211
|
+
|
|
212
|
+
console.log('Voted successfully');
|
|
213
|
+
_context.next = 12;
|
|
214
|
+
break;
|
|
215
|
+
|
|
216
|
+
case 11:
|
|
217
|
+
console.log('Unable to vote!');
|
|
218
|
+
|
|
219
|
+
case 12:
|
|
220
|
+
case 'end':
|
|
221
|
+
return _context.stop();
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}, _callee, this);
|
|
225
|
+
}));
|
|
226
|
+
|
|
227
|
+
return function onVote(_x, _x2) {
|
|
228
|
+
return _ref.apply(this, arguments);
|
|
229
|
+
};
|
|
230
|
+
}();
|
|
231
|
+
|
|
232
|
+
var article = props.article;
|
|
233
|
+
var client = props.client,
|
|
234
|
+
pageview = props.pageview,
|
|
235
|
+
videoAccountIDs = props.videoAccountIDs,
|
|
236
|
+
drupalLeadSettings = props.drupalLeadSettings,
|
|
237
|
+
currentPage = props.currentPage,
|
|
238
|
+
_props$article = props.article,
|
|
239
|
+
title = _props$article.title,
|
|
240
|
+
_props$article$passwo = _props$article.passwordLock,
|
|
241
|
+
passwordLock = _props$article$passwo === undefined ? false : _props$article$passwo,
|
|
242
|
+
authorDetails = _props$article.authorDetails,
|
|
243
|
+
pageNumber = _props$article.pageNumber,
|
|
244
|
+
published = _props$article.published,
|
|
245
|
+
articleBody = _props$article.body,
|
|
246
|
+
thumbnail = _props$article.thumbnail,
|
|
247
|
+
content_placement = _props$article.content_placement,
|
|
248
|
+
_props$article$url = _props$article.url;
|
|
249
|
+
_props$article$url = _props$article$url === undefined ? {
|
|
250
|
+
current: ''
|
|
251
|
+
} : _props$article$url;
|
|
252
|
+
var url = _props$article$url.current,
|
|
253
|
+
issue = _props$article.issue,
|
|
254
|
+
source = _props$article.source,
|
|
255
|
+
documentGroup = _props$article.documentGroup,
|
|
256
|
+
regionalPages = props.regionalPages,
|
|
257
|
+
nationalPage = props.nationalPage,
|
|
258
|
+
ISIContent = props.ISIContent,
|
|
259
|
+
shareOptions = props.shareOptions,
|
|
260
|
+
cpModificationRequired = props.cpModificationRequired,
|
|
261
|
+
authorPrefix = props.authorPrefix;
|
|
262
|
+
var changeUrl = props.changeUrl;
|
|
263
|
+
|
|
264
|
+
var _useState = useState(null),
|
|
265
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
266
|
+
contextualADFlag = _useState2[0],
|
|
267
|
+
setContextualADFlag = _useState2[1];
|
|
268
|
+
|
|
269
|
+
var summary = getArticleSummary(props.article);
|
|
270
|
+
|
|
271
|
+
var _useState3 = useState(1),
|
|
272
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
273
|
+
auth = _useState4[0],
|
|
274
|
+
setAuth = _useState4[1];
|
|
275
|
+
|
|
276
|
+
var _useState5 = useState(''),
|
|
277
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
278
|
+
passwordKey = _useState6[0],
|
|
279
|
+
setPasswordKey = _useState6[1];
|
|
280
|
+
|
|
281
|
+
var _useState7 = useState(false),
|
|
282
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
283
|
+
showVotes = _useState8[0],
|
|
284
|
+
setShowVotes = _useState8[1];
|
|
285
|
+
|
|
286
|
+
var isCutomPage = function isCutomPage(article) {
|
|
287
|
+
var url = article.url.current;
|
|
288
|
+
|
|
289
|
+
if (regionalPages || nationalPage) {
|
|
290
|
+
return regionalPages.includes(url) || nationalPage === url;
|
|
291
|
+
} else {
|
|
292
|
+
return false;
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
var renderIsiContent = function renderIsiContent(article) {
|
|
297
|
+
var url = article.url.current;
|
|
298
|
+
|
|
299
|
+
if (regionalPages && ISIContent && regionalPages.includes(url)) {
|
|
300
|
+
return React.createElement(ISIContent, null);
|
|
301
|
+
} else if (nationalPage === url && ISIContent) {
|
|
302
|
+
return React.createElement(ISIContent, { national: true });
|
|
303
|
+
}
|
|
304
|
+
return null;
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
var renderRelevantTopicsDropdown = function renderRelevantTopicsDropdown() {
|
|
308
|
+
if (content_placement && content_placement.length > 0 || documentGroup) {
|
|
309
|
+
return React.createElement(
|
|
310
|
+
Dropdown,
|
|
311
|
+
null,
|
|
312
|
+
React.createElement(
|
|
313
|
+
Dropdown.Toggle,
|
|
314
|
+
{ variant: 'primary', id: 'partner-dropdown' },
|
|
315
|
+
'Relevant Topics'
|
|
316
|
+
),
|
|
317
|
+
React.createElement(
|
|
318
|
+
Dropdown.Menu,
|
|
319
|
+
null,
|
|
320
|
+
documentGroup && documentGroup.parent && React.createElement(
|
|
321
|
+
Dropdown.Item,
|
|
322
|
+
{ href: cpModificationRequired ? '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path : '/' + documentGroup.path },
|
|
323
|
+
documentGroup.name
|
|
324
|
+
),
|
|
325
|
+
content_placement.length > 0 ? content_placement.map(function (cp, index) {
|
|
326
|
+
var cp_url = cpModificationRequired ? getContentPlacementUrl(cp) : cp.path;
|
|
327
|
+
var href = '/' + cp_url;
|
|
328
|
+
return React.createElement(
|
|
329
|
+
Dropdown.Item,
|
|
330
|
+
{ key: index, href: href },
|
|
331
|
+
cp.name
|
|
332
|
+
);
|
|
333
|
+
}) : null
|
|
334
|
+
)
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
return null;
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
var form = function form() {
|
|
341
|
+
return React.createElement(
|
|
342
|
+
React.Fragment,
|
|
343
|
+
null,
|
|
344
|
+
React.createElement(
|
|
345
|
+
Head,
|
|
346
|
+
null,
|
|
347
|
+
React.createElement('meta', { name: 'googlebot', content: 'noindex' })
|
|
348
|
+
),
|
|
349
|
+
React.createElement(
|
|
350
|
+
'div',
|
|
351
|
+
{ className: 'mt-5', style: { display: 'flex', justifyContent: 'center', alignItems: 'center' } },
|
|
352
|
+
React.createElement(
|
|
353
|
+
Form,
|
|
354
|
+
{
|
|
355
|
+
inline: true,
|
|
356
|
+
onSubmit: function onSubmit(e) {
|
|
357
|
+
e.preventDefault();
|
|
358
|
+
} },
|
|
359
|
+
React.createElement(FormControl, { type: 'text', className: 'mr-sm-2', value: passwordKey, onChange: function onChange(e) {
|
|
360
|
+
return setPasswordKey(e.target.value);
|
|
361
|
+
}, placeholder: 'Password' }),
|
|
362
|
+
React.createElement(
|
|
363
|
+
Button,
|
|
364
|
+
{
|
|
365
|
+
variant: 'primary',
|
|
366
|
+
onClick: function onClick() {
|
|
367
|
+
if (passwordKey === props.article.password) {
|
|
368
|
+
setAuth(2);
|
|
369
|
+
} else {
|
|
370
|
+
alert('Incorrect Password');
|
|
371
|
+
}
|
|
372
|
+
} },
|
|
373
|
+
'Submit'
|
|
374
|
+
)
|
|
375
|
+
)
|
|
376
|
+
)
|
|
377
|
+
);
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
var renderBlockContent = function renderBlockContent(payload) {
|
|
381
|
+
var _payload = payload,
|
|
382
|
+
body = _payload.body;
|
|
383
|
+
|
|
384
|
+
var findIndex = function findIndex(arr) {
|
|
385
|
+
var indexes = [];
|
|
386
|
+
var _iteratorNormalCompletion = true;
|
|
387
|
+
var _didIteratorError = false;
|
|
388
|
+
var _iteratorError = undefined;
|
|
389
|
+
|
|
390
|
+
try {
|
|
391
|
+
for (var _iterator = _getIterator(arr), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
392
|
+
var ele = _step.value;
|
|
393
|
+
|
|
394
|
+
if (ele['_type'] === 'block' && ele.children.some(function (child) {
|
|
395
|
+
return child.text.trim().length > 0;
|
|
396
|
+
}) && ele['listItem'] !== 'bullet' && ele['style'] === 'normal' || ele['_type'] === 'figure') {
|
|
397
|
+
indexes.push(arr.indexOf(ele));
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
} catch (err) {
|
|
401
|
+
_didIteratorError = true;
|
|
402
|
+
_iteratorError = err;
|
|
403
|
+
} finally {
|
|
404
|
+
try {
|
|
405
|
+
if (!_iteratorNormalCompletion && _iterator.return) {
|
|
406
|
+
_iterator.return();
|
|
407
|
+
}
|
|
408
|
+
} finally {
|
|
409
|
+
if (_didIteratorError) {
|
|
410
|
+
throw _iteratorError;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
return indexes;
|
|
416
|
+
};
|
|
417
|
+
var indexes = findIndex(body);
|
|
418
|
+
if (indexes.length >= 2 && body.length > 3 && payload.contextualAD && payload.contextualVideoAD) {
|
|
419
|
+
payload = _extends({}, payload, {
|
|
420
|
+
contextualAD: _extends({}, payload.contextualAD, {
|
|
421
|
+
slotId: (payload.contextualAD.slotId || 'native-ad') + '-' + payload._id
|
|
422
|
+
}),
|
|
423
|
+
contextualVideoAD: _extends({}, payload.contextualVideoAD, {
|
|
424
|
+
slotId: (payload.contextualVideoAD.slotId || 'in-context_video') + '-' + payload._id
|
|
425
|
+
})
|
|
426
|
+
});
|
|
427
|
+
var selectedIndex = indexes[1] + 1;
|
|
428
|
+
|
|
429
|
+
var checkIsAdFound = function checkIsAdFound(isFound) {
|
|
430
|
+
if (!isFound) {
|
|
431
|
+
var parent = document.getElementById('contextual-native-ad-' + payload._id);
|
|
432
|
+
parent.style.height = '0%';
|
|
433
|
+
parent.style.width = '0%';
|
|
434
|
+
parent.style.display = 'none';
|
|
435
|
+
setContextualADFlag(false);
|
|
436
|
+
} else {
|
|
437
|
+
if (body[0]._type === 'figure' || body[1]._type === 'figure' || body[2]._type === 'figure' || body[3]._type === 'figure') {
|
|
438
|
+
setContextualADFlag(true);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
|
|
443
|
+
var checkIsVideoAdFound = function checkIsVideoAdFound(isFound) {
|
|
444
|
+
if (!isFound) {
|
|
445
|
+
var parent = document.getElementById('contextual-video-ad-' + payload._id);
|
|
446
|
+
parent.style.height = '0%';
|
|
447
|
+
parent.style.width = '0%';
|
|
448
|
+
parent.style.display = 'none';
|
|
449
|
+
setContextualADFlag(false);
|
|
450
|
+
} else {
|
|
451
|
+
setContextualADFlag(true);
|
|
452
|
+
}
|
|
453
|
+
};
|
|
454
|
+
|
|
455
|
+
return React.createElement(
|
|
456
|
+
React.Fragment,
|
|
457
|
+
null,
|
|
458
|
+
React.createElement(BlockContent, _extends({
|
|
459
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, showVotes, drupalLeadSettings, currentPage, false, contextualADFlag),
|
|
460
|
+
blocks: [].concat(_toConsumableArray(body.slice(0, selectedIndex))),
|
|
461
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
462
|
+
}, client.config())),
|
|
463
|
+
React.createElement('span', { className: 'clearfix' }),
|
|
464
|
+
React.createElement(
|
|
465
|
+
'div',
|
|
466
|
+
{ id: 'contextual-native-ad-' + payload._id, className: 'contextual-native-ad' },
|
|
467
|
+
React.createElement(DFPAdSlot, _extends({}, payload.contextualAD, { refreshFlag: false, checkIsAdFound: checkIsAdFound }))
|
|
468
|
+
),
|
|
469
|
+
React.createElement('span', { className: 'clearfix' }),
|
|
470
|
+
React.createElement(
|
|
471
|
+
'div',
|
|
472
|
+
{ id: 'contextual-video-ad-' + payload._id, className: 'contextual-video-ad' },
|
|
473
|
+
React.createElement(DFPAdSlot, _extends({}, payload.contextualVideoAD, { refreshFlag: false, checkIsAdFound: checkIsVideoAdFound }))
|
|
474
|
+
),
|
|
475
|
+
React.createElement(BlockContent, _extends({
|
|
476
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, showVotes, drupalLeadSettings, currentPage, false),
|
|
477
|
+
blocks: [].concat(_toConsumableArray(body.slice(selectedIndex))),
|
|
478
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
479
|
+
}, client.config()))
|
|
480
|
+
);
|
|
481
|
+
} else if (indexes.length >= 2 && body.length > 3 && payload.contextualAD && !payload.contextualVideoAD) {
|
|
482
|
+
payload = _extends({}, payload, {
|
|
483
|
+
contextualAD: _extends({}, payload.contextualAD, {
|
|
484
|
+
slotId: (payload.contextualAD.slotId || 'native-ad') + '-' + payload._id
|
|
485
|
+
})
|
|
486
|
+
});
|
|
487
|
+
var _selectedIndex = indexes[1] + 1;
|
|
488
|
+
|
|
489
|
+
var _checkIsAdFound = function _checkIsAdFound(isFound) {
|
|
490
|
+
if (!isFound) {
|
|
491
|
+
var parent = document.getElementById('contextual-native-ad-' + payload._id);
|
|
492
|
+
parent.style.height = '0%';
|
|
493
|
+
parent.style.width = '0%';
|
|
494
|
+
parent.style.display = 'none';
|
|
495
|
+
setContextualADFlag(false);
|
|
496
|
+
} else {
|
|
497
|
+
if (body && body[1] && body[1]._type === 'figure') {
|
|
498
|
+
setContextualADFlag(true);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
|
|
503
|
+
return React.createElement(
|
|
504
|
+
React.Fragment,
|
|
505
|
+
null,
|
|
506
|
+
React.createElement(BlockContent, _extends({
|
|
507
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings, currentPage, false, contextualADFlag),
|
|
508
|
+
blocks: [].concat(_toConsumableArray(body.slice(0, _selectedIndex))),
|
|
509
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
510
|
+
}, client.config())),
|
|
511
|
+
contextualADFlag && React.createElement('span', { className: 'clearfix' }),
|
|
512
|
+
React.createElement(
|
|
513
|
+
'div',
|
|
514
|
+
{ id: 'contextual-native-ad-' + payload._id, className: 'contextual-native-ad' },
|
|
515
|
+
React.createElement(DFPAdSlot, _extends({}, payload.contextualAD, { refreshFlag: false, checkIsAdFound: _checkIsAdFound }))
|
|
516
|
+
),
|
|
517
|
+
contextualADFlag && React.createElement('span', { className: 'clearfix' }),
|
|
518
|
+
React.createElement(BlockContent, _extends({
|
|
519
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings, currentPage, false),
|
|
520
|
+
blocks: [].concat(_toConsumableArray(body.slice(_selectedIndex))),
|
|
521
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
522
|
+
}, client.config()))
|
|
523
|
+
);
|
|
524
|
+
} else if (indexes.length >= 2 && body.length > 3 && payload.contextualVideoAD && !payload.contextualAD) {
|
|
525
|
+
payload = _extends({}, payload, {
|
|
526
|
+
contextualVideoAD: _extends({}, payload.contextualVideoAD, {
|
|
527
|
+
slotId: (payload.contextualVideoAD.slotId || 'in-context_video') + '-' + payload._id
|
|
528
|
+
})
|
|
529
|
+
});
|
|
530
|
+
var _selectedIndex2 = indexes[1] + 1;
|
|
531
|
+
|
|
532
|
+
var _checkIsAdFound2 = function _checkIsAdFound2(isFound) {
|
|
533
|
+
if (!isFound) {
|
|
534
|
+
var parent = document.getElementById('contextual-video-ad-' + payload._id);
|
|
535
|
+
parent.style.height = '0%';
|
|
536
|
+
parent.style.width = '0%';
|
|
537
|
+
parent.style.display = 'none';
|
|
538
|
+
setContextualADFlag(false);
|
|
539
|
+
} else {
|
|
540
|
+
if (body && body[1] && body[1]._type === 'figure') {
|
|
541
|
+
setContextualADFlag(true);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
};
|
|
545
|
+
|
|
546
|
+
return React.createElement(
|
|
547
|
+
React.Fragment,
|
|
548
|
+
null,
|
|
549
|
+
React.createElement(BlockContent, _extends({
|
|
550
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, showVotes, drupalLeadSettings, currentPage, false, contextualADFlag),
|
|
551
|
+
blocks: [].concat(_toConsumableArray(body.slice(0, _selectedIndex2))),
|
|
552
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
553
|
+
}, client.config())),
|
|
554
|
+
React.createElement('span', { className: 'clearfix' }),
|
|
555
|
+
React.createElement(
|
|
556
|
+
'div',
|
|
557
|
+
{ id: 'contextual-video-ad-' + payload._id, className: 'contextual-video-ad' },
|
|
558
|
+
React.createElement(DFPAdSlot, _extends({}, payload.contextualVideoAD, { refreshFlag: false, checkIsAdFound: _checkIsAdFound2 }))
|
|
559
|
+
),
|
|
560
|
+
React.createElement(BlockContent, _extends({
|
|
561
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, showVotes, drupalLeadSettings, currentPage, false),
|
|
562
|
+
blocks: [].concat(_toConsumableArray(body.slice(_selectedIndex2))),
|
|
563
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
564
|
+
}, client.config()))
|
|
565
|
+
);
|
|
566
|
+
} else {
|
|
567
|
+
return React.createElement(BlockContent, _extends({
|
|
568
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, showVotes, drupalLeadSettings, currentPage, false),
|
|
569
|
+
blocks: articleBody,
|
|
570
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
571
|
+
}, client.config()));
|
|
572
|
+
}
|
|
573
|
+
};
|
|
574
|
+
|
|
575
|
+
var detail = function detail() {
|
|
576
|
+
var shareVia = shareOptions.shareVia,
|
|
577
|
+
shareSubject = shareOptions.shareSubject,
|
|
578
|
+
twitterSiteName = shareOptions.twitterSiteName,
|
|
579
|
+
shareImageDefault = shareOptions.shareImageDefault,
|
|
580
|
+
shareBaseUrl = shareOptions.shareBaseUrl,
|
|
581
|
+
shareSiteTitle = shareOptions.shareSiteTitle;
|
|
582
|
+
|
|
583
|
+
var shareUrl = shareBaseUrl + props.article.url.current;
|
|
584
|
+
var shareTitle = article.title;
|
|
585
|
+
var shareSummary = article.summary;
|
|
586
|
+
var shareImage = thumbnail && thumbnail.asset ? urlFor(props.client, thumbnail.asset).url() : shareImageDefault;
|
|
587
|
+
var siteName = props.website && props.website.title ? props.website.title : '';
|
|
588
|
+
|
|
589
|
+
var meta = {
|
|
590
|
+
shareTitle: shareTitle,
|
|
591
|
+
shareSiteName: props.cache.siteSettingCache.name,
|
|
592
|
+
shareSummary: shareSummary,
|
|
593
|
+
shareUrl: shareUrl,
|
|
594
|
+
shareImage: shareImage,
|
|
595
|
+
shareVia: props.Settings.title
|
|
596
|
+
};
|
|
597
|
+
if (!props.infiniteScroll) {
|
|
598
|
+
changeUrl = function changeUrl() {
|
|
599
|
+
return null;
|
|
600
|
+
};
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
return React.createElement(
|
|
604
|
+
React.Fragment,
|
|
605
|
+
null,
|
|
606
|
+
React.createElement(
|
|
607
|
+
InscreenSensor,
|
|
608
|
+
{
|
|
609
|
+
offSetTop: 120,
|
|
610
|
+
className: 'inscreen-wrapper',
|
|
611
|
+
id: 'article-' + title,
|
|
612
|
+
onChange: function onChange(visible) {
|
|
613
|
+
if (visible === 'top' || visible === 'bottom' || visible === 'small-top') {
|
|
614
|
+
changeUrl(url, visible, meta);
|
|
615
|
+
}
|
|
616
|
+
} },
|
|
617
|
+
React.createElement(
|
|
618
|
+
'div',
|
|
619
|
+
null,
|
|
620
|
+
React.createElement(
|
|
621
|
+
'div',
|
|
622
|
+
{ className: 'video-detail', style: { marginBottom: isCutomPage(props.article) ? '150px' : 0 } },
|
|
623
|
+
React.createElement(
|
|
624
|
+
'h1',
|
|
625
|
+
{ className: 'page-title' },
|
|
626
|
+
title
|
|
627
|
+
),
|
|
628
|
+
React.createElement(
|
|
629
|
+
'div',
|
|
630
|
+
{ className: 'mb-4 doc-group-container', style: { display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end' } },
|
|
631
|
+
React.createElement(
|
|
632
|
+
'style',
|
|
633
|
+
{ jsx: 'true' },
|
|
634
|
+
'\n @media screen and (max-width: 468px) {\n .video-detail .doc-group-container {\n flex-direction: column;\n align-items: flex-start !important;\n }\n .video-detail .doc-group {\n margin-top: 2rem;\n width: calc(100vw - 45px);\n align-items: center;\n }\n .video-detail .doc-group img,\n .doc-group p {\n max-width: calc(100vw - 45px) !important;\n }\n }\n '
|
|
635
|
+
),
|
|
636
|
+
React.createElement(
|
|
637
|
+
'div',
|
|
638
|
+
{ className: 'left-wrap' },
|
|
639
|
+
React.createElement(
|
|
640
|
+
'div',
|
|
641
|
+
null,
|
|
642
|
+
moment(published).format('LL')
|
|
643
|
+
),
|
|
644
|
+
React.createElement(
|
|
645
|
+
'div',
|
|
646
|
+
{ className: 'mb-3' },
|
|
647
|
+
authorDetails && authorDetails.map(function (authorDetail, index) {
|
|
648
|
+
return React.createElement(
|
|
649
|
+
'span',
|
|
650
|
+
{ key: index },
|
|
651
|
+
renderAuthor(authorDetail.displayName, authorDetail.url, index, authorDetails.length, authorPrefix)
|
|
652
|
+
);
|
|
653
|
+
}),
|
|
654
|
+
React.createElement(
|
|
655
|
+
'div',
|
|
656
|
+
null,
|
|
657
|
+
source && React.createElement(
|
|
658
|
+
'p',
|
|
659
|
+
{
|
|
660
|
+
style: {
|
|
661
|
+
display: 'inline-block',
|
|
662
|
+
padding: '0 .25rem',
|
|
663
|
+
color: 'var(--franchise-primary, #484848)',
|
|
664
|
+
borderRadius: '2px',
|
|
665
|
+
fontWeight: 'bold',
|
|
666
|
+
border: '2px solid var(--franchise-primary, #484848)'
|
|
667
|
+
},
|
|
668
|
+
className: 'source-label' },
|
|
669
|
+
source
|
|
670
|
+
)
|
|
671
|
+
),
|
|
672
|
+
issue && React.createElement(
|
|
673
|
+
'div',
|
|
674
|
+
null,
|
|
675
|
+
React.createElement(
|
|
676
|
+
'div',
|
|
677
|
+
{ className: 'volume-issue' },
|
|
678
|
+
React.createElement(
|
|
679
|
+
'p',
|
|
680
|
+
null,
|
|
681
|
+
issue.volume && React.createElement(
|
|
682
|
+
'span',
|
|
683
|
+
null,
|
|
684
|
+
'Volume ' + issue.volume,
|
|
685
|
+
','
|
|
686
|
+
),
|
|
687
|
+
issue.issueNumber && React.createElement(
|
|
688
|
+
'span',
|
|
689
|
+
null,
|
|
690
|
+
' Issue ' + issue.issueNumber
|
|
691
|
+
)
|
|
692
|
+
)
|
|
693
|
+
)
|
|
694
|
+
),
|
|
695
|
+
pageNumber && React.createElement(
|
|
696
|
+
'div',
|
|
697
|
+
{ className: 'article-pageNumber' },
|
|
698
|
+
'Page Number: ' + pageNumber
|
|
699
|
+
)
|
|
700
|
+
),
|
|
701
|
+
React.createElement(
|
|
702
|
+
'p',
|
|
703
|
+
null,
|
|
704
|
+
React.createElement(SocialShare, {
|
|
705
|
+
shareUrl: shareUrl,
|
|
706
|
+
shareTitle: shareTitle,
|
|
707
|
+
shareVia: shareVia,
|
|
708
|
+
shareSummary: shareSummary,
|
|
709
|
+
shareSubject: shareSubject,
|
|
710
|
+
shareImage: shareImage,
|
|
711
|
+
size: 32,
|
|
712
|
+
siteName: siteName,
|
|
713
|
+
twitterSiteName: twitterSiteName,
|
|
714
|
+
disableMeta: true
|
|
715
|
+
})
|
|
716
|
+
),
|
|
717
|
+
renderRelevantTopicsDropdown()
|
|
718
|
+
),
|
|
719
|
+
React.createElement(
|
|
720
|
+
'div',
|
|
721
|
+
null,
|
|
722
|
+
React.createElement(DocumentGroup, { article: props.article, client: props.client })
|
|
723
|
+
)
|
|
724
|
+
),
|
|
725
|
+
React.createElement(
|
|
726
|
+
'p',
|
|
727
|
+
null,
|
|
728
|
+
React.createElement(
|
|
729
|
+
'em',
|
|
730
|
+
null,
|
|
731
|
+
summary
|
|
732
|
+
),
|
|
733
|
+
React.createElement('br', null),
|
|
734
|
+
React.createElement('br', null)
|
|
735
|
+
),
|
|
736
|
+
React.createElement(
|
|
737
|
+
'div',
|
|
738
|
+
{ className: 'ad-box', style: { textAlign: 'center' } },
|
|
739
|
+
main_36 && props.article.Ads && props.article.Ads.length > 0 && props.article.Ads.map(function (ad, index) {
|
|
740
|
+
if (index === 0) {
|
|
741
|
+
return React.createElement(
|
|
742
|
+
'div',
|
|
743
|
+
{
|
|
744
|
+
key: index,
|
|
745
|
+
id: 'addid-' + index,
|
|
746
|
+
style: {
|
|
747
|
+
display: 'flex',
|
|
748
|
+
flex: '1 0 auto',
|
|
749
|
+
justifyContent: 'center',
|
|
750
|
+
alignItems: 'center',
|
|
751
|
+
textAlign: 'center'
|
|
752
|
+
} },
|
|
753
|
+
ad.component
|
|
754
|
+
);
|
|
755
|
+
}
|
|
756
|
+
})
|
|
757
|
+
),
|
|
758
|
+
React.createElement(
|
|
759
|
+
'div',
|
|
760
|
+
{ className: 'block-content' },
|
|
761
|
+
renderBlockContent(props.article),
|
|
762
|
+
React.createElement(
|
|
763
|
+
'noscript',
|
|
764
|
+
null,
|
|
765
|
+
React.createElement(
|
|
766
|
+
'div',
|
|
767
|
+
{ style: { display: 'flex', justifyContent: 'center' }, className: 'series-links' },
|
|
768
|
+
props.article.seriesDetail && props.article.seriesDetail.prevUrl && React.createElement(
|
|
769
|
+
'a',
|
|
770
|
+
{ className: 'mx-3', href: props.article.seriesDetail.prevUrl },
|
|
771
|
+
'Previous ',
|
|
772
|
+
props.article.seriesDetail.type
|
|
773
|
+
),
|
|
774
|
+
props.article.seriesDetail && props.article.seriesDetail.nextUrl && React.createElement(
|
|
775
|
+
'a',
|
|
776
|
+
{ className: 'mx-3', href: props.article.seriesDetail.nextUrl },
|
|
777
|
+
'Next ',
|
|
778
|
+
props.article.seriesDetail.type
|
|
779
|
+
)
|
|
780
|
+
)
|
|
781
|
+
),
|
|
782
|
+
issue && issue.url && React.createElement(
|
|
783
|
+
'a',
|
|
784
|
+
{ href: issue.url, target: '_blank', title: 'Download issue' },
|
|
785
|
+
React.createElement('img', { style: { margin: '1rem', maxHeight: '40px', maxWidth: '40px' }, src: '/download.png', alt: 'download issue' }),
|
|
786
|
+
'Download Issue : ',
|
|
787
|
+
issue.name
|
|
788
|
+
)
|
|
789
|
+
)
|
|
790
|
+
),
|
|
791
|
+
renderIsiContent(props.article)
|
|
792
|
+
)
|
|
793
|
+
),
|
|
794
|
+
main_36 && props.article.Ads && props.article.Ads.length > 0 && props.article.Ads.map(function (ad, index) {
|
|
795
|
+
if (index > 0) {
|
|
796
|
+
return React.createElement(
|
|
797
|
+
'div',
|
|
798
|
+
{ key: index, id: 'addid-' + index, style: { display: 'flex', flex: '1 0 auto' } },
|
|
799
|
+
ad.component
|
|
800
|
+
);
|
|
801
|
+
}
|
|
802
|
+
}),
|
|
803
|
+
React.createElement('div', { className: 'clearfix', style: { minHeight: '1px' } }),
|
|
804
|
+
React.createElement('hr', { className: 'article-seperater my-5' })
|
|
805
|
+
);
|
|
806
|
+
};
|
|
807
|
+
|
|
808
|
+
if (passwordLock) {
|
|
809
|
+
if (auth === 2) {
|
|
810
|
+
return detail();
|
|
811
|
+
} else {
|
|
812
|
+
return form();
|
|
813
|
+
}
|
|
814
|
+
} else {
|
|
815
|
+
return detail();
|
|
816
|
+
}
|
|
817
|
+
};
|
|
818
|
+
|
|
819
|
+
var defineProperty = createCommonjsModule(function (module, exports) {
|
|
820
|
+
|
|
821
|
+
exports.__esModule = true;
|
|
822
|
+
|
|
823
|
+
|
|
824
|
+
|
|
825
|
+
var _defineProperty2 = _interopRequireDefault(defineProperty$1);
|
|
826
|
+
|
|
827
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
828
|
+
|
|
829
|
+
exports.default = function (obj, key, value) {
|
|
830
|
+
if (key in obj) {
|
|
831
|
+
(0, _defineProperty2.default)(obj, key, {
|
|
832
|
+
value: value,
|
|
833
|
+
enumerable: true,
|
|
834
|
+
configurable: true,
|
|
835
|
+
writable: true
|
|
836
|
+
});
|
|
837
|
+
} else {
|
|
838
|
+
obj[key] = value;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
return obj;
|
|
842
|
+
};
|
|
843
|
+
});
|
|
844
|
+
|
|
845
|
+
var _defineProperty = unwrapExports(defineProperty);
|
|
846
|
+
|
|
847
|
+
var ArticleQueue = function ArticleQueue(props) {
|
|
848
|
+
var _props$prevUrl = props.prevUrl,
|
|
849
|
+
prevUrl = _props$prevUrl === undefined ? '/' : _props$prevUrl,
|
|
850
|
+
Ads = props.Ads,
|
|
851
|
+
_props$maxListLength = props.maxListLength,
|
|
852
|
+
maxListLength = _props$maxListLength === undefined ? 10 : _props$maxListLength,
|
|
853
|
+
_props$sponsoredTaxon = props.sponsoredTaxonomies,
|
|
854
|
+
sponsoredTaxonomies = _props$sponsoredTaxon === undefined ? [] : _props$sponsoredTaxon,
|
|
855
|
+
_props$cpModification = props.cpModificationRequired,
|
|
856
|
+
cpModificationRequired = _props$cpModification === undefined ? false : _props$cpModification,
|
|
857
|
+
_props$authorPrefix = props.authorPrefix,
|
|
858
|
+
authorPrefix = _props$authorPrefix === undefined ? 'authors' : _props$authorPrefix;
|
|
859
|
+
|
|
860
|
+
|
|
861
|
+
var firstArticle = function firstArticle() {
|
|
862
|
+
var article = _Object$assign({}, props.article);
|
|
863
|
+
var targeting = getTargeting(props);
|
|
864
|
+
article.Ads = Ads.getRightItems(targeting);
|
|
865
|
+
return article;
|
|
866
|
+
};
|
|
867
|
+
|
|
868
|
+
var _useState = useState([firstArticle()]),
|
|
869
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
870
|
+
queueData = _useState2[0],
|
|
871
|
+
setQueueData = _useState2[1];
|
|
872
|
+
|
|
873
|
+
var refreshAD = function refreshAD(path) {
|
|
874
|
+
if (!main_36) {
|
|
875
|
+
var activeArticle = queueData.find(function (item) {
|
|
876
|
+
return item.url.current === path;
|
|
877
|
+
});
|
|
878
|
+
|
|
879
|
+
var targeting = getTargeting({ article: activeArticle, cpModificationRequired: cpModificationRequired, position: props.position, prevUrl: prevUrl });
|
|
880
|
+
|
|
881
|
+
lib_3.getGoogletag().then(function (googletag) {
|
|
882
|
+
if (window.googletag && googletag.pubadsReady) {
|
|
883
|
+
var slots = googletag.pubads().getSlots();
|
|
884
|
+
slots.forEach(function (slot) {
|
|
885
|
+
var pos = slot.getTargeting('pos');
|
|
886
|
+
|
|
887
|
+
slot.clearTargeting();
|
|
888
|
+
_Object$keys(targeting).forEach(function (key) {
|
|
889
|
+
slot.setTargeting(key, targeting[key]);
|
|
890
|
+
});
|
|
891
|
+
slot.setTargeting('pos', pos);
|
|
892
|
+
});
|
|
893
|
+
lib_3.refresh();
|
|
894
|
+
}
|
|
895
|
+
});
|
|
896
|
+
}
|
|
897
|
+
};
|
|
898
|
+
|
|
899
|
+
var checkSponseredArticle = function checkSponseredArticle(article) {
|
|
900
|
+
var _article$taxonomyMapp = article.taxonomyMapping,
|
|
901
|
+
taxonomyMapping = _article$taxonomyMapp === undefined ? [] : _article$taxonomyMapp;
|
|
902
|
+
|
|
903
|
+
if (props.checkSponsered) {
|
|
904
|
+
return taxonomyMapping.some(function (item) {
|
|
905
|
+
return includes_1(sponsoredTaxonomies, item._ref);
|
|
906
|
+
});
|
|
907
|
+
} else {
|
|
908
|
+
return false;
|
|
909
|
+
}
|
|
910
|
+
};
|
|
911
|
+
|
|
912
|
+
var preVscroll = 0;
|
|
913
|
+
var isScrollDown = true;
|
|
914
|
+
|
|
915
|
+
var scrollDirectionDetect = function scrollDirectionDetect(e) {
|
|
916
|
+
var window = e.currentTarget;
|
|
917
|
+
|
|
918
|
+
if (preVscroll > window.scrollY) {
|
|
919
|
+
isScrollDown = false;
|
|
920
|
+
} else if (preVscroll < window.scrollY) {
|
|
921
|
+
isScrollDown = true;
|
|
922
|
+
}
|
|
923
|
+
preVscroll = window.scrollY;
|
|
924
|
+
};
|
|
925
|
+
|
|
926
|
+
useEffect(function () {
|
|
927
|
+
window.addEventListener('scroll', scrollDirectionDetect);
|
|
928
|
+
return function () {
|
|
929
|
+
return window.removeEventListener('scroll', scrollDirectionDetect);
|
|
930
|
+
};
|
|
931
|
+
});
|
|
932
|
+
|
|
933
|
+
var loadmore = function loadmore() {
|
|
934
|
+
var query = props.relatedArticleQuery;
|
|
935
|
+
var params = props.params;
|
|
936
|
+
if (queueData && queueData.length < maxListLength) {
|
|
937
|
+
params.index = queueData.length - 1;
|
|
938
|
+
props.client.fetch(query, params).then(function (article) {
|
|
939
|
+
if (article && article._id) {
|
|
940
|
+
var targeting = getTargeting({ article: article, cpModificationRequired: cpModificationRequired, prevUrl: prevUrl });
|
|
941
|
+
article.Ads = Ads.getRightItems(targeting);
|
|
942
|
+
setQueueData([].concat(_toConsumableArray(queueData), [article]));
|
|
943
|
+
}
|
|
944
|
+
});
|
|
945
|
+
}
|
|
946
|
+
};
|
|
947
|
+
|
|
948
|
+
var changeMeta = function changeMeta(meta) {
|
|
949
|
+
document.title = meta.shareTitle;
|
|
950
|
+
document.querySelector('meta[name="description"]').setAttribute('content', meta.shareSummary);
|
|
951
|
+
document.querySelector('meta[property="og:url"]').setAttribute('content', meta.shareUrl);
|
|
952
|
+
document.querySelector('meta[property="og:title"]').setAttribute('content', meta.shareTitle);
|
|
953
|
+
document.querySelector('meta[property="og:site_name"]').setAttribute('content', meta.shareVia);
|
|
954
|
+
document.querySelector('meta[property="og:description"]').setAttribute('content', meta.shareSummary);
|
|
955
|
+
document.querySelector('meta[name="twitter:title"]').setAttribute('content', meta.shareTitle);
|
|
956
|
+
document.querySelector('meta[name="twitter:image"]').setAttribute('content', meta.shareImage);
|
|
957
|
+
document.querySelector('meta[name="twitter:site"]').setAttribute('content', meta.shareVia);
|
|
958
|
+
document.querySelector('meta[name="twitter:description"]').setAttribute('content', meta.shareSummary);
|
|
959
|
+
};
|
|
960
|
+
|
|
961
|
+
var changeUrl = function changeUrl(path, visibility, meta) {
|
|
962
|
+
var currentPath = window && window.location && window.location.pathname ? window.location.pathname.replace('/view/', '') : '';
|
|
963
|
+
var newPath = '/view/' + path;
|
|
964
|
+
if (currentPath !== path) {
|
|
965
|
+
if (isScrollDown) {
|
|
966
|
+
if (visibility === 'top') {
|
|
967
|
+
// router.push('/view/[url]', newPath, { shallow: true })
|
|
968
|
+
window.history.pushState({ page: path }, meta.shareTitle, newPath);
|
|
969
|
+
changeMeta(meta);
|
|
970
|
+
if (props.pageview) {
|
|
971
|
+
props.pageview(newPath);
|
|
972
|
+
}
|
|
973
|
+
refreshAD(path);
|
|
974
|
+
}
|
|
975
|
+
} else {
|
|
976
|
+
if (visibility === 'bottom') {
|
|
977
|
+
// router.push('/view/[url]', newPath, { shallow: true })
|
|
978
|
+
window.history.pushState({ page: path }, meta.shareTitle, newPath);
|
|
979
|
+
changeMeta(meta);
|
|
980
|
+
if (props.pageview) {
|
|
981
|
+
props.pageview(newPath);
|
|
982
|
+
}
|
|
983
|
+
refreshAD(path);
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
if (visibility === 'small-top') {
|
|
987
|
+
window.history.pushState({ page: path }, meta.shareTitle, newPath);
|
|
988
|
+
changeMeta(meta);
|
|
989
|
+
if (props.pageview) {
|
|
990
|
+
props.pageview(newPath);
|
|
991
|
+
}
|
|
992
|
+
refreshAD(path);
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
};
|
|
996
|
+
|
|
997
|
+
return React.createElement(
|
|
998
|
+
InfiniteScroll,
|
|
999
|
+
{ dataLength: queueData.length, next: loadmore, scrollThreshold: '60%', hasMore: true, style: { overflow: 'hidden' } },
|
|
1000
|
+
queueData.map(function (article, index) {
|
|
1001
|
+
if (!checkSponseredArticle(article) && Ads.getVideoContextualAD) {
|
|
1002
|
+
article.contextualVideoAD = Ads.getVideoContextualAD(getTargeting(props));
|
|
1003
|
+
}
|
|
1004
|
+
if (!checkSponseredArticle(article) && Ads.getNativeContextualAD) {
|
|
1005
|
+
article.contextualAD = Ads.getNativeContextualAD(getTargeting(props));
|
|
1006
|
+
}
|
|
1007
|
+
return React.createElement(Article, _extends({ key: index }, props, { changeUrl: changeUrl, authorPrfix: authorPrefix, article: article, cpModificationRequired: cpModificationRequired }));
|
|
1008
|
+
})
|
|
1009
|
+
);
|
|
1010
|
+
};
|
|
1011
|
+
|
|
1012
|
+
var Articles = function Articles(props) {
|
|
1013
|
+
var _extends2;
|
|
1014
|
+
|
|
1015
|
+
var videoAccountIDs = props.videoAccountIDs,
|
|
1016
|
+
Ads = props.Ads,
|
|
1017
|
+
cpModificationRequired = props.cpModificationRequired,
|
|
1018
|
+
Settings = props.Settings,
|
|
1019
|
+
ISIContent = props.ISIContent,
|
|
1020
|
+
prevUrl = props.prevUrl,
|
|
1021
|
+
setActiveArticle = props.setActiveArticle,
|
|
1022
|
+
article = props.article,
|
|
1023
|
+
client = props.client,
|
|
1024
|
+
relatedArticleQuery = props.relatedArticleQuery,
|
|
1025
|
+
Website = props.Website,
|
|
1026
|
+
pageview = props.pageview,
|
|
1027
|
+
shareOptions = props.shareOptions,
|
|
1028
|
+
WAds = props.WAds,
|
|
1029
|
+
regionalPages = props.regionalPages,
|
|
1030
|
+
nationalPage = props.nationalPage;
|
|
1031
|
+
var taxonomyMapping = article.taxonomyMapping,
|
|
1032
|
+
_article$url = article.url;
|
|
1033
|
+
_article$url = _article$url === undefined ? {
|
|
1034
|
+
current: null
|
|
1035
|
+
} : _article$url;
|
|
1036
|
+
var url = _article$url.current,
|
|
1037
|
+
content_placement = article.content_placement;
|
|
1038
|
+
|
|
1039
|
+
|
|
1040
|
+
var taxonomy = [];
|
|
1041
|
+
content_placement.forEach(function (_ref2) {
|
|
1042
|
+
var path = _ref2.path,
|
|
1043
|
+
_id = _ref2._id;
|
|
1044
|
+
|
|
1045
|
+
var prev_url_to_check = prevUrl;
|
|
1046
|
+
if (prev_url_to_check.includes('?')) {
|
|
1047
|
+
prev_url_to_check = prev_url_to_check.split('?')[0];
|
|
1048
|
+
}
|
|
1049
|
+
if (prev_url_to_check.endsWith(path)) taxonomy.push(_id);
|
|
1050
|
+
});
|
|
1051
|
+
|
|
1052
|
+
if (taxonomy.length === 0) {
|
|
1053
|
+
taxonomy = taxonomyMapping.map(function (_ref3) {
|
|
1054
|
+
var _ref = _ref3._ref;
|
|
1055
|
+
return _ref;
|
|
1056
|
+
});
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
var params = {
|
|
1060
|
+
url: url,
|
|
1061
|
+
taxonomy: taxonomy,
|
|
1062
|
+
index: 0
|
|
1063
|
+
};
|
|
1064
|
+
|
|
1065
|
+
return React.createElement(ArticleQueue, _extends((_extends2 = {
|
|
1066
|
+
client: client,
|
|
1067
|
+
params: params,
|
|
1068
|
+
relatedArticleQuery: relatedArticleQuery,
|
|
1069
|
+
website: Website,
|
|
1070
|
+
checkSponsered: true,
|
|
1071
|
+
pageview: pageview,
|
|
1072
|
+
shareOptions: shareOptions,
|
|
1073
|
+
Ads: WAds,
|
|
1074
|
+
regionalPages: regionalPages,
|
|
1075
|
+
nationalPage: nationalPage
|
|
1076
|
+
}, _defineProperty(_extends2, 'pageview', pageview), _defineProperty(_extends2, 'onVote', function onVote() {}), _defineProperty(_extends2, 'ISIContent', ISIContent), _defineProperty(_extends2, 'videoAccountIDs', videoAccountIDs), _defineProperty(_extends2, 'sponsoredTaxonomies', []), _defineProperty(_extends2, 'cpModificationRequired', cpModificationRequired), _defineProperty(_extends2, 'Settings', Settings), _extends2), props));
|
|
1077
|
+
};
|
|
1078
|
+
|
|
1079
|
+
var View = function View(props) {
|
|
1080
|
+
var shareOptions = props.shareOptions,
|
|
1081
|
+
article = props.article;
|
|
1082
|
+
var _props$article = props.article,
|
|
1083
|
+
_props$article$passwo = _props$article.passwordLock,
|
|
1084
|
+
passwordLock = _props$article$passwo === undefined ? false : _props$article$passwo,
|
|
1085
|
+
description = _props$article.description,
|
|
1086
|
+
title = _props$article.title;
|
|
1087
|
+
|
|
1088
|
+
//disable infinite scroll
|
|
1089
|
+
|
|
1090
|
+
var checkVideoSeries = function checkVideoSeries(article) {
|
|
1091
|
+
for (var i = 0; i < article.body.length; i++) {
|
|
1092
|
+
var row = article.body[i];
|
|
1093
|
+
if (typeof row.videos !== 'undefined') {
|
|
1094
|
+
return true;
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
return false;
|
|
1098
|
+
};
|
|
1099
|
+
var isVideoSeries = checkVideoSeries(props.article);
|
|
1100
|
+
var needInfiniteScroll = ['Articles', 'Videos', 'Podcasts'].includes(article.category.name) && article.taxonomyMapping && article.passwordLock !== true && !isVideoSeries && !article.ExcludeFromInfiniteScroll;
|
|
1101
|
+
|
|
1102
|
+
if (['Articles', 'Videos', 'Podcasts'].includes(article.category.name)) {
|
|
1103
|
+
description = null;
|
|
1104
|
+
title = null;
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
if (!needInfiniteScroll && !title) {
|
|
1108
|
+
title = props.article ? props.article.title : '';
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
return React.createElement(
|
|
1112
|
+
React.Fragment,
|
|
1113
|
+
null,
|
|
1114
|
+
React.createElement(
|
|
1115
|
+
Head,
|
|
1116
|
+
null,
|
|
1117
|
+
React.createElement(
|
|
1118
|
+
'title',
|
|
1119
|
+
{ key: 'title' },
|
|
1120
|
+
article.title + ' | ' + props.cache.siteSettingCache.name
|
|
1121
|
+
),
|
|
1122
|
+
React.createElement('meta', { name: 'description', key: 'description', content: shareOptions.shareSummary }),
|
|
1123
|
+
passwordLock && React.createElement('meta', { name: 'robots', content: 'noindex, nofollow' }),
|
|
1124
|
+
React.createElement('meta', { property: 'og:url', content: shareOptions.shareUrl, key: 'og:url' }),
|
|
1125
|
+
React.createElement('meta', { property: 'og:title', content: shareOptions.shareTitle, key: 'og:title' }),
|
|
1126
|
+
React.createElement('meta', { property: 'og:image', content: shareOptions.shareImage, key: 'og:image' }),
|
|
1127
|
+
React.createElement('meta', { property: 'og:site_name', content: props.Settings.title, key: 'og:site_name' }),
|
|
1128
|
+
React.createElement('meta', { property: 'og:description', content: shareOptions.shareSummary, key: 'og:description' }),
|
|
1129
|
+
React.createElement('meta', { name: 'twitter:card', content: 'summary', key: 'twitter:card' }),
|
|
1130
|
+
React.createElement('meta', { name: 'twitter:title', content: shareOptions.shareTitle, key: 'twitter:title' }),
|
|
1131
|
+
React.createElement('meta', { name: 'twitter:image', content: shareOptions.shareImage, key: 'twitter:image' }),
|
|
1132
|
+
React.createElement('meta', { name: 'twitter:site', content: '@' + props.Settings.title, key: 'twitter:site' }),
|
|
1133
|
+
React.createElement('meta', { name: 'twitter:description', content: shareOptions.shareSummary, key: 'twitter:description' }),
|
|
1134
|
+
React.createElement(
|
|
1135
|
+
'noscript',
|
|
1136
|
+
null,
|
|
1137
|
+
props.article.seriesDetail && props.article.seriesDetail.prevUrl && React.createElement('link', { rel: 'prev', href: props.article.seriesDetail.prevUrl }),
|
|
1138
|
+
props.article.seriesDetail && props.article.seriesDetail.nextUrl && React.createElement('link', { rel: 'next', href: props.article.seriesDetail.nextUrl })
|
|
1139
|
+
)
|
|
1140
|
+
),
|
|
1141
|
+
!needInfiniteScroll ? React.createElement(Article, _extends({ infiniteScroll: false }, props)) : React.createElement(Articles, _extends({ infiniteScroll: true }, props))
|
|
1142
|
+
);
|
|
1143
|
+
};
|
|
1144
|
+
|
|
1145
|
+
export default View;
|