@mjhls/mjh-framework 1.0.694-beta.1 → 1.0.694-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/View.js +136 -175
- package/dist/cjs/getQuery.js +2 -2
- package/dist/cjs/getRelatedArticle.js +75 -32
- package/dist/cjs/index.js +5 -82
- package/dist/esm/AD300x250.js +1 -1
- package/dist/esm/AD300x250x600.js +1 -1
- package/dist/esm/AD728x90.js +1 -1
- package/dist/esm/ADFloatingFooter.js +1 -1
- package/dist/esm/ADGutter.js +1 -1
- package/dist/esm/ADSkyscraper.js +1 -1
- package/dist/esm/ADSponsoredResources.js +1 -1
- package/dist/esm/ADWebcast.js +1 -1
- package/dist/esm/ADWelcome.js +1 -1
- package/dist/esm/AdSlot.js +1 -1
- package/dist/esm/Auth.js +1 -1
- package/dist/esm/Beam.js +1 -1
- package/dist/esm/CMEDeck.js +1 -1
- package/dist/esm/Column2.js +1 -1
- package/dist/esm/Column3.js +1 -1
- package/dist/esm/DeckContent.js +2 -2
- package/dist/esm/ExternalResources.js +2 -2
- package/dist/esm/GridContent.js +3 -3
- package/dist/esm/HamMagazine.js +1 -1
- package/dist/esm/IssueLanding.js +3 -3
- package/dist/esm/LeftNav.js +1 -1
- package/dist/esm/MasterDeck.js +3 -3
- package/dist/esm/NavDvm.js +1 -1
- package/dist/esm/NavMagazine.js +1 -1
- package/dist/esm/NavNative.js +1 -1
- package/dist/esm/NavNormal.js +1 -1
- package/dist/esm/PartnerDetailListing.js +4 -4
- package/dist/esm/QueueDeckExpanded.js +3 -3
- package/dist/esm/Segment.js +1 -1
- package/dist/esm/SideFooter.js +1 -1
- package/dist/esm/TemplateNormal.js +1 -1
- package/dist/esm/VideoSeriesFilter.js +1 -1
- package/dist/esm/View.js +138 -177
- package/dist/esm/{asyncToGenerator-d0f08f8d.js → asyncToGenerator-7c654f36.js} +1 -1
- package/dist/esm/getQuery.js +2 -2
- package/dist/esm/getRelatedArticle.js +76 -33
- package/dist/esm/getSerializers.js +2 -2
- package/dist/esm/index.js +8 -86
- package/package.json +1 -1
- /package/dist/esm/{ADInfeed-d46be909.js → ADInfeed-eae71d07.js} +0 -0
- /package/dist/esm/{ADlgInfeed-5d1bce95.js → ADlgInfeed-c619fe64.js} +0 -0
- /package/dist/esm/{index-aad92b92.js → index-c376cd8e.js} +0 -0
package/dist/esm/View.js
CHANGED
|
@@ -30,7 +30,7 @@ import { m as main_36 } from './main-5d1e4bd3.js';
|
|
|
30
30
|
import './entities-7cc3bf45.js';
|
|
31
31
|
import { _ as _JSON$stringify } from './stringify-008c8802.js';
|
|
32
32
|
import { a as _getIterator, _ as _slicedToArray } from './slicedToArray-7021e5df.js';
|
|
33
|
-
import {
|
|
33
|
+
import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-7c654f36.js';
|
|
34
34
|
import './_set-species-cede29f8.js';
|
|
35
35
|
import './Segment.js';
|
|
36
36
|
import './Beam.js';
|
|
@@ -42,9 +42,8 @@ import 'react-bootstrap';
|
|
|
42
42
|
import './iconBase-602d52fe.js';
|
|
43
43
|
import './index.esm-29e48d38.js';
|
|
44
44
|
import Button from 'react-bootstrap/Button';
|
|
45
|
-
import { _ as _defineProperty } from './defineProperty-b798470d.js';
|
|
46
45
|
import Form from 'react-bootstrap/Form';
|
|
47
|
-
import { I as InscreenSensor, r as renderAuthor, g as getSerializers } from './index-
|
|
46
|
+
import { I as InscreenSensor, r as renderAuthor, g as getSerializers } from './index-c376cd8e.js';
|
|
48
47
|
import './util-7700fc59.js';
|
|
49
48
|
import './brightcove-react-player-loader.es-83f53e4e.js';
|
|
50
49
|
import 'react-bootstrap/Pagination';
|
|
@@ -248,7 +247,7 @@ var ISI = function ISI(props) {
|
|
|
248
247
|
);
|
|
249
248
|
};
|
|
250
249
|
|
|
251
|
-
var css = ".RelatedArticles-module_mediaContainer__10h9k {\r\n display: flex;\r\n flex-direction: row;\r\n flex-wrap: nowrap;\r\n margin: 0 -1rem;\r\n}\r\n.RelatedArticles-module_mediaCard__3wQbn {\r\n margin: 0 1rem 1rem;\r\n width: calc(33% - 1rem);\r\n display: column;\r\n flex-direction: row;\r\n margin-bottom: 0.75rem;\r\n padding-bottom: 0.75rem;\r\n border-bottom: none;\r\n}\r\n.RelatedArticles-module_mediaCard__3wQbn:last-child {\r\n border-bottom: none;\r\n}\r\n.RelatedArticles-module_cardTitle__3P-Ib {\r\n font-weight: bold;\r\n color: #252525;\r\n margin-bottom: 0.25rem;\r\n font-size: 15px;\r\n}\r\n.RelatedArticles-module_authorListing__1EFg4 span.RelatedArticles-module_text-muted__3b0zX {\r\n color: #000;\r\n font-weight: bold;\r\n}\r\n.RelatedArticles-module_cardDate__1wOR5 {\r\n color: var(--dark);\r\n display: block;\r\n background: #fff !important;\r\n margin-bottom: 0;\r\n}\r\n.RelatedArticles-module_imgWrapper__5Jx_4 {\r\n display: block;\r\n text-align: center;\r\n margin-bottom: 0.5rem;\r\n}\r\n.RelatedArticles-module_imgWrapper__5Jx_4 img {\r\n height: 135px;\r\n width: 100%;\r\n object-fit: cover;\r\n object-position: center;\r\n}\r\n@media screen and (max-width: 1064px) {\r\n}\r\n@media screen and (max-width: 968px) {\r\n .RelatedArticles-module_mediaContainer__10h9k {\r\n flex-wrap: wrap;\r\n }\r\n .RelatedArticles-
|
|
250
|
+
var css = ".RelatedArticles-module_mediaContainer__10h9k {\r\n display: flex;\r\n flex-direction: row;\r\n flex-wrap: nowrap;\r\n margin: 0 -1rem;\r\n}\r\n.RelatedArticles-module_mediaCard__3wQbn {\r\n margin: 0 1rem 1rem;\r\n width: calc(33% - 1rem);\r\n display: column;\r\n flex-direction: row;\r\n margin-bottom: 0.75rem;\r\n padding-bottom: 0.75rem;\r\n border-bottom: none;\r\n}\r\n.RelatedArticles-module_mediaCard__3wQbn:last-child {\r\n border-bottom: none;\r\n}\r\n.RelatedArticles-module_cardTitle__3P-Ib {\r\n font-weight: bold;\r\n color: #252525;\r\n margin-bottom: 0.25rem;\r\n font-size: 15px;\r\n}\r\n.RelatedArticles-module_authorListing__1EFg4 span.RelatedArticles-module_text-muted__3b0zX {\r\n color: #000;\r\n font-weight: bold;\r\n}\r\n.RelatedArticles-module_cardDate__1wOR5 {\r\n color: var(--dark);\r\n display: block;\r\n background: #fff !important;\r\n margin-bottom: 0;\r\n}\r\n.RelatedArticles-module_imgWrapper__5Jx_4 {\r\n display: block;\r\n text-align: center;\r\n margin-bottom: 0.5rem;\r\n}\r\n.RelatedArticles-module_imgWrapper__5Jx_4 img {\r\n height: 135px;\r\n width: 100%;\r\n object-fit: cover;\r\n object-position: center;\r\n}\r\n@media screen and (max-width: 1064px) {\r\n}\r\n@media screen and (max-width: 968px) {\r\n .RelatedArticles-module_mediaContainer__10h9k {\r\n flex-wrap: wrap;\r\n }\r\n .RelatedArticles-module_imgWrapper__5Jx_4 {\r\n display: none;\r\n }\r\n .RelatedArticles-module_mediaCard__3wQbn {\r\n width: 100%;\r\n margin-bottom: 0.5rem;\r\n padding: 0;\r\n }\r\n .RelatedArticles-module_cardTitle__3P-Ib {\r\n font-size: 0.75rem;\r\n margin-bottom: 0;\r\n }\r\n}\r\n";
|
|
252
251
|
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" };
|
|
253
252
|
styleInject(css);
|
|
254
253
|
|
|
@@ -484,65 +483,73 @@ var Article = function Article(props) {
|
|
|
484
483
|
};
|
|
485
484
|
|
|
486
485
|
var RelevantTopics = function RelevantTopics() {
|
|
487
|
-
if (content_placement && content_placement.length > 0 || documentGroupMapping) {
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
{ className: 'mb-0' },
|
|
494
|
-
React__default.createElement(
|
|
495
|
-
'b',
|
|
496
|
-
null,
|
|
497
|
-
'Related Content:'
|
|
498
|
-
)
|
|
499
|
-
),
|
|
500
|
-
documentGroupMapping && documentGroupMapping.map(function (documentGroup) {
|
|
501
|
-
if (!documentGroup.parent) {
|
|
502
|
-
return null;
|
|
486
|
+
if (content_placement && content_placement.length > 0 || documentGroupMapping && documentGroupMapping.length > 0) {
|
|
487
|
+
var relatedLinks = [];
|
|
488
|
+
if (documentGroupMapping && documentGroupMapping.length > 0) {
|
|
489
|
+
documentGroupMapping.forEach(function (documentGroup) {
|
|
490
|
+
if (documentGroup.parent) {
|
|
491
|
+
relatedLinks = [].concat(_toConsumableArray(relatedLinks), [{ label: documentGroup.name, href: cpModificationRequired ? '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path : '/' + documentGroup.path }]);
|
|
503
492
|
}
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
{ className: '' },
|
|
511
|
-
React__default.createElement(
|
|
512
|
-
'a',
|
|
513
|
-
{
|
|
514
|
-
className: 'related-links',
|
|
515
|
-
style: { color: 'blue' },
|
|
516
|
-
href: cpModificationRequired ? '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path : '/' + documentGroup.path },
|
|
517
|
-
documentGroup.name
|
|
518
|
-
)
|
|
519
|
-
),
|
|
520
|
-
content_placement && content_placement.length ? ' | ' : null
|
|
521
|
-
);
|
|
522
|
-
}),
|
|
523
|
-
content_placement && content_placement.length > 0 ? content_placement.map(function (cp, index) {
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
if (content_placement && content_placement.length > 0) {
|
|
496
|
+
content_placement.filter(function (item) {
|
|
497
|
+
return item.path !== 'news';
|
|
498
|
+
}).forEach(function (cp) {
|
|
524
499
|
var cp_url = cpModificationRequired ? getContentPlacementUrl(cp) : cp.path;
|
|
525
500
|
var href = '/' + cp_url;
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
501
|
+
relatedLinks = [].concat(_toConsumableArray(relatedLinks), [{ label: cp.name, href: href }]);
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
if (relatedLinks && relatedLinks.length > 0) {
|
|
505
|
+
return React__default.createElement(
|
|
506
|
+
'div',
|
|
507
|
+
null,
|
|
508
|
+
relatedLinks.map(function (relatedLink, index) {
|
|
509
|
+
return React__default.createElement(
|
|
530
510
|
'span',
|
|
531
|
-
|
|
511
|
+
{ key: index, className: 'related-link' },
|
|
532
512
|
React__default.createElement(
|
|
533
513
|
'a',
|
|
534
|
-
{ className: 'related-links',
|
|
535
|
-
|
|
514
|
+
{ className: 'related-links', style: { color: 'blue' }, href: relatedLink.href },
|
|
515
|
+
relatedLink.label
|
|
516
|
+
),
|
|
517
|
+
React__default.createElement(
|
|
518
|
+
'style',
|
|
519
|
+
{ jsx: 'true' },
|
|
520
|
+
'\n .related-link:not(:first-child):before {\n content: \' | \';\n }\n '
|
|
536
521
|
)
|
|
537
|
-
)
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
522
|
+
);
|
|
523
|
+
})
|
|
524
|
+
);
|
|
525
|
+
}
|
|
526
|
+
return null;
|
|
542
527
|
}
|
|
543
528
|
return null;
|
|
544
529
|
};
|
|
545
530
|
|
|
531
|
+
var RelatedContent = function RelatedContent() {
|
|
532
|
+
return React__default.createElement(
|
|
533
|
+
'section',
|
|
534
|
+
{ id: 'related-content-section', className: 'my-1' },
|
|
535
|
+
React__default.createElement(
|
|
536
|
+
'p',
|
|
537
|
+
{ className: 'mb-0' },
|
|
538
|
+
React__default.createElement(
|
|
539
|
+
'b',
|
|
540
|
+
null,
|
|
541
|
+
'Related Content:'
|
|
542
|
+
)
|
|
543
|
+
),
|
|
544
|
+
React__default.createElement(RelevantTopics, null),
|
|
545
|
+
React__default.createElement(
|
|
546
|
+
'div',
|
|
547
|
+
{ className: 'pt-2' },
|
|
548
|
+
React__default.createElement(RelatedArticle, { articles: article.relatedArticle, client: client })
|
|
549
|
+
)
|
|
550
|
+
);
|
|
551
|
+
};
|
|
552
|
+
|
|
546
553
|
var form = function form() {
|
|
547
554
|
return React__default.createElement(
|
|
548
555
|
React__default.Fragment,
|
|
@@ -1001,20 +1008,7 @@ var Article = function Article(props) {
|
|
|
1001
1008
|
)
|
|
1002
1009
|
),
|
|
1003
1010
|
React__default.createElement('div', { className: 'clearfix', style: { minHeight: '1px' } }),
|
|
1004
|
-
showRelatedArticles && !showIsi && React__default.createElement(
|
|
1005
|
-
React__default.Fragment,
|
|
1006
|
-
null,
|
|
1007
|
-
React__default.createElement(
|
|
1008
|
-
'div',
|
|
1009
|
-
null,
|
|
1010
|
-
React__default.createElement(RelevantTopics, null)
|
|
1011
|
-
),
|
|
1012
|
-
React__default.createElement(
|
|
1013
|
-
'div',
|
|
1014
|
-
{ className: 'pt-2' },
|
|
1015
|
-
React__default.createElement(RelatedArticle, { articles: article.relatedArticle, client: client })
|
|
1016
|
-
)
|
|
1017
|
-
)
|
|
1011
|
+
showRelatedArticles && !showIsi && React__default.createElement(RelatedContent, null)
|
|
1018
1012
|
),
|
|
1019
1013
|
renderIsiContent(props.article)
|
|
1020
1014
|
),
|
|
@@ -1179,50 +1173,77 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1179
1173
|
}, 1000);
|
|
1180
1174
|
}, [queueData.length]);
|
|
1181
1175
|
|
|
1182
|
-
var loadmore = function
|
|
1183
|
-
var
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
switch (_context.prev = _context.next) {
|
|
1193
|
-
case 0:
|
|
1194
|
-
if (!(article && article._id)) {
|
|
1195
|
-
_context.next = 9;
|
|
1196
|
-
break;
|
|
1197
|
-
}
|
|
1198
|
-
|
|
1199
|
-
//query next 4 related article without repeating previous 4 related articles
|
|
1200
|
-
startingIndex = queueData.length + 1;
|
|
1201
|
-
endingIndex = startingIndex + 2;
|
|
1202
|
-
_context.next = 5;
|
|
1203
|
-
return getRelatedArticle(null, props.client, article, prevUrl, startingIndex + '..' + endingIndex);
|
|
1204
|
-
|
|
1205
|
-
case 5:
|
|
1206
|
-
article.relatedArticle = _context.sent;
|
|
1207
|
-
targeting = getTargeting({ article: article, cpModificationRequired: cpModificationRequired, prevUrl: prevUrl });
|
|
1208
|
-
|
|
1209
|
-
article.Ads = Ads.getRightItems(targeting);
|
|
1210
|
-
setQueueData([].concat(_toConsumableArray(queueData), [article]));
|
|
1211
|
-
|
|
1212
|
-
case 9:
|
|
1213
|
-
case 'end':
|
|
1214
|
-
return _context.stop();
|
|
1176
|
+
var loadmore = function () {
|
|
1177
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
|
|
1178
|
+
var index, article, startingIndex, endingIndex, targeting;
|
|
1179
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
1180
|
+
while (1) {
|
|
1181
|
+
switch (_context.prev = _context.next) {
|
|
1182
|
+
case 0:
|
|
1183
|
+
if (!(queueData && queueData.length < maxListLength)) {
|
|
1184
|
+
_context.next = 27;
|
|
1185
|
+
break;
|
|
1215
1186
|
}
|
|
1216
|
-
}
|
|
1217
|
-
}, _callee, _this);
|
|
1218
|
-
}));
|
|
1219
1187
|
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1188
|
+
index = queueData.length - 1;
|
|
1189
|
+
article = null;
|
|
1190
|
+
_context.prev = 3;
|
|
1191
|
+
_context.next = 6;
|
|
1192
|
+
return getRelatedArticle(null, props.client, props.article, prevUrl, index);
|
|
1193
|
+
|
|
1194
|
+
case 6:
|
|
1195
|
+
article = _context.sent;
|
|
1196
|
+
_context.next = 12;
|
|
1197
|
+
break;
|
|
1198
|
+
|
|
1199
|
+
case 9:
|
|
1200
|
+
_context.prev = 9;
|
|
1201
|
+
_context.t0 = _context['catch'](3);
|
|
1202
|
+
|
|
1203
|
+
console.error(_context.t0);
|
|
1204
|
+
|
|
1205
|
+
case 12:
|
|
1206
|
+
if (!(article && article._id)) {
|
|
1207
|
+
_context.next = 27;
|
|
1208
|
+
break;
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
//query next 4 related article without repeating previous 4 related articles
|
|
1212
|
+
startingIndex = queueData.length + 1;
|
|
1213
|
+
endingIndex = startingIndex + 2;
|
|
1214
|
+
_context.prev = 15;
|
|
1215
|
+
_context.next = 18;
|
|
1216
|
+
return getRelatedArticle(null, props.client, props.article, prevUrl, startingIndex + '..' + endingIndex);
|
|
1217
|
+
|
|
1218
|
+
case 18:
|
|
1219
|
+
article.relatedArticle = _context.sent;
|
|
1220
|
+
_context.next = 24;
|
|
1221
|
+
break;
|
|
1222
|
+
|
|
1223
|
+
case 21:
|
|
1224
|
+
_context.prev = 21;
|
|
1225
|
+
_context.t1 = _context['catch'](15);
|
|
1226
|
+
|
|
1227
|
+
console.error(_context.t1);
|
|
1228
|
+
|
|
1229
|
+
case 24:
|
|
1230
|
+
targeting = getTargeting({ article: article, cpModificationRequired: cpModificationRequired, prevUrl: prevUrl });
|
|
1231
|
+
|
|
1232
|
+
article.Ads = Ads.getRightItems(targeting);
|
|
1233
|
+
setQueueData([].concat(_toConsumableArray(queueData), [article]));
|
|
1234
|
+
|
|
1235
|
+
case 27:
|
|
1236
|
+
case 'end':
|
|
1237
|
+
return _context.stop();
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
}, _callee, _this, [[3, 9], [15, 21]]);
|
|
1241
|
+
}));
|
|
1242
|
+
|
|
1243
|
+
return function loadmore() {
|
|
1244
|
+
return _ref.apply(this, arguments);
|
|
1245
|
+
};
|
|
1246
|
+
}();
|
|
1226
1247
|
|
|
1227
1248
|
var changeMeta = function changeMeta(meta) {
|
|
1228
1249
|
document.title = meta.shareTitle;
|
|
@@ -1294,74 +1315,6 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1294
1315
|
);
|
|
1295
1316
|
};
|
|
1296
1317
|
|
|
1297
|
-
var Articles = function Articles(props) {
|
|
1298
|
-
var _extends2;
|
|
1299
|
-
|
|
1300
|
-
var videoAccountIDs = props.videoAccountIDs,
|
|
1301
|
-
Ads = props.Ads,
|
|
1302
|
-
cpModificationRequired = props.cpModificationRequired,
|
|
1303
|
-
Settings = props.Settings,
|
|
1304
|
-
ISIContent = props.ISIContent,
|
|
1305
|
-
prevUrl = props.prevUrl,
|
|
1306
|
-
setActiveArticle = props.setActiveArticle,
|
|
1307
|
-
article = props.article,
|
|
1308
|
-
client = props.client,
|
|
1309
|
-
relatedArticleQuery = props.relatedArticleQuery,
|
|
1310
|
-
Website = props.Website,
|
|
1311
|
-
pageview = props.pageview,
|
|
1312
|
-
shareOptions = props.shareOptions,
|
|
1313
|
-
WAds = props.WAds,
|
|
1314
|
-
regionalPages = props.regionalPages,
|
|
1315
|
-
nationalPage = props.nationalPage,
|
|
1316
|
-
canonicalTag = props.canonicalTag;
|
|
1317
|
-
var taxonomyMapping = article.taxonomyMapping,
|
|
1318
|
-
_article$url = article.url;
|
|
1319
|
-
_article$url = _article$url === undefined ? {
|
|
1320
|
-
current: null
|
|
1321
|
-
} : _article$url;
|
|
1322
|
-
var url = _article$url.current,
|
|
1323
|
-
content_placement = article.content_placement;
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
var taxonomy = [];
|
|
1327
|
-
content_placement.forEach(function (_ref2) {
|
|
1328
|
-
var path = _ref2.path,
|
|
1329
|
-
_id = _ref2._id;
|
|
1330
|
-
|
|
1331
|
-
var prev_url_to_check = prevUrl;
|
|
1332
|
-
if (prev_url_to_check.includes('?')) {
|
|
1333
|
-
prev_url_to_check = prev_url_to_check.split('?')[0];
|
|
1334
|
-
}
|
|
1335
|
-
if (prev_url_to_check.endsWith(path)) taxonomy.push(_id);
|
|
1336
|
-
});
|
|
1337
|
-
|
|
1338
|
-
if (taxonomy.length === 0) {
|
|
1339
|
-
taxonomy = taxonomyMapping.map(function (_ref3) {
|
|
1340
|
-
var _ref = _ref3._ref;
|
|
1341
|
-
return _ref;
|
|
1342
|
-
});
|
|
1343
|
-
}
|
|
1344
|
-
|
|
1345
|
-
var params = {
|
|
1346
|
-
url: url,
|
|
1347
|
-
taxonomy: taxonomy,
|
|
1348
|
-
index: 0
|
|
1349
|
-
};
|
|
1350
|
-
|
|
1351
|
-
return React__default.createElement(ArticleQueue, _extends((_extends2 = {
|
|
1352
|
-
client: client,
|
|
1353
|
-
params: params,
|
|
1354
|
-
relatedArticleQuery: relatedArticleQuery,
|
|
1355
|
-
website: Website,
|
|
1356
|
-
checkSponsered: true,
|
|
1357
|
-
pageview: pageview,
|
|
1358
|
-
shareOptions: shareOptions,
|
|
1359
|
-
Ads: WAds,
|
|
1360
|
-
regionalPages: regionalPages,
|
|
1361
|
-
nationalPage: nationalPage
|
|
1362
|
-
}, _defineProperty(_extends2, 'pageview', pageview), _defineProperty(_extends2, 'onVote', function onVote() {}), _defineProperty(_extends2, 'ISIContent', ISIContent), _defineProperty(_extends2, 'videoAccountIDs', videoAccountIDs), _defineProperty(_extends2, 'sponsoredTaxonomies', []), _defineProperty(_extends2, 'cpModificationRequired', cpModificationRequired), _defineProperty(_extends2, 'Settings', Settings), _defineProperty(_extends2, 'canonicalTag', canonicalTag), _extends2), props));
|
|
1363
|
-
};
|
|
1364
|
-
|
|
1365
1318
|
var _this$1 = undefined;
|
|
1366
1319
|
|
|
1367
1320
|
var View = function View(props) {
|
|
@@ -1540,7 +1493,15 @@ var View = function View(props) {
|
|
|
1540
1493
|
props.article.seriesDetail && props.article.seriesDetail.nextUrl && React__default.createElement('link', { rel: 'next', href: props.article.seriesDetail.nextUrl })
|
|
1541
1494
|
)
|
|
1542
1495
|
),
|
|
1543
|
-
!needInfiniteScroll ? React__default.createElement(Article, _extends({ infiniteScroll: false, showRelatedArticles: showRelatedArticles }, props)) : React__default.createElement(
|
|
1496
|
+
!needInfiniteScroll ? React__default.createElement(Article, _extends({ infiniteScroll: false, showRelatedArticles: showRelatedArticles }, props)) : React__default.createElement(ArticleQueue, _extends({
|
|
1497
|
+
infiniteScroll: true,
|
|
1498
|
+
showRelatedArticles: showRelatedArticles,
|
|
1499
|
+
canonicalTag: canonicalTag,
|
|
1500
|
+
checkSponsered: true,
|
|
1501
|
+
Ads: props.WAds,
|
|
1502
|
+
onVote: function onVote() {},
|
|
1503
|
+
sponsoredTaxonomies: []
|
|
1504
|
+
}, props))
|
|
1544
1505
|
);
|
|
1545
1506
|
};
|
|
1546
1507
|
|
package/dist/esm/getQuery.js
CHANGED
|
@@ -8,9 +8,9 @@ var getQuery = function getQuery(type) {
|
|
|
8
8
|
|
|
9
9
|
switch (type) {
|
|
10
10
|
case 'related':
|
|
11
|
-
return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && defined(published) \n && dateTime(published) <= dateTime(now())\n && passwordLock!=true\n && taxonomyMapping[]._ref in $taxonomy\n && taxonomyMapping[].disableAds != \'true\'\n && contentCategory->.name != \'Poll\'\n && contentCategory->.name != \'Slideshows\'\n && contentCategory->.disableAds != \'true\'\n && ExcludeFromInfiniteScroll !=true\n && url.current != $url\n && !defined(body[].videos)\n
|
|
11
|
+
return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && defined(published) \n && dateTime(published) <= dateTime(now())\n && passwordLock!=true\n && taxonomyMapping[]._ref in $taxonomy\n && taxonomyMapping[].disableAds != \'true\'\n && contentCategory->.name != \'Poll\'\n && contentCategory->.name != \'Slideshows\'\n && contentCategory->.disableAds != \'true\'\n && ExcludeFromInfiniteScroll !=true\n && url.current != $url\n ' + conditions + '\n && !defined(body[].videos)\n ]| order(published desc)[' + (articleCount ? articleCount : '$index') + ']{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n _id,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n disableAds\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n }';
|
|
12
12
|
case 'article':
|
|
13
|
-
return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n medias[]{\n ...,\n upload_doc {\n _type,\n asset-> \n } \n },\n articles[]{\n ...,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n text[]{\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n }\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n documentGroupMapping[]-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n \'category\':contentCategory->{\n name,\n disableAds\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n volume,\n \'issueNumber\': number,\n \'articleSource\': source,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n\n }';
|
|
13
|
+
return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n medias[]{\n ...,\n upload_doc {\n _type,\n asset-> \n } \n },\n articles[]{\n ...,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n text[]{\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n }\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n \'category\':contentCategory->{\n name,\n disableAds\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n volume,\n \'issueNumber\': number,\n \'articleSource\': source,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n\n }';
|
|
14
14
|
case 'publication':
|
|
15
15
|
return '*[_type == \'publication\'\n && identifier.current == $publication\n ' + conditions + '][0] {\n ' + params + '\n ...,\n \'issues\': *[_type == \'publication\'\n && is_visible\n && references(^._id)\n && defined(identifier)] {\n ...,\n pdf{asset->}\n } | order(year desc, month desc)\n }';
|
|
16
16
|
case 'issue':
|
|
@@ -5,7 +5,7 @@ import './_library-528f1934.js';
|
|
|
5
5
|
import './_iter-detect-59409a32.js';
|
|
6
6
|
import './core.get-iterator-method-54d2e411.js';
|
|
7
7
|
import './web.dom.iterable-8956f9a5.js';
|
|
8
|
-
import {
|
|
8
|
+
import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-7c654f36.js';
|
|
9
9
|
import './_set-species-cede29f8.js';
|
|
10
10
|
import { c as cookie } from './index-db3bb315.js';
|
|
11
11
|
import getQuery from './getQuery.js';
|
|
@@ -362,28 +362,33 @@ var dist_3 = dist.parseCookies;
|
|
|
362
362
|
var _this = undefined;
|
|
363
363
|
|
|
364
364
|
var getRelatedArticle = function () {
|
|
365
|
-
var
|
|
365
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
|
|
366
366
|
var ctx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
367
367
|
var client = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
368
368
|
var article = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
369
369
|
var prevUrl = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '/';
|
|
370
370
|
var articleCount = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
371
371
|
|
|
372
|
-
var
|
|
372
|
+
var _article$url, url, documentGroupMapping, issueGroup, content_placement, references, params, articles, filters, cookies, prevSlugs, referenceFilter, query;
|
|
373
373
|
|
|
374
374
|
return regenerator.wrap(function _callee$(_context) {
|
|
375
375
|
while (1) {
|
|
376
376
|
switch (_context.prev = _context.next) {
|
|
377
377
|
case 0:
|
|
378
|
-
|
|
378
|
+
_article$url = article.url;
|
|
379
379
|
_article$url = _article$url === undefined ? {
|
|
380
380
|
current: null
|
|
381
381
|
} : _article$url;
|
|
382
|
-
url = _article$url.current,
|
|
383
|
-
|
|
384
|
-
|
|
382
|
+
url = _article$url.current, documentGroupMapping = article.documentGroupMapping, issueGroup = article.issueGroup;
|
|
383
|
+
content_placement = article.content_placement;
|
|
384
|
+
references = [];
|
|
385
385
|
|
|
386
|
-
|
|
386
|
+
|
|
387
|
+
content_placement = content_placement && content_placement.length > 0 && content_placement.filter(function (_ref2) {
|
|
388
|
+
var identifier = _ref2.identifier;
|
|
389
|
+
return identifier !== 'news';
|
|
390
|
+
});
|
|
391
|
+
if (content_placement && content_placement.length > 0) {
|
|
387
392
|
content_placement.forEach(function (_ref3) {
|
|
388
393
|
var path = _ref3.path,
|
|
389
394
|
_id = _ref3._id;
|
|
@@ -395,27 +400,38 @@ var getRelatedArticle = function () {
|
|
|
395
400
|
if (prev_url_to_check.includes('?')) {
|
|
396
401
|
prev_url_to_check = prev_url_to_check.split('?')[0];
|
|
397
402
|
}
|
|
398
|
-
if (prev_url_to_check.endsWith(path) && _id)
|
|
403
|
+
if (prev_url_to_check.endsWith(path) && _id) references.push(_id);
|
|
399
404
|
});
|
|
405
|
+
if (references.length === 0) {
|
|
406
|
+
content_placement.forEach(function (_ref4) {
|
|
407
|
+
var _id = _ref4._id;
|
|
408
|
+
|
|
409
|
+
if (_id) references.push(_id);
|
|
410
|
+
});
|
|
411
|
+
}
|
|
400
412
|
}
|
|
401
413
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
var _ref = _ref4._ref;
|
|
414
|
+
if (documentGroupMapping && documentGroupMapping.length > 0) {
|
|
415
|
+
documentGroupMapping.forEach(function (_ref5) {
|
|
416
|
+
var _id = _ref5._id;
|
|
406
417
|
|
|
407
|
-
if (
|
|
408
|
-
taxonomy.push(_ref);
|
|
409
|
-
}
|
|
418
|
+
if (_id) references.push(_id);
|
|
410
419
|
});
|
|
411
420
|
}
|
|
412
421
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
};
|
|
418
|
-
|
|
422
|
+
if (issueGroup && issueGroup._ref) {
|
|
423
|
+
references.push(issueGroup._ref);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
params = { url: url, index: articleCount };
|
|
427
|
+
articles = null;
|
|
428
|
+
|
|
429
|
+
if (!(references && references.length > 0)) {
|
|
430
|
+
_context.next = 26;
|
|
431
|
+
break;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
filters = '';
|
|
419
435
|
|
|
420
436
|
if (ctx && url) {
|
|
421
437
|
cookies = dist_3(ctx);
|
|
@@ -423,27 +439,54 @@ var getRelatedArticle = function () {
|
|
|
423
439
|
|
|
424
440
|
if (!!prevSlugs) {
|
|
425
441
|
dist_2(ctx, 'prevSlugs', prevSlugs + ',"' + url + '"', {});
|
|
426
|
-
|
|
442
|
+
filters = '&& !(url.current in [' + prevSlugs + '])';
|
|
427
443
|
} else dist_2(ctx, 'prevSlugs', '"' + url + '"', {});
|
|
428
444
|
}
|
|
429
|
-
relatedArticleQuery = getQuery('related', conditions, '', articleCount);
|
|
430
|
-
_context.next = 12;
|
|
431
|
-
return client.fetch(relatedArticleQuery, params);
|
|
432
|
-
|
|
433
|
-
case 12:
|
|
434
|
-
relatedArticle = _context.sent;
|
|
435
|
-
return _context.abrupt('return', relatedArticle);
|
|
436
445
|
|
|
437
|
-
|
|
446
|
+
referenceFilter = references.reduce(function (acc, item, index, array) {
|
|
447
|
+
if (array.length === 1) {
|
|
448
|
+
acc = acc + ' references("' + item + '") ';
|
|
449
|
+
} else if (index === 0) {
|
|
450
|
+
acc = acc + ' (references("' + item + '") ||';
|
|
451
|
+
} else if (index + 1 === array.length) {
|
|
452
|
+
acc = acc + ' references("' + item + '")) ';
|
|
453
|
+
} else {
|
|
454
|
+
acc = acc + ' references("' + item + '") ||';
|
|
455
|
+
}
|
|
456
|
+
return acc;
|
|
457
|
+
}, '&&');
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
filters = filters + referenceFilter;
|
|
461
|
+
query = getQuery('related', filters, '', articleCount).replace('&& taxonomyMapping[]._ref in $taxonomy', '');
|
|
462
|
+
_context.prev = 17;
|
|
463
|
+
_context.next = 20;
|
|
464
|
+
return client.fetch(query, params);
|
|
465
|
+
|
|
466
|
+
case 20:
|
|
467
|
+
articles = _context.sent;
|
|
468
|
+
_context.next = 26;
|
|
469
|
+
break;
|
|
470
|
+
|
|
471
|
+
case 23:
|
|
472
|
+
_context.prev = 23;
|
|
473
|
+
_context.t0 = _context['catch'](17);
|
|
474
|
+
|
|
475
|
+
console.error(_context.t0);
|
|
476
|
+
|
|
477
|
+
case 26:
|
|
478
|
+
return _context.abrupt('return', articles);
|
|
479
|
+
|
|
480
|
+
case 27:
|
|
438
481
|
case 'end':
|
|
439
482
|
return _context.stop();
|
|
440
483
|
}
|
|
441
484
|
}
|
|
442
|
-
}, _callee, _this);
|
|
485
|
+
}, _callee, _this, [[17, 23]]);
|
|
443
486
|
}));
|
|
444
487
|
|
|
445
488
|
return function getRelatedArticle() {
|
|
446
|
-
return
|
|
489
|
+
return _ref.apply(this, arguments);
|
|
447
490
|
};
|
|
448
491
|
}();
|
|
449
492
|
|
|
@@ -29,7 +29,7 @@ import './main-5d1e4bd3.js';
|
|
|
29
29
|
import './entities-7cc3bf45.js';
|
|
30
30
|
import './stringify-008c8802.js';
|
|
31
31
|
import './slicedToArray-7021e5df.js';
|
|
32
|
-
import './asyncToGenerator-
|
|
32
|
+
import './asyncToGenerator-7c654f36.js';
|
|
33
33
|
import './_set-species-cede29f8.js';
|
|
34
34
|
import './Segment.js';
|
|
35
35
|
import './Beam.js';
|
|
@@ -41,7 +41,7 @@ import 'react-bootstrap';
|
|
|
41
41
|
import './iconBase-602d52fe.js';
|
|
42
42
|
import './index.esm-29e48d38.js';
|
|
43
43
|
import 'react-bootstrap/Button';
|
|
44
|
-
export { g as default } from './index-
|
|
44
|
+
export { g as default } from './index-c376cd8e.js';
|
|
45
45
|
import './util-7700fc59.js';
|
|
46
46
|
import './brightcove-react-player-loader.es-83f53e4e.js';
|
|
47
47
|
import 'react-bootstrap/Pagination';
|