@mjhls/mjh-framework 1.0.365 → 1.0.367
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/{Normal-0d1211d3.js → Normal-c03e274d.js} +2 -1
- package/dist/cjs/TemplateNormal.js +1 -1
- package/dist/cjs/index.js +661 -34
- package/dist/esm/{Normal-fd393897.js → Normal-13c85a50.js} +2 -1
- package/dist/esm/TemplateNormal.js +1 -1
- package/dist/esm/index.js +669 -43
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -30,7 +30,7 @@ var entities = require('./entities-310b46ee.js');
|
|
|
30
30
|
var slicedToArray = require('./slicedToArray-879ab2fb.js');
|
|
31
31
|
var AdSlot = require('./AdSlot-c5bff604.js');
|
|
32
32
|
require('./promise-3b44b2a3.js');
|
|
33
|
-
require('./ADInfeed-43996091.js');
|
|
33
|
+
var ADInfeed = require('./ADInfeed-43996091.js');
|
|
34
34
|
var DeckContent = require('./DeckContent.js');
|
|
35
35
|
var get$1 = require('./get-3b23d857.js');
|
|
36
36
|
var GridContent = require('./GridContent-7a85d904.js');
|
|
@@ -53,7 +53,7 @@ var IssueDeck = require('./IssueDeck.js');
|
|
|
53
53
|
require('react-bootstrap/Badge');
|
|
54
54
|
var IssueContentDeck = require('./IssueContentDeck.js');
|
|
55
55
|
var Spinner = _interopDefault(require('react-bootstrap/Spinner'));
|
|
56
|
-
var TemplateNormal = require('./Normal-
|
|
56
|
+
var TemplateNormal = require('./Normal-c03e274d.js');
|
|
57
57
|
require('react-bootstrap/ListGroup');
|
|
58
58
|
var Head = _interopDefault(require('next/head'));
|
|
59
59
|
var Accordion = _interopDefault(require('react-bootstrap/Accordion'));
|
|
@@ -75,6 +75,632 @@ var useSWR = _interopDefault(require('swr'));
|
|
|
75
75
|
var Local = _interopDefault(require('passport-local'));
|
|
76
76
|
var mysql = _interopDefault(require('mysql'));
|
|
77
77
|
|
|
78
|
+
var urlFor$1 = function urlFor(source, builder) {
|
|
79
|
+
return builder.image(source).auto('format');
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
var renderCardImage = function renderCardImage(row, builder, imageHeight, imageWidth) {
|
|
83
|
+
var url = urlFor$1(row.thumbnail, builder);
|
|
84
|
+
if (imageHeight) url = url.height(imageHeight);
|
|
85
|
+
if (imageWidth) url = url.width(imageWidth);
|
|
86
|
+
return url.url();
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
var loadMore = function loadMore(values, setValues, per) {
|
|
90
|
+
setValues({
|
|
91
|
+
page: values.page + 1,
|
|
92
|
+
from: values.from + per,
|
|
93
|
+
to: values.to + per
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
var loadData = function loadData(values, query, client, params, setData, setScrolling, pointer, pointerArray) {
|
|
98
|
+
params = _extends$2._extends({}, params, {
|
|
99
|
+
from: values.from,
|
|
100
|
+
to: values.to
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
client.fetch(query, params).then(function (dataArr) {
|
|
104
|
+
if (pointer && pointerArray) {
|
|
105
|
+
dataArr = dataArr[pointerArray][pointer];
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (!dataArr) {
|
|
109
|
+
dataArr = [];
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
dataArr = dataArr.map(function (item) {
|
|
113
|
+
return _extends$2._extends({}, item, {
|
|
114
|
+
pageNumber: values.page
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
if (dataArr.length > 0) {
|
|
119
|
+
setData(function (prevData) {
|
|
120
|
+
return [].concat(toConsumableArray._toConsumableArray(prevData), toConsumableArray._toConsumableArray(dataArr));
|
|
121
|
+
});
|
|
122
|
+
setScrolling(true);
|
|
123
|
+
} else {
|
|
124
|
+
setScrolling(false);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
var changePageNumber = function changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, itemIndex) {
|
|
130
|
+
if (seoPaginate) {
|
|
131
|
+
var path = router.asPath;
|
|
132
|
+
var qrIndex = path.indexOf('?');
|
|
133
|
+
var pathname = router.pathname;
|
|
134
|
+
var queryString = '';
|
|
135
|
+
|
|
136
|
+
if (qrIndex > 0) {
|
|
137
|
+
path = path.substring(1, qrIndex);
|
|
138
|
+
|
|
139
|
+
var partialQS = router.asPath.substring(qrIndex + 1);
|
|
140
|
+
var partialQSArr = partialQS.split('&');
|
|
141
|
+
|
|
142
|
+
// exclude page=xxx from query string
|
|
143
|
+
partialQSArr.map(function (item) {
|
|
144
|
+
var itemArr = item.split('=');
|
|
145
|
+
var key = itemArr[0];
|
|
146
|
+
var val = itemArr[1];
|
|
147
|
+
|
|
148
|
+
if (key !== 'page') {
|
|
149
|
+
queryString += (queryString.length === 0 ? '' : '&') + key + '=' + val;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (queryString.length > 0) {
|
|
155
|
+
path += '?' + queryString;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// pageNumber = parseInt(pageNumber)
|
|
159
|
+
|
|
160
|
+
var index = Number(itemIndex);
|
|
161
|
+
var perPage = Number(itemsPerPage);
|
|
162
|
+
|
|
163
|
+
pageNumber = Math.ceil((index + 1) / perPage);
|
|
164
|
+
|
|
165
|
+
if (currentPage !== pageNumber) {
|
|
166
|
+
debounce.lib_3.refresh();
|
|
167
|
+
|
|
168
|
+
setCurrentPage(pageNumber);
|
|
169
|
+
if (path[0] !== '/') {
|
|
170
|
+
path = '/' + path;
|
|
171
|
+
}
|
|
172
|
+
var newPath = pageNumber === 1 ? '' + path : '' + path + (queryString.length > 0 ? '&' : '?') + 'page=' + pageNumber;
|
|
173
|
+
|
|
174
|
+
if (pageview) {
|
|
175
|
+
pageview(newPath);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
router.push(pathname, newPath, {
|
|
179
|
+
shallow: true
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
var renderAuthor = function renderAuthor(authorDetail, index, length) {
|
|
186
|
+
if (authorDetail) {
|
|
187
|
+
var _id = authorDetail._id,
|
|
188
|
+
displayName = authorDetail.displayName,
|
|
189
|
+
url = authorDetail.url;
|
|
190
|
+
|
|
191
|
+
if (displayName && url && url.current) {
|
|
192
|
+
return React__default.createElement(
|
|
193
|
+
'div',
|
|
194
|
+
{ key: _id },
|
|
195
|
+
index === 0 && React__default.createElement(
|
|
196
|
+
'span',
|
|
197
|
+
{ className: 'pr-1' },
|
|
198
|
+
'By'
|
|
199
|
+
),
|
|
200
|
+
React__default.createElement(
|
|
201
|
+
'a',
|
|
202
|
+
{ href: '/authors/' + url.current, className: 'text-muted' },
|
|
203
|
+
displayName,
|
|
204
|
+
length !== index + 1 && React__default.createElement('br', null)
|
|
205
|
+
)
|
|
206
|
+
);
|
|
207
|
+
} else if (displayName) {
|
|
208
|
+
return React__default.createElement(
|
|
209
|
+
'div',
|
|
210
|
+
{ key: _id },
|
|
211
|
+
index === 0 && React__default.createElement(
|
|
212
|
+
'span',
|
|
213
|
+
{ className: 'pr-1' },
|
|
214
|
+
'By'
|
|
215
|
+
),
|
|
216
|
+
React__default.createElement(
|
|
217
|
+
'span',
|
|
218
|
+
{ className: 'text-muted' },
|
|
219
|
+
displayName,
|
|
220
|
+
length !== index + 1 && React__default.createElement('br', null)
|
|
221
|
+
)
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
} else return null;
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
var checkExternalUrl = function checkExternalUrl(url) {
|
|
228
|
+
return new RegExp(['http', 'https'].join('|')).test(url);
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth, rightItems, brandInsightAd, showBI, itemsPerPage) {
|
|
232
|
+
var numberOfItemsBeforeAd = 6;
|
|
233
|
+
|
|
234
|
+
var insertBrandInsightAd = function insertBrandInsightAd(arr, index, newElement) {
|
|
235
|
+
return [].concat(toConsumableArray._toConsumableArray(arr.slice(0, index)), [newElement], toConsumableArray._toConsumableArray(arr.slice(index)));
|
|
236
|
+
};
|
|
237
|
+
if (showBI && brandInsightAd) {
|
|
238
|
+
var pos = 0;
|
|
239
|
+
for (var i = 1; pos < data.length; i++) {
|
|
240
|
+
var inFeedAd = {
|
|
241
|
+
adUnit: brandInsightAd.adUnit,
|
|
242
|
+
className: brandInsightAd.className,
|
|
243
|
+
networkID: brandInsightAd.networkID,
|
|
244
|
+
sizes: brandInsightAd.sizes,
|
|
245
|
+
slotId: brandInsightAd.slotId + '_' + i,
|
|
246
|
+
targeting: {
|
|
247
|
+
pos: 'article' + i,
|
|
248
|
+
content_placement: brandInsightAd.targeting.content_placement,
|
|
249
|
+
document_url: brandInsightAd.targeting.document_url
|
|
250
|
+
},
|
|
251
|
+
_type: 'brandInsightAd'
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
data = insertBrandInsightAd(data, pos, inFeedAd);
|
|
255
|
+
pos += brandInsightAd.interval + 1;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
return React__default.createElement(
|
|
260
|
+
'div',
|
|
261
|
+
null,
|
|
262
|
+
data && data.length > 0 ? data.map(function (article, index) {
|
|
263
|
+
var pageNumber = article.pageNumber || values.page;
|
|
264
|
+
|
|
265
|
+
var contentCategoryName = article.contentCategory ? article.contentCategory.name : 'Articles';
|
|
266
|
+
|
|
267
|
+
if (article._type === 'feature') {
|
|
268
|
+
if (article.blank || checkExternalUrl(article.url.current)) {
|
|
269
|
+
return React__default.createElement(
|
|
270
|
+
React__default.Fragment,
|
|
271
|
+
{ key: article._id ? article._id : index },
|
|
272
|
+
React__default.createElement(
|
|
273
|
+
visibilitySensor.VisibilitySensor,
|
|
274
|
+
{
|
|
275
|
+
key: article._id ? article._id : index,
|
|
276
|
+
partialVisibility: true,
|
|
277
|
+
onChange: function onChange(isVisible) {
|
|
278
|
+
isVisible && changePageNumber(1, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, parseInt(index));
|
|
279
|
+
} },
|
|
280
|
+
React__default.createElement(
|
|
281
|
+
React__default.Fragment,
|
|
282
|
+
null,
|
|
283
|
+
React__default.createElement(
|
|
284
|
+
reactBootstrap.Media,
|
|
285
|
+
{
|
|
286
|
+
key: article._id ? article._id : index,
|
|
287
|
+
className: 'feature-media',
|
|
288
|
+
style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
|
|
289
|
+
(article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
|
|
290
|
+
'a',
|
|
291
|
+
{ href: article.url.current, target: '_blank', className: 'feature-wrapper' },
|
|
292
|
+
React__default.createElement(
|
|
293
|
+
index$1.LazyLoad,
|
|
294
|
+
{ height: imageHeight },
|
|
295
|
+
article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: '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 })
|
|
296
|
+
)
|
|
297
|
+
),
|
|
298
|
+
React__default.createElement(
|
|
299
|
+
reactBootstrap.Media.Body,
|
|
300
|
+
null,
|
|
301
|
+
React__default.createElement(
|
|
302
|
+
'a',
|
|
303
|
+
{ href: article.url.current, target: '_blank' },
|
|
304
|
+
article.title && React__default.createElement(
|
|
305
|
+
'h4',
|
|
306
|
+
{ className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
|
|
307
|
+
article.title
|
|
308
|
+
)
|
|
309
|
+
),
|
|
310
|
+
showPublished && article.published && React__default.createElement(
|
|
311
|
+
'p',
|
|
312
|
+
{ className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
|
|
313
|
+
moment.moment(article.published).format('MMMM DD, YYYY')
|
|
314
|
+
),
|
|
315
|
+
showAuthor && article.authorMapping && article.authorMapping.length > 0 && article.authorMapping.map(function (authorDetail, index) {
|
|
316
|
+
return renderAuthor(authorDetail, index, article.authorMapping.length);
|
|
317
|
+
}),
|
|
318
|
+
article.source && React__default.createElement(
|
|
319
|
+
'p',
|
|
320
|
+
{ className: 'p-0 mb-1' },
|
|
321
|
+
article.source
|
|
322
|
+
),
|
|
323
|
+
showCategory && article.contentCategory && React__default.createElement(
|
|
324
|
+
'p',
|
|
325
|
+
{
|
|
326
|
+
className: 'article-category',
|
|
327
|
+
style: {
|
|
328
|
+
background: '#3FB618',
|
|
329
|
+
color: '#ffffff',
|
|
330
|
+
marginBottom: '.25rem',
|
|
331
|
+
display: 'inline-block',
|
|
332
|
+
padding: '0 .25rem',
|
|
333
|
+
fontSize: '.8rem'
|
|
334
|
+
} },
|
|
335
|
+
article.contentCategory.name.slice(0, article.contentCategory.name.length - 1)
|
|
336
|
+
),
|
|
337
|
+
article.summary && React__default.createElement(
|
|
338
|
+
'p',
|
|
339
|
+
{ className: 'pt-2 card-text' },
|
|
340
|
+
entities.clean_html_1(article.summary)
|
|
341
|
+
)
|
|
342
|
+
)
|
|
343
|
+
)
|
|
344
|
+
)
|
|
345
|
+
),
|
|
346
|
+
main.main_39 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index, numberOfItemsBeforeAd, rightItems)
|
|
347
|
+
);
|
|
348
|
+
} else {
|
|
349
|
+
return React__default.createElement(
|
|
350
|
+
React__default.Fragment,
|
|
351
|
+
{ key: article._id ? article._id : index },
|
|
352
|
+
React__default.createElement(
|
|
353
|
+
visibilitySensor.VisibilitySensor,
|
|
354
|
+
{
|
|
355
|
+
key: article._id ? article._id : index,
|
|
356
|
+
partialVisibility: true,
|
|
357
|
+
onChange: function onChange(isVisible) {
|
|
358
|
+
isVisible && changePageNumber(1, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, parseInt(index));
|
|
359
|
+
} },
|
|
360
|
+
React__default.createElement(
|
|
361
|
+
React__default.Fragment,
|
|
362
|
+
null,
|
|
363
|
+
React__default.createElement(
|
|
364
|
+
reactBootstrap.Media,
|
|
365
|
+
{
|
|
366
|
+
key: article._id ? article._id : index,
|
|
367
|
+
className: 'feature-media',
|
|
368
|
+
style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
|
|
369
|
+
(article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
|
|
370
|
+
'a',
|
|
371
|
+
{ href: article.url.current, className: 'feature-wrapper' },
|
|
372
|
+
React__default.createElement(
|
|
373
|
+
index$1.LazyLoad,
|
|
374
|
+
{ height: imageHeight },
|
|
375
|
+
article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: '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 })
|
|
376
|
+
)
|
|
377
|
+
),
|
|
378
|
+
React__default.createElement(
|
|
379
|
+
reactBootstrap.Media.Body,
|
|
380
|
+
null,
|
|
381
|
+
React__default.createElement(
|
|
382
|
+
'a',
|
|
383
|
+
{ href: article.url.current },
|
|
384
|
+
article.title && React__default.createElement(
|
|
385
|
+
'h4',
|
|
386
|
+
{ className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
|
|
387
|
+
article.title
|
|
388
|
+
)
|
|
389
|
+
),
|
|
390
|
+
showPublished && article.published && React__default.createElement(
|
|
391
|
+
'p',
|
|
392
|
+
{ className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
|
|
393
|
+
moment.moment(article.published).format('MMMM DD, YYYY')
|
|
394
|
+
),
|
|
395
|
+
showAuthor && article.authorMapping && article.authorMapping.length > 0 && article.authorMapping.map(function (authorDetail, index) {
|
|
396
|
+
return renderAuthor(authorDetail, index, article.authorMapping.length);
|
|
397
|
+
}),
|
|
398
|
+
article.source && React__default.createElement(
|
|
399
|
+
'p',
|
|
400
|
+
{ className: 'p-0 mb-1' },
|
|
401
|
+
article.source
|
|
402
|
+
),
|
|
403
|
+
showCategory && article.contentCategory && React__default.createElement(
|
|
404
|
+
'p',
|
|
405
|
+
{
|
|
406
|
+
style: {
|
|
407
|
+
background: '#3FB618',
|
|
408
|
+
color: '#ffffff',
|
|
409
|
+
marginBottom: '.25rem',
|
|
410
|
+
display: 'inline-block',
|
|
411
|
+
padding: '0 .25rem',
|
|
412
|
+
fontSize: '.8rem'
|
|
413
|
+
} },
|
|
414
|
+
article.contentCategory.name.slice(0, article.contentCategory.name.length - 1)
|
|
415
|
+
),
|
|
416
|
+
article.summary && React__default.createElement(
|
|
417
|
+
'p',
|
|
418
|
+
{ className: 'pt-2 card-text' },
|
|
419
|
+
entities.clean_html_1(article.summary)
|
|
420
|
+
)
|
|
421
|
+
)
|
|
422
|
+
)
|
|
423
|
+
)
|
|
424
|
+
),
|
|
425
|
+
main.main_39 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index, numberOfItemsBeforeAd, rightItems)
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
} else if (article._type === 'brandInsightAd' && article.adUnit) {
|
|
429
|
+
return React__default.createElement(ADInfeed.ADInfeed, { index: index, infeedAd: article });
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
return React__default.createElement(
|
|
433
|
+
React__default.Fragment,
|
|
434
|
+
{ key: article._id ? article._id : index },
|
|
435
|
+
React__default.createElement(
|
|
436
|
+
visibilitySensor.VisibilitySensor,
|
|
437
|
+
{
|
|
438
|
+
key: article._id ? article._id : index,
|
|
439
|
+
onChange: function onChange(isVisible) {
|
|
440
|
+
isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, parseInt(index));
|
|
441
|
+
} },
|
|
442
|
+
React__default.createElement(
|
|
443
|
+
React__default.Fragment,
|
|
444
|
+
null,
|
|
445
|
+
React__default.createElement(
|
|
446
|
+
reactBootstrap.Media,
|
|
447
|
+
{
|
|
448
|
+
key: article._id ? article._id : index,
|
|
449
|
+
style: { flexDirection: 'row', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
|
|
450
|
+
(article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
|
|
451
|
+
'a',
|
|
452
|
+
{ href: mapping[contentCategoryName] + '/' + article.url.current, className: 'img-wrapper' },
|
|
453
|
+
React__default.createElement(
|
|
454
|
+
index$1.LazyLoad,
|
|
455
|
+
{ height: imageHeight },
|
|
456
|
+
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 })
|
|
457
|
+
)
|
|
458
|
+
),
|
|
459
|
+
React__default.createElement(
|
|
460
|
+
reactBootstrap.Media.Body,
|
|
461
|
+
null,
|
|
462
|
+
React__default.createElement(
|
|
463
|
+
'a',
|
|
464
|
+
{ href: mapping[contentCategoryName] + '/' + article.url.current },
|
|
465
|
+
article.title && React__default.createElement(
|
|
466
|
+
'h4',
|
|
467
|
+
{ className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
|
|
468
|
+
article.title
|
|
469
|
+
)
|
|
470
|
+
),
|
|
471
|
+
showPublished && article.published && React__default.createElement(
|
|
472
|
+
'p',
|
|
473
|
+
{ className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
|
|
474
|
+
moment.moment(article.published).format('MMMM DD, YYYY')
|
|
475
|
+
),
|
|
476
|
+
showAuthor && article.authorMapping && article.authorMapping.length > 0 && article.authorMapping.map(function (authorDetail, index) {
|
|
477
|
+
return renderAuthor(authorDetail, index, article.authorMapping.length);
|
|
478
|
+
}),
|
|
479
|
+
article.source && React__default.createElement(
|
|
480
|
+
'p',
|
|
481
|
+
{ className: 'p-0 mb-1' },
|
|
482
|
+
article.source
|
|
483
|
+
),
|
|
484
|
+
showCategory && article.contentCategory && React__default.createElement(
|
|
485
|
+
'p',
|
|
486
|
+
{
|
|
487
|
+
style: {
|
|
488
|
+
background: '#3FB618',
|
|
489
|
+
color: '#ffffff',
|
|
490
|
+
marginBottom: '.25rem',
|
|
491
|
+
display: 'inline-block',
|
|
492
|
+
padding: '0 .25rem',
|
|
493
|
+
fontSize: '.8rem'
|
|
494
|
+
} },
|
|
495
|
+
article.contentCategory.name.slice(0, article.contentCategory.name.length - 1)
|
|
496
|
+
),
|
|
497
|
+
article.summary && React__default.createElement(
|
|
498
|
+
'p',
|
|
499
|
+
{ className: 'pt-2 card-text' },
|
|
500
|
+
entities.clean_html_1(article.summary)
|
|
501
|
+
)
|
|
502
|
+
)
|
|
503
|
+
)
|
|
504
|
+
)
|
|
505
|
+
),
|
|
506
|
+
main.main_39 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index, numberOfItemsBeforeAd, rightItems)
|
|
507
|
+
);
|
|
508
|
+
}) : React__default.createElement(
|
|
509
|
+
'div',
|
|
510
|
+
null,
|
|
511
|
+
React__default.createElement(
|
|
512
|
+
'h5',
|
|
513
|
+
null,
|
|
514
|
+
React__default.createElement(
|
|
515
|
+
'em',
|
|
516
|
+
null,
|
|
517
|
+
'New content coming soon, please check back later.'
|
|
518
|
+
)
|
|
519
|
+
)
|
|
520
|
+
),
|
|
521
|
+
React__default.createElement(
|
|
522
|
+
'style',
|
|
523
|
+
{ jsx: 'true' },
|
|
524
|
+
'\n .feature-media > .media-body {\n -webkit-box-flex: none;\n -ms-flex: none;\n flex: none;\n }\n .img-wrapper img {\n max-height: 240px;\n height: auto;\n width: 100%;\n object-fit: contain;\n }\n .feature-wrapper {\n height: 100%;\n width: 100%;\n }\n .feature-wrapper img {\n width: 100%;\n margin-bottom: 1em;\n }\n @media only screen and (min-width: 768px) {\n .img-wrapper > img {\n padding-right: 1em;\n }\n }\n @media only screen and (max-width: 767px) {\n .img-wrapper {\n width: 100%;\n }\n .img-wrapper img {\n padding-bottom: 1em;\n }\n .media {\n flex-direction: column !important;\n }\n }\n '
|
|
525
|
+
)
|
|
526
|
+
);
|
|
527
|
+
};
|
|
528
|
+
|
|
529
|
+
var renderMobileAd = function renderMobileAd(index, numberOfItemsBeforeAd, rightItems) {
|
|
530
|
+
var i = ((index + 1) / numberOfItemsBeforeAd - 1) % rightItems.length;
|
|
531
|
+
return React__default.createElement(
|
|
532
|
+
'div',
|
|
533
|
+
{ style: { display: 'flex', flex: '1 0 auto' } },
|
|
534
|
+
rightItems[i].component
|
|
535
|
+
);
|
|
536
|
+
};
|
|
537
|
+
|
|
538
|
+
var renderManualPagination = function renderManualPagination(currentPage) {
|
|
539
|
+
return React__default.createElement(
|
|
540
|
+
'div',
|
|
541
|
+
{ className: 'd-flex justify-content-between' },
|
|
542
|
+
currentPage && currentPage > 1 && React__default.createElement(
|
|
543
|
+
'a',
|
|
544
|
+
{ href: '?page=' + (currentPage - 1) },
|
|
545
|
+
'<< Previous'
|
|
546
|
+
),
|
|
547
|
+
React__default.createElement(
|
|
548
|
+
'a',
|
|
549
|
+
{ href: '?page=' + (currentPage + 1) },
|
|
550
|
+
'Next >>'
|
|
551
|
+
)
|
|
552
|
+
);
|
|
553
|
+
};
|
|
554
|
+
|
|
555
|
+
var usePrevious = function usePrevious(value) {
|
|
556
|
+
var ref = React.useRef();
|
|
557
|
+
React.useEffect(function () {
|
|
558
|
+
ref.current = value;
|
|
559
|
+
});
|
|
560
|
+
return ref.current;
|
|
561
|
+
};
|
|
562
|
+
|
|
563
|
+
var InfiniteScrollDeck = function InfiniteScrollDeck(props) {
|
|
564
|
+
var router = Router.useRouter();
|
|
565
|
+
var initialData = props.dataRecord,
|
|
566
|
+
client = props.client,
|
|
567
|
+
params = props.params,
|
|
568
|
+
query = props.query,
|
|
569
|
+
autoScroll = props.autoScroll,
|
|
570
|
+
pointer = props.pointer,
|
|
571
|
+
pointerArray = props.pointerArray,
|
|
572
|
+
mapping = props.mapping,
|
|
573
|
+
seoPaginate = props.seoPaginate,
|
|
574
|
+
pageview = props.pageview,
|
|
575
|
+
defaultImage = props.defaultImage,
|
|
576
|
+
showAuthor = props.showAuthor,
|
|
577
|
+
showCategory = props.showCategory,
|
|
578
|
+
imageHeight = props.imageHeight,
|
|
579
|
+
imageWidth = props.imageWidth,
|
|
580
|
+
rightItems = props.rightItems,
|
|
581
|
+
brandInsightAd = props.brandInsightAd,
|
|
582
|
+
_props$showBI = props.showBI,
|
|
583
|
+
showBI = _props$showBI === undefined ? false : _props$showBI;
|
|
584
|
+
var initialCurrentPage = props.currentPage,
|
|
585
|
+
showPublished = props.showPublished;
|
|
586
|
+
|
|
587
|
+
var builder = index.imageUrlBuilder(client);
|
|
588
|
+
|
|
589
|
+
var _useState = React.useState(initialData),
|
|
590
|
+
_useState2 = slicedToArray._slicedToArray(_useState, 2),
|
|
591
|
+
data = _useState2[0],
|
|
592
|
+
setData = _useState2[1];
|
|
593
|
+
|
|
594
|
+
var _useState3 = React.useState(true),
|
|
595
|
+
_useState4 = slicedToArray._slicedToArray(_useState3, 2),
|
|
596
|
+
scrolling = _useState4[0],
|
|
597
|
+
setScrolling = _useState4[1];
|
|
598
|
+
|
|
599
|
+
var _useState5 = React.useState(params ? params.to : 0),
|
|
600
|
+
_useState6 = slicedToArray._slicedToArray(_useState5, 1),
|
|
601
|
+
per = _useState6[0];
|
|
602
|
+
|
|
603
|
+
var _useState7 = React.useState(initialCurrentPage || 1),
|
|
604
|
+
_useState8 = slicedToArray._slicedToArray(_useState7, 2),
|
|
605
|
+
currentPage = _useState8[0],
|
|
606
|
+
setCurrentPage = _useState8[1];
|
|
607
|
+
|
|
608
|
+
var _useState9 = React.useState({
|
|
609
|
+
from: params ? params.from : 0,
|
|
610
|
+
to: params ? params.to : 0,
|
|
611
|
+
page: 1
|
|
612
|
+
}),
|
|
613
|
+
_useState10 = slicedToArray._slicedToArray(_useState9, 2),
|
|
614
|
+
values = _useState10[0],
|
|
615
|
+
setValues = _useState10[1];
|
|
616
|
+
|
|
617
|
+
var itemsPerPage = params.itemsPerPage;
|
|
618
|
+
|
|
619
|
+
var prevValues = usePrevious(values);
|
|
620
|
+
|
|
621
|
+
React.useEffect(function () {
|
|
622
|
+
if (prevValues) {
|
|
623
|
+
if (values.page !== prevValues.page && values.from !== prevValues.from && values.to !== prevValues.from) {
|
|
624
|
+
loadData(values, query, client, params, setData, setScrolling, pointer, pointerArray);
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
}, [values, prevValues, query, client, params, setData, setScrolling, pointer, pointerArray]);
|
|
628
|
+
|
|
629
|
+
React.useEffect(function () {
|
|
630
|
+
document.addEventListener('scroll', trackScrolling);
|
|
631
|
+
return function () {
|
|
632
|
+
document.removeEventListener('scroll', trackScrolling);
|
|
633
|
+
};
|
|
634
|
+
}, [currentPage]);
|
|
635
|
+
|
|
636
|
+
var trackScrolling = function trackScrolling(current) {
|
|
637
|
+
if (window.pageYOffset === 0) {
|
|
638
|
+
if (currentPage > 1) {
|
|
639
|
+
changePageNumber(1, seoPaginate, pageview, router, currentPage, setCurrentPage, itemsPerPage, 1);
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
};
|
|
643
|
+
|
|
644
|
+
return React__default.createElement(
|
|
645
|
+
'div',
|
|
646
|
+
null,
|
|
647
|
+
autoScroll ? React__default.createElement(
|
|
648
|
+
React__default.Fragment,
|
|
649
|
+
null,
|
|
650
|
+
React__default.createElement(
|
|
651
|
+
visibilitySensor.InfiniteScroll,
|
|
652
|
+
{ dataLength: data && data.length, next: function next() {
|
|
653
|
+
return loadMore(values, setValues, per);
|
|
654
|
+
}, hasMore: scrolling, scrollThreshold: 0.9 },
|
|
655
|
+
React__default.createElement(
|
|
656
|
+
reactBootstrap.Container,
|
|
657
|
+
null,
|
|
658
|
+
cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth, rightItems, brandInsightAd, showBI, itemsPerPage)
|
|
659
|
+
)
|
|
660
|
+
),
|
|
661
|
+
React__default.createElement(
|
|
662
|
+
'noscript',
|
|
663
|
+
null,
|
|
664
|
+
renderManualPagination(currentPage)
|
|
665
|
+
)
|
|
666
|
+
) : React__default.createElement(
|
|
667
|
+
React__default.Fragment,
|
|
668
|
+
null,
|
|
669
|
+
React__default.createElement(
|
|
670
|
+
reactBootstrap.Container,
|
|
671
|
+
null,
|
|
672
|
+
cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, rightItems, brandInsightAd, showBI, itemsPerPage)
|
|
673
|
+
),
|
|
674
|
+
React__default.createElement(
|
|
675
|
+
'div',
|
|
676
|
+
{ style: { padding: '0px 10px' } },
|
|
677
|
+
scrolling ? React__default.createElement(
|
|
678
|
+
'button',
|
|
679
|
+
{
|
|
680
|
+
style: { margin: 'auto', width: '100%' },
|
|
681
|
+
onClick: function onClick(e) {
|
|
682
|
+
loadMore(values, setValues, per);
|
|
683
|
+
} },
|
|
684
|
+
'Load More'
|
|
685
|
+
) : React__default.createElement(
|
|
686
|
+
'p',
|
|
687
|
+
{ style: { textAlign: 'center' } },
|
|
688
|
+
React__default.createElement(
|
|
689
|
+
'b',
|
|
690
|
+
null,
|
|
691
|
+
'End of data'
|
|
692
|
+
)
|
|
693
|
+
)
|
|
694
|
+
),
|
|
695
|
+
React__default.createElement(
|
|
696
|
+
'noscript',
|
|
697
|
+
null,
|
|
698
|
+
renderManualPagination(currentPage)
|
|
699
|
+
)
|
|
700
|
+
)
|
|
701
|
+
);
|
|
702
|
+
};
|
|
703
|
+
|
|
78
704
|
var momentTimezone = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
79
705
|
//! moment-timezone.js
|
|
80
706
|
//! version : 0.5.31
|
|
@@ -1626,12 +2252,12 @@ var latest = {
|
|
|
1626
2252
|
};
|
|
1627
2253
|
|
|
1628
2254
|
var latest$1 = /*#__PURE__*/Object.freeze({
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
2255
|
+
__proto__: null,
|
|
2256
|
+
version: version,
|
|
2257
|
+
zones: zones,
|
|
2258
|
+
links: links,
|
|
2259
|
+
countries: countries,
|
|
2260
|
+
'default': latest
|
|
1635
2261
|
});
|
|
1636
2262
|
|
|
1637
2263
|
var require$$1 = _commonjsHelpers.getCjsExportFromNamespace(latest$1);
|
|
@@ -3162,7 +3788,7 @@ var ADSponsoredResources = function ADSponsoredResources(_ref) {
|
|
|
3162
3788
|
} else return null;
|
|
3163
3789
|
};
|
|
3164
3790
|
|
|
3165
|
-
var urlFor$
|
|
3791
|
+
var urlFor$2 = function urlFor(source, builder) {
|
|
3166
3792
|
return builder.image(source).auto('format');
|
|
3167
3793
|
};
|
|
3168
3794
|
|
|
@@ -3213,7 +3839,7 @@ var Slideshow = function Slideshow(_ref) {
|
|
|
3213
3839
|
return React__default.createElement(
|
|
3214
3840
|
reactBootstrap.Carousel.Item,
|
|
3215
3841
|
{ key: slide._key },
|
|
3216
|
-
React__default.createElement('img', { src: slide.asset && urlFor$
|
|
3842
|
+
React__default.createElement('img', { src: slide.asset && urlFor$2(slide.asset, builder).url(), alt: slide.alt && slide.alt, style: { width: '100%' } }),
|
|
3217
3843
|
slide.caption && React__default.createElement(
|
|
3218
3844
|
'p',
|
|
3219
3845
|
{ className: 'p-2' },
|
|
@@ -13522,7 +14148,7 @@ var Leads = function Leads(_ref) {
|
|
|
13522
14148
|
);
|
|
13523
14149
|
};
|
|
13524
14150
|
|
|
13525
|
-
var urlFor$
|
|
14151
|
+
var urlFor$3 = function urlFor(source, client) {
|
|
13526
14152
|
var builder = index.imageUrlBuilder(client);
|
|
13527
14153
|
return builder.image(source).auto('format');
|
|
13528
14154
|
};
|
|
@@ -13579,7 +14205,7 @@ var Slideshow$1 = function Slideshow(_ref) {
|
|
|
13579
14205
|
React__default.createElement(
|
|
13580
14206
|
index$1.LazyLoad,
|
|
13581
14207
|
null,
|
|
13582
|
-
React__default.createElement('img', { src: urlFor$
|
|
14208
|
+
React__default.createElement('img', { src: urlFor$3(slide.slideshowImage, client).url(), alt: slide.slideshowImage.alt || 'slideshow image', style: { width: '100%' } })
|
|
13583
14209
|
)
|
|
13584
14210
|
),
|
|
13585
14211
|
React__default.createElement(
|
|
@@ -14013,13 +14639,13 @@ var SetCookie = function SetCookie(key, value) {
|
|
|
14013
14639
|
js_cookie.set(key, value, { expires: 1, sameSite: 'none', secure: true });
|
|
14014
14640
|
};
|
|
14015
14641
|
|
|
14016
|
-
var urlFor$
|
|
14642
|
+
var urlFor$4 = function urlFor(source, client) {
|
|
14017
14643
|
var builder = index.imageUrlBuilder(client);
|
|
14018
14644
|
return builder.image(source).auto('format');
|
|
14019
14645
|
};
|
|
14020
14646
|
|
|
14021
|
-
var renderCardImage = function renderCardImage(thumbnail, client, imageHeight, imageWidth) {
|
|
14022
|
-
var url = urlFor$
|
|
14647
|
+
var renderCardImage$1 = function renderCardImage(thumbnail, client, imageHeight, imageWidth) {
|
|
14648
|
+
var url = urlFor$4(thumbnail, client);
|
|
14023
14649
|
if (imageHeight) url = url.height(imageHeight);
|
|
14024
14650
|
if (imageWidth) url = url.width(imageWidth);
|
|
14025
14651
|
return url.url();
|
|
@@ -14046,7 +14672,7 @@ var Hero = function Hero(_ref) {
|
|
|
14046
14672
|
{ className: 'h4' },
|
|
14047
14673
|
title
|
|
14048
14674
|
),
|
|
14049
|
-
thumbnail && client && React__default.createElement(reactBootstrap.Card.Img, { src: renderCardImage(thumbnail, client, imageHeight, imageWidth) }),
|
|
14675
|
+
thumbnail && client && React__default.createElement(reactBootstrap.Card.Img, { src: renderCardImage$1(thumbnail, client, imageHeight, imageWidth) }),
|
|
14050
14676
|
summary && React__default.createElement(
|
|
14051
14677
|
reactBootstrap.Card.Footer,
|
|
14052
14678
|
{ className: 'h6' },
|
|
@@ -16217,7 +16843,7 @@ var InscreenSensor = function (_React$Component) {
|
|
|
16217
16843
|
return InscreenSensor;
|
|
16218
16844
|
}(React__default.Component);
|
|
16219
16845
|
|
|
16220
|
-
var renderAuthor = function renderAuthor(authorName, authorURL, index, length) {
|
|
16846
|
+
var renderAuthor$1 = function renderAuthor(authorName, authorURL, index, length) {
|
|
16221
16847
|
if (authorName && authorURL) {
|
|
16222
16848
|
return React__default.createElement(
|
|
16223
16849
|
'a',
|
|
@@ -16519,7 +17145,7 @@ var Article = function Article(props) {
|
|
|
16519
17145
|
return React__default.createElement(
|
|
16520
17146
|
'div',
|
|
16521
17147
|
{ key: index },
|
|
16522
|
-
renderAuthor(authorDetail.displayName, authorDetail.url, index, authorDetails.length)
|
|
17148
|
+
renderAuthor$1(authorDetail.displayName, authorDetail.url, index, authorDetails.length)
|
|
16523
17149
|
);
|
|
16524
17150
|
}),
|
|
16525
17151
|
React__default.createElement(
|
|
@@ -17094,8 +17720,8 @@ function useUser() {
|
|
|
17094
17720
|
}
|
|
17095
17721
|
|
|
17096
17722
|
var hooks = /*#__PURE__*/Object.freeze({
|
|
17097
|
-
|
|
17098
|
-
|
|
17723
|
+
__proto__: null,
|
|
17724
|
+
useUser: useUser
|
|
17099
17725
|
});
|
|
17100
17726
|
|
|
17101
17727
|
var LoginForm = function LoginForm(props) {
|
|
@@ -18317,11 +18943,11 @@ function getTokenCookie(req) {
|
|
|
18317
18943
|
}
|
|
18318
18944
|
|
|
18319
18945
|
var authCookies = /*#__PURE__*/Object.freeze({
|
|
18320
|
-
|
|
18321
|
-
|
|
18322
|
-
|
|
18323
|
-
|
|
18324
|
-
|
|
18946
|
+
__proto__: null,
|
|
18947
|
+
setTokenCookie: setTokenCookie,
|
|
18948
|
+
removeTokenCookie: removeTokenCookie,
|
|
18949
|
+
parseCookies: parseCookies,
|
|
18950
|
+
getTokenCookie: getTokenCookie
|
|
18325
18951
|
});
|
|
18326
18952
|
|
|
18327
18953
|
function encryptSession(session) {
|
|
@@ -18365,9 +18991,9 @@ var getSession = function () {
|
|
|
18365
18991
|
}();
|
|
18366
18992
|
|
|
18367
18993
|
var iron = /*#__PURE__*/Object.freeze({
|
|
18368
|
-
|
|
18369
|
-
|
|
18370
|
-
|
|
18994
|
+
__proto__: null,
|
|
18995
|
+
encryptSession: encryptSession,
|
|
18996
|
+
getSession: getSession
|
|
18371
18997
|
});
|
|
18372
18998
|
|
|
18373
18999
|
var toStr = Object.prototype.toString;
|
|
@@ -20622,10 +21248,10 @@ var findUser$1 = function () {
|
|
|
20622
21248
|
}();
|
|
20623
21249
|
|
|
20624
21250
|
var user = /*#__PURE__*/Object.freeze({
|
|
20625
|
-
|
|
20626
|
-
|
|
20627
|
-
|
|
20628
|
-
|
|
21251
|
+
__proto__: null,
|
|
21252
|
+
createUser: createUser$1,
|
|
21253
|
+
updateUser: updateUser$1,
|
|
21254
|
+
findUser: findUser$1
|
|
20629
21255
|
});
|
|
20630
21256
|
|
|
20631
21257
|
var localStrategy = new Local.Strategy({
|
|
@@ -20641,8 +21267,8 @@ var localStrategy = new Local.Strategy({
|
|
|
20641
21267
|
});
|
|
20642
21268
|
|
|
20643
21269
|
var passportLocal = /*#__PURE__*/Object.freeze({
|
|
20644
|
-
|
|
20645
|
-
|
|
21270
|
+
__proto__: null,
|
|
21271
|
+
localStrategy: localStrategy
|
|
20646
21272
|
});
|
|
20647
21273
|
|
|
20648
21274
|
var _this$4 = undefined;
|
|
@@ -20889,6 +21515,7 @@ exports.GridHero = GridHero;
|
|
|
20889
21515
|
exports.Hero = Hero;
|
|
20890
21516
|
exports.HighlightenVideo = HighlightenVideo;
|
|
20891
21517
|
exports.HorizontalHero = HorizontalHero;
|
|
21518
|
+
exports.InfiniteScrollDeck = InfiniteScrollDeck;
|
|
20892
21519
|
exports.KMTracker = KMTracker;
|
|
20893
21520
|
exports.OncliveHero = OncliveHero;
|
|
20894
21521
|
exports.OncliveLargeHero = OncliveLargeHero;
|