@mjhls/mjh-framework 1.0.331 → 1.0.333

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 (62) hide show
  1. package/README.md +171 -171
  2. package/dist/cjs/{ADInfeed-d58f7a88.js → ADInfeed-b042a194.js} +1 -1
  3. package/dist/cjs/{AdSlot-c8f07bcf.js → AdSlot-c5bff604.js} +3 -3
  4. package/dist/cjs/DeckContent.js +18 -18
  5. package/dist/cjs/DeckQueue.js +8 -8
  6. package/dist/cjs/{Dfp-fc16f64b.js → Dfp-9ede68c7.js} +2 -2
  7. package/dist/cjs/{Figure-6805ef02.js → Figure-a47ec3a7.js} +1 -1
  8. package/dist/cjs/{GridContent-70d80f27.js → GridContent-9f212ec5.js} +12 -12
  9. package/dist/cjs/GridContent.js +11 -11
  10. package/dist/cjs/GroupDeck.js +4 -4
  11. package/dist/cjs/IssueContentDeck.js +1 -1
  12. package/dist/cjs/IssueDeck.js +1 -1
  13. package/dist/cjs/MasterDeck.js +16 -16
  14. package/dist/cjs/{Normal-cc2f9b2f.js → Normal-c85aee96.js} +39 -39
  15. package/dist/cjs/PublicationDeck.js +1 -1
  16. package/dist/cjs/QueueDeckExpanded.js +11 -11
  17. package/dist/cjs/{TaxonomyCard-0b6bc8db.js → TaxonomyCard-e36602e8.js} +1 -1
  18. package/dist/cjs/TaxonomyCard.js +2 -2
  19. package/dist/cjs/TemplateNormal.js +6 -6
  20. package/dist/cjs/ThumbnailCard.js +1 -1
  21. package/dist/cjs/VideoSeriesListing.js +3 -3
  22. package/dist/cjs/YoutubeGroup.js +4 -4
  23. package/dist/cjs/{debounce-ba3eaee2.js → debounce-528ad412.js} +4 -6
  24. package/dist/cjs/{get-de2660c3.js → get-3b23d857.js} +1 -1
  25. package/dist/cjs/{index-be0c82be.js → index-b5eb3ff8.js} +20 -19
  26. package/dist/cjs/index.js +1213 -828
  27. package/dist/cjs/{inherits-d1613ef1.js → inherits-7548e3e8.js} +1 -1
  28. package/dist/cjs/{main-6a82a5d2.js → main-987c23c6.js} +66 -35
  29. package/dist/cjs/{promise-60431c75.js → promise-3b44b2a3.js} +2 -2
  30. package/dist/cjs/{toConsumableArray-82ec1016.js → toConsumableArray-34b5e9a7.js} +1 -1
  31. package/dist/cjs/{visibility-sensor-b72d9527.js → visibility-sensor-c2ccc22d.js} +4 -2
  32. package/dist/esm/{ADInfeed-c42432d8.js → ADInfeed-aadcfc25.js} +1 -1
  33. package/dist/esm/{AdSlot-4a85e252.js → AdSlot-8946358f.js} +3 -3
  34. package/dist/esm/DeckContent.js +18 -18
  35. package/dist/esm/DeckQueue.js +8 -8
  36. package/dist/esm/{Dfp-1cde9792.js → Dfp-9293acfb.js} +2 -2
  37. package/dist/esm/{Figure-ddfa279d.js → Figure-584ac0c8.js} +1 -1
  38. package/dist/esm/{GridContent-55e6512a.js → GridContent-13be42a1.js} +12 -12
  39. package/dist/esm/GridContent.js +11 -11
  40. package/dist/esm/GroupDeck.js +4 -4
  41. package/dist/esm/IssueContentDeck.js +1 -1
  42. package/dist/esm/IssueDeck.js +1 -1
  43. package/dist/esm/MasterDeck.js +16 -16
  44. package/dist/esm/{Normal-63478e2d.js → Normal-cbddc3c0.js} +39 -39
  45. package/dist/esm/PublicationDeck.js +1 -1
  46. package/dist/esm/QueueDeckExpanded.js +11 -11
  47. package/dist/esm/{TaxonomyCard-c036f1c3.js → TaxonomyCard-89325080.js} +1 -1
  48. package/dist/esm/TaxonomyCard.js +2 -2
  49. package/dist/esm/TemplateNormal.js +6 -6
  50. package/dist/esm/ThumbnailCard.js +1 -1
  51. package/dist/esm/VideoSeriesListing.js +3 -3
  52. package/dist/esm/YoutubeGroup.js +4 -4
  53. package/dist/esm/{debounce-93ab8f80.js → debounce-702eb224.js} +4 -6
  54. package/dist/esm/{get-9c285a85.js → get-36d03764.js} +1 -1
  55. package/dist/esm/{index-73819142.js → index-51a80699.js} +20 -19
  56. package/dist/esm/index.js +1216 -831
  57. package/dist/esm/{inherits-424c89e9.js → inherits-4b85034c.js} +1 -1
  58. package/dist/esm/{main-9ae8991d.js → main-cb86f95d.js} +65 -34
  59. package/dist/esm/{promise-e4a5eb9f.js → promise-86cb8313.js} +2 -2
  60. package/dist/esm/{toConsumableArray-ec38f5fe.js → toConsumableArray-2718dc16.js} +1 -1
  61. package/dist/esm/{visibility-sensor-336093e1.js → visibility-sensor-3cea5efb.js} +4 -2
  62. package/package.json +104 -104
@@ -1,12 +1,12 @@
1
- import { m as main_36, c as main_37 } from './main-9ae8991d.js';
1
+ import { m as main_39, c as main_40 } from './main-cb86f95d.js';
2
2
  import React__default, { useState, useEffect, useRef } from 'react';
3
3
  import Container from 'react-bootstrap/Container';
4
4
  import Row from 'react-bootstrap/Row';
5
5
  import Col from 'react-bootstrap/Col';
6
6
  import 'next/link';
7
7
  import { _ as _slicedToArray } from './slicedToArray-a47a84a4.js';
8
- import { D as DFPAdSlot } from './AdSlot-4a85e252.js';
9
- import { g as get_1 } from './get-9c285a85.js';
8
+ import { D as DFPAdSlot } from './AdSlot-8946358f.js';
9
+ import { g as get_1 } from './get-36d03764.js';
10
10
  import { r as reactSocialIcons_1 } from './react-social-icons-a7d5c5c7.js';
11
11
  import { Dropdown } from 'react-bootstrap';
12
12
  import { G as GenIcon, b as IoMdLogIn, c as IoIosHome } from './index.esm-536609db.js';
@@ -60,8 +60,8 @@ var renderLink = function renderLink(row) {
60
60
  };
61
61
 
62
62
  var SideFooter = function SideFooter(props) {
63
- /*
64
- useage example: <SideFooter cache={props.cache} logo='https://mjh-web.s3.amazonaws.com/_media/an_mjhls_brand_logo.png' />
63
+ /*
64
+ useage example: <SideFooter cache={props.cache} logo='https://mjh-web.s3.amazonaws.com/_media/an_mjhls_brand_logo.png' />
65
65
  */
66
66
  var _get = get_1(props, 'cache.siteSettingCache', {}),
67
67
  socialLinks = _get.socialLinks,
@@ -339,7 +339,7 @@ var Column3 = function Column3(props) {
339
339
  var adRef = useRef(null);
340
340
 
341
341
  useEffect(function () {
342
- if (!main_36 && window.innerWidth >= 768) {
342
+ if (!main_39 && window.innerWidth >= 768) {
343
343
  var navbar = document.querySelector('.navbar');
344
344
  var AdOffsetTop = adRef.current.getBoundingClientRect().top;
345
345
  window.addEventListener('scroll', function () {
@@ -398,7 +398,7 @@ var Column3 = function Column3(props) {
398
398
  { jsx: 'true' },
399
399
  '\n .filter-box {\n float: right;\n padding-top: 6px;\n padding-right: 18px;\n }\n @media only screen and (min-width: 768px) {\n .title-wrap {\n display: flex;\n justify-content: space-between;\n }\n }\n @media only screen and (max-width: 767px) {\n /* .filter-box {\n float: right;\n display: flex;\n justify-content: flex-end;\n } */\n .title-wrap {\n display: flex;\n flex-direction: column;\n margin-bottom: 10px;\n }\n }\n '
400
400
  ),
401
- (!main_36 || showRightAd) && React__default.createElement(
401
+ (!main_39 || showRightAd) && React__default.createElement(
402
402
  Col,
403
403
  { xs: 12, className: 'rightCol' },
404
404
  website && website.conferenceBannerContent && React__default.createElement(ConferenceBanner, { website: website }),
@@ -634,16 +634,16 @@ var SocialNavFooter = function SocialNavFooter(props) {
634
634
  };
635
635
 
636
636
  var NavMagazine = function NavMagazine(props) {
637
- /*
638
- Example Nav with acceptable props
639
- <MagazineNav
640
- showLogin
641
- user={props.cache.user}
642
- logo={props.settings.logo}
643
- dataObject={props.cache.mainNavCache}
644
- website={website}
645
- subNav={props.cache.subNavCache}
646
- />
637
+ /*
638
+ Example Nav with acceptable props
639
+ <MagazineNav
640
+ showLogin
641
+ user={props.cache.user}
642
+ logo={props.settings.logo}
643
+ dataObject={props.cache.mainNavCache}
644
+ website={website}
645
+ subNav={props.cache.subNavCache}
646
+ />
647
647
  */
648
648
 
649
649
  var logo = props.logo,
@@ -842,7 +842,7 @@ var NavMagazine = function NavMagazine(props) {
842
842
  ),
843
843
  React__default.createElement(
844
844
  Navbar,
845
- { id: 'navbar-ham', className: main_37 ? 'bottom-nav ios-nav' : 'bottom-nav ', variant: 'dark', expand: 'xl', bg: 'primary', sticky: 'top', ref: navRef },
845
+ { id: 'navbar-ham', className: main_40 ? 'bottom-nav ios-nav' : 'bottom-nav ', variant: 'dark', expand: 'xl', bg: 'primary', sticky: 'top', ref: navRef },
846
846
  React__default.createElement(
847
847
  Container,
848
848
  { className: 'mobile-nav android-nav' },
@@ -976,15 +976,15 @@ var NavMagazine = function NavMagazine(props) {
976
976
  var MagazineNav = React__default.memo(NavMagazine);
977
977
 
978
978
  var NavNative = function NavNative(props) {
979
- /*
980
- Example Nav with acceptable props
981
- <MagazineNav
982
- showLogin
983
- logo={props.settings.logo}
984
- dataObject={props.cache.mainNavCache}
985
- website={website}
986
- subNav={props.cache.subNavCache}
987
- />
979
+ /*
980
+ Example Nav with acceptable props
981
+ <MagazineNav
982
+ showLogin
983
+ logo={props.settings.logo}
984
+ dataObject={props.cache.mainNavCache}
985
+ website={website}
986
+ subNav={props.cache.subNavCache}
987
+ />
988
988
  */
989
989
 
990
990
  var logo = props.logo,
@@ -1037,7 +1037,7 @@ var NavNative = function NavNative(props) {
1037
1037
  React__default.createElement(
1038
1038
  Navbar,
1039
1039
  {
1040
- className: main_37 ? 'bottom-nav ios-nav' : 'bottom-nav android-nav',
1040
+ className: main_40 ? 'bottom-nav ios-nav' : 'bottom-nav android-nav',
1041
1041
  variant: 'dark',
1042
1042
  expand: 'lg',
1043
1043
  bg: 'primary',
@@ -1378,15 +1378,15 @@ var NavDvm = function NavDvm(props) {
1378
1378
  };
1379
1379
 
1380
1380
  var HamMagazine = function HamMagazine(props) {
1381
- /*
1382
- Example Nav with acceptable props
1383
- <MagazineNav
1384
- showLogin
1385
- logo={props.settings.logo}
1386
- dataObject={props.cache.mainNavCache}
1387
- website={website}
1388
- subNav={props.cache.subNavCache}
1389
- />
1381
+ /*
1382
+ Example Nav with acceptable props
1383
+ <MagazineNav
1384
+ showLogin
1385
+ logo={props.settings.logo}
1386
+ dataObject={props.cache.mainNavCache}
1387
+ website={website}
1388
+ subNav={props.cache.subNavCache}
1389
+ />
1390
1390
  */
1391
1391
 
1392
1392
  var logo = props.logo,
@@ -1538,7 +1538,7 @@ var HamMagazine = function HamMagazine(props) {
1538
1538
 
1539
1539
  return React__default.createElement(
1540
1540
  'header',
1541
- { className: !main_36 && isOpen ? 'nav-open' : 'nav-close', style: { zIndex: '99999' } },
1541
+ { className: !main_39 && isOpen ? 'nav-open' : 'nav-close', style: { zIndex: '99999' } },
1542
1542
  React__default.createElement(
1543
1543
  Navbar,
1544
1544
  { expand: 'md', ref: topNavRef },
@@ -1779,7 +1779,7 @@ var AD728x90 = function AD728x90(_ref) {
1779
1779
 
1780
1780
 
1781
1781
  var mobileView = false;
1782
- if (main_36) {
1782
+ if (main_39) {
1783
1783
  pos = 'top-mobile';
1784
1784
  mobileView = true;
1785
1785
  }
@@ -6,7 +6,7 @@ import Col from 'react-bootstrap/Col';
6
6
  import Card from 'react-bootstrap/Card';
7
7
  import 'next/link';
8
8
  import 'react-dom';
9
- import { i as imageUrlBuilder } from './index-73819142.js';
9
+ import { i as imageUrlBuilder } from './index-51a80699.js';
10
10
  import { L as LazyLoad } from './index-5f9f807a.js';
11
11
  import Button from 'react-bootstrap/Button';
12
12
 
@@ -1,24 +1,24 @@
1
1
  import './_commonjsHelpers-0c4b6f40.js';
2
2
  import './_to-object-b9b796ec.js';
3
3
  import './web.dom.iterable-7e9bebf9.js';
4
- import { l as lib_3 } from './debounce-93ab8f80.js';
5
- import { m as main_36 } from './main-9ae8991d.js';
6
- import { _ as _toConsumableArray } from './toConsumableArray-ec38f5fe.js';
4
+ import { l as lib_3 } from './debounce-702eb224.js';
5
+ import { m as main_39 } from './main-cb86f95d.js';
6
+ import { _ as _toConsumableArray } from './toConsumableArray-2718dc16.js';
7
7
  import { _ as _extends } from './extends-26d3b609.js';
8
8
  import React__default, { useState, useEffect, useRef } from 'react';
9
9
  import 'prop-types';
10
10
  import 'react-bootstrap/Card';
11
- import { I as InfiniteScroll, V as VisibilitySensor, m as moment } from './visibility-sensor-336093e1.js';
11
+ import { I as InfiniteScroll, V as VisibilitySensor, m as moment } from './visibility-sensor-3cea5efb.js';
12
12
  import 'next/link';
13
13
  import { useRouter } from 'next/router';
14
14
  import 'react-dom';
15
- import { i as imageUrlBuilder } from './index-73819142.js';
15
+ import { i as imageUrlBuilder } from './index-51a80699.js';
16
16
  import { L as LazyLoad } from './index-5f9f807a.js';
17
17
  import { c as clean_html_1 } from './entities-7cc3bf45.js';
18
18
  import { _ as _slicedToArray } from './slicedToArray-a47a84a4.js';
19
- import './AdSlot-4a85e252.js';
20
- import './promise-e4a5eb9f.js';
21
- import { A as ADInfeed } from './ADInfeed-c42432d8.js';
19
+ import './AdSlot-8946358f.js';
20
+ import './promise-86cb8313.js';
21
+ import { A as ADInfeed } from './ADInfeed-aadcfc25.js';
22
22
  import { Container, Media } from 'react-bootstrap';
23
23
 
24
24
  var urlFor = function urlFor(source, builder) {
@@ -278,7 +278,7 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
278
278
  )
279
279
  )
280
280
  ),
281
- main_36 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index, numberOfItemsBeforeAd, rightItems)
281
+ main_39 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index, numberOfItemsBeforeAd, rightItems)
282
282
  );
283
283
  } else {
284
284
  return React__default.createElement(
@@ -352,7 +352,7 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
352
352
  )
353
353
  )
354
354
  ),
355
- main_36 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index, numberOfItemsBeforeAd, rightItems)
355
+ main_39 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index, numberOfItemsBeforeAd, rightItems)
356
356
  );
357
357
  }
358
358
  } else if (article._type === 'brandInsightAd' && article.adUnit) {
@@ -428,7 +428,7 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
428
428
  )
429
429
  )
430
430
  ),
431
- main_36 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index, numberOfItemsBeforeAd, rightItems)
431
+ main_39 && rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index, numberOfItemsBeforeAd, rightItems)
432
432
  );
433
433
  }) : React__default.createElement(
434
434
  'div',
@@ -5,7 +5,7 @@ import Container from 'react-bootstrap/Container';
5
5
  import Row from 'react-bootstrap/Row';
6
6
  import Col from 'react-bootstrap/Col';
7
7
  import Card from 'react-bootstrap/Card';
8
- import { n as node, i as imageUrlBuilder } from './index-73819142.js';
8
+ import { n as node, i as imageUrlBuilder } from './index-51a80699.js';
9
9
  import { L as LazyLoad } from './index-5f9f807a.js';
10
10
  import { r as reactSocialIcons_1 } from './react-social-icons-a7d5c5c7.js';
11
11
 
@@ -8,7 +8,7 @@ import 'react-bootstrap/Row';
8
8
  import 'react-bootstrap/Col';
9
9
  import 'react-bootstrap/Card';
10
10
  import 'react-dom';
11
- import './index-73819142.js';
11
+ import './index-51a80699.js';
12
12
  import './index-5f9f807a.js';
13
- export { T as default } from './TaxonomyCard-c036f1c3.js';
13
+ export { T as default } from './TaxonomyCard-89325080.js';
14
14
  import './react-social-icons-a7d5c5c7.js';
@@ -1,8 +1,8 @@
1
1
  import './_commonjsHelpers-0c4b6f40.js';
2
2
  import './_to-object-b9b796ec.js';
3
3
  import './web.dom.iterable-7e9bebf9.js';
4
- import './debounce-93ab8f80.js';
5
- import './main-9ae8991d.js';
4
+ import './debounce-702eb224.js';
5
+ import './main-cb86f95d.js';
6
6
  import 'react';
7
7
  import 'prop-types';
8
8
  import 'react-bootstrap/Container';
@@ -10,14 +10,14 @@ import 'react-bootstrap/Row';
10
10
  import 'react-bootstrap/Col';
11
11
  import 'next/link';
12
12
  import './slicedToArray-a47a84a4.js';
13
- import './AdSlot-4a85e252.js';
14
- import './promise-e4a5eb9f.js';
15
- import './get-9c285a85.js';
13
+ import './AdSlot-8946358f.js';
14
+ import './promise-86cb8313.js';
15
+ import './get-36d03764.js';
16
16
  import './react-social-icons-a7d5c5c7.js';
17
17
  import 'react-bootstrap';
18
18
  import './index.esm-536609db.js';
19
19
  import 'react-bootstrap/Button';
20
- export { T as default } from './Normal-63478e2d.js';
20
+ export { T as default } from './Normal-cbddc3c0.js';
21
21
  import 'react-bootstrap/ListGroup';
22
22
  import 'next/head';
23
23
  import 'react-bootstrap/Nav';
@@ -2,7 +2,7 @@ import './_commonjsHelpers-0c4b6f40.js';
2
2
  import React__default from 'react';
3
3
  import 'prop-types';
4
4
  import 'react-dom';
5
- import { i as imageUrlBuilder } from './index-73819142.js';
5
+ import { i as imageUrlBuilder } from './index-51a80699.js';
6
6
  import { L as LazyLoad } from './index-5f9f807a.js';
7
7
  import { c as clean_html_1 } from './entities-7cc3bf45.js';
8
8
  import Media$1 from 'react-bootstrap/Media';
@@ -1,13 +1,13 @@
1
1
  import './_commonjsHelpers-0c4b6f40.js';
2
2
  import './_to-object-b9b796ec.js';
3
3
  import './web.dom.iterable-7e9bebf9.js';
4
- import { d as debounce_1, l as lib_3 } from './debounce-93ab8f80.js';
4
+ import { d as debounce_1, l as lib_3 } from './debounce-702eb224.js';
5
5
  import { _ as _extends } from './extends-26d3b609.js';
6
- import { a as _inherits, b as _classCallCheck, c as _possibleConstructorReturn, d as _Object$getPrototypeOf, e as _createClass } from './inherits-424c89e9.js';
6
+ import { a as _inherits, b as _classCallCheck, c as _possibleConstructorReturn, d as _Object$getPrototypeOf, e as _createClass } from './inherits-4b85034c.js';
7
7
  import React__default from 'react';
8
8
  import 'prop-types';
9
9
  import Container from 'react-bootstrap/Container';
10
- import { I as InfiniteScroll, V as VisibilitySensor } from './visibility-sensor-336093e1.js';
10
+ import { I as InfiniteScroll, V as VisibilitySensor } from './visibility-sensor-3cea5efb.js';
11
11
  import 'next/link';
12
12
  import { withRouter } from 'next/router';
13
13
  import 'react-dom';
@@ -9,10 +9,10 @@ import { L as LazyLoad } from './index-5f9f807a.js';
9
9
  import { _ as _slicedToArray } from './slicedToArray-a47a84a4.js';
10
10
  import { s as smoothscroll, g as getYoutubeId } from './smoothscroll-4b699764.js';
11
11
 
12
- /*
13
- GROQ query -
14
- accepts an array of title, URL
15
- `https://img.youtube.com/vi/${getYouTubeId(vid.url)}/hqdefault.jpg`
12
+ /*
13
+ GROQ query -
14
+ accepts an array of title, URL
15
+ `https://img.youtube.com/vi/${getYouTubeId(vid.url)}/hqdefault.jpg`
16
16
  */
17
17
 
18
18
  var YoutubeGroup = function YoutubeGroup(props) {
@@ -823,15 +823,13 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
823
823
  });
824
824
 
825
825
  if (_this5.lazyLoadIsEnabled()) {
826
- var args = [];
827
-
828
826
  var config = _this5.getLazyLoadConfig();
829
827
 
830
- if (config !== null) {
831
- args.push(config);
828
+ if (config) {
829
+ pubadsService.enableLazyLoad(config);
830
+ } else {
831
+ pubadsService.enableLazyLoad();
832
832
  }
833
-
834
- pubadsService.enableLazyLoad.call(args);
835
833
  }
836
834
 
837
835
  if (_this5.singleRequestIsEnabled()) {
@@ -1,4 +1,4 @@
1
- import { g as isSymbol_1, h as isObject_1, _ as _baseGetTag, b as _root, j as _Symbol } from './debounce-93ab8f80.js';
1
+ import { g as isSymbol_1, h as isObject_1, _ as _baseGetTag, b as _root, j as _Symbol } from './debounce-702eb224.js';
2
2
 
3
3
  /**
4
4
  * Checks if `value` is classified as an `Array` object.
@@ -58,35 +58,35 @@ function parseSource(source) {
58
58
  if (typeof source === 'string' && isUrl(source)) {
59
59
  // Someone passed an existing image url?
60
60
  image = {
61
- asset: { _ref: urlToId(source) }
61
+ asset: { _ref: urlToId(source) },
62
62
  };
63
63
  }
64
64
  else if (typeof source === 'string') {
65
65
  // Just an asset id
66
66
  image = {
67
- asset: { _ref: source }
67
+ asset: { _ref: source },
68
68
  };
69
69
  }
70
70
  else if (isRef(source)) {
71
71
  // We just got passed an asset directly
72
72
  image = {
73
- asset: source
73
+ asset: source,
74
74
  };
75
75
  }
76
76
  else if (isAsset(source)) {
77
77
  // If we were passed an image asset document
78
78
  image = {
79
79
  asset: {
80
- _ref: source._id || ''
81
- }
80
+ _ref: source._id || '',
81
+ },
82
82
  };
83
83
  }
84
84
  else if (isAssetStub(source)) {
85
85
  // If we were passed a partial asset (`url`, but no `_id`)
86
86
  image = {
87
87
  asset: {
88
- _ref: urlToId(source.asset.url)
89
- }
88
+ _ref: urlToId(source.asset.url),
89
+ },
90
90
  };
91
91
  }
92
92
  else if (typeof source.asset === 'object') {
@@ -127,7 +127,7 @@ function applyDefaults(image) {
127
127
  left: 0,
128
128
  top: 0,
129
129
  bottom: 0,
130
- right: 0
130
+ right: 0,
131
131
  };
132
132
  }
133
133
  if (!result.hotspot) {
@@ -135,7 +135,7 @@ function applyDefaults(image) {
135
135
  x: 0.5,
136
136
  y: 0.5,
137
137
  height: 1.0,
138
- width: 1.0
138
+ width: 1.0,
139
139
  };
140
140
  }
141
141
  return result;
@@ -182,7 +182,7 @@ exports.SPEC_NAME_TO_URL_NAME_MAPPINGS = [
182
182
  ['crop', 'crop'],
183
183
  ['saturation', 'sat'],
184
184
  ['auto', 'auto'],
185
- ['dpr', 'dpr']
185
+ ['dpr', 'dpr'],
186
186
  ];
187
187
  function urlForImage(options) {
188
188
  var spec = __assign({}, (options || {}));
@@ -201,7 +201,7 @@ function urlForImage(options) {
201
201
  left: cropLeft,
202
202
  top: cropTop,
203
203
  width: Math.round(asset.width - image.crop.right * asset.width - cropLeft),
204
- height: Math.round(asset.height - image.crop.bottom * asset.height - cropTop)
204
+ height: Math.round(asset.height - image.crop.bottom * asset.height - cropTop),
205
205
  };
206
206
  // Compute hot spot rect in terms of pixel coordinates
207
207
  var hotSpotVerticalRadius = (image.hotspot.height * asset.height) / 2;
@@ -212,7 +212,7 @@ function urlForImage(options) {
212
212
  left: hotSpotCenterX - hotSpotHorizontalRadius,
213
213
  top: hotSpotCenterY - hotSpotVerticalRadius,
214
214
  right: hotSpotCenterX + hotSpotHorizontalRadius,
215
- bottom: hotSpotCenterY + hotSpotVerticalRadius
215
+ bottom: hotSpotCenterY + hotSpotVerticalRadius,
216
216
  };
217
217
  // If irrelevant, or if we are requested to: don't perform crop/fit based on
218
218
  // the crop/hotspot.
@@ -294,7 +294,7 @@ function fit(source, spec) {
294
294
  left: Math.round(left),
295
295
  top: Math.round(top_2),
296
296
  width: Math.round(width),
297
- height: Math.round(height)
297
+ height: Math.round(height),
298
298
  };
299
299
  }
300
300
  else {
@@ -316,13 +316,13 @@ function fit(source, spec) {
316
316
  left: Math.max(0, Math.floor(left)),
317
317
  top: Math.max(0, Math.floor(top_3)),
318
318
  width: Math.round(width),
319
- height: Math.round(height)
319
+ height: Math.round(height),
320
320
  };
321
321
  }
322
322
  return {
323
323
  width: imgWidth,
324
324
  height: imgHeight,
325
- rect: cropRect
325
+ rect: cropRect,
326
326
  };
327
327
  }
328
328
 
@@ -375,11 +375,12 @@ function urlBuilder(options) {
375
375
  var client = options;
376
376
  if (isSanityClient(client)) {
377
377
  // Inherit config from client
378
- var _a = client.clientConfig, apiHost = _a.apiHost, projectId = _a.projectId, dataset = _a.dataset;
378
+ var _a = client.clientConfig, apiUrl = _a.apiHost, projectId = _a.projectId, dataset = _a.dataset;
379
+ var apiHost = apiUrl || 'https://api.sanity.io';
379
380
  return new ImageUrlBuilder(null, {
380
381
  baseUrl: apiHost.replace(/^https:\/\/api\./, 'https://cdn.'),
381
382
  projectId: projectId,
382
- dataset: dataset
383
+ dataset: dataset,
383
384
  });
384
385
  }
385
386
  // Or just accept the options as given
@@ -392,7 +393,7 @@ var ImageUrlBuilder = /** @class */ (function () {
392
393
  ? __assign(__assign({}, (parent.options || {})), (options || {})) : __assign({}, (options || {})); // Copy options
393
394
  }
394
395
  ImageUrlBuilder.prototype.withOptions = function (options) {
395
- var baseUrl = options.baseUrl || '';
396
+ var baseUrl = options.baseUrl || this.options.baseUrl;
396
397
  var newOptions = { baseUrl: baseUrl };
397
398
  for (var key in options) {
398
399
  if (options.hasOwnProperty(key)) {
@@ -520,7 +521,7 @@ var ImageUrlBuilder = /** @class */ (function () {
520
521
  ImageUrlBuilder.prototype.url = function () {
521
522
  return urlForImage_1$1.default(this.options);
522
523
  };
523
- // Synonym for url()
524
+ // Alias for url()
524
525
  ImageUrlBuilder.prototype.toString = function () {
525
526
  return this.url();
526
527
  };