@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/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
  ),
@@ -15116,6 +15278,25 @@ var Slideshow$1 = function Slideshow(_ref) {
15116
15278
  );
15117
15279
  };
15118
15280
 
15281
+ var NativeAd = function NativeAd(props) {
15282
+ var _props$node = props.node,
15283
+ networkID = _props$node.networkID,
15284
+ adUnit = _props$node.adUnit,
15285
+ slotId = _props$node.slotId,
15286
+ _props$node$targeting = _props$node.targeting,
15287
+ targeting = _props$node$targeting === undefined ? {} : _props$node$targeting,
15288
+ className = _props$node.className,
15289
+ sizes = _props$node.sizes,
15290
+ sizeMapping = _props$node.sizeMapping;
15291
+
15292
+ console.log('props', props);
15293
+ return React__default.createElement(
15294
+ 'div',
15295
+ { className: 'native-ad-wrapper', style: { textAlign: 'center' } },
15296
+ React__default.createElement(AD, { networkID: networkID, adUnit: adUnit, slotId: slotId, targeting: targeting, className: className, sizes: sizes, sizeMapping: sizeMapping })
15297
+ );
15298
+ };
15299
+
15119
15300
  var convertEntities = function convertEntities(props) {
15120
15301
  if (typeof props === 'string' || props instanceof String) {
15121
15302
  props = html_decode_1(props);
@@ -15216,6 +15397,11 @@ var getSerializers$1 = function getSerializers(client, pageview, videoAccountIDs
15216
15397
  var node = _ref14.node;
15217
15398
 
15218
15399
  return React__default.createElement(Slideshow$1, { node: node, client: client, pageview: pageview, serializerArguments: (drupalLeadSettings) });
15400
+ },
15401
+ nativeAd: function nativeAd(_ref15) {
15402
+ var node = _ref15.node;
15403
+
15404
+ return React__default.createElement(NativeAd, { node: node });
15219
15405
  }
15220
15406
  },
15221
15407
  marks: {
@@ -15245,32 +15431,32 @@ var getSerializers$1 = function getSerializers(client, pageview, videoAccountIDs
15245
15431
  children
15246
15432
  );
15247
15433
  },
15248
- alignleft: function alignleft(_ref15) {
15249
- var children = _ref15.children;
15434
+ alignleft: function alignleft(_ref16) {
15435
+ var children = _ref16.children;
15250
15436
  return React__default.createElement(
15251
15437
  'div',
15252
15438
  { style: { textAlign: 'left' } },
15253
15439
  children
15254
15440
  );
15255
15441
  },
15256
- alignright: function alignright(_ref16) {
15257
- var children = _ref16.children;
15442
+ alignright: function alignright(_ref17) {
15443
+ var children = _ref17.children;
15258
15444
  return React__default.createElement(
15259
15445
  'div',
15260
15446
  { style: { textAlign: 'right' } },
15261
15447
  children
15262
15448
  );
15263
15449
  },
15264
- aligncenter: function aligncenter(_ref17) {
15265
- var children = _ref17.children;
15450
+ aligncenter: function aligncenter(_ref18) {
15451
+ var children = _ref18.children;
15266
15452
  return React__default.createElement(
15267
15453
  'div',
15268
15454
  { style: { textAlign: 'center' } },
15269
15455
  children
15270
15456
  );
15271
15457
  },
15272
- alignjustify: function alignjustify(_ref18) {
15273
- var children = _ref18.children;
15458
+ alignjustify: function alignjustify(_ref19) {
15459
+ var children = _ref19.children;
15274
15460
  return React__default.createElement(
15275
15461
  'div',
15276
15462
  { style: { textAlign: 'justify' } },