sfc-utils 1.4.13 → 1.4.15

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 @@ const DevHubCredit = () => {
4
4
  return (
5
5
  <>
6
6
  <span className="devhub-credit">
7
- Powered by the <a target="_blank" href="https://www.poynter.org/business-work/2022/coming-off-big-digital-subscription-growth-hearst-newspapers-plan-a-new-data-and-product-hub-for-2022/">Hearst Newspapers DevHub</a>.
7
+ Powered by the <a target="_blank" href="https://www.sfchronicle.com/projects/about-the-devhub-hearst-newspapers/">Hearst Newspapers DevHub</a>.
8
8
  <svg fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h82.7L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3V192c0 17.7 14.3 32 32 32s32-14.3 32-32V32c0-17.7-14.3-32-32-32H320zM80 32C35.8 32 0 67.8 0 112V432c0 44.2 35.8 80 80 80H400c44.2 0 80-35.8 80-80V320c0-17.7-14.3-32-32-32s-32 14.3-32 32V432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16H192c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z"/></svg>
9
9
  </span>
10
10
  </>
@@ -12,7 +12,7 @@ const Topper2 = ({ settings, wcmData, mods }) => {
12
12
  Topper_Style, Title, Title_Style, Deck, Image, Image_Alt, Video_Mp4, Image_Caption, Image_Credits,
13
13
  HeaderDek_Vertical_Position, HeaderDek_Vertical_Offset, HeaderDek_Horizontal_Offset,
14
14
  HeaderDek_Horizontal_Position, Inverted_Colors, Inverted_Layout, Inverted_Text_Color,
15
- Topper_Background_Color, Small_Visual_Max_Width
15
+ Topper_Background_Color, Small_Visual_Max_Width, Small_Visual_Topper_Url
16
16
  } = settings
17
17
 
18
18
  // During server-side rendering, access to ":root" is unavailable. This is okay; we just need
@@ -156,7 +156,7 @@ const Topper2 = ({ settings, wcmData, mods }) => {
156
156
  if (!listStr) return [];
157
157
  // For backwards compat, handle both ; and , as delimiters
158
158
  let charSearch = ","
159
- if (listStr.toString().indexOf(";") !== -1){
159
+ if (listStr.toString().indexOf(";") !== -1) {
160
160
  charSearch = ";"
161
161
  }
162
162
  return listStr.toString().split(charSearch).map((d) => parseInt(d));
@@ -244,11 +244,20 @@ const Topper2 = ({ settings, wcmData, mods }) => {
244
244
  />
245
245
  )
246
246
  case "small-visual":
247
- // If there is a "Small_Visual_Max_Width" column, set the custom max width
247
+ // If there is a "Small_Visual_Max_Width" column, override the max width of the topper image
248
248
  if (Small_Visual_Max_Width && r) {
249
249
  r.style.setProperty('--small-visual-max-width', Small_Visual_Max_Width)
250
250
  }
251
251
 
252
+ // If there is a custom topper image or gif url, override the WCM image
253
+ if (Small_Visual_Topper_Url) {
254
+ return <img
255
+ className={imageStyles.cImgSmallVisualUrl}
256
+ src={Small_Visual_Topper_Url}
257
+ alt={Image_Alt}
258
+ />
259
+ }
260
+
252
261
  return (
253
262
  <TopperImage
254
263
  wcm={Image}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sfc-utils",
3
- "version": "1.4.13",
3
+ "version": "1.4.15",
4
4
  "author": "ewagstaff <evanjwagstaff@gmail.com>",
5
5
  "dependencies": {
6
6
  "archieml": "^0.4.2",
@@ -119,6 +119,16 @@
119
119
  padding: 0;
120
120
  }
121
121
 
122
+ .c-img-small-visual-url {
123
+ max-width: var(--small-visual-max-width);
124
+ width: calc(100vw - 32px);
125
+ margin: @s16 @s16 0 @s16;
126
+
127
+ @media @mobile {
128
+ margin: auto;
129
+ }
130
+ }
131
+
122
132
  .c-container-side-by-side {
123
133
  height: 100%;
124
134
  }