@mjhls/mjh-framework 1.0.932 → 1.0.933
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/View.js +16 -11
- package/dist/cjs/getQuery.js +2 -2
- package/dist/esm/View.js +16 -11
- package/dist/esm/getQuery.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# mjh-framework v. 1.0.
|
|
1
|
+
# mjh-framework v. 1.0.933
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/mjh-framework) [](https://standardjs.com)
|
|
4
4
|
|
package/dist/cjs/View.js
CHANGED
|
@@ -564,20 +564,25 @@ var Article = React.forwardRef(function (props, ref) {
|
|
|
564
564
|
showDisqus = props.showDisqus,
|
|
565
565
|
_props$downloadCitati = props.downloadCitation,
|
|
566
566
|
downloadCitation = _props$downloadCitati === undefined ? false : _props$downloadCitati;
|
|
567
|
+
var sliderData = props.sliderData;
|
|
567
568
|
|
|
568
569
|
|
|
569
570
|
var targeting = getTargeting.getTargeting(props);
|
|
571
|
+
//remove slider data if toggled
|
|
572
|
+
if (article && article.documentGroup && article.documentGroup.hideSeriesSlider === true) {
|
|
573
|
+
sliderData = null;
|
|
574
|
+
}
|
|
570
575
|
//next video url
|
|
571
|
-
if (
|
|
576
|
+
if (sliderData) {
|
|
572
577
|
var nextArticle = void 0;
|
|
573
|
-
|
|
578
|
+
sliderData.forEach(function (data, index) {
|
|
574
579
|
if (data.url.current === props.article.url.current) {
|
|
575
580
|
nextArticle = index + 1;
|
|
576
581
|
}
|
|
577
582
|
});
|
|
578
583
|
|
|
579
|
-
if (nextArticle &&
|
|
580
|
-
article.nextVideo =
|
|
584
|
+
if (nextArticle && sliderData[nextArticle]) {
|
|
585
|
+
article.nextVideo = sliderData[nextArticle].url.current;
|
|
581
586
|
}
|
|
582
587
|
}
|
|
583
588
|
|
|
@@ -897,7 +902,7 @@ var Article = React.forwardRef(function (props, ref) {
|
|
|
897
902
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
898
903
|
}, client.config())),
|
|
899
904
|
React__default['default'].createElement('span', { className: 'clearfix' }),
|
|
900
|
-
article.documentGroup && article.documentGroup.isSeries &&
|
|
905
|
+
article.documentGroup && article.documentGroup.isSeries && sliderData && seriesInfo.hasVideo && React__default['default'].createElement(SeriesSlider.SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: true }),
|
|
901
906
|
React__default['default'].createElement(
|
|
902
907
|
'div',
|
|
903
908
|
{ id: 'contextual-native-ad-' + payload._id, className: 'contextual-native-ad' },
|
|
@@ -946,7 +951,7 @@ var Article = React.forwardRef(function (props, ref) {
|
|
|
946
951
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
947
952
|
}, client.config())),
|
|
948
953
|
contextualADFlag && React__default['default'].createElement('span', { className: 'clearfix' }),
|
|
949
|
-
article.documentGroup && article.documentGroup.isSeries &&
|
|
954
|
+
article.documentGroup && article.documentGroup.isSeries && sliderData && seriesInfo.hasVideo && React__default['default'].createElement(SeriesSlider.SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: true }),
|
|
950
955
|
(visibleFlag || queueData && queueData.length === 1 || !props.infiniteScroll) && React__default['default'].createElement(
|
|
951
956
|
'div',
|
|
952
957
|
{ id: 'contextual-native-ad-' + payload._id, className: 'contextual-native-ad' },
|
|
@@ -995,7 +1000,7 @@ var Article = React.forwardRef(function (props, ref) {
|
|
|
995
1000
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
996
1001
|
}, client.config())),
|
|
997
1002
|
React__default['default'].createElement('span', { className: 'clearfix' }),
|
|
998
|
-
article.documentGroup && article.documentGroup.isSeries &&
|
|
1003
|
+
article.documentGroup && article.documentGroup.isSeries && sliderData && seriesInfo.hasVideo && React__default['default'].createElement(SeriesSlider.SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: true }),
|
|
999
1004
|
React__default['default'].createElement(
|
|
1000
1005
|
'div',
|
|
1001
1006
|
{ id: 'contextual-video-ad-' + payload._id, className: 'contextual-video-ad' },
|
|
@@ -1021,7 +1026,7 @@ var Article = React.forwardRef(function (props, ref) {
|
|
|
1021
1026
|
blocks: article.documentGroup && article.documentGroup.isSeries ? [].concat(toConsumableArray._toConsumableArray(articleBody.slice(0, _selectedIndex3))) : articleBody,
|
|
1022
1027
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
1023
1028
|
}, client.config())),
|
|
1024
|
-
article.documentGroup && article.documentGroup.isSeries &&
|
|
1029
|
+
article.documentGroup && article.documentGroup.isSeries && sliderData && seriesInfo.hasVideo && React__default['default'].createElement(SeriesSlider.SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: true }),
|
|
1025
1030
|
article.documentGroup && article.documentGroup.isSeries && React__default['default'].createElement(BlockContent.BlockContent, _extends._extends({
|
|
1026
1031
|
serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, null, null, null, targeting, article, meta, authorPrefix, authorImgHeight),
|
|
1027
1032
|
blocks: [].concat(toConsumableArray._toConsumableArray(articleBody.slice(_selectedIndex3))),
|
|
@@ -1117,7 +1122,7 @@ var Article = React.forwardRef(function (props, ref) {
|
|
|
1117
1122
|
// pixels from bottom of window to change trigger visibility change
|
|
1118
1123
|
var triggerOffset = 20;
|
|
1119
1124
|
var isVideoSeries = checkIfVideoSeries(article);
|
|
1120
|
-
var episodeNumber = fetchCurrentEpisode(
|
|
1125
|
+
var episodeNumber = fetchCurrentEpisode(sliderData, props.article);
|
|
1121
1126
|
var isMediaSeries = article.documentGroup && article.documentGroup.isSeries ? true : false;
|
|
1122
1127
|
var seriesInfo = checkIfMediaSeriesHasVideo(article);
|
|
1123
1128
|
var isFormAssembly = checkIfFormAssembly(article);
|
|
@@ -1354,11 +1359,11 @@ var Article = React.forwardRef(function (props, ref) {
|
|
|
1354
1359
|
)
|
|
1355
1360
|
),
|
|
1356
1361
|
React__default['default'].createElement('div', { className: 'clearfix', style: { minHeight: '1px' } }),
|
|
1357
|
-
article.documentGroup && article.documentGroup.isSeries &&
|
|
1362
|
+
article.documentGroup && article.documentGroup.isSeries && sliderData && !seriesInfo.hasVideo && React__default['default'].createElement(
|
|
1358
1363
|
'div',
|
|
1359
1364
|
null,
|
|
1360
1365
|
false ,
|
|
1361
|
-
React__default['default'].createElement(SeriesSlider.SeriesSlider, { dataset:
|
|
1366
|
+
React__default['default'].createElement(SeriesSlider.SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: true })
|
|
1362
1367
|
),
|
|
1363
1368
|
showRelatedArticles && !showIsi && React__default['default'].createElement(RelatedContent, null),
|
|
1364
1369
|
disqusConfig && showDisqus && React__default['default'].createElement(
|
package/dist/cjs/getQuery.js
CHANGED
|
@@ -10,9 +10,9 @@ var getQuery = function getQuery(type) {
|
|
|
10
10
|
|
|
11
11
|
switch (type) {
|
|
12
12
|
case 'related':
|
|
13
|
-
return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && defined(published) \n && dateTime(published) <= dateTime(now())\n && passwordLock!=true\n && taxonomyMapping[]._ref in $taxonomy\n && taxonomyMapping[].disableAds != \'true\'\n && contentCategory->.name != \'Poll\'\n && contentCategory->.name != \'Slideshows\'\n && contentCategory->.disableAds != \'true\'\n && ExcludeFromInfiniteScroll !=true\n && url.current != $url\n && !defined(body[].videos)\n ' + conditions + '\n ]| order(published desc)[' + (articleCount ? articleCount : '$index') + ']{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n fieldAbstract,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n body[] {\n ...,\n asset->,\n images[]{\n ...,\n asset->\n },\n content[]{\n ...,\n asset->\n },\n videos[]{\n ...,\n thumbnail{\n _type,\n asset->\n }\n },\n response[]{\n ...,\n asset->\n },\n quizzes[]{\n ...,\n answer[]{\n ...,\n asset->\n },\n question[]{\n ...,\n asset->\n }\n },\n poster {\n _type,\n asset->\n },\n slides[]{\n ...,\n slideshowImage{\n ...,\n asset->\n }\n },\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'category\':contentCategory->{\n name,\n disableAds\n },\n \'content_placement\': taxonomyMapping[]-> {\n _id,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n disableAds,\n showSocialShare\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n \'path\': identifier.current,\n show_download_ris_button,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current,\n show_download_ris_button,\n },\n \'url\' : pdf.asset-> url,\n \'pdf\': pdf.asset->,\n isbn_issn,\n abbreviatedJournal,\n }\n }';
|
|
13
|
+
return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && defined(published) \n && dateTime(published) <= dateTime(now())\n && passwordLock!=true\n && taxonomyMapping[]._ref in $taxonomy\n && taxonomyMapping[].disableAds != \'true\'\n && contentCategory->.name != \'Poll\'\n && contentCategory->.name != \'Slideshows\'\n && contentCategory->.disableAds != \'true\'\n && ExcludeFromInfiniteScroll !=true\n && url.current != $url\n && !defined(body[].videos)\n ' + conditions + '\n ]| order(published desc)[' + (articleCount ? articleCount : '$index') + ']{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n fieldAbstract,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n body[] {\n ...,\n asset->,\n images[]{\n ...,\n asset->\n },\n content[]{\n ...,\n asset->\n },\n videos[]{\n ...,\n thumbnail{\n _type,\n asset->\n }\n },\n response[]{\n ...,\n asset->\n },\n quizzes[]{\n ...,\n answer[]{\n ...,\n asset->\n },\n question[]{\n ...,\n asset->\n }\n },\n poster {\n _type,\n asset->\n },\n slides[]{\n ...,\n slideshowImage{\n ...,\n asset->\n }\n },\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'category\':contentCategory->{\n name,\n disableAds\n },\n \'content_placement\': taxonomyMapping[]-> {\n _id,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n disableAds,\n showSocialShare\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL,\n hideSeriesSlider\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL,\n hideSeriesSlider\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n \'path\': identifier.current,\n show_download_ris_button,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current,\n show_download_ris_button,\n },\n \'url\' : pdf.asset-> url,\n \'pdf\': pdf.asset->,\n isbn_issn,\n abbreviatedJournal,\n }\n }';
|
|
14
14
|
case 'article':
|
|
15
|
-
return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && is_visible != false\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n fieldAbstract,\n ...,\n passwordLock,\n password,\n issueGroup-> { _id, name, identifier, parent-> },\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n body[] {\n ...,\n asset->,\n images[]{\n ...,\n asset->\n },\n content[]{\n ...,\n asset->\n },\n videos[]{\n ...,\n thumbnail{\n _type,\n asset->\n }\n },\n response[]{\n ...,\n asset->\n },\n quizzes[]{\n ...,\n answer[]{\n ...,\n asset->\n },\n question[]{\n ...,\n asset->\n }\n },\n poster {\n _type,\n asset->\n },\n slides[]{\n ...,\n slideshowImage{\n ...,\n asset->\n }\n },\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n medias[]{\n ...,\n upload_doc {\n _type,\n asset-> \n },\n poster {\n _type,\n asset-> \n }\n },\n articles[]{\n ...,\n thumbnail{\n ...,\n asset-> \n },\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n text[]{\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n }\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n showSocialShare\n },\n documentGroup-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n isSeries,\n excludeRelatedContents,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n excludeRelatedContents,\n \'path\': identifier.current\n },\n \'category\':contentCategory->{\n name,\n disableAds\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n volume,\n year,\n \'issueNumber\': number,\n \'articleSource\': source,\n \'path\': identifier.current,\n show_download_ris_button,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current,\n show_download_ris_button,\n },\n \'url\' : pdf.asset-> url,\n \'pdf\': pdf.asset->,\n isbn_issn,\n abbreviatedJournal,\n }\n\n }';
|
|
15
|
+
return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && is_visible != false\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n fieldAbstract,\n ...,\n passwordLock,\n password,\n issueGroup-> { _id, name, identifier, parent-> },\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n body[] {\n ...,\n asset->,\n images[]{\n ...,\n asset->\n },\n content[]{\n ...,\n asset->\n },\n videos[]{\n ...,\n thumbnail{\n _type,\n asset->\n }\n },\n response[]{\n ...,\n asset->\n },\n quizzes[]{\n ...,\n answer[]{\n ...,\n asset->\n },\n question[]{\n ...,\n asset->\n }\n },\n poster {\n _type,\n asset->\n },\n slides[]{\n ...,\n slideshowImage{\n ...,\n asset->\n }\n },\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n medias[]{\n ...,\n upload_doc {\n _type,\n asset-> \n },\n poster {\n _type,\n asset-> \n }\n },\n articles[]{\n ...,\n thumbnail{\n ...,\n asset-> \n },\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n text[]{\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n }\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n showSocialShare\n },\n documentGroup-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n isSeries,\n excludeRelatedContents,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL,\n hideSeriesSlider\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n excludeRelatedContents,\n \'path\': identifier.current,\n hideSeriesSlider\n },\n \'category\':contentCategory->{\n name,\n disableAds\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n volume,\n year,\n \'issueNumber\': number,\n \'articleSource\': source,\n \'path\': identifier.current,\n show_download_ris_button,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current,\n show_download_ris_button,\n },\n \'url\' : pdf.asset-> url,\n \'pdf\': pdf.asset->,\n isbn_issn,\n abbreviatedJournal,\n }\n\n }';
|
|
16
16
|
case 'publication':
|
|
17
17
|
return '*[_type == \'publication\'\n && identifier.current == $publication\n ' + conditions + '][0] {\n ' + params + '\n ...,\n \'issues\': *[_type == \'publication\'\n && is_visible\n && references(^._id)\n && defined(identifier)] {\n ...,\n thumbnail{ ..., asset-> },\n taxonomyMapping[]->,\n pdf{asset->},\n } | order(year desc, month desc)\n }';
|
|
18
18
|
case 'issue':
|
package/dist/esm/View.js
CHANGED
|
@@ -553,20 +553,25 @@ var Article = forwardRef(function (props, ref) {
|
|
|
553
553
|
showDisqus = props.showDisqus,
|
|
554
554
|
_props$downloadCitati = props.downloadCitation,
|
|
555
555
|
downloadCitation = _props$downloadCitati === undefined ? false : _props$downloadCitati;
|
|
556
|
+
var sliderData = props.sliderData;
|
|
556
557
|
|
|
557
558
|
|
|
558
559
|
var targeting = getTargeting(props);
|
|
560
|
+
//remove slider data if toggled
|
|
561
|
+
if (article && article.documentGroup && article.documentGroup.hideSeriesSlider === true) {
|
|
562
|
+
sliderData = null;
|
|
563
|
+
}
|
|
559
564
|
//next video url
|
|
560
|
-
if (
|
|
565
|
+
if (sliderData) {
|
|
561
566
|
var nextArticle = void 0;
|
|
562
|
-
|
|
567
|
+
sliderData.forEach(function (data, index) {
|
|
563
568
|
if (data.url.current === props.article.url.current) {
|
|
564
569
|
nextArticle = index + 1;
|
|
565
570
|
}
|
|
566
571
|
});
|
|
567
572
|
|
|
568
|
-
if (nextArticle &&
|
|
569
|
-
article.nextVideo =
|
|
573
|
+
if (nextArticle && sliderData[nextArticle]) {
|
|
574
|
+
article.nextVideo = sliderData[nextArticle].url.current;
|
|
570
575
|
}
|
|
571
576
|
}
|
|
572
577
|
|
|
@@ -886,7 +891,7 @@ var Article = forwardRef(function (props, ref) {
|
|
|
886
891
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
887
892
|
}, client.config())),
|
|
888
893
|
React__default.createElement('span', { className: 'clearfix' }),
|
|
889
|
-
article.documentGroup && article.documentGroup.isSeries &&
|
|
894
|
+
article.documentGroup && article.documentGroup.isSeries && sliderData && seriesInfo.hasVideo && React__default.createElement(SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: true }),
|
|
890
895
|
React__default.createElement(
|
|
891
896
|
'div',
|
|
892
897
|
{ id: 'contextual-native-ad-' + payload._id, className: 'contextual-native-ad' },
|
|
@@ -935,7 +940,7 @@ var Article = forwardRef(function (props, ref) {
|
|
|
935
940
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
936
941
|
}, client.config())),
|
|
937
942
|
contextualADFlag && React__default.createElement('span', { className: 'clearfix' }),
|
|
938
|
-
article.documentGroup && article.documentGroup.isSeries &&
|
|
943
|
+
article.documentGroup && article.documentGroup.isSeries && sliderData && seriesInfo.hasVideo && React__default.createElement(SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: true }),
|
|
939
944
|
(visibleFlag || queueData && queueData.length === 1 || !props.infiniteScroll) && React__default.createElement(
|
|
940
945
|
'div',
|
|
941
946
|
{ id: 'contextual-native-ad-' + payload._id, className: 'contextual-native-ad' },
|
|
@@ -984,7 +989,7 @@ var Article = forwardRef(function (props, ref) {
|
|
|
984
989
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
985
990
|
}, client.config())),
|
|
986
991
|
React__default.createElement('span', { className: 'clearfix' }),
|
|
987
|
-
article.documentGroup && article.documentGroup.isSeries &&
|
|
992
|
+
article.documentGroup && article.documentGroup.isSeries && sliderData && seriesInfo.hasVideo && React__default.createElement(SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: true }),
|
|
988
993
|
React__default.createElement(
|
|
989
994
|
'div',
|
|
990
995
|
{ id: 'contextual-video-ad-' + payload._id, className: 'contextual-video-ad' },
|
|
@@ -1010,7 +1015,7 @@ var Article = forwardRef(function (props, ref) {
|
|
|
1010
1015
|
blocks: article.documentGroup && article.documentGroup.isSeries ? [].concat(_toConsumableArray(articleBody.slice(0, _selectedIndex3))) : articleBody,
|
|
1011
1016
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
1012
1017
|
}, client.config())),
|
|
1013
|
-
article.documentGroup && article.documentGroup.isSeries &&
|
|
1018
|
+
article.documentGroup && article.documentGroup.isSeries && sliderData && seriesInfo.hasVideo && React__default.createElement(SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: true }),
|
|
1014
1019
|
article.documentGroup && article.documentGroup.isSeries && React__default.createElement(BlockContent, _extends({
|
|
1015
1020
|
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, isMediaSeries, null, null, null, targeting, article, meta, authorPrefix, authorImgHeight),
|
|
1016
1021
|
blocks: [].concat(_toConsumableArray(articleBody.slice(_selectedIndex3))),
|
|
@@ -1106,7 +1111,7 @@ var Article = forwardRef(function (props, ref) {
|
|
|
1106
1111
|
// pixels from bottom of window to change trigger visibility change
|
|
1107
1112
|
var triggerOffset = 20;
|
|
1108
1113
|
var isVideoSeries = checkIfVideoSeries(article);
|
|
1109
|
-
var episodeNumber = fetchCurrentEpisode(
|
|
1114
|
+
var episodeNumber = fetchCurrentEpisode(sliderData, props.article);
|
|
1110
1115
|
var isMediaSeries = article.documentGroup && article.documentGroup.isSeries ? true : false;
|
|
1111
1116
|
var seriesInfo = checkIfMediaSeriesHasVideo(article);
|
|
1112
1117
|
var isFormAssembly = checkIfFormAssembly(article);
|
|
@@ -1343,11 +1348,11 @@ var Article = forwardRef(function (props, ref) {
|
|
|
1343
1348
|
)
|
|
1344
1349
|
),
|
|
1345
1350
|
React__default.createElement('div', { className: 'clearfix', style: { minHeight: '1px' } }),
|
|
1346
|
-
article.documentGroup && article.documentGroup.isSeries &&
|
|
1351
|
+
article.documentGroup && article.documentGroup.isSeries && sliderData && !seriesInfo.hasVideo && React__default.createElement(
|
|
1347
1352
|
'div',
|
|
1348
1353
|
null,
|
|
1349
1354
|
false ,
|
|
1350
|
-
React__default.createElement(SeriesSlider, { dataset:
|
|
1355
|
+
React__default.createElement(SeriesSlider, { dataset: sliderData, client: client, nowPlaying: article.title, displayEpisodeNumber: true })
|
|
1351
1356
|
),
|
|
1352
1357
|
showRelatedArticles && !showIsi && React__default.createElement(RelatedContent, null),
|
|
1353
1358
|
disqusConfig && showDisqus && React__default.createElement(
|
package/dist/esm/getQuery.js
CHANGED
|
@@ -8,9 +8,9 @@ var getQuery = function getQuery(type) {
|
|
|
8
8
|
|
|
9
9
|
switch (type) {
|
|
10
10
|
case 'related':
|
|
11
|
-
return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && defined(published) \n && dateTime(published) <= dateTime(now())\n && passwordLock!=true\n && taxonomyMapping[]._ref in $taxonomy\n && taxonomyMapping[].disableAds != \'true\'\n && contentCategory->.name != \'Poll\'\n && contentCategory->.name != \'Slideshows\'\n && contentCategory->.disableAds != \'true\'\n && ExcludeFromInfiniteScroll !=true\n && url.current != $url\n && !defined(body[].videos)\n ' + conditions + '\n ]| order(published desc)[' + (articleCount ? articleCount : '$index') + ']{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n fieldAbstract,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n body[] {\n ...,\n asset->,\n images[]{\n ...,\n asset->\n },\n content[]{\n ...,\n asset->\n },\n videos[]{\n ...,\n thumbnail{\n _type,\n asset->\n }\n },\n response[]{\n ...,\n asset->\n },\n quizzes[]{\n ...,\n answer[]{\n ...,\n asset->\n },\n question[]{\n ...,\n asset->\n }\n },\n poster {\n _type,\n asset->\n },\n slides[]{\n ...,\n slideshowImage{\n ...,\n asset->\n }\n },\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'category\':contentCategory->{\n name,\n disableAds\n },\n \'content_placement\': taxonomyMapping[]-> {\n _id,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n disableAds,\n showSocialShare\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n \'path\': identifier.current,\n show_download_ris_button,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current,\n show_download_ris_button,\n },\n \'url\' : pdf.asset-> url,\n \'pdf\': pdf.asset->,\n isbn_issn,\n abbreviatedJournal,\n }\n }';
|
|
11
|
+
return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && defined(published) \n && dateTime(published) <= dateTime(now())\n && passwordLock!=true\n && taxonomyMapping[]._ref in $taxonomy\n && taxonomyMapping[].disableAds != \'true\'\n && contentCategory->.name != \'Poll\'\n && contentCategory->.name != \'Slideshows\'\n && contentCategory->.disableAds != \'true\'\n && ExcludeFromInfiniteScroll !=true\n && url.current != $url\n && !defined(body[].videos)\n ' + conditions + '\n ]| order(published desc)[' + (articleCount ? articleCount : '$index') + ']{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n fieldAbstract,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n body[] {\n ...,\n asset->,\n images[]{\n ...,\n asset->\n },\n content[]{\n ...,\n asset->\n },\n videos[]{\n ...,\n thumbnail{\n _type,\n asset->\n }\n },\n response[]{\n ...,\n asset->\n },\n quizzes[]{\n ...,\n answer[]{\n ...,\n asset->\n },\n question[]{\n ...,\n asset->\n }\n },\n poster {\n _type,\n asset->\n },\n slides[]{\n ...,\n slideshowImage{\n ...,\n asset->\n }\n },\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'category\':contentCategory->{\n name,\n disableAds\n },\n \'content_placement\': taxonomyMapping[]-> {\n _id,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n disableAds,\n showSocialShare\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL,\n hideSeriesSlider\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL,\n hideSeriesSlider\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n \'path\': identifier.current,\n show_download_ris_button,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current,\n show_download_ris_button,\n },\n \'url\' : pdf.asset-> url,\n \'pdf\': pdf.asset->,\n isbn_issn,\n abbreviatedJournal,\n }\n }';
|
|
12
12
|
case 'article':
|
|
13
|
-
return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && is_visible != false\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n fieldAbstract,\n ...,\n passwordLock,\n password,\n issueGroup-> { _id, name, identifier, parent-> },\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n body[] {\n ...,\n asset->,\n images[]{\n ...,\n asset->\n },\n content[]{\n ...,\n asset->\n },\n videos[]{\n ...,\n thumbnail{\n _type,\n asset->\n }\n },\n response[]{\n ...,\n asset->\n },\n quizzes[]{\n ...,\n answer[]{\n ...,\n asset->\n },\n question[]{\n ...,\n asset->\n }\n },\n poster {\n _type,\n asset->\n },\n slides[]{\n ...,\n slideshowImage{\n ...,\n asset->\n }\n },\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n medias[]{\n ...,\n upload_doc {\n _type,\n asset-> \n },\n poster {\n _type,\n asset-> \n }\n },\n articles[]{\n ...,\n thumbnail{\n ...,\n asset-> \n },\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n text[]{\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n }\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n showSocialShare\n },\n documentGroup-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n isSeries,\n excludeRelatedContents,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n excludeRelatedContents,\n \'path\': identifier.current\n },\n \'category\':contentCategory->{\n name,\n disableAds\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n volume,\n year,\n \'issueNumber\': number,\n \'articleSource\': source,\n \'path\': identifier.current,\n show_download_ris_button,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current,\n show_download_ris_button,\n },\n \'url\' : pdf.asset-> url,\n \'pdf\': pdf.asset->,\n isbn_issn,\n abbreviatedJournal,\n }\n\n }';
|
|
13
|
+
return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && is_visible != false\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n fieldAbstract,\n ...,\n passwordLock,\n password,\n issueGroup-> { _id, name, identifier, parent-> },\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n body[] {\n ...,\n asset->,\n images[]{\n ...,\n asset->\n },\n content[]{\n ...,\n asset->\n },\n videos[]{\n ...,\n thumbnail{\n _type,\n asset->\n }\n },\n response[]{\n ...,\n asset->\n },\n quizzes[]{\n ...,\n answer[]{\n ...,\n asset->\n },\n question[]{\n ...,\n asset->\n }\n },\n poster {\n _type,\n asset->\n },\n slides[]{\n ...,\n slideshowImage{\n ...,\n asset->\n }\n },\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n medias[]{\n ...,\n upload_doc {\n _type,\n asset-> \n },\n poster {\n _type,\n asset-> \n }\n },\n articles[]{\n ...,\n thumbnail{\n ...,\n asset-> \n },\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n text[]{\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n }\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n showSocialShare\n },\n documentGroup-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n isSeries,\n excludeRelatedContents,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL,\n hideSeriesSlider\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n excludeRelatedContents,\n \'path\': identifier.current,\n hideSeriesSlider\n },\n \'category\':contentCategory->{\n name,\n disableAds\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n volume,\n year,\n \'issueNumber\': number,\n \'articleSource\': source,\n \'path\': identifier.current,\n show_download_ris_button,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current,\n show_download_ris_button,\n },\n \'url\' : pdf.asset-> url,\n \'pdf\': pdf.asset->,\n isbn_issn,\n abbreviatedJournal,\n }\n\n }';
|
|
14
14
|
case 'publication':
|
|
15
15
|
return '*[_type == \'publication\'\n && identifier.current == $publication\n ' + conditions + '][0] {\n ' + params + '\n ...,\n \'issues\': *[_type == \'publication\'\n && is_visible\n && references(^._id)\n && defined(identifier)] {\n ...,\n thumbnail{ ..., asset-> },\n taxonomyMapping[]->,\n pdf{asset->},\n } | order(year desc, month desc)\n }';
|
|
16
16
|
case 'issue':
|