@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/cjs/View.js
CHANGED
|
@@ -48,7 +48,6 @@ require('react-bootstrap');
|
|
|
48
48
|
require('./iconBase-68959171.js');
|
|
49
49
|
require('./index.esm-90433435.js');
|
|
50
50
|
var Button = _interopDefault(require('react-bootstrap/Button'));
|
|
51
|
-
var defineProperty$1 = require('./defineProperty-55548b25.js');
|
|
52
51
|
var Form = _interopDefault(require('react-bootstrap/Form'));
|
|
53
52
|
var getSerializers = require('./index-a5919bab.js');
|
|
54
53
|
require('./util-f2c1b65b.js');
|
|
@@ -254,7 +253,7 @@ var ISI = function ISI(props) {
|
|
|
254
253
|
);
|
|
255
254
|
};
|
|
256
255
|
|
|
257
|
-
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-
|
|
256
|
+
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";
|
|
258
257
|
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" };
|
|
259
258
|
styleInject_es.styleInject(css);
|
|
260
259
|
|
|
@@ -490,65 +489,73 @@ var Article = function Article(props) {
|
|
|
490
489
|
};
|
|
491
490
|
|
|
492
491
|
var RelevantTopics = function RelevantTopics() {
|
|
493
|
-
if (content_placement && content_placement.length > 0 || documentGroupMapping) {
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
{ className: 'mb-0' },
|
|
500
|
-
React__default.createElement(
|
|
501
|
-
'b',
|
|
502
|
-
null,
|
|
503
|
-
'Related Content:'
|
|
504
|
-
)
|
|
505
|
-
),
|
|
506
|
-
documentGroupMapping && documentGroupMapping.map(function (documentGroup) {
|
|
507
|
-
if (!documentGroup.parent) {
|
|
508
|
-
return null;
|
|
492
|
+
if (content_placement && content_placement.length > 0 || documentGroupMapping && documentGroupMapping.length > 0) {
|
|
493
|
+
var relatedLinks = [];
|
|
494
|
+
if (documentGroupMapping && documentGroupMapping.length > 0) {
|
|
495
|
+
documentGroupMapping.forEach(function (documentGroup) {
|
|
496
|
+
if (documentGroup.parent) {
|
|
497
|
+
relatedLinks = [].concat(toConsumableArray._toConsumableArray(relatedLinks), [{ label: documentGroup.name, href: cpModificationRequired ? '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path : '/' + documentGroup.path }]);
|
|
509
498
|
}
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
{ className: '' },
|
|
517
|
-
React__default.createElement(
|
|
518
|
-
'a',
|
|
519
|
-
{
|
|
520
|
-
className: 'related-links',
|
|
521
|
-
style: { color: 'blue' },
|
|
522
|
-
href: cpModificationRequired ? '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path : '/' + documentGroup.path },
|
|
523
|
-
documentGroup.name
|
|
524
|
-
)
|
|
525
|
-
),
|
|
526
|
-
content_placement && content_placement.length ? ' | ' : null
|
|
527
|
-
);
|
|
528
|
-
}),
|
|
529
|
-
content_placement && content_placement.length > 0 ? content_placement.map(function (cp, index) {
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
if (content_placement && content_placement.length > 0) {
|
|
502
|
+
content_placement.filter(function (item) {
|
|
503
|
+
return item.path !== 'news';
|
|
504
|
+
}).forEach(function (cp) {
|
|
530
505
|
var cp_url = cpModificationRequired ? getTargeting.getContentPlacementUrl(cp) : cp.path;
|
|
531
506
|
var href = '/' + cp_url;
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
507
|
+
relatedLinks = [].concat(toConsumableArray._toConsumableArray(relatedLinks), [{ label: cp.name, href: href }]);
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
if (relatedLinks && relatedLinks.length > 0) {
|
|
511
|
+
return React__default.createElement(
|
|
512
|
+
'div',
|
|
513
|
+
null,
|
|
514
|
+
relatedLinks.map(function (relatedLink, index) {
|
|
515
|
+
return React__default.createElement(
|
|
536
516
|
'span',
|
|
537
|
-
|
|
517
|
+
{ key: index, className: 'related-link' },
|
|
538
518
|
React__default.createElement(
|
|
539
519
|
'a',
|
|
540
|
-
{ className: 'related-links',
|
|
541
|
-
|
|
520
|
+
{ className: 'related-links', style: { color: 'blue' }, href: relatedLink.href },
|
|
521
|
+
relatedLink.label
|
|
522
|
+
),
|
|
523
|
+
React__default.createElement(
|
|
524
|
+
'style',
|
|
525
|
+
{ jsx: 'true' },
|
|
526
|
+
'\n .related-link:not(:first-child):before {\n content: \' | \';\n }\n '
|
|
542
527
|
)
|
|
543
|
-
)
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
528
|
+
);
|
|
529
|
+
})
|
|
530
|
+
);
|
|
531
|
+
}
|
|
532
|
+
return null;
|
|
548
533
|
}
|
|
549
534
|
return null;
|
|
550
535
|
};
|
|
551
536
|
|
|
537
|
+
var RelatedContent = function RelatedContent() {
|
|
538
|
+
return React__default.createElement(
|
|
539
|
+
'section',
|
|
540
|
+
{ id: 'related-content-section', className: 'my-1' },
|
|
541
|
+
React__default.createElement(
|
|
542
|
+
'p',
|
|
543
|
+
{ className: 'mb-0' },
|
|
544
|
+
React__default.createElement(
|
|
545
|
+
'b',
|
|
546
|
+
null,
|
|
547
|
+
'Related Content:'
|
|
548
|
+
)
|
|
549
|
+
),
|
|
550
|
+
React__default.createElement(RelevantTopics, null),
|
|
551
|
+
React__default.createElement(
|
|
552
|
+
'div',
|
|
553
|
+
{ className: 'pt-2' },
|
|
554
|
+
React__default.createElement(RelatedArticle, { articles: article.relatedArticle, client: client })
|
|
555
|
+
)
|
|
556
|
+
);
|
|
557
|
+
};
|
|
558
|
+
|
|
552
559
|
var form = function form() {
|
|
553
560
|
return React__default.createElement(
|
|
554
561
|
React__default.Fragment,
|
|
@@ -1007,20 +1014,7 @@ var Article = function Article(props) {
|
|
|
1007
1014
|
)
|
|
1008
1015
|
),
|
|
1009
1016
|
React__default.createElement('div', { className: 'clearfix', style: { minHeight: '1px' } }),
|
|
1010
|
-
showRelatedArticles && !showIsi && React__default.createElement(
|
|
1011
|
-
React__default.Fragment,
|
|
1012
|
-
null,
|
|
1013
|
-
React__default.createElement(
|
|
1014
|
-
'div',
|
|
1015
|
-
null,
|
|
1016
|
-
React__default.createElement(RelevantTopics, null)
|
|
1017
|
-
),
|
|
1018
|
-
React__default.createElement(
|
|
1019
|
-
'div',
|
|
1020
|
-
{ className: 'pt-2' },
|
|
1021
|
-
React__default.createElement(RelatedArticle, { articles: article.relatedArticle, client: client })
|
|
1022
|
-
)
|
|
1023
|
-
)
|
|
1017
|
+
showRelatedArticles && !showIsi && React__default.createElement(RelatedContent, null)
|
|
1024
1018
|
),
|
|
1025
1019
|
renderIsiContent(props.article)
|
|
1026
1020
|
),
|
|
@@ -1185,50 +1179,77 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1185
1179
|
}, 1000);
|
|
1186
1180
|
}, [queueData.length]);
|
|
1187
1181
|
|
|
1188
|
-
var loadmore = function
|
|
1189
|
-
var
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
switch (_context.prev = _context.next) {
|
|
1199
|
-
case 0:
|
|
1200
|
-
if (!(article && article._id)) {
|
|
1201
|
-
_context.next = 9;
|
|
1202
|
-
break;
|
|
1203
|
-
}
|
|
1204
|
-
|
|
1205
|
-
//query next 4 related article without repeating previous 4 related articles
|
|
1206
|
-
startingIndex = queueData.length + 1;
|
|
1207
|
-
endingIndex = startingIndex + 2;
|
|
1208
|
-
_context.next = 5;
|
|
1209
|
-
return getRelatedArticle(null, props.client, article, prevUrl, startingIndex + '..' + endingIndex);
|
|
1210
|
-
|
|
1211
|
-
case 5:
|
|
1212
|
-
article.relatedArticle = _context.sent;
|
|
1213
|
-
targeting = getTargeting.getTargeting({ article: article, cpModificationRequired: cpModificationRequired, prevUrl: prevUrl });
|
|
1214
|
-
|
|
1215
|
-
article.Ads = Ads.getRightItems(targeting);
|
|
1216
|
-
setQueueData([].concat(toConsumableArray._toConsumableArray(queueData), [article]));
|
|
1217
|
-
|
|
1218
|
-
case 9:
|
|
1219
|
-
case 'end':
|
|
1220
|
-
return _context.stop();
|
|
1182
|
+
var loadmore = function () {
|
|
1183
|
+
var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee() {
|
|
1184
|
+
var index, article, startingIndex, endingIndex, targeting;
|
|
1185
|
+
return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
|
|
1186
|
+
while (1) {
|
|
1187
|
+
switch (_context.prev = _context.next) {
|
|
1188
|
+
case 0:
|
|
1189
|
+
if (!(queueData && queueData.length < maxListLength)) {
|
|
1190
|
+
_context.next = 27;
|
|
1191
|
+
break;
|
|
1221
1192
|
}
|
|
1222
|
-
}
|
|
1223
|
-
}, _callee, _this);
|
|
1224
|
-
}));
|
|
1225
1193
|
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1194
|
+
index = queueData.length - 1;
|
|
1195
|
+
article = null;
|
|
1196
|
+
_context.prev = 3;
|
|
1197
|
+
_context.next = 6;
|
|
1198
|
+
return getRelatedArticle(null, props.client, props.article, prevUrl, index);
|
|
1199
|
+
|
|
1200
|
+
case 6:
|
|
1201
|
+
article = _context.sent;
|
|
1202
|
+
_context.next = 12;
|
|
1203
|
+
break;
|
|
1204
|
+
|
|
1205
|
+
case 9:
|
|
1206
|
+
_context.prev = 9;
|
|
1207
|
+
_context.t0 = _context['catch'](3);
|
|
1208
|
+
|
|
1209
|
+
console.error(_context.t0);
|
|
1210
|
+
|
|
1211
|
+
case 12:
|
|
1212
|
+
if (!(article && article._id)) {
|
|
1213
|
+
_context.next = 27;
|
|
1214
|
+
break;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
//query next 4 related article without repeating previous 4 related articles
|
|
1218
|
+
startingIndex = queueData.length + 1;
|
|
1219
|
+
endingIndex = startingIndex + 2;
|
|
1220
|
+
_context.prev = 15;
|
|
1221
|
+
_context.next = 18;
|
|
1222
|
+
return getRelatedArticle(null, props.client, props.article, prevUrl, startingIndex + '..' + endingIndex);
|
|
1223
|
+
|
|
1224
|
+
case 18:
|
|
1225
|
+
article.relatedArticle = _context.sent;
|
|
1226
|
+
_context.next = 24;
|
|
1227
|
+
break;
|
|
1228
|
+
|
|
1229
|
+
case 21:
|
|
1230
|
+
_context.prev = 21;
|
|
1231
|
+
_context.t1 = _context['catch'](15);
|
|
1232
|
+
|
|
1233
|
+
console.error(_context.t1);
|
|
1234
|
+
|
|
1235
|
+
case 24:
|
|
1236
|
+
targeting = getTargeting.getTargeting({ article: article, cpModificationRequired: cpModificationRequired, prevUrl: prevUrl });
|
|
1237
|
+
|
|
1238
|
+
article.Ads = Ads.getRightItems(targeting);
|
|
1239
|
+
setQueueData([].concat(toConsumableArray._toConsumableArray(queueData), [article]));
|
|
1240
|
+
|
|
1241
|
+
case 27:
|
|
1242
|
+
case 'end':
|
|
1243
|
+
return _context.stop();
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
}, _callee, _this, [[3, 9], [15, 21]]);
|
|
1247
|
+
}));
|
|
1248
|
+
|
|
1249
|
+
return function loadmore() {
|
|
1250
|
+
return _ref.apply(this, arguments);
|
|
1251
|
+
};
|
|
1252
|
+
}();
|
|
1232
1253
|
|
|
1233
1254
|
var changeMeta = function changeMeta(meta) {
|
|
1234
1255
|
document.title = meta.shareTitle;
|
|
@@ -1300,74 +1321,6 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1300
1321
|
);
|
|
1301
1322
|
};
|
|
1302
1323
|
|
|
1303
|
-
var Articles = function Articles(props) {
|
|
1304
|
-
var _extends2;
|
|
1305
|
-
|
|
1306
|
-
var videoAccountIDs = props.videoAccountIDs,
|
|
1307
|
-
Ads = props.Ads,
|
|
1308
|
-
cpModificationRequired = props.cpModificationRequired,
|
|
1309
|
-
Settings = props.Settings,
|
|
1310
|
-
ISIContent = props.ISIContent,
|
|
1311
|
-
prevUrl = props.prevUrl,
|
|
1312
|
-
setActiveArticle = props.setActiveArticle,
|
|
1313
|
-
article = props.article,
|
|
1314
|
-
client = props.client,
|
|
1315
|
-
relatedArticleQuery = props.relatedArticleQuery,
|
|
1316
|
-
Website = props.Website,
|
|
1317
|
-
pageview = props.pageview,
|
|
1318
|
-
shareOptions = props.shareOptions,
|
|
1319
|
-
WAds = props.WAds,
|
|
1320
|
-
regionalPages = props.regionalPages,
|
|
1321
|
-
nationalPage = props.nationalPage,
|
|
1322
|
-
canonicalTag = props.canonicalTag;
|
|
1323
|
-
var taxonomyMapping = article.taxonomyMapping,
|
|
1324
|
-
_article$url = article.url;
|
|
1325
|
-
_article$url = _article$url === undefined ? {
|
|
1326
|
-
current: null
|
|
1327
|
-
} : _article$url;
|
|
1328
|
-
var url = _article$url.current,
|
|
1329
|
-
content_placement = article.content_placement;
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
var taxonomy = [];
|
|
1333
|
-
content_placement.forEach(function (_ref2) {
|
|
1334
|
-
var path = _ref2.path,
|
|
1335
|
-
_id = _ref2._id;
|
|
1336
|
-
|
|
1337
|
-
var prev_url_to_check = prevUrl;
|
|
1338
|
-
if (prev_url_to_check.includes('?')) {
|
|
1339
|
-
prev_url_to_check = prev_url_to_check.split('?')[0];
|
|
1340
|
-
}
|
|
1341
|
-
if (prev_url_to_check.endsWith(path)) taxonomy.push(_id);
|
|
1342
|
-
});
|
|
1343
|
-
|
|
1344
|
-
if (taxonomy.length === 0) {
|
|
1345
|
-
taxonomy = taxonomyMapping.map(function (_ref3) {
|
|
1346
|
-
var _ref = _ref3._ref;
|
|
1347
|
-
return _ref;
|
|
1348
|
-
});
|
|
1349
|
-
}
|
|
1350
|
-
|
|
1351
|
-
var params = {
|
|
1352
|
-
url: url,
|
|
1353
|
-
taxonomy: taxonomy,
|
|
1354
|
-
index: 0
|
|
1355
|
-
};
|
|
1356
|
-
|
|
1357
|
-
return React__default.createElement(ArticleQueue, _extends$1._extends((_extends2 = {
|
|
1358
|
-
client: client,
|
|
1359
|
-
params: params,
|
|
1360
|
-
relatedArticleQuery: relatedArticleQuery,
|
|
1361
|
-
website: Website,
|
|
1362
|
-
checkSponsered: true,
|
|
1363
|
-
pageview: pageview,
|
|
1364
|
-
shareOptions: shareOptions,
|
|
1365
|
-
Ads: WAds,
|
|
1366
|
-
regionalPages: regionalPages,
|
|
1367
|
-
nationalPage: nationalPage
|
|
1368
|
-
}, defineProperty$1._defineProperty(_extends2, 'pageview', pageview), defineProperty$1._defineProperty(_extends2, 'onVote', function onVote() {}), defineProperty$1._defineProperty(_extends2, 'ISIContent', ISIContent), defineProperty$1._defineProperty(_extends2, 'videoAccountIDs', videoAccountIDs), defineProperty$1._defineProperty(_extends2, 'sponsoredTaxonomies', []), defineProperty$1._defineProperty(_extends2, 'cpModificationRequired', cpModificationRequired), defineProperty$1._defineProperty(_extends2, 'Settings', Settings), defineProperty$1._defineProperty(_extends2, 'canonicalTag', canonicalTag), _extends2), props));
|
|
1369
|
-
};
|
|
1370
|
-
|
|
1371
1324
|
var _this$1 = undefined;
|
|
1372
1325
|
|
|
1373
1326
|
var View = function View(props) {
|
|
@@ -1546,7 +1499,15 @@ var View = function View(props) {
|
|
|
1546
1499
|
props.article.seriesDetail && props.article.seriesDetail.nextUrl && React__default.createElement('link', { rel: 'next', href: props.article.seriesDetail.nextUrl })
|
|
1547
1500
|
)
|
|
1548
1501
|
),
|
|
1549
|
-
!needInfiniteScroll ? React__default.createElement(Article, _extends$1._extends({ infiniteScroll: false, showRelatedArticles: showRelatedArticles }, props)) : React__default.createElement(
|
|
1502
|
+
!needInfiniteScroll ? React__default.createElement(Article, _extends$1._extends({ infiniteScroll: false, showRelatedArticles: showRelatedArticles }, props)) : React__default.createElement(ArticleQueue, _extends$1._extends({
|
|
1503
|
+
infiniteScroll: true,
|
|
1504
|
+
showRelatedArticles: showRelatedArticles,
|
|
1505
|
+
canonicalTag: canonicalTag,
|
|
1506
|
+
checkSponsered: true,
|
|
1507
|
+
Ads: props.WAds,
|
|
1508
|
+
onVote: function onVote() {},
|
|
1509
|
+
sponsoredTaxonomies: []
|
|
1510
|
+
}, props))
|
|
1550
1511
|
);
|
|
1551
1512
|
};
|
|
1552
1513
|
|
package/dist/cjs/getQuery.js
CHANGED
|
@@ -10,9 +10,9 @@ var getQuery = function getQuery(type) {
|
|
|
10
10
|
|
|
11
11
|
switch (type) {
|
|
12
12
|
case 'related':
|
|
13
|
-
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
|
|
13
|
+
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 }';
|
|
14
14
|
case 'article':
|
|
15
|
-
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 }';
|
|
15
|
+
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 }';
|
|
16
16
|
case 'publication':
|
|
17
17
|
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 }';
|
|
18
18
|
case 'issue':
|
|
@@ -364,28 +364,33 @@ var dist_3 = dist.parseCookies;
|
|
|
364
364
|
var _this = undefined;
|
|
365
365
|
|
|
366
366
|
var getRelatedArticle = function () {
|
|
367
|
-
var
|
|
367
|
+
var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee() {
|
|
368
368
|
var ctx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
369
369
|
var client = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
370
370
|
var article = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
371
371
|
var prevUrl = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '/';
|
|
372
372
|
var articleCount = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
373
373
|
|
|
374
|
-
var
|
|
374
|
+
var _article$url, url, documentGroupMapping, issueGroup, content_placement, references, params, articles, filters, cookies, prevSlugs, referenceFilter, query;
|
|
375
375
|
|
|
376
376
|
return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
|
|
377
377
|
while (1) {
|
|
378
378
|
switch (_context.prev = _context.next) {
|
|
379
379
|
case 0:
|
|
380
|
-
|
|
380
|
+
_article$url = article.url;
|
|
381
381
|
_article$url = _article$url === undefined ? {
|
|
382
382
|
current: null
|
|
383
383
|
} : _article$url;
|
|
384
|
-
url = _article$url.current,
|
|
385
|
-
|
|
386
|
-
|
|
384
|
+
url = _article$url.current, documentGroupMapping = article.documentGroupMapping, issueGroup = article.issueGroup;
|
|
385
|
+
content_placement = article.content_placement;
|
|
386
|
+
references = [];
|
|
387
387
|
|
|
388
|
-
|
|
388
|
+
|
|
389
|
+
content_placement = content_placement && content_placement.length > 0 && content_placement.filter(function (_ref2) {
|
|
390
|
+
var identifier = _ref2.identifier;
|
|
391
|
+
return identifier !== 'news';
|
|
392
|
+
});
|
|
393
|
+
if (content_placement && content_placement.length > 0) {
|
|
389
394
|
content_placement.forEach(function (_ref3) {
|
|
390
395
|
var path = _ref3.path,
|
|
391
396
|
_id = _ref3._id;
|
|
@@ -397,27 +402,38 @@ var getRelatedArticle = function () {
|
|
|
397
402
|
if (prev_url_to_check.includes('?')) {
|
|
398
403
|
prev_url_to_check = prev_url_to_check.split('?')[0];
|
|
399
404
|
}
|
|
400
|
-
if (prev_url_to_check.endsWith(path) && _id)
|
|
405
|
+
if (prev_url_to_check.endsWith(path) && _id) references.push(_id);
|
|
401
406
|
});
|
|
407
|
+
if (references.length === 0) {
|
|
408
|
+
content_placement.forEach(function (_ref4) {
|
|
409
|
+
var _id = _ref4._id;
|
|
410
|
+
|
|
411
|
+
if (_id) references.push(_id);
|
|
412
|
+
});
|
|
413
|
+
}
|
|
402
414
|
}
|
|
403
415
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
var _ref = _ref4._ref;
|
|
416
|
+
if (documentGroupMapping && documentGroupMapping.length > 0) {
|
|
417
|
+
documentGroupMapping.forEach(function (_ref5) {
|
|
418
|
+
var _id = _ref5._id;
|
|
408
419
|
|
|
409
|
-
if (
|
|
410
|
-
taxonomy.push(_ref);
|
|
411
|
-
}
|
|
420
|
+
if (_id) references.push(_id);
|
|
412
421
|
});
|
|
413
422
|
}
|
|
414
423
|
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
};
|
|
420
|
-
|
|
424
|
+
if (issueGroup && issueGroup._ref) {
|
|
425
|
+
references.push(issueGroup._ref);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
params = { url: url, index: articleCount };
|
|
429
|
+
articles = null;
|
|
430
|
+
|
|
431
|
+
if (!(references && references.length > 0)) {
|
|
432
|
+
_context.next = 26;
|
|
433
|
+
break;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
filters = '';
|
|
421
437
|
|
|
422
438
|
if (ctx && url) {
|
|
423
439
|
cookies = dist_3(ctx);
|
|
@@ -425,27 +441,54 @@ var getRelatedArticle = function () {
|
|
|
425
441
|
|
|
426
442
|
if (!!prevSlugs) {
|
|
427
443
|
dist_2(ctx, 'prevSlugs', prevSlugs + ',"' + url + '"', {});
|
|
428
|
-
|
|
444
|
+
filters = '&& !(url.current in [' + prevSlugs + '])';
|
|
429
445
|
} else dist_2(ctx, 'prevSlugs', '"' + url + '"', {});
|
|
430
446
|
}
|
|
431
|
-
relatedArticleQuery = getQuery('related', conditions, '', articleCount);
|
|
432
|
-
_context.next = 12;
|
|
433
|
-
return client.fetch(relatedArticleQuery, params);
|
|
434
|
-
|
|
435
|
-
case 12:
|
|
436
|
-
relatedArticle = _context.sent;
|
|
437
|
-
return _context.abrupt('return', relatedArticle);
|
|
438
447
|
|
|
439
|
-
|
|
448
|
+
referenceFilter = references.reduce(function (acc, item, index, array) {
|
|
449
|
+
if (array.length === 1) {
|
|
450
|
+
acc = acc + ' references("' + item + '") ';
|
|
451
|
+
} else if (index === 0) {
|
|
452
|
+
acc = acc + ' (references("' + item + '") ||';
|
|
453
|
+
} else if (index + 1 === array.length) {
|
|
454
|
+
acc = acc + ' references("' + item + '")) ';
|
|
455
|
+
} else {
|
|
456
|
+
acc = acc + ' references("' + item + '") ||';
|
|
457
|
+
}
|
|
458
|
+
return acc;
|
|
459
|
+
}, '&&');
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
filters = filters + referenceFilter;
|
|
463
|
+
query = getQuery('related', filters, '', articleCount).replace('&& taxonomyMapping[]._ref in $taxonomy', '');
|
|
464
|
+
_context.prev = 17;
|
|
465
|
+
_context.next = 20;
|
|
466
|
+
return client.fetch(query, params);
|
|
467
|
+
|
|
468
|
+
case 20:
|
|
469
|
+
articles = _context.sent;
|
|
470
|
+
_context.next = 26;
|
|
471
|
+
break;
|
|
472
|
+
|
|
473
|
+
case 23:
|
|
474
|
+
_context.prev = 23;
|
|
475
|
+
_context.t0 = _context['catch'](17);
|
|
476
|
+
|
|
477
|
+
console.error(_context.t0);
|
|
478
|
+
|
|
479
|
+
case 26:
|
|
480
|
+
return _context.abrupt('return', articles);
|
|
481
|
+
|
|
482
|
+
case 27:
|
|
440
483
|
case 'end':
|
|
441
484
|
return _context.stop();
|
|
442
485
|
}
|
|
443
486
|
}
|
|
444
|
-
}, _callee, _this);
|
|
487
|
+
}, _callee, _this, [[17, 23]]);
|
|
445
488
|
}));
|
|
446
489
|
|
|
447
490
|
return function getRelatedArticle() {
|
|
448
|
-
return
|
|
491
|
+
return _ref.apply(this, arguments);
|
|
449
492
|
};
|
|
450
493
|
}();
|
|
451
494
|
|