@mjhls/mjh-framework 1.0.695 → 1.0.696-1034-2

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.695
2
+ # mjh-framework v. 1.0.696-1034-2
3
3
 
4
4
  > Foundation Framework
5
5
 
@@ -48,11 +48,12 @@ 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-c0bfab13.js');
51
+ var getSerializers = require('./index-7a6308f1.js');
52
52
  require('./util-f2c1b65b.js');
53
53
  require('./brightcove-react-player-loader.es-156bd4d6.js');
54
54
  require('react-bootstrap/Pagination');
55
55
  require('next/head');
56
+ require('react-bootstrap/Figure');
56
57
 
57
58
  var ExternalResources = function ExternalResources(props) {
58
59
  var resources = props.resources,
@@ -61,7 +62,11 @@ var ExternalResources = function ExternalResources(props) {
61
62
  _props$cta = props.cta,
62
63
  cta = _props$cta === undefined ? 'Learn More' : _props$cta,
63
64
  _props$url = props.url,
64
- url = _props$url === undefined ? 'resources' : _props$url;
65
+ url = _props$url === undefined ? 'resources' : _props$url,
66
+ _props$recentTitle = props.recentTitle,
67
+ recentTitle = _props$recentTitle === undefined ? 'Recent' : _props$recentTitle,
68
+ _props$archiveTitle = props.archiveTitle,
69
+ archiveTitle = _props$archiveTitle === undefined ? 'Archive' : _props$archiveTitle;
65
70
 
66
71
  var _useState = React.useState(display && (display === 'recent' || display === 'archived') ? display : 'recent'),
67
72
  _useState2 = slicedToArray._slicedToArray(_useState, 2),
@@ -85,7 +90,7 @@ var ExternalResources = function ExternalResources(props) {
85
90
  return 'recent';
86
91
  });
87
92
  }, className: active === 'recent' ? 'active' : '' },
88
- 'Recent'
93
+ recentTitle
89
94
  ),
90
95
  React__default.createElement(
91
96
  'div',
@@ -94,13 +99,13 @@ var ExternalResources = function ExternalResources(props) {
94
99
  return 'archived';
95
100
  });
96
101
  }, className: active === 'archived' ? 'active' : '' },
97
- 'Archive'
102
+ archiveTitle
98
103
  )
99
104
  ),
100
- resources[active].length > 0 ? resources[active].map(function (r, i) {
105
+ resources[active].length > 0 ? resources[active].map(function (r) {
101
106
  return React__default.createElement(
102
107
  'div',
103
- { key: i, className: 'resource' },
108
+ { key: r._id, className: 'resource' },
104
109
  React__default.createElement(
105
110
  'div',
106
111
  { id: 'thumb' },
@@ -181,7 +186,7 @@ var ExternalResources = function ExternalResources(props) {
181
186
  }) : React__default.createElement(
182
187
  'p',
183
188
  null,
184
- 'No ' + active + ' resources available. '
189
+ 'No content available.'
185
190
  ),
186
191
  React__default.createElement(
187
192
  'style',
@@ -57,11 +57,12 @@ 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-c0bfab13.js');
60
+ var getSerializers = require('./index-7a6308f1.js');
61
61
  require('./util-f2c1b65b.js');
62
62
  require('./brightcove-react-player-loader.es-156bd4d6.js');
63
63
  require('react-bootstrap/Pagination');
64
64
  require('next/head');
65
+ require('react-bootstrap/Figure');
65
66
  require('react-bootstrap/Carousel');
66
67
  var Feature = require('./Feature.js');
67
68
  require('react-bootstrap/Breadcrumb');
@@ -52,25 +52,27 @@ var VideoSeriesListing = function (_React$Component) {
52
52
 
53
53
  return _ret = (_temp = (_this = inherits._possibleConstructorReturn(this, (_ref = VideoSeriesListing.__proto__ || inherits._Object$getPrototypeOf(VideoSeriesListing)).call.apply(_ref, [this].concat(args))), _this), _this.page = _this.props.page, _this.mapping = _this.props.mapping, _this.data = _this.props.dataRecord, _this.query = _this.props.query, _this.params = _this.props.params, _this.today = moment.moment().utc().format(), _this.dataArr = [_this.data], _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.state = {
54
54
  data: _this.dataArr.map(function (item) {
55
- var tempObj = item;
56
- if (tempObj.body) {
57
- var filteredBody = tempObj.body.map(function (item) {
58
- if (item._type === 'articleSeries') {
59
- var innerObj = item;
60
- var filteredArticles = innerObj.articles.filter(function (article) {
61
- if ((article.is_visible === true || !article.hasOwnProperty('is_visible')) && (_this.today >= article.published || !article.hasOwnProperty('published'))) {
62
- return article;
63
- }
64
- });
65
- innerObj.body = filteredArticles;
66
- return innerObj;
67
- } else {
68
- return item;
69
- }
70
- });
55
+ var tempObj = item.map(function (arrItem) {
56
+ if (arrItem.body) {
57
+ var filteredBody = arrItem.body.map(function (item) {
58
+ if (item._type === 'youtubeGallery') {
59
+ var innerObj = item;
60
+ var filteredArticles = innerObj.videos.filter(function (video) {
61
+ if ((video.is_visible === true || !video.hasOwnProperty('is_visible')) && (_this.today >= video.published || !video.hasOwnProperty('published'))) {
62
+ return video;
63
+ }
64
+ });
65
+ innerObj.videos = filteredArticles;
66
+ return innerObj;
67
+ } else {
68
+ return item;
69
+ }
70
+ });
71
71
 
72
- tempObj.body = filteredBody;
73
- }
72
+ arrItem.body = filteredBody;
73
+ }
74
+ return arrItem;
75
+ });
74
76
  return tempObj;
75
77
  }),
76
78
  per: _this.params ? _this.params.to : 2,
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,11 +51,12 @@ 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-c0bfab13.js');
54
+ var getSerializers = require('./index-7a6308f1.js');
54
55
  require('./util-f2c1b65b.js');
55
56
  require('./brightcove-react-player-loader.es-156bd4d6.js');
56
57
  require('react-bootstrap/Pagination');
57
58
  var Head = _interopDefault(require('next/head'));
59
+ require('react-bootstrap/Figure');
58
60
  require('react-share');
59
61
  var SocialShare = require('./SocialShare.js');
60
62
  var FormControl = _interopDefault(require('react-bootstrap/FormControl'));
@@ -396,7 +398,10 @@ var Article = function Article(props) {
396
398
  _props$sponsoredFlag = props.sponsoredFlag,
397
399
  sponsoredFlag = _props$sponsoredFlag === undefined ? false : _props$sponsoredFlag,
398
400
  _props$authorImgHeigh = props.authorImgHeight,
399
- authorImgHeight = _props$authorImgHeigh === undefined ? 270 : _props$authorImgHeigh;
401
+ authorImgHeight = _props$authorImgHeigh === undefined ? 270 : _props$authorImgHeigh,
402
+ active = props.active,
403
+ containerHeight = props.containerHeight;
404
+
400
405
 
401
406
  var targeting = getTargeting.getTargeting(props);
402
407
  var onChangeArticle = props.onChangeArticle;
@@ -810,16 +815,16 @@ var Article = function Article(props) {
810
815
  React__default.Fragment,
811
816
  null,
812
817
  React__default.createElement(
813
- getSerializers.InscreenSensor,
818
+ visibilitySensor.VisibilitySensor,
814
819
  {
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);
820
+ partialVisibility: true,
821
+ offset: { bottom: 100, top: containerHeight - 100 },
822
+ onChange: function onChange(isVisible) {
823
+ if (isVisible && queueData.length > 1) {
824
+ onChangeArticle(url, meta);
825
+ setVisibleFlag(function () {
826
+ return true;
827
+ });
823
828
  }
824
829
  } },
825
830
  React__default.createElement(
@@ -1023,16 +1028,16 @@ var Article = function Article(props) {
1023
1028
  )
1024
1029
  ),
1025
1030
  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
1031
  )
1035
1032
  ),
1033
+ showIsi && Array.isArray(isi) && isi.length > 0 && React__default.createElement(
1034
+ ISI,
1035
+ null,
1036
+ React__default.createElement(BlockContent.BlockContent, {
1037
+ serializers: getSerializers.getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, false, null, props.article.Ads, targeting),
1038
+ blocks: isi
1039
+ })
1040
+ ),
1036
1041
  main.main_39 && !sponsoredFlag && props.article.Ads && props.article.Ads.length > 0 && props.article.Ads.map(function (ad, index) {
1037
1042
  if (index > 0) {
1038
1043
  return React__default.createElement(
@@ -1087,7 +1092,25 @@ var ArticleQueue = function ArticleQueue(props) {
1087
1092
  showRelatedArticles = props.showRelatedArticles,
1088
1093
  canonicalTag = props.canonicalTag;
1089
1094
 
1095
+ var _useState = React.useState(0),
1096
+ _useState2 = slicedToArray._slicedToArray(_useState, 2),
1097
+ containerHeight = _useState2[0],
1098
+ setContainerHeight = _useState2[1];
1090
1099
 
1100
+ React.useEffect(function () {
1101
+ setContainerHeight(function () {
1102
+ return window.innerHeight;
1103
+ });
1104
+ var handleResize = function handleResize() {
1105
+ return setContainerHeight(function () {
1106
+ return window.innerHeight;
1107
+ });
1108
+ };
1109
+ window.addEventListener('resize', handleResize);
1110
+ return function () {
1111
+ return window.removeEventListener('resize', handleResize);
1112
+ };
1113
+ }, []);
1091
1114
  var firstArticle = function firstArticle() {
1092
1115
  var article = _extends._Object$assign({}, props.article);
1093
1116
  var targeting = getTargeting.getTargeting(props);
@@ -1095,10 +1118,15 @@ var ArticleQueue = function ArticleQueue(props) {
1095
1118
  return article;
1096
1119
  };
1097
1120
 
1098
- var _useState = React.useState([firstArticle()]),
1099
- _useState2 = slicedToArray._slicedToArray(_useState, 2),
1100
- queueData = _useState2[0],
1101
- setQueueData = _useState2[1];
1121
+ var _useState3 = React.useState([firstArticle()]),
1122
+ _useState4 = slicedToArray._slicedToArray(_useState3, 2),
1123
+ queueData = _useState4[0],
1124
+ setQueueData = _useState4[1];
1125
+
1126
+ var _useState5 = React.useState(queueData[0]._id),
1127
+ _useState6 = slicedToArray._slicedToArray(_useState5, 2),
1128
+ active = _useState6[0],
1129
+ setActive = _useState6[1];
1102
1130
 
1103
1131
  var refreshAD = function refreshAD(path) {
1104
1132
  var activeArticle = queueData.find(function (item) {
@@ -1148,16 +1176,11 @@ var ArticleQueue = function ArticleQueue(props) {
1148
1176
  };
1149
1177
 
1150
1178
  var preVscroll = 0;
1151
- var isScrollDown = true;
1152
1179
 
1153
1180
  var scrollDirectionDetect = function scrollDirectionDetect(e) {
1154
1181
  var window = e.currentTarget;
1155
1182
 
1156
- if (preVscroll > window.scrollY) {
1157
- isScrollDown = false;
1158
- } else if (preVscroll < window.scrollY) {
1159
- isScrollDown = true;
1160
- }
1183
+ if (preVscroll > window.scrollY) ; else if (preVscroll < window.scrollY) ;
1161
1184
  preVscroll = window.scrollY;
1162
1185
  };
1163
1186
 
@@ -1247,38 +1270,23 @@ var ArticleQueue = function ArticleQueue(props) {
1247
1270
  }
1248
1271
  };
1249
1272
 
1250
- var onChangeArticle = function onChangeArticle(path, visibility, meta) {
1273
+ var onChangeArticle = function onChangeArticle(path, meta) {
1251
1274
  var currentPath = window && window.location && window.location.pathname ? window.location.pathname.replace('/view/', '') : '';
1252
1275
  var newPath = '/view/' + path;
1253
-
1276
+ var activeArticle = queueData.find(function (item) {
1277
+ return item.url.current === path;
1278
+ });
1279
+ setActive(function () {
1280
+ return activeArticle._id;
1281
+ });
1254
1282
  // 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
- }
1283
+ window.history.pushState({ page: path }, meta.shareTitle, newPath);
1284
+ changeMeta(meta);
1285
+ if (props.setCustomDimensions) {
1286
+ props.setCustomDimensions(activeArticle, '200', prevUrl);
1281
1287
  }
1288
+ if (props.pageview) props.pageview(newPath);
1289
+ refreshAD(path);
1282
1290
  };
1283
1291
 
1284
1292
  return React__default.createElement(
@@ -1288,10 +1296,12 @@ var ArticleQueue = function ArticleQueue(props) {
1288
1296
  return React__default.createElement(Article, _extends._extends({
1289
1297
  key: index
1290
1298
  }, props, {
1299
+ containerHeight: containerHeight,
1291
1300
  onChangeArticle: onChangeArticle,
1292
1301
  authorPrfix: authorPrefix,
1293
1302
  article: article,
1294
- cpModificationRequired: cpModificationRequired
1303
+ cpModificationRequired: cpModificationRequired,
1304
+ active: active === article._id
1295
1305
  // Passing queueData to check for single article
1296
1306
  , queueData: queueData,
1297
1307
  showRelatedArticles: showRelatedArticles
@@ -74,7 +74,7 @@ var YoutubeGroup = function YoutubeGroup(props) {
74
74
  var tileHeight = tileArray.current.map(function (tile) {
75
75
  return tile.scrollHeight;
76
76
  });
77
- console.log(tileArray.current);
77
+
78
78
  for (var ele in tileArray.current) {
79
79
  var eleHeight = tileHeight[ele] < 185 ? 185 : tileHeight[ele];
80
80
  tileArray.current[ele].style.height = eleHeight + 'px';
@@ -43,11 +43,12 @@ 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-c0bfab13.js');
46
+ var getSerializers = require('./index-7a6308f1.js');
47
47
  require('./util-f2c1b65b.js');
48
48
  require('./brightcove-react-player-loader.es-156bd4d6.js');
49
49
  require('react-bootstrap/Pagination');
50
50
  require('next/head');
51
+ require('react-bootstrap/Figure');
51
52
 
52
53
 
53
54