@mjhls/mjh-framework 1.0.404 → 1.0.406
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/{GridContent-2f42692a.js → GridContent-62c5d302.js} +82 -52
- package/dist/cjs/GridContent.js +1 -1
- package/dist/cjs/QueueDeckExpanded.js +105 -73
- package/dist/cjs/index.js +55 -680
- package/dist/esm/{GridContent-cafb2fe4.js → GridContent-2cabe342.js} +82 -52
- package/dist/esm/GridContent.js +1 -1
- package/dist/esm/QueueDeckExpanded.js +105 -73
- package/dist/esm/index.js +62 -686
- package/package.json +1 -1
|
@@ -79,7 +79,22 @@ var GridContent = function (_React$Component) {
|
|
|
79
79
|
to: to + per
|
|
80
80
|
};
|
|
81
81
|
}, _this.loadData);
|
|
82
|
-
}, 0), _this.
|
|
82
|
+
}, 0), _this.componentDidMount = function () {
|
|
83
|
+
document.addEventListener('scroll', _this.trackScrolling);
|
|
84
|
+
}, _this.componentWillUnmount = function () {
|
|
85
|
+
document.removeEventListener('scroll', _this.trackScrolling);
|
|
86
|
+
}, _this.componentDidUpdate = function (prevProps, prevState) {
|
|
87
|
+
if (prevState.currentPage !== _this.state.currentPage) {
|
|
88
|
+
document.addEventListener('scroll', _this.trackScrolling);
|
|
89
|
+
}
|
|
90
|
+
}, _this.trackScrolling = function () {
|
|
91
|
+
var itemsPerPage = _this.props.params.itemsPerPage;
|
|
92
|
+
if (window.pageYOffset === 0) {
|
|
93
|
+
if (_this.state.currentPage > 1) {
|
|
94
|
+
_this.changePageNumber(1, itemsPerPage, 1);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}, _this.loadData = function () {
|
|
83
98
|
var _this$state = _this.state,
|
|
84
99
|
from = _this$state.from,
|
|
85
100
|
to = _this$state.to,
|
|
@@ -129,7 +144,7 @@ var GridContent = function (_React$Component) {
|
|
|
129
144
|
} else {
|
|
130
145
|
return _this.defaultImage;
|
|
131
146
|
}
|
|
132
|
-
}, _this.changePageNumber = function (pageNumber) {
|
|
147
|
+
}, _this.changePageNumber = function (pageNumber, itemsPerPage, itemIndex) {
|
|
133
148
|
var _this$props = _this.props,
|
|
134
149
|
seoPaginate = _this$props.seoPaginate,
|
|
135
150
|
pageview = _this$props.pageview,
|
|
@@ -164,7 +179,12 @@ var GridContent = function (_React$Component) {
|
|
|
164
179
|
path += '?' + queryString;
|
|
165
180
|
}
|
|
166
181
|
|
|
167
|
-
pageNumber = parseInt(pageNumber)
|
|
182
|
+
// pageNumber = parseInt(pageNumber)
|
|
183
|
+
|
|
184
|
+
var index = Number(itemIndex);
|
|
185
|
+
var perPage = Number(itemsPerPage);
|
|
186
|
+
|
|
187
|
+
pageNumber = Math.ceil((index + 1) / perPage);
|
|
168
188
|
|
|
169
189
|
if (currentPage !== pageNumber) {
|
|
170
190
|
lib_3.refresh();
|
|
@@ -336,6 +356,9 @@ var GridContent = function (_React$Component) {
|
|
|
336
356
|
posts = this.state.data;
|
|
337
357
|
}
|
|
338
358
|
|
|
359
|
+
var itemsPerPage = this.props.params.itemsPerPage;
|
|
360
|
+
var heroContent = this.props.heroContent ? this.props.heroContent : 0;
|
|
361
|
+
var featureCount = 0;
|
|
339
362
|
return React__default.createElement(
|
|
340
363
|
'div',
|
|
341
364
|
{ className: 'grid-container' },
|
|
@@ -344,6 +367,7 @@ var GridContent = function (_React$Component) {
|
|
|
344
367
|
var contentCategoryName = row.contentCategory && row.contentCategory.name && _this2.mapping[row.contentCategory.name] ? row.contentCategory.name : 'Articles';
|
|
345
368
|
var linkHref = row.url && row.url.current ? _this2.mapping[contentCategoryName] + '/' + row.url.current : '';
|
|
346
369
|
if (row._type === 'feature') {
|
|
370
|
+
featureCount++;
|
|
347
371
|
if (row.blank || _this2.checkExternalUrl(row.url.current)) {
|
|
348
372
|
return React__default.createElement(
|
|
349
373
|
React__default.Fragment,
|
|
@@ -353,7 +377,7 @@ var GridContent = function (_React$Component) {
|
|
|
353
377
|
{
|
|
354
378
|
partialVisibility: true,
|
|
355
379
|
onChange: function onChange(isVisible) {
|
|
356
|
-
isVisible && _this2.changePageNumber(1);
|
|
380
|
+
isVisible && _this2.changePageNumber(1, itemsPerPage, index);
|
|
357
381
|
} },
|
|
358
382
|
React__default.createElement(
|
|
359
383
|
'div',
|
|
@@ -417,7 +441,7 @@ var GridContent = function (_React$Component) {
|
|
|
417
441
|
{
|
|
418
442
|
partialVisibility: true,
|
|
419
443
|
onChange: function onChange(isVisible) {
|
|
420
|
-
isVisible && _this2.changePageNumber(1);
|
|
444
|
+
isVisible && _this2.changePageNumber(1, itemsPerPage, index);
|
|
421
445
|
} },
|
|
422
446
|
React__default.createElement(
|
|
423
447
|
'div',
|
|
@@ -476,64 +500,70 @@ var GridContent = function (_React$Component) {
|
|
|
476
500
|
} else if (row._type === 'BrandInsight' && row.adUnit) {
|
|
477
501
|
return React__default.createElement(ADInfeed, { index: index, infeedAd: row });
|
|
478
502
|
}
|
|
479
|
-
|
|
480
|
-
React__default.
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
VisibilitySensor,
|
|
484
|
-
{
|
|
485
|
-
onChange: function onChange(isVisible) {
|
|
486
|
-
isVisible && _this2.changePageNumber(pageNumber);
|
|
487
|
-
} },
|
|
503
|
+
if (index + 1 > heroContent + featureCount) {
|
|
504
|
+
return React__default.createElement(
|
|
505
|
+
React__default.Fragment,
|
|
506
|
+
{ key: itemCounter },
|
|
488
507
|
React__default.createElement(
|
|
489
|
-
|
|
490
|
-
{
|
|
508
|
+
VisibilitySensor,
|
|
509
|
+
{
|
|
510
|
+
onChange: function onChange(isVisible) {
|
|
511
|
+
isVisible && _this2.changePageNumber(pageNumber, itemsPerPage, index);
|
|
512
|
+
} },
|
|
491
513
|
React__default.createElement(
|
|
492
|
-
|
|
493
|
-
{
|
|
494
|
-
(row.thumbnail && row.thumbnail.asset || _this2.props.defaultImage) && React__default.createElement(
|
|
495
|
-
'a',
|
|
496
|
-
{ href: linkHref, className: index === 0 || index % 4 === 0 ? '' : 'card-image' },
|
|
497
|
-
React__default.createElement(
|
|
498
|
-
LazyLoad,
|
|
499
|
-
{ height: _this2.props.imageHeight },
|
|
500
|
-
React__default.createElement(Card.Img, { variant: 'top', src: _this2.renderCardImage(row, page), alt: row.thumbnail && row.thumbnail.asset ? row.thumbnail.asset.originalFilename : '' })
|
|
501
|
-
)
|
|
502
|
-
),
|
|
514
|
+
'div',
|
|
515
|
+
{ counter: itemCounter++, style: { display: 'flex', flex: '1 0 auto' } },
|
|
503
516
|
React__default.createElement(
|
|
504
|
-
Card
|
|
505
|
-
|
|
506
|
-
React__default.createElement(
|
|
517
|
+
Card,
|
|
518
|
+
{ className: 'content-card', style: { flexDirection: index === 0 || index % 4 === 0 ? 'top' : 'row' } },
|
|
519
|
+
(row.thumbnail && row.thumbnail.asset || _this2.props.defaultImage) && React__default.createElement(
|
|
507
520
|
'a',
|
|
508
|
-
{ href: linkHref },
|
|
521
|
+
{ href: linkHref, className: index === 0 || index % 4 === 0 ? '' : 'card-image' },
|
|
509
522
|
React__default.createElement(
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
523
|
+
LazyLoad,
|
|
524
|
+
{ height: _this2.props.imageHeight },
|
|
525
|
+
React__default.createElement(Card.Img, {
|
|
526
|
+
variant: 'top',
|
|
527
|
+
src: _this2.renderCardImage(row, page),
|
|
528
|
+
alt: row.thumbnail && row.thumbnail.asset ? row.thumbnail.asset.originalFilename : ''
|
|
529
|
+
})
|
|
513
530
|
)
|
|
514
531
|
),
|
|
515
|
-
_this2.props.showPublished && row.published && React__default.createElement(
|
|
516
|
-
Card.Subtitle,
|
|
517
|
-
{ style: { marginTop: 0 } },
|
|
518
|
-
moment(row.published).format('MMMM DD, YYYY')
|
|
519
|
-
),
|
|
520
|
-
_this2.props.showAuthor && row.authorMapping && row.authorMapping.length > 0 && React__default.createElement(
|
|
521
|
-
LazyLoad,
|
|
522
|
-
{ height: 50 },
|
|
523
|
-
React__default.createElement(AuthorComponent, { key: index.toString(), index: index, authors: row.authorMapping })
|
|
524
|
-
),
|
|
525
532
|
React__default.createElement(
|
|
526
|
-
Card.
|
|
527
|
-
|
|
528
|
-
|
|
533
|
+
Card.Body,
|
|
534
|
+
null,
|
|
535
|
+
React__default.createElement(
|
|
536
|
+
'a',
|
|
537
|
+
{ href: linkHref },
|
|
538
|
+
React__default.createElement(
|
|
539
|
+
Card.Title,
|
|
540
|
+
null,
|
|
541
|
+
row.title
|
|
542
|
+
)
|
|
543
|
+
),
|
|
544
|
+
_this2.props.showPublished && row.published && React__default.createElement(
|
|
545
|
+
Card.Subtitle,
|
|
546
|
+
{ style: { marginTop: 0 } },
|
|
547
|
+
moment(row.published).format('MMMM DD, YYYY')
|
|
548
|
+
),
|
|
549
|
+
_this2.props.showAuthor && row.authorMapping && row.authorMapping.length > 0 && React__default.createElement(
|
|
550
|
+
LazyLoad,
|
|
551
|
+
{ height: 50 },
|
|
552
|
+
React__default.createElement(AuthorComponent, { key: index.toString(), index: index, authors: row.authorMapping })
|
|
553
|
+
),
|
|
554
|
+
React__default.createElement(
|
|
555
|
+
Card.Text,
|
|
556
|
+
{ className: index === 0 || index % 4 === 0 ? '' : 'card-subtext' },
|
|
557
|
+
clean_html_1(row.summary)
|
|
558
|
+
)
|
|
529
559
|
)
|
|
530
560
|
)
|
|
531
561
|
)
|
|
532
|
-
)
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
562
|
+
),
|
|
563
|
+
showVideo && (posts.length < numberOfItemsBeforeVideo || index + 1 === numberOfItemsBeforeVideo) && React__default.createElement(VideoPlayer, null),
|
|
564
|
+
main_39 && _this2.props.rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && _this2.renderMobileAd(index, numberOfItemsBeforeAd)
|
|
565
|
+
);
|
|
566
|
+
} else return null;
|
|
537
567
|
}) : React__default.createElement(
|
|
538
568
|
'div',
|
|
539
569
|
null,
|
package/dist/esm/GridContent.js
CHANGED
|
@@ -29,5 +29,5 @@ import './AdSlot-78e48a2c.js';
|
|
|
29
29
|
import './promise-2592a80a.js';
|
|
30
30
|
import './ADInfeed-e5cefea5.js';
|
|
31
31
|
import './get-53653403.js';
|
|
32
|
-
export { G as default } from './GridContent-
|
|
32
|
+
export { G as default } from './GridContent-2cabe342.js';
|
|
33
33
|
import './AuthorComponent-c9e46673.js';
|
|
@@ -77,7 +77,7 @@ var loadData = function loadData(values, query, client, params, setData, setScro
|
|
|
77
77
|
});
|
|
78
78
|
};
|
|
79
79
|
|
|
80
|
-
var changePageNumber = function changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage) {
|
|
80
|
+
var changePageNumber = function changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, itemIndex) {
|
|
81
81
|
if (seoPaginate) {
|
|
82
82
|
var path = router.asPath;
|
|
83
83
|
var qrIndex = path.indexOf('?');
|
|
@@ -106,7 +106,12 @@ var changePageNumber = function changePageNumber(pageNumber, seoPaginate, pagevi
|
|
|
106
106
|
path += '?' + queryString;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
pageNumber = parseInt(pageNumber)
|
|
109
|
+
// pageNumber = parseInt(pageNumber)
|
|
110
|
+
|
|
111
|
+
var index = Number(itemIndex);
|
|
112
|
+
var perPage = Number(itemsPerPage);
|
|
113
|
+
|
|
114
|
+
pageNumber = Math.ceil((index + 1) / perPage);
|
|
110
115
|
|
|
111
116
|
if (currentPage !== pageNumber) {
|
|
112
117
|
lib_3.refresh();
|
|
@@ -132,7 +137,7 @@ var checkExternalUrl = function checkExternalUrl(url) {
|
|
|
132
137
|
return new RegExp(['http', 'https'].join('|')).test(url);
|
|
133
138
|
};
|
|
134
139
|
|
|
135
|
-
var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth, rightItems, brandInsightAd, showBI) {
|
|
140
|
+
var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth, rightItems, brandInsightAd, showBI, itemsPerPage, heroContent) {
|
|
136
141
|
var numberOfItemsBeforeAd = 6;
|
|
137
142
|
|
|
138
143
|
var insertBrandInsightAd = function insertBrandInsightAd(arr, index, newElement) {
|
|
@@ -160,6 +165,8 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
|
|
|
160
165
|
}
|
|
161
166
|
}
|
|
162
167
|
|
|
168
|
+
var featureCount = 0;
|
|
169
|
+
|
|
163
170
|
return React__default.createElement(
|
|
164
171
|
'div',
|
|
165
172
|
null,
|
|
@@ -168,6 +175,7 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
|
|
|
168
175
|
var contentCategoryName = article.contentCategory ? article.contentCategory.name : 'Articles';
|
|
169
176
|
|
|
170
177
|
if (article._type === 'feature') {
|
|
178
|
+
featureCount++;
|
|
171
179
|
if (article.blank || checkExternalUrl(article.url.current)) {
|
|
172
180
|
return React__default.createElement(
|
|
173
181
|
VisibilitySensor,
|
|
@@ -175,7 +183,7 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
|
|
|
175
183
|
key: article._id ? article._id : index,
|
|
176
184
|
partialVisibility: true,
|
|
177
185
|
onChange: function onChange(isVisible) {
|
|
178
|
-
isVisible && changePageNumber(1, seoPaginate, pageview, router, currentPage, setCurrentPage);
|
|
186
|
+
isVisible && changePageNumber(1, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, index);
|
|
179
187
|
} },
|
|
180
188
|
React__default.createElement(
|
|
181
189
|
React__default.Fragment,
|
|
@@ -252,7 +260,7 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
|
|
|
252
260
|
key: article._id ? article._id : index,
|
|
253
261
|
partialVisibility: true,
|
|
254
262
|
onChange: function onChange(isVisible) {
|
|
255
|
-
isVisible && changePageNumber(1, seoPaginate, pageview, router, currentPage, setCurrentPage);
|
|
263
|
+
isVisible && changePageNumber(1, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, index);
|
|
256
264
|
} },
|
|
257
265
|
React__default.createElement(
|
|
258
266
|
React__default.Fragment,
|
|
@@ -328,81 +336,86 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
|
|
|
328
336
|
if (main_39 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0) {
|
|
329
337
|
return renderMobileAd(index, numberOfItemsBeforeAd, rightItems);
|
|
330
338
|
}
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
null,
|
|
339
|
+
|
|
340
|
+
if (index + 1 > heroContent + featureCount) {
|
|
341
|
+
return React__default.createElement(
|
|
342
|
+
VisibilitySensor,
|
|
343
|
+
{
|
|
344
|
+
key: article._id ? article._id : index,
|
|
345
|
+
onChange: function onChange(isVisible) {
|
|
346
|
+
isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, index);
|
|
347
|
+
} },
|
|
341
348
|
React__default.createElement(
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
(article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
|
|
345
|
-
'a',
|
|
346
|
-
{ href: mapping[contentCategoryName] + '/' + article.url.current, className: 'img-wrapper' },
|
|
347
|
-
React__default.createElement(
|
|
348
|
-
LazyLoad,
|
|
349
|
-
{ height: imageHeight },
|
|
350
|
-
article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'mr-3 img-fluid', src: renderCardImage(article, builder, imageHeight, imageWidth), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
|
|
351
|
-
)
|
|
352
|
-
),
|
|
349
|
+
React__default.Fragment,
|
|
350
|
+
null,
|
|
353
351
|
React__default.createElement(
|
|
354
|
-
Media
|
|
355
|
-
|
|
356
|
-
|
|
352
|
+
Media,
|
|
353
|
+
{
|
|
354
|
+
key: article._id ? article._id : index,
|
|
355
|
+
style: { flexDirection: 'row', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
|
|
356
|
+
(article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
|
|
357
357
|
'a',
|
|
358
|
-
{ href: mapping[contentCategoryName] + '/' + article.url.current },
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
{
|
|
362
|
-
article.title
|
|
358
|
+
{ href: mapping[contentCategoryName] + '/' + article.url.current, className: 'img-wrapper' },
|
|
359
|
+
React__default.createElement(
|
|
360
|
+
LazyLoad,
|
|
361
|
+
{ height: imageHeight },
|
|
362
|
+
article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'mr-3 img-fluid', src: renderCardImage(article, builder, imageHeight, imageWidth), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
|
|
363
363
|
)
|
|
364
364
|
),
|
|
365
|
-
showPublished && article.published && React__default.createElement(
|
|
366
|
-
'p',
|
|
367
|
-
{ className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
|
|
368
|
-
moment(article.published).format('MMMM DD, YYYY')
|
|
369
|
-
),
|
|
370
365
|
React__default.createElement(
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
{
|
|
376
|
-
|
|
366
|
+
Media.Body,
|
|
367
|
+
null,
|
|
368
|
+
React__default.createElement(
|
|
369
|
+
'a',
|
|
370
|
+
{ href: mapping[contentCategoryName] + '/' + article.url.current },
|
|
371
|
+
article.title && React__default.createElement(
|
|
372
|
+
'h4',
|
|
373
|
+
{ className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
|
|
374
|
+
article.title
|
|
375
|
+
)
|
|
376
|
+
),
|
|
377
|
+
showPublished && article.published && React__default.createElement(
|
|
378
|
+
'p',
|
|
379
|
+
{ className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
|
|
380
|
+
moment(article.published).format('MMMM DD, YYYY')
|
|
381
|
+
),
|
|
382
|
+
React__default.createElement(
|
|
383
|
+
'div',
|
|
384
|
+
{ className: 'author-sec', style: { lineHeight: 1.5 } },
|
|
385
|
+
showAuthor && article.authorMapping && article.authorMapping.length > 0 && React__default.createElement(
|
|
386
|
+
LazyLoad,
|
|
387
|
+
{ height: 50 },
|
|
388
|
+
React__default.createElement(AuthorComponent, { key: index.toString(), index: index, authors: article.authorMapping })
|
|
389
|
+
)
|
|
390
|
+
),
|
|
391
|
+
article.source && React__default.createElement(
|
|
392
|
+
'p',
|
|
393
|
+
{ className: 'p-0 mb-1' },
|
|
394
|
+
article.source
|
|
395
|
+
),
|
|
396
|
+
showCategory && article.contentCategory && React__default.createElement(
|
|
397
|
+
'p',
|
|
398
|
+
{
|
|
399
|
+
style: {
|
|
400
|
+
background: '#3FB618',
|
|
401
|
+
color: '#ffffff',
|
|
402
|
+
marginBottom: '.25rem',
|
|
403
|
+
display: 'inline-block',
|
|
404
|
+
padding: '0 .25rem',
|
|
405
|
+
fontSize: '.8rem'
|
|
406
|
+
} },
|
|
407
|
+
article.contentCategory.name.slice(0, article.contentCategory.name.length - 1)
|
|
408
|
+
),
|
|
409
|
+
article.summary && React__default.createElement(
|
|
410
|
+
'p',
|
|
411
|
+
{ className: 'pt-2 card-text' },
|
|
412
|
+
clean_html_1(article.summary)
|
|
377
413
|
)
|
|
378
|
-
),
|
|
379
|
-
article.source && React__default.createElement(
|
|
380
|
-
'p',
|
|
381
|
-
{ className: 'p-0 mb-1' },
|
|
382
|
-
article.source
|
|
383
|
-
),
|
|
384
|
-
showCategory && article.contentCategory && React__default.createElement(
|
|
385
|
-
'p',
|
|
386
|
-
{
|
|
387
|
-
style: {
|
|
388
|
-
background: '#3FB618',
|
|
389
|
-
color: '#ffffff',
|
|
390
|
-
marginBottom: '.25rem',
|
|
391
|
-
display: 'inline-block',
|
|
392
|
-
padding: '0 .25rem',
|
|
393
|
-
fontSize: '.8rem'
|
|
394
|
-
} },
|
|
395
|
-
article.contentCategory.name.slice(0, article.contentCategory.name.length - 1)
|
|
396
|
-
),
|
|
397
|
-
article.summary && React__default.createElement(
|
|
398
|
-
'p',
|
|
399
|
-
{ className: 'pt-2 card-text' },
|
|
400
|
-
clean_html_1(article.summary)
|
|
401
414
|
)
|
|
402
415
|
)
|
|
403
416
|
)
|
|
404
|
-
)
|
|
405
|
-
|
|
417
|
+
);
|
|
418
|
+
} else return null;
|
|
406
419
|
}) : React__default.createElement(
|
|
407
420
|
'div',
|
|
408
421
|
null,
|
|
@@ -478,7 +491,9 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
|
|
|
478
491
|
rightItems = props.rightItems,
|
|
479
492
|
brandInsightAd = props.brandInsightAd,
|
|
480
493
|
_props$showBI = props.showBI,
|
|
481
|
-
showBI = _props$showBI === undefined ? false : _props$showBI
|
|
494
|
+
showBI = _props$showBI === undefined ? false : _props$showBI,
|
|
495
|
+
_props$heroContent = props.heroContent,
|
|
496
|
+
heroContent = _props$heroContent === undefined ? 0 : _props$heroContent;
|
|
482
497
|
var initialCurrentPage = props.currentPage,
|
|
483
498
|
showPublished = props.showPublished;
|
|
484
499
|
|
|
@@ -512,6 +527,8 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
|
|
|
512
527
|
values = _useState10[0],
|
|
513
528
|
setValues = _useState10[1];
|
|
514
529
|
|
|
530
|
+
var itemsPerPage = params.itemsPerPage;
|
|
531
|
+
|
|
515
532
|
var prevValues = usePrevious(values);
|
|
516
533
|
|
|
517
534
|
useEffect(function () {
|
|
@@ -522,6 +539,21 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
|
|
|
522
539
|
}
|
|
523
540
|
}, [values, prevValues, query, client, params, setData, setScrolling, pointer, pointerArray]);
|
|
524
541
|
|
|
542
|
+
useEffect(function () {
|
|
543
|
+
document.addEventListener('scroll', trackScrolling);
|
|
544
|
+
return function () {
|
|
545
|
+
document.removeEventListener('scroll', trackScrolling);
|
|
546
|
+
};
|
|
547
|
+
}, [currentPage]);
|
|
548
|
+
|
|
549
|
+
var trackScrolling = function trackScrolling(current) {
|
|
550
|
+
if (window.pageYOffset === 0) {
|
|
551
|
+
if (currentPage > 1) {
|
|
552
|
+
changePageNumber(1, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, 1);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
};
|
|
556
|
+
|
|
525
557
|
return React__default.createElement(
|
|
526
558
|
'div',
|
|
527
559
|
null,
|
|
@@ -536,7 +568,7 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
|
|
|
536
568
|
React__default.createElement(
|
|
537
569
|
Container,
|
|
538
570
|
null,
|
|
539
|
-
cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth, rightItems, brandInsightAd, showBI)
|
|
571
|
+
cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth, rightItems, brandInsightAd, showBI, itemsPerPage, heroContent)
|
|
540
572
|
)
|
|
541
573
|
),
|
|
542
574
|
React__default.createElement(
|
|
@@ -550,7 +582,7 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
|
|
|
550
582
|
React__default.createElement(
|
|
551
583
|
Container,
|
|
552
584
|
null,
|
|
553
|
-
cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, rightItems, brandInsightAd, showBI)
|
|
585
|
+
cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, rightItems, brandInsightAd, showBI, itemsPerPage, heroContent)
|
|
554
586
|
),
|
|
555
587
|
React__default.createElement(
|
|
556
588
|
'div',
|