@mjhls/mjh-framework 1.0.593 → 1.0.596
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/ArticleQueue.js +296 -25
- package/dist/cjs/{AuthorComponent-cb8b8128.js → AuthorComponent-3c79e1ab.js} +2 -2
- package/dist/cjs/DeckContent.js +1 -1
- package/dist/cjs/DeckQueue.js +1 -1
- package/dist/cjs/ExternalResources.js +4 -3
- package/dist/cjs/ForbesHero.js +1 -1
- package/dist/cjs/GridContent.js +2 -2
- package/dist/cjs/GridHero.js +1 -1
- package/dist/cjs/InscreenSensor-e45e95e3.js +85 -0
- package/dist/cjs/IssueContentDeck.js +1 -1
- package/dist/cjs/IssueLanding.js +1 -1
- package/dist/cjs/MasterDeck.js +1 -1
- package/dist/cjs/OncliveLargeHero.js +1 -1
- package/dist/cjs/PartnerDetailListing.js +3 -3
- package/dist/cjs/QueueDeckExpanded.js +1 -1
- package/dist/cjs/RecentNews.js +93 -0
- package/dist/cjs/VideoSeriesListing.js +1 -1
- package/dist/cjs/View.js +234 -120
- package/dist/cjs/YahooHero.js +1 -1
- package/dist/cjs/getQuery.js +3 -5
- package/dist/cjs/getRelatedArticle.js +4 -6
- package/dist/cjs/getSerializers.js +31 -8305
- package/dist/cjs/getSeriesDetail.js +0 -1
- package/dist/cjs/index-e7f86168.js +8562 -0
- package/dist/cjs/index.js +7 -7
- package/dist/cjs/{inherits-14962339.js → inherits-93684212.js} +4 -4
- package/dist/esm/AD.js +1 -1
- package/dist/esm/AD300x250.js +2 -2
- package/dist/esm/AD300x250x600.js +2 -2
- package/dist/esm/AD728x90.js +2 -2
- package/dist/esm/ADFloatingFooter.js +2 -2
- package/dist/esm/ADGutter.js +2 -2
- package/dist/esm/ADSkyscraper.js +2 -2
- package/dist/esm/ADSponsoredResources.js +2 -2
- package/dist/esm/ADWebcast.js +2 -2
- package/dist/esm/ADWelcome.js +2 -2
- package/dist/esm/AdSlot.js +2 -2
- package/dist/esm/ArticleQueue.js +287 -16
- package/dist/esm/{AuthorComponent-158226c9.js → AuthorComponent-357dbee9.js} +2 -2
- package/dist/esm/CMEDeck.js +2 -2
- package/dist/esm/Column2.js +3 -3
- package/dist/esm/Column3.js +4 -4
- package/dist/esm/DeckContent.js +3 -3
- package/dist/esm/DeckQueue.js +4 -4
- package/dist/esm/{Dfp-ae9336e2.js → Dfp-56444b73.js} +2 -2
- package/dist/esm/ExternalResources.js +4 -3
- package/dist/esm/ForbesHero.js +1 -1
- package/dist/esm/GridContent.js +7 -7
- package/dist/esm/GridHero.js +1 -1
- package/dist/esm/InscreenSensor-beb2ec79.js +80 -0
- package/dist/esm/IssueContentDeck.js +1 -1
- package/dist/esm/IssueLanding.js +5 -5
- package/dist/esm/LeftNav.js +2 -2
- package/dist/esm/MasterDeck.js +4 -4
- package/dist/esm/OncliveLargeHero.js +1 -1
- package/dist/esm/PartnerDetailListing.js +6 -6
- package/dist/esm/QueueDeckExpanded.js +5 -5
- package/dist/esm/RecentNews.js +88 -0
- package/dist/esm/SideFooter.js +3 -3
- package/dist/esm/TemplateNormal.js +4 -4
- package/dist/esm/VideoSeriesListing.js +2 -2
- package/dist/esm/View.js +224 -110
- package/dist/esm/YahooHero.js +1 -1
- package/dist/esm/{_arrayMap-64cbe0e4.js → _arrayMap-818441dd.js} +1 -1
- package/dist/esm/{debounce-048d9cb6.js → debounce-a0d9abca.js} +1 -1
- package/dist/esm/{get-0eb56363.js → get-58d2f7cc.js} +2 -2
- package/dist/esm/getQuery.js +3 -5
- package/dist/esm/getRelatedArticle.js +4 -6
- package/dist/esm/getSerializers.js +29 -8303
- package/dist/esm/getSeriesDetail.js +0 -1
- package/dist/esm/index-91506c27.js +8555 -0
- package/dist/esm/index.js +10 -10
- package/dist/esm/{isSymbol-b7b7434f.js → isSymbol-47f5ff3b.js} +1 -1
- package/package.json +1 -1
- package/dist/cjs/InscreenSensor-3aec8492.js +0 -361
- package/dist/esm/InscreenSensor-280b2b10.js +0 -352
- /package/dist/esm/{ADInfeed-c7dba95f.js → ADInfeed-cecd42e8.js} +0 -0
- /package/dist/esm/{ADlgInfeed-8bfd6d58.js → ADlgInfeed-234ba767.js} +0 -0
package/dist/esm/View.js
CHANGED
|
@@ -19,8 +19,8 @@ import 'react-bootstrap/Row';
|
|
|
19
19
|
import 'react-bootstrap/Col';
|
|
20
20
|
import { m as moment } from './moment-12415288.js';
|
|
21
21
|
import { useRouter } from 'next/router';
|
|
22
|
-
import './isSymbol-
|
|
23
|
-
import './debounce-
|
|
22
|
+
import './isSymbol-47f5ff3b.js';
|
|
23
|
+
import './debounce-a0d9abca.js';
|
|
24
24
|
import { I as InfiniteScroll } from './index.es-938a3a58.js';
|
|
25
25
|
import 'react-dom';
|
|
26
26
|
import './index-51a80699.js';
|
|
@@ -33,12 +33,14 @@ import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-037
|
|
|
33
33
|
import './_set-species-6f64f1c1.js';
|
|
34
34
|
import './beam-a25bd8fd.js';
|
|
35
35
|
import DFPAdSlot from './AdSlot.js';
|
|
36
|
+
import './lodash-17fdfebb.js';
|
|
37
|
+
import { A as AuthorComponent } from './AuthorComponent-357dbee9.js';
|
|
36
38
|
import { B as BlockContent } from './BlockContent-a614acdf.js';
|
|
37
39
|
import './smoothscroll-4b699764.js';
|
|
38
40
|
import './GroupDeck.js';
|
|
39
|
-
import
|
|
41
|
+
import 'react-bootstrap';
|
|
40
42
|
import Button from 'react-bootstrap/Button';
|
|
41
|
-
import getSerializers from './
|
|
43
|
+
import { r as renderAuthor, g as getSerializers } from './index-91506c27.js';
|
|
42
44
|
import './util-7700fc59.js';
|
|
43
45
|
import './brightcove-react-player-loader.es-83f53e4e.js';
|
|
44
46
|
import 'react-bootstrap/Pagination';
|
|
@@ -48,8 +50,8 @@ import SocialShare from './SocialShare.js';
|
|
|
48
50
|
import Form from 'react-bootstrap/Form';
|
|
49
51
|
import FormControl from 'react-bootstrap/FormControl';
|
|
50
52
|
import { _ as _Object$keys } from './keys-04cdec91.js';
|
|
51
|
-
import
|
|
52
|
-
import { I as InscreenSensor } from './InscreenSensor-
|
|
53
|
+
import 'react-bootstrap/Dropdown';
|
|
54
|
+
import { I as InscreenSensor } from './InscreenSensor-beb2ec79.js';
|
|
53
55
|
import getKeywords from './getKeywords.js';
|
|
54
56
|
import getSeriesDetail from './getSeriesDetail.js';
|
|
55
57
|
import 'nookies';
|
|
@@ -58,64 +60,6 @@ import getRelatedArticle from './getRelatedArticle.js';
|
|
|
58
60
|
import { g as getTargeting, a as getContentPlacementUrl } from './getTargeting-1a0bd08d.js';
|
|
59
61
|
import urlFor from './urlFor.js';
|
|
60
62
|
|
|
61
|
-
var renderAuthor = function renderAuthor(authorName, authorURL, index, length) {
|
|
62
|
-
var defaultUrl = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'authors';
|
|
63
|
-
var biography = arguments[5];
|
|
64
|
-
var profileImage = arguments[6];
|
|
65
|
-
|
|
66
|
-
if (authorName && authorURL) {
|
|
67
|
-
return React__default.createElement(
|
|
68
|
-
'span',
|
|
69
|
-
null,
|
|
70
|
-
React__default.createElement(
|
|
71
|
-
'a',
|
|
72
|
-
{ className: 'author-details-link-' + index, rel: 'author', href: '/' + defaultUrl + '/' + authorURL.current, key: index },
|
|
73
|
-
authorName
|
|
74
|
-
),
|
|
75
|
-
React__default.createElement(
|
|
76
|
-
Card,
|
|
77
|
-
{ className: 'author-details-card-' + index },
|
|
78
|
-
React__default.createElement(
|
|
79
|
-
Row,
|
|
80
|
-
null,
|
|
81
|
-
profileImage && React__default.createElement(
|
|
82
|
-
Col,
|
|
83
|
-
{ sm: 12, md: 4, className: 'author-details-img-container' },
|
|
84
|
-
React__default.createElement(Card.Img, { className: 'author-details-img', src: profileImage, alt: authorName })
|
|
85
|
-
),
|
|
86
|
-
React__default.createElement(
|
|
87
|
-
Col,
|
|
88
|
-
{ className: 'author-details-col', sm: 12, md: profileImage ? 8 : 12 },
|
|
89
|
-
React__default.createElement(
|
|
90
|
-
'h5',
|
|
91
|
-
null,
|
|
92
|
-
authorName
|
|
93
|
-
),
|
|
94
|
-
React__default.createElement(
|
|
95
|
-
'p',
|
|
96
|
-
null,
|
|
97
|
-
biography
|
|
98
|
-
)
|
|
99
|
-
)
|
|
100
|
-
)
|
|
101
|
-
),
|
|
102
|
-
React__default.createElement(
|
|
103
|
-
'style',
|
|
104
|
-
{ jsx: 'true' },
|
|
105
|
-
'\n .author-details-card-' + index + ' {\n display: none;\n position: absolute;\n width: 90%;\n max-width: 450px;\n z-index: 9999;\n }\n .author-details-card-' + index + ' h5 {\n font-weight: 500;\n }\n .author-details-link-' + index + ':hover + .author-details-card-' + index + ', .author-details-card-' + index + ':hover {\n display: block;\n box-shadow: 0px 0px 5px #aaa;\n padding: 15px;\n border-radius: 5px;\n }\n '
|
|
106
|
-
),
|
|
107
|
-
length !== index + 1 && ' , '
|
|
108
|
-
);
|
|
109
|
-
} else if (authorName) {
|
|
110
|
-
return React__default.createElement(
|
|
111
|
-
'span',
|
|
112
|
-
{ key: index },
|
|
113
|
-
authorName,
|
|
114
|
-
length !== index + 1 && ' , '
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
|
|
119
63
|
var getArticleSummary = function getArticleSummary(article) {
|
|
120
64
|
if (article.summary && article.summary.length > 0) {
|
|
121
65
|
return article.summary;
|
|
@@ -237,6 +181,89 @@ var findIndex = function findIndex(arr) {
|
|
|
237
181
|
return indexes;
|
|
238
182
|
};
|
|
239
183
|
|
|
184
|
+
function styleInject(css, ref) {
|
|
185
|
+
if ( ref === void 0 ) ref = {};
|
|
186
|
+
var insertAt = ref.insertAt;
|
|
187
|
+
|
|
188
|
+
if (!css || typeof document === 'undefined') { return; }
|
|
189
|
+
|
|
190
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
191
|
+
var style = document.createElement('style');
|
|
192
|
+
style.type = 'text/css';
|
|
193
|
+
|
|
194
|
+
if (insertAt === 'top') {
|
|
195
|
+
if (head.firstChild) {
|
|
196
|
+
head.insertBefore(style, head.firstChild);
|
|
197
|
+
} else {
|
|
198
|
+
head.appendChild(style);
|
|
199
|
+
}
|
|
200
|
+
} else {
|
|
201
|
+
head.appendChild(style);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
if (style.styleSheet) {
|
|
205
|
+
style.styleSheet.cssText = css;
|
|
206
|
+
} else {
|
|
207
|
+
style.appendChild(document.createTextNode(css));
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
var css = ".RelatedArticles-module_mediaCard__3wQbn {\r\n display: flex;\r\n flex-direction: row;\r\n margin-bottom: .75rem;\r\n padding-bottom: .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: 19px;\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_mediaCard__3wQbn a img {\r\n width: 175px;\r\n min-width: 175px;\r\n height: auto;\r\n object-fit: contain;\r\n}\r\n@media screen and (max-width: 1064px) {\r\n .RelatedArticles-module_cardTitle__3P-Ib {\r\n font-size: 1.1rem;\r\n }\r\n}\r\n@media screen and (max-width: 768px) {\r\n .RelatedArticles-module_mediaCard__3wQbn {\r\n flex-direction: column;\r\n }\r\n .RelatedArticles-module_mediaCard__3wQbn a img {\r\n width: 100%;\r\n height: auto;\r\n max-height: 175px;\r\n object-fit: contain;\r\n margin-bottom: 1rem;\r\n }\r\n}";
|
|
212
|
+
var styles = { "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" };
|
|
213
|
+
styleInject(css);
|
|
214
|
+
|
|
215
|
+
var RelatedArticle = function RelatedArticle(_ref) {
|
|
216
|
+
var articles = _ref.articles,
|
|
217
|
+
client = _ref.client;
|
|
218
|
+
|
|
219
|
+
if (!articles || articles.length == 0 || !articles[0]) {
|
|
220
|
+
return null;
|
|
221
|
+
}
|
|
222
|
+
return React__default.createElement(
|
|
223
|
+
'div',
|
|
224
|
+
null,
|
|
225
|
+
articles.map(function (article, index) {
|
|
226
|
+
return React__default.createElement(
|
|
227
|
+
'div',
|
|
228
|
+
{ id: 'related-card', key: index, className: styles.mediaCard },
|
|
229
|
+
React__default.createElement(
|
|
230
|
+
'a',
|
|
231
|
+
{ className: styles.imgWrapper, href: '/view/' + (article.url ? article.url.current : '') },
|
|
232
|
+
article.thumbnail && React__default.createElement('img', {
|
|
233
|
+
style: { maxHeight: '135px', objectFit: 'cover', objectPosition: 'center' },
|
|
234
|
+
className: 'mr-3 img-fluid',
|
|
235
|
+
src: article.thumbnail && urlFor(client, article.thumbnail.asset).width(250).url(),
|
|
236
|
+
alt: article.title
|
|
237
|
+
})
|
|
238
|
+
),
|
|
239
|
+
React__default.createElement(
|
|
240
|
+
'div',
|
|
241
|
+
{ className: styles.mediaBody },
|
|
242
|
+
React__default.createElement(
|
|
243
|
+
'a',
|
|
244
|
+
{ href: '/view/' + (article.url ? article.url.current : '') },
|
|
245
|
+
React__default.createElement(
|
|
246
|
+
'h4',
|
|
247
|
+
{ className: styles.cardTitle },
|
|
248
|
+
article.title
|
|
249
|
+
)
|
|
250
|
+
),
|
|
251
|
+
React__default.createElement(
|
|
252
|
+
'span',
|
|
253
|
+
{ className: styles.cardDate },
|
|
254
|
+
moment(article.published).format('MMMM Do YYYY, h:mma')
|
|
255
|
+
),
|
|
256
|
+
article.authorDetails && article.authorDetails.length > 0 && React__default.createElement(
|
|
257
|
+
'div',
|
|
258
|
+
{ className: 'author-listing' },
|
|
259
|
+
React__default.createElement(AuthorComponent, { index: index, authors: article.authorDetails })
|
|
260
|
+
)
|
|
261
|
+
)
|
|
262
|
+
);
|
|
263
|
+
})
|
|
264
|
+
);
|
|
265
|
+
};
|
|
266
|
+
|
|
240
267
|
var Article = function Article(props) {
|
|
241
268
|
var onVote = function () {
|
|
242
269
|
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(nodeKey, selectedChoice) {
|
|
@@ -289,7 +316,8 @@ var Article = function Article(props) {
|
|
|
289
316
|
}();
|
|
290
317
|
|
|
291
318
|
var article = props.article,
|
|
292
|
-
Ads = props.Ads
|
|
319
|
+
Ads = props.Ads,
|
|
320
|
+
showRelatedArticles = props.showRelatedArticles;
|
|
293
321
|
var client = props.client,
|
|
294
322
|
pageview = props.pageview,
|
|
295
323
|
videoAccountIDs = props.videoAccountIDs,
|
|
@@ -333,6 +361,7 @@ var Article = function Article(props) {
|
|
|
333
361
|
if (sponsoredFlag) {
|
|
334
362
|
article.contextualVideoAD = false;
|
|
335
363
|
article.contextualAD = false;
|
|
364
|
+
showRelatedArticles = false;
|
|
336
365
|
}
|
|
337
366
|
//This was being done in ArticleQueue2 which wasnt effecting articles excluded from infinite scroll, moved inside article component
|
|
338
367
|
if (!sponsoredFlag && Ads.getVideoContextualAD) {
|
|
@@ -399,34 +428,55 @@ var Article = function Article(props) {
|
|
|
399
428
|
return null;
|
|
400
429
|
};
|
|
401
430
|
|
|
402
|
-
var
|
|
431
|
+
var RelevantTopics = function RelevantTopics() {
|
|
403
432
|
if (content_placement && content_placement.length > 0 || documentGroup) {
|
|
404
433
|
return React__default.createElement(
|
|
405
|
-
|
|
406
|
-
|
|
434
|
+
'div',
|
|
435
|
+
{ style: { color: '#262626' } },
|
|
407
436
|
React__default.createElement(
|
|
408
|
-
|
|
409
|
-
{
|
|
410
|
-
|
|
437
|
+
'p',
|
|
438
|
+
{ className: 'mb-0' },
|
|
439
|
+
React__default.createElement(
|
|
440
|
+
'b',
|
|
441
|
+
null,
|
|
442
|
+
'Related Content:'
|
|
443
|
+
)
|
|
411
444
|
),
|
|
412
|
-
React__default.createElement(
|
|
413
|
-
|
|
445
|
+
documentGroup && documentGroup.parent && React__default.createElement(
|
|
446
|
+
React__default.Fragment,
|
|
414
447
|
null,
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
{
|
|
418
|
-
|
|
448
|
+
React__default.createElement(
|
|
449
|
+
'span',
|
|
450
|
+
{ className: '' },
|
|
451
|
+
React__default.createElement(
|
|
452
|
+
'a',
|
|
453
|
+
{
|
|
454
|
+
className: 'related-links',
|
|
455
|
+
style: { color: 'blue' },
|
|
456
|
+
href: cpModificationRequired ? '/' + documentGroup.parent.identifier.current + '/' + documentGroup.path : '/' + documentGroup.path },
|
|
457
|
+
documentGroup.name
|
|
458
|
+
)
|
|
419
459
|
),
|
|
420
|
-
content_placement && content_placement.length
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
460
|
+
content_placement && content_placement.length ? ' | ' : null
|
|
461
|
+
),
|
|
462
|
+
content_placement && content_placement.length > 0 ? content_placement.map(function (cp, index) {
|
|
463
|
+
var cp_url = cpModificationRequired ? getContentPlacementUrl(cp) : cp.path;
|
|
464
|
+
var href = '/' + cp_url;
|
|
465
|
+
return React__default.createElement(
|
|
466
|
+
React__default.Fragment,
|
|
467
|
+
{ key: index },
|
|
468
|
+
React__default.createElement(
|
|
469
|
+
'span',
|
|
470
|
+
null,
|
|
471
|
+
React__default.createElement(
|
|
472
|
+
'a',
|
|
473
|
+
{ className: 'related-links', key: index, href: href, style: { color: 'blue' } },
|
|
474
|
+
cp.name
|
|
475
|
+
)
|
|
476
|
+
),
|
|
477
|
+
content_placement.length > index + 1 ? ' | ' : null
|
|
478
|
+
);
|
|
479
|
+
}) : null
|
|
430
480
|
);
|
|
431
481
|
}
|
|
432
482
|
return null;
|
|
@@ -718,7 +768,7 @@ var Article = function Article(props) {
|
|
|
718
768
|
),
|
|
719
769
|
React__default.createElement(
|
|
720
770
|
'div',
|
|
721
|
-
{ className: 'mb-
|
|
771
|
+
{ className: 'mb-3 doc-group-container', style: { display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end' } },
|
|
722
772
|
React__default.createElement(
|
|
723
773
|
'style',
|
|
724
774
|
{ jsx: 'true' },
|
|
@@ -765,6 +815,23 @@ var Article = function Article(props) {
|
|
|
765
815
|
issue && React__default.createElement(
|
|
766
816
|
'div',
|
|
767
817
|
{ className: 'volume-issue' },
|
|
818
|
+
issue.publication && issue.publication.name && React__default.createElement(
|
|
819
|
+
'span',
|
|
820
|
+
{ className: 'mb-0' },
|
|
821
|
+
React__default.createElement(
|
|
822
|
+
'b',
|
|
823
|
+
null,
|
|
824
|
+
issue.publication.name
|
|
825
|
+
),
|
|
826
|
+
',',
|
|
827
|
+
' '
|
|
828
|
+
),
|
|
829
|
+
issue.name && React__default.createElement(
|
|
830
|
+
'span',
|
|
831
|
+
{ className: 'mb-0' },
|
|
832
|
+
issue.name,
|
|
833
|
+
', '
|
|
834
|
+
),
|
|
768
835
|
issue.volume && React__default.createElement(
|
|
769
836
|
'span',
|
|
770
837
|
null,
|
|
@@ -798,8 +865,7 @@ var Article = function Article(props) {
|
|
|
798
865
|
twitterSiteName: twitterSiteName,
|
|
799
866
|
disableMeta: true
|
|
800
867
|
})
|
|
801
|
-
)
|
|
802
|
-
renderRelevantTopicsDropdown()
|
|
868
|
+
)
|
|
803
869
|
),
|
|
804
870
|
React__default.createElement(
|
|
805
871
|
'div',
|
|
@@ -842,6 +908,7 @@ var Article = function Article(props) {
|
|
|
842
908
|
'div',
|
|
843
909
|
{ className: 'block-content mt-3' },
|
|
844
910
|
renderBlockContent(article),
|
|
911
|
+
React__default.createElement('div', { className: 'clearfix' }),
|
|
845
912
|
React__default.createElement(
|
|
846
913
|
'noscript',
|
|
847
914
|
null,
|
|
@@ -869,6 +936,17 @@ var Article = function Article(props) {
|
|
|
869
936
|
'Download Issue : ',
|
|
870
937
|
issue.name
|
|
871
938
|
)
|
|
939
|
+
),
|
|
940
|
+
React__default.createElement('div', { className: 'clearfix', style: { minHeight: '1px' } }),
|
|
941
|
+
React__default.createElement(
|
|
942
|
+
'div',
|
|
943
|
+
null,
|
|
944
|
+
React__default.createElement(RelevantTopics, null)
|
|
945
|
+
),
|
|
946
|
+
showRelatedArticles && React__default.createElement(
|
|
947
|
+
'div',
|
|
948
|
+
{ className: 'pt-2', style: { borderTop: '1px solid #eee' } },
|
|
949
|
+
React__default.createElement(RelatedArticle, { articles: article.relatedArticle, client: client })
|
|
872
950
|
)
|
|
873
951
|
),
|
|
874
952
|
renderIsiContent(props.article)
|
|
@@ -883,21 +961,21 @@ var Article = function Article(props) {
|
|
|
883
961
|
);
|
|
884
962
|
}
|
|
885
963
|
}),
|
|
886
|
-
React__default.createElement('div', { className: 'clearfix', style: { minHeight: '1px' } }),
|
|
887
|
-
React__default.createElement('hr', { className: 'article-seperater my-5' }),
|
|
888
964
|
React__default.createElement(
|
|
889
965
|
'noscript',
|
|
890
966
|
null,
|
|
891
|
-
props.infiniteScroll && props.article.relatedArticle && props.article.relatedArticle.url && props.article.relatedArticle.url.current && React__default.createElement(
|
|
967
|
+
props.infiniteScroll && props.article.relatedArticle && props.article.relatedArticle[0] && props.article.relatedArticle[0].url && props.article.relatedArticle[0].url.current && React__default.createElement(
|
|
892
968
|
'div',
|
|
893
969
|
{ style: { textAlign: 'center' } },
|
|
894
970
|
React__default.createElement(
|
|
895
971
|
'a',
|
|
896
|
-
{ href: '/view/' + props.article.relatedArticle.url.current },
|
|
897
|
-
'Related Article
|
|
972
|
+
{ href: '/view/' + props.article.relatedArticle[0].url.current },
|
|
973
|
+
'Related Article ',
|
|
974
|
+
'>>>'
|
|
898
975
|
)
|
|
899
976
|
)
|
|
900
|
-
)
|
|
977
|
+
),
|
|
978
|
+
React__default.createElement('hr', { className: 'article-seperater my-5' })
|
|
901
979
|
);
|
|
902
980
|
};
|
|
903
981
|
|
|
@@ -940,6 +1018,8 @@ exports.default = function (obj, key, value) {
|
|
|
940
1018
|
|
|
941
1019
|
var _defineProperty = unwrapExports(defineProperty);
|
|
942
1020
|
|
|
1021
|
+
var _this = undefined;
|
|
1022
|
+
|
|
943
1023
|
var ArticleQueue = function ArticleQueue(props) {
|
|
944
1024
|
var _props$prevUrl = props.prevUrl,
|
|
945
1025
|
prevUrl = _props$prevUrl === undefined ? '/' : _props$prevUrl,
|
|
@@ -950,7 +1030,8 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
950
1030
|
_props$cpModification = props.cpModificationRequired,
|
|
951
1031
|
cpModificationRequired = _props$cpModification === undefined ? false : _props$cpModification,
|
|
952
1032
|
_props$authorPrefix = props.authorPrefix,
|
|
953
|
-
authorPrefix = _props$authorPrefix === undefined ? 'authors' : _props$authorPrefix
|
|
1033
|
+
authorPrefix = _props$authorPrefix === undefined ? 'authors' : _props$authorPrefix,
|
|
1034
|
+
showRelatedArticles = props.showRelatedArticles;
|
|
954
1035
|
|
|
955
1036
|
|
|
956
1037
|
var firstArticle = function firstArticle() {
|
|
@@ -1055,13 +1136,43 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1055
1136
|
var params = props.params;
|
|
1056
1137
|
if (queueData && queueData.length < maxListLength) {
|
|
1057
1138
|
params.index = queueData.length - 1;
|
|
1058
|
-
props.client.fetch(query, params).then(function (
|
|
1059
|
-
|
|
1060
|
-
var
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1139
|
+
props.client.fetch(query, params).then(function () {
|
|
1140
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(article) {
|
|
1141
|
+
var startingIndex, endingIndex, targeting;
|
|
1142
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
1143
|
+
while (1) {
|
|
1144
|
+
switch (_context.prev = _context.next) {
|
|
1145
|
+
case 0:
|
|
1146
|
+
if (!(article && article._id)) {
|
|
1147
|
+
_context.next = 9;
|
|
1148
|
+
break;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
//query next 4 related article without repeating previous 4 related articles
|
|
1152
|
+
startingIndex = queueData.length;
|
|
1153
|
+
endingIndex = startingIndex + 3;
|
|
1154
|
+
_context.next = 5;
|
|
1155
|
+
return getRelatedArticle(null, props.client, article, prevUrl, startingIndex + '..' + endingIndex);
|
|
1156
|
+
|
|
1157
|
+
case 5:
|
|
1158
|
+
article.relatedArticle = _context.sent;
|
|
1159
|
+
targeting = getTargeting({ article: article, cpModificationRequired: cpModificationRequired, prevUrl: prevUrl });
|
|
1160
|
+
|
|
1161
|
+
article.Ads = Ads.getRightItems(targeting);
|
|
1162
|
+
setQueueData([].concat(_toConsumableArray(queueData), [article]));
|
|
1163
|
+
|
|
1164
|
+
case 9:
|
|
1165
|
+
case 'end':
|
|
1166
|
+
return _context.stop();
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
}, _callee, _this);
|
|
1170
|
+
}));
|
|
1171
|
+
|
|
1172
|
+
return function (_x) {
|
|
1173
|
+
return _ref.apply(this, arguments);
|
|
1174
|
+
};
|
|
1175
|
+
}());
|
|
1065
1176
|
}
|
|
1066
1177
|
};
|
|
1067
1178
|
|
|
@@ -1126,7 +1237,8 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1126
1237
|
article: article,
|
|
1127
1238
|
cpModificationRequired: cpModificationRequired
|
|
1128
1239
|
// Passing queueData to check for single article
|
|
1129
|
-
, queueData: queueData
|
|
1240
|
+
, queueData: queueData,
|
|
1241
|
+
showRelatedArticles: showRelatedArticles
|
|
1130
1242
|
}));
|
|
1131
1243
|
})
|
|
1132
1244
|
);
|
|
@@ -1199,7 +1311,7 @@ var Articles = function Articles(props) {
|
|
|
1199
1311
|
}, _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));
|
|
1200
1312
|
};
|
|
1201
1313
|
|
|
1202
|
-
var _this = undefined;
|
|
1314
|
+
var _this$1 = undefined;
|
|
1203
1315
|
|
|
1204
1316
|
var View = function View(props) {
|
|
1205
1317
|
var router = useRouter();
|
|
@@ -1212,7 +1324,9 @@ var View = function View(props) {
|
|
|
1212
1324
|
setCustomDimensions = props.setCustomDimensions,
|
|
1213
1325
|
statusCode = props.statusCode,
|
|
1214
1326
|
prevUrl = props.prevUrl,
|
|
1215
|
-
pageview = props.pageview
|
|
1327
|
+
pageview = props.pageview,
|
|
1328
|
+
_props$showRelatedArt = props.showRelatedArticles,
|
|
1329
|
+
showRelatedArticles = _props$showRelatedArt === undefined ? false : _props$showRelatedArt;
|
|
1216
1330
|
var _props$article = props.article,
|
|
1217
1331
|
_props$article$passwo = _props$article.passwordLock,
|
|
1218
1332
|
passwordLock = _props$article$passwo === undefined ? false : _props$article$passwo,
|
|
@@ -1306,7 +1420,7 @@ var View = function View(props) {
|
|
|
1306
1420
|
props.article.seriesDetail && props.article.seriesDetail.nextUrl && React__default.createElement('link', { rel: 'next', href: props.article.seriesDetail.nextUrl })
|
|
1307
1421
|
)
|
|
1308
1422
|
),
|
|
1309
|
-
!needInfiniteScroll ? React__default.createElement(Article, _extends({ infiniteScroll: false }, props)) : React__default.createElement(Articles, _extends({ infiniteScroll: true }, props))
|
|
1423
|
+
!needInfiniteScroll ? React__default.createElement(Article, _extends({ infiniteScroll: false, showRelatedArticles: showRelatedArticles }, props)) : React__default.createElement(Articles, _extends({ infiniteScroll: true, showRelatedArticles: showRelatedArticles }, props))
|
|
1310
1424
|
);
|
|
1311
1425
|
};
|
|
1312
1426
|
|
|
@@ -1353,7 +1467,7 @@ View.returnGetInitialProps = function () {
|
|
|
1353
1467
|
}
|
|
1354
1468
|
|
|
1355
1469
|
_context.next = 13;
|
|
1356
|
-
return getRelatedArticle(context, client, article, prevUrl);
|
|
1470
|
+
return getRelatedArticle(context, client, article, prevUrl, '0..3');
|
|
1357
1471
|
|
|
1358
1472
|
case 13:
|
|
1359
1473
|
article.relatedArticle = _context.sent;
|
|
@@ -1374,7 +1488,7 @@ View.returnGetInitialProps = function () {
|
|
|
1374
1488
|
return _context.stop();
|
|
1375
1489
|
}
|
|
1376
1490
|
}
|
|
1377
|
-
}, _callee, _this);
|
|
1491
|
+
}, _callee, _this$1);
|
|
1378
1492
|
}));
|
|
1379
1493
|
|
|
1380
1494
|
return function (_x, _x2, _x3, _x4, _x5) {
|
package/dist/esm/YahooHero.js
CHANGED
|
@@ -10,7 +10,7 @@ import { i as imageUrlBuilder } from './index-51a80699.js';
|
|
|
10
10
|
import { L as LazyLoad } from './index-5f9f807a.js';
|
|
11
11
|
import { c as clean_html_1 } from './entities-7cc3bf45.js';
|
|
12
12
|
import './slicedToArray-f1e40361.js';
|
|
13
|
-
import { A as AuthorComponent } from './AuthorComponent-
|
|
13
|
+
import { A as AuthorComponent } from './AuthorComponent-357dbee9.js';
|
|
14
14
|
|
|
15
15
|
var YahooHero = function YahooHero(props) {
|
|
16
16
|
var removeTimeStamp = props.removeTimeStamp;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as isArray_1, i as isFunction_1, _ as _arrayMap } from './_arrayMap-
|
|
1
|
+
import { c as isSymbol_1, a as _root, d as isObject_1, e as _Symbol } from './isSymbol-47f5ff3b.js';
|
|
2
|
+
import { a as isArray_1, i as isFunction_1, _ as _arrayMap } from './_arrayMap-818441dd.js';
|
|
3
3
|
|
|
4
4
|
/** Used to match property names within property paths. */
|
|
5
5
|
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
|
package/dist/esm/getQuery.js
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import './_commonjsHelpers-0c4b6f40.js';
|
|
2
|
-
import './moment-12415288.js';
|
|
3
|
-
|
|
4
1
|
var getQuery = function getQuery(type) {
|
|
5
2
|
var conditions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
6
3
|
var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
4
|
+
var articleCount = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
7
5
|
|
|
8
6
|
//Added feature to include additional conditions and parameters for site level operations
|
|
9
7
|
//Site level conditions should start with && (logical AND), and site level params should end with , (comma) in order to execute query
|
|
10
8
|
|
|
11
9
|
switch (type) {
|
|
12
10
|
case 'related':
|
|
13
|
-
return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && published <= 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 ' + conditions + '\n ]| order(published desc)[$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 \'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 \'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 }';
|
|
11
|
+
return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && published <= 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 ' + conditions + '\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 \'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 \'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
12
|
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 },\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 \'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 }\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 \'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
14
|
case 'publication':
|
|
17
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 }';
|
|
18
16
|
case 'issue':
|
|
@@ -4,7 +4,6 @@ import './core.get-iterator-method-f5c0d66a.js';
|
|
|
4
4
|
import './_library-528f1934.js';
|
|
5
5
|
import './_iter-detect-6e099a34.js';
|
|
6
6
|
import './web.dom.iterable-46c95e52.js';
|
|
7
|
-
import './moment-12415288.js';
|
|
8
7
|
import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-0379e924.js';
|
|
9
8
|
import './_set-species-6f64f1c1.js';
|
|
10
9
|
import { parseCookies, setCookie } from 'nookies';
|
|
@@ -18,6 +17,7 @@ var getRelatedArticle = function () {
|
|
|
18
17
|
var client = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
19
18
|
var article = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
20
19
|
var prevUrl = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '/';
|
|
20
|
+
var articleCount = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
21
21
|
|
|
22
22
|
var taxonomyMapping, _article$url, url, content_placement, taxonomy, params, conditions, cookies, prevSlugs, relatedArticleQuery, relatedArticle;
|
|
23
23
|
|
|
@@ -42,7 +42,7 @@ var getRelatedArticle = function () {
|
|
|
42
42
|
if (prev_url_to_check.includes('?')) {
|
|
43
43
|
prev_url_to_check = prev_url_to_check.split('?')[0];
|
|
44
44
|
}
|
|
45
|
-
if (prev_url_to_check.endsWith(path)) taxonomy.push(_id);
|
|
45
|
+
if (prev_url_to_check.endsWith(path) && _id) taxonomy.push(_id);
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
|
|
@@ -53,11 +53,10 @@ var getRelatedArticle = function () {
|
|
|
53
53
|
return _ref;
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
-
|
|
57
56
|
params = {
|
|
58
57
|
url: url,
|
|
59
58
|
taxonomy: taxonomy,
|
|
60
|
-
index:
|
|
59
|
+
index: articleCount
|
|
61
60
|
};
|
|
62
61
|
conditions = '';
|
|
63
62
|
|
|
@@ -70,8 +69,7 @@ var getRelatedArticle = function () {
|
|
|
70
69
|
conditions = '&& !(url.current in [' + prevSlugs + '])';
|
|
71
70
|
} else setCookie(ctx, 'prevSlugs', '"' + url + '"', {});
|
|
72
71
|
}
|
|
73
|
-
|
|
74
|
-
relatedArticleQuery = getQuery('related', conditions);
|
|
72
|
+
relatedArticleQuery = getQuery('related', conditions, '', articleCount);
|
|
75
73
|
_context.next = 12;
|
|
76
74
|
return client.fetch(relatedArticleQuery, params);
|
|
77
75
|
|