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