@mjhls/mjh-framework 1.0.817-image-crop-test-v4 → 1.0.818

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.
Files changed (98) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/AlgoliaSearch.js +5 -6
  3. package/dist/cjs/ArticleCarousel.js +0 -1
  4. package/dist/cjs/ArticleProgramLandingPage.js +1 -2
  5. package/dist/cjs/ArticleSeriesListing.js +0 -1
  6. package/dist/cjs/ConferenceArticleCard.js +9 -4
  7. package/dist/cjs/DeckContent.js +15 -9
  8. package/dist/cjs/DeckQueue.js +16 -9
  9. package/dist/cjs/ExternalResources.js +1 -2
  10. package/dist/cjs/Feature.js +9 -5
  11. package/dist/cjs/ForbesHero.js +14 -12
  12. package/dist/cjs/GridContent.js +26 -20
  13. package/dist/cjs/GridHero.js +19 -10
  14. package/dist/cjs/GroupDeck.js +8 -4
  15. package/dist/cjs/HamMagazine.js +21 -11
  16. package/dist/cjs/Hero.js +14 -3
  17. package/dist/cjs/HorizontalArticleListing.js +1 -2
  18. package/dist/cjs/HorizontalHero.js +6 -5
  19. package/dist/cjs/IssueContentDeck.js +27 -10
  20. package/dist/cjs/IssueDeck.js +12 -10
  21. package/dist/cjs/IssueLanding.js +1 -2
  22. package/dist/cjs/MasterDeck.js +1 -1
  23. package/dist/cjs/MediaSeriesLanding.js +6 -6
  24. package/dist/cjs/OncliveHero.js +6 -5
  25. package/dist/cjs/OncliveLargeHero.js +22 -21
  26. package/dist/cjs/PartnerDetailListing.js +10 -6
  27. package/dist/cjs/PubSection.js +0 -1
  28. package/dist/cjs/PublicationDeck.js +12 -10
  29. package/dist/cjs/PublicationLanding.js +5 -2
  30. package/dist/cjs/QueueDeckExpanded.js +69 -70
  31. package/dist/cjs/RecentNews.js +6 -3
  32. package/dist/cjs/RelatedContent.js +10 -7
  33. package/dist/cjs/SeriesListingDeck.js +1 -2
  34. package/dist/cjs/{SeriesSlider-d54fa925.js → SeriesSlider-c022ce04.js} +7 -2
  35. package/dist/cjs/TaxonomyCard.js +14 -11
  36. package/dist/cjs/TaxonomyDescription.js +1 -2
  37. package/dist/cjs/ThumbnailCard.js +10 -6
  38. package/dist/cjs/VerticalHero.js +7 -3
  39. package/dist/cjs/VideoProgramLandingPage.js +1 -2
  40. package/dist/cjs/VideoSeriesCard.js +7 -8
  41. package/dist/cjs/VideoSeriesLandingPage.js +0 -1
  42. package/dist/cjs/VideoSeriesListing.js +1 -2
  43. package/dist/cjs/View.js +9 -9
  44. package/dist/cjs/YahooHero.js +13 -11
  45. package/dist/cjs/YoutubeGroup.js +8 -4
  46. package/dist/cjs/getSerializers.js +1 -2
  47. package/dist/cjs/{index-55c6de08.js → index-e5fd35c7.js} +91 -47
  48. package/dist/cjs/index.js +20 -6
  49. package/dist/cjs/urlFor.js +2 -34
  50. package/dist/esm/AlgoliaSearch.js +3 -4
  51. package/dist/esm/ArticleCarousel.js +0 -1
  52. package/dist/esm/ArticleProgramLandingPage.js +1 -2
  53. package/dist/esm/ArticleSeriesListing.js +0 -1
  54. package/dist/esm/ConferenceArticleCard.js +9 -4
  55. package/dist/esm/DeckContent.js +11 -5
  56. package/dist/esm/DeckQueue.js +12 -5
  57. package/dist/esm/ExternalResources.js +1 -2
  58. package/dist/esm/Feature.js +9 -5
  59. package/dist/esm/ForbesHero.js +8 -6
  60. package/dist/esm/GridContent.js +11 -5
  61. package/dist/esm/GridHero.js +13 -4
  62. package/dist/esm/GroupDeck.js +8 -4
  63. package/dist/esm/HamMagazine.js +21 -11
  64. package/dist/esm/Hero.js +14 -3
  65. package/dist/esm/HorizontalArticleListing.js +1 -2
  66. package/dist/esm/HorizontalHero.js +6 -5
  67. package/dist/esm/IssueContentDeck.js +27 -10
  68. package/dist/esm/IssueDeck.js +12 -10
  69. package/dist/esm/IssueLanding.js +1 -2
  70. package/dist/esm/MasterDeck.js +1 -1
  71. package/dist/esm/MediaSeriesLanding.js +4 -4
  72. package/dist/esm/OncliveHero.js +6 -5
  73. package/dist/esm/OncliveLargeHero.js +9 -8
  74. package/dist/esm/PartnerDetailListing.js +10 -6
  75. package/dist/esm/PubSection.js +0 -1
  76. package/dist/esm/PublicationDeck.js +12 -10
  77. package/dist/esm/PublicationLanding.js +5 -2
  78. package/dist/esm/QueueDeckExpanded.js +20 -21
  79. package/dist/esm/RecentNews.js +6 -3
  80. package/dist/esm/RelatedContent.js +6 -3
  81. package/dist/esm/SeriesListingDeck.js +1 -2
  82. package/dist/esm/{SeriesSlider-8f2aca58.js → SeriesSlider-8414085b.js} +7 -2
  83. package/dist/esm/TaxonomyCard.js +11 -8
  84. package/dist/esm/TaxonomyDescription.js +1 -2
  85. package/dist/esm/ThumbnailCard.js +7 -3
  86. package/dist/esm/VerticalHero.js +7 -3
  87. package/dist/esm/VideoProgramLandingPage.js +1 -2
  88. package/dist/esm/VideoSeriesCard.js +3 -4
  89. package/dist/esm/VideoSeriesLandingPage.js +0 -1
  90. package/dist/esm/VideoSeriesListing.js +1 -2
  91. package/dist/esm/View.js +9 -9
  92. package/dist/esm/YahooHero.js +8 -6
  93. package/dist/esm/YoutubeGroup.js +8 -4
  94. package/dist/esm/getSerializers.js +1 -2
  95. package/dist/esm/{index-e8c6a892.js → index-04c4d8d6.js} +67 -23
  96. package/dist/esm/index.js +19 -6
  97. package/dist/esm/urlFor.js +2 -34
  98. package/package.json +1 -1
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
2
  import { m as moment } from './moment-bc12cb97.js';
3
- import urlFor from './urlFor.js';
3
+ import { i as imageUrlBuilder } from './index-0dbff1d1.js';
4
4
  import './_commonjsHelpers-0c4b6f40.js';
5
- import './index-0dbff1d1.js';
6
5
 
7
6
  /*
8
7
  Example usage - targetedonc.com/latest-conference
@@ -27,8 +26,14 @@ var ConferenceArticleCard = function ConferenceArticleCard(props) {
27
26
  props.index;
28
27
  var client = props.client;
29
28
 
30
- // title, thumbnail, summary, published, documentGroup.identifier.current, documentGroup.identifier.name
31
29
 
30
+ var builder = imageUrlBuilder(client);
31
+
32
+ function urlFor(source) {
33
+ return builder.image(source).auto('format');
34
+ }
35
+
36
+ // title, thumbnail, summary, published, documentGroup.identifier.current, documentGroup.identifier.name
32
37
  return React.createElement(
33
38
  'div',
34
39
  { className: 'conference-media' },
@@ -37,7 +42,7 @@ var ConferenceArticleCard = function ConferenceArticleCard(props) {
37
42
  { className: 'img-wrapper', href: '/view/' + (data.url ? data.url.current : '') },
38
43
  React.createElement('img', {
39
44
  className: 'mr-3 img-fluid',
40
- src: data.thumbnail && urlFor({ client: client, source: data.thumbnail.asset, imageWidth: 350 }),
45
+ src: data.thumbnail && urlFor(data.thumbnail.asset).width(350).url(),
41
46
  alt: data.title
42
47
  })
43
48
  ),
@@ -12,7 +12,7 @@ import { withRouter } from 'next/router';
12
12
  import { d as debounce_1 } from './debounce-533d9748.js';
13
13
  import { I as InfiniteScroll } from './index.es-c6222053.js';
14
14
  import { V as VisibilitySensor } from './visibility-sensor-f40c2564.js';
15
- import urlFor from './urlFor.js';
15
+ import { i as imageUrlBuilder } from './index-0dbff1d1.js';
16
16
  import { L as LazyLoad } from './index-35bdcc81.js';
17
17
  import { m as main_43 } from './main-b5c5aac1.js';
18
18
  import { c as clean_html_1 } from './entities-932b50cf.js';
@@ -34,7 +34,6 @@ import 'prop-types';
34
34
  import './isSymbol-a7e9aafe.js';
35
35
  import './toNumber-5aeba6e7.js';
36
36
  import 'react-dom';
37
- import './index-0dbff1d1.js';
38
37
  import './slicedToArray-be2f7a22.js';
39
38
  import './AdSlot.js';
40
39
  import './Beam.js';
@@ -56,7 +55,7 @@ var DeckContent = function (_React$Component) {
56
55
  args[_key] = arguments[_key];
57
56
  }
58
57
 
59
- return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = DeckContent.__proto__ || _Object$getPrototypeOf(DeckContent)).call.apply(_ref, [this].concat(args))), _this), _this.mapping = _this.props.mapping, _this.data = _this.props.dataRecord || [], _this.query = _this.props.query, _this.params = _this.props.params, _this.pointer = _this.props.pointer ? _this.props.pointer : false, _this.pointerArray = _this.props.pointerArray ? _this.props.pointerArray : false, _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.client = _this.props.client, _this.state = {
58
+ return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = DeckContent.__proto__ || _Object$getPrototypeOf(DeckContent)).call.apply(_ref, [this].concat(args))), _this), _this.mapping = _this.props.mapping, _this.data = _this.props.dataRecord || [], _this.query = _this.props.query, _this.params = _this.props.params, _this.pointer = _this.props.pointer ? _this.props.pointer : false, _this.pointerArray = _this.props.pointerArray ? _this.props.pointerArray : false, _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.state = {
60
59
  data: _this.data,
61
60
  dataKeptToCompareNewDatarecord: _this.data,
62
61
  per: _this.params ? _this.params.to : 2,
@@ -117,10 +116,17 @@ var DeckContent = function (_React$Component) {
117
116
  }
118
117
  });
119
118
  });
119
+ }, _this.urlFor = function (source) {
120
+ var client = _this.props.client;
121
+
122
+ var builder = imageUrlBuilder(client);
123
+ return builder.image(source).auto('format');
120
124
  }, _this.renderCardImage = function (row, page) {
121
125
  if (row.thumbnail && row.thumbnail.asset) {
122
- var url = urlFor({ client: _this.client, source: row.thumbnail, imageHeight: _this.props.imageHeight || null, imageWidth: _this.props.imageWidth || null, imageFit: _this.props.imageFit || null });
123
- return url;
126
+ var url = _this.urlFor(row.thumbnail);
127
+ if (_this.props.imageHeight) url = url.height(_this.props.imageHeight);
128
+ if (_this.props.imageWidth) url = url.width(_this.props.imageWidth);
129
+ return url.url();
124
130
  } else {
125
131
  return _this.defaultImage;
126
132
  }
@@ -14,7 +14,7 @@ import { L as LazyLoad } from './index-35bdcc81.js';
14
14
  import { g as get_1 } from './get-3c308da4.js';
15
15
  import { d as debounce_1 } from './debounce-533d9748.js';
16
16
  import { I as InfiniteScroll } from './index.es-c6222053.js';
17
- import urlFor from './urlFor.js';
17
+ import { i as imageUrlBuilder } from './index-0dbff1d1.js';
18
18
  import { m as main_43 } from './main-b5c5aac1.js';
19
19
  import { c as clean_html_1 } from './entities-932b50cf.js';
20
20
  import './_commonjsHelpers-0c4b6f40.js';
@@ -35,7 +35,6 @@ import 'react-dom';
35
35
  import './isSymbol-a7e9aafe.js';
36
36
  import './eq-bdcbf886.js';
37
37
  import './toNumber-5aeba6e7.js';
38
- import './index-0dbff1d1.js';
39
38
 
40
39
  var DeckQueue = function (_React$Component) {
41
40
  _inherits(DeckQueue, _React$Component);
@@ -51,7 +50,7 @@ var DeckQueue = function (_React$Component) {
51
50
  args[_key] = arguments[_key];
52
51
  }
53
52
 
54
- return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = DeckQueue.__proto__ || _Object$getPrototypeOf(DeckQueue)).call.apply(_ref, [this].concat(args))), _this), _this.page = _this.props.page, _this.data = _this.props.dataRecord, _this.query = _this.props.query, _this.params = _this.props.params, _this.client = _this.props.client, _this.pointer = _this.props.pointer ? _this.props.pointer : false, _this.pointerArray = _this.props.pointerArray ? _this.props.pointerArray : false, _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.imageHeight = _this.props.imageHeight ? _this.props.imageHeight : 270, _this.state = {
53
+ return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = DeckQueue.__proto__ || _Object$getPrototypeOf(DeckQueue)).call.apply(_ref, [this].concat(args))), _this), _this.page = _this.props.page, _this.data = _this.props.dataRecord, _this.query = _this.props.query, _this.params = _this.props.params, _this.pointer = _this.props.pointer ? _this.props.pointer : false, _this.pointerArray = _this.props.pointerArray ? _this.props.pointerArray : false, _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.imageHeight = _this.props.imageHeight ? _this.props.imageHeight : 270, _this.state = {
55
54
  data: _this.data,
56
55
  per: _this.params ? _this.params.to : 2,
57
56
  page: _this.props.currentPage || 1,
@@ -81,6 +80,7 @@ var DeckQueue = function (_React$Component) {
81
80
  data = _this$state.data,
82
81
  query = _this$state.query,
83
82
  page = _this$state.page;
83
+ var client = _this.props.client;
84
84
 
85
85
 
86
86
  var params = _extends({}, _this.params, { from: from, to: to
@@ -109,10 +109,17 @@ var DeckQueue = function (_React$Component) {
109
109
  }
110
110
  });
111
111
  });
112
+ }, _this.urlFor = function (source) {
113
+ var client = _this.props.client;
114
+
115
+ var builder = imageUrlBuilder(client);
116
+ return builder.image(source).auto('format');
112
117
  }, _this.renderCardImage = function (row) {
113
118
  if (row.thumbnail && row.thumbnail.asset) {
114
- var url = urlFor({ client: _this.client, source: row.thumbnail, imageHeight: _this.imageHeight || null, imageWidth: _this.props.imageWidth || null, imageFit: _this.props.imageFit || null });
115
- return url;
119
+ var url = _this.urlFor(row.thumbnail);
120
+ url = url.height(_this.imageHeight);
121
+ if (_this.props.imageWidth) url = url.width(_this.props.imageWidth);
122
+ return url.url();
116
123
  } else {
117
124
  return _this.defaultImage;
118
125
  }
@@ -2,7 +2,7 @@ import { _ as _extends } from './extends-60e0e1c6.js';
2
2
  import { _ as _slicedToArray } from './slicedToArray-be2f7a22.js';
3
3
  import React, { useState, useEffect } from 'react';
4
4
  import { B as BlockContent } from './BlockContent-52cf21c5.js';
5
- import { g as getSerializers } from './index-e8c6a892.js';
5
+ import { g as getSerializers } from './index-04c4d8d6.js';
6
6
  import { m as momentTimezone } from './index-79cfd25c.js';
7
7
  import { useRouter } from 'next/router';
8
8
  import Button from 'react-bootstrap/Button';
@@ -15,7 +15,6 @@ import './core.get-iterator-method-133dfacd.js';
15
15
  import 'prop-types';
16
16
  import './index-0dbff1d1.js';
17
17
  import 'react-bootstrap';
18
- import './urlFor.js';
19
18
  import './index-2446af28.js';
20
19
  import './events-6c3a7a63.js';
21
20
  import './index-c7e2ac95.js';
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
- import urlFor from './urlFor.js';
2
+ import { i as imageUrlBuilder } from './index-0dbff1d1.js';
3
3
  import { m as main_43 } from './main-b5c5aac1.js';
4
4
  import Carousel from 'react-bootstrap/Carousel';
5
- import './index-0dbff1d1.js';
6
5
  import './_commonjsHelpers-0c4b6f40.js';
7
6
 
8
7
  //Feature query to be used
@@ -17,8 +16,7 @@ import './_commonjsHelpers-0c4b6f40.js';
17
16
  var Feature = function Feature(props) {
18
17
  var dataset = props.dataset;
19
18
  var _props$controls = props.controls,
20
- controls = _props$controls === undefined ? false : _props$controls,
21
- client = props.client;
19
+ controls = _props$controls === undefined ? false : _props$controls;
22
20
 
23
21
 
24
22
  var checkUrlIsExternal = function checkUrlIsExternal(url) {
@@ -28,6 +26,12 @@ var Feature = function Feature(props) {
28
26
  return false;
29
27
  };
30
28
 
29
+ var urlFor = function urlFor(source) {
30
+ var client = props.client;
31
+
32
+ var builder = imageUrlBuilder(client);
33
+ return builder.image(source).auto('format');
34
+ };
31
35
  //image width updated.
32
36
  var imageWidth = 450;
33
37
  if (main_43) {
@@ -91,7 +95,7 @@ var Feature = function Feature(props) {
91
95
  React.createElement('img', {
92
96
  style: { maxHeight: '375px', minHeight: '300px', objectFit: 'cover', paddingLeft: '50%' },
93
97
  className: 'd-block w-100',
94
- src: urlFor({ client: client, source: feature_img, imageWidth: imageWidth }),
98
+ src: urlFor(feature_img).width(imageWidth).url(),
95
99
  alt: feature_alt
96
100
  }),
97
101
  React.createElement(
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
2
  import { m as moment } from './moment-bc12cb97.js';
3
- import urlFor from './urlFor.js';
3
+ import { i as imageUrlBuilder } from './index-0dbff1d1.js';
4
4
  import { A as AuthorComponent } from './AuthorComponent-5ae7409f.js';
5
5
  import { L as LazyLoad } from './index-35bdcc81.js';
6
6
  import './_commonjsHelpers-0c4b6f40.js';
7
- import './index-0dbff1d1.js';
8
7
  import './slicedToArray-be2f7a22.js';
9
8
  import './web.dom.iterable-4109ff68.js';
10
9
  import './es6.string.iterator-bc33758b.js';
@@ -21,12 +20,15 @@ var fbsHero = function fbsHero(props) {
21
20
 
22
21
  var client = props.client;
23
22
 
23
+ var builder = imageUrlBuilder(client);
24
+ function urlFor(source) {
25
+ return builder.image(source).auto('format');
26
+ }
24
27
 
25
28
  var topArticleThumbnail = '';
26
29
  var topArticleAltText = topArticle.title;
27
30
  if (topArticle.thumbnail && topArticle.thumbnail.asset) {
28
- topArticleThumbnail = urlFor({ client: client, source: topArticle.thumbnail.asset, imageWidth: 600 });
29
-
31
+ topArticleThumbnail = urlFor(topArticle.thumbnail.asset).width(600).url();
30
32
  topArticleAltText = topArticle.thumbnail.asset.originalFileName;
31
33
  } else if (props.thumbnail) {
32
34
  topArticleThumbnail = props.thumbnail;
@@ -82,7 +84,7 @@ var fbsHero = function fbsHero(props) {
82
84
  var articleThumbnail = '';
83
85
  var articleAltText = article.title;
84
86
  if (article.thumbnail && article.thumbnail.asset) {
85
- articleThumbnail = urlFor({ client: client, source: article.thumbnail.asset, imageWidth: 250 });
87
+ articleThumbnail = urlFor(article.thumbnail.asset).width(250).url();
86
88
  articleAltText = article.thumbnail.asset.originalFileName;
87
89
  } else if (props.thumbnail) {
88
90
  articleThumbnail = props.thumbnail;
@@ -125,7 +127,7 @@ var fbsHero = function fbsHero(props) {
125
127
  React.createElement(
126
128
  'style',
127
129
  { jsx: 'true' },
128
- '\n .author-wrapper {\n text-align: center;\n }\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\n max-height: 400px;\n min-height: 275px;\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: 145px;\n min-width: 145px;\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 '
130
+ '\n .author-wrapper {\n text-align: center;\n }\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\n max-height: 300px;\n min-height: 275px;\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: 145px;\n min-width: 145px;\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 '
129
131
  )
130
132
  );
131
133
  };
@@ -19,7 +19,7 @@ import { g as getContentCategory } from './getContentCategory-15dcc413.js';
19
19
  import { g as get_1 } from './get-3c308da4.js';
20
20
  import { d as debounce_1 } from './debounce-533d9748.js';
21
21
  import { I as InfiniteScroll } from './index.es-c6222053.js';
22
- import urlFor from './urlFor.js';
22
+ import { i as imageUrlBuilder } from './index-0dbff1d1.js';
23
23
  import { m as main_43 } from './main-b5c5aac1.js';
24
24
  import './AD.js';
25
25
  import { A as AuthorComponent } from './AuthorComponent-5ae7409f.js';
@@ -47,7 +47,6 @@ import './Segment.js';
47
47
  import './isSymbol-a7e9aafe.js';
48
48
  import './eq-bdcbf886.js';
49
49
  import './toNumber-5aeba6e7.js';
50
- import './index-0dbff1d1.js';
51
50
 
52
51
  var GridContent = function (_React$Component) {
53
52
  _inherits(GridContent, _React$Component);
@@ -63,7 +62,7 @@ var GridContent = function (_React$Component) {
63
62
  args[_key] = arguments[_key];
64
63
  }
65
64
 
66
- return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = GridContent.__proto__ || _Object$getPrototypeOf(GridContent)).call.apply(_ref, [this].concat(args))), _this), _this.page = _this.props.page, _this.mapping = _this.props.mapping, _this.data = _this.props.dataRecord, _this.query = _this.props.query, _this.params = _this.props.params, _this.client = _this.props.client, _this.pointer = _this.props.pointer ? _this.props.pointer : false, _this.pointerArray = _this.props.pointerArray ? _this.props.pointerArray : false, _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.state = {
65
+ return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = GridContent.__proto__ || _Object$getPrototypeOf(GridContent)).call.apply(_ref, [this].concat(args))), _this), _this.page = _this.props.page, _this.mapping = _this.props.mapping, _this.data = _this.props.dataRecord, _this.query = _this.props.query, _this.params = _this.props.params, _this.pointer = _this.props.pointer ? _this.props.pointer : false, _this.pointerArray = _this.props.pointerArray ? _this.props.pointerArray : false, _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.state = {
67
66
  data: _this.data,
68
67
  per: _this.params ? _this.params.to : 2,
69
68
  page: _this.props.currentPage || 1,
@@ -150,10 +149,17 @@ var GridContent = function (_React$Component) {
150
149
  }
151
150
  });
152
151
  });
152
+ }, _this.urlFor = function (source) {
153
+ var client = _this.props.client;
154
+
155
+ var builder = imageUrlBuilder(client);
156
+ return builder.image(source).auto('format');
153
157
  }, _this.renderCardImage = function (row, page) {
154
158
  if (row.thumbnail && row.thumbnail.asset) {
155
- var url = urlFor({ client: _this.client, source: row.thumbnail, imageHeight: _this.props.imageHeight || null, imageWidth: _this.props.imageWidth || null, imageFit: _this.props.imageFit || null });
156
- return url;
159
+ var url = _this.urlFor(row.thumbnail);
160
+ if (_this.props.imageHeight) url = url.height(_this.props.imageHeight);
161
+ if (_this.props.imageWidth) url = url.width(_this.props.imageWidth);
162
+ return url.url();
157
163
  } else {
158
164
  return _this.defaultImage;
159
165
  }
@@ -1,11 +1,10 @@
1
1
  import React from 'react';
2
2
  import { m as moment } from './moment-bc12cb97.js';
3
- import urlFor from './urlFor.js';
3
+ import { i as imageUrlBuilder } from './index-0dbff1d1.js';
4
4
  import { c as clean_html_1 } from './entities-932b50cf.js';
5
5
  import { L as LazyLoad } from './index-35bdcc81.js';
6
6
  import { A as AuthorComponent } from './AuthorComponent-5ae7409f.js';
7
7
  import './_commonjsHelpers-0c4b6f40.js';
8
- import './index-0dbff1d1.js';
9
8
  import 'react-dom';
10
9
  import 'prop-types';
11
10
  import './slicedToArray-be2f7a22.js';
@@ -26,11 +25,21 @@ var GridHero = function GridHero(props) {
26
25
  _props$subHeight = props.subHeight,
27
26
  subHeight = _props$subHeight === undefined ? 270 : _props$subHeight;
28
27
 
28
+ var builder = imageUrlBuilder(client);
29
+ function urlFor(source) {
30
+ var imageWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
31
+ var imageHeight = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
32
+
33
+ var url = builder.image(source);
34
+ if (imageWidth) url = url.width(imageWidth);
35
+ if (imageHeight) url = url.height(imageHeight);
36
+ return url.auto('format').url();
37
+ }
29
38
 
30
39
  var topArticleThumbnail = '';
31
40
  var topArticleAltText = topArticle.title;
32
41
  if (topArticle.thumbnail && topArticle.thumbnail.asset) {
33
- topArticleThumbnail = urlFor({ client: client, source: topArticle.thumbnail.asset, imageWidth: topWidth });
42
+ topArticleThumbnail = urlFor(topArticle.thumbnail.asset, topWidth);
34
43
  topArticleAltText = topArticle.thumbnail.asset.originalFileName;
35
44
  } else if (props.thumbnail) {
36
45
  topArticleThumbnail = props.thumbnail;
@@ -87,7 +96,7 @@ var GridHero = function GridHero(props) {
87
96
  var articleThumbnail = '';
88
97
  var articleAltText = article.title;
89
98
  if (article.thumbnail && article.thumbnail.asset) {
90
- articleThumbnail = urlFor({ client: client, source: article.thumbnail.asset, imageWidth: subWidth, imageHeight: subHeight });
99
+ articleThumbnail = urlFor(article.thumbnail.asset, subWidth, subHeight);
91
100
  articleAltText = article.thumbnail.asset.originalFileName;
92
101
  } else if (props.thumbnail) {
93
102
  articleThumbnail = props.thumbnail;
@@ -3,7 +3,7 @@ import { _ as _slicedToArray } from './slicedToArray-be2f7a22.js';
3
3
  import React, { useRef, useState, useEffect } from 'react';
4
4
  import { g as getYoutubeId } from './index-c7e2ac95.js';
5
5
  import { s as smoothscroll } from './smoothscroll-fa4e3f8c.js';
6
- import urlFor from './urlFor.js';
6
+ import { i as imageUrlBuilder } from './index-0dbff1d1.js';
7
7
  import './_commonjsHelpers-0c4b6f40.js';
8
8
  import './es6.string.iterator-bc33758b.js';
9
9
  import './_to-object-b50e61c3.js';
@@ -12,7 +12,6 @@ import './_is-array-3e99e06e.js';
12
12
  import './_object-pie-133f504a.js';
13
13
  import './_library-528f1934.js';
14
14
  import './core.get-iterator-method-133dfacd.js';
15
- import './index-0dbff1d1.js';
16
15
 
17
16
  var GroupDeck = function GroupDeck(props) {
18
17
  // Props should be an array of objects containing Thumbnail, title, and URL
@@ -35,6 +34,11 @@ var GroupDeck = function GroupDeck(props) {
35
34
  scrollPosition = _useState6[0],
36
35
  setScrollPosition = _useState6[1];
37
36
 
37
+ var urlFor = function urlFor(source, client) {
38
+ var builder = imageUrlBuilder(client);
39
+ return builder.image(source).auto('format');
40
+ };
41
+
38
42
  useEffect(function () {
39
43
  //IE11 Polyfill
40
44
  smoothscroll.polyfill();
@@ -160,7 +164,7 @@ var GroupDeck = function GroupDeck(props) {
160
164
  var thumbnail = void 0;
161
165
 
162
166
  if (video.thumbnail && video.thumbnail.asset) {
163
- thumbnail = urlFor({ source: video.thumbnail, client: props.client });
167
+ thumbnail = urlFor(video.thumbnail, props.client);
164
168
  } else if (_typeof(video.thumbnail == 'string')) {
165
169
  thumbnail = video.thumbnail;
166
170
  } else {
@@ -234,7 +238,7 @@ var GroupDeck = function GroupDeck(props) {
234
238
  var _url = '' + video.link;
235
239
  var _thumbnail = void 0;
236
240
  if (video.thumbnail && video.thumbnail.asset) {
237
- _thumbnail = urlFor({ source: video.thumbnail, client: props.client });
241
+ _thumbnail = urlFor(video.thumbnail, props.client);
238
242
  } else if (_typeof(video.thumbnail == 'string')) {
239
243
  _thumbnail = video.thumbnail;
240
244
  } else {
@@ -156,17 +156,11 @@ var HamMagazine = function HamMagazine(props) {
156
156
  var adSection = document.querySelector('.AD728x90');
157
157
  var navLinks = document.getElementById('nav-links');
158
158
  var mastNav = document.querySelector('.nav-brands');
159
- if (mastNav && mastNav.offsetHeight) setTopOffset(mastNav.offsetHeight - 3);
160
-
161
- if (window.pageYOffset > navOffsetTop) {
162
- if (navRef.current && navRef.current.style) {
163
- navRef.current.style.position = 'fixed';
164
- if (mastNav && mastNav.offsetHeight) navRef.current.style.top = mastNav.offsetHeight;
165
- }
166
- }
167
- var stickyNav = window.addEventListener('scroll', function () {
159
+ var stickNavOnScroll = function stickNavOnScroll() {
168
160
  // Taking into consideration the height of the top navbar while setting the navigation fixed
161
+
169
162
  if (window && topNavRef && topNavRef.current && navRef && navRef.current && window.pageYOffset !== 0 && window.pageYOffset + topNavRef.current.clientHeight + navRef.current.clientHeight > navOffsetTop) {
163
+
170
164
  if (navRef.current && navRef.current.style) {
171
165
  navRef.current.style.position = 'fixed';
172
166
  if (mastNav && mastNav.offsetHeight) navRef.current.style.top = mastNav.offsetHeight;
@@ -183,9 +177,25 @@ var HamMagazine = function HamMagazine(props) {
183
177
  setIsSticky(false);
184
178
  navLinks.style.margin = '0px auto 0px 0px';
185
179
  }
186
- });
180
+ };
181
+ if (mastNav && mastNav.offsetHeight) setTopOffset(mastNav.offsetHeight - 3);
182
+
183
+ if (window.pageYOffset > navOffsetTop) {
184
+ if (navRef.current && navRef.current.style) {
185
+ navRef.current.style.position = 'fixed';
186
+ if (mastNav && mastNav.offsetHeight) navRef.current.style.top = mastNav.offsetHeight;
187
+ }
188
+ }
189
+
190
+ if (props.initiallyCollapsed && !main_43) {
191
+ navRef.current.style.position = 'fixed';
192
+ setIsSticky(true);
193
+ navLinks.style.margin = 'auto';
194
+ if (mastNav && mastNav.offsetHeight) navRef.current.style.top = mastNav.offsetHeight;
195
+ }
196
+ window.addEventListener('scroll', stickNavOnScroll);
187
197
  return function () {
188
- window.removeEventListener('scroll', stickyNav);
198
+ window.removeEventListener('scroll', stickNavOnScroll);
189
199
  };
190
200
  }, []);
191
201
 
package/dist/esm/Hero.js CHANGED
@@ -1,10 +1,21 @@
1
1
  import React from 'react';
2
2
  import { Card } from 'react-bootstrap';
3
- import urlFor from './urlFor.js';
3
+ import { i as imageUrlBuilder } from './index-0dbff1d1.js';
4
4
  import { c as clean_html_1 } from './entities-932b50cf.js';
5
- import './index-0dbff1d1.js';
6
5
  import './_commonjsHelpers-0c4b6f40.js';
7
6
 
7
+ var urlFor = function urlFor(source, client) {
8
+ var builder = imageUrlBuilder(client);
9
+ return builder.image(source).auto('format');
10
+ };
11
+
12
+ var renderCardImage = function renderCardImage(thumbnail, client, imageHeight, imageWidth) {
13
+ var url = urlFor(thumbnail, client);
14
+ if (imageHeight) url = url.height(imageHeight);
15
+ if (imageWidth) url = url.width(imageWidth);
16
+ return url.url();
17
+ };
18
+
8
19
  var Hero = function Hero(_ref) {
9
20
  var data = _ref.data,
10
21
  client = _ref.client,
@@ -26,7 +37,7 @@ var Hero = function Hero(_ref) {
26
37
  { className: 'h4' },
27
38
  title
28
39
  ),
29
- thumbnail && client && React.createElement(Card.Img, { src: urlFor({ source: thumbnail, client: client, imageHeight: imageHeight, imageWidth: imageWidth }), alt: title }),
40
+ thumbnail && client && React.createElement(Card.Img, { src: renderCardImage(thumbnail, client, imageHeight, imageWidth) }),
30
41
  summary && React.createElement(
31
42
  Card.Footer,
32
43
  { className: 'h6' },
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import ArticleCarousel from './ArticleCarousel.js';
4
4
  import { I as IoIosArrowForward } from './index.esm-3fdda599.js';
5
5
  import { B as BlockContent } from './BlockContent-52cf21c5.js';
6
- import { g as getSerializers } from './index-e8c6a892.js';
6
+ import { g as getSerializers } from './index-04c4d8d6.js';
7
7
  import './_commonjsHelpers-0c4b6f40.js';
8
8
  import './_to-object-b50e61c3.js';
9
9
  import './_object-pie-133f504a.js';
@@ -20,7 +20,6 @@ import './index-35bdcc81.js';
20
20
  import 'react-dom';
21
21
  import 'prop-types';
22
22
  import './smoothscroll-fa4e3f8c.js';
23
- import './urlFor.js';
24
23
  import './index-0dbff1d1.js';
25
24
  import './main-b5c5aac1.js';
26
25
  import './iconBase-602d52fe.js';
@@ -1,15 +1,17 @@
1
1
  import React from 'react';
2
2
  import './moment-bc12cb97.js';
3
- import urlFor from './urlFor.js';
3
+ import { i as imageUrlBuilder } from './index-0dbff1d1.js';
4
4
  import { a as FaLongArrowAltRight } from './index.esm-a8ff922c.js';
5
5
  import './_commonjsHelpers-0c4b6f40.js';
6
- import './index-0dbff1d1.js';
7
6
  import './iconBase-602d52fe.js';
8
7
 
9
8
  var HorizontalHero = function HorizontalHero(props) {
10
9
  var client = props.client;
11
10
 
12
-
11
+ var builder = imageUrlBuilder(client);
12
+ function urlFor(source) {
13
+ return builder.image(source).auto('format');
14
+ }
13
15
  var topArticle = props.dataRecord[0];
14
16
  var subArticles = props.dataRecord.slice(1, props.dataRecord.length);
15
17
  var _props$heroTitle = props.heroTitle,
@@ -21,8 +23,7 @@ var HorizontalHero = function HorizontalHero(props) {
21
23
  var topArticleThumbnail = '';
22
24
  var topArticleAltText = topArticle.title;
23
25
  if (topArticle.thumbnail && topArticle.thumbnail.asset) {
24
- topArticleThumbnail = urlFor({ client: client, source: topArticle.thumbnail.asset, imageWidth: 350 });
25
-
26
+ topArticleThumbnail = urlFor(topArticle.thumbnail.asset).width(350).url();
26
27
  topArticleAltText = topArticle.thumbnail.asset.originalFileName;
27
28
  }
28
29
  if (props.thumbnail) {
@@ -4,19 +4,40 @@ import Col from 'react-bootstrap/Col';
4
4
  import Card from 'react-bootstrap/Card';
5
5
  import Badge from 'react-bootstrap/Badge';
6
6
  import { L as LazyLoad } from './index-35bdcc81.js';
7
- import urlFor from './urlFor.js';
7
+ import { i as imageUrlBuilder } from './index-0dbff1d1.js';
8
8
  import { m as moment } from './moment-bc12cb97.js';
9
9
  import { A as AuthorComponent } from './AuthorComponent-5ae7409f.js';
10
10
  import './_commonjsHelpers-0c4b6f40.js';
11
11
  import 'react-dom';
12
12
  import 'prop-types';
13
- import './index-0dbff1d1.js';
14
13
  import './slicedToArray-be2f7a22.js';
15
14
  import './web.dom.iterable-4109ff68.js';
16
15
  import './es6.string.iterator-bc33758b.js';
17
16
  import './_to-object-b50e61c3.js';
18
17
  import './core.get-iterator-method-133dfacd.js';
19
18
 
19
+ var urlFor = function urlFor(source, client) {
20
+ var builder = imageUrlBuilder(client);
21
+ return builder.image(source).auto('format');
22
+ };
23
+
24
+ var renderCardImage = function renderCardImage(props) {
25
+ var coverImage = props.coverImage,
26
+ imageHeight = props.imageHeight,
27
+ imageWidth = props.imageWidth,
28
+ client = props.client,
29
+ Settings = props.Settings;
30
+
31
+ if (coverImage && coverImage.asset) {
32
+ var url = urlFor(coverImage, client);
33
+ if (imageHeight) url = url.height(imageHeight);
34
+ if (imageWidth) url = url.width(imageWidth);
35
+ return url.url();
36
+ } else {
37
+ return Settings.logo;
38
+ }
39
+ };
40
+
20
41
  var PublicationDeckStack = function PublicationDeckStack(props) {
21
42
  var title = props.title,
22
43
  coverImage = props.coverImage,
@@ -25,12 +46,8 @@ var PublicationDeckStack = function PublicationDeckStack(props) {
25
46
  author = props.author,
26
47
  summary = props.summary,
27
48
  section = props.section,
28
- _props$imageHeight = props.imageHeight,
29
- imageHeight = _props$imageHeight === undefined ? null : _props$imageHeight,
30
- _props$imageWidth = props.imageWidth,
31
- imageWidth = _props$imageWidth === undefined ? null : _props$imageWidth,
32
- _props$imageFit = props.imageFit,
33
- imageFit = _props$imageFit === undefined ? null : _props$imageFit,
49
+ imageHeight = props.imageHeight,
50
+ imageWidth = props.imageWidth,
34
51
  client = props.client,
35
52
  Settings = props.Settings,
36
53
  index = props.index,
@@ -56,7 +73,7 @@ var PublicationDeckStack = function PublicationDeckStack(props) {
56
73
  { height: imageHeight },
57
74
  React.createElement(Card.Img, {
58
75
  variant: 'right',
59
- src: coverImage ? urlFor({ source: coverImage, imageHeight: imageHeight, imageWidth: imageWidth, imageFit: imageFit, client: client }) : Settings.logo,
76
+ src: renderCardImage({ coverImage: coverImage, imageHeight: imageHeight, imageWidth: imageWidth, client: client, Settings: Settings }),
60
77
  alt: title,
61
78
  style: { width: '170px', height: 'auto', objectFit: 'contain', padding: '0.25rem', float: 'left' }
62
79
  })
@@ -147,7 +164,7 @@ var PublicationDeckBlock = function PublicationDeckBlock(props) {
147
164
  coverImage && React.createElement(
148
165
  LazyLoad,
149
166
  { height: imageHeight },
150
- React.createElement(Card.Img, { variant: 'top', src: coverImage ? urlFor({ source: coverImage, imageHeight: imageHeight, imageWidth: imageWidth, imageFit: imageFit, client: client, Settings: Settings }) : Settings.logo, alt: title })
167
+ React.createElement(Card.Img, { variant: 'top', src: renderCardImage({ coverImage: coverImage, imageHeight: imageHeight, imageWidth: imageWidth, client: client, Settings: Settings }), alt: title })
151
168
  ),
152
169
  React.createElement(
153
170
  Card.Body,
@@ -7,7 +7,7 @@ import Col from 'react-bootstrap/Col';
7
7
  import Button from 'react-bootstrap/Button';
8
8
  import Card from 'react-bootstrap/Card';
9
9
  import { L as LazyLoad } from './index-35bdcc81.js';
10
- import urlFor from './urlFor.js';
10
+ import { i as imageUrlBuilder } from './index-0dbff1d1.js';
11
11
  import { I as InfiniteScroll } from './index.es-c6222053.js';
12
12
  import './_commonjsHelpers-0c4b6f40.js';
13
13
  import './es6.string.iterator-bc33758b.js';
@@ -18,7 +18,6 @@ import './_object-pie-133f504a.js';
18
18
  import './web.dom.iterable-4109ff68.js';
19
19
  import 'react-dom';
20
20
  import 'prop-types';
21
- import './index-0dbff1d1.js';
22
21
 
23
22
  var usePrevious = function usePrevious(value) {
24
23
  var ref = useRef();
@@ -31,12 +30,8 @@ var usePrevious = function usePrevious(value) {
31
30
  var IssueDeck = function IssueDeck(props) {
32
31
  var data = props.data,
33
32
  href = props.href,
34
- _props$imageHeight = props.imageHeight,
35
- imageHeight = _props$imageHeight === undefined ? null : _props$imageHeight,
36
- _props$imageWidth = props.imageWidth,
37
- imageWidth = _props$imageWidth === undefined ? null : _props$imageWidth,
38
- _props$imageFit = props.imageFit,
39
- imageFit = _props$imageFit === undefined ? null : _props$imageFit,
33
+ imageHeight = props.imageHeight,
34
+ imageWidth = props.imageWidth,
40
35
  Website = props.Website,
41
36
  client = props.client,
42
37
  publication = props.publication,
@@ -68,10 +63,17 @@ var IssueDeck = function IssueDeck(props) {
68
63
 
69
64
  var prevValues = usePrevious(values);
70
65
 
66
+ var urlFor = function urlFor(source) {
67
+ var builder = imageUrlBuilder(client);
68
+ return builder.image(source).auto('format');
69
+ };
70
+
71
71
  var renderCardImage = function renderCardImage(thumbnail) {
72
72
  if (thumbnail && thumbnail.asset) {
73
- var url = urlFor({ client: client, source: thumbnail, imageHeight: imageHeight, imageWidth: imageWidth, imageFit: imageFit });
74
- return url;
73
+ var url = urlFor(thumbnail);
74
+ if (imageHeight) url = url.height(imageHeight);
75
+ if (imageWidth) url = url.width(imageWidth);
76
+ return url.url();
75
77
  } else {
76
78
  return Website.logo;
77
79
  }