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