sfc-utils 1.3.57 → 1.3.59

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.
@@ -4,7 +4,7 @@ import WCMImage2 from "./wcmimage2.mjs"
4
4
  import CaptionCredit from "./captioncredit.mjs"
5
5
  import * as topperStyles from "../styles/modules/topper2.module.less"
6
6
 
7
- const Topper2 = ({ settings, wcmData, lazyloader }) => {
7
+ const Topper2 = ({ settings, wcmData }) => {
8
8
  const {
9
9
  Topper_Style, Title, Title_Style, Deck, Image, Image_Alt, Image_Caption, Image_Credits,
10
10
  HeaderDek_Vertical_Position, HeaderDek_Vertical_Offset, HeaderDek_Horizontal_Offset, HeaderDek_Horizontal_Position, Inverted_Colors
@@ -87,8 +87,8 @@ const Topper2 = ({ settings, wcmData, lazyloader }) => {
87
87
  }
88
88
  }
89
89
 
90
- const ImageHTML = () => <WCMImage2 wcm={Image} alt={Image_Alt} isNotLazyloaded={false} wcmData={wcmData} lazyloader={lazyloader} isFullScreenTopper={false}/>
91
- const FullScreenImageHTML = () => <WCMImage2 wcm={Image} alt={Image_Alt} isNotLazyloaded={false} ratio={calculateFullScreenImageRatio()} wcmData={wcmData} lazyloader={lazyloader} isFullScreenTopper={true}/>
90
+ const ImageHTML = () => <WCMImage2 wcm={Image} alt={Image_Alt} isNotLazyloaded={false} wcmData={wcmData} isFullScreenTopper={false}/>
91
+ const FullScreenImageHTML = () => <WCMImage2 wcm={Image} alt={Image_Alt} isNotLazyloaded={false} ratio={calculateFullScreenImageRatio()} wcmData={wcmData} isFullScreenTopper={true}/>
92
92
 
93
93
  const TopperHtml = () => {
94
94
  switch (Topper_Style) {
@@ -190,6 +190,7 @@ const Topper2 = ({ settings, wcmData, lazyloader }) => {
190
190
 
191
191
  const calculateFullScreenImageRatio = () => {
192
192
  // ratio needs to account for height of nav bar which is 37px
193
+ if (typeof window === "undefined") return "56.25%"
193
194
  const windowRatio = ((window.innerHeight-37) / window.innerWidth)*100;
194
195
  let fullScreenRatio = "56.25%"; // defaults to 16/9;
195
196
 
@@ -17,7 +17,7 @@ const ImageHTML = ({fullPath, imageRez, alt, isFullScreenTopper}) => {
17
17
  )
18
18
  }
19
19
 
20
- const WCMImage = ({ wcm, alt, ratio, wcmData, lazyloader, isFullScreenTopper }) => {
20
+ const WCMImage = ({ wcm, alt, ratio, wcmData, isFullScreenTopper }) => {
21
21
  // When the wrapping div is rendered, we're going to figure out the best size for this image to be
22
22
  let picRef = useRef(null)
23
23
  let [imageRez, setImageRez] = useState(0)
@@ -95,14 +95,9 @@ const WCMImage = ({ wcm, alt, ratio, wcmData, lazyloader, isFullScreenTopper })
95
95
  throw `WCMImage error: Image for ${wcm} needs an alt tag! Please add a good, descriptive alt tag. Suggestion from Mozilla: When choosing alt strings for your images, imagine what you would say when reading the page to someone over the phone without mentioning that there's an image on the page.`
96
96
  }
97
97
 
98
- // Pull lazyloader HTML from index.js
99
- const LazyLoaderHTML = lazyloader;
100
-
101
98
  return (
102
99
  <div ref={picRef}>
103
- <LazyLoaderHTML>
104
100
  <ImageHTML fullPath={fullPath} imageRez={imageRez} alt={alt} isFullScreenTopper={isFullScreenTopper}/>
105
- </LazyLoaderHTML>
106
101
  </div>
107
102
  )
108
103
  }
@@ -110,8 +105,7 @@ const WCMImage = ({ wcm, alt, ratio, wcmData, lazyloader, isFullScreenTopper })
110
105
  WCMImage.propTypes = {
111
106
  wcm: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
112
107
  alt: PropTypes.string.isRequired,
113
- ratio: PropTypes.string,
114
- lazyloader: PropTypes.element
108
+ ratio: PropTypes.string
115
109
  }
116
110
 
117
111
  export default WCMImage
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sfc-utils",
3
- "version": "1.3.57",
3
+ "version": "1.3.59",
4
4
  "author": "ewagstaff <evanjwagstaff@gmail.com>",
5
5
  "dependencies": {
6
6
  "archieml": "^0.4.2",