@mjhls/mjh-framework 1.0.204 → 1.0.206

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.
Files changed (74) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/AD-e2479b7c.js +31 -0
  3. package/dist/cjs/DeckContent.js +430 -0
  4. package/dist/cjs/DeckQueue.js +366 -0
  5. package/dist/cjs/Dfp-d94f7f73.js +97 -0
  6. package/dist/cjs/GridContent.js +613 -0
  7. package/dist/cjs/GroupDeck.js +156 -0
  8. package/dist/cjs/IssueContentDeck.js +81 -0
  9. package/dist/cjs/IssueDeck.js +144 -0
  10. package/dist/cjs/MasterDeck.js +340 -0
  11. package/dist/cjs/Normal-7dd8c339.js +2374 -0
  12. package/dist/cjs/PublicationDeck.js +81 -0
  13. package/dist/cjs/QueueDeckExpanded.js +559 -0
  14. package/dist/cjs/TaxonomyCard-7b5b4298.js +1045 -0
  15. package/dist/cjs/TaxonomyCard.js +18 -0
  16. package/dist/cjs/TemplateNormal.js +29 -0
  17. package/dist/cjs/ThumbnailCard.js +58 -0
  18. package/dist/cjs/Ustream-0d3dd953.js +122 -0
  19. package/dist/cjs/Ustream.js +10 -0
  20. package/dist/cjs/VideoSeriesListing.js +248 -0
  21. package/dist/cjs/YoutubeGroup-4cf7a4aa.js +228 -0
  22. package/dist/cjs/YoutubeGroup.js +13 -0
  23. package/dist/cjs/_babelHelpers-f321c258.js +119 -0
  24. package/dist/cjs/_commonjsHelpers-3fc1f64e.js +20 -0
  25. package/dist/cjs/debounce-286eb3fb.js +279 -0
  26. package/dist/cjs/entities-3e0b4a16.js +506 -0
  27. package/dist/cjs/get-06aac51b.js +992 -0
  28. package/dist/cjs/index-0d0efcfa.js +610 -0
  29. package/dist/cjs/index-a4c53ff4.js +551 -0
  30. package/dist/cjs/index.es-2289df51.js +5028 -0
  31. package/dist/cjs/index.esm-340d3792.js +113 -0
  32. package/dist/cjs/index.js +12044 -0
  33. package/dist/cjs/isSymbol-311eb805.js +209 -0
  34. package/dist/cjs/main-58839f4e.js +858 -0
  35. package/dist/cjs/visibility-sensor-5c5a7302.js +2251 -0
  36. package/dist/esm/AD-1b2a3dd3.js +26 -0
  37. package/dist/esm/DeckContent.js +424 -0
  38. package/dist/esm/DeckQueue.js +360 -0
  39. package/dist/esm/Dfp-ab7941d3.js +92 -0
  40. package/dist/esm/GridContent.js +607 -0
  41. package/dist/esm/GroupDeck.js +151 -0
  42. package/dist/esm/IssueContentDeck.js +76 -0
  43. package/dist/esm/IssueDeck.js +139 -0
  44. package/dist/esm/MasterDeck.js +334 -0
  45. package/dist/esm/Normal-403c5666.js +2354 -0
  46. package/dist/esm/PublicationDeck.js +76 -0
  47. package/dist/esm/QueueDeckExpanded.js +553 -0
  48. package/dist/esm/TaxonomyCard-f9c93953.js +1039 -0
  49. package/dist/esm/TaxonomyCard.js +12 -0
  50. package/dist/esm/TemplateNormal.js +23 -0
  51. package/dist/esm/ThumbnailCard.js +53 -0
  52. package/dist/esm/Ustream-6bb45fe7.js +116 -0
  53. package/dist/esm/Ustream.js +4 -0
  54. package/dist/esm/VideoSeriesListing.js +242 -0
  55. package/dist/esm/YoutubeGroup-dc617e8b.js +222 -0
  56. package/dist/esm/YoutubeGroup.js +7 -0
  57. package/dist/esm/_babelHelpers-67c05996.js +111 -0
  58. package/dist/esm/_commonjsHelpers-ae1b5db5.js +15 -0
  59. package/dist/esm/debounce-a0242b4a.js +277 -0
  60. package/dist/esm/entities-e85d3a4a.js +503 -0
  61. package/dist/esm/get-b684ff61.js +990 -0
  62. package/dist/esm/index-3c1ee9ab.js +605 -0
  63. package/dist/esm/index-ca4ff5cb.js +548 -0
  64. package/dist/esm/index.es-f369b3e8.js +5022 -0
  65. package/dist/esm/index.esm-536609db.js +103 -0
  66. package/dist/esm/index.js +11991 -0
  67. package/dist/esm/isSymbol-c2b7d05a.js +203 -0
  68. package/dist/esm/main-dea495b7.js +851 -0
  69. package/dist/esm/visibility-sensor-3cfe6713.js +2243 -0
  70. package/package.json +8 -7
  71. package/dist/index.es.js +0 -30261
  72. package/dist/index.es.js.map +0 -1
  73. package/dist/index.js +0 -30320
  74. package/dist/index.js.map +0 -1
@@ -0,0 +1,76 @@
1
+ import React__default from 'react';
2
+ import './_commonjsHelpers-ae1b5db5.js';
3
+ import 'prop-types';
4
+ import Row from 'react-bootstrap/Row';
5
+ import Col from 'react-bootstrap/Col';
6
+ import Card from 'react-bootstrap/Card';
7
+ import 'next/link';
8
+ import 'react-dom';
9
+ import { i as imageUrlBuilder } from './index-ca4ff5cb.js';
10
+ import { L as LazyLoad } from './index-3c1ee9ab.js';
11
+ import Button from 'react-bootstrap/Button';
12
+
13
+ var PublicationDeck = function PublicationDeck(props) {
14
+ var data = props.data,
15
+ imageHeight = props.imageHeight,
16
+ imageWidth = props.imageWidth,
17
+ href = props.href,
18
+ Website = props.Website,
19
+ client = props.client;
20
+
21
+ var urlFor = function urlFor(source) {
22
+ var builder = imageUrlBuilder(client);
23
+ return builder.image(source).auto('format');
24
+ };
25
+
26
+ var renderCardImage = function renderCardImage(thumbnail) {
27
+ if (thumbnail && thumbnail.asset) {
28
+ var url = urlFor(thumbnail);
29
+ if (imageHeight) url = url.height(imageHeight);
30
+ if (imageWidth) url = url.width(imageWidth);
31
+ return url.url();
32
+ } else {
33
+ return Website.logo;
34
+ }
35
+ };
36
+
37
+ return React__default.createElement(
38
+ Row,
39
+ null,
40
+ data && data.map(function (row, index) {
41
+ return row.identifier && row.identifier.current && React__default.createElement(
42
+ Col,
43
+ { xs: 6, sm: 6, md: 6, lg: 4, style: { display: 'flex', flex: '1 0 auto' }, key: index },
44
+ React__default.createElement(
45
+ Card,
46
+ { className: 'block-card', style: { width: '200px' } },
47
+ React__default.createElement(
48
+ 'a',
49
+ { href: href + '/' + row.identifier.current },
50
+ row.childIssue && row.childIssue.thumbnail && React__default.createElement(
51
+ LazyLoad,
52
+ { height: imageHeight },
53
+ React__default.createElement(Card.Img, { variant: 'top', src: renderCardImage(row.childIssue.thumbnail), alt: row.name })
54
+ ),
55
+ React__default.createElement(
56
+ Card.Body,
57
+ null,
58
+ React__default.createElement(
59
+ Card.Title,
60
+ null,
61
+ row.name
62
+ ),
63
+ React__default.createElement(
64
+ Button,
65
+ { variant: 'secondary' },
66
+ 'Browse Issues'
67
+ )
68
+ )
69
+ )
70
+ )
71
+ );
72
+ })
73
+ );
74
+ };
75
+
76
+ export default PublicationDeck;
@@ -0,0 +1,553 @@
1
+ import React__default, { useState, useEffect, useRef } from 'react';
2
+ import './_commonjsHelpers-ae1b5db5.js';
3
+ import { V as VisibilitySensor, l as lib_3 } from './visibility-sensor-3cfe6713.js';
4
+ import 'prop-types';
5
+ import { I as InfiniteScroll, m as moment } from './index.es-f369b3e8.js';
6
+ import 'next/link';
7
+ import { useRouter } from 'next/router';
8
+ import 'react-dom';
9
+ import { i as imageUrlBuilder } from './index-ca4ff5cb.js';
10
+ import { L as LazyLoad } from './index-3c1ee9ab.js';
11
+ import { a as main_36 } from './main-dea495b7.js';
12
+ import { c as clean_html_1 } from './entities-e85d3a4a.js';
13
+ import { s as slicedToArray, _ as _extends, t as toConsumableArray } from './_babelHelpers-67c05996.js';
14
+ import { Container, Media } from 'react-bootstrap';
15
+
16
+ var urlFor = function urlFor(source, builder) {
17
+ return builder.image(source).auto('format');
18
+ };
19
+
20
+ var renderCardImage = function renderCardImage(row, builder, imageHeight, imageWidth) {
21
+ var url = urlFor(row.thumbnail, builder);
22
+ if (imageHeight) url = url.height(imageHeight);
23
+ if (imageWidth) url = url.width(imageWidth);
24
+ return url.url();
25
+ };
26
+
27
+ var loadMore = function loadMore(values, setValues, per) {
28
+ setValues({
29
+ page: values.page + 1,
30
+ from: values.from + per,
31
+ to: values.to + per
32
+ });
33
+ };
34
+
35
+ var loadData = function loadData(values, query, client, params, setData, setScrolling, pointer, pointerArray) {
36
+ params = _extends({}, params, {
37
+ from: values.from,
38
+ to: values.to
39
+ });
40
+
41
+ client.fetch(query, params).then(function (dataArr) {
42
+ if (pointer && pointerArray) {
43
+ dataArr = dataArr[pointerArray][pointer];
44
+ }
45
+ dataArr = dataArr.map(function (item) {
46
+ return _extends({}, item, {
47
+ pageNumber: values.page
48
+ });
49
+ });
50
+
51
+ if (dataArr.length > 0) {
52
+ setData(function (prevData) {
53
+ return [].concat(toConsumableArray(prevData), toConsumableArray(dataArr));
54
+ });
55
+ setScrolling(true);
56
+ } else {
57
+ setScrolling(false);
58
+ }
59
+ });
60
+ };
61
+
62
+ var changePageNumber = function changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage) {
63
+ if (seoPaginate) {
64
+ var path = router.asPath;
65
+ var qrIndex = path.indexOf('?');
66
+ var pathname = router.pathname;
67
+ var queryString = '';
68
+
69
+ if (qrIndex > 0) {
70
+ path = path.substring(1, qrIndex);
71
+
72
+ var partialQS = router.asPath.substring(qrIndex + 1);
73
+ var partialQSArr = partialQS.split('&');
74
+
75
+ // exclude page=xxx from query string
76
+ partialQSArr.map(function (item) {
77
+ var itemArr = item.split('=');
78
+ var key = itemArr[0];
79
+ var val = itemArr[1];
80
+
81
+ if (key !== 'page') {
82
+ queryString += (queryString.length === 0 ? '' : '&') + key + '=' + val;
83
+ }
84
+ });
85
+ }
86
+
87
+ if (queryString.length > 0) {
88
+ path += '?' + queryString;
89
+ }
90
+
91
+ pageNumber = parseInt(pageNumber);
92
+
93
+ if (currentPage !== pageNumber) {
94
+ lib_3.refresh();
95
+
96
+ setCurrentPage(pageNumber);
97
+ if (path[0] !== '/') {
98
+ path = '/' + path;
99
+ }
100
+ var newPath = pageNumber === 1 ? '' + path : path + '?page=' + pageNumber;
101
+
102
+ if (pageview) {
103
+ pageview(newPath);
104
+ }
105
+
106
+ router.push(pathname, newPath, {
107
+ shallow: true
108
+ });
109
+ }
110
+ }
111
+ };
112
+
113
+ var renderAuthor = function renderAuthor(authorDetail, index, length) {
114
+ if (authorDetail) {
115
+ var _id = authorDetail._id,
116
+ displayName = authorDetail.displayName,
117
+ url = authorDetail.url;
118
+
119
+ if (displayName && url && url.current) {
120
+ return React__default.createElement(
121
+ 'div',
122
+ { key: _id },
123
+ index === 0 && React__default.createElement(
124
+ 'span',
125
+ { className: 'pr-1' },
126
+ 'By'
127
+ ),
128
+ React__default.createElement(
129
+ 'a',
130
+ { href: '/authors/' + url.current, className: 'text-muted' },
131
+ displayName,
132
+ length !== index + 1 && React__default.createElement('br', null)
133
+ )
134
+ );
135
+ } else if (displayName) {
136
+ return React__default.createElement(
137
+ 'div',
138
+ { key: _id },
139
+ index === 0 && React__default.createElement(
140
+ 'span',
141
+ { className: 'pr-1' },
142
+ 'By'
143
+ ),
144
+ React__default.createElement(
145
+ 'span',
146
+ { className: 'text-muted' },
147
+ displayName,
148
+ length !== index + 1 && React__default.createElement('br', null)
149
+ )
150
+ );
151
+ }
152
+ } else return null;
153
+ };
154
+
155
+ var checkExternalUrl = function checkExternalUrl(url) {
156
+ return new RegExp(['http', 'https'].join('|')).test(url);
157
+ };
158
+
159
+ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth, rightItems) {
160
+ var numberOfItemsBeforeAd = 6;
161
+ return React__default.createElement(
162
+ 'div',
163
+ null,
164
+ data && data.map(function (article, index) {
165
+ var pageNumber = article.pageNumber || values.page;
166
+ var contentCategoryName = article.contentCategory ? article.contentCategory.name : 'Articles';
167
+
168
+ if (article._type === 'feature') {
169
+ if (article.blank || checkExternalUrl(article.url.current)) {
170
+ return React__default.createElement(
171
+ React__default.Fragment,
172
+ { key: article._id ? article._id : index },
173
+ React__default.createElement(
174
+ VisibilitySensor,
175
+ {
176
+ key: article._id ? article._id : index,
177
+ onChange: function onChange(isVisible) {
178
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage);
179
+ } },
180
+ React__default.createElement(
181
+ React__default.Fragment,
182
+ null,
183
+ React__default.createElement(
184
+ Media,
185
+ {
186
+ key: article._id ? article._id : index,
187
+ className: 'feature-media',
188
+ style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
189
+ (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
190
+ 'a',
191
+ { href: article.url.current, target: '_blank', className: 'feature-wrapper' },
192
+ React__default.createElement(
193
+ LazyLoad,
194
+ { height: imageHeight },
195
+ 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 })
196
+ )
197
+ ),
198
+ React__default.createElement(
199
+ Media.Body,
200
+ null,
201
+ React__default.createElement(
202
+ 'a',
203
+ { href: article.url.current, target: '_blank' },
204
+ article.title && React__default.createElement(
205
+ 'h4',
206
+ { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
207
+ article.title
208
+ )
209
+ ),
210
+ showPublished && article.published && React__default.createElement(
211
+ 'p',
212
+ { className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
213
+ moment(article.published).format('MMMM DD, YYYY')
214
+ ),
215
+ showAuthor && article.authorMapping && article.authorMapping.length > 0 && article.authorMapping.map(function (authorDetail, index) {
216
+ return renderAuthor(authorDetail, index, article.authorMapping.length);
217
+ }),
218
+ showCategory && article.contentCategory && React__default.createElement(
219
+ 'p',
220
+ {
221
+ style: {
222
+ background: '#3FB618',
223
+ color: '#ffffff',
224
+ marginBottom: '.25rem',
225
+ display: 'inline-block',
226
+ padding: '0 .25rem',
227
+ fontSize: '.8rem'
228
+ } },
229
+ article.contentCategory.name.slice(0, article.contentCategory.name.length - 1)
230
+ ),
231
+ article.summary && React__default.createElement(
232
+ 'p',
233
+ { className: 'pt-2 card-text' },
234
+ clean_html_1(article.summary)
235
+ )
236
+ )
237
+ )
238
+ )
239
+ ),
240
+ main_36 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index, numberOfItemsBeforeAd, rightItems)
241
+ );
242
+ } else {
243
+ return React__default.createElement(
244
+ React__default.Fragment,
245
+ { key: article._id ? article._id : index },
246
+ React__default.createElement(
247
+ VisibilitySensor,
248
+ {
249
+ key: article._id ? article._id : index,
250
+ onChange: function onChange(isVisible) {
251
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage);
252
+ } },
253
+ React__default.createElement(
254
+ React__default.Fragment,
255
+ null,
256
+ React__default.createElement(
257
+ Media,
258
+ {
259
+ key: article._id ? article._id : index,
260
+ className: 'feature-media',
261
+ style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
262
+ (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
263
+ 'a',
264
+ { href: article.url.current, className: 'feature-wrapper' },
265
+ React__default.createElement(
266
+ LazyLoad,
267
+ { height: imageHeight },
268
+ 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 })
269
+ )
270
+ ),
271
+ React__default.createElement(
272
+ Media.Body,
273
+ null,
274
+ React__default.createElement(
275
+ 'a',
276
+ { href: article.url.current },
277
+ article.title && React__default.createElement(
278
+ 'h4',
279
+ { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
280
+ article.title
281
+ )
282
+ ),
283
+ showPublished && article.published && React__default.createElement(
284
+ 'p',
285
+ { className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
286
+ moment(article.published).format('MMMM DD, YYYY')
287
+ ),
288
+ showAuthor && article.authorMapping && article.authorMapping.length > 0 && article.authorMapping.map(function (authorDetail, index) {
289
+ return renderAuthor(authorDetail, index, article.authorMapping.length);
290
+ }),
291
+ showCategory && article.contentCategory && React__default.createElement(
292
+ 'p',
293
+ {
294
+ style: {
295
+ background: '#3FB618',
296
+ color: '#ffffff',
297
+ marginBottom: '.25rem',
298
+ display: 'inline-block',
299
+ padding: '0 .25rem',
300
+ fontSize: '.8rem'
301
+ } },
302
+ article.contentCategory.name.slice(0, article.contentCategory.name.length - 1)
303
+ ),
304
+ article.summary && React__default.createElement(
305
+ 'p',
306
+ { className: 'pt-2 card-text' },
307
+ clean_html_1(article.summary)
308
+ )
309
+ )
310
+ )
311
+ )
312
+ ),
313
+ main_36 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index, numberOfItemsBeforeAd, rightItems)
314
+ );
315
+ }
316
+ }
317
+
318
+ return React__default.createElement(
319
+ React__default.Fragment,
320
+ { key: article._id ? article._id : index },
321
+ React__default.createElement(
322
+ VisibilitySensor,
323
+ {
324
+ key: article._id ? article._id : index,
325
+ onChange: function onChange(isVisible) {
326
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage);
327
+ } },
328
+ React__default.createElement(
329
+ React__default.Fragment,
330
+ null,
331
+ React__default.createElement(
332
+ Media,
333
+ {
334
+ key: article._id ? article._id : index,
335
+ style: { flexDirection: 'row', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
336
+ (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
337
+ 'a',
338
+ { href: mapping[contentCategoryName] + '/' + article.url.current, className: 'img-wrapper' },
339
+ React__default.createElement(
340
+ LazyLoad,
341
+ { height: imageHeight },
342
+ 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 })
343
+ )
344
+ ),
345
+ React__default.createElement(
346
+ Media.Body,
347
+ null,
348
+ React__default.createElement(
349
+ 'a',
350
+ { href: mapping[contentCategoryName] + '/' + article.url.current },
351
+ article.title && React__default.createElement(
352
+ 'h4',
353
+ { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
354
+ article.title
355
+ )
356
+ ),
357
+ showPublished && article.published && React__default.createElement(
358
+ 'p',
359
+ { className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
360
+ moment(article.published).format('MMMM DD, YYYY')
361
+ ),
362
+ showAuthor && article.authorMapping && article.authorMapping.length > 0 && article.authorMapping.map(function (authorDetail, index) {
363
+ return renderAuthor(authorDetail, index, article.authorMapping.length);
364
+ }),
365
+ showCategory && article.contentCategory && React__default.createElement(
366
+ 'p',
367
+ {
368
+ style: {
369
+ background: '#3FB618',
370
+ color: '#ffffff',
371
+ marginBottom: '.25rem',
372
+ display: 'inline-block',
373
+ padding: '0 .25rem',
374
+ fontSize: '.8rem'
375
+ } },
376
+ article.contentCategory.name.slice(0, article.contentCategory.name.length - 1)
377
+ ),
378
+ article.summary && React__default.createElement(
379
+ 'p',
380
+ { className: 'pt-2 card-text' },
381
+ clean_html_1(article.summary)
382
+ )
383
+ )
384
+ )
385
+ )
386
+ ),
387
+ main_36 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index, numberOfItemsBeforeAd, rightItems)
388
+ );
389
+ }),
390
+ React__default.createElement(
391
+ 'style',
392
+ { jsx: 'true' },
393
+ '\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 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;\n }\n }\n '
394
+ )
395
+ );
396
+ };
397
+
398
+ var renderMobileAd = function renderMobileAd(index, numberOfItemsBeforeAd, rightItems) {
399
+ var i = ((index + 1) / numberOfItemsBeforeAd - 1) % rightItems.length;
400
+ return React__default.createElement(
401
+ 'div',
402
+ { style: { display: 'flex', flex: '1 0 auto' } },
403
+ rightItems[i].component
404
+ );
405
+ };
406
+
407
+ var renderManualPagination = function renderManualPagination(currentPage) {
408
+ return React__default.createElement(
409
+ 'div',
410
+ { className: 'd-flex justify-content-between' },
411
+ currentPage && currentPage > 1 && React__default.createElement(
412
+ 'a',
413
+ { href: '?page=' + (currentPage - 1) },
414
+ '<< Previous'
415
+ ),
416
+ React__default.createElement(
417
+ 'a',
418
+ { href: '?page=' + (currentPage + 1) },
419
+ 'Next >>'
420
+ )
421
+ );
422
+ };
423
+
424
+ var usePrevious = function usePrevious(value) {
425
+ var ref = useRef();
426
+ useEffect(function () {
427
+ ref.current = value;
428
+ });
429
+ return ref.current;
430
+ };
431
+
432
+ var QueueDeckExpanded = function QueueDeckExpanded(props) {
433
+ var router = useRouter();
434
+ var initialData = props.dataRecord,
435
+ client = props.client,
436
+ params = props.params,
437
+ query = props.query,
438
+ autoScroll = props.autoScroll,
439
+ pointer = props.pointer,
440
+ pointerArray = props.pointerArray,
441
+ mapping = props.mapping,
442
+ seoPaginate = props.seoPaginate,
443
+ pageview = props.pageview,
444
+ defaultImage = props.defaultImage,
445
+ showAuthor = props.showAuthor,
446
+ showCategory = props.showCategory,
447
+ imageHeight = props.imageHeight,
448
+ imageWidth = props.imageWidth,
449
+ rightItems = props.rightItems;
450
+ var initialCurrentPage = props.currentPage,
451
+ showPublished = props.showPublished;
452
+
453
+ var builder = imageUrlBuilder(client);
454
+
455
+ var _useState = useState(initialData),
456
+ _useState2 = slicedToArray(_useState, 2),
457
+ data = _useState2[0],
458
+ setData = _useState2[1];
459
+
460
+ var _useState3 = useState(true),
461
+ _useState4 = slicedToArray(_useState3, 2),
462
+ scrolling = _useState4[0],
463
+ setScrolling = _useState4[1];
464
+
465
+ var _useState5 = useState(params ? params.to : 0),
466
+ _useState6 = slicedToArray(_useState5, 1),
467
+ per = _useState6[0];
468
+
469
+ var _useState7 = useState(initialCurrentPage || 1),
470
+ _useState8 = slicedToArray(_useState7, 2),
471
+ currentPage = _useState8[0],
472
+ setCurrentPage = _useState8[1];
473
+
474
+ var _useState9 = useState({
475
+ from: params ? params.from : 0,
476
+ to: params ? params.to : 0,
477
+ page: 1
478
+ }),
479
+ _useState10 = slicedToArray(_useState9, 2),
480
+ values = _useState10[0],
481
+ setValues = _useState10[1];
482
+
483
+ var prevValues = usePrevious(values);
484
+
485
+ useEffect(function () {
486
+ if (prevValues) {
487
+ if (values.page !== prevValues.page && values.from !== prevValues.from && values.to !== prevValues.from) {
488
+ loadData(values, query, client, params, setData, setScrolling, pointer, pointerArray);
489
+ }
490
+ }
491
+ }, [values, prevValues, query, client, params, setData, setScrolling, pointer, pointerArray]);
492
+
493
+ return React__default.createElement(
494
+ 'div',
495
+ null,
496
+ autoScroll ? React__default.createElement(
497
+ React__default.Fragment,
498
+ null,
499
+ React__default.createElement(
500
+ InfiniteScroll,
501
+ { dataLength: data && data.length, next: function next() {
502
+ return loadMore(values, setValues, per);
503
+ }, hasMore: scrolling, scrollThreshold: 0.9 },
504
+ React__default.createElement(
505
+ Container,
506
+ null,
507
+ cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth, rightItems)
508
+ )
509
+ ),
510
+ React__default.createElement(
511
+ 'noscript',
512
+ null,
513
+ renderManualPagination(currentPage)
514
+ )
515
+ ) : React__default.createElement(
516
+ React__default.Fragment,
517
+ null,
518
+ React__default.createElement(
519
+ Container,
520
+ null,
521
+ cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, rightItems)
522
+ ),
523
+ React__default.createElement(
524
+ 'div',
525
+ { style: { padding: '0px 10px' } },
526
+ scrolling ? React__default.createElement(
527
+ 'button',
528
+ {
529
+ style: { margin: 'auto', width: '100%' },
530
+ onClick: function onClick(e) {
531
+ loadMore(values, setValues, per);
532
+ } },
533
+ 'Load More'
534
+ ) : React__default.createElement(
535
+ 'p',
536
+ { style: { textAlign: 'center' } },
537
+ React__default.createElement(
538
+ 'b',
539
+ null,
540
+ 'End of data'
541
+ )
542
+ )
543
+ ),
544
+ React__default.createElement(
545
+ 'noscript',
546
+ null,
547
+ renderManualPagination(currentPage)
548
+ )
549
+ )
550
+ );
551
+ };
552
+
553
+ export default QueueDeckExpanded;