@mjhls/mjh-framework 1.0.195 → 1.0.197

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.195
2
+ # mjh-framework v. 1.0.197
3
3
 
4
4
 
5
5
 
package/dist/index.es.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import React__default, { Component, useState, useEffect, useRef, createElement, createContext } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import require$$1 from 'react-dom';
3
+ import reactDom from 'react-dom';
4
4
  import Container from 'react-bootstrap/Container';
5
5
  import Row from 'react-bootstrap/Row';
6
6
  import Col from 'react-bootstrap/Col';
@@ -7186,7 +7186,7 @@ var InfiniteScroll = /** @class */ (function (_super) {
7186
7186
 
7187
7187
  var visibilitySensor = createCommonjsModule(function (module, exports) {
7188
7188
  (function webpackUniversalModuleDefinition(root, factory) {
7189
- module.exports = factory(React__default, require$$1);
7189
+ module.exports = factory(React__default, reactDom);
7190
7190
  })(commonjsGlobal, function(__WEBPACK_EXTERNAL_MODULE__1__, __WEBPACK_EXTERNAL_MODULE__2__) {
7191
7191
  return /******/ (function(modules) { // webpackBootstrap
7192
7192
  /******/ // The module cache
@@ -8494,7 +8494,7 @@ var _react2 = _interopRequireDefault(React__default);
8494
8494
 
8495
8495
 
8496
8496
 
8497
- var _reactDom2 = _interopRequireDefault(require$$1);
8497
+ var _reactDom2 = _interopRequireDefault(reactDom);
8498
8498
 
8499
8499
 
8500
8500
 
@@ -11764,6 +11764,88 @@ function get$1(object, path, defaultValue) {
11764
11764
 
11765
11765
  var get_1 = get$1;
11766
11766
 
11767
+ var AD = function AD(_ref) {
11768
+ var networkID = _ref.networkID,
11769
+ adUnit = _ref.adUnit,
11770
+ sizeMapping = _ref.sizeMapping,
11771
+ className = _ref.className,
11772
+ slotId = _ref.slotId,
11773
+ sizes = _ref.sizes,
11774
+ minInViewPercent = _ref.minInViewPercent,
11775
+ _ref$targeting = _ref.targeting,
11776
+ targeting = _ref$targeting === undefined ? {} : _ref$targeting;
11777
+
11778
+ var _useState = useState(false),
11779
+ _useState2 = slicedToArray(_useState, 2),
11780
+ adRendered = _useState2[0],
11781
+ setAdRendered = _useState2[1];
11782
+
11783
+ var _useState3 = useState(false),
11784
+ _useState4 = slicedToArray(_useState3, 2),
11785
+ showPlaceholder = _useState4[0],
11786
+ setShowPlaceholder = _useState4[1];
11787
+
11788
+ var handleVisibilityChange = debounce_1(function (_ref2) {
11789
+ var event = _ref2.event;
11790
+
11791
+ if (event.inViewPercentage <= 0) {
11792
+ setShowPlaceholder(true);
11793
+ }
11794
+ }, 500);
11795
+
11796
+ return React__default.createElement(
11797
+ React__default.Fragment,
11798
+ null,
11799
+ !showPlaceholder && React__default.createElement(
11800
+ lib_1,
11801
+ {
11802
+ dfpNetworkId: networkID,
11803
+ targetingArguments: targeting,
11804
+ sizeMapping: sizeMapping,
11805
+ lazyLoad: { fetchMarginPercent: 500, renderMarginPercent: 200, mobileScaling: 2.0 } },
11806
+ React__default.createElement(
11807
+ 'div',
11808
+ { className: className },
11809
+ React__default.createElement(lib_2, {
11810
+ slotId: slotId,
11811
+ sizes: sizes,
11812
+ adUnit: adUnit,
11813
+ sizeMapping: sizeMapping,
11814
+ onSlotRender: function onSlotRender(eventData) {
11815
+ setAdRendered(true);
11816
+ },
11817
+ onSlotVisibilityChanged: handleVisibilityChange
11818
+ })
11819
+ )
11820
+ ),
11821
+ adRendered && showPlaceholder && React__default.createElement(
11822
+ VisibilitySensor,
11823
+ {
11824
+ partialVisibility: true,
11825
+ onChange: function onChange(isVisible) {
11826
+ if (isVisible) {
11827
+ setShowPlaceholder(false);
11828
+ }
11829
+ } },
11830
+ React__default.createElement(
11831
+ 'div',
11832
+ { style: { height: 'auto' } },
11833
+ '\xA0'
11834
+ )
11835
+ )
11836
+ );
11837
+ };
11838
+
11839
+ AD.propTypes = {
11840
+ networkID: PropTypes.string.isRequired,
11841
+ adUnit: PropTypes.string.isRequired,
11842
+ slotId: PropTypes.string,
11843
+ className: PropTypes.string,
11844
+ sizeMapping: PropTypes.array,
11845
+ sizes: PropTypes.array,
11846
+ minInViewPercent: PropTypes.number
11847
+ };
11848
+
11767
11849
  var GridContent = function (_React$Component) {
11768
11850
  inherits(GridContent, _React$Component);
11769
11851
 
@@ -11982,7 +12064,7 @@ var GridContent = function (_React$Component) {
11982
12064
 
11983
12065
  createClass(GridContent, [{
11984
12066
  key: 'cardLoader',
11985
- value: function cardLoader(page, columns, variant, showVideo, VideoPlayer) {
12067
+ value: function cardLoader(page, columns, variant, showVideo, VideoPlayer, showBI, brandInsight) {
11986
12068
  var _this2 = this;
11987
12069
 
11988
12070
  var lgVar = Math.floor(12 / columns);
@@ -12057,13 +12139,33 @@ var GridContent = function (_React$Component) {
12057
12139
  })
12058
12140
  );
12059
12141
  }
12142
+
12143
+ var insert = function insert(arr, index$$1, newElement) {
12144
+ return [].concat(toConsumableArray(arr.slice(0, index$$1)), [newElement], toConsumableArray(arr.slice(index$$1)));
12145
+ };
12146
+ var posts = [];
12147
+ if (showBI) {
12148
+ var interval = brandInsight.interval;
12149
+ var data = this.state.data;
12150
+ posts = data;
12151
+ var i = 1;
12152
+ for (var pos = interval; pos <= posts.length;) {
12153
+ brandInsight.targeting.pos = 'article' + i;
12154
+ posts = insert(posts, pos, brandInsight);
12155
+ pos += interval + 1;
12156
+ i++;
12157
+ }
12158
+ } else {
12159
+ posts = this.state.data;
12160
+ }
12161
+
12060
12162
  return React__default.createElement(
12061
12163
  'div',
12062
12164
  { className: 'grid-container' },
12063
- this.state.data && this.state.data.map(function (row, index$$1) {
12165
+ posts && posts.map(function (row, index$$1) {
12064
12166
  var pageNumber = row.pageNumber || _this2.state.page;
12065
12167
  var contentCategoryName = row.contentCategory && row.contentCategory.name && _this2.mapping[row.contentCategory.name] ? row.contentCategory.name : 'Articles';
12066
- var linkHref = _this2.mapping[contentCategoryName] + '/' + row.url.current;
12168
+ var linkHref = row.url && row.url.current ? _this2.mapping[contentCategoryName] + '/' + row.url.current : '';
12067
12169
  if (row._type === 'feature') {
12068
12170
  if (row.blank || _this2.checkExternalUrl(row.url.current)) {
12069
12171
  return React__default.createElement(
@@ -12123,7 +12225,7 @@ var GridContent = function (_React$Component) {
12123
12225
  )
12124
12226
  )
12125
12227
  ),
12126
- showVideo && (_this2.state.data.length < numberOfItemsBeforeVideo || index$$1 + 1 === numberOfItemsBeforeVideo) && React__default.createElement(VideoPlayer, null),
12228
+ showVideo && (posts.length < numberOfItemsBeforeVideo || index$$1 + 1 === numberOfItemsBeforeVideo) && React__default.createElement(VideoPlayer, null),
12127
12229
  main_36 && _this2.props.rightItems && (index$$1 + 1) % numberOfItemsBeforeAd === 0 && _this2.renderMobileAd(index$$1, numberOfItemsBeforeAd)
12128
12230
  );
12129
12231
  } else {
@@ -12184,10 +12286,24 @@ var GridContent = function (_React$Component) {
12184
12286
  )
12185
12287
  )
12186
12288
  ),
12187
- showVideo && (_this2.state.data.length < numberOfItemsBeforeVideo || index$$1 + 1 === numberOfItemsBeforeVideo) && React__default.createElement(VideoPlayer, null),
12289
+ showVideo && (posts.length < numberOfItemsBeforeVideo || index$$1 + 1 === numberOfItemsBeforeVideo) && React__default.createElement(VideoPlayer, null),
12188
12290
  main_36 && _this2.props.rightItems && (index$$1 + 1) % numberOfItemsBeforeAd === 0 && _this2.renderMobileAd(index$$1, numberOfItemsBeforeAd)
12189
12291
  );
12190
12292
  }
12293
+ } else if (row._type === 'BrandInsight' && row.adUnit) {
12294
+ return React__default.createElement(
12295
+ React__default.Fragment,
12296
+ { key: itemCounter, className: 'brand-insight-wrapper' },
12297
+ React__default.createElement(
12298
+ 'div',
12299
+ { counter: itemCounter++, style: { display: 'flex', flex: '1 0 auto' } },
12300
+ React__default.createElement(
12301
+ Card,
12302
+ { className: 'content-card ad-wrapper', style: { flexDirection: index$$1 === 0 || index$$1 % 4 === 0 ? 'top' : 'row' } },
12303
+ React__default.createElement(AD, { networkID: row.networkID, adUnit: row.adUnit, targeting: row.targeting, className: row.className, sizes: row.sizes, slotId: row.slotId })
12304
+ )
12305
+ )
12306
+ );
12191
12307
  }
12192
12308
  return React__default.createElement(
12193
12309
  React__default.Fragment,
@@ -12246,7 +12362,7 @@ var GridContent = function (_React$Component) {
12246
12362
  )
12247
12363
  )
12248
12364
  ),
12249
- showVideo && (_this2.state.data.length < numberOfItemsBeforeVideo || index$$1 + 1 === numberOfItemsBeforeVideo) && React__default.createElement(VideoPlayer, null),
12365
+ showVideo && (posts.length < numberOfItemsBeforeVideo || index$$1 + 1 === numberOfItemsBeforeVideo) && React__default.createElement(VideoPlayer, null),
12250
12366
  main_36 && _this2.props.rightItems && (index$$1 + 1) % numberOfItemsBeforeAd === 0 && _this2.renderMobileAd(index$$1, numberOfItemsBeforeAd)
12251
12367
  );
12252
12368
  })
@@ -12263,7 +12379,9 @@ var GridContent = function (_React$Component) {
12263
12379
  autoScroll = _props.autoScroll,
12264
12380
  page = _props.page,
12265
12381
  showVideo = _props.showVideo,
12266
- VideoPlayer = _props.VideoPlayer;
12382
+ VideoPlayer = _props.VideoPlayer,
12383
+ showBI = _props.showBI,
12384
+ brandInsight = _props.brandInsight;
12267
12385
 
12268
12386
 
12269
12387
  return React__default.createElement(
@@ -12275,7 +12393,7 @@ var GridContent = function (_React$Component) {
12275
12393
  React__default.createElement(
12276
12394
  Container,
12277
12395
  null,
12278
- this.cardLoader(page, columns, variant, showVideo, VideoPlayer)
12396
+ this.cardLoader(page, columns, variant, showVideo, VideoPlayer, showBI, brandInsight)
12279
12397
  )
12280
12398
  ) : React__default.createElement(
12281
12399
  React__default.Fragment,
@@ -12283,7 +12401,7 @@ var GridContent = function (_React$Component) {
12283
12401
  React__default.createElement(
12284
12402
  Container,
12285
12403
  null,
12286
- this.cardLoader(page, columns, variant, showVideo, VideoPlayer)
12404
+ this.cardLoader(page, columns, variant, showVideo, VideoPlayer, showBI, brandInsight)
12287
12405
  ),
12288
12406
  React__default.createElement(
12289
12407
  'div',
@@ -16888,88 +17006,6 @@ var HamMagazine = function HamMagazine(props) {
16888
17006
  );
16889
17007
  };
16890
17008
 
16891
- var AD = function AD(_ref) {
16892
- var networkID = _ref.networkID,
16893
- adUnit = _ref.adUnit,
16894
- sizeMapping = _ref.sizeMapping,
16895
- className = _ref.className,
16896
- slotId = _ref.slotId,
16897
- sizes = _ref.sizes,
16898
- minInViewPercent = _ref.minInViewPercent,
16899
- _ref$targeting = _ref.targeting,
16900
- targeting = _ref$targeting === undefined ? {} : _ref$targeting;
16901
-
16902
- var _useState = useState(false),
16903
- _useState2 = slicedToArray(_useState, 2),
16904
- adRendered = _useState2[0],
16905
- setAdRendered = _useState2[1];
16906
-
16907
- var _useState3 = useState(false),
16908
- _useState4 = slicedToArray(_useState3, 2),
16909
- showPlaceholder = _useState4[0],
16910
- setShowPlaceholder = _useState4[1];
16911
-
16912
- var handleVisibilityChange = debounce_1(function (_ref2) {
16913
- var event = _ref2.event;
16914
-
16915
- if (event.inViewPercentage <= 0) {
16916
- setShowPlaceholder(true);
16917
- }
16918
- }, 500);
16919
-
16920
- return React__default.createElement(
16921
- React__default.Fragment,
16922
- null,
16923
- !showPlaceholder && React__default.createElement(
16924
- lib_1,
16925
- {
16926
- dfpNetworkId: networkID,
16927
- targetingArguments: targeting,
16928
- sizeMapping: sizeMapping,
16929
- lazyLoad: { fetchMarginPercent: 500, renderMarginPercent: 200, mobileScaling: 2.0 } },
16930
- React__default.createElement(
16931
- 'div',
16932
- { className: className },
16933
- React__default.createElement(lib_2, {
16934
- slotId: slotId,
16935
- sizes: sizes,
16936
- adUnit: adUnit,
16937
- sizeMapping: sizeMapping,
16938
- onSlotRender: function onSlotRender(eventData) {
16939
- setAdRendered(true);
16940
- },
16941
- onSlotVisibilityChanged: handleVisibilityChange
16942
- })
16943
- )
16944
- ),
16945
- adRendered && showPlaceholder && React__default.createElement(
16946
- VisibilitySensor,
16947
- {
16948
- partialVisibility: true,
16949
- onChange: function onChange(isVisible) {
16950
- if (isVisible) {
16951
- setShowPlaceholder(false);
16952
- }
16953
- } },
16954
- React__default.createElement(
16955
- 'div',
16956
- { style: { height: 'auto' } },
16957
- '\xA0'
16958
- )
16959
- )
16960
- );
16961
- };
16962
-
16963
- AD.propTypes = {
16964
- networkID: PropTypes.string.isRequired,
16965
- adUnit: PropTypes.string.isRequired,
16966
- slotId: PropTypes.string,
16967
- className: PropTypes.string,
16968
- sizeMapping: PropTypes.array,
16969
- sizes: PropTypes.array,
16970
- minInViewPercent: PropTypes.number
16971
- };
16972
-
16973
17009
  var AD728x90 = function AD728x90(_ref) {
16974
17010
  var networkID = _ref.networkID,
16975
17011
  adUnit = _ref.adUnit,
@@ -29355,6 +29391,16 @@ var fbsHero = function fbsHero(props) {
29355
29391
  function urlFor(source) {
29356
29392
  return builder.image(source);
29357
29393
  }
29394
+
29395
+ var topArticleThumbnail = '';
29396
+ var topArticleAltText = topArticle.title;
29397
+ if (topArticle.thumbnail && topArticle.thumbnail.asset) {
29398
+ topArticleThumbnail = urlFor(topArticle.thumbnail.asset).width(600).url();
29399
+ topArticleAltText = topArticle.thumbnail.asset.originalFileName;
29400
+ } else if (props.thumbnail) {
29401
+ topArticleThumbnail = props.thumbnail;
29402
+ }
29403
+
29358
29404
  return React__default.createElement(
29359
29405
  'div',
29360
29406
  { className: 'article-hero' },
@@ -29367,7 +29413,7 @@ var fbsHero = function fbsHero(props) {
29367
29413
  React__default.createElement(
29368
29414
  'div',
29369
29415
  { className: 'fbs-top-article--img' },
29370
- React__default.createElement('img', { src: urlFor(topArticle.thumbnail.asset).width(600).url(), alt: topArticle.thumbnail.asset.originalFileName })
29416
+ React__default.createElement('img', { src: topArticleThumbnail, alt: topArticleAltText })
29371
29417
  ),
29372
29418
  React__default.createElement(
29373
29419
  'div',
@@ -29382,7 +29428,7 @@ var fbsHero = function fbsHero(props) {
29382
29428
  null,
29383
29429
  moment(topArticle.published).format('MMMM DD, YYYY hh:mma')
29384
29430
  ),
29385
- React__default.createElement(
29431
+ topArticle.authorMapping && topArticle.authorMapping[0] && React__default.createElement(
29386
29432
  'p',
29387
29433
  null,
29388
29434
  'By ',
@@ -29399,10 +29445,19 @@ var fbsHero = function fbsHero(props) {
29399
29445
  'div',
29400
29446
  { className: 'fbs-sub-article-container' },
29401
29447
  subArticles.map(function (article, index) {
29448
+ var articleThumbnail = '';
29449
+ var articleAltText = article.title;
29450
+ if (article.thumbnail && article.thumbnail.asset) {
29451
+ articleThumbnail = urlFor(article.thumbnail.asset).width(250).url();
29452
+ articleAltText = article.thumbnail.asset.originalFileName;
29453
+ } else if (props.thumbnail) {
29454
+ articleThumbnail = props.thumbnail;
29455
+ }
29456
+
29402
29457
  return React__default.createElement(
29403
29458
  'a',
29404
29459
  { key: index, href: '/view/' + article.url.current, className: 'fbs-sub-article' },
29405
- React__default.createElement('img', { src: urlFor(article.thumbnail.asset).width(250).url() }),
29460
+ React__default.createElement('img', { src: articleThumbnail, alt: articleAltText }),
29406
29461
  React__default.createElement(
29407
29462
  'div',
29408
29463
  null,
@@ -29416,14 +29471,14 @@ var fbsHero = function fbsHero(props) {
29416
29471
  null,
29417
29472
  moment(article.published).format('MMMM DD, YYYY hh:mma')
29418
29473
  ),
29419
- React__default.createElement(
29474
+ article.authorMapping && article.authorMapping[0] && React__default.createElement(
29420
29475
  'p',
29421
29476
  null,
29422
29477
  'By ',
29423
29478
  React__default.createElement(
29424
29479
  'b',
29425
29480
  null,
29426
- topArticle.authorMapping[0].displayName
29481
+ article.authorMapping[0].displayName
29427
29482
  )
29428
29483
  )
29429
29484
  )
@@ -29433,7 +29488,7 @@ var fbsHero = function fbsHero(props) {
29433
29488
  React__default.createElement(
29434
29489
  'style',
29435
29490
  { jsx: 'true' },
29436
- '\n .article-hero {\n margin-bottom: 1rem;\n border-bottom: 1px solid #ddd;\n padding-bottom: 0.5rem;\n }\n .fbs-top-article {\n width: 100%;\n margin-bottom: 1rem;\n padding-bottom: 1rem;\n border-bottom: 1px solid #ddd;\n }\n .fbs-top-article img {\n width: 100%;\n height: auto;\n max-height: 375px;\n object-fit: cover;\n }\n .fbs-top-article--body {\n }\n .fbs-top-article--body h1 {\n color: #252525!important;\n font-size: 1.6rem;\n font-weight: bold;\n text-align: center;\n margin-top: 1rem;\n }\n .fbs-top-article--body p {\n text-align: center;\n margin-bottom: 0;\n color: #252525;\n }\n .fbs-top-article--body p:first-of-type {\n \n font-size: 0.9rem;\n }\n .fbs-sub-article-container {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n\n padding-top: 1.75rem;\n margin-left: -1rem;\n margin-rigth: -1rem;\n }\n .fbs-sub-article {\n width: calc(50% - 2rem);\n min-width: 350px;\n display: flex;\n flex-direction: row;\n flex: 1 1 auto;\n margin: 0 1rem 1.75rem;\n }\n .fbs-sub-article img {\n margin-right: 1rem;\n width: 100px;\n max-height: 100px;\n object-fit: cover;\n }\n .fbs-sub-article p {\n margin-bottom: 0;\n font-size: 0.8rem;\n color: #252525;\n }\n .fbs-sub-article .fbs-sub-article--title {\n font-weight: bold;\n font-size: 1rem;\n color: #252525;\n }\n \n '
29491
+ '\n .article-hero {\n margin-bottom: 1rem;\n border-bottom: 1px solid #ddd;\n padding-bottom: 0.5rem;\n }\n .fbs-top-article {\n width: 100%;\n margin-bottom: 1rem;\n padding-bottom: 1rem;\n border-bottom: 1px solid #ddd;\n }\n .fbs-top-article img {\n width: 100%;\n height: auto;\n max-height: 375px;\n object-fit: cover;\n }\n \n .fbs-top-article--body {\n }\n .fbs-top-article--body h1 {\n color: #252525 !important;\n font-size: 1.6rem;\n font-weight: bold;\n text-align: center;\n margin-top: 1rem;\n }\n .fbs-top-article--body p {\n text-align: center;\n margin-bottom: 0;\n color: #252525;\n }\n .fbs-top-article--body p:first-of-type {\n font-size: 0.9rem;\n }\n .fbs-sub-article-container {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n\n padding-top: 1.75rem;\n margin-left: -1rem;\n margin-rigth: -1rem;\n }\n .fbs-sub-article {\n width: calc(50% - 2rem);\n min-width: 350px;\n display: flex;\n flex-direction: row;\n flex: 1 1 auto;\n margin: 0 1rem 1.75rem;\n }\n .fbs-sub-article img {\n margin-right: 1rem;\n width: 100px;\n max-height: 100px;\n object-fit: contain;\n }\n .fbs-sub-article p {\n margin-bottom: 0;\n font-size: 0.8rem;\n color: #252525;\n }\n .fbs-sub-article .fbs-sub-article--title {\n font-weight: bold;\n font-size: 1rem;\n color: #252525;\n }\n '
29437
29492
  )
29438
29493
  );
29439
29494
  };
@@ -29453,9 +29508,18 @@ var HorizontalHero = function HorizontalHero(props) {
29453
29508
  borderColor = _props$borderColor === undefined ? 'black' : _props$borderColor;
29454
29509
 
29455
29510
 
29511
+ var topArticleThumbnail = '';
29512
+ var topArticleAltText = topArticle.title;
29513
+ if (topArticle.thumbnail && topArticle.thumbnail.asset) {
29514
+ topArticleThumbnail = urlFor(topArticle.thumbnail.asset).width(350).url();
29515
+ topArticleAltText = topArticle.thumbnail.asset.originalFileName;
29516
+ } else if (props.thumbnail) {
29517
+ topArticleThumbnail = props.thumbnail;
29518
+ }
29519
+
29456
29520
  return React__default.createElement(
29457
29521
  'div',
29458
- { className: 'horizontal-hero-container' },
29522
+ { className: 'horizontal-hero-container', style: { borderRight: '3px solid ' + borderColor, borderTop: '3px solid ' + borderColor } },
29459
29523
  React__default.createElement(
29460
29524
  'div',
29461
29525
  { className: 'horizontal-hero-title' },
@@ -29472,7 +29536,7 @@ var HorizontalHero = function HorizontalHero(props) {
29472
29536
  React__default.createElement(
29473
29537
  'a',
29474
29538
  { href: '/view/' + topArticle.url.current, className: 'horizontal-hero-img' },
29475
- React__default.createElement('img', { src: urlFor(topArticle.thumbnail.asset).width(350).url() })
29539
+ React__default.createElement('img', { src: topArticleThumbnail, alt: topArticleAltText })
29476
29540
  ),
29477
29541
  React__default.createElement(
29478
29542
  'div',
@@ -29519,7 +29583,7 @@ var HorizontalHero = function HorizontalHero(props) {
29519
29583
  React__default.createElement(
29520
29584
  'style',
29521
29585
  { jsx: 'true' },
29522
- '\n .horizontal-hero-container {\n border-right: 3px solid ' + borderColor + ';\n border-top: 3px solid ' + borderColor + ';\n margin-bottom: 3rem;\n margin-top: 2rem;\n position: relative;\n }\n .horizontal-hero-title {\n position: absolute;\n top: -25px;\n background: white;\n z-index: 2;\n padding-right: 1.5rem;\n font-weight: bold;\n }\n .horizontal-hero-inner {\n display: flex;\n flex-direction: row;\n padding-top: 0.75rem;\n margin-top: 0.75rem;\n }\n\n .horizontal-articles-wrap {\n padding: 0 1rem;\n }\n\n .horizontal-hero-img {\n width: 33%;\n min-width: 200px;\n }\n .horizontal-hero-img img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n .horizontal-article {\n border-bottom: 1px solid #ccc;\n display: block;\n margin-bottom: 0.5rem;\n }\n .horizontal-article:hover {\n background: #eee;\n }\n .horizontal-article p {\n margin-bottom: 0.5rem;\n font-weight: bold;\n color: #252525;\n }\n .horizontal-view-more {\n position: absolute;\n right: 0;\n margin-top: 0.25rem;\n font-weight: bold;\n }\n .horizontal-view-more span {\n display: inline-block;\n color: rgb(81, 116, 153);\n font-size: 1.2rem;\n }\n @media screen and (max-width: 768px) {\n .horizontal-hero-img {\n display: none;\n }\n }\n '
29586
+ '\n .horizontal-hero-container {\n margin-bottom: 3rem;\n margin-top: 2rem;\n position: relative;\n }\n .horizontal-hero-title {\n position: absolute;\n top: -25px;\n background: white;\n z-index: 2;\n padding-right: 1.5rem;\n font-weight: bold;\n }\n .horizontal-hero-inner {\n display: flex;\n flex-direction: row;\n padding-top: 0.75rem;\n margin-top: 0.75rem;\n }\n\n .horizontal-articles-wrap {\n padding: 0 1rem;\n }\n\n .horizontal-hero-img {\n width: 33%;\n min-width: 200px;\n }\n .horizontal-hero-img img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n .horizontal-article {\n border-bottom: 1px solid #ccc;\n display: block;\n margin-bottom: 0.5rem;\n }\n .horizontal-article:hover {\n background: #eee;\n }\n .horizontal-article p {\n margin-bottom: 0.5rem;\n font-weight: bold;\n color: #252525;\n }\n .horizontal-view-more {\n position: absolute;\n right: 0;\n margin-top: 0.25rem;\n font-weight: bold;\n }\n .horizontal-view-more span {\n display: inline-block;\n color: rgb(81, 116, 153);\n font-size: 1.2rem;\n }\n @media screen and (max-width: 768px) {\n .horizontal-hero-img {\n display: none;\n }\n }\n '
29523
29587
  )
29524
29588
  );
29525
29589
  };
@@ -29535,13 +29599,21 @@ var OncliveHero = function OncliveHero(props) {
29535
29599
  'div',
29536
29600
  { className: 'article-group--container' },
29537
29601
  props.dataRecord.map(function (article, index) {
29602
+ var articleThumbnail = '';
29603
+ var articleAltText = article.title;
29604
+ if (article.thumbnail && article.thumbnail.asset) {
29605
+ articleThumbnail = urlFor(article.thumbnail.asset).width(250).url();
29606
+ articleAltText = article.thumbnail.asset.originalFileName;
29607
+ } else if (props.thumbnail) {
29608
+ articleThumbnail = props.thumbnail;
29609
+ }
29538
29610
  return React__default.createElement(
29539
29611
  'a',
29540
29612
  { key: index, href: '/view/' + article.url.current, className: 'article-group' },
29541
29613
  React__default.createElement(
29542
29614
  'figure',
29543
29615
  null,
29544
- React__default.createElement('img', { src: urlFor(article.thumbnail.asset).width(250).url(), alt: article.title })
29616
+ React__default.createElement('img', { src: articleThumbnail, alt: articleAltText })
29545
29617
  ),
29546
29618
  React__default.createElement(
29547
29619
  'div',
@@ -29553,7 +29625,7 @@ var OncliveHero = function OncliveHero(props) {
29553
29625
  ),
29554
29626
  React__default.createElement('div', null),
29555
29627
  moment(article.published).format('MMMM Do YYYY, h:mma'),
29556
- article.authorMapping[0].displayName && React__default.createElement(
29628
+ article.authorMapping && article.authorMapping[0] && article.authorMapping[0].displayName && React__default.createElement(
29557
29629
  'p',
29558
29630
  { className: 'mb-2' },
29559
29631
  'By ',
@@ -29574,7 +29646,7 @@ var OncliveHero = function OncliveHero(props) {
29574
29646
  React__default.createElement(
29575
29647
  'style',
29576
29648
  { jsx: 'true' },
29577
- '\n .article-group--container {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n }\n .article-group--container * {\n transition: all 0.13s ease;\n }\n .article-group {\n display: flex;\n flex-direction: row;\n flex: 1 1 auto;\n margin: 0.5rem 1rem;\n width: calc(50% - 2rem);\n background: #fff;\n min-width: 320px;\n transition: all 0.1s ease-out;\n border-top: 1px solid #eee;\n position: relative;\n overflow: hidden;\n }\n \n .article-group:nth-of-type(1) {\n width: 100%;\n }\n .article-group:nth-of-type(1) .article-group--body {\n }\n .article-group:nth-of-type(1) figure img {\n width: 225px;\n }\n .article-group:nth-of-type(1) .article-group--body h2 {\n font-size: 1.4rem;\n }\n .article-group:nth-of-type(1) .article-group--summary {\n display: block;\n }\n @media screen and (max-width: 1091px) {\n .article-group:nth-of-type(1) {\n width: 100%;\n }\n .article-group:nth-of-type(1) .article-group--summary {\n display: none;\n }\n .article-group:nth-of-type(1) figure img {\n width: 130px;\n }\n .article-group:nth-of-type(1) .article-group--body h2 {\n font-size: 1rem;\n }\n }\n .article-group figure {\n margin-bottom: 0;\n }\n .article-group figure img {\n height: 100%;\n width: 130px;\n\n object-fit: cover;\n }\n .article-group--body {\n padding-left: 1rem;\n }\n .article-group--body p {\n font-size: .9rem;\n }\n .article-group--body h2 {\n font-weight: bold;\n margin-top: 1rem;\n font-size: 1rem;\n padding-right: 0.5rem;\n }\n .article-group--summary {\n font-size: 1rem;\n display: none;\n }\n '
29649
+ '\n .article-group--container {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n }\n .article-group--container * {\n transition: all 0.13s ease;\n }\n .article-group {\n display: flex;\n flex-direction: row;\n flex: 1 1 auto;\n margin: 0.5rem 1rem;\n width: calc(50% - 2rem);\n background: #fff;\n min-width: 320px;\n transition: all 0.1s ease-out;\n border-top: 1px solid #eee;\n position: relative;\n overflow: hidden;\n }\n \n .article-group:nth-of-type(1) {\n width: 100%;\n }\n .article-group:nth-of-type(1) .article-group--body {\n }\n .article-group:nth-of-type(1) figure img {\n width: 225px;\n }\n .article-group:nth-of-type(1) .article-group--body h2 {\n font-size: 1.4rem;\n }\n .article-group:nth-of-type(1) .article-group--summary {\n display: block;\n }\n @media screen and (max-width: 1091px) {\n .article-group:nth-of-type(1) {\n width: 100%;\n }\n .article-group:nth-of-type(1) .article-group--summary {\n display: none;\n }\n .article-group:nth-of-type(1) figure img {\n width: 130px;\n }\n .article-group:nth-of-type(1) .article-group--body h2 {\n font-size: 1rem;\n }\n }\n .article-group figure {\n margin-bottom: 0;\n }\n .article-group figure img {\n height: 100%;\n width: 130px;\n object-fit: contain;\n }\n \n .article-group--body {\n padding-left: 1rem;\n }\n .article-group--body p {\n font-size: .9rem;\n }\n .article-group--body h2 {\n font-weight: bold;\n margin-top: 1rem;\n font-size: 1rem;\n padding-right: 0.5rem;\n }\n .article-group--summary {\n font-size: 1rem;\n display: none;\n }\n '
29578
29650
  )
29579
29651
  );
29580
29652
  };
@@ -29589,6 +29661,15 @@ var OncliveLargeHero = function OncliveLargeHero(props) {
29589
29661
  return builder.image(source);
29590
29662
  }
29591
29663
 
29664
+ var topArticleThumbnail = '';
29665
+ var topArticleAltText = topArticle.title;
29666
+ if (topArticle.thumbnail && topArticle.thumbnail.asset) {
29667
+ topArticleThumbnail = urlFor(topArticle.thumbnail.asset).width(550).url();
29668
+ topArticleAltText = topArticle.thumbnail.asset.originalFileName;
29669
+ } else if (props.thumbnail) {
29670
+ topArticleThumbnail = props.thumbnail;
29671
+ }
29672
+
29592
29673
  return React__default.createElement(
29593
29674
  'div',
29594
29675
  { className: 'article-hero-container' },
@@ -29598,8 +29679,7 @@ var OncliveLargeHero = function OncliveLargeHero(props) {
29598
29679
  React__default.createElement(
29599
29680
  'figure',
29600
29681
  null,
29601
- React__default.createElement('img', {
29602
- src: urlFor(topArticle.thumbnail.asset).width(500).url() })
29682
+ React__default.createElement('img', { src: topArticleThumbnail, alt: topArticleAltText })
29603
29683
  ),
29604
29684
  React__default.createElement(
29605
29685
  'div',
@@ -29625,16 +29705,21 @@ var OncliveLargeHero = function OncliveLargeHero(props) {
29625
29705
  'div',
29626
29706
  { className: 'sub-articles-container' },
29627
29707
  subArticles && subArticles.map(function (article, index) {
29708
+ var articleThumbnail = '';
29709
+ var articleAltText = article.title;
29710
+ if (article.thumbnail && article.thumbnail.asset) {
29711
+ articleThumbnail = urlFor(article.thumbnail.asset).width(250).url();
29712
+ articleAltText = article.thumbnail.asset.originalFileName;
29713
+ } else if (props.thumbnail) {
29714
+ articleThumbnail = props.thumbnail;
29715
+ }
29628
29716
  return React__default.createElement(
29629
29717
  'a',
29630
- { href: '/view/' + article.url.current, className: 'sub-article' },
29718
+ { key: index, href: '/view/' + article.url.current, className: 'sub-article' },
29631
29719
  React__default.createElement(
29632
29720
  'figure',
29633
29721
  null,
29634
- React__default.createElement('img', {
29635
- src: urlFor(article.thumbnail.asset).width(250).url(),
29636
- alt: article.title
29637
- })
29722
+ React__default.createElement('img', { src: articleThumbnail, alt: articleAltText })
29638
29723
  ),
29639
29724
  React__default.createElement(
29640
29725
  'div',
@@ -29646,7 +29731,7 @@ var OncliveLargeHero = function OncliveLargeHero(props) {
29646
29731
  ),
29647
29732
  React__default.createElement('div', null),
29648
29733
  moment(article.published).format('MMMM Do YYYY, h:mma'),
29649
- article.authorMapping[0].displayName && React__default.createElement(
29734
+ article.authorMapping && article.authorMapping[0] && article.authorMapping[0].displayName && React__default.createElement(
29650
29735
  'p',
29651
29736
  { className: 'mb-2' },
29652
29737
  'By ',
@@ -29695,10 +29780,18 @@ var VerticalHero = function VerticalHero(props) {
29695
29780
  )
29696
29781
  ),
29697
29782
  props.dataRecord.map(function (article, index) {
29783
+ var articleThumbnail = '';
29784
+ var articleAltText = article.title;
29785
+ if (article.thumbnail && article.thumbnail.asset) {
29786
+ articleThumbnail = urlFor(article.thumbnail.asset).width(500).url();
29787
+ articleAltText = article.thumbnail.asset.originalFileName;
29788
+ } else if (props.thumbnail) {
29789
+ articleThumbnail = props.thumbnail;
29790
+ }
29698
29791
  return index === 0 ? React__default.createElement(
29699
29792
  'a',
29700
29793
  { href: '/view/' + article.url.current, key: index, className: 'vertical-article' },
29701
- React__default.createElement('img', { src: urlFor(article.thumbnail.asset).width(500).url() }),
29794
+ React__default.createElement('img', { src: articleThumbnail, alt: articleAltText }),
29702
29795
  React__default.createElement(
29703
29796
  'h2',
29704
29797
  null,
@@ -29718,7 +29811,7 @@ var VerticalHero = function VerticalHero(props) {
29718
29811
  React__default.createElement(
29719
29812
  'style',
29720
29813
  { jsx: 'true' },
29721
- '\n .vertical-hero-container {\n display: flex;\n flex-direction: row;\n padding: 0.25rem;\n justify-content: space-between;\n width: 100%;\n flex: 1 1 auto;\n \n }\n .hero-title h2{\n font-size: 1.2rem;\n font-weight: bold;\n \n }\n .vertical-article {\n display: block;\n }\n .vertical-article img {\n width: 100%;\n height: auto;\n min-width: 200px;\n }\n .vertical-article h2 {\n font-size: .9rem;\n color: #252525;\n font-weight: bold;\n padding: 0.5rem .5rem 1rem;\n margin: 0.5rem;\n border-bottom: 1px solid #ccc;\n }\n \n '
29814
+ '\n .vertical-hero-container {\n display: flex;\n flex-direction: row;\n padding: 0.25rem;\n justify-content: space-between;\n width: 100%;\n flex: 1 1 auto;\n }\n .hero-title h2 {\n font-size: 1.2rem;\n font-weight: bold;\n }\n .vertical-article {\n display: block;\n }\n .vertical-article img {\n width: 100%;\n height: auto;\n min-width: 200px;\n }\n .vertical-article h2 {\n font-size: 0.9rem;\n color: #252525;\n font-weight: bold;\n padding: 0.5rem 0.5rem 1rem;\n margin: 0.5rem;\n border-bottom: 1px solid #ccc;\n }\n '
29722
29815
  )
29723
29816
  );
29724
29817
  };
@@ -29732,6 +29825,16 @@ var YahooHero = function YahooHero(props) {
29732
29825
  function urlFor(source) {
29733
29826
  return builder.image(source);
29734
29827
  }
29828
+
29829
+ var topArticleThumbnail = '';
29830
+ var topArticleAltText = topArticle.title;
29831
+ if (topArticle.thumbnail && topArticle.thumbnail.asset) {
29832
+ topArticleThumbnail = urlFor(topArticle.thumbnail.asset).width(600).url();
29833
+ topArticleAltText = topArticle.thumbnail.asset.originalFileName;
29834
+ } else if (props.thumbnail) {
29835
+ topArticleThumbnail = props.thumbnail;
29836
+ }
29837
+
29735
29838
  return React__default.createElement(
29736
29839
  'div',
29737
29840
  { className: 'article-hero' },
@@ -29744,7 +29847,7 @@ var YahooHero = function YahooHero(props) {
29744
29847
  React__default.createElement(
29745
29848
  'div',
29746
29849
  { className: 'yh-top-article--img' },
29747
- React__default.createElement('img', { src: urlFor(topArticle.thumbnail.asset).width(600).url(), alt: topArticle.thumbnail.asset.originalFileName })
29850
+ React__default.createElement('img', { src: topArticleThumbnail, alt: topArticleAltText })
29748
29851
  ),
29749
29852
  React__default.createElement('div', { className: 'yh-top-article--blur' }),
29750
29853
  React__default.createElement(
@@ -29772,10 +29875,19 @@ var YahooHero = function YahooHero(props) {
29772
29875
  'div',
29773
29876
  { className: 'yh-sub-article-container' },
29774
29877
  subArticles.map(function (article, index) {
29878
+ var articleThumbnail = '';
29879
+ var articleAltText = article.title;
29880
+ if (article.thumbnail && article.thumbnail.asset) {
29881
+ articleThumbnail = urlFor(article.thumbnail.asset).width(250).url();
29882
+ articleAltText = article.thumbnail.asset.originalFileName;
29883
+ } else if (props.thumbnail) {
29884
+ articleThumbnail = props.thumbnail;
29885
+ }
29886
+
29775
29887
  return React__default.createElement(
29776
29888
  'a',
29777
29889
  { href: '/view/' + article.url.current, key: index, className: 'yh-sub-article' },
29778
- React__default.createElement('img', { src: urlFor(article.thumbnail.asset).width(250).url() }),
29890
+ React__default.createElement('img', { src: articleThumbnail }),
29779
29891
  React__default.createElement(
29780
29892
  'h6',
29781
29893
  { className: 'yh-sub-article--title' },
@@ -29786,9 +29898,9 @@ var YahooHero = function YahooHero(props) {
29786
29898
  { className: 'yh-sub-article--info' },
29787
29899
  moment(article.published).format('MMMM DD, YYYY hh:mma')
29788
29900
  ),
29789
- React__default.createElement(
29901
+ article.authorMapping && article.authorMapping[0] && React__default.createElement(
29790
29902
  'p',
29791
- { className: 'yh-sub-article--info' },
29903
+ null,
29792
29904
  'By ',
29793
29905
  React__default.createElement(
29794
29906
  'b',
@@ -29802,7 +29914,7 @@ var YahooHero = function YahooHero(props) {
29802
29914
  React__default.createElement(
29803
29915
  'style',
29804
29916
  { jsx: 'true' },
29805
- '\n .yh-top-article {\n display: flex;\n flex-direction: row;\n position: relative;\n font-family: \'Roboto\', sans-serif;\n margin-bottom: 1rem;\n border-radius: 15px;\n overflow: hidden;\n min-height: 315px;\n }\n .yh-top-article--img {\n width: 100%;\n min-height: 240px;\n overflow: hidden;\n }\n .yh-top-article--img img {\n width: 100%;\n height: auto;\n min-height: 100%;\n max-height: 315px;\n object-fit: cover;\n }\n .yh-top-article--body {\n height: 100%;\n width: 40%;\n min-width: 320px;\n right: 0;\n position: absolute;\n color: white;\n padding: 1.75rem;\n height: 315px;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n flex-direction: column;\n }\n .yh-top-article--body h1 {\n color: white!important;\n font-size: 1.4rem;\n font-weight: 500;\n margin-bottom: 0.5rem;\n }\n .yh-top-article--body p {\n font-size: 0.9rem;\n margin-bottom: 0.5rem;\n }\n .yh-top-article--blur {\n height: 100%;\n width: 40%;\n right: 0;\n position: absolute;\n filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));\n background: rgba(0,0,0,.65);\n min-width: 320px;\n }\n .yh-sub-article-container {\n display: flex;\n justify-content: space-between;\n }\n .yh-sub-article {\n width: 23.25%;\n }\n .yh-sub-article p.yh-sub-article--title {\n font-weight: bold;\n }\n .yh-sub-article img {\n width: 100%;\n height: 150px;\n object-fit: cover;\n border-radius: 15px;\n }\n .yh-sub-article--title {\n font-weight: bold;\n margin-top: .25rem;\n font-size: 1rem;\n margin-bottom: .25rem;\n }\n .yh-sub-article--info {\n font-size: .8rem;\n margin-bottom: 0;\n \n }\n @media screen and (max-width: 968px) {\n .yh-sub-article-container {\n flex-wrap: wrap;\n }\n .yh-sub-article {\n width: 48%;\n margin-bottom: 1rem;\n }\n }\n '
29917
+ '\n .yh-top-article {\n display: flex;\n flex-direction: row;\n position: relative;\n font-family: \'Roboto\', sans-serif;\n margin-bottom: 1rem;\n border-radius: 15px;\n overflow: hidden;\n min-height: 315px;\n }\n .yh-top-article--img {\n width: 100%;\n min-height: 240px;\n overflow: hidden;\n }\n .yh-top-article--img img {\n width: 100%;\n height: auto;\n min-height: 100%;\n max-height: 315px;\n object-fit: cover;\n }\n .yh-top-article--body {\n height: 100%;\n width: 40%;\n min-width: 320px;\n right: 0;\n position: absolute;\n color: white;\n padding: 1.75rem;\n height: 315px;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n flex-direction: column;\n }\n .yh-top-article--body h1 {\n color: white!important;\n font-size: 1.4rem;\n font-weight: 500;\n margin-bottom: 0.5rem;\n }\n .yh-top-article--body p {\n font-size: 0.9rem;\n margin-bottom: 0.5rem;\n }\n .yh-top-article--blur {\n height: 100%;\n width: 40%;\n right: 0;\n position: absolute;\n filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));\n background: rgba(0,0,0,.65);\n min-width: 320px;\n }\n .yh-sub-article-container {\n display: flex;\n justify-content: space-between;\n }\n .yh-sub-article {\n width: 23.25%;\n }\n .yh-sub-article p.yh-sub-article--title {\n font-weight: bold;\n }\n .yh-sub-article img {\n width: 100%;\n height: 150px;\n object-fit: cover;\n border-radius: 15px;\n }\n .yh-sub-article img[src=\'' + props.thumbnail + '\']{\n object-fit: contain;\n }\n .yh-sub-article--title {\n font-weight: bold;\n margin-top: .25rem;\n font-size: 1rem;\n margin-bottom: .25rem;\n }\n .yh-sub-article--info {\n font-size: .8rem;\n margin-bottom: 0;\n \n }\n @media screen and (max-width: 968px) {\n .yh-sub-article-container {\n flex-wrap: wrap;\n }\n .yh-sub-article {\n width: 48%;\n margin-bottom: 1rem;\n }\n }\n '
29806
29918
  )
29807
29919
  );
29808
29920
  };