@mjhls/mjh-framework 1.0.154 → 1.0.156

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.156
3
3
 
4
4
 
5
5
 
package/dist/index.es.js CHANGED
@@ -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
  ),
@@ -15109,6 +15271,25 @@ var Slideshow$1 = function Slideshow(_ref) {
15109
15271
  );
15110
15272
  };
15111
15273
 
15274
+ var NativeAd = function NativeAd(props) {
15275
+ var _props$node = props.node,
15276
+ networkID = _props$node.networkID,
15277
+ adUnit = _props$node.adUnit,
15278
+ slotId = _props$node.slotId,
15279
+ _props$node$targeting = _props$node.targeting,
15280
+ targeting = _props$node$targeting === undefined ? {} : _props$node$targeting,
15281
+ className = _props$node.className,
15282
+ sizes = _props$node.sizes,
15283
+ sizeMapping = _props$node.sizeMapping;
15284
+
15285
+ console.log('props', props);
15286
+ return React__default.createElement(
15287
+ 'div',
15288
+ { className: 'native-ad-wrapper', style: { textAlign: 'center' } },
15289
+ React__default.createElement(AD, { networkID: networkID, adUnit: adUnit, slotId: slotId, targeting: targeting, className: className, sizes: sizes, sizeMapping: sizeMapping })
15290
+ );
15291
+ };
15292
+
15112
15293
  var convertEntities = function convertEntities(props) {
15113
15294
  if (typeof props === 'string' || props instanceof String) {
15114
15295
  props = html_decode_1(props);
@@ -15209,6 +15390,11 @@ var getSerializers$1 = function getSerializers(client, pageview, videoAccountIDs
15209
15390
  var node = _ref14.node;
15210
15391
 
15211
15392
  return React__default.createElement(Slideshow$1, { node: node, client: client, pageview: pageview, serializerArguments: (drupalLeadSettings) });
15393
+ },
15394
+ nativeAd: function nativeAd(_ref15) {
15395
+ var node = _ref15.node;
15396
+
15397
+ return React__default.createElement(NativeAd, { node: node });
15212
15398
  }
15213
15399
  },
15214
15400
  marks: {
@@ -15238,32 +15424,32 @@ var getSerializers$1 = function getSerializers(client, pageview, videoAccountIDs
15238
15424
  children
15239
15425
  );
15240
15426
  },
15241
- alignleft: function alignleft(_ref15) {
15242
- var children = _ref15.children;
15427
+ alignleft: function alignleft(_ref16) {
15428
+ var children = _ref16.children;
15243
15429
  return React__default.createElement(
15244
15430
  'div',
15245
15431
  { style: { textAlign: 'left' } },
15246
15432
  children
15247
15433
  );
15248
15434
  },
15249
- alignright: function alignright(_ref16) {
15250
- var children = _ref16.children;
15435
+ alignright: function alignright(_ref17) {
15436
+ var children = _ref17.children;
15251
15437
  return React__default.createElement(
15252
15438
  'div',
15253
15439
  { style: { textAlign: 'right' } },
15254
15440
  children
15255
15441
  );
15256
15442
  },
15257
- aligncenter: function aligncenter(_ref17) {
15258
- var children = _ref17.children;
15443
+ aligncenter: function aligncenter(_ref18) {
15444
+ var children = _ref18.children;
15259
15445
  return React__default.createElement(
15260
15446
  'div',
15261
15447
  { style: { textAlign: 'center' } },
15262
15448
  children
15263
15449
  );
15264
15450
  },
15265
- alignjustify: function alignjustify(_ref18) {
15266
- var children = _ref18.children;
15451
+ alignjustify: function alignjustify(_ref19) {
15452
+ var children = _ref19.children;
15267
15453
  return React__default.createElement(
15268
15454
  'div',
15269
15455
  { style: { textAlign: 'justify' } },