sfc-utils 1.3.56 → 1.3.57

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.
@@ -17,7 +17,10 @@ const Topper2 = ({ settings, wcmData, lazyloader }) => {
17
17
  return [topperStyles.headerDekStacked, " mw-lg mt-lg mb-md"];
18
18
  case "full-screen":
19
19
  // apply margin offsets from spreadsheet
20
- calculatefullScreenOffsets();
20
+ if (typeof window != "undefined") {
21
+ calculatefullScreenOffsets();
22
+ }
23
+
21
24
  return [
22
25
  topperStyles.headerDekFullScreen, fullScreenHorizontalCss(),
23
26
  ... (HeaderDek_Vertical_Position === "top") ? [topperStyles.headerDekTop] : [topperStyles.headerDekBottom],
@@ -56,7 +56,11 @@ const WCMImage = ({ wcm, alt, ratio, wcmData, lazyloader, isFullScreenTopper })
56
56
 
57
57
  // This calculation is not used for the topper impl, but keeping it here just in case
58
58
  // it is needed for the general WCMImage utils migration
59
- let r = document.querySelector(':root');
59
+ let r = null;
60
+ if (typeof window != "undefined") {
61
+ r = document.querySelector(':root');
62
+ }
63
+
60
64
  let photoRatio = "56.25%"; // Default to 16/9
61
65
  let fullPath = `https://s.hdnux.com/photos/0/0/0/${wcm}/0/`;
62
66
  if (!ratio){
@@ -69,7 +73,9 @@ const WCMImage = ({ wcm, alt, ratio, wcmData, lazyloader, isFullScreenTopper })
69
73
  if (matchedPhoto){
70
74
  // Set ratio of the actual photo like a legit hacker
71
75
  photoRatio = (matchedPhoto.photo.ratio*100)+"%";
72
- r.style.setProperty('--img-bottom-padding-ratio', photoRatio);
76
+ if (r) {
77
+ r.style.setProperty('--img-bottom-padding-ratio', photoRatio);
78
+ }
73
79
 
74
80
  fullPath = matchedPhoto.photo.full_path;
75
81
  } else {
@@ -79,7 +85,9 @@ const WCMImage = ({ wcm, alt, ratio, wcmData, lazyloader, isFullScreenTopper })
79
85
  } else {
80
86
  // If an override is being passed in, use that
81
87
  photoRatio = ratio
82
- r.style.setProperty('--img-bottom-padding-ratio', photoRatio);
88
+ if (r) {
89
+ r.style.setProperty('--img-bottom-padding-ratio', photoRatio);
90
+ }
83
91
  }
84
92
 
85
93
  // Get serious about alt tags
@@ -92,11 +100,9 @@ const WCMImage = ({ wcm, alt, ratio, wcmData, lazyloader, isFullScreenTopper })
92
100
 
93
101
  return (
94
102
  <div ref={picRef}>
95
-
96
103
  <LazyLoaderHTML>
97
104
  <ImageHTML fullPath={fullPath} imageRez={imageRez} alt={alt} isFullScreenTopper={isFullScreenTopper}/>
98
105
  </LazyLoaderHTML>
99
-
100
106
  </div>
101
107
  )
102
108
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sfc-utils",
3
- "version": "1.3.56",
3
+ "version": "1.3.57",
4
4
  "author": "ewagstaff <evanjwagstaff@gmail.com>",
5
5
  "dependencies": {
6
6
  "archieml": "^0.4.2",