@mjhls/mjh-framework 1.0.695 → 1.0.696-1034
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/ExternalResources.js +11 -7
- package/dist/cjs/PartnerDetailListing.js +1 -1
- package/dist/cjs/View.js +67 -58
- package/dist/cjs/getSerializers.js +1 -1
- package/dist/cjs/{index-c0bfab13.js → index-8e495016.js} +0 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/ExternalResources.js +11 -7
- package/dist/esm/PartnerDetailListing.js +1 -1
- package/dist/esm/View.js +67 -58
- package/dist/esm/getSerializers.js +1 -1
- package/dist/esm/{index-754010eb.js → index-6a239712.js} +1 -1
- package/dist/esm/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ require('./iconBase-68959171.js');
|
|
|
48
48
|
require('./index.esm-90433435.js');
|
|
49
49
|
var Button = _interopDefault(require('react-bootstrap/Button'));
|
|
50
50
|
var index$3 = require('./index-5be2866f.js');
|
|
51
|
-
var getSerializers = require('./index-
|
|
51
|
+
var getSerializers = require('./index-8e495016.js');
|
|
52
52
|
require('./util-f2c1b65b.js');
|
|
53
53
|
require('./brightcove-react-player-loader.es-156bd4d6.js');
|
|
54
54
|
require('react-bootstrap/Pagination');
|
|
@@ -61,7 +61,11 @@ var ExternalResources = function ExternalResources(props) {
|
|
|
61
61
|
_props$cta = props.cta,
|
|
62
62
|
cta = _props$cta === undefined ? 'Learn More' : _props$cta,
|
|
63
63
|
_props$url = props.url,
|
|
64
|
-
url = _props$url === undefined ? 'resources' : _props$url
|
|
64
|
+
url = _props$url === undefined ? 'resources' : _props$url,
|
|
65
|
+
_props$recentTitle = props.recentTitle,
|
|
66
|
+
recentTitle = _props$recentTitle === undefined ? 'Recent' : _props$recentTitle,
|
|
67
|
+
_props$archiveTitle = props.archiveTitle,
|
|
68
|
+
archiveTitle = _props$archiveTitle === undefined ? 'Archive' : _props$archiveTitle;
|
|
65
69
|
|
|
66
70
|
var _useState = React.useState(display && (display === 'recent' || display === 'archived') ? display : 'recent'),
|
|
67
71
|
_useState2 = slicedToArray._slicedToArray(_useState, 2),
|
|
@@ -85,7 +89,7 @@ var ExternalResources = function ExternalResources(props) {
|
|
|
85
89
|
return 'recent';
|
|
86
90
|
});
|
|
87
91
|
}, className: active === 'recent' ? 'active' : '' },
|
|
88
|
-
|
|
92
|
+
recentTitle
|
|
89
93
|
),
|
|
90
94
|
React__default.createElement(
|
|
91
95
|
'div',
|
|
@@ -94,13 +98,13 @@ var ExternalResources = function ExternalResources(props) {
|
|
|
94
98
|
return 'archived';
|
|
95
99
|
});
|
|
96
100
|
}, className: active === 'archived' ? 'active' : '' },
|
|
97
|
-
|
|
101
|
+
archiveTitle
|
|
98
102
|
)
|
|
99
103
|
),
|
|
100
|
-
resources[active].length > 0 ? resources[active].map(function (r
|
|
104
|
+
resources[active].length > 0 ? resources[active].map(function (r) {
|
|
101
105
|
return React__default.createElement(
|
|
102
106
|
'div',
|
|
103
|
-
{ key:
|
|
107
|
+
{ key: r._id, className: 'resource' },
|
|
104
108
|
React__default.createElement(
|
|
105
109
|
'div',
|
|
106
110
|
{ id: 'thumb' },
|
|
@@ -181,7 +185,7 @@ var ExternalResources = function ExternalResources(props) {
|
|
|
181
185
|
}) : React__default.createElement(
|
|
182
186
|
'p',
|
|
183
187
|
null,
|
|
184
|
-
'No
|
|
188
|
+
'No content available.'
|
|
185
189
|
),
|
|
186
190
|
React__default.createElement(
|
|
187
191
|
'style',
|
|
@@ -57,7 +57,7 @@ var QueueDeckExpanded = require('./QueueDeckExpanded.js');
|
|
|
57
57
|
require('./iconBase-68959171.js');
|
|
58
58
|
require('./index.esm-90433435.js');
|
|
59
59
|
require('react-bootstrap/Button');
|
|
60
|
-
var getSerializers = require('./index-
|
|
60
|
+
var getSerializers = require('./index-8e495016.js');
|
|
61
61
|
require('./util-f2c1b65b.js');
|
|
62
62
|
require('./brightcove-react-player-loader.es-156bd4d6.js');
|
|
63
63
|
require('react-bootstrap/Pagination');
|
package/dist/cjs/View.js
CHANGED
|
@@ -30,6 +30,7 @@ require('./isSymbol-04666465.js');
|
|
|
30
30
|
require('./debounce-eb287781.js');
|
|
31
31
|
var index_es = require('./index.es-ab3f2690.js');
|
|
32
32
|
require('react-dom');
|
|
33
|
+
var visibilitySensor = require('./visibility-sensor-0c45a583.js');
|
|
33
34
|
require('./index-b5eb3ff8.js');
|
|
34
35
|
require('./index-da796b8c.js');
|
|
35
36
|
var main = require('./main-b6c96c8d.js');
|
|
@@ -50,7 +51,7 @@ require('./index.esm-90433435.js');
|
|
|
50
51
|
var Button = _interopDefault(require('react-bootstrap/Button'));
|
|
51
52
|
var defineProperty$1 = require('./defineProperty-55548b25.js');
|
|
52
53
|
var Form = _interopDefault(require('react-bootstrap/Form'));
|
|
53
|
-
var getSerializers = require('./index-
|
|
54
|
+
var getSerializers = require('./index-8e495016.js');
|
|
54
55
|
require('./util-f2c1b65b.js');
|
|
55
56
|
require('./brightcove-react-player-loader.es-156bd4d6.js');
|
|
56
57
|
require('react-bootstrap/Pagination');
|
|
@@ -396,7 +397,10 @@ var Article = function Article(props) {
|
|
|
396
397
|
_props$sponsoredFlag = props.sponsoredFlag,
|
|
397
398
|
sponsoredFlag = _props$sponsoredFlag === undefined ? false : _props$sponsoredFlag,
|
|
398
399
|
_props$authorImgHeigh = props.authorImgHeight,
|
|
399
|
-
authorImgHeight = _props$authorImgHeigh === undefined ? 270 : _props$authorImgHeigh
|
|
400
|
+
authorImgHeight = _props$authorImgHeigh === undefined ? 270 : _props$authorImgHeigh,
|
|
401
|
+
active = props.active,
|
|
402
|
+
containerHeight = props.containerHeight;
|
|
403
|
+
|
|
400
404
|
|
|
401
405
|
var targeting = getTargeting.getTargeting(props);
|
|
402
406
|
var onChangeArticle = props.onChangeArticle;
|
|
@@ -810,16 +814,16 @@ var Article = function Article(props) {
|
|
|
810
814
|
React__default.Fragment,
|
|
811
815
|
null,
|
|
812
816
|
React__default.createElement(
|
|
813
|
-
|
|
817
|
+
visibilitySensor.VisibilitySensor,
|
|
814
818
|
{
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
819
|
+
partialVisibility: true,
|
|
820
|
+
offset: { bottom: 100, top: containerHeight - 100 },
|
|
821
|
+
onChange: function onChange(isVisible) {
|
|
822
|
+
if (isVisible) {
|
|
823
|
+
onChangeArticle(url, meta);
|
|
824
|
+
setVisibleFlag(function () {
|
|
825
|
+
return true;
|
|
826
|
+
});
|
|
823
827
|
}
|
|
824
828
|
} },
|
|
825
829
|
React__default.createElement(
|
|
@@ -1023,16 +1027,16 @@ var Article = function Article(props) {
|
|
|
1023
1027
|
)
|
|
1024
1028
|
),
|
|
1025
1029
|
renderIsiContent(props.article)
|
|
1026
|
-
),
|
|
1027
|
-
showIsi && Array.isArray(isi) && isi.length > 0 && React__default.createElement(
|
|
1028
|
-
ISI,
|
|
1029
|
-
null,
|
|
1030
|
-
React__default.createElement(BlockContent.BlockContent, {
|
|
1031
|
-
serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, false, null, props.article.Ads, targeting),
|
|
1032
|
-
blocks: isi
|
|
1033
|
-
})
|
|
1034
1030
|
)
|
|
1035
1031
|
),
|
|
1032
|
+
showIsi && Array.isArray(isi) && isi.length > 0 && React__default.createElement(
|
|
1033
|
+
ISI,
|
|
1034
|
+
null,
|
|
1035
|
+
React__default.createElement(BlockContent.BlockContent, {
|
|
1036
|
+
serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, false, null, props.article.Ads, targeting),
|
|
1037
|
+
blocks: isi
|
|
1038
|
+
})
|
|
1039
|
+
),
|
|
1036
1040
|
main.main_39 && !sponsoredFlag && props.article.Ads && props.article.Ads.length > 0 && props.article.Ads.map(function (ad, index) {
|
|
1037
1041
|
if (index > 0) {
|
|
1038
1042
|
return React__default.createElement(
|
|
@@ -1087,7 +1091,25 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1087
1091
|
showRelatedArticles = props.showRelatedArticles,
|
|
1088
1092
|
canonicalTag = props.canonicalTag;
|
|
1089
1093
|
|
|
1094
|
+
var _useState = React.useState(0),
|
|
1095
|
+
_useState2 = slicedToArray._slicedToArray(_useState, 2),
|
|
1096
|
+
containerHeight = _useState2[0],
|
|
1097
|
+
setContainerHeight = _useState2[1];
|
|
1090
1098
|
|
|
1099
|
+
React.useEffect(function () {
|
|
1100
|
+
setContainerHeight(function () {
|
|
1101
|
+
return window.innerHeight;
|
|
1102
|
+
});
|
|
1103
|
+
var handleResize = function handleResize() {
|
|
1104
|
+
return setContainerHeight(function () {
|
|
1105
|
+
return window.innerHeight;
|
|
1106
|
+
});
|
|
1107
|
+
};
|
|
1108
|
+
window.addEventListener('resize', handleResize);
|
|
1109
|
+
return function () {
|
|
1110
|
+
return window.removeEventListener('resize', handleResize);
|
|
1111
|
+
};
|
|
1112
|
+
}, []);
|
|
1091
1113
|
var firstArticle = function firstArticle() {
|
|
1092
1114
|
var article = _extends._Object$assign({}, props.article);
|
|
1093
1115
|
var targeting = getTargeting.getTargeting(props);
|
|
@@ -1095,10 +1117,15 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1095
1117
|
return article;
|
|
1096
1118
|
};
|
|
1097
1119
|
|
|
1098
|
-
var
|
|
1099
|
-
|
|
1100
|
-
queueData =
|
|
1101
|
-
setQueueData =
|
|
1120
|
+
var _useState3 = React.useState([firstArticle()]),
|
|
1121
|
+
_useState4 = slicedToArray._slicedToArray(_useState3, 2),
|
|
1122
|
+
queueData = _useState4[0],
|
|
1123
|
+
setQueueData = _useState4[1];
|
|
1124
|
+
|
|
1125
|
+
var _useState5 = React.useState(queueData[0]._id),
|
|
1126
|
+
_useState6 = slicedToArray._slicedToArray(_useState5, 2),
|
|
1127
|
+
active = _useState6[0],
|
|
1128
|
+
setActive = _useState6[1];
|
|
1102
1129
|
|
|
1103
1130
|
var refreshAD = function refreshAD(path) {
|
|
1104
1131
|
var activeArticle = queueData.find(function (item) {
|
|
@@ -1148,16 +1175,11 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1148
1175
|
};
|
|
1149
1176
|
|
|
1150
1177
|
var preVscroll = 0;
|
|
1151
|
-
var isScrollDown = true;
|
|
1152
1178
|
|
|
1153
1179
|
var scrollDirectionDetect = function scrollDirectionDetect(e) {
|
|
1154
1180
|
var window = e.currentTarget;
|
|
1155
1181
|
|
|
1156
|
-
if (preVscroll > window.scrollY)
|
|
1157
|
-
isScrollDown = false;
|
|
1158
|
-
} else if (preVscroll < window.scrollY) {
|
|
1159
|
-
isScrollDown = true;
|
|
1160
|
-
}
|
|
1182
|
+
if (preVscroll > window.scrollY) ; else if (preVscroll < window.scrollY) ;
|
|
1161
1183
|
preVscroll = window.scrollY;
|
|
1162
1184
|
};
|
|
1163
1185
|
|
|
@@ -1247,38 +1269,23 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1247
1269
|
}
|
|
1248
1270
|
};
|
|
1249
1271
|
|
|
1250
|
-
var onChangeArticle = function onChangeArticle(path,
|
|
1272
|
+
var onChangeArticle = function onChangeArticle(path, meta) {
|
|
1251
1273
|
var currentPath = window && window.location && window.location.pathname ? window.location.pathname.replace('/view/', '') : '';
|
|
1252
1274
|
var newPath = '/view/' + path;
|
|
1253
|
-
|
|
1275
|
+
var activeArticle = queueData.find(function (item) {
|
|
1276
|
+
return item.url.current === path;
|
|
1277
|
+
});
|
|
1278
|
+
setActive(function () {
|
|
1279
|
+
return activeArticle._id;
|
|
1280
|
+
});
|
|
1254
1281
|
// Change URL and do other changes
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
var activeArticle = queueData.find(function (item) {
|
|
1260
|
-
return item.url.current === path;
|
|
1261
|
-
});
|
|
1262
|
-
props.setCustomDimensions(activeArticle, '200', prevUrl);
|
|
1263
|
-
}
|
|
1264
|
-
if (props.pageview) props.pageview(newPath);
|
|
1265
|
-
refreshAD(path);
|
|
1266
|
-
};
|
|
1267
|
-
|
|
1268
|
-
if (currentPath !== path) {
|
|
1269
|
-
if (isScrollDown) {
|
|
1270
|
-
if (visibility === 'top') {
|
|
1271
|
-
doChanges();
|
|
1272
|
-
}
|
|
1273
|
-
} else {
|
|
1274
|
-
if (visibility === 'bottom') {
|
|
1275
|
-
doChanges();
|
|
1276
|
-
}
|
|
1277
|
-
}
|
|
1278
|
-
if (visibility === 'small-top') {
|
|
1279
|
-
doChanges();
|
|
1280
|
-
}
|
|
1282
|
+
window.history.pushState({ page: path }, meta.shareTitle, newPath);
|
|
1283
|
+
changeMeta(meta);
|
|
1284
|
+
if (props.setCustomDimensions) {
|
|
1285
|
+
props.setCustomDimensions(activeArticle, '200', prevUrl);
|
|
1281
1286
|
}
|
|
1287
|
+
if (props.pageview) props.pageview(newPath);
|
|
1288
|
+
refreshAD(path);
|
|
1282
1289
|
};
|
|
1283
1290
|
|
|
1284
1291
|
return React__default.createElement(
|
|
@@ -1288,10 +1295,12 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1288
1295
|
return React__default.createElement(Article, _extends._extends({
|
|
1289
1296
|
key: index
|
|
1290
1297
|
}, props, {
|
|
1298
|
+
containerHeight: containerHeight,
|
|
1291
1299
|
onChangeArticle: onChangeArticle,
|
|
1292
1300
|
authorPrfix: authorPrefix,
|
|
1293
1301
|
article: article,
|
|
1294
|
-
cpModificationRequired: cpModificationRequired
|
|
1302
|
+
cpModificationRequired: cpModificationRequired,
|
|
1303
|
+
active: active === article._id
|
|
1295
1304
|
// Passing queueData to check for single article
|
|
1296
1305
|
, queueData: queueData,
|
|
1297
1306
|
showRelatedArticles: showRelatedArticles
|
|
@@ -43,7 +43,7 @@ require('react-bootstrap');
|
|
|
43
43
|
require('./iconBase-68959171.js');
|
|
44
44
|
require('./index.esm-90433435.js');
|
|
45
45
|
require('react-bootstrap/Button');
|
|
46
|
-
var getSerializers = require('./index-
|
|
46
|
+
var getSerializers = require('./index-8e495016.js');
|
|
47
47
|
require('./util-f2c1b65b.js');
|
|
48
48
|
require('./brightcove-react-player-loader.es-156bd4d6.js');
|
|
49
49
|
require('react-bootstrap/Pagination');
|
package/dist/cjs/index.js
CHANGED
|
@@ -83,7 +83,7 @@ require('react-bootstrap/Form');
|
|
|
83
83
|
require('./index-5be2866f.js');
|
|
84
84
|
require('./js.cookie-a511c430.js');
|
|
85
85
|
var CMEDeck = require('./CMEDeck.js');
|
|
86
|
-
var getSerializers = require('./index-
|
|
86
|
+
var getSerializers = require('./index-8e495016.js');
|
|
87
87
|
require('./util-f2c1b65b.js');
|
|
88
88
|
require('./brightcove-react-player-loader.es-156bd4d6.js');
|
|
89
89
|
require('react-bootstrap/Pagination');
|
|
@@ -42,7 +42,7 @@ import './iconBase-602d52fe.js';
|
|
|
42
42
|
import './index.esm-29e48d38.js';
|
|
43
43
|
import Button from 'react-bootstrap/Button';
|
|
44
44
|
import { m as momentTimezone } from './index-d2f90501.js';
|
|
45
|
-
import { g as getSerializers } from './index-
|
|
45
|
+
import { g as getSerializers } from './index-6a239712.js';
|
|
46
46
|
import './util-7700fc59.js';
|
|
47
47
|
import './brightcove-react-player-loader.es-83f53e4e.js';
|
|
48
48
|
import 'react-bootstrap/Pagination';
|
|
@@ -55,7 +55,11 @@ var ExternalResources = function ExternalResources(props) {
|
|
|
55
55
|
_props$cta = props.cta,
|
|
56
56
|
cta = _props$cta === undefined ? 'Learn More' : _props$cta,
|
|
57
57
|
_props$url = props.url,
|
|
58
|
-
url = _props$url === undefined ? 'resources' : _props$url
|
|
58
|
+
url = _props$url === undefined ? 'resources' : _props$url,
|
|
59
|
+
_props$recentTitle = props.recentTitle,
|
|
60
|
+
recentTitle = _props$recentTitle === undefined ? 'Recent' : _props$recentTitle,
|
|
61
|
+
_props$archiveTitle = props.archiveTitle,
|
|
62
|
+
archiveTitle = _props$archiveTitle === undefined ? 'Archive' : _props$archiveTitle;
|
|
59
63
|
|
|
60
64
|
var _useState = useState(display && (display === 'recent' || display === 'archived') ? display : 'recent'),
|
|
61
65
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -79,7 +83,7 @@ var ExternalResources = function ExternalResources(props) {
|
|
|
79
83
|
return 'recent';
|
|
80
84
|
});
|
|
81
85
|
}, className: active === 'recent' ? 'active' : '' },
|
|
82
|
-
|
|
86
|
+
recentTitle
|
|
83
87
|
),
|
|
84
88
|
React__default.createElement(
|
|
85
89
|
'div',
|
|
@@ -88,13 +92,13 @@ var ExternalResources = function ExternalResources(props) {
|
|
|
88
92
|
return 'archived';
|
|
89
93
|
});
|
|
90
94
|
}, className: active === 'archived' ? 'active' : '' },
|
|
91
|
-
|
|
95
|
+
archiveTitle
|
|
92
96
|
)
|
|
93
97
|
),
|
|
94
|
-
resources[active].length > 0 ? resources[active].map(function (r
|
|
98
|
+
resources[active].length > 0 ? resources[active].map(function (r) {
|
|
95
99
|
return React__default.createElement(
|
|
96
100
|
'div',
|
|
97
|
-
{ key:
|
|
101
|
+
{ key: r._id, className: 'resource' },
|
|
98
102
|
React__default.createElement(
|
|
99
103
|
'div',
|
|
100
104
|
{ id: 'thumb' },
|
|
@@ -175,7 +179,7 @@ var ExternalResources = function ExternalResources(props) {
|
|
|
175
179
|
}) : React__default.createElement(
|
|
176
180
|
'p',
|
|
177
181
|
null,
|
|
178
|
-
'No
|
|
182
|
+
'No content available.'
|
|
179
183
|
),
|
|
180
184
|
React__default.createElement(
|
|
181
185
|
'style',
|
|
@@ -51,7 +51,7 @@ import QueueDeckExpanded from './QueueDeckExpanded.js';
|
|
|
51
51
|
import './iconBase-602d52fe.js';
|
|
52
52
|
import './index.esm-29e48d38.js';
|
|
53
53
|
import 'react-bootstrap/Button';
|
|
54
|
-
import { g as getSerializers } from './index-
|
|
54
|
+
import { g as getSerializers } from './index-6a239712.js';
|
|
55
55
|
import './util-7700fc59.js';
|
|
56
56
|
import './brightcove-react-player-loader.es-83f53e4e.js';
|
|
57
57
|
import 'react-bootstrap/Pagination';
|
package/dist/esm/View.js
CHANGED
|
@@ -24,6 +24,7 @@ import './isSymbol-807e927e.js';
|
|
|
24
24
|
import './debounce-1a993acf.js';
|
|
25
25
|
import { I as InfiniteScroll } from './index.es-938a3a58.js';
|
|
26
26
|
import 'react-dom';
|
|
27
|
+
import { V as VisibilitySensor } from './visibility-sensor-0baa4eea.js';
|
|
27
28
|
import './index-51a80699.js';
|
|
28
29
|
import './index-5f9f807a.js';
|
|
29
30
|
import { m as main_39 } from './main-0465b2a0.js';
|
|
@@ -44,7 +45,7 @@ import './index.esm-29e48d38.js';
|
|
|
44
45
|
import Button from 'react-bootstrap/Button';
|
|
45
46
|
import { _ as _defineProperty } from './defineProperty-b798470d.js';
|
|
46
47
|
import Form from 'react-bootstrap/Form';
|
|
47
|
-
import {
|
|
48
|
+
import { r as renderAuthor, g as getSerializers } from './index-6a239712.js';
|
|
48
49
|
import './util-7700fc59.js';
|
|
49
50
|
import './brightcove-react-player-loader.es-83f53e4e.js';
|
|
50
51
|
import 'react-bootstrap/Pagination';
|
|
@@ -390,7 +391,10 @@ var Article = function Article(props) {
|
|
|
390
391
|
_props$sponsoredFlag = props.sponsoredFlag,
|
|
391
392
|
sponsoredFlag = _props$sponsoredFlag === undefined ? false : _props$sponsoredFlag,
|
|
392
393
|
_props$authorImgHeigh = props.authorImgHeight,
|
|
393
|
-
authorImgHeight = _props$authorImgHeigh === undefined ? 270 : _props$authorImgHeigh
|
|
394
|
+
authorImgHeight = _props$authorImgHeigh === undefined ? 270 : _props$authorImgHeigh,
|
|
395
|
+
active = props.active,
|
|
396
|
+
containerHeight = props.containerHeight;
|
|
397
|
+
|
|
394
398
|
|
|
395
399
|
var targeting = getTargeting(props);
|
|
396
400
|
var onChangeArticle = props.onChangeArticle;
|
|
@@ -804,16 +808,16 @@ var Article = function Article(props) {
|
|
|
804
808
|
React__default.Fragment,
|
|
805
809
|
null,
|
|
806
810
|
React__default.createElement(
|
|
807
|
-
|
|
811
|
+
VisibilitySensor,
|
|
808
812
|
{
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
813
|
+
partialVisibility: true,
|
|
814
|
+
offset: { bottom: 100, top: containerHeight - 100 },
|
|
815
|
+
onChange: function onChange(isVisible) {
|
|
816
|
+
if (isVisible) {
|
|
817
|
+
onChangeArticle(url, meta);
|
|
818
|
+
setVisibleFlag(function () {
|
|
819
|
+
return true;
|
|
820
|
+
});
|
|
817
821
|
}
|
|
818
822
|
} },
|
|
819
823
|
React__default.createElement(
|
|
@@ -1017,16 +1021,16 @@ var Article = function Article(props) {
|
|
|
1017
1021
|
)
|
|
1018
1022
|
),
|
|
1019
1023
|
renderIsiContent(props.article)
|
|
1020
|
-
),
|
|
1021
|
-
showIsi && Array.isArray(isi) && isi.length > 0 && React__default.createElement(
|
|
1022
|
-
ISI,
|
|
1023
|
-
null,
|
|
1024
|
-
React__default.createElement(BlockContent, {
|
|
1025
|
-
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, false, null, props.article.Ads, targeting),
|
|
1026
|
-
blocks: isi
|
|
1027
|
-
})
|
|
1028
1024
|
)
|
|
1029
1025
|
),
|
|
1026
|
+
showIsi && Array.isArray(isi) && isi.length > 0 && React__default.createElement(
|
|
1027
|
+
ISI,
|
|
1028
|
+
null,
|
|
1029
|
+
React__default.createElement(BlockContent, {
|
|
1030
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, false, null, props.article.Ads, targeting),
|
|
1031
|
+
blocks: isi
|
|
1032
|
+
})
|
|
1033
|
+
),
|
|
1030
1034
|
main_39 && !sponsoredFlag && props.article.Ads && props.article.Ads.length > 0 && props.article.Ads.map(function (ad, index) {
|
|
1031
1035
|
if (index > 0) {
|
|
1032
1036
|
return React__default.createElement(
|
|
@@ -1081,7 +1085,25 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1081
1085
|
showRelatedArticles = props.showRelatedArticles,
|
|
1082
1086
|
canonicalTag = props.canonicalTag;
|
|
1083
1087
|
|
|
1088
|
+
var _useState = useState(0),
|
|
1089
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1090
|
+
containerHeight = _useState2[0],
|
|
1091
|
+
setContainerHeight = _useState2[1];
|
|
1084
1092
|
|
|
1093
|
+
useEffect(function () {
|
|
1094
|
+
setContainerHeight(function () {
|
|
1095
|
+
return window.innerHeight;
|
|
1096
|
+
});
|
|
1097
|
+
var handleResize = function handleResize() {
|
|
1098
|
+
return setContainerHeight(function () {
|
|
1099
|
+
return window.innerHeight;
|
|
1100
|
+
});
|
|
1101
|
+
};
|
|
1102
|
+
window.addEventListener('resize', handleResize);
|
|
1103
|
+
return function () {
|
|
1104
|
+
return window.removeEventListener('resize', handleResize);
|
|
1105
|
+
};
|
|
1106
|
+
}, []);
|
|
1085
1107
|
var firstArticle = function firstArticle() {
|
|
1086
1108
|
var article = _Object$assign({}, props.article);
|
|
1087
1109
|
var targeting = getTargeting(props);
|
|
@@ -1089,10 +1111,15 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1089
1111
|
return article;
|
|
1090
1112
|
};
|
|
1091
1113
|
|
|
1092
|
-
var
|
|
1093
|
-
|
|
1094
|
-
queueData =
|
|
1095
|
-
setQueueData =
|
|
1114
|
+
var _useState3 = useState([firstArticle()]),
|
|
1115
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
1116
|
+
queueData = _useState4[0],
|
|
1117
|
+
setQueueData = _useState4[1];
|
|
1118
|
+
|
|
1119
|
+
var _useState5 = useState(queueData[0]._id),
|
|
1120
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
1121
|
+
active = _useState6[0],
|
|
1122
|
+
setActive = _useState6[1];
|
|
1096
1123
|
|
|
1097
1124
|
var refreshAD = function refreshAD(path) {
|
|
1098
1125
|
var activeArticle = queueData.find(function (item) {
|
|
@@ -1142,16 +1169,11 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1142
1169
|
};
|
|
1143
1170
|
|
|
1144
1171
|
var preVscroll = 0;
|
|
1145
|
-
var isScrollDown = true;
|
|
1146
1172
|
|
|
1147
1173
|
var scrollDirectionDetect = function scrollDirectionDetect(e) {
|
|
1148
1174
|
var window = e.currentTarget;
|
|
1149
1175
|
|
|
1150
|
-
if (preVscroll > window.scrollY)
|
|
1151
|
-
isScrollDown = false;
|
|
1152
|
-
} else if (preVscroll < window.scrollY) {
|
|
1153
|
-
isScrollDown = true;
|
|
1154
|
-
}
|
|
1176
|
+
if (preVscroll > window.scrollY) ; else if (preVscroll < window.scrollY) ;
|
|
1155
1177
|
preVscroll = window.scrollY;
|
|
1156
1178
|
};
|
|
1157
1179
|
|
|
@@ -1241,38 +1263,23 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1241
1263
|
}
|
|
1242
1264
|
};
|
|
1243
1265
|
|
|
1244
|
-
var onChangeArticle = function onChangeArticle(path,
|
|
1266
|
+
var onChangeArticle = function onChangeArticle(path, meta) {
|
|
1245
1267
|
var currentPath = window && window.location && window.location.pathname ? window.location.pathname.replace('/view/', '') : '';
|
|
1246
1268
|
var newPath = '/view/' + path;
|
|
1247
|
-
|
|
1269
|
+
var activeArticle = queueData.find(function (item) {
|
|
1270
|
+
return item.url.current === path;
|
|
1271
|
+
});
|
|
1272
|
+
setActive(function () {
|
|
1273
|
+
return activeArticle._id;
|
|
1274
|
+
});
|
|
1248
1275
|
// Change URL and do other changes
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
var activeArticle = queueData.find(function (item) {
|
|
1254
|
-
return item.url.current === path;
|
|
1255
|
-
});
|
|
1256
|
-
props.setCustomDimensions(activeArticle, '200', prevUrl);
|
|
1257
|
-
}
|
|
1258
|
-
if (props.pageview) props.pageview(newPath);
|
|
1259
|
-
refreshAD(path);
|
|
1260
|
-
};
|
|
1261
|
-
|
|
1262
|
-
if (currentPath !== path) {
|
|
1263
|
-
if (isScrollDown) {
|
|
1264
|
-
if (visibility === 'top') {
|
|
1265
|
-
doChanges();
|
|
1266
|
-
}
|
|
1267
|
-
} else {
|
|
1268
|
-
if (visibility === 'bottom') {
|
|
1269
|
-
doChanges();
|
|
1270
|
-
}
|
|
1271
|
-
}
|
|
1272
|
-
if (visibility === 'small-top') {
|
|
1273
|
-
doChanges();
|
|
1274
|
-
}
|
|
1276
|
+
window.history.pushState({ page: path }, meta.shareTitle, newPath);
|
|
1277
|
+
changeMeta(meta);
|
|
1278
|
+
if (props.setCustomDimensions) {
|
|
1279
|
+
props.setCustomDimensions(activeArticle, '200', prevUrl);
|
|
1275
1280
|
}
|
|
1281
|
+
if (props.pageview) props.pageview(newPath);
|
|
1282
|
+
refreshAD(path);
|
|
1276
1283
|
};
|
|
1277
1284
|
|
|
1278
1285
|
return React__default.createElement(
|
|
@@ -1282,10 +1289,12 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1282
1289
|
return React__default.createElement(Article, _extends({
|
|
1283
1290
|
key: index
|
|
1284
1291
|
}, props, {
|
|
1292
|
+
containerHeight: containerHeight,
|
|
1285
1293
|
onChangeArticle: onChangeArticle,
|
|
1286
1294
|
authorPrfix: authorPrefix,
|
|
1287
1295
|
article: article,
|
|
1288
|
-
cpModificationRequired: cpModificationRequired
|
|
1296
|
+
cpModificationRequired: cpModificationRequired,
|
|
1297
|
+
active: active === article._id
|
|
1289
1298
|
// Passing queueData to check for single article
|
|
1290
1299
|
, queueData: queueData,
|
|
1291
1300
|
showRelatedArticles: showRelatedArticles
|
|
@@ -41,7 +41,7 @@ import 'react-bootstrap';
|
|
|
41
41
|
import './iconBase-602d52fe.js';
|
|
42
42
|
import './index.esm-29e48d38.js';
|
|
43
43
|
import 'react-bootstrap/Button';
|
|
44
|
-
export { g as default } from './index-
|
|
44
|
+
export { g as default } from './index-6a239712.js';
|
|
45
45
|
import './util-7700fc59.js';
|
|
46
46
|
import './brightcove-react-player-loader.es-83f53e4e.js';
|
|
47
47
|
import 'react-bootstrap/Pagination';
|
package/dist/esm/index.js
CHANGED
|
@@ -79,7 +79,7 @@ import 'react-bootstrap/Form';
|
|
|
79
79
|
import './index-d2f90501.js';
|
|
80
80
|
import './js.cookie-6874175c.js';
|
|
81
81
|
export { default as CMEDeck } from './CMEDeck.js';
|
|
82
|
-
export { g as getSerializers } from './index-
|
|
82
|
+
export { g as getSerializers } from './index-6a239712.js';
|
|
83
83
|
import './util-7700fc59.js';
|
|
84
84
|
import './brightcove-react-player-loader.es-83f53e4e.js';
|
|
85
85
|
import 'react-bootstrap/Pagination';
|