@mjhls/mjh-framework 1.0.771 → 1.0.772
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/MediaSeriesLanding.js +8 -5
- package/dist/cjs/SeriesListingDeck.js +102 -28
- package/dist/cjs/{SeriesSlider-8b500128.js → SeriesSlider-560c7162.js} +1 -1
- package/dist/cjs/View.js +23 -17
- package/dist/cjs/index.js +1 -1
- package/dist/esm/MediaSeriesLanding.js +8 -5
- package/dist/esm/SeriesListingDeck.js +102 -28
- package/dist/esm/{SeriesSlider-00ad2992.js → SeriesSlider-5279b68a.js} +1 -1
- package/dist/esm/View.js +23 -17
- package/dist/esm/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
# mjh-framework v. 1.0.
|
|
2
|
+
# mjh-framework v. 1.0.772
|
|
3
3
|
|
|
4
4
|
[](https://www.npmjs.com/package/mjh-framework) [](https://standardjs.com)
|
|
5
5
|
|
|
@@ -16,15 +16,18 @@ require('./_iter-detect-2613ffa1.js');
|
|
|
16
16
|
require('./_object-pie-68c5bcbc.js');
|
|
17
17
|
require('./toConsumableArray-cf0865fc.js');
|
|
18
18
|
require('./slicedToArray-db24842a.js');
|
|
19
|
-
require('
|
|
19
|
+
require('next/router');
|
|
20
|
+
require('./index-0e4427c8.js');
|
|
21
|
+
require('prop-types');
|
|
20
22
|
require('./index.es-f3e47207.js');
|
|
21
|
-
require('./SeriesSlider-
|
|
23
|
+
require('./SeriesSlider-560c7162.js');
|
|
22
24
|
require('./index-187c967e.js');
|
|
23
25
|
require('./index-80f57cff.js');
|
|
24
26
|
require('react-dom');
|
|
25
|
-
require('prop-types');
|
|
26
27
|
require('./smoothscroll-99df7f93.js');
|
|
28
|
+
require('./index-d48b231c.js');
|
|
27
29
|
require('./main-dc082238.js');
|
|
30
|
+
require('./visibility-sensor-8b54af99.js');
|
|
28
31
|
|
|
29
32
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
30
33
|
|
|
@@ -89,7 +92,7 @@ MediaSeriesLanding.getInitialData = function () {
|
|
|
89
92
|
to: start + itemsPerPage,
|
|
90
93
|
url: pathname
|
|
91
94
|
};
|
|
92
|
-
seriesQuery = '*[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\'][0]{\n _id,\n name,\n identifier,\n \'series\': *[_type == \'documentGroup\' && references(^._id) && isSeries != false][$from...$to]{\n _id,\n name,\n identifier,\n \'articles\': \n *[!(_id in path("drafts.**")) \n && _type == "article"\n && defined(title)\n && is_visible\n && defined(url)\n && references(^._id)\n && passwordLock != true\n && defined(published)\n && dateTime(published) <= dateTime(now())\n ] | order(published
|
|
95
|
+
seriesQuery = '*[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\'][0]{\n _id,\n name,\n identifier,\n \'series\': *[_type == \'documentGroup\' && references(^._id) && isSeries != false && isShow != false] | order(published desc) [$from...$to]{\n _id,\n name,\n identifier,\n \'articles\': \n *[!(_id in path("drafts.**")) \n && _type == "article"\n && defined(title)\n && is_visible\n && defined(url)\n && references(^._id)\n && passwordLock != true\n && defined(published)\n && dateTime(published) <= dateTime(now())\n ] | order(published asc) {\n ...,\n title,\n summary,\n thumbnail,\n url,\n published,\n authorMapping[0]->,\n taxonomyMapping[]->,\n contentCategory->,\n \'pageNumber\': ' + currentPage + '\n }\n\n }\n}';
|
|
93
96
|
_context.next = 9;
|
|
94
97
|
return client.fetch(seriesQuery, params);
|
|
95
98
|
|
|
@@ -97,7 +100,7 @@ MediaSeriesLanding.getInitialData = function () {
|
|
|
97
100
|
seriesData = _context.sent;
|
|
98
101
|
filterDropDownData = [];
|
|
99
102
|
_context.next = 13;
|
|
100
|
-
return client.fetch('*[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\'][0]{\n _id,\n name,\n identifier,\n \'series\': *[_type == \'documentGroup\' && references(^._id) && isSeries != false]{\n _id,\n name,\n identifier\n \n }\n }');
|
|
103
|
+
return client.fetch('*[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\'][0]{\n _id,\n name,\n identifier,\n \'series\': *[_type == \'documentGroup\' && references(^._id) && isSeries != false && isShow != false]{\n _id,\n name,\n identifier\n \n }\n }');
|
|
101
104
|
|
|
102
105
|
case 13:
|
|
103
106
|
allSeries = _context.sent;
|
|
@@ -4,9 +4,11 @@ var toConsumableArray = require('./toConsumableArray-cf0865fc.js');
|
|
|
4
4
|
var _extends = require('./extends-1e24fc8d.js');
|
|
5
5
|
var slicedToArray = require('./slicedToArray-db24842a.js');
|
|
6
6
|
var React = require('react');
|
|
7
|
-
require('
|
|
7
|
+
var Router = require('next/router');
|
|
8
|
+
var index = require('./index-0e4427c8.js');
|
|
8
9
|
var index_es = require('./index.es-f3e47207.js');
|
|
9
|
-
var SeriesSlider = require('./SeriesSlider-
|
|
10
|
+
var SeriesSlider = require('./SeriesSlider-560c7162.js');
|
|
11
|
+
var visibilitySensor = require('./visibility-sensor-8b54af99.js');
|
|
10
12
|
require('./_commonjsHelpers-06173234.js');
|
|
11
13
|
require('./es6.string.iterator-20d42c53.js');
|
|
12
14
|
require('./_to-object-821a2927.js');
|
|
@@ -14,11 +16,12 @@ require('./_iter-detect-2613ffa1.js');
|
|
|
14
16
|
require('./core.get-iterator-method-b4615fd3.js');
|
|
15
17
|
require('./_object-pie-68c5bcbc.js');
|
|
16
18
|
require('./web.dom.iterable-4480325a.js');
|
|
19
|
+
require('prop-types');
|
|
17
20
|
require('./index-187c967e.js');
|
|
18
21
|
require('./index-80f57cff.js');
|
|
19
22
|
require('react-dom');
|
|
20
|
-
require('prop-types');
|
|
21
23
|
require('./smoothscroll-99df7f93.js');
|
|
24
|
+
require('./index-d48b231c.js');
|
|
22
25
|
require('./main-dc082238.js');
|
|
23
26
|
|
|
24
27
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -34,14 +37,13 @@ var usePrevious = function usePrevious(value) {
|
|
|
34
37
|
};
|
|
35
38
|
|
|
36
39
|
var SeriesListingDeck = function SeriesListingDeck(props) {
|
|
37
|
-
var data = props.data
|
|
38
|
-
props.
|
|
39
|
-
props.imageWidth;
|
|
40
|
-
props.Website;
|
|
41
|
-
var client = props.client,
|
|
40
|
+
var data = props.data,
|
|
41
|
+
client = props.client,
|
|
42
42
|
query = props.query,
|
|
43
43
|
params = props.params,
|
|
44
|
-
parentIdentifier = props.identifier
|
|
44
|
+
parentIdentifier = props.identifier,
|
|
45
|
+
initialCurrentPage = props.currentPage,
|
|
46
|
+
pageview = props.pageview;
|
|
45
47
|
|
|
46
48
|
var _useState = React.useState(params ? params.count : 0),
|
|
47
49
|
_useState2 = slicedToArray._slicedToArray(_useState, 1),
|
|
@@ -57,17 +59,24 @@ var SeriesListingDeck = function SeriesListingDeck(props) {
|
|
|
57
59
|
seriesData = _useState6[0],
|
|
58
60
|
setSeriesData = _useState6[1];
|
|
59
61
|
|
|
60
|
-
var _useState7 = React.useState(
|
|
62
|
+
var _useState7 = React.useState(initialCurrentPage || 1),
|
|
63
|
+
_useState8 = slicedToArray._slicedToArray(_useState7, 2),
|
|
64
|
+
currentPage = _useState8[0],
|
|
65
|
+
setCurrentPage = _useState8[1];
|
|
66
|
+
|
|
67
|
+
var _useState9 = React.useState({
|
|
61
68
|
from: params ? params.from : 0,
|
|
62
69
|
to: params ? params.to : 0,
|
|
63
70
|
page: 1
|
|
64
71
|
}),
|
|
65
|
-
|
|
66
|
-
values =
|
|
67
|
-
setValues =
|
|
72
|
+
_useState10 = slicedToArray._slicedToArray(_useState9, 2),
|
|
73
|
+
values = _useState10[0],
|
|
74
|
+
setValues = _useState10[1];
|
|
68
75
|
|
|
69
76
|
var prevValues = usePrevious(values);
|
|
70
77
|
|
|
78
|
+
var router = Router.useRouter();
|
|
79
|
+
|
|
71
80
|
var loadMore = function loadMore() {
|
|
72
81
|
setValues({
|
|
73
82
|
page: values.page + 1,
|
|
@@ -76,6 +85,62 @@ var SeriesListingDeck = function SeriesListingDeck(props) {
|
|
|
76
85
|
});
|
|
77
86
|
};
|
|
78
87
|
|
|
88
|
+
var changePageNumber = function changePageNumber(pageNumber, arrIndex, pageview) {
|
|
89
|
+
if (pageNumber) {
|
|
90
|
+
var path = router.asPath;
|
|
91
|
+
var qrIndex = path.indexOf('?');
|
|
92
|
+
var pathname = router.pathname;
|
|
93
|
+
var queryString = '';
|
|
94
|
+
|
|
95
|
+
if (qrIndex > 0) {
|
|
96
|
+
path = path.substring(1, qrIndex);
|
|
97
|
+
|
|
98
|
+
var partialQS = router.asPath.substring(qrIndex + 1);
|
|
99
|
+
var partialQSArr = partialQS.split('&');
|
|
100
|
+
|
|
101
|
+
// exclude page=xxx from query string
|
|
102
|
+
partialQSArr.map(function (item) {
|
|
103
|
+
var itemArr = item.split('=');
|
|
104
|
+
var key = itemArr[0];
|
|
105
|
+
var val = itemArr[1];
|
|
106
|
+
|
|
107
|
+
if (key !== 'page') {
|
|
108
|
+
queryString += (queryString.length === 0 ? '' : '&') + key + '=' + val;
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (queryString.length > 0) {
|
|
114
|
+
path += '?' + queryString;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// pageNumber = parseInt(pageNumber)
|
|
118
|
+
var index$1 = Number(arrIndex);
|
|
119
|
+
var perPage = 6;
|
|
120
|
+
|
|
121
|
+
pageNumber = Math.ceil((index$1 + 1) / perPage);
|
|
122
|
+
|
|
123
|
+
if (currentPage !== pageNumber) {
|
|
124
|
+
index.lib_3.refresh();
|
|
125
|
+
|
|
126
|
+
setCurrentPage(pageNumber);
|
|
127
|
+
if (path[0] !== '/') {
|
|
128
|
+
path = '/' + path;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
var newPath = pageNumber === 1 ? '' + path : '' + path + (queryString.length > 0 ? '&' : '?') + 'page=' + pageNumber;
|
|
132
|
+
|
|
133
|
+
if (pageview) {
|
|
134
|
+
pageview(newPath);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
router.push(pathname, newPath, {
|
|
138
|
+
shallow: true
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
|
|
79
144
|
var loadData = function loadData(values, query, client, params, setSeriesData, setScrolling) {
|
|
80
145
|
params = _extends._extends({}, params, {
|
|
81
146
|
from: values.from,
|
|
@@ -134,25 +199,34 @@ var SeriesListingDeck = function SeriesListingDeck(props) {
|
|
|
134
199
|
seriesData && seriesData.length ? React__default['default'].createElement(
|
|
135
200
|
'div',
|
|
136
201
|
null,
|
|
137
|
-
seriesData.map(function (series) {
|
|
202
|
+
seriesData.map(function (series, index) {
|
|
138
203
|
return React__default['default'].createElement(
|
|
139
|
-
|
|
140
|
-
{
|
|
204
|
+
visibilitySensor.VisibilitySensor,
|
|
205
|
+
{
|
|
206
|
+
key: series._id ? series._id : index,
|
|
207
|
+
partialVisibility: true,
|
|
208
|
+
onChange: function onChange(isVisible) {
|
|
209
|
+
isVisible && changePageNumber(currentPage, index, pageview);
|
|
210
|
+
} },
|
|
141
211
|
React__default['default'].createElement(
|
|
142
212
|
'div',
|
|
143
|
-
{
|
|
213
|
+
{ className: 'mb-5', key: series.name },
|
|
144
214
|
React__default['default'].createElement(
|
|
145
|
-
'
|
|
146
|
-
{
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
215
|
+
'div',
|
|
216
|
+
{ style: { fontSize: '20px', fontWeight: 'bold', borderBottom: '1px solid #eee', margin: '0 .5rem', color: '373a3c' } },
|
|
217
|
+
React__default['default'].createElement(
|
|
218
|
+
'a',
|
|
219
|
+
{ href: '/' + parentIdentifier + '/' + series.identifier.current },
|
|
220
|
+
series.name
|
|
221
|
+
)
|
|
222
|
+
),
|
|
223
|
+
series.articles && series.articles.length == 0 && React__default['default'].createElement(
|
|
224
|
+
'p',
|
|
225
|
+
{ className: 'mt-2 ml-2' },
|
|
226
|
+
'Please check back for more content.'
|
|
227
|
+
),
|
|
228
|
+
series.articles && series.articles.length > 0 && React__default['default'].createElement(SeriesSlider.SeriesSlider, _extends._extends({}, props, { dataset: series.articles, client: client }))
|
|
229
|
+
)
|
|
156
230
|
);
|
|
157
231
|
})
|
|
158
232
|
) : React__default['default'].createElement(
|
package/dist/cjs/View.js
CHANGED
|
@@ -18,7 +18,7 @@ var Button = require('react-bootstrap/Button');
|
|
|
18
18
|
var getSerializers = require('./index-9475e5ae.js');
|
|
19
19
|
var SocialShare = require('./SocialShare.js');
|
|
20
20
|
var AdSlot = require('./AdSlot.js');
|
|
21
|
-
var SeriesSlider = require('./SeriesSlider-
|
|
21
|
+
var SeriesSlider = require('./SeriesSlider-560c7162.js');
|
|
22
22
|
var getTargeting = require('./getTargeting-497b581d.js');
|
|
23
23
|
var getKeywords = require('./getKeywords.js');
|
|
24
24
|
var urlFor = require('./urlFor.js');
|
|
@@ -726,9 +726,9 @@ var Article = function Article(props) {
|
|
|
726
726
|
slotId: (payload.contextualVideoAD.slotId || 'in-context_video') + '-' + payload._id
|
|
727
727
|
})
|
|
728
728
|
});
|
|
729
|
-
var
|
|
729
|
+
var selectedIndex = indexes[1] + 1;
|
|
730
730
|
if (seriesInfo.hasVideo) {
|
|
731
|
-
|
|
731
|
+
selectedIndex = seriesInfo.videoIndex;
|
|
732
732
|
}
|
|
733
733
|
|
|
734
734
|
var checkIsVideoAdFound = function checkIsVideoAdFound(isFound) {
|
|
@@ -747,7 +747,7 @@ var Article = function Article(props) {
|
|
|
747
747
|
null,
|
|
748
748
|
React__default['default'].createElement(BlockContent.BlockContent, _extends._extends({
|
|
749
749
|
serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting, article, meta, authorPrefix, authorImgHeight),
|
|
750
|
-
blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(0,
|
|
750
|
+
blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(0, selectedIndex))),
|
|
751
751
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
752
752
|
}, client.config())),
|
|
753
753
|
React__default['default'].createElement('span', { className: 'clearfix' }),
|
|
@@ -768,7 +768,7 @@ var Article = function Article(props) {
|
|
|
768
768
|
),
|
|
769
769
|
React__default['default'].createElement(BlockContent.BlockContent, _extends._extends({
|
|
770
770
|
serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, null, null, null, targeting, article, meta, authorPrefix, authorImgHeight),
|
|
771
|
-
blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(
|
|
771
|
+
blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(selectedIndex))),
|
|
772
772
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
773
773
|
}, client.config()))
|
|
774
774
|
);
|
|
@@ -787,9 +787,9 @@ var Article = function Article(props) {
|
|
|
787
787
|
}, { viewport: [0, 0], sizes: ['fluid', [300, 100]] }] : { viewport: [0, 0], sizes: ['fluid', [300, 100]] }
|
|
788
788
|
})
|
|
789
789
|
});
|
|
790
|
-
var
|
|
790
|
+
var _selectedIndex = indexes[1] + 1;
|
|
791
791
|
if (seriesInfo.hasVideo) {
|
|
792
|
-
|
|
792
|
+
_selectedIndex = seriesInfo.videoIndex;
|
|
793
793
|
}
|
|
794
794
|
|
|
795
795
|
return React__default['default'].createElement(
|
|
@@ -797,7 +797,7 @@ var Article = function Article(props) {
|
|
|
797
797
|
null,
|
|
798
798
|
React__default['default'].createElement(BlockContent.BlockContent, _extends._extends({
|
|
799
799
|
serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting, article, meta, authorPrefix, authorImgHeight),
|
|
800
|
-
blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(0,
|
|
800
|
+
blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(0, _selectedIndex))),
|
|
801
801
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
802
802
|
}, client.config())),
|
|
803
803
|
contextualADFlag && React__default['default'].createElement('span', { className: 'clearfix' }),
|
|
@@ -813,7 +813,7 @@ var Article = function Article(props) {
|
|
|
813
813
|
contextualADFlag && React__default['default'].createElement('span', { className: 'clearfix' }),
|
|
814
814
|
React__default['default'].createElement(BlockContent.BlockContent, _extends._extends({
|
|
815
815
|
serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, null, null, null, targeting, article, meta, authorPrefix, authorImgHeight),
|
|
816
|
-
blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(
|
|
816
|
+
blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(_selectedIndex))),
|
|
817
817
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
818
818
|
}, client.config()))
|
|
819
819
|
);
|
|
@@ -823,9 +823,9 @@ var Article = function Article(props) {
|
|
|
823
823
|
slotId: (payload.contextualVideoAD.slotId || 'in-context_video') + '-' + payload._id
|
|
824
824
|
})
|
|
825
825
|
});
|
|
826
|
-
var
|
|
826
|
+
var _selectedIndex2 = indexes[1] + 1;
|
|
827
827
|
if (seriesInfo.hasVideo) {
|
|
828
|
-
|
|
828
|
+
_selectedIndex2 = seriesInfo.videoIndex;
|
|
829
829
|
}
|
|
830
830
|
var _checkIsAdFound2 = function _checkIsAdFound2(isFound) {
|
|
831
831
|
if (!isFound) {
|
|
@@ -846,7 +846,7 @@ var Article = function Article(props) {
|
|
|
846
846
|
null,
|
|
847
847
|
React__default['default'].createElement(BlockContent.BlockContent, _extends._extends({
|
|
848
848
|
serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting, article, meta, authorPrefix, authorImgHeight),
|
|
849
|
-
blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(0,
|
|
849
|
+
blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(0, _selectedIndex2))),
|
|
850
850
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
851
851
|
}, client.config())),
|
|
852
852
|
React__default['default'].createElement('span', { className: 'clearfix' }),
|
|
@@ -858,23 +858,29 @@ var Article = function Article(props) {
|
|
|
858
858
|
),
|
|
859
859
|
React__default['default'].createElement(BlockContent.BlockContent, _extends._extends({
|
|
860
860
|
serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, null, null, null, targeting, article, meta, authorPrefix, authorImgHeight),
|
|
861
|
-
blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(
|
|
861
|
+
blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(_selectedIndex2))),
|
|
862
862
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
863
863
|
}, client.config()))
|
|
864
864
|
);
|
|
865
865
|
} else {
|
|
866
|
+
|
|
867
|
+
var _selectedIndex3 = indexes[1] + 1;
|
|
868
|
+
if (seriesInfo.hasVideo) {
|
|
869
|
+
_selectedIndex3 = seriesInfo.videoIndex;
|
|
870
|
+
}
|
|
871
|
+
|
|
866
872
|
return React__default['default'].createElement(
|
|
867
873
|
'div',
|
|
868
874
|
null,
|
|
869
875
|
React__default['default'].createElement(BlockContent.BlockContent, _extends._extends({
|
|
870
876
|
serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, false, null, props.article.Ads, targeting, article, meta, authorPrefix, authorImgHeight),
|
|
871
|
-
blocks: article.documentGroup && article.documentGroup.isSeries ? [].concat(toConsumableArray._toConsumableArray(articleBody.slice(
|
|
877
|
+
blocks: article.documentGroup && article.documentGroup.isSeries ? [].concat(toConsumableArray._toConsumableArray(articleBody.slice(0, _selectedIndex3))) : articleBody,
|
|
872
878
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
873
879
|
}, client.config())),
|
|
874
880
|
article.documentGroup && article.documentGroup.isSeries && props.sliderData && seriesInfo.hasVideo && React__default['default'].createElement(SeriesSlider.SeriesSlider, { dataset: props.sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: true }),
|
|
875
881
|
article.documentGroup && article.documentGroup.isSeries && React__default['default'].createElement(BlockContent.BlockContent, _extends._extends({
|
|
876
882
|
serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, null, null, null, targeting, article, meta, authorPrefix, authorImgHeight),
|
|
877
|
-
blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(
|
|
883
|
+
blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(_selectedIndex3))),
|
|
878
884
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
879
885
|
}, client.config()))
|
|
880
886
|
);
|
|
@@ -946,7 +952,7 @@ var Article = function Article(props) {
|
|
|
946
952
|
var episode = null;
|
|
947
953
|
sliderData.forEach(function (seriesArticle, index) {
|
|
948
954
|
if (seriesArticle.title === article.title) {
|
|
949
|
-
episode =
|
|
955
|
+
episode = index + 1;
|
|
950
956
|
}
|
|
951
957
|
});
|
|
952
958
|
return episode;
|
|
@@ -1726,7 +1732,7 @@ View.returnGetInitialProps = function () {
|
|
|
1726
1732
|
}
|
|
1727
1733
|
|
|
1728
1734
|
_context.next = 11;
|
|
1729
|
-
return client.fetch('*[!(_id in path("drafts.**")) \n && _type == "article"\n && defined(title)\n && references(\'' + article.documentGroup._id + '\')\n && defined(published)\n && dateTime(published) <= dateTime(now())\n ] | order(published
|
|
1735
|
+
return client.fetch('*[!(_id in path("drafts.**")) \n && _type == "article"\n && defined(title)\n && references(\'' + article.documentGroup._id + '\')\n && is_visible == true\n && passwordLock != true\n && defined(published)\n && dateTime(published) <= dateTime(now())\n ] | order(published asc) {\n title,\n thumbnail,\n url,\n published\n }');
|
|
1730
1736
|
|
|
1731
1737
|
case 11:
|
|
1732
1738
|
sliderArticles = _context.sent;
|
package/dist/cjs/index.js
CHANGED
|
@@ -185,7 +185,7 @@ require('./index-bd6c9f56.js');
|
|
|
185
185
|
require('swr');
|
|
186
186
|
require('passport-local');
|
|
187
187
|
require('mysql');
|
|
188
|
-
require('./SeriesSlider-
|
|
188
|
+
require('./SeriesSlider-560c7162.js');
|
|
189
189
|
require('./style-inject.es-dcee06b6.js');
|
|
190
190
|
require('disqus-react');
|
|
191
191
|
require('react-twitter-embed');
|
|
@@ -14,15 +14,18 @@ import './_iter-detect-48516cd3.js';
|
|
|
14
14
|
import './_object-pie-33c40e79.js';
|
|
15
15
|
import './toConsumableArray-fa2dcda7.js';
|
|
16
16
|
import './slicedToArray-cdeaee08.js';
|
|
17
|
-
import '
|
|
17
|
+
import 'next/router';
|
|
18
|
+
import './index-888f9253.js';
|
|
19
|
+
import 'prop-types';
|
|
18
20
|
import './index.es-c6222053.js';
|
|
19
|
-
import './SeriesSlider-
|
|
21
|
+
import './SeriesSlider-5279b68a.js';
|
|
20
22
|
import './index-c7e2ac95.js';
|
|
21
23
|
import './index-752d1dae.js';
|
|
22
24
|
import 'react-dom';
|
|
23
|
-
import 'prop-types';
|
|
24
25
|
import './smoothscroll-fa4e3f8c.js';
|
|
26
|
+
import './index-3f5c03b2.js';
|
|
25
27
|
import './main-1450d277.js';
|
|
28
|
+
import './visibility-sensor-082c757b.js';
|
|
26
29
|
|
|
27
30
|
var _this = undefined;
|
|
28
31
|
|
|
@@ -82,7 +85,7 @@ MediaSeriesLanding.getInitialData = function () {
|
|
|
82
85
|
to: start + itemsPerPage,
|
|
83
86
|
url: pathname
|
|
84
87
|
};
|
|
85
|
-
seriesQuery = '*[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\'][0]{\n _id,\n name,\n identifier,\n \'series\': *[_type == \'documentGroup\' && references(^._id) && isSeries != false][$from...$to]{\n _id,\n name,\n identifier,\n \'articles\': \n *[!(_id in path("drafts.**")) \n && _type == "article"\n && defined(title)\n && is_visible\n && defined(url)\n && references(^._id)\n && passwordLock != true\n && defined(published)\n && dateTime(published) <= dateTime(now())\n ] | order(published
|
|
88
|
+
seriesQuery = '*[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\'][0]{\n _id,\n name,\n identifier,\n \'series\': *[_type == \'documentGroup\' && references(^._id) && isSeries != false && isShow != false] | order(published desc) [$from...$to]{\n _id,\n name,\n identifier,\n \'articles\': \n *[!(_id in path("drafts.**")) \n && _type == "article"\n && defined(title)\n && is_visible\n && defined(url)\n && references(^._id)\n && passwordLock != true\n && defined(published)\n && dateTime(published) <= dateTime(now())\n ] | order(published asc) {\n ...,\n title,\n summary,\n thumbnail,\n url,\n published,\n authorMapping[0]->,\n taxonomyMapping[]->,\n contentCategory->,\n \'pageNumber\': ' + currentPage + '\n }\n\n }\n}';
|
|
86
89
|
_context.next = 9;
|
|
87
90
|
return client.fetch(seriesQuery, params);
|
|
88
91
|
|
|
@@ -90,7 +93,7 @@ MediaSeriesLanding.getInitialData = function () {
|
|
|
90
93
|
seriesData = _context.sent;
|
|
91
94
|
filterDropDownData = [];
|
|
92
95
|
_context.next = 13;
|
|
93
|
-
return client.fetch('*[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\'][0]{\n _id,\n name,\n identifier,\n \'series\': *[_type == \'documentGroup\' && references(^._id) && isSeries != false]{\n _id,\n name,\n identifier\n \n }\n }');
|
|
96
|
+
return client.fetch('*[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\'][0]{\n _id,\n name,\n identifier,\n \'series\': *[_type == \'documentGroup\' && references(^._id) && isSeries != false && isShow != false]{\n _id,\n name,\n identifier\n \n }\n }');
|
|
94
97
|
|
|
95
98
|
case 13:
|
|
96
99
|
allSeries = _context.sent;
|
|
@@ -2,9 +2,11 @@ import { _ as _toConsumableArray } from './toConsumableArray-fa2dcda7.js';
|
|
|
2
2
|
import { _ as _extends } from './extends-31d65aba.js';
|
|
3
3
|
import { _ as _slicedToArray } from './slicedToArray-cdeaee08.js';
|
|
4
4
|
import React, { useState, useEffect, useRef } from 'react';
|
|
5
|
-
import '
|
|
5
|
+
import { useRouter } from 'next/router';
|
|
6
|
+
import { l as lib_3 } from './index-888f9253.js';
|
|
6
7
|
import { I as InfiniteScroll } from './index.es-c6222053.js';
|
|
7
|
-
import { S as SeriesSlider } from './SeriesSlider-
|
|
8
|
+
import { S as SeriesSlider } from './SeriesSlider-5279b68a.js';
|
|
9
|
+
import { V as VisibilitySensor } from './visibility-sensor-082c757b.js';
|
|
8
10
|
import './_commonjsHelpers-0c4b6f40.js';
|
|
9
11
|
import './es6.string.iterator-aa6068a3.js';
|
|
10
12
|
import './_to-object-97770c52.js';
|
|
@@ -12,11 +14,12 @@ import './_iter-detect-48516cd3.js';
|
|
|
12
14
|
import './core.get-iterator-method-d1d5ed02.js';
|
|
13
15
|
import './_object-pie-33c40e79.js';
|
|
14
16
|
import './web.dom.iterable-035980f3.js';
|
|
17
|
+
import 'prop-types';
|
|
15
18
|
import './index-c7e2ac95.js';
|
|
16
19
|
import './index-752d1dae.js';
|
|
17
20
|
import 'react-dom';
|
|
18
|
-
import 'prop-types';
|
|
19
21
|
import './smoothscroll-fa4e3f8c.js';
|
|
22
|
+
import './index-3f5c03b2.js';
|
|
20
23
|
import './main-1450d277.js';
|
|
21
24
|
|
|
22
25
|
var usePrevious = function usePrevious(value) {
|
|
@@ -28,14 +31,13 @@ var usePrevious = function usePrevious(value) {
|
|
|
28
31
|
};
|
|
29
32
|
|
|
30
33
|
var SeriesListingDeck = function SeriesListingDeck(props) {
|
|
31
|
-
var data = props.data
|
|
32
|
-
props.
|
|
33
|
-
props.imageWidth;
|
|
34
|
-
props.Website;
|
|
35
|
-
var client = props.client,
|
|
34
|
+
var data = props.data,
|
|
35
|
+
client = props.client,
|
|
36
36
|
query = props.query,
|
|
37
37
|
params = props.params,
|
|
38
|
-
parentIdentifier = props.identifier
|
|
38
|
+
parentIdentifier = props.identifier,
|
|
39
|
+
initialCurrentPage = props.currentPage,
|
|
40
|
+
pageview = props.pageview;
|
|
39
41
|
|
|
40
42
|
var _useState = useState(params ? params.count : 0),
|
|
41
43
|
_useState2 = _slicedToArray(_useState, 1),
|
|
@@ -51,17 +53,24 @@ var SeriesListingDeck = function SeriesListingDeck(props) {
|
|
|
51
53
|
seriesData = _useState6[0],
|
|
52
54
|
setSeriesData = _useState6[1];
|
|
53
55
|
|
|
54
|
-
var _useState7 = useState(
|
|
56
|
+
var _useState7 = useState(initialCurrentPage || 1),
|
|
57
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
58
|
+
currentPage = _useState8[0],
|
|
59
|
+
setCurrentPage = _useState8[1];
|
|
60
|
+
|
|
61
|
+
var _useState9 = useState({
|
|
55
62
|
from: params ? params.from : 0,
|
|
56
63
|
to: params ? params.to : 0,
|
|
57
64
|
page: 1
|
|
58
65
|
}),
|
|
59
|
-
|
|
60
|
-
values =
|
|
61
|
-
setValues =
|
|
66
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
67
|
+
values = _useState10[0],
|
|
68
|
+
setValues = _useState10[1];
|
|
62
69
|
|
|
63
70
|
var prevValues = usePrevious(values);
|
|
64
71
|
|
|
72
|
+
var router = useRouter();
|
|
73
|
+
|
|
65
74
|
var loadMore = function loadMore() {
|
|
66
75
|
setValues({
|
|
67
76
|
page: values.page + 1,
|
|
@@ -70,6 +79,62 @@ var SeriesListingDeck = function SeriesListingDeck(props) {
|
|
|
70
79
|
});
|
|
71
80
|
};
|
|
72
81
|
|
|
82
|
+
var changePageNumber = function changePageNumber(pageNumber, arrIndex, pageview) {
|
|
83
|
+
if (pageNumber) {
|
|
84
|
+
var path = router.asPath;
|
|
85
|
+
var qrIndex = path.indexOf('?');
|
|
86
|
+
var pathname = router.pathname;
|
|
87
|
+
var queryString = '';
|
|
88
|
+
|
|
89
|
+
if (qrIndex > 0) {
|
|
90
|
+
path = path.substring(1, qrIndex);
|
|
91
|
+
|
|
92
|
+
var partialQS = router.asPath.substring(qrIndex + 1);
|
|
93
|
+
var partialQSArr = partialQS.split('&');
|
|
94
|
+
|
|
95
|
+
// exclude page=xxx from query string
|
|
96
|
+
partialQSArr.map(function (item) {
|
|
97
|
+
var itemArr = item.split('=');
|
|
98
|
+
var key = itemArr[0];
|
|
99
|
+
var val = itemArr[1];
|
|
100
|
+
|
|
101
|
+
if (key !== 'page') {
|
|
102
|
+
queryString += (queryString.length === 0 ? '' : '&') + key + '=' + val;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (queryString.length > 0) {
|
|
108
|
+
path += '?' + queryString;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// pageNumber = parseInt(pageNumber)
|
|
112
|
+
var index = Number(arrIndex);
|
|
113
|
+
var perPage = 6;
|
|
114
|
+
|
|
115
|
+
pageNumber = Math.ceil((index + 1) / perPage);
|
|
116
|
+
|
|
117
|
+
if (currentPage !== pageNumber) {
|
|
118
|
+
lib_3.refresh();
|
|
119
|
+
|
|
120
|
+
setCurrentPage(pageNumber);
|
|
121
|
+
if (path[0] !== '/') {
|
|
122
|
+
path = '/' + path;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
var newPath = pageNumber === 1 ? '' + path : '' + path + (queryString.length > 0 ? '&' : '?') + 'page=' + pageNumber;
|
|
126
|
+
|
|
127
|
+
if (pageview) {
|
|
128
|
+
pageview(newPath);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
router.push(pathname, newPath, {
|
|
132
|
+
shallow: true
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
|
|
73
138
|
var loadData = function loadData(values, query, client, params, setSeriesData, setScrolling) {
|
|
74
139
|
params = _extends({}, params, {
|
|
75
140
|
from: values.from,
|
|
@@ -128,25 +193,34 @@ var SeriesListingDeck = function SeriesListingDeck(props) {
|
|
|
128
193
|
seriesData && seriesData.length ? React.createElement(
|
|
129
194
|
'div',
|
|
130
195
|
null,
|
|
131
|
-
seriesData.map(function (series) {
|
|
196
|
+
seriesData.map(function (series, index) {
|
|
132
197
|
return React.createElement(
|
|
133
|
-
|
|
134
|
-
{
|
|
198
|
+
VisibilitySensor,
|
|
199
|
+
{
|
|
200
|
+
key: series._id ? series._id : index,
|
|
201
|
+
partialVisibility: true,
|
|
202
|
+
onChange: function onChange(isVisible) {
|
|
203
|
+
isVisible && changePageNumber(currentPage, index, pageview);
|
|
204
|
+
} },
|
|
135
205
|
React.createElement(
|
|
136
206
|
'div',
|
|
137
|
-
{
|
|
207
|
+
{ className: 'mb-5', key: series.name },
|
|
138
208
|
React.createElement(
|
|
139
|
-
'
|
|
140
|
-
{
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
209
|
+
'div',
|
|
210
|
+
{ style: { fontSize: '20px', fontWeight: 'bold', borderBottom: '1px solid #eee', margin: '0 .5rem', color: '373a3c' } },
|
|
211
|
+
React.createElement(
|
|
212
|
+
'a',
|
|
213
|
+
{ href: '/' + parentIdentifier + '/' + series.identifier.current },
|
|
214
|
+
series.name
|
|
215
|
+
)
|
|
216
|
+
),
|
|
217
|
+
series.articles && series.articles.length == 0 && React.createElement(
|
|
218
|
+
'p',
|
|
219
|
+
{ className: 'mt-2 ml-2' },
|
|
220
|
+
'Please check back for more content.'
|
|
221
|
+
),
|
|
222
|
+
series.articles && series.articles.length > 0 && React.createElement(SeriesSlider, _extends({}, props, { dataset: series.articles, client: client }))
|
|
223
|
+
)
|
|
150
224
|
);
|
|
151
225
|
})
|
|
152
226
|
) : React.createElement(
|
package/dist/esm/View.js
CHANGED
|
@@ -16,7 +16,7 @@ import Button from 'react-bootstrap/Button';
|
|
|
16
16
|
import { I as InscreenSensor, r as renderAuthor, g as getSerializers } from './index-da6ed052.js';
|
|
17
17
|
import SocialShare from './SocialShare.js';
|
|
18
18
|
import DFPAdSlot from './AdSlot.js';
|
|
19
|
-
import { S as SeriesSlider } from './SeriesSlider-
|
|
19
|
+
import { S as SeriesSlider } from './SeriesSlider-5279b68a.js';
|
|
20
20
|
import { g as getTargeting, a as getContentPlacementUrl } from './getTargeting-2d402d66.js';
|
|
21
21
|
import getKeywords from './getKeywords.js';
|
|
22
22
|
import urlFor from './urlFor.js';
|
|
@@ -716,9 +716,9 @@ var Article = function Article(props) {
|
|
|
716
716
|
slotId: (payload.contextualVideoAD.slotId || 'in-context_video') + '-' + payload._id
|
|
717
717
|
})
|
|
718
718
|
});
|
|
719
|
-
var
|
|
719
|
+
var selectedIndex = indexes[1] + 1;
|
|
720
720
|
if (seriesInfo.hasVideo) {
|
|
721
|
-
|
|
721
|
+
selectedIndex = seriesInfo.videoIndex;
|
|
722
722
|
}
|
|
723
723
|
|
|
724
724
|
var checkIsVideoAdFound = function checkIsVideoAdFound(isFound) {
|
|
@@ -737,7 +737,7 @@ var Article = function Article(props) {
|
|
|
737
737
|
null,
|
|
738
738
|
React.createElement(BlockContent, _extends({
|
|
739
739
|
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting, article, meta, authorPrefix, authorImgHeight),
|
|
740
|
-
blocks: [].concat(_toConsumableArray(articleBody.slice(0,
|
|
740
|
+
blocks: [].concat(_toConsumableArray(articleBody.slice(0, selectedIndex))),
|
|
741
741
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
742
742
|
}, client.config())),
|
|
743
743
|
React.createElement('span', { className: 'clearfix' }),
|
|
@@ -758,7 +758,7 @@ var Article = function Article(props) {
|
|
|
758
758
|
),
|
|
759
759
|
React.createElement(BlockContent, _extends({
|
|
760
760
|
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, null, null, null, targeting, article, meta, authorPrefix, authorImgHeight),
|
|
761
|
-
blocks: [].concat(_toConsumableArray(articleBody.slice(
|
|
761
|
+
blocks: [].concat(_toConsumableArray(articleBody.slice(selectedIndex))),
|
|
762
762
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
763
763
|
}, client.config()))
|
|
764
764
|
);
|
|
@@ -777,9 +777,9 @@ var Article = function Article(props) {
|
|
|
777
777
|
}, { viewport: [0, 0], sizes: ['fluid', [300, 100]] }] : { viewport: [0, 0], sizes: ['fluid', [300, 100]] }
|
|
778
778
|
})
|
|
779
779
|
});
|
|
780
|
-
var
|
|
780
|
+
var _selectedIndex = indexes[1] + 1;
|
|
781
781
|
if (seriesInfo.hasVideo) {
|
|
782
|
-
|
|
782
|
+
_selectedIndex = seriesInfo.videoIndex;
|
|
783
783
|
}
|
|
784
784
|
|
|
785
785
|
return React.createElement(
|
|
@@ -787,7 +787,7 @@ var Article = function Article(props) {
|
|
|
787
787
|
null,
|
|
788
788
|
React.createElement(BlockContent, _extends({
|
|
789
789
|
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting, article, meta, authorPrefix, authorImgHeight),
|
|
790
|
-
blocks: [].concat(_toConsumableArray(articleBody.slice(0,
|
|
790
|
+
blocks: [].concat(_toConsumableArray(articleBody.slice(0, _selectedIndex))),
|
|
791
791
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
792
792
|
}, client.config())),
|
|
793
793
|
contextualADFlag && React.createElement('span', { className: 'clearfix' }),
|
|
@@ -803,7 +803,7 @@ var Article = function Article(props) {
|
|
|
803
803
|
contextualADFlag && React.createElement('span', { className: 'clearfix' }),
|
|
804
804
|
React.createElement(BlockContent, _extends({
|
|
805
805
|
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, null, null, null, targeting, article, meta, authorPrefix, authorImgHeight),
|
|
806
|
-
blocks: [].concat(_toConsumableArray(articleBody.slice(
|
|
806
|
+
blocks: [].concat(_toConsumableArray(articleBody.slice(_selectedIndex))),
|
|
807
807
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
808
808
|
}, client.config()))
|
|
809
809
|
);
|
|
@@ -813,9 +813,9 @@ var Article = function Article(props) {
|
|
|
813
813
|
slotId: (payload.contextualVideoAD.slotId || 'in-context_video') + '-' + payload._id
|
|
814
814
|
})
|
|
815
815
|
});
|
|
816
|
-
var
|
|
816
|
+
var _selectedIndex2 = indexes[1] + 1;
|
|
817
817
|
if (seriesInfo.hasVideo) {
|
|
818
|
-
|
|
818
|
+
_selectedIndex2 = seriesInfo.videoIndex;
|
|
819
819
|
}
|
|
820
820
|
var _checkIsAdFound2 = function _checkIsAdFound2(isFound) {
|
|
821
821
|
if (!isFound) {
|
|
@@ -836,7 +836,7 @@ var Article = function Article(props) {
|
|
|
836
836
|
null,
|
|
837
837
|
React.createElement(BlockContent, _extends({
|
|
838
838
|
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag, null, null, targeting, article, meta, authorPrefix, authorImgHeight),
|
|
839
|
-
blocks: [].concat(_toConsumableArray(articleBody.slice(0,
|
|
839
|
+
blocks: [].concat(_toConsumableArray(articleBody.slice(0, _selectedIndex2))),
|
|
840
840
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
841
841
|
}, client.config())),
|
|
842
842
|
React.createElement('span', { className: 'clearfix' }),
|
|
@@ -848,23 +848,29 @@ var Article = function Article(props) {
|
|
|
848
848
|
),
|
|
849
849
|
React.createElement(BlockContent, _extends({
|
|
850
850
|
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, null, null, null, targeting, article, meta, authorPrefix, authorImgHeight),
|
|
851
|
-
blocks: [].concat(_toConsumableArray(articleBody.slice(
|
|
851
|
+
blocks: [].concat(_toConsumableArray(articleBody.slice(_selectedIndex2))),
|
|
852
852
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
853
853
|
}, client.config()))
|
|
854
854
|
);
|
|
855
855
|
} else {
|
|
856
|
+
|
|
857
|
+
var _selectedIndex3 = indexes[1] + 1;
|
|
858
|
+
if (seriesInfo.hasVideo) {
|
|
859
|
+
_selectedIndex3 = seriesInfo.videoIndex;
|
|
860
|
+
}
|
|
861
|
+
|
|
856
862
|
return React.createElement(
|
|
857
863
|
'div',
|
|
858
864
|
null,
|
|
859
865
|
React.createElement(BlockContent, _extends({
|
|
860
866
|
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, false, null, props.article.Ads, targeting, article, meta, authorPrefix, authorImgHeight),
|
|
861
|
-
blocks: article.documentGroup && article.documentGroup.isSeries ? [].concat(_toConsumableArray(articleBody.slice(
|
|
867
|
+
blocks: article.documentGroup && article.documentGroup.isSeries ? [].concat(_toConsumableArray(articleBody.slice(0, _selectedIndex3))) : articleBody,
|
|
862
868
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
863
869
|
}, client.config())),
|
|
864
870
|
article.documentGroup && article.documentGroup.isSeries && props.sliderData && seriesInfo.hasVideo && React.createElement(SeriesSlider, { dataset: props.sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: true }),
|
|
865
871
|
article.documentGroup && article.documentGroup.isSeries && React.createElement(BlockContent, _extends({
|
|
866
872
|
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, null, null, null, targeting, article, meta, authorPrefix, authorImgHeight),
|
|
867
|
-
blocks: [].concat(_toConsumableArray(articleBody.slice(
|
|
873
|
+
blocks: [].concat(_toConsumableArray(articleBody.slice(_selectedIndex3))),
|
|
868
874
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
869
875
|
}, client.config()))
|
|
870
876
|
);
|
|
@@ -936,7 +942,7 @@ var Article = function Article(props) {
|
|
|
936
942
|
var episode = null;
|
|
937
943
|
sliderData.forEach(function (seriesArticle, index) {
|
|
938
944
|
if (seriesArticle.title === article.title) {
|
|
939
|
-
episode =
|
|
945
|
+
episode = index + 1;
|
|
940
946
|
}
|
|
941
947
|
});
|
|
942
948
|
return episode;
|
|
@@ -1716,7 +1722,7 @@ View.returnGetInitialProps = function () {
|
|
|
1716
1722
|
}
|
|
1717
1723
|
|
|
1718
1724
|
_context.next = 11;
|
|
1719
|
-
return client.fetch('*[!(_id in path("drafts.**")) \n && _type == "article"\n && defined(title)\n && references(\'' + article.documentGroup._id + '\')\n && defined(published)\n && dateTime(published) <= dateTime(now())\n ] | order(published
|
|
1725
|
+
return client.fetch('*[!(_id in path("drafts.**")) \n && _type == "article"\n && defined(title)\n && references(\'' + article.documentGroup._id + '\')\n && is_visible == true\n && passwordLock != true\n && defined(published)\n && dateTime(published) <= dateTime(now())\n ] | order(published asc) {\n title,\n thumbnail,\n url,\n published\n }');
|
|
1720
1726
|
|
|
1721
1727
|
case 11:
|
|
1722
1728
|
sliderArticles = _context.sent;
|
package/dist/esm/index.js
CHANGED
|
@@ -181,7 +181,7 @@ import './index-db3bb315.js';
|
|
|
181
181
|
import 'swr';
|
|
182
182
|
import 'passport-local';
|
|
183
183
|
import 'mysql';
|
|
184
|
-
import './SeriesSlider-
|
|
184
|
+
import './SeriesSlider-5279b68a.js';
|
|
185
185
|
import './style-inject.es-1f59c1d0.js';
|
|
186
186
|
import 'disqus-react';
|
|
187
187
|
import 'react-twitter-embed';
|