@mjhls/mjh-framework 1.0.170 → 1.0.172

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.170
2
+ # mjh-framework v. 1.0.172
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';
@@ -7177,7 +7177,7 @@ var InfiniteScroll = /** @class */ (function (_super) {
7177
7177
 
7178
7178
  var visibilitySensor = createCommonjsModule(function (module, exports) {
7179
7179
  (function webpackUniversalModuleDefinition(root, factory) {
7180
- module.exports = factory(React__default, require$$1);
7180
+ module.exports = factory(React__default, reactDom);
7181
7181
  })(commonjsGlobal, function(__WEBPACK_EXTERNAL_MODULE__1__, __WEBPACK_EXTERNAL_MODULE__2__) {
7182
7182
  return /******/ (function(modules) { // webpackBootstrap
7183
7183
  /******/ // The module cache
@@ -8477,7 +8477,7 @@ var _react2 = _interopRequireDefault(React__default);
8477
8477
 
8478
8478
 
8479
8479
 
8480
- var _reactDom2 = _interopRequireDefault(require$$1);
8480
+ var _reactDom2 = _interopRequireDefault(reactDom);
8481
8481
 
8482
8482
 
8483
8483
 
@@ -14042,55 +14042,68 @@ var IssueDeck = function IssueDeck(props) {
14042
14042
  Col,
14043
14043
  { md: 12, lg: 12, key: index },
14044
14044
  React__default.createElement(
14045
- Link,
14046
- { href: href + '/' + publication + '/' + row.identifier.current },
14045
+ Card,
14046
+ { className: 'queue-card journal-queue', style: { borderTop: '1px solid #EEE' } },
14047
14047
  React__default.createElement(
14048
- 'a',
14049
- null,
14048
+ Row,
14049
+ { style: { flexDirection: 'left' } },
14050
14050
  React__default.createElement(
14051
- Card,
14052
- { className: 'queue-card journal-queue', style: { borderTop: '1px solid #EEE' } },
14051
+ Link,
14052
+ { href: href + '/' + publication + '/' + row.identifier.current },
14053
14053
  React__default.createElement(
14054
- Row,
14055
- { style: { flexDirection: 'left' } },
14054
+ 'a',
14055
+ null,
14056
14056
  React__default.createElement(
14057
14057
  Col,
14058
- { md: 12, lg: 4 },
14058
+ { md: 12, lg: 4, className: 'body-image' },
14059
14059
  row.thumbnail && React__default.createElement(
14060
14060
  LazyLoad,
14061
14061
  { height: imageHeight },
14062
14062
  React__default.createElement(Card.Img, { variant: 'top', src: renderCardImage(row.thumbnail), alt: row.name })
14063
14063
  )
14064
+ )
14065
+ )
14066
+ ),
14067
+ React__default.createElement(
14068
+ Col,
14069
+ null,
14070
+ React__default.createElement(
14071
+ Card.Body,
14072
+ { style: { padding: '20px' }, className: 'body-text' },
14073
+ React__default.createElement(
14074
+ Card.Title,
14075
+ null,
14076
+ row.name
14064
14077
  ),
14065
14078
  React__default.createElement(
14066
- Col,
14079
+ 'div',
14080
+ null,
14081
+ 'Volume: ',
14082
+ row.volume
14083
+ ),
14084
+ React__default.createElement(
14085
+ 'div',
14067
14086
  null,
14087
+ 'Number: ',
14088
+ row.number
14089
+ ),
14090
+ React__default.createElement(
14091
+ Link,
14092
+ { href: href + '/' + publication + '/' + row.identifier.current },
14068
14093
  React__default.createElement(
14069
- Card.Body,
14070
- { style: { padding: '20px' } },
14071
- React__default.createElement(
14072
- Card.Title,
14073
- null,
14074
- row.name
14075
- ),
14076
- React__default.createElement(
14077
- 'div',
14078
- null,
14079
- 'Volume: ',
14080
- row.volume
14081
- ),
14082
- React__default.createElement(
14083
- 'div',
14084
- null,
14085
- 'Number: ',
14086
- row.number
14087
- ),
14094
+ 'a',
14095
+ null,
14088
14096
  React__default.createElement(
14089
14097
  Button,
14090
14098
  { style: { marginTop: '20px' }, variant: 'secondary' },
14091
14099
  'View Issue'
14092
14100
  )
14093
14101
  )
14102
+ ),
14103
+ row.pdf && row.pdf.asset && React__default.createElement(
14104
+ 'a',
14105
+ { href: row.pdf.asset.url, target: '_blank', className: 'btn btn-primary', style: { marginTop: '20px', marginLeft: '1rem' } },
14106
+ 'Download Issue'
14094
14107
  )
14095
14108
  )
14096
14109
  )
@@ -14807,7 +14820,6 @@ var SideFooter = function SideFooter(props) {
14807
14820
  var logo = props.logo;
14808
14821
 
14809
14822
  var year = new Date().getFullYear();
14810
-
14811
14823
  return React__default.createElement(
14812
14824
  'div',
14813
14825
  { className: 'side-footer' },
@@ -15083,7 +15095,7 @@ var Column3 = function Column3(props) {
15083
15095
  Col,
15084
15096
  { md: true, className: 'leftCol', style: { width: '200px' } },
15085
15097
  React__default.createElement(LeftNav, { leftItems: leftItems }),
15086
- website && website.sideFooterContent && website.sideFooterContent.length && website.showFooterOnLeftSide && React__default.createElement(SideFooter, { website: website })
15098
+ website && website.sideFooterContent && website.sideFooterContent.length && website.showFooterOnLeftSide && React__default.createElement(SideFooter, { website: website, logo: logo })
15087
15099
  ),
15088
15100
  React__default.createElement(
15089
15101
  Col,
@@ -15406,7 +15418,7 @@ var NavFooter = function NavFooter(props) {
15406
15418
  { className: 'nav-link' },
15407
15419
  '\xA9 ',
15408
15420
  year,
15409
- ' ',
15421
+ ' MJH Life Sciences and ',
15410
15422
  website.title,
15411
15423
  '. All rights reserved.'
15412
15424
  )
@@ -15475,7 +15487,7 @@ var SocialNavFooter = function SocialNavFooter(props) {
15475
15487
  { className: 'nav-link' },
15476
15488
  '\xA9 ',
15477
15489
  year,
15478
- ' ',
15490
+ ' MJH Life Sciences and ',
15479
15491
  website.name,
15480
15492
  '. All rights reserved.'
15481
15493
  )
@@ -16312,7 +16324,7 @@ var HamMagazine = function HamMagazine(props) {
16312
16324
  var trackScrolling = function trackScrolling() {
16313
16325
  var offsetTop = navRef.current.getBoundingClientRect().top;
16314
16326
 
16315
- if (offsetTop === 0) {
16327
+ if (offsetTop <= 0) {
16316
16328
  setIsSticky(true);
16317
16329
  } else {
16318
16330
  setIsSticky(false);
@@ -16890,16 +16902,30 @@ var FigureComponent = function FigureComponent(_ref) {
16890
16902
  imgFloat = _useState4[0],
16891
16903
  setimgFloat = _useState4[1];
16892
16904
 
16905
+ var _useState5 = useState(false),
16906
+ _useState6 = slicedToArray(_useState5, 2),
16907
+ openImg = _useState6[0],
16908
+ setOpenImg = _useState6[1];
16909
+
16910
+ var _useState7 = useState(''),
16911
+ _useState8 = slicedToArray(_useState7, 2),
16912
+ openImgSrc = _useState8[0],
16913
+ setOpenImgSrc = _useState8[1];
16914
+
16893
16915
  var caption = node$$1.caption,
16894
16916
  alt = node$$1.alt,
16895
16917
  blank = node$$1.blank,
16896
16918
  link = node$$1.link,
16897
- _node$widthP = node$$1.widthP,
16898
- widthP = _node$widthP === undefined ? '30' : _node$widthP,
16899
16919
  _node$alignment = node$$1.alignment,
16900
16920
  alignment = _node$alignment === undefined ? 'center' : _node$alignment;
16921
+ var _node$widthP = node$$1.widthP,
16922
+ widthP = _node$widthP === undefined ? 'auto' : _node$widthP;
16901
16923
 
16902
16924
 
16925
+ if (client.clientConfig.defaultImageSize && widthP === 'auto') {
16926
+ widthP = client.clientConfig.defaultImageSize;
16927
+ }
16928
+
16903
16929
  var figureMargin = void 0;
16904
16930
  if (imgFloat === 'none') {
16905
16931
  figureMargin = '0 auto 1rem';
@@ -16936,7 +16962,7 @@ var FigureComponent = function FigureComponent(_ref) {
16936
16962
  useEffect(function () {
16937
16963
  var screenWidth = window.innerWidth;
16938
16964
  if (screenWidth > 1000) {
16939
- var align = alignment.toLowerCase() === 'center' ? 'none' : alignment.toLowerCase();
16965
+ var align = ['center', 'top'].includes(alignment.toLowerCase()) ? 'none' : alignment.toLowerCase();
16940
16966
  setimgFloat(align);
16941
16967
  }
16942
16968
 
@@ -16946,23 +16972,45 @@ var FigureComponent = function FigureComponent(_ref) {
16946
16972
  if (!node$$1.asset) return null;
16947
16973
 
16948
16974
  return React__default.createElement(
16949
- Figure,
16950
- { className: 'd-block', style: { width: imageWidth, maxWidth: '100%', clear: 'both', float: imgFloat, margin: figureMargin } },
16951
- link ? React__default.createElement(
16952
- 'a',
16953
- { href: link, target: blank ? '_blank' : '_self' },
16954
- React__default.createElement(Figure.Image, { style: { width: '100%' }, className: 'figure-image', ref: imgElement, onLoad: loadImg, src: urlFor$1(node$$1, client).url(), alt: alt && alt }),
16955
- caption && React__default.createElement('div', { dangerouslySetInnerHTML: { __html: '<span class=\'figure-caption\'>' + caption + '</span>' } })
16956
- ) : React__default.createElement(
16957
- React__default.Fragment,
16958
- null,
16959
- React__default.createElement(Figure.Image, { style: { width: '100%' }, className: 'figure-image', ref: imgElement, onLoad: loadImg, src: urlFor$1(node$$1, client).url(), alt: alt && alt }),
16960
- caption && React__default.createElement('div', { dangerouslySetInnerHTML: { __html: '<span class=\'figure-caption\'>' + caption + '</span>' } })
16975
+ React__default.Fragment,
16976
+ null,
16977
+ React__default.createElement(
16978
+ Figure,
16979
+ {
16980
+ className: 'd-block',
16981
+ style: { width: imageWidth, maxWidth: '100%', clear: 'both', float: imgFloat, margin: figureMargin },
16982
+ onClick: function onClick() {
16983
+ setOpenImgSrc(urlFor$1(node$$1, client).url());
16984
+ setOpenImg(true);
16985
+ } },
16986
+ link ? React__default.createElement(
16987
+ 'a',
16988
+ { target: blank ? '_blank' : '_self' },
16989
+ React__default.createElement(Figure.Image, { style: { width: '100%' }, className: 'figure-image', ref: imgElement, onLoad: loadImg, src: urlFor$1(node$$1, client).url(), alt: alt && alt }),
16990
+ caption && React__default.createElement('div', { dangerouslySetInnerHTML: { __html: '<span class=\'figure-caption\'>' + caption + '</span>' } })
16991
+ ) : React__default.createElement(
16992
+ React__default.Fragment,
16993
+ null,
16994
+ React__default.createElement(Figure.Image, { style: { width: '100%' }, className: 'figure-image', ref: imgElement, onLoad: loadImg, src: urlFor$1(node$$1, client).url(), alt: alt && alt }),
16995
+ caption && React__default.createElement('div', { dangerouslySetInnerHTML: { __html: '<span class=\'figure-caption\'>' + caption + '</span>' } })
16996
+ )
16997
+ ),
16998
+ React__default.createElement(
16999
+ 'div',
17000
+ { className: 'lightbox-target ' + (openImg ? 'open' : 'close') },
17001
+ React__default.createElement('img', { src: openImgSrc }),
17002
+ React__default.createElement('a', {
17003
+ className: 'lightbox-close',
17004
+ onClick: function onClick() {
17005
+ setOpenImgSrc('');
17006
+ setOpenImg(false);
17007
+ }
17008
+ })
16961
17009
  ),
16962
17010
  React__default.createElement(
16963
17011
  'style',
16964
17012
  { jsx: 'true' },
16965
- '\n figure-caption {\n font-size: 90%;\n color: #6c757d;\n }\n '
17013
+ '\n figure-caption {\n font-size: 90%;\n color: #6c757d;\n }\n /*Eliminates padding, centers the thumbnail */\n\n body,\n html {\n padding: 0;\n margin: 0;\n text-align: center;\n }\n\n /* Styles the lightbox, removes it from sight and adds the fade-in transition */\n\n .lightbox-target {\n position: fixed;\n top: -100%;\n width: 100%;\n background: rgba(0, 0, 0, 0.7);\n width: 100%;\n opacity: 0;\n -webkit-transition: opacity 0.5s ease-in-out;\n -moz-transition: opacity 0.5s ease-in-out;\n -o-transition: opacity 0.5s ease-in-out;\n transition: opacity 0.5s ease-in-out;\n overflow: hidden;\n }\n\n .lightbox-target.close {\n opacity: 0;\n }\n\n /* Styles the lightbox image, centers it vertically and horizontally, adds the zoom-in transition and makes it responsive using a combination of margin and absolute positioning */\n\n .lightbox-target img {\n margin: auto;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n max-height: 0%;\n max-width: 0%;\n border: 3px solid white;\n box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);\n box-sizing: border-box;\n -webkit-transition: 0.5s ease-in-out;\n -moz-transition: 0.5s ease-in-out;\n -o-transition: 0.5s ease-in-out;\n transition: 0.5s ease-in-out;\n }\n\n /* Styles the close link, adds the slide down transition */\n\n a.lightbox-close {\n display: block;\n width: 50px;\n height: 50px;\n box-sizing: border-box;\n background: white;\n color: black;\n text-decoration: none;\n position: absolute;\n top: -80px;\n right: 0;\n -webkit-transition: 0.5s ease-in-out;\n -moz-transition: 0.5s ease-in-out;\n -o-transition: 0.5s ease-in-out;\n transition: 0.5s ease-in-out;\n }\n\n /* Provides part of the "X" to eliminate an image from the close link */\n\n a.lightbox-close:before {\n content: \'\';\n display: block;\n height: 30px;\n width: 1px;\n background: black;\n position: absolute;\n left: 26px;\n top: 10px;\n -webkit-transform: rotate(45deg);\n -moz-transform: rotate(45deg);\n -o-transform: rotate(45deg);\n transform: rotate(45deg);\n }\n\n /* Provides part of the "X" to eliminate an image from the close link */\n\n a.lightbox-close:after {\n content: \'\';\n display: block;\n height: 30px;\n width: 1px;\n background: black;\n position: absolute;\n left: 26px;\n top: 10px;\n -webkit-transform: rotate(-45deg);\n -moz-transform: rotate(-45deg);\n -o-transform: rotate(-45deg);\n transform: rotate(-45deg);\n }\n\n /* Uses the :target pseudo-class to perform the animations upon clicking the .lightbox-target anchor */\n\n .lightbox-target.open {\n opacity: 1;\n top: 0;\n bottom: 0;\n right: 0;\n z-index: 9999;\n }\n\n .lightbox-target.open img {\n max-height: 100%;\n max-width: 100%;\n }\n\n .lightbox-target.open a.lightbox-close {\n top: 0px;\n }\n '
16966
17014
  )
16967
17015
  );
16968
17016
  };
@@ -29839,5 +29887,103 @@ var YahooHero = function YahooHero(props) {
29839
29887
  );
29840
29888
  };
29841
29889
 
29842
- export { ContentCard as DeckContent, GridContent$1 as GridContent, Queue as DeckQueue, ThumbnailCard, TaxonomyCard, GroupDeck, YoutubeGroup, QueueDeckExpanded, VideoSeriesListing$1 as VideoSeriesListing, MasterDeck$1 as MasterDeck, PublicationDeck, IssueDeck, IssueContentDeck, Column1, Column2, Column3, Header, LeftNav, AccordionPanel, SocialShare, PageFilter, NavMagazine, NavNative, NavNormal, NavDvm, HamMagazine, TemplateNormal, AD, AD300x250, AD300x250x600, AD728x90, ADFooter, getSerializers$1 as getSerializers, Search, Feature, Breadcrumbs, SetCookie, Hero, AlphabeticList, PdfDownload, RelatedTopicsDropdown, Ustream, SideFooter, fbsHero as ForbesHero, HorizontalHero, OncliveHero, OncliveLargeHero, VerticalHero, YahooHero };
29890
+ /*
29891
+ Sample query
29892
+ let references = ''
29893
+ if(article.taxonomyMapping.length > 0){
29894
+ article.taxonomyMapping.forEach((ref, index) => {
29895
+ references = references + `references('${ref._ref}') `
29896
+ if(index+1 !== article.taxonomyMapping.length){
29897
+ references = references + ` && `
29898
+ }
29899
+ })
29900
+ }
29901
+
29902
+ const relatedArticlesQuery = `*[!(_id in path("drafts.**")) && _type == "article" && title !='${article.title}' && defined(title) && is_visible == true && ( references('article.documentGroup._id') || ${references} ) && published <= '${today}'] | order(published desc) [0...4] {
29903
+ ...,
29904
+ title,
29905
+ summary,
29906
+ thumbnail,
29907
+ url,
29908
+ published,
29909
+ authorMapping[]->,
29910
+ contentCategory->
29911
+ }`
29912
+ const relatedArticles = await client.fetch(relatedArticlesQuery)
29913
+
29914
+ Sample usage
29915
+ <RelatedContent dataRecord={props.relatedArticles} client={client} showAuthor showPublished reverse/>
29916
+
29917
+
29918
+ */
29919
+ var RelatedContent = function RelatedContent(props) {
29920
+ var client = props.client,
29921
+ dataRecord = props.dataRecord,
29922
+ _props$defaultImage = props.defaultImage;
29923
+
29924
+ var builder = imageUrlBuilder(client);
29925
+ function urlFor(source) {
29926
+ return builder.image(source);
29927
+ }
29928
+
29929
+ return React__default.createElement(
29930
+ 'div',
29931
+ null,
29932
+ React__default.createElement(
29933
+ 'h1',
29934
+ { className: 'mb-4 pb-2', style: { borderBottom: '1px solid #ccc', fontSize: '1.2rem', fontWeight: 'bold', color: '#252525' } },
29935
+ 'Related Content'
29936
+ ),
29937
+ React__default.createElement(
29938
+ 'div',
29939
+ { className: 'related-articles-container' },
29940
+ dataRecord.map(function (article, index) {
29941
+ console.log(article);
29942
+ return React__default.createElement(
29943
+ Link,
29944
+ { href: '/view/[url]', as: '/view/' + article.url.current, key: index },
29945
+ React__default.createElement(
29946
+ 'a',
29947
+ { className: 'related-article' },
29948
+ React__default.createElement(
29949
+ 'figure',
29950
+ null,
29951
+ React__default.createElement('img', {
29952
+ src: urlFor(article.thumbnail.asset).width(500).url(),
29953
+ alt: article.title
29954
+ })
29955
+ ),
29956
+ React__default.createElement(
29957
+ 'div',
29958
+ { className: 'related-article-body' },
29959
+ React__default.createElement('h4', { dangerouslySetInnerHTML: { __html: article.title } }),
29960
+ props.showPublished && React__default.createElement(
29961
+ 'p',
29962
+ { className: 'pb-0 mb-0' },
29963
+ moment(article.published).format('MMMM DD, YYYY hh:mma')
29964
+ ),
29965
+ props.showAuthor && article.authorMapping && article.authorMapping[0] && React__default.createElement(
29966
+ 'p',
29967
+ null,
29968
+ 'By ',
29969
+ React__default.createElement(
29970
+ 'b',
29971
+ null,
29972
+ article.authorMapping[0].displayName
29973
+ )
29974
+ )
29975
+ )
29976
+ )
29977
+ );
29978
+ }),
29979
+ React__default.createElement(
29980
+ 'style',
29981
+ { jsx: 'true' },
29982
+ '\n .related-article {\n width: 100%;\n display: flex;\n flex-direction: ' + (props.reverse ? 'row-reverse' : 'row') + ';\n margin-bottom: 1rem;\n }\n .related-article figure {\n width: 165px;\n height: 110px;\n min-width: 165px;\n }\n .related-article figure img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n .related-article-body {\n flex: 1 1 auto;\n padding: 0 1rem;\n }\n .related-article-body h4 {\n font-weight: bold;\n font-size: 1.1rem;\n margin-bottom: 0.25rem;\n line-height: 1.3;\n }\n @media screen and (max-width: 430px) {\n .related-article {\n flex-direction: column;\n }\n .related-article figure {\n width: 80%;\n height: auto;\n min-width: 80%;\n margin: 0 auto;\n }\n .related-article figure img {\n width: 100%;\n height: auto;\n object-fit: cover;\n }\n }\n '
29983
+ )
29984
+ )
29985
+ );
29986
+ };
29987
+
29988
+ export { ContentCard as DeckContent, GridContent$1 as GridContent, Queue as DeckQueue, ThumbnailCard, TaxonomyCard, GroupDeck, YoutubeGroup, QueueDeckExpanded, VideoSeriesListing$1 as VideoSeriesListing, MasterDeck$1 as MasterDeck, PublicationDeck, IssueDeck, IssueContentDeck, Column1, Column2, Column3, Header, LeftNav, AccordionPanel, SocialShare, PageFilter, NavMagazine, NavNative, NavNormal, NavDvm, HamMagazine, TemplateNormal, AD, AD300x250, AD300x250x600, AD728x90, ADFooter, getSerializers$1 as getSerializers, Search, Feature, Breadcrumbs, SetCookie, Hero, AlphabeticList, PdfDownload, RelatedTopicsDropdown, Ustream, SideFooter, fbsHero as ForbesHero, HorizontalHero, OncliveHero, OncliveLargeHero, VerticalHero, YahooHero, RelatedContent };
29843
29989
  //# sourceMappingURL=index.es.js.map