@mjhls/mjh-framework 1.0.644 → 1.0.646

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.644
2
+ # mjh-framework v. 1.0.646
3
3
 
4
4
  > Foundation Framework
5
5
 
@@ -481,7 +481,8 @@ var MasterDeck = function (_React$Component) {
481
481
  this.state.scrolling ? React__default.createElement(
482
482
  'button',
483
483
  {
484
- style: { margin: 'auto', width: '100%' },
484
+ className: 'btn',
485
+ style: { margin: '0 auto 2rem', display: 'block', fontSize: '18px', padding: '.5rem 1.5rem', boxShadow: '1px 2px 4px 4px rgba(0,0,0,.15)', background: 'var(--primary)', color: '#fff', borderRadius: '5px' },
485
486
  onClick: function onClick(e) {
486
487
  _this3.loadMore();
487
488
  } },
@@ -5,8 +5,11 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
5
5
  require('./_commonjsHelpers-06173234.js');
6
6
  var React = require('react');
7
7
  var React__default = _interopDefault(React);
8
+ require('prop-types');
8
9
  var moment = require('./moment-66a6a284.js');
10
+ require('react-dom');
9
11
  var index$1 = require('./index-b5eb3ff8.js');
12
+ var index$2 = require('./index-da796b8c.js');
10
13
  require('react-bootstrap/Media');
11
14
 
12
15
  /*
@@ -67,10 +70,14 @@ var RelatedContent = function RelatedContent(props) {
67
70
  React__default.createElement(
68
71
  'figure',
69
72
  null,
70
- React__default.createElement('img', {
71
- src: article.thumbnail ? urlFor(article.thumbnail.asset).width(500).url() : defaultImage,
72
- alt: article.title
73
- })
73
+ React__default.createElement(
74
+ index$2.LazyLoad,
75
+ { once: true },
76
+ React__default.createElement('img', {
77
+ src: article.thumbnail ? urlFor(article.thumbnail.asset).width(500).url() : defaultImage,
78
+ alt: article.title
79
+ })
80
+ )
74
81
  ),
75
82
  React__default.createElement(
76
83
  'div',
@@ -229,17 +229,74 @@ var VideoSeriesListing = function (_React$Component) {
229
229
  }
230
230
 
231
231
  inherits._createClass(VideoSeriesListing, [{
232
+ key: 'componentDidMount',
233
+ value: function componentDidMount() {
234
+ console.log(this.state);
235
+ }
236
+ }, {
232
237
  key: 'render',
233
238
  value: function render() {
234
239
  var _this2 = this;
235
240
 
236
- return React__default.createElement(
237
- React__default.Fragment,
238
- null,
239
- this.state.data.length >= 1 && this.state.data[0].length > 0 ? //Check if any Video Groups available
240
- React__default.createElement(
241
- index_es.InfiniteScroll,
242
- { dataLength: this.state.data.length, next: this.loadMore, hasMore: this.state.scrolling, scrollThreshold: 0.8 },
241
+ var _props$autoScroll = this.props.autoScroll,
242
+ autoScroll = _props$autoScroll === undefined ? true : _props$autoScroll;
243
+
244
+
245
+ if (autoScroll) {
246
+ return React__default.createElement(
247
+ React__default.Fragment,
248
+ null,
249
+ this.state.data.length >= 1 && this.state.data[0].length > 0 ?
250
+ //Check if any Video Groups available
251
+ React__default.createElement(
252
+ index_es.InfiniteScroll,
253
+ { dataLength: this.state.data.length, next: this.loadMore, hasMore: this.state.scrolling, scrollThreshold: 0.8 },
254
+ React__default.createElement(
255
+ Container,
256
+ null,
257
+ this.state.data && this.state.data.map(function (series, index) {
258
+ var page = series && series.length > 0 && series[0].pageNumber !== 1 ? series[0].pageNumber : 1;
259
+
260
+ return React__default.createElement(
261
+ React__default.Fragment,
262
+ { key: index },
263
+ React__default.createElement(
264
+ visibilitySensor.VisibilitySensor,
265
+ {
266
+ onChange: function onChange(isVisible) {
267
+ isVisible && _this2.changePageNumber(page);
268
+ } },
269
+ React__default.createElement('div', { className: 'visibility-sensor', style: { minHeight: '.25rem' } })
270
+ ),
271
+ React__default.createElement(
272
+ 'div',
273
+ null,
274
+ _this2.renderSeries(series)
275
+ )
276
+ );
277
+ })
278
+ )
279
+ ) : React__default.createElement(
280
+ 'div',
281
+ { style: { marginTop: '10px' } },
282
+ React__default.createElement(
283
+ 'h5',
284
+ null,
285
+ React__default.createElement(
286
+ 'em',
287
+ null,
288
+ 'New content coming soon, please check back later.'
289
+ )
290
+ )
291
+ )
292
+ );
293
+ }
294
+ if (!autoScroll) {
295
+ return React__default.createElement(
296
+ React__default.Fragment,
297
+ null,
298
+ this.state.data.length >= 1 && this.state.data[0].length > 0 ?
299
+ //Check if any Video Groups available
243
300
  React__default.createElement(
244
301
  Container,
245
302
  null,
@@ -261,24 +318,43 @@ var VideoSeriesListing = function (_React$Component) {
261
318
  'div',
262
319
  null,
263
320
  _this2.renderSeries(series)
321
+ ),
322
+ _this2.state.scrolling ? React__default.createElement(
323
+ 'button',
324
+ {
325
+ className: 'btn',
326
+ style: { margin: '0 auto 2rem', display: 'block', fontSize: '18px', padding: '.5rem 1.5rem', boxShadow: '1px 2px 4px 4px rgba(0,0,0,.15)', background: 'var(--primary)', color: '#fff', borderRadius: '5px' },
327
+ onClick: function onClick(e) {
328
+ e.target.style.display = 'none';
329
+ _this2.loadMore();
330
+ } },
331
+ 'Load More'
332
+ ) : React__default.createElement(
333
+ 'p',
334
+ { style: { textAlign: 'center' } },
335
+ React__default.createElement(
336
+ 'b',
337
+ null,
338
+ 'End of data'
339
+ )
264
340
  )
265
341
  );
266
342
  })
267
- )
268
- ) : React__default.createElement(
269
- 'div',
270
- { style: { marginTop: '10px' } },
271
- React__default.createElement(
272
- 'h5',
273
- null,
343
+ ) : React__default.createElement(
344
+ 'div',
345
+ { style: { marginTop: '10px' } },
274
346
  React__default.createElement(
275
- 'em',
347
+ 'h5',
276
348
  null,
277
- 'New content coming soon, please check back later.'
349
+ React__default.createElement(
350
+ 'em',
351
+ null,
352
+ 'New content coming soon, please check back later.'
353
+ )
278
354
  )
279
355
  )
280
- )
281
- );
356
+ );
357
+ }
282
358
  }
283
359
  }]);
284
360
 
package/dist/cjs/View.js CHANGED
@@ -1282,7 +1282,9 @@ var View = function View(props) {
1282
1282
  _props$showRelatedArt = props.showRelatedArticles,
1283
1283
  showRelatedArticles = _props$showRelatedArt === undefined ? false : _props$showRelatedArt,
1284
1284
  _props$canonicalTag = props.canonicalTag,
1285
- canonicalTag = _props$canonicalTag === undefined ? true : _props$canonicalTag;
1285
+ canonicalTag = _props$canonicalTag === undefined ? true : _props$canonicalTag,
1286
+ _props$infiniteScroll = props.infiniteScrollFlag,
1287
+ infiniteScrollFlag = _props$infiniteScroll === undefined ? true : _props$infiniteScroll;
1286
1288
  var _props$article = props.article,
1287
1289
  _props$article$passwo = _props$article.passwordLock,
1288
1290
  passwordLock = _props$article$passwo === undefined ? false : _props$article$passwo,
@@ -1340,7 +1342,7 @@ var View = function View(props) {
1340
1342
 
1341
1343
  var isVideoSeries = checkVideoSeries(props.article);
1342
1344
  var isArticleSeries = checkArticleSeries(props.article);
1343
- var needInfiniteScroll = ['Articles', 'Videos', 'Podcasts'].includes(article.category.name) && article.taxonomyMapping && article.passwordLock !== true && !isVideoSeries && !isArticleSeries && !article.ExcludeFromInfiniteScroll && !sponsoredFlag;
1345
+ var needInfiniteScroll = ['Articles', 'Videos', 'Podcasts'].includes(article.category.name) && article.taxonomyMapping && article.passwordLock !== true && !isVideoSeries && !isArticleSeries && !article.ExcludeFromInfiniteScroll && !sponsoredFlag && infiniteScrollFlag;
1344
1346
 
1345
1347
  if (['Articles', 'Videos', 'Podcasts'].includes(article.category.name)) {
1346
1348
  description = null;
@@ -475,7 +475,8 @@ var MasterDeck = function (_React$Component) {
475
475
  this.state.scrolling ? React__default.createElement(
476
476
  'button',
477
477
  {
478
- style: { margin: 'auto', width: '100%' },
478
+ className: 'btn',
479
+ style: { margin: '0 auto 2rem', display: 'block', fontSize: '18px', padding: '.5rem 1.5rem', boxShadow: '1px 2px 4px 4px rgba(0,0,0,.15)', background: 'var(--primary)', color: '#fff', borderRadius: '5px' },
479
480
  onClick: function onClick(e) {
480
481
  _this3.loadMore();
481
482
  } },
@@ -1,7 +1,10 @@
1
1
  import './_commonjsHelpers-0c4b6f40.js';
2
2
  import React__default from 'react';
3
+ import 'prop-types';
3
4
  import { m as moment } from './moment-12415288.js';
5
+ import 'react-dom';
4
6
  import { i as imageUrlBuilder } from './index-51a80699.js';
7
+ import { L as LazyLoad } from './index-5f9f807a.js';
5
8
  import 'react-bootstrap/Media';
6
9
 
7
10
  /*
@@ -62,10 +65,14 @@ var RelatedContent = function RelatedContent(props) {
62
65
  React__default.createElement(
63
66
  'figure',
64
67
  null,
65
- React__default.createElement('img', {
66
- src: article.thumbnail ? urlFor(article.thumbnail.asset).width(500).url() : defaultImage,
67
- alt: article.title
68
- })
68
+ React__default.createElement(
69
+ LazyLoad,
70
+ { once: true },
71
+ React__default.createElement('img', {
72
+ src: article.thumbnail ? urlFor(article.thumbnail.asset).width(500).url() : defaultImage,
73
+ alt: article.title
74
+ })
75
+ )
69
76
  ),
70
77
  React__default.createElement(
71
78
  'div',
@@ -223,17 +223,74 @@ var VideoSeriesListing = function (_React$Component) {
223
223
  }
224
224
 
225
225
  _createClass(VideoSeriesListing, [{
226
+ key: 'componentDidMount',
227
+ value: function componentDidMount() {
228
+ console.log(this.state);
229
+ }
230
+ }, {
226
231
  key: 'render',
227
232
  value: function render() {
228
233
  var _this2 = this;
229
234
 
230
- return React__default.createElement(
231
- React__default.Fragment,
232
- null,
233
- this.state.data.length >= 1 && this.state.data[0].length > 0 ? //Check if any Video Groups available
234
- React__default.createElement(
235
- InfiniteScroll,
236
- { dataLength: this.state.data.length, next: this.loadMore, hasMore: this.state.scrolling, scrollThreshold: 0.8 },
235
+ var _props$autoScroll = this.props.autoScroll,
236
+ autoScroll = _props$autoScroll === undefined ? true : _props$autoScroll;
237
+
238
+
239
+ if (autoScroll) {
240
+ return React__default.createElement(
241
+ React__default.Fragment,
242
+ null,
243
+ this.state.data.length >= 1 && this.state.data[0].length > 0 ?
244
+ //Check if any Video Groups available
245
+ React__default.createElement(
246
+ InfiniteScroll,
247
+ { dataLength: this.state.data.length, next: this.loadMore, hasMore: this.state.scrolling, scrollThreshold: 0.8 },
248
+ React__default.createElement(
249
+ Container,
250
+ null,
251
+ this.state.data && this.state.data.map(function (series, index) {
252
+ var page = series && series.length > 0 && series[0].pageNumber !== 1 ? series[0].pageNumber : 1;
253
+
254
+ return React__default.createElement(
255
+ React__default.Fragment,
256
+ { key: index },
257
+ React__default.createElement(
258
+ VisibilitySensor,
259
+ {
260
+ onChange: function onChange(isVisible) {
261
+ isVisible && _this2.changePageNumber(page);
262
+ } },
263
+ React__default.createElement('div', { className: 'visibility-sensor', style: { minHeight: '.25rem' } })
264
+ ),
265
+ React__default.createElement(
266
+ 'div',
267
+ null,
268
+ _this2.renderSeries(series)
269
+ )
270
+ );
271
+ })
272
+ )
273
+ ) : React__default.createElement(
274
+ 'div',
275
+ { style: { marginTop: '10px' } },
276
+ React__default.createElement(
277
+ 'h5',
278
+ null,
279
+ React__default.createElement(
280
+ 'em',
281
+ null,
282
+ 'New content coming soon, please check back later.'
283
+ )
284
+ )
285
+ )
286
+ );
287
+ }
288
+ if (!autoScroll) {
289
+ return React__default.createElement(
290
+ React__default.Fragment,
291
+ null,
292
+ this.state.data.length >= 1 && this.state.data[0].length > 0 ?
293
+ //Check if any Video Groups available
237
294
  React__default.createElement(
238
295
  Container,
239
296
  null,
@@ -255,24 +312,43 @@ var VideoSeriesListing = function (_React$Component) {
255
312
  'div',
256
313
  null,
257
314
  _this2.renderSeries(series)
315
+ ),
316
+ _this2.state.scrolling ? React__default.createElement(
317
+ 'button',
318
+ {
319
+ className: 'btn',
320
+ style: { margin: '0 auto 2rem', display: 'block', fontSize: '18px', padding: '.5rem 1.5rem', boxShadow: '1px 2px 4px 4px rgba(0,0,0,.15)', background: 'var(--primary)', color: '#fff', borderRadius: '5px' },
321
+ onClick: function onClick(e) {
322
+ e.target.style.display = 'none';
323
+ _this2.loadMore();
324
+ } },
325
+ 'Load More'
326
+ ) : React__default.createElement(
327
+ 'p',
328
+ { style: { textAlign: 'center' } },
329
+ React__default.createElement(
330
+ 'b',
331
+ null,
332
+ 'End of data'
333
+ )
258
334
  )
259
335
  );
260
336
  })
261
- )
262
- ) : React__default.createElement(
263
- 'div',
264
- { style: { marginTop: '10px' } },
265
- React__default.createElement(
266
- 'h5',
267
- null,
337
+ ) : React__default.createElement(
338
+ 'div',
339
+ { style: { marginTop: '10px' } },
268
340
  React__default.createElement(
269
- 'em',
341
+ 'h5',
270
342
  null,
271
- 'New content coming soon, please check back later.'
343
+ React__default.createElement(
344
+ 'em',
345
+ null,
346
+ 'New content coming soon, please check back later.'
347
+ )
272
348
  )
273
349
  )
274
- )
275
- );
350
+ );
351
+ }
276
352
  }
277
353
  }]);
278
354
 
package/dist/esm/View.js CHANGED
@@ -1276,7 +1276,9 @@ var View = function View(props) {
1276
1276
  _props$showRelatedArt = props.showRelatedArticles,
1277
1277
  showRelatedArticles = _props$showRelatedArt === undefined ? false : _props$showRelatedArt,
1278
1278
  _props$canonicalTag = props.canonicalTag,
1279
- canonicalTag = _props$canonicalTag === undefined ? true : _props$canonicalTag;
1279
+ canonicalTag = _props$canonicalTag === undefined ? true : _props$canonicalTag,
1280
+ _props$infiniteScroll = props.infiniteScrollFlag,
1281
+ infiniteScrollFlag = _props$infiniteScroll === undefined ? true : _props$infiniteScroll;
1280
1282
  var _props$article = props.article,
1281
1283
  _props$article$passwo = _props$article.passwordLock,
1282
1284
  passwordLock = _props$article$passwo === undefined ? false : _props$article$passwo,
@@ -1334,7 +1336,7 @@ var View = function View(props) {
1334
1336
 
1335
1337
  var isVideoSeries = checkVideoSeries(props.article);
1336
1338
  var isArticleSeries = checkArticleSeries(props.article);
1337
- var needInfiniteScroll = ['Articles', 'Videos', 'Podcasts'].includes(article.category.name) && article.taxonomyMapping && article.passwordLock !== true && !isVideoSeries && !isArticleSeries && !article.ExcludeFromInfiniteScroll && !sponsoredFlag;
1339
+ var needInfiniteScroll = ['Articles', 'Videos', 'Podcasts'].includes(article.category.name) && article.taxonomyMapping && article.passwordLock !== true && !isVideoSeries && !isArticleSeries && !article.ExcludeFromInfiniteScroll && !sponsoredFlag && infiniteScrollFlag;
1338
1340
 
1339
1341
  if (['Articles', 'Videos', 'Podcasts'].includes(article.category.name)) {
1340
1342
  description = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.644",
3
+ "version": "1.0.646",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",