@mjhls/mjh-framework 1.0.154 → 1.0.155

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.154
2
+ # mjh-framework v. 1.0.155
3
3
 
4
4
 
5
5
 
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import React__default, { Component, useState, useEffect, useRef, createElement, createContext } from 'react';
1
+ import React__default, { Component, useState, useEffect, useRef, createContext, createElement } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import reactDom from 'react-dom';
4
4
  import Container from 'react-bootstrap/Container';
@@ -7642,6 +7642,10 @@ var renderAuthor = function renderAuthor(authorDetail, index$$1, length) {
7642
7642
  } else return null;
7643
7643
  };
7644
7644
 
7645
+ var checkExternalUrl = function checkExternalUrl(url) {
7646
+ return new RegExp(['http', 'https'].join('|')).test(url);
7647
+ };
7648
+
7645
7649
  var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth, rightItems) {
7646
7650
  var numberOfItemsBeforeAd = 6;
7647
7651
  return React__default.createElement(
@@ -7650,6 +7654,169 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
7650
7654
  data && data.map(function (article, index$$1) {
7651
7655
  var pageNumber = article.pageNumber || values.page;
7652
7656
  var contentCategoryName = article.contentCategory ? article.contentCategory.name : 'Articles';
7657
+
7658
+ if (article._type === 'feature') {
7659
+ if (article.blank || checkExternalUrl(article.url.current)) {
7660
+ return React__default.createElement(
7661
+ React__default.Fragment,
7662
+ { key: article._id ? article._id : index$$1 },
7663
+ React__default.createElement(
7664
+ VisibilitySensor,
7665
+ {
7666
+ key: article._id ? article._id : index$$1,
7667
+ onChange: function onChange(isVisible) {
7668
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage);
7669
+ } },
7670
+ React__default.createElement(
7671
+ React__default.Fragment,
7672
+ null,
7673
+ React__default.createElement(
7674
+ Media$1,
7675
+ {
7676
+ key: article._id ? article._id : index$$1,
7677
+ className: 'feature-media',
7678
+ style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
7679
+ (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
7680
+ 'a',
7681
+ { href: article.url.current, target: '_blank', className: 'feature-wrapper' },
7682
+ React__default.createElement(
7683
+ LazyLoad,
7684
+ { height: imageHeight },
7685
+ article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage(article, builder, imageHeight, imageWidth), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
7686
+ )
7687
+ ),
7688
+ React__default.createElement(
7689
+ Media$1.Body,
7690
+ null,
7691
+ React__default.createElement(
7692
+ Link,
7693
+ { href: mapping[contentCategoryName] + '/[url]', as: mapping[contentCategoryName] + '/' + article.url.current },
7694
+ React__default.createElement(
7695
+ 'a',
7696
+ null,
7697
+ article.title && React__default.createElement(
7698
+ 'h4',
7699
+ { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
7700
+ article.title
7701
+ )
7702
+ )
7703
+ ),
7704
+ showPublished && article.published && React__default.createElement(
7705
+ 'p',
7706
+ { className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
7707
+ moment(article.published).format('MMMM DD, YYYY')
7708
+ ),
7709
+ showAuthor && article.authorMapping && article.authorMapping.length > 0 && article.authorMapping.map(function (authorDetail, index$$1) {
7710
+ return renderAuthor(authorDetail, index$$1, article.authorMapping.length);
7711
+ }),
7712
+ showCategory && article.contentCategory && React__default.createElement(
7713
+ 'p',
7714
+ {
7715
+ style: {
7716
+ background: 'var(--highlight)',
7717
+ color: 'var(--highlight-accent)',
7718
+ marginBottom: '.25rem',
7719
+ display: 'inline-block',
7720
+ padding: '0 .25rem',
7721
+ fontSize: '.8rem'
7722
+ } },
7723
+ article.contentCategory.name.slice(0, article.contentCategory.name.length - 1)
7724
+ ),
7725
+ article.summary && React__default.createElement(
7726
+ 'p',
7727
+ { className: 'pt-2 card-text' },
7728
+ article.summary
7729
+ )
7730
+ )
7731
+ )
7732
+ )
7733
+ ),
7734
+ main_36 && rightItems && (index$$1 + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index$$1, numberOfItemsBeforeAd, rightItems)
7735
+ );
7736
+ } else {
7737
+ return React__default.createElement(
7738
+ React__default.Fragment,
7739
+ { key: article._id ? article._id : index$$1 },
7740
+ React__default.createElement(
7741
+ VisibilitySensor,
7742
+ {
7743
+ key: article._id ? article._id : index$$1,
7744
+ onChange: function onChange(isVisible) {
7745
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage);
7746
+ } },
7747
+ React__default.createElement(
7748
+ React__default.Fragment,
7749
+ null,
7750
+ React__default.createElement(
7751
+ Media$1,
7752
+ {
7753
+ key: article._id ? article._id : index$$1,
7754
+ className: 'feature-media',
7755
+ style: { flexDirection: 'column', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
7756
+ (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
7757
+ Link,
7758
+ { href: article.url.current, as: mapping[contentCategoryName] + '/' + article.url.current },
7759
+ React__default.createElement(
7760
+ 'a',
7761
+ { className: 'feature-wrapper' },
7762
+ React__default.createElement(
7763
+ LazyLoad,
7764
+ { height: imageHeight },
7765
+ article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'img-fluid', src: renderCardImage(article, builder, imageHeight, imageWidth), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
7766
+ )
7767
+ )
7768
+ ),
7769
+ React__default.createElement(
7770
+ Media$1.Body,
7771
+ null,
7772
+ React__default.createElement(
7773
+ Link,
7774
+ { href: mapping[contentCategoryName] + '/[url]', as: mapping[contentCategoryName] + '/' + article.url.current },
7775
+ React__default.createElement(
7776
+ 'a',
7777
+ null,
7778
+ article.title && React__default.createElement(
7779
+ 'h4',
7780
+ { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
7781
+ article.title
7782
+ )
7783
+ )
7784
+ ),
7785
+ showPublished && article.published && React__default.createElement(
7786
+ 'p',
7787
+ { className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
7788
+ moment(article.published).format('MMMM DD, YYYY')
7789
+ ),
7790
+ showAuthor && article.authorMapping && article.authorMapping.length > 0 && article.authorMapping.map(function (authorDetail, index$$1) {
7791
+ return renderAuthor(authorDetail, index$$1, article.authorMapping.length);
7792
+ }),
7793
+ showCategory && article.contentCategory && React__default.createElement(
7794
+ 'p',
7795
+ {
7796
+ style: {
7797
+ background: 'var(--highlight)',
7798
+ color: 'var(--highlight-accent)',
7799
+ marginBottom: '.25rem',
7800
+ display: 'inline-block',
7801
+ padding: '0 .25rem',
7802
+ fontSize: '.8rem'
7803
+ } },
7804
+ article.contentCategory.name.slice(0, article.contentCategory.name.length - 1)
7805
+ ),
7806
+ article.summary && React__default.createElement(
7807
+ 'p',
7808
+ { className: 'pt-2 card-text' },
7809
+ article.summary
7810
+ )
7811
+ )
7812
+ )
7813
+ )
7814
+ ),
7815
+ main_36 && rightItems && (index$$1 + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index$$1, numberOfItemsBeforeAd, rightItems)
7816
+ );
7817
+ }
7818
+ }
7819
+
7653
7820
  return React__default.createElement(
7654
7821
  React__default.Fragment,
7655
7822
  { key: article._id ? article._id : index$$1 },
@@ -7667,22 +7834,17 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
7667
7834
  Media$1,
7668
7835
  {
7669
7836
  key: article._id ? article._id : index$$1,
7670
- className: article._type == 'feature' ? 'feature-media' : '',
7671
- style: { flexDirection: article._type == 'feature' ? 'column' : 'row', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
7837
+ style: { flexDirection: 'row', marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
7672
7838
  (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
7673
7839
  Link,
7674
7840
  { href: mapping[contentCategoryName] + '/[url]', as: mapping[contentCategoryName] + '/' + article.url.current },
7675
7841
  React__default.createElement(
7676
7842
  'a',
7677
- { className: article._type == 'feature' ? 'feature-wrapper' : 'img-wrapper' },
7843
+ { className: 'img-wrapper' },
7678
7844
  React__default.createElement(
7679
7845
  LazyLoad,
7680
7846
  { height: imageHeight },
7681
- article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', {
7682
- className: article._type == 'feature' ? 'img-fluid' : 'mr-3 img-fluid',
7683
- src: renderCardImage(article, builder, imageHeight, imageWidth),
7684
- alt: article.title
7685
- }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
7847
+ article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'mr-3 img-fluid', src: renderCardImage(article, builder, imageHeight, imageWidth), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
7686
7848
  )
7687
7849
  )
7688
7850
  ),