@mjhls/mjh-framework 1.0.694 → 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 CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- # mjh-framework v. 1.0.694
2
+ # mjh-framework v. 1.0.696-1034
3
3
 
4
4
  > Foundation Framework
5
5
 
@@ -227,7 +227,7 @@ var ArticleSeriesListing = function (_React$Component) {
227
227
  { key: index, counter: itemCounter++ },
228
228
  React__default.createElement(
229
229
  'h4',
230
- { className: 'article-title-banner', style: { fontWeight: 'bold', color: 'var(--primary)', padding: '.25rem 0', borderBottom: '2px solid var(--gold)' } },
230
+ { className: 'article-title-banner', style: { fontWeight: 'bold', color: 'var(--primary)', padding: '.25rem 0', borderBottom: '2px solid #d4a64d' } },
231
231
  React__default.createElement(
232
232
  'a',
233
233
  { href: '/' + _this.props.page + '/' + docSeries.url.current },
@@ -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-bb6b1bfb.js');
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
- 'Recent'
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
- 'Archive'
101
+ archiveTitle
98
102
  )
99
103
  ),
100
- resources[active].length > 0 ? resources[active].map(function (r, i) {
104
+ resources[active].length > 0 ? resources[active].map(function (r) {
101
105
  return React__default.createElement(
102
106
  'div',
103
- { key: i, className: 'resource' },
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 ' + active + ' resources available. '
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-bb6b1bfb.js');
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');
@@ -227,7 +227,7 @@ var VideoSeriesListing = function (_React$Component) {
227
227
  { key: index, counter: itemCounter++ },
228
228
  React__default.createElement(
229
229
  'h4',
230
- { className: 'video-title-banner', style: { fontWeight: 'bold', color: 'var(--primary)', padding: '.25rem 0', borderBottom: '2px solid var(--gold)' } },
230
+ { className: 'video-title-banner', style: { fontWeight: 'bold', color: 'var(--primary)', padding: '.25rem 0', borderBottom: '2px solid #d4a64d' } },
231
231
  React__default.createElement(
232
232
  'a',
233
233
  { href: '/' + _this.props.page + '/' + docSeries.url.current },
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-bb6b1bfb.js');
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;
@@ -769,7 +773,7 @@ var Article = function Article(props) {
769
773
  );
770
774
  } else {
771
775
  return React__default.createElement(BlockContent.BlockContent, _extends._extends({
772
- serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, false, null, props.article.Ads, targeting),
776
+ serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, false, null, props.article.Ads, targeting, article),
773
777
  blocks: articleBody,
774
778
  imageOptions: { w: 320, h: 240, fit: 'max' }
775
779
  }, client.config()));
@@ -810,16 +814,16 @@ var Article = function Article(props) {
810
814
  React__default.Fragment,
811
815
  null,
812
816
  React__default.createElement(
813
- getSerializers.InscreenSensor,
817
+ visibilitySensor.VisibilitySensor,
814
818
  {
815
- offSetTop: 120,
816
- className: 'inscreen-wrapper',
817
- id: 'article-' + title,
818
- onChange: function onChange(visible) {
819
- if (visible === 'top' || visible === 'bottom' || visible === 'small-top') {
820
- onChangeArticle(url, visible, meta);
821
- // Setting 'visibleFlag' to know that the article is visible.
822
- setVisibleFlag(true);
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 _useState = React.useState([firstArticle()]),
1099
- _useState2 = slicedToArray._slicedToArray(_useState, 2),
1100
- queueData = _useState2[0],
1101
- setQueueData = _useState2[1];
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, visibility, meta) {
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
- var doChanges = function doChanges() {
1256
- window.history.pushState({ page: path }, meta.shareTitle, newPath);
1257
- changeMeta(meta);
1258
- if (props.setCustomDimensions) {
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-bb6b1bfb.js');
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');
@@ -7065,6 +7065,14 @@ var YouTubeGallery = function YouTubeGallery(_ref) {
7065
7065
  return null;
7066
7066
  }
7067
7067
 
7068
+ var today = moment.moment().utc().format();
7069
+
7070
+ var Videos = nodes.videos.filter(function (video) {
7071
+ if ((video.is_visible === true || !video.hasOwnProperty('is_visible')) && (today >= video.published || !video.hasOwnProperty('published'))) {
7072
+ return video;
7073
+ }
7074
+ });
7075
+
7068
7076
  var builder = index$1.imageUrlBuilder(client);
7069
7077
  function urlFor(source) {
7070
7078
  return builder.image(source);
@@ -7133,7 +7141,7 @@ var YouTubeGallery = function YouTubeGallery(_ref) {
7133
7141
  var seriesVid = params.get('seriesVid') || 1;
7134
7142
  var data = [];
7135
7143
 
7136
- nodes.videos.forEach(function (vid) {
7144
+ Videos.forEach(function (vid) {
7137
7145
  if (vid.type == 'mp4') {
7138
7146
  data.push({ title: vid.title, thumbnail: urlFor(vid.thumbnail.asset).url(), url: vid.url });
7139
7147
  } else {
@@ -7148,10 +7156,10 @@ var YouTubeGallery = function YouTubeGallery(_ref) {
7148
7156
 
7149
7157
  if (data.length < seriesVid) {
7150
7158
  setSeries(1);
7151
- setVidUrl(nodes.videos[0].url);
7152
- setVidThumbnail(nodes.videos[0].thumbnail && nodes.videos[0].thumbnail.asset ? urlFor(nodes.videos[0].thumbnail.asset).url() : '');
7153
- if (nodes.videos[0].type) {
7154
- setVidType(nodes.videos[0].type);
7159
+ setVidUrl(Videos[0].url);
7160
+ setVidThumbnail(Videos[0].thumbnail && Videos[0].thumbnail.asset ? urlFor(Videos[0].thumbnail.asset).url() : '');
7161
+ if (Videos[0].type) {
7162
+ setVidType(Videos[0].type);
7155
7163
  }
7156
7164
 
7157
7165
  var newPath = '/' + get2 + '/' + get3 + '?seriesVid=1';
@@ -7159,10 +7167,10 @@ var YouTubeGallery = function YouTubeGallery(_ref) {
7159
7167
  window.history.pushState(vidState, '', newPath);
7160
7168
  } else {
7161
7169
  setSeries(seriesVid);
7162
- setVidUrl(nodes.videos[seriesVid - 1].url);
7163
- setVidThumbnail(nodes.videos[seriesVid - 1].thumbnail && nodes.videos[seriesVid - 1].thumbnail.asset ? urlFor(nodes.videos[seriesVid - 1].thumbnail.asset).url() : '');
7164
- if (nodes.videos[0].type) {
7165
- setVidType(nodes.videos[seriesVid - 1].type);
7170
+ setVidUrl(Videos[seriesVid - 1].url);
7171
+ setVidThumbnail(Videos[seriesVid - 1].thumbnail && Videos[seriesVid - 1].thumbnail.asset ? urlFor(Videos[seriesVid - 1].thumbnail.asset).url() : '');
7172
+ if (Videos[0].type) {
7173
+ setVidType(Videos[seriesVid - 1].type);
7166
7174
  }
7167
7175
  setVidLoaded(true);
7168
7176
  }
@@ -7173,7 +7181,7 @@ var YouTubeGallery = function YouTubeGallery(_ref) {
7173
7181
  if (vidLoaded == true) {
7174
7182
  var params = new URL(document.location).searchParams;
7175
7183
  var seriesVid = params.get('seriesVid');
7176
- var vidTitle = nodes.videos[series - 1].title;
7184
+ var vidTitle = Videos[series - 1].title;
7177
7185
  var originalTitle = document.title;
7178
7186
  if (seriesVid) {
7179
7187
  document.title = vidTitle + ' | ' + originalTitle;
@@ -7235,7 +7243,7 @@ var YouTubeGallery = function YouTubeGallery(_ref) {
7235
7243
  nextVid = currentVid + 1;
7236
7244
  }
7237
7245
  // set the new Video URL
7238
- setState(nodes.videos[nextVid].url, '', nextVid + 1);
7246
+ setState(Videos[nextVid].url, '', nextVid + 1);
7239
7247
  }
7240
7248
 
7241
7249
  var autoplayNextVideo = function autoplayNextVideo(e) {
@@ -7256,7 +7264,7 @@ var YouTubeGallery = function YouTubeGallery(_ref) {
7256
7264
  nextVid = currentVid + 1;
7257
7265
  }
7258
7266
  // set the new Video URL
7259
- setState(nodes.videos[nextVid].url, '', nextVid + 1);
7267
+ setState(Videos[nextVid].url, '', nextVid + 1);
7260
7268
  };
7261
7269
 
7262
7270
  var handlePlayPercent = function handlePlayPercent(player) {
@@ -7364,26 +7372,26 @@ var YouTubeGallery = function YouTubeGallery(_ref) {
7364
7372
  'Episode ',
7365
7373
  series
7366
7374
  ),
7367
- nodes.videos[series - 1] && React__default.createElement(
7375
+ Videos[series - 1] && React__default.createElement(
7368
7376
  'h2',
7369
7377
  { className: 'mb-3' },
7370
- nodes.videos[series - 1].title
7378
+ Videos[series - 1].title
7371
7379
  ),
7372
- nodes.videos[series - 1] && nodes.videos[series - 1].intro && React__default.createElement(
7380
+ Videos[series - 1] && Videos[series - 1].intro && React__default.createElement(
7373
7381
  'p',
7374
7382
  { className: 'mb-3' },
7375
7383
  React__default.createElement(
7376
7384
  'em',
7377
7385
  null,
7378
- nodes.videos[series - 1].intro
7386
+ Videos[series - 1].intro
7379
7387
  )
7380
7388
  ),
7381
- nodes.videos[series - 1] && nodes.videos[series - 1].text && React__default.createElement(BlockContent.BlockContent, _extends._extends({ serializers: getSerializers, blocks: nodes.videos[series - 1].text, imageOptions: { w: 320, h: 240, fit: 'max' } }, client.config()))
7389
+ Videos[series - 1] && Videos[series - 1].text && React__default.createElement(BlockContent.BlockContent, _extends._extends({ serializers: getSerializers, blocks: Videos[series - 1].text, imageOptions: { w: 320, h: 240, fit: 'max' } }, client.config()))
7382
7390
  ),
7383
7391
  React__default.createElement(
7384
7392
  'style',
7385
7393
  { jsx: 'true' },
7386
- '\n \n #fluid-video-container > div {\n position: relative;\n padding-bottom: 56.25%; /* 16:9 */\n height: 0;\n }\n #fluid-video-container .fluid-iframe {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100% !important;\n }\n\n span.btn {\n margin: 0 1rem;\n }\n \n \n '
7394
+ '\n #fluid-video-container > div {\n position: relative;\n padding-bottom: 56.25%; /* 16:9 */\n height: 0;\n }\n #fluid-video-container .fluid-iframe {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100% !important;\n }\n\n span.btn {\n margin: 0 1rem;\n }\n '
7387
7395
  )
7388
7396
  );
7389
7397
  };
@@ -8019,9 +8027,11 @@ var InscreenSensor = function (_React$Component) {
8019
8027
  var ArticleSeries = function ArticleSeries(_ref) {
8020
8028
  var nodes = _ref.nodes,
8021
8029
  client = _ref.client,
8030
+ pageview = _ref.pageview,
8022
8031
  getSerializers = _ref.getSerializers,
8023
8032
  accountIDs = _ref.accountIDs,
8024
- Ads = _ref.Ads;
8033
+ Ads = _ref.Ads,
8034
+ rootArticle = _ref.rootArticle;
8025
8035
 
8026
8036
  if (!nodes || !nodes.articles) {
8027
8037
  return null;
@@ -8182,7 +8192,7 @@ var ArticleSeries = function ArticleSeries(_ref) {
8182
8192
  // Change URL and do other changes
8183
8193
  var doChanges = function doChanges() {
8184
8194
  if (firstLoad) {
8185
- refreshAD();
8195
+ refreshAD(newPath);
8186
8196
  }
8187
8197
  window.history.pushState({ page: path }, '', newPath);
8188
8198
  document.title = title;
@@ -8262,6 +8272,7 @@ var ArticleSeries = function ArticleSeries(_ref) {
8262
8272
  var refreshAD = function refreshAD(path) {
8263
8273
  //const activeArticle = path
8264
8274
  //let targeting = getTargeting({ article: activeArticle, cpModificationRequired, position: props.position, prevUrl })
8275
+ if (pageview) pageview(path);
8265
8276
 
8266
8277
  if (!main.main_39) {
8267
8278
  index.lib_3.getGoogletag().then(function (googletag) {
@@ -8282,12 +8293,25 @@ var ArticleSeries = function ArticleSeries(_ref) {
8282
8293
  };
8283
8294
 
8284
8295
  var handleArrowClick = function handleArrowClick() {
8296
+ var newPath = router.asPath.split('?')[0];
8297
+ var title = nodes.seriesTitle;
8285
8298
  isScrollDown = true;
8286
8299
  upArrowClicked = true;
8287
8300
  arrowRef.current.style.visibility = 'hidden';
8288
8301
  window.scrollTo({ top: 0, behavior: 'smooth' });
8289
- window.history.pushState({}, '', router.asPath.split('?')[0]);
8290
- document.title = nodes.seriesTitle;
8302
+ window.history.pushState({}, '', newPath);
8303
+ document.title = title;
8304
+
8305
+ setCurrentURL(newPath);
8306
+ setCurrentTitle(title);
8307
+ if (rootArticle) {
8308
+ setCurrentSummary(rootArticle.summary ? rootArticle.summary : '');
8309
+ setCurrentThumbnail(urlFor(rootArticle.thumbnail.asset).url());
8310
+ } else {
8311
+ setCurrentSummary('');
8312
+ setCurrentThumbnail('');
8313
+ }
8314
+ refreshAD(newPath);
8291
8315
  };
8292
8316
 
8293
8317
  return React__default.createElement(
@@ -8295,10 +8319,10 @@ var ArticleSeries = function ArticleSeries(_ref) {
8295
8319
  null,
8296
8320
  React__default.createElement(
8297
8321
  'div',
8298
- { ref: arrowRef, className: 'scrollToTopArrow', onClick: function onClick() {
8322
+ { ref: arrowRef, className: 'scrollToTopArrow' },
8323
+ React__default.createElement(index_esm.IoIosArrowDropupCircle, { style: { cursor: 'pointer' }, onClick: function onClick() {
8299
8324
  return handleArrowClick();
8300
- } },
8301
- React__default.createElement(index_esm.IoIosArrowDropupCircle, null)
8325
+ } })
8302
8326
  ),
8303
8327
  React__default.createElement('hr', { className: 'article-seperater my-4' }),
8304
8328
  React__default.createElement(
@@ -8468,7 +8492,7 @@ var ArticleSeries = function ArticleSeries(_ref) {
8468
8492
  React__default.createElement(
8469
8493
  'style',
8470
8494
  { jsx: 'true' },
8471
- '\n .scrollToTopArrow {\n position: fixed;\n top: 150px;\n display: flex;\n justify-content: center;\n width: ' + contentWidth + 'px;\n opacity: 1;\n z-index: 99999999999;\n cursor: pointer;\n visibility: hidden;\n }\n .scrollToTopArrow > svg {\n min-height: 50px;\n min-width: 50px;\n max-height: 50px;\n max-width: 50px;\n }\n .block-content > div p {\n padding: 0;\n }\n\n h2.article-title {\n padding: 0;\n font-weight: 500;\n }\n h4.article-title {\n padding: 0;\n font-weight: 500;\n }\n h4.prevNext-title {\n padding: 0;\n font-size: 1rem;\n font-weight: 500;\n }\n .article-wrapper {\n border: 1px solid #252525;\n border-radius: 5px;\n padding: 1rem 1rem 0 1rem;\n margin-bottom: 1rem;\n }\n .prevNext-reading {\n margin-top: -10px;\n width: 75%;\n text-align: center;\n background: white;\n border: 1px solid #252525;\n align-self: center;\n display: none;\n }\n .showReading {\n display: block;\n }\n .author-details-wrapper a {\n color: #252525;\n }\n .objective-prevNext-Wrapper {\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n .objective-title {\n padding: 0 !important;\n }\n .prevNext-thumbnail {\n display: flex;\n flex-direction: column;\n min-width: 225px;\n max-width: 225px;\n overflow: hidden;\n align-items: center;\n object-fit: contain;\n border-radius: 15px;\n }\n .prevNext-thumbnail img {\n height: 125px;\n object-fit: contain;\n border-radius: 15px;\n }\n .prevNext-summary {\n text-align: center;\n }\n .prevNext-publishDate {\n font-size: 0.75rem;\n margin-top: 0.5rem;\n }\n .prevNext-title {\n padding: 0 !important;\n line-height: 1 !important;\n font-weight: 500;\n }\n .prevNextWrapper {\n display: flex;\n flex-direction: row;\n justify-content: space-evenly;\n flex-wrap: wrap;\n }\n .prevNextWrapper a {\n display: flex;\n flex-direction: column;\n color: #252525;\n align-items: center;\n }\n .prevNextCards {\n max-width: 250px;\n margin-bottom: 1rem;\n }\n @media only screen and (max-width: 568px) {\n .prevNextWrapper {\n flex-direction: column;\n align-items: center;\n }\n .prevNextCards {\n margin-bottom: 2rem;\n }\n }\n @media only screen and (max-width: 568px) {\n }\n '
8495
+ '\n .scrollToTopArrow {\n position: fixed;\n top: 150px;\n display: flex;\n justify-content: center;\n width: ' + contentWidth + 'px;\n opacity: 1;\n z-index: 99999999999;\n visibility: hidden;\n }\n .scrollToTopArrow > svg {\n min-height: 50px;\n min-width: 50px;\n max-height: 50px;\n max-width: 50px;\n }\n .block-content > div p {\n padding: 0;\n }\n\n h2.article-title {\n padding: 0;\n font-weight: 500;\n }\n h4.article-title {\n padding: 0;\n font-weight: 500;\n }\n h4.prevNext-title {\n padding: 0;\n font-size: 1rem;\n font-weight: 500;\n }\n .article-wrapper {\n border: 1px solid #252525;\n border-radius: 5px;\n padding: 1rem 1rem 0 1rem;\n margin-bottom: 1rem;\n }\n .prevNext-reading {\n margin-top: -10px;\n width: 75%;\n text-align: center;\n background: white;\n border: 1px solid #252525;\n align-self: center;\n display: none;\n }\n .showReading {\n display: block;\n }\n .author-details-wrapper a {\n color: #252525;\n }\n .objective-prevNext-Wrapper {\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n .objective-title {\n padding: 0 !important;\n }\n .prevNext-thumbnail {\n display: flex;\n flex-direction: column;\n min-width: 225px;\n max-width: 225px;\n overflow: hidden;\n align-items: center;\n object-fit: contain;\n border-radius: 15px;\n }\n .prevNext-thumbnail img {\n height: 125px;\n object-fit: contain;\n border-radius: 15px;\n }\n .prevNext-summary {\n text-align: center;\n }\n .prevNext-publishDate {\n font-size: 0.75rem;\n margin-top: 0.5rem;\n }\n .prevNext-title {\n padding: 0 !important;\n line-height: 1 !important;\n font-weight: 500;\n }\n .prevNextWrapper {\n display: flex;\n flex-direction: row;\n justify-content: space-evenly;\n flex-wrap: wrap;\n }\n .prevNextWrapper a {\n display: flex;\n flex-direction: column;\n color: #252525;\n align-items: center;\n }\n .prevNextCards {\n max-width: 250px;\n margin-bottom: 1rem;\n }\n @media only screen and (max-width: 568px) {\n .prevNextWrapper {\n flex-direction: column;\n align-items: center;\n }\n .prevNextCards {\n margin-bottom: 2rem;\n }\n }\n @media only screen and (max-width: 568px) {\n }\n '
8472
8496
  )
8473
8497
  )
8474
8498
  );
@@ -8822,7 +8846,8 @@ var getSerializers = function getSerializers() {
8822
8846
  contextualADFlag = _props$2 === undefined ? false : _props$2,
8823
8847
  articleId = props[9],
8824
8848
  Ads = props[10],
8825
- targeting = props[11];
8849
+ targeting = props[11],
8850
+ article = props[12];
8826
8851
 
8827
8852
  return {
8828
8853
  types: {
@@ -8844,7 +8869,7 @@ var getSerializers = function getSerializers() {
8844
8869
  articleSeries: function articleSeries(_ref3) {
8845
8870
  var node = _ref3.node;
8846
8871
 
8847
- return React__default.createElement(ArticleSeries, { nodes: node, accountIDs: videoAccountIDs || {}, client: client, getSerializers: getSerializers.apply(undefined, props), Ads: Ads || null });
8872
+ return React__default.createElement(ArticleSeries, { nodes: node, accountIDs: videoAccountIDs || {}, pageview: pageview, client: client, getSerializers: getSerializers.apply(undefined, props), Ads: Ads || null, rootArticle: article || null });
8848
8873
  },
8849
8874
  figure: function figure(_ref4) {
8850
8875
  var node = _ref4.node;
@@ -9034,6 +9059,5 @@ var getSerializers = function getSerializers() {
9034
9059
  };
9035
9060
  };
9036
9061
 
9037
- exports.InscreenSensor = InscreenSensor;
9038
9062
  exports.getSerializers = getSerializers;
9039
9063
  exports.renderAuthor = renderAuthor;
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-bb6b1bfb.js');
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');
@@ -221,7 +221,7 @@ var ArticleSeriesListing = function (_React$Component) {
221
221
  { key: index, counter: itemCounter++ },
222
222
  React__default.createElement(
223
223
  'h4',
224
- { className: 'article-title-banner', style: { fontWeight: 'bold', color: 'var(--primary)', padding: '.25rem 0', borderBottom: '2px solid var(--gold)' } },
224
+ { className: 'article-title-banner', style: { fontWeight: 'bold', color: 'var(--primary)', padding: '.25rem 0', borderBottom: '2px solid #d4a64d' } },
225
225
  React__default.createElement(
226
226
  'a',
227
227
  { href: '/' + _this.props.page + '/' + docSeries.url.current },
@@ -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-74d46cc5.js';
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
- 'Recent'
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
- 'Archive'
95
+ archiveTitle
92
96
  )
93
97
  ),
94
- resources[active].length > 0 ? resources[active].map(function (r, i) {
98
+ resources[active].length > 0 ? resources[active].map(function (r) {
95
99
  return React__default.createElement(
96
100
  'div',
97
- { key: i, className: 'resource' },
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 ' + active + ' resources available. '
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-74d46cc5.js';
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';
@@ -221,7 +221,7 @@ var VideoSeriesListing = function (_React$Component) {
221
221
  { key: index, counter: itemCounter++ },
222
222
  React__default.createElement(
223
223
  'h4',
224
- { className: 'video-title-banner', style: { fontWeight: 'bold', color: 'var(--primary)', padding: '.25rem 0', borderBottom: '2px solid var(--gold)' } },
224
+ { className: 'video-title-banner', style: { fontWeight: 'bold', color: 'var(--primary)', padding: '.25rem 0', borderBottom: '2px solid #d4a64d' } },
225
225
  React__default.createElement(
226
226
  'a',
227
227
  { href: '/' + _this.props.page + '/' + docSeries.url.current },
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 { I as InscreenSensor, r as renderAuthor, g as getSerializers } from './index-74d46cc5.js';
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;
@@ -763,7 +767,7 @@ var Article = function Article(props) {
763
767
  );
764
768
  } else {
765
769
  return React__default.createElement(BlockContent, _extends({
766
- serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, false, null, props.article.Ads, targeting),
770
+ serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, false, null, props.article.Ads, targeting, article),
767
771
  blocks: articleBody,
768
772
  imageOptions: { w: 320, h: 240, fit: 'max' }
769
773
  }, client.config()));
@@ -804,16 +808,16 @@ var Article = function Article(props) {
804
808
  React__default.Fragment,
805
809
  null,
806
810
  React__default.createElement(
807
- InscreenSensor,
811
+ VisibilitySensor,
808
812
  {
809
- offSetTop: 120,
810
- className: 'inscreen-wrapper',
811
- id: 'article-' + title,
812
- onChange: function onChange(visible) {
813
- if (visible === 'top' || visible === 'bottom' || visible === 'small-top') {
814
- onChangeArticle(url, visible, meta);
815
- // Setting 'visibleFlag' to know that the article is visible.
816
- setVisibleFlag(true);
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 _useState = useState([firstArticle()]),
1093
- _useState2 = _slicedToArray(_useState, 2),
1094
- queueData = _useState2[0],
1095
- setQueueData = _useState2[1];
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, visibility, meta) {
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
- var doChanges = function doChanges() {
1250
- window.history.pushState({ page: path }, meta.shareTitle, newPath);
1251
- changeMeta(meta);
1252
- if (props.setCustomDimensions) {
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-74d46cc5.js';
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';
@@ -7058,6 +7058,14 @@ var YouTubeGallery = function YouTubeGallery(_ref) {
7058
7058
  return null;
7059
7059
  }
7060
7060
 
7061
+ var today = moment().utc().format();
7062
+
7063
+ var Videos = nodes.videos.filter(function (video) {
7064
+ if ((video.is_visible === true || !video.hasOwnProperty('is_visible')) && (today >= video.published || !video.hasOwnProperty('published'))) {
7065
+ return video;
7066
+ }
7067
+ });
7068
+
7061
7069
  var builder = imageUrlBuilder(client);
7062
7070
  function urlFor(source) {
7063
7071
  return builder.image(source);
@@ -7126,7 +7134,7 @@ var YouTubeGallery = function YouTubeGallery(_ref) {
7126
7134
  var seriesVid = params.get('seriesVid') || 1;
7127
7135
  var data = [];
7128
7136
 
7129
- nodes.videos.forEach(function (vid) {
7137
+ Videos.forEach(function (vid) {
7130
7138
  if (vid.type == 'mp4') {
7131
7139
  data.push({ title: vid.title, thumbnail: urlFor(vid.thumbnail.asset).url(), url: vid.url });
7132
7140
  } else {
@@ -7141,10 +7149,10 @@ var YouTubeGallery = function YouTubeGallery(_ref) {
7141
7149
 
7142
7150
  if (data.length < seriesVid) {
7143
7151
  setSeries(1);
7144
- setVidUrl(nodes.videos[0].url);
7145
- setVidThumbnail(nodes.videos[0].thumbnail && nodes.videos[0].thumbnail.asset ? urlFor(nodes.videos[0].thumbnail.asset).url() : '');
7146
- if (nodes.videos[0].type) {
7147
- setVidType(nodes.videos[0].type);
7152
+ setVidUrl(Videos[0].url);
7153
+ setVidThumbnail(Videos[0].thumbnail && Videos[0].thumbnail.asset ? urlFor(Videos[0].thumbnail.asset).url() : '');
7154
+ if (Videos[0].type) {
7155
+ setVidType(Videos[0].type);
7148
7156
  }
7149
7157
 
7150
7158
  var newPath = '/' + get2 + '/' + get3 + '?seriesVid=1';
@@ -7152,10 +7160,10 @@ var YouTubeGallery = function YouTubeGallery(_ref) {
7152
7160
  window.history.pushState(vidState, '', newPath);
7153
7161
  } else {
7154
7162
  setSeries(seriesVid);
7155
- setVidUrl(nodes.videos[seriesVid - 1].url);
7156
- setVidThumbnail(nodes.videos[seriesVid - 1].thumbnail && nodes.videos[seriesVid - 1].thumbnail.asset ? urlFor(nodes.videos[seriesVid - 1].thumbnail.asset).url() : '');
7157
- if (nodes.videos[0].type) {
7158
- setVidType(nodes.videos[seriesVid - 1].type);
7163
+ setVidUrl(Videos[seriesVid - 1].url);
7164
+ setVidThumbnail(Videos[seriesVid - 1].thumbnail && Videos[seriesVid - 1].thumbnail.asset ? urlFor(Videos[seriesVid - 1].thumbnail.asset).url() : '');
7165
+ if (Videos[0].type) {
7166
+ setVidType(Videos[seriesVid - 1].type);
7159
7167
  }
7160
7168
  setVidLoaded(true);
7161
7169
  }
@@ -7166,7 +7174,7 @@ var YouTubeGallery = function YouTubeGallery(_ref) {
7166
7174
  if (vidLoaded == true) {
7167
7175
  var params = new URL(document.location).searchParams;
7168
7176
  var seriesVid = params.get('seriesVid');
7169
- var vidTitle = nodes.videos[series - 1].title;
7177
+ var vidTitle = Videos[series - 1].title;
7170
7178
  var originalTitle = document.title;
7171
7179
  if (seriesVid) {
7172
7180
  document.title = vidTitle + ' | ' + originalTitle;
@@ -7228,7 +7236,7 @@ var YouTubeGallery = function YouTubeGallery(_ref) {
7228
7236
  nextVid = currentVid + 1;
7229
7237
  }
7230
7238
  // set the new Video URL
7231
- setState(nodes.videos[nextVid].url, '', nextVid + 1);
7239
+ setState(Videos[nextVid].url, '', nextVid + 1);
7232
7240
  }
7233
7241
 
7234
7242
  var autoplayNextVideo = function autoplayNextVideo(e) {
@@ -7249,7 +7257,7 @@ var YouTubeGallery = function YouTubeGallery(_ref) {
7249
7257
  nextVid = currentVid + 1;
7250
7258
  }
7251
7259
  // set the new Video URL
7252
- setState(nodes.videos[nextVid].url, '', nextVid + 1);
7260
+ setState(Videos[nextVid].url, '', nextVid + 1);
7253
7261
  };
7254
7262
 
7255
7263
  var handlePlayPercent = function handlePlayPercent(player) {
@@ -7357,26 +7365,26 @@ var YouTubeGallery = function YouTubeGallery(_ref) {
7357
7365
  'Episode ',
7358
7366
  series
7359
7367
  ),
7360
- nodes.videos[series - 1] && React__default.createElement(
7368
+ Videos[series - 1] && React__default.createElement(
7361
7369
  'h2',
7362
7370
  { className: 'mb-3' },
7363
- nodes.videos[series - 1].title
7371
+ Videos[series - 1].title
7364
7372
  ),
7365
- nodes.videos[series - 1] && nodes.videos[series - 1].intro && React__default.createElement(
7373
+ Videos[series - 1] && Videos[series - 1].intro && React__default.createElement(
7366
7374
  'p',
7367
7375
  { className: 'mb-3' },
7368
7376
  React__default.createElement(
7369
7377
  'em',
7370
7378
  null,
7371
- nodes.videos[series - 1].intro
7379
+ Videos[series - 1].intro
7372
7380
  )
7373
7381
  ),
7374
- nodes.videos[series - 1] && nodes.videos[series - 1].text && React__default.createElement(BlockContent, _extends({ serializers: getSerializers, blocks: nodes.videos[series - 1].text, imageOptions: { w: 320, h: 240, fit: 'max' } }, client.config()))
7382
+ Videos[series - 1] && Videos[series - 1].text && React__default.createElement(BlockContent, _extends({ serializers: getSerializers, blocks: Videos[series - 1].text, imageOptions: { w: 320, h: 240, fit: 'max' } }, client.config()))
7375
7383
  ),
7376
7384
  React__default.createElement(
7377
7385
  'style',
7378
7386
  { jsx: 'true' },
7379
- '\n \n #fluid-video-container > div {\n position: relative;\n padding-bottom: 56.25%; /* 16:9 */\n height: 0;\n }\n #fluid-video-container .fluid-iframe {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100% !important;\n }\n\n span.btn {\n margin: 0 1rem;\n }\n \n \n '
7387
+ '\n #fluid-video-container > div {\n position: relative;\n padding-bottom: 56.25%; /* 16:9 */\n height: 0;\n }\n #fluid-video-container .fluid-iframe {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100% !important;\n }\n\n span.btn {\n margin: 0 1rem;\n }\n '
7380
7388
  )
7381
7389
  );
7382
7390
  };
@@ -8012,9 +8020,11 @@ var InscreenSensor = function (_React$Component) {
8012
8020
  var ArticleSeries = function ArticleSeries(_ref) {
8013
8021
  var nodes = _ref.nodes,
8014
8022
  client = _ref.client,
8023
+ pageview = _ref.pageview,
8015
8024
  getSerializers = _ref.getSerializers,
8016
8025
  accountIDs = _ref.accountIDs,
8017
- Ads = _ref.Ads;
8026
+ Ads = _ref.Ads,
8027
+ rootArticle = _ref.rootArticle;
8018
8028
 
8019
8029
  if (!nodes || !nodes.articles) {
8020
8030
  return null;
@@ -8175,7 +8185,7 @@ var ArticleSeries = function ArticleSeries(_ref) {
8175
8185
  // Change URL and do other changes
8176
8186
  var doChanges = function doChanges() {
8177
8187
  if (firstLoad) {
8178
- refreshAD();
8188
+ refreshAD(newPath);
8179
8189
  }
8180
8190
  window.history.pushState({ page: path }, '', newPath);
8181
8191
  document.title = title;
@@ -8255,6 +8265,7 @@ var ArticleSeries = function ArticleSeries(_ref) {
8255
8265
  var refreshAD = function refreshAD(path) {
8256
8266
  //const activeArticle = path
8257
8267
  //let targeting = getTargeting({ article: activeArticle, cpModificationRequired, position: props.position, prevUrl })
8268
+ if (pageview) pageview(path);
8258
8269
 
8259
8270
  if (!main_39) {
8260
8271
  lib_3.getGoogletag().then(function (googletag) {
@@ -8275,12 +8286,25 @@ var ArticleSeries = function ArticleSeries(_ref) {
8275
8286
  };
8276
8287
 
8277
8288
  var handleArrowClick = function handleArrowClick() {
8289
+ var newPath = router.asPath.split('?')[0];
8290
+ var title = nodes.seriesTitle;
8278
8291
  isScrollDown = true;
8279
8292
  upArrowClicked = true;
8280
8293
  arrowRef.current.style.visibility = 'hidden';
8281
8294
  window.scrollTo({ top: 0, behavior: 'smooth' });
8282
- window.history.pushState({}, '', router.asPath.split('?')[0]);
8283
- document.title = nodes.seriesTitle;
8295
+ window.history.pushState({}, '', newPath);
8296
+ document.title = title;
8297
+
8298
+ setCurrentURL(newPath);
8299
+ setCurrentTitle(title);
8300
+ if (rootArticle) {
8301
+ setCurrentSummary(rootArticle.summary ? rootArticle.summary : '');
8302
+ setCurrentThumbnail(urlFor(rootArticle.thumbnail.asset).url());
8303
+ } else {
8304
+ setCurrentSummary('');
8305
+ setCurrentThumbnail('');
8306
+ }
8307
+ refreshAD(newPath);
8284
8308
  };
8285
8309
 
8286
8310
  return React__default.createElement(
@@ -8288,10 +8312,10 @@ var ArticleSeries = function ArticleSeries(_ref) {
8288
8312
  null,
8289
8313
  React__default.createElement(
8290
8314
  'div',
8291
- { ref: arrowRef, className: 'scrollToTopArrow', onClick: function onClick() {
8315
+ { ref: arrowRef, className: 'scrollToTopArrow' },
8316
+ React__default.createElement(IoIosArrowDropupCircle, { style: { cursor: 'pointer' }, onClick: function onClick() {
8292
8317
  return handleArrowClick();
8293
- } },
8294
- React__default.createElement(IoIosArrowDropupCircle, null)
8318
+ } })
8295
8319
  ),
8296
8320
  React__default.createElement('hr', { className: 'article-seperater my-4' }),
8297
8321
  React__default.createElement(
@@ -8461,7 +8485,7 @@ var ArticleSeries = function ArticleSeries(_ref) {
8461
8485
  React__default.createElement(
8462
8486
  'style',
8463
8487
  { jsx: 'true' },
8464
- '\n .scrollToTopArrow {\n position: fixed;\n top: 150px;\n display: flex;\n justify-content: center;\n width: ' + contentWidth + 'px;\n opacity: 1;\n z-index: 99999999999;\n cursor: pointer;\n visibility: hidden;\n }\n .scrollToTopArrow > svg {\n min-height: 50px;\n min-width: 50px;\n max-height: 50px;\n max-width: 50px;\n }\n .block-content > div p {\n padding: 0;\n }\n\n h2.article-title {\n padding: 0;\n font-weight: 500;\n }\n h4.article-title {\n padding: 0;\n font-weight: 500;\n }\n h4.prevNext-title {\n padding: 0;\n font-size: 1rem;\n font-weight: 500;\n }\n .article-wrapper {\n border: 1px solid #252525;\n border-radius: 5px;\n padding: 1rem 1rem 0 1rem;\n margin-bottom: 1rem;\n }\n .prevNext-reading {\n margin-top: -10px;\n width: 75%;\n text-align: center;\n background: white;\n border: 1px solid #252525;\n align-self: center;\n display: none;\n }\n .showReading {\n display: block;\n }\n .author-details-wrapper a {\n color: #252525;\n }\n .objective-prevNext-Wrapper {\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n .objective-title {\n padding: 0 !important;\n }\n .prevNext-thumbnail {\n display: flex;\n flex-direction: column;\n min-width: 225px;\n max-width: 225px;\n overflow: hidden;\n align-items: center;\n object-fit: contain;\n border-radius: 15px;\n }\n .prevNext-thumbnail img {\n height: 125px;\n object-fit: contain;\n border-radius: 15px;\n }\n .prevNext-summary {\n text-align: center;\n }\n .prevNext-publishDate {\n font-size: 0.75rem;\n margin-top: 0.5rem;\n }\n .prevNext-title {\n padding: 0 !important;\n line-height: 1 !important;\n font-weight: 500;\n }\n .prevNextWrapper {\n display: flex;\n flex-direction: row;\n justify-content: space-evenly;\n flex-wrap: wrap;\n }\n .prevNextWrapper a {\n display: flex;\n flex-direction: column;\n color: #252525;\n align-items: center;\n }\n .prevNextCards {\n max-width: 250px;\n margin-bottom: 1rem;\n }\n @media only screen and (max-width: 568px) {\n .prevNextWrapper {\n flex-direction: column;\n align-items: center;\n }\n .prevNextCards {\n margin-bottom: 2rem;\n }\n }\n @media only screen and (max-width: 568px) {\n }\n '
8488
+ '\n .scrollToTopArrow {\n position: fixed;\n top: 150px;\n display: flex;\n justify-content: center;\n width: ' + contentWidth + 'px;\n opacity: 1;\n z-index: 99999999999;\n visibility: hidden;\n }\n .scrollToTopArrow > svg {\n min-height: 50px;\n min-width: 50px;\n max-height: 50px;\n max-width: 50px;\n }\n .block-content > div p {\n padding: 0;\n }\n\n h2.article-title {\n padding: 0;\n font-weight: 500;\n }\n h4.article-title {\n padding: 0;\n font-weight: 500;\n }\n h4.prevNext-title {\n padding: 0;\n font-size: 1rem;\n font-weight: 500;\n }\n .article-wrapper {\n border: 1px solid #252525;\n border-radius: 5px;\n padding: 1rem 1rem 0 1rem;\n margin-bottom: 1rem;\n }\n .prevNext-reading {\n margin-top: -10px;\n width: 75%;\n text-align: center;\n background: white;\n border: 1px solid #252525;\n align-self: center;\n display: none;\n }\n .showReading {\n display: block;\n }\n .author-details-wrapper a {\n color: #252525;\n }\n .objective-prevNext-Wrapper {\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n .objective-title {\n padding: 0 !important;\n }\n .prevNext-thumbnail {\n display: flex;\n flex-direction: column;\n min-width: 225px;\n max-width: 225px;\n overflow: hidden;\n align-items: center;\n object-fit: contain;\n border-radius: 15px;\n }\n .prevNext-thumbnail img {\n height: 125px;\n object-fit: contain;\n border-radius: 15px;\n }\n .prevNext-summary {\n text-align: center;\n }\n .prevNext-publishDate {\n font-size: 0.75rem;\n margin-top: 0.5rem;\n }\n .prevNext-title {\n padding: 0 !important;\n line-height: 1 !important;\n font-weight: 500;\n }\n .prevNextWrapper {\n display: flex;\n flex-direction: row;\n justify-content: space-evenly;\n flex-wrap: wrap;\n }\n .prevNextWrapper a {\n display: flex;\n flex-direction: column;\n color: #252525;\n align-items: center;\n }\n .prevNextCards {\n max-width: 250px;\n margin-bottom: 1rem;\n }\n @media only screen and (max-width: 568px) {\n .prevNextWrapper {\n flex-direction: column;\n align-items: center;\n }\n .prevNextCards {\n margin-bottom: 2rem;\n }\n }\n @media only screen and (max-width: 568px) {\n }\n '
8465
8489
  )
8466
8490
  )
8467
8491
  );
@@ -8815,7 +8839,8 @@ var getSerializers = function getSerializers() {
8815
8839
  contextualADFlag = _props$2 === undefined ? false : _props$2,
8816
8840
  articleId = props[9],
8817
8841
  Ads = props[10],
8818
- targeting = props[11];
8842
+ targeting = props[11],
8843
+ article = props[12];
8819
8844
 
8820
8845
  return {
8821
8846
  types: {
@@ -8837,7 +8862,7 @@ var getSerializers = function getSerializers() {
8837
8862
  articleSeries: function articleSeries(_ref3) {
8838
8863
  var node = _ref3.node;
8839
8864
 
8840
- return React__default.createElement(ArticleSeries, { nodes: node, accountIDs: videoAccountIDs || {}, client: client, getSerializers: getSerializers.apply(undefined, props), Ads: Ads || null });
8865
+ return React__default.createElement(ArticleSeries, { nodes: node, accountIDs: videoAccountIDs || {}, pageview: pageview, client: client, getSerializers: getSerializers.apply(undefined, props), Ads: Ads || null, rootArticle: article || null });
8841
8866
  },
8842
8867
  figure: function figure(_ref4) {
8843
8868
  var node = _ref4.node;
@@ -9027,4 +9052,4 @@ var getSerializers = function getSerializers() {
9027
9052
  };
9028
9053
  };
9029
9054
 
9030
- export { InscreenSensor as I, getSerializers as g, renderAuthor as r };
9055
+ export { getSerializers as g, renderAuthor as r };
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-74d46cc5.js';
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';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.694",
3
+ "version": "1.0.696-1034",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",