@mjhls/mjh-framework 1.0.607 → 1.0.609

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.607
2
+ # mjh-framework v. 1.0.609
3
3
 
4
4
  > Foundation Framework
5
5
 
@@ -53,7 +53,7 @@ var DeckQueue = function (_React$Component) {
53
53
  args[_key] = arguments[_key];
54
54
  }
55
55
 
56
- return _ret = (_temp = (_this = inherits._possibleConstructorReturn(this, (_ref = DeckQueue.__proto__ || inherits._Object$getPrototypeOf(DeckQueue)).call.apply(_ref, [this].concat(args))), _this), _this.page = _this.props.page, _this.data = _this.props.dataRecord, _this.query = _this.props.query, _this.params = _this.props.params, _this.pointer = _this.props.pointer ? _this.props.pointer : false, _this.pointerArray = _this.props.pointerArray ? _this.props.pointerArray : false, _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.state = {
56
+ return _ret = (_temp = (_this = inherits._possibleConstructorReturn(this, (_ref = DeckQueue.__proto__ || inherits._Object$getPrototypeOf(DeckQueue)).call.apply(_ref, [this].concat(args))), _this), _this.page = _this.props.page, _this.data = _this.props.dataRecord, _this.query = _this.props.query, _this.params = _this.props.params, _this.pointer = _this.props.pointer ? _this.props.pointer : false, _this.pointerArray = _this.props.pointerArray ? _this.props.pointerArray : false, _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.imageHeight = _this.props.imageHeight ? _this.props.imageHeight : 270, _this.state = {
57
57
  data: _this.data,
58
58
  per: _this.params ? _this.params.to : 2,
59
59
  page: _this.props.currentPage || 1,
@@ -120,7 +120,7 @@ var DeckQueue = function (_React$Component) {
120
120
  }, _this.renderCardImage = function (row) {
121
121
  if (row.thumbnail && row.thumbnail.asset) {
122
122
  var url = _this.urlFor(row.thumbnail);
123
- if (_this.props.imageHeight) url = url.height(_this.props.imageHeight);
123
+ url = url.height(_this.imageHeight);
124
124
  if (_this.props.imageWidth) url = url.width(_this.props.imageWidth);
125
125
  return url.url();
126
126
  } else {
@@ -74,7 +74,8 @@ var GridContent = function (_React$Component) {
74
74
  scrolling: true,
75
75
  query: _this.query,
76
76
  currentPage: _this.props.currentPage || 1,
77
- lgInfeedAd: _this.props.lgInfeedAd ? _this.props.lgInfeedAd : false
77
+ lgInfeedAd: _this.props.lgInfeedAd ? _this.props.lgInfeedAd : false,
78
+ showCategory: _this.props.showCategory ? _this.props.showCategory : false
78
79
  }, _this.loadMore = debounce.debounce_1(function () {
79
80
  _this.setState(function (state) {
80
81
  var page = state.page,
@@ -319,6 +320,24 @@ var GridContent = function (_React$Component) {
319
320
  { height: 50 },
320
321
  React__default.createElement(AuthorComponent.AuthorComponent, { key: index.toString(), index: index, authors: row.authorMapping })
321
322
  ),
323
+ _this2.props.showCategory && row.contentCategory && React__default.createElement(
324
+ index$2.LazyLoad,
325
+ { height: 50 },
326
+ React__default.createElement(
327
+ 'p',
328
+ {
329
+ className: 'article-category',
330
+ style: {
331
+ background: '#3FB618',
332
+ color: '#ffffff',
333
+ marginBottom: '.25rem',
334
+ display: 'inline-block',
335
+ padding: '0 .25rem',
336
+ fontSize: '.8rem'
337
+ } },
338
+ row.contentCategory.name.slice(0, row.contentCategory.name.length - 1)
339
+ )
340
+ ),
322
341
  React__default.createElement(
323
342
  Card.Text,
324
343
  null,
@@ -635,6 +654,24 @@ var GridContent = function (_React$Component) {
635
654
  { height: 50 },
636
655
  React__default.createElement(AuthorComponent.AuthorComponent, { key: index.toString(), index: index, authors: row.authorMapping })
637
656
  ),
657
+ _this2.props.showCategory && row.contentCategory && React__default.createElement(
658
+ index$2.LazyLoad,
659
+ { height: 50 },
660
+ React__default.createElement(
661
+ 'p',
662
+ {
663
+ className: 'article-category',
664
+ style: {
665
+ background: '#3FB618',
666
+ color: '#ffffff',
667
+ marginBottom: '.25rem',
668
+ display: 'inline-block',
669
+ padding: '0 .25rem',
670
+ fontSize: '.8rem'
671
+ } },
672
+ row.contentCategory.name.slice(0, row.contentCategory.name.length - 1)
673
+ )
674
+ ),
638
675
  React__default.createElement(
639
676
  Card.Text,
640
677
  { className: index === 0 || index % 4 === 0 ? '' : 'card-subtext' },
@@ -20,6 +20,7 @@ var BlockContent = require('./BlockContent-f942392e.js');
20
20
  var reactSocialIcons = require('./react-social-icons-cd0d9d3b.js');
21
21
 
22
22
  var TaxonomyCard = function TaxonomyCard(props) {
23
+ // setting default value for imageHeight
23
24
  var columns = props.columns,
24
25
  variant = props.variant,
25
26
  _props$icon = props.icon,
@@ -27,7 +28,8 @@ var TaxonomyCard = function TaxonomyCard(props) {
27
28
  data = props.dataRecord,
28
29
  defaultImage = props.defaultImage,
29
30
  client = props.client,
30
- imageHeight = props.imageHeight,
31
+ _props$imageHeight = props.imageHeight,
32
+ imageHeight = _props$imageHeight === undefined ? 270 : _props$imageHeight,
31
33
  imageWidth = props.imageWidth,
32
34
  getSerializers = props.getSerializers;
33
35
 
package/dist/cjs/View.js CHANGED
@@ -350,7 +350,9 @@ var Article = function Article(props) {
350
350
  lgContextAd = _props$lgContextAd === undefined ? false : _props$lgContextAd,
351
351
  queueData = props.queueData,
352
352
  _props$sponsoredFlag = props.sponsoredFlag,
353
- sponsoredFlag = _props$sponsoredFlag === undefined ? false : _props$sponsoredFlag;
353
+ sponsoredFlag = _props$sponsoredFlag === undefined ? false : _props$sponsoredFlag,
354
+ _props$authorImgHeigh = props.authorImgHeight,
355
+ authorImgHeight = _props$authorImgHeigh === undefined ? 270 : _props$authorImgHeigh;
354
356
  var onChangeArticle = props.onChangeArticle;
355
357
 
356
358
  //If sponsored flag, disable contextual ads
@@ -788,7 +790,7 @@ var Article = function Article(props) {
788
790
  return React__default.createElement(
789
791
  'span',
790
792
  { key: index },
791
- getSerializers.renderAuthor(authorDetail.displayName, authorDetail.url, index, authorDetails.length, authorPrefix, authorDetail.biography && renderAuthorBiography(authorDetail.biography[0]), authorDetail.profileImage && urlFor(props.client, authorDetail.profileImage).url())
793
+ getSerializers.renderAuthor(authorDetail.displayName, authorDetail.url, index, authorDetails.length, authorPrefix, authorDetail.biography && renderAuthorBiography(authorDetail.biography[0]), authorDetail.profileImage && urlFor(props.client, authorDetail.profileImage).height(authorImgHeight).url())
792
794
  );
793
795
  }),
794
796
  React__default.createElement(
@@ -3,8 +3,9 @@
3
3
  require('./_commonjsHelpers-06173234.js');
4
4
  var index$1 = require('./index-b5eb3ff8.js');
5
5
 
6
+ // Sanity image auto formating
6
7
  function urlFor(client, source) {
7
- return index$1.imageUrlBuilder(client).image(source);
8
+ return index$1.imageUrlBuilder(client).image(source).auto('format');
8
9
  }
9
10
 
10
11
  module.exports = urlFor;
@@ -47,7 +47,7 @@ var DeckQueue = function (_React$Component) {
47
47
  args[_key] = arguments[_key];
48
48
  }
49
49
 
50
- return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = DeckQueue.__proto__ || _Object$getPrototypeOf(DeckQueue)).call.apply(_ref, [this].concat(args))), _this), _this.page = _this.props.page, _this.data = _this.props.dataRecord, _this.query = _this.props.query, _this.params = _this.props.params, _this.pointer = _this.props.pointer ? _this.props.pointer : false, _this.pointerArray = _this.props.pointerArray ? _this.props.pointerArray : false, _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.state = {
50
+ return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = DeckQueue.__proto__ || _Object$getPrototypeOf(DeckQueue)).call.apply(_ref, [this].concat(args))), _this), _this.page = _this.props.page, _this.data = _this.props.dataRecord, _this.query = _this.props.query, _this.params = _this.props.params, _this.pointer = _this.props.pointer ? _this.props.pointer : false, _this.pointerArray = _this.props.pointerArray ? _this.props.pointerArray : false, _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.imageHeight = _this.props.imageHeight ? _this.props.imageHeight : 270, _this.state = {
51
51
  data: _this.data,
52
52
  per: _this.params ? _this.params.to : 2,
53
53
  page: _this.props.currentPage || 1,
@@ -114,7 +114,7 @@ var DeckQueue = function (_React$Component) {
114
114
  }, _this.renderCardImage = function (row) {
115
115
  if (row.thumbnail && row.thumbnail.asset) {
116
116
  var url = _this.urlFor(row.thumbnail);
117
- if (_this.props.imageHeight) url = url.height(_this.props.imageHeight);
117
+ url = url.height(_this.imageHeight);
118
118
  if (_this.props.imageWidth) url = url.width(_this.props.imageWidth);
119
119
  return url.url();
120
120
  } else {
@@ -68,7 +68,8 @@ var GridContent = function (_React$Component) {
68
68
  scrolling: true,
69
69
  query: _this.query,
70
70
  currentPage: _this.props.currentPage || 1,
71
- lgInfeedAd: _this.props.lgInfeedAd ? _this.props.lgInfeedAd : false
71
+ lgInfeedAd: _this.props.lgInfeedAd ? _this.props.lgInfeedAd : false,
72
+ showCategory: _this.props.showCategory ? _this.props.showCategory : false
72
73
  }, _this.loadMore = debounce_1(function () {
73
74
  _this.setState(function (state) {
74
75
  var page = state.page,
@@ -313,6 +314,24 @@ var GridContent = function (_React$Component) {
313
314
  { height: 50 },
314
315
  React__default.createElement(AuthorComponent, { key: index.toString(), index: index, authors: row.authorMapping })
315
316
  ),
317
+ _this2.props.showCategory && row.contentCategory && React__default.createElement(
318
+ LazyLoad,
319
+ { height: 50 },
320
+ React__default.createElement(
321
+ 'p',
322
+ {
323
+ className: 'article-category',
324
+ style: {
325
+ background: '#3FB618',
326
+ color: '#ffffff',
327
+ marginBottom: '.25rem',
328
+ display: 'inline-block',
329
+ padding: '0 .25rem',
330
+ fontSize: '.8rem'
331
+ } },
332
+ row.contentCategory.name.slice(0, row.contentCategory.name.length - 1)
333
+ )
334
+ ),
316
335
  React__default.createElement(
317
336
  Card.Text,
318
337
  null,
@@ -629,6 +648,24 @@ var GridContent = function (_React$Component) {
629
648
  { height: 50 },
630
649
  React__default.createElement(AuthorComponent, { key: index.toString(), index: index, authors: row.authorMapping })
631
650
  ),
651
+ _this2.props.showCategory && row.contentCategory && React__default.createElement(
652
+ LazyLoad,
653
+ { height: 50 },
654
+ React__default.createElement(
655
+ 'p',
656
+ {
657
+ className: 'article-category',
658
+ style: {
659
+ background: '#3FB618',
660
+ color: '#ffffff',
661
+ marginBottom: '.25rem',
662
+ display: 'inline-block',
663
+ padding: '0 .25rem',
664
+ fontSize: '.8rem'
665
+ } },
666
+ row.contentCategory.name.slice(0, row.contentCategory.name.length - 1)
667
+ )
668
+ ),
632
669
  React__default.createElement(
633
670
  Card.Text,
634
671
  { className: index === 0 || index % 4 === 0 ? '' : 'card-subtext' },
@@ -15,6 +15,7 @@ import { B as BlockContent } from './BlockContent-a614acdf.js';
15
15
  import { r as reactSocialIcons_1 } from './react-social-icons-a7d5c5c7.js';
16
16
 
17
17
  var TaxonomyCard = function TaxonomyCard(props) {
18
+ // setting default value for imageHeight
18
19
  var columns = props.columns,
19
20
  variant = props.variant,
20
21
  _props$icon = props.icon,
@@ -22,7 +23,8 @@ var TaxonomyCard = function TaxonomyCard(props) {
22
23
  data = props.dataRecord,
23
24
  defaultImage = props.defaultImage,
24
25
  client = props.client,
25
- imageHeight = props.imageHeight,
26
+ _props$imageHeight = props.imageHeight,
27
+ imageHeight = _props$imageHeight === undefined ? 270 : _props$imageHeight,
26
28
  imageWidth = props.imageWidth,
27
29
  getSerializers = props.getSerializers;
28
30
 
package/dist/esm/View.js CHANGED
@@ -344,7 +344,9 @@ var Article = function Article(props) {
344
344
  lgContextAd = _props$lgContextAd === undefined ? false : _props$lgContextAd,
345
345
  queueData = props.queueData,
346
346
  _props$sponsoredFlag = props.sponsoredFlag,
347
- sponsoredFlag = _props$sponsoredFlag === undefined ? false : _props$sponsoredFlag;
347
+ sponsoredFlag = _props$sponsoredFlag === undefined ? false : _props$sponsoredFlag,
348
+ _props$authorImgHeigh = props.authorImgHeight,
349
+ authorImgHeight = _props$authorImgHeigh === undefined ? 270 : _props$authorImgHeigh;
348
350
  var onChangeArticle = props.onChangeArticle;
349
351
 
350
352
  //If sponsored flag, disable contextual ads
@@ -782,7 +784,7 @@ var Article = function Article(props) {
782
784
  return React__default.createElement(
783
785
  'span',
784
786
  { key: index },
785
- renderAuthor(authorDetail.displayName, authorDetail.url, index, authorDetails.length, authorPrefix, authorDetail.biography && renderAuthorBiography(authorDetail.biography[0]), authorDetail.profileImage && urlFor(props.client, authorDetail.profileImage).url())
787
+ renderAuthor(authorDetail.displayName, authorDetail.url, index, authorDetails.length, authorPrefix, authorDetail.biography && renderAuthorBiography(authorDetail.biography[0]), authorDetail.profileImage && urlFor(props.client, authorDetail.profileImage).height(authorImgHeight).url())
786
788
  );
787
789
  }),
788
790
  React__default.createElement(
@@ -1,8 +1,9 @@
1
1
  import './_commonjsHelpers-0c4b6f40.js';
2
2
  import { i as imageUrlBuilder } from './index-51a80699.js';
3
3
 
4
+ // Sanity image auto formating
4
5
  function urlFor(client, source) {
5
- return imageUrlBuilder(client).image(source);
6
+ return imageUrlBuilder(client).image(source).auto('format');
6
7
  }
7
8
 
8
9
  export default urlFor;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.607",
3
+ "version": "1.0.609",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",