@mjhls/mjh-framework 1.0.508 → 1.0.510
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/ArticleQueue.js +512 -9
- package/dist/cjs/InscreenSensor-3aec8492.js +361 -0
- package/dist/cjs/View.js +64 -62
- package/dist/cjs/getQuery.js +3 -3
- package/dist/cjs/getRelatedArticle.js +16 -12
- package/dist/cjs/index.js +3 -3
- package/dist/esm/AD.js +1 -1
- package/dist/esm/AD300x250.js +2 -2
- package/dist/esm/AD300x250x600.js +2 -2
- package/dist/esm/AD728x90.js +2 -2
- package/dist/esm/ADFloatingFooter.js +2 -2
- package/dist/esm/ADGutter.js +2 -2
- package/dist/esm/ADSponsoredResources.js +2 -2
- package/dist/esm/ADWebcast.js +2 -2
- package/dist/esm/ADWelcome.js +2 -2
- package/dist/esm/AdSlot.js +2 -2
- package/dist/esm/ArticleQueue.js +507 -4
- package/dist/esm/CMEDeck.js +2 -2
- package/dist/esm/Column2.js +3 -3
- package/dist/esm/Column3.js +4 -4
- package/dist/esm/DeckContent.js +3 -3
- package/dist/esm/DeckQueue.js +4 -4
- package/dist/esm/{Dfp-58cfc45a.js → Dfp-81a052c2.js} +2 -2
- package/dist/esm/ExternalResources.js +2 -2
- package/dist/esm/GridContent.js +6 -6
- package/dist/esm/InscreenSensor-280b2b10.js +352 -0
- package/dist/esm/IssueLanding.js +4 -4
- package/dist/esm/LeftNav.js +2 -2
- package/dist/esm/MasterDeck.js +4 -4
- package/dist/esm/PartnerDetailListing.js +4 -4
- package/dist/esm/QueueDeckExpanded.js +4 -4
- package/dist/esm/SideFooter.js +3 -3
- package/dist/esm/TemplateNormal.js +4 -4
- package/dist/esm/VideoSeriesListing.js +2 -2
- package/dist/esm/View.js +64 -62
- package/dist/esm/{_arrayMap-a8dd2b2c.js → _arrayMap-64cbe0e4.js} +2 -2
- package/dist/esm/{debounce-8cd9e09c.js → debounce-048d9cb6.js} +1 -1
- package/dist/esm/{get-ae817b75.js → get-0eb56363.js} +2 -2
- package/dist/esm/getQuery.js +3 -3
- package/dist/esm/getRelatedArticle.js +14 -10
- package/dist/esm/getSerializers.js +2 -2
- package/dist/esm/index.js +8 -8
- package/dist/esm/{isSymbol-c1b9be80.js → isSymbol-b7b7434f.js} +1 -1
- package/package.json +1 -1
- package/dist/cjs/InscreenSensor-f9989c04.js +0 -863
- package/dist/esm/InscreenSensor-67905ed5.js +0 -857
- /package/dist/esm/{ADInfeed-15266562.js → ADInfeed-cb0d3a09.js} +0 -0
- /package/dist/esm/{ADlgInfeed-64346b44.js → ADlgInfeed-353fb56a.js} +0 -0
package/dist/esm/View.js
CHANGED
|
@@ -17,8 +17,8 @@ import { l as lib_3 } from './index-3f4dd6f2.js';
|
|
|
17
17
|
import 'prop-types';
|
|
18
18
|
import { m as moment } from './moment-49ae13fa.js';
|
|
19
19
|
import 'next/router';
|
|
20
|
-
import './isSymbol-
|
|
21
|
-
import './debounce-
|
|
20
|
+
import './isSymbol-b7b7434f.js';
|
|
21
|
+
import './debounce-048d9cb6.js';
|
|
22
22
|
import { I as InfiniteScroll } from './index.es-29c1cef5.js';
|
|
23
23
|
import 'react-dom';
|
|
24
24
|
import './index-51a80699.js';
|
|
@@ -31,7 +31,6 @@ import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-037
|
|
|
31
31
|
import './_set-species-6f64f1c1.js';
|
|
32
32
|
import './beam-dd2b10c0.js';
|
|
33
33
|
import DFPAdSlot from './AdSlot.js';
|
|
34
|
-
import './_arrayMap-a8dd2b2c.js';
|
|
35
34
|
import { B as BlockContent } from './BlockContent-a614acdf.js';
|
|
36
35
|
import './smoothscroll-4b699764.js';
|
|
37
36
|
import './GroupDeck.js';
|
|
@@ -49,11 +48,11 @@ import Form from 'react-bootstrap/Form';
|
|
|
49
48
|
import FormControl from 'react-bootstrap/FormControl';
|
|
50
49
|
import { _ as _Object$keys } from './keys-04cdec91.js';
|
|
51
50
|
import Dropdown from 'react-bootstrap/Dropdown';
|
|
52
|
-
import { I as InscreenSensor
|
|
51
|
+
import { I as InscreenSensor } from './InscreenSensor-280b2b10.js';
|
|
53
52
|
import getKeywords from './getKeywords.js';
|
|
54
53
|
import getSeriesDetail from './getSeriesDetail.js';
|
|
55
54
|
import getQuery from './getQuery.js';
|
|
56
|
-
import {
|
|
55
|
+
import { g as getTargeting, a as getContentPlacementUrl } from './getTargeting-1f2c61e3.js';
|
|
57
56
|
import urlFor from './urlFor.js';
|
|
58
57
|
|
|
59
58
|
var renderAuthor = function renderAuthor(authorName, authorURL, index, length) {
|
|
@@ -288,7 +287,8 @@ var Article = function Article(props) {
|
|
|
288
287
|
lgContextAd = _props$lgContextAd === undefined ? false : _props$lgContextAd,
|
|
289
288
|
queueData = props.queueData,
|
|
290
289
|
_props$sponsoredFlag = props.sponsoredFlag,
|
|
291
|
-
sponsoredFlag = _props$sponsoredFlag === undefined ? false : _props$sponsoredFlag
|
|
290
|
+
sponsoredFlag = _props$sponsoredFlag === undefined ? false : _props$sponsoredFlag,
|
|
291
|
+
Ads = props.Ads;
|
|
292
292
|
var onChangeArticle = props.onChangeArticle;
|
|
293
293
|
|
|
294
294
|
//If sponsored flag, disable contextual ads
|
|
@@ -297,6 +297,13 @@ var Article = function Article(props) {
|
|
|
297
297
|
article.contextualVideoAD = false;
|
|
298
298
|
article.contextualAD = false;
|
|
299
299
|
}
|
|
300
|
+
//This was being done in ArticleQueue2 which wasnt effecting articles excluded from infinite scroll, moved inside article component
|
|
301
|
+
if (!sponsoredFlag && Ads.getVideoContextualAD) {
|
|
302
|
+
article.contextualVideoAD = Ads.getVideoContextualAD(getTargeting(props, 'in-context_video'));
|
|
303
|
+
}
|
|
304
|
+
if (!sponsoredFlag && Ads.getNativeContextualAD) {
|
|
305
|
+
article.contextualAD = Ads.getNativeContextualAD(getTargeting(props, 'native-ad'));
|
|
306
|
+
}
|
|
300
307
|
|
|
301
308
|
var _useState = useState(null),
|
|
302
309
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -430,7 +437,7 @@ var Article = function Article(props) {
|
|
|
430
437
|
if (indexes.length >= 2 && body.length > 3 && payload.contextualAD && payload.contextualVideoAD) {
|
|
431
438
|
payload = _extends({}, payload, {
|
|
432
439
|
contextualAD: _extends({}, payload.contextualAD, {
|
|
433
|
-
slotId: (payload.contextualAD.slotId || '
|
|
440
|
+
slotId: (payload.contextualAD.slotId || 'contextual_ad') + '-' + payload._id
|
|
434
441
|
}),
|
|
435
442
|
contextualVideoAD: _extends({}, payload.contextualVideoAD, {
|
|
436
443
|
slotId: (payload.contextualVideoAD.slotId || 'in-context_video') + '-' + payload._id
|
|
@@ -492,7 +499,8 @@ var Article = function Article(props) {
|
|
|
492
499
|
} else if (indexes.length >= 2 && body.length > 3 && payload.contextualAD && !payload.contextualVideoAD) {
|
|
493
500
|
payload = _extends({}, payload, {
|
|
494
501
|
contextualAD: _extends({}, payload.contextualAD, {
|
|
495
|
-
slotId: (payload.contextualAD.slotId || '
|
|
502
|
+
slotId: (payload.contextualAD.slotId || 'contextual_ad') + '-' + payload._id,
|
|
503
|
+
className: 'ADFluid',
|
|
496
504
|
// Fetching new contextual targeting based on the current active article.
|
|
497
505
|
targeting: getTargeting(props, 'native-ad'),
|
|
498
506
|
// Adding new ad size for large contextual ad for desktop screen width >= 1400
|
|
@@ -500,24 +508,37 @@ var Article = function Article(props) {
|
|
|
500
508
|
sizeMapping: lgContextAd ? [{
|
|
501
509
|
viewport: [1400, 0],
|
|
502
510
|
sizes: [[728, 90], 'fluid', [300, 100]]
|
|
503
|
-
}, { viewport: [0, 0], sizes: ['fluid', [300, 100]] }] : ['fluid', [300, 100]]
|
|
511
|
+
}, { viewport: [0, 0], sizes: ['fluid', [300, 100]] }] : { viewport: [0, 0], sizes: ['fluid', [300, 100]] }
|
|
504
512
|
})
|
|
505
513
|
});
|
|
506
514
|
var _selectedIndex = indexes[1] + 1;
|
|
507
515
|
|
|
508
|
-
var _checkIsAdFound = function _checkIsAdFound(isFound) {
|
|
509
|
-
var parent = document.getElementById('contextual-native-ad-' + payload._id);
|
|
516
|
+
var _checkIsAdFound = function _checkIsAdFound(isFound, adData) {
|
|
510
517
|
if (!isFound) {
|
|
518
|
+
var parent = document.getElementById('contextual-native-ad-' + payload._id);
|
|
511
519
|
parent.style.height = '0%';
|
|
512
520
|
parent.style.width = '0%';
|
|
513
521
|
parent.style.display = 'none';
|
|
514
522
|
setContextualADFlag(false);
|
|
515
523
|
} else {
|
|
516
|
-
|
|
524
|
+
var _parent = document.getElementById('contextual-native-ad-' + payload._id);
|
|
525
|
+
if (adData && adData.event && adData.event.size && _parent) {
|
|
526
|
+
// Adding fix for fluid contextual ad to avoid from collapsing when size is [0,0]
|
|
527
|
+
var fluidSizes = [[0, 0]];
|
|
528
|
+
var checkAdSize = function checkAdSize(size) {
|
|
529
|
+
return _JSON$stringify(size) === _JSON$stringify(adData.event.size);
|
|
530
|
+
};
|
|
531
|
+
if (!fluidSizes.some(checkAdSize)) {
|
|
532
|
+
_parent.style.width = adData.event.size[0] + 'px';
|
|
533
|
+
_parent.style.height = adData.event.size[1] + 'px';
|
|
534
|
+
}
|
|
535
|
+
_parent.style.margin = 'auto';
|
|
536
|
+
// Adding margin below to create a seperation from text.
|
|
537
|
+
_parent.style.marginBottom = '15px';
|
|
538
|
+
}
|
|
539
|
+
if (body[0]._type === 'figure' || body[1]._type === 'figure' || body[2]._type === 'figure' || body[3]._type === 'figure') {
|
|
517
540
|
setContextualADFlag(true);
|
|
518
541
|
}
|
|
519
|
-
// Adding margin below to create a seperation from text.
|
|
520
|
-
if (parent && parent.style) parent.style.marginBottom = '15px';
|
|
521
542
|
}
|
|
522
543
|
};
|
|
523
544
|
|
|
@@ -530,9 +551,7 @@ var Article = function Article(props) {
|
|
|
530
551
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
531
552
|
}, client.config())),
|
|
532
553
|
contextualADFlag && React__default.createElement('span', { className: 'clearfix' }),
|
|
533
|
-
(visibleFlag || queueData && queueData.length === 1) &&
|
|
534
|
-
// Adding margin below to create a seperation from text.
|
|
535
|
-
React__default.createElement(
|
|
554
|
+
(visibleFlag || queueData && queueData.length === 1 || !props.infiniteScroll) && React__default.createElement(
|
|
536
555
|
'div',
|
|
537
556
|
{ id: 'contextual-native-ad-' + payload._id, className: 'contextual-native-ad' },
|
|
538
557
|
React__default.createElement(DFPAdSlot, _extends({}, payload.contextualAD, { refreshFlag: false, checkIsAdFound: _checkIsAdFound }))
|
|
@@ -700,24 +719,20 @@ var Article = function Article(props) {
|
|
|
700
719
|
),
|
|
701
720
|
issue && React__default.createElement(
|
|
702
721
|
'div',
|
|
703
|
-
|
|
722
|
+
{ className: 'volume-issue' },
|
|
704
723
|
React__default.createElement(
|
|
705
|
-
'
|
|
706
|
-
|
|
707
|
-
React__default.createElement(
|
|
708
|
-
'
|
|
724
|
+
'p',
|
|
725
|
+
null,
|
|
726
|
+
issue.volume && React__default.createElement(
|
|
727
|
+
'span',
|
|
728
|
+
null,
|
|
729
|
+
'Volume ' + issue.volume,
|
|
730
|
+
','
|
|
731
|
+
),
|
|
732
|
+
issue.issueNumber && React__default.createElement(
|
|
733
|
+
'span',
|
|
709
734
|
null,
|
|
710
|
-
|
|
711
|
-
'span',
|
|
712
|
-
null,
|
|
713
|
-
'Volume ' + issue.volume,
|
|
714
|
-
','
|
|
715
|
-
),
|
|
716
|
-
issue.issueNumber && React__default.createElement(
|
|
717
|
-
'span',
|
|
718
|
-
null,
|
|
719
|
-
' Issue ' + issue.issueNumber
|
|
720
|
-
)
|
|
735
|
+
' Issue ' + issue.issueNumber
|
|
721
736
|
)
|
|
722
737
|
)
|
|
723
738
|
),
|
|
@@ -891,7 +906,6 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
891
906
|
_props$maxListLength = props.maxListLength,
|
|
892
907
|
maxListLength = _props$maxListLength === undefined ? 10 : _props$maxListLength,
|
|
893
908
|
_props$sponsoredTaxon = props.sponsoredTaxonomies,
|
|
894
|
-
sponsoredTaxonomies = _props$sponsoredTaxon === undefined ? [] : _props$sponsoredTaxon,
|
|
895
909
|
_props$cpModification = props.cpModificationRequired,
|
|
896
910
|
cpModificationRequired = _props$cpModification === undefined ? false : _props$cpModification,
|
|
897
911
|
_props$authorPrefix = props.authorPrefix,
|
|
@@ -957,19 +971,6 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
957
971
|
}
|
|
958
972
|
};
|
|
959
973
|
|
|
960
|
-
var checkSponseredArticle = function checkSponseredArticle(article) {
|
|
961
|
-
var _article$taxonomyMapp = article.taxonomyMapping,
|
|
962
|
-
taxonomyMapping = _article$taxonomyMapp === undefined ? [] : _article$taxonomyMapp;
|
|
963
|
-
|
|
964
|
-
if (props.checkSponsered) {
|
|
965
|
-
return taxonomyMapping.some(function (item) {
|
|
966
|
-
return includes_1(sponsoredTaxonomies, item._ref);
|
|
967
|
-
});
|
|
968
|
-
} else {
|
|
969
|
-
return false;
|
|
970
|
-
}
|
|
971
|
-
};
|
|
972
|
-
|
|
973
974
|
var preVscroll = 0;
|
|
974
975
|
var isScrollDown = true;
|
|
975
976
|
|
|
@@ -1001,9 +1002,11 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1001
1002
|
|
|
1002
1003
|
useEffect(function () {
|
|
1003
1004
|
// Fetching related article after component mounted if vertical scroll not found
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1005
|
+
setTimeout(function () {
|
|
1006
|
+
if (!hasVerticalScroll()) {
|
|
1007
|
+
loadmore();
|
|
1008
|
+
}
|
|
1009
|
+
}, 1000);
|
|
1007
1010
|
}, [queueData.length]);
|
|
1008
1011
|
|
|
1009
1012
|
var loadmore = function loadmore() {
|
|
@@ -1074,12 +1077,6 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1074
1077
|
InfiniteScroll,
|
|
1075
1078
|
{ dataLength: queueData.length, next: loadmore, scrollThreshold: '60%', hasMore: true, style: { overflow: 'hidden' } },
|
|
1076
1079
|
queueData.map(function (article, index) {
|
|
1077
|
-
if (!checkSponseredArticle(article) && Ads.getVideoContextualAD) {
|
|
1078
|
-
article.contextualVideoAD = Ads.getVideoContextualAD(getTargeting(props, 'in-context_video'));
|
|
1079
|
-
}
|
|
1080
|
-
if (!checkSponseredArticle(article) && Ads.getNativeContextualAD) {
|
|
1081
|
-
article.contextualAD = Ads.getNativeContextualAD(getTargeting(props, 'native-ad'));
|
|
1082
|
-
}
|
|
1083
1080
|
return React__default.createElement(Article, _extends({
|
|
1084
1081
|
key: index
|
|
1085
1082
|
}, props, {
|
|
@@ -1178,6 +1175,9 @@ var View = function View(props) {
|
|
|
1178
1175
|
//disable infinite scroll
|
|
1179
1176
|
|
|
1180
1177
|
var checkVideoSeries = function checkVideoSeries(article) {
|
|
1178
|
+
if (!article || !article.body) {
|
|
1179
|
+
return false;
|
|
1180
|
+
}
|
|
1181
1181
|
for (var i = 0; i < article.body.length; i++) {
|
|
1182
1182
|
var row = article.body[i];
|
|
1183
1183
|
if (typeof row.videos !== 'undefined') {
|
|
@@ -1235,7 +1235,7 @@ var View = function View(props) {
|
|
|
1235
1235
|
);
|
|
1236
1236
|
};
|
|
1237
1237
|
|
|
1238
|
-
//This should be called in /view/[url] getInitialProps to fetch the article data and related articles. This will also set the sponsoredFlag to true if any taxonomies have disabled ads.
|
|
1238
|
+
//This should be called in /view/[url] getInitialProps to fetch the article data and related articles. This will also set the sponsoredFlag to true if any taxonomies have disabled ads.
|
|
1239
1239
|
View.returnGetInitialProps = function () {
|
|
1240
1240
|
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(url, prevUrl, seriesVid, client, sao) {
|
|
1241
1241
|
var article, relatedArticleQuery, statusCode, sponsoredFlag;
|
|
@@ -1259,11 +1259,13 @@ View.returnGetInitialProps = function () {
|
|
|
1259
1259
|
sponsoredFlag = false;
|
|
1260
1260
|
//check for disableAds flag on each taxonomoy
|
|
1261
1261
|
|
|
1262
|
-
article.content_placement
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1262
|
+
if (article && article.content_placement) {
|
|
1263
|
+
article.content_placement.forEach(function (x) {
|
|
1264
|
+
if (x.disableAds) {
|
|
1265
|
+
sponsoredFlag = true;
|
|
1266
|
+
}
|
|
1267
|
+
});
|
|
1268
|
+
}
|
|
1267
1269
|
//check for disableAds flag on content category
|
|
1268
1270
|
if (article.category && article.category.disableAds) {
|
|
1269
1271
|
sponsoredFlag = true;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as isObject_1, _ as _baseGetTag } from './isSymbol-b7b7434f.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Checks if `value` is classified as an `Array` object.
|
|
@@ -84,4 +84,4 @@ function arrayMap(array, iteratee) {
|
|
|
84
84
|
|
|
85
85
|
var _arrayMap = arrayMap;
|
|
86
86
|
|
|
87
|
-
export { _arrayMap as _,
|
|
87
|
+
export { _arrayMap as _, isArray_1 as a, isFunction_1 as i };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { b as isSymbol_1, a as _root, c as isObject_1, d as _Symbol } from './isSymbol-b7b7434f.js';
|
|
2
|
+
import { a as isArray_1, i as isFunction_1, _ as _arrayMap } from './_arrayMap-64cbe0e4.js';
|
|
3
3
|
|
|
4
4
|
/** Used to match property names within property paths. */
|
|
5
5
|
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
|
package/dist/esm/getQuery.js
CHANGED
|
@@ -10,13 +10,13 @@ var getQuery = function getQuery(type) {
|
|
|
10
10
|
var today = moment().utc().format();
|
|
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 && published <= \'' + today + '\'\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)[$index]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n disableAds\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n }';
|
|
13
|
+
return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && published <= \'' + today + '\'\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)[$index]{\n ' + params + '\n title,\n published,\n \'showPublished\':select(contentCategory->name !=\'Webcasts\' => true,false),\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n disableAds\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n }';
|
|
14
14
|
case 'article':
|
|
15
|
-
return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\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 \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n\n }';
|
|
15
|
+
return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n \'showPublished\':select(contentCategory->name !=\'Webcasts\' => true,false),\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\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 \'issueNumber\': number,\n \'articleSource\': source,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\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 pdf{asset->}\n } | order(year desc, month desc)\n }';
|
|
18
18
|
case 'issue':
|
|
19
|
-
return '*[_type == \'publication\'\n && identifier.current == $publication\n ' + conditions + '][0] {\n ' + params + '\n ...,\n \'issue\': *[_type == \'publication\'\n && references(^._id)\n && identifier.current == $issue][0] {\n ...,\n \'articles\': *[_type == \'article\'\n && !(_id in path("drafts.**"))\n && defined(title)\n && is_visible\n && defined(url)\n &&
|
|
19
|
+
return '*[_type == \'publication\'\n && identifier.current == $publication\n ' + conditions + '][0] {\n ' + params + '\n ...,\n \'issue\': *[_type == \'publication\'\n && references(^._id)\n && identifier.current == $issue][0] {\n ...,\n \'articles\': *[_type == \'article\'\n && !(_id in path("drafts.**"))\n && defined(title)\n && is_visible\n && defined(url)\n && published <= $currentDate\n && references(^._id)] {\n ...,\n authorMapping[0]->,\n contentCategory->,\n issueSection-> {\n name\n }\n }\n }\n }';
|
|
20
20
|
case 'externalResources':
|
|
21
21
|
return '{\n \'archived\': *[_type == "external" && archived && isVisible ' + conditions + '] | order(displayDate desc),\n \'recent\': *[_type == "external" && archived != true && isVisible ' + conditions + '] | order(displayDate asc)\n }';
|
|
22
22
|
}
|
|
@@ -31,19 +31,23 @@ var getRelatedArticle = function () {
|
|
|
31
31
|
} : _article$url;
|
|
32
32
|
url = _article$url.current, content_placement = article.content_placement;
|
|
33
33
|
taxonomy = [];
|
|
34
|
+
//404 articles were throwing server error
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
if (content_placement) {
|
|
37
|
+
content_placement.forEach(function (_ref3) {
|
|
38
|
+
var path = _ref3.path,
|
|
39
|
+
_id = _ref3._id;
|
|
38
40
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
var prev_url_to_check = prevUrl;
|
|
42
|
+
if (prev_url_to_check.includes('?')) {
|
|
43
|
+
prev_url_to_check = prev_url_to_check.split('?')[0];
|
|
44
|
+
}
|
|
45
|
+
if (prev_url_to_check.endsWith(path)) taxonomy.push(_id);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
45
48
|
|
|
46
|
-
|
|
49
|
+
//404 articles were throwing server error
|
|
50
|
+
if (taxonomy.length === 0 && taxonomyMapping) {
|
|
47
51
|
taxonomy = taxonomyMapping.map(function (_ref4) {
|
|
48
52
|
var _ref = _ref4._ref;
|
|
49
53
|
return _ref;
|
|
@@ -13,8 +13,8 @@ import React__default, { useState, useEffect } from 'react';
|
|
|
13
13
|
import { l as lib_3 } from './index-3f4dd6f2.js';
|
|
14
14
|
import PropTypes from 'prop-types';
|
|
15
15
|
import Router, { useRouter } from 'next/router';
|
|
16
|
-
import './isSymbol-
|
|
17
|
-
import './debounce-
|
|
16
|
+
import './isSymbol-b7b7434f.js';
|
|
17
|
+
import './debounce-048d9cb6.js';
|
|
18
18
|
import 'react-dom';
|
|
19
19
|
import { i as imageUrlBuilder } from './index-51a80699.js';
|
|
20
20
|
import { L as LazyLoad } from './index-5f9f807a.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -21,8 +21,8 @@ import 'react-bootstrap/Col';
|
|
|
21
21
|
import 'react-bootstrap/Card';
|
|
22
22
|
import './moment-49ae13fa.js';
|
|
23
23
|
import 'next/router';
|
|
24
|
-
import './isSymbol-
|
|
25
|
-
import './debounce-
|
|
24
|
+
import './isSymbol-b7b7434f.js';
|
|
25
|
+
import './debounce-048d9cb6.js';
|
|
26
26
|
import './index.es-29c1cef5.js';
|
|
27
27
|
import 'react-dom';
|
|
28
28
|
import './visibility-sensor-0baa4eea.js';
|
|
@@ -36,12 +36,12 @@ import './asyncToGenerator-0379e924.js';
|
|
|
36
36
|
import './_set-species-6f64f1c1.js';
|
|
37
37
|
export { B as Beam, S as Segment } from './beam-dd2b10c0.js';
|
|
38
38
|
export { default as AdSlot } from './AdSlot.js';
|
|
39
|
-
import './ADInfeed-
|
|
39
|
+
import './ADInfeed-cb0d3a09.js';
|
|
40
40
|
export { default as DeckContent } from './DeckContent.js';
|
|
41
41
|
import './lodash-17fdfebb.js';
|
|
42
|
-
import './ADlgInfeed-
|
|
43
|
-
import './_arrayMap-
|
|
44
|
-
import './get-
|
|
42
|
+
import './ADlgInfeed-353fb56a.js';
|
|
43
|
+
import './_arrayMap-64cbe0e4.js';
|
|
44
|
+
import './get-0eb56363.js';
|
|
45
45
|
export { default as AD } from './AD.js';
|
|
46
46
|
import './AuthorComponent-158226c9.js';
|
|
47
47
|
export { default as GridContent } from './GridContent.js';
|
|
@@ -136,9 +136,9 @@ export { default as PublicationLanding } from './PublicationLanding.js';
|
|
|
136
136
|
export { default as IssueLanding } from './IssueLanding.js';
|
|
137
137
|
import 'react-bootstrap/Modal';
|
|
138
138
|
export { default as PopUpModal } from './PopUpModal.js';
|
|
139
|
-
import './InscreenSensor-67905ed5.js';
|
|
140
|
-
export { default as getKeywords } from './getKeywords.js';
|
|
141
139
|
export { default as ArticleQueue } from './ArticleQueue.js';
|
|
140
|
+
import './InscreenSensor-280b2b10.js';
|
|
141
|
+
export { default as getKeywords } from './getKeywords.js';
|
|
142
142
|
export { default as RelatedContent } from './RelatedContent.js';
|
|
143
143
|
export { default as ForbesHero } from './ForbesHero.js';
|
|
144
144
|
export { default as HorizontalHero } from './HorizontalHero.js';
|
|
@@ -200,4 +200,4 @@ function isSymbol(value) {
|
|
|
200
200
|
|
|
201
201
|
var isSymbol_1 = isSymbol;
|
|
202
202
|
|
|
203
|
-
export {
|
|
203
|
+
export { _baseGetTag as _, _root as a, isSymbol_1 as b, isObject_1 as c, _Symbol as d, _freeGlobal as e, isObjectLike_1 as i };
|