sfc-utils 1.4.5 → 1.4.7
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/components/slideshow/imageslideshow.mjs +0 -4
- package/components/topper2.mjs +11 -40
- package/components/topperimage.mjs +1 -5
- package/package.json +1 -1
- package/styles/modules/imageslideshow.module.less +0 -11
- package/styles/modules/topper2.module.less +0 -10
- package/styles/modules/topperimage.module.less +0 -12
|
@@ -33,8 +33,6 @@ const ImageSlideshow = ({ wcmData, imageList, altList, topperStyle, isLayoutInve
|
|
|
33
33
|
case "stacked":
|
|
34
34
|
case "full-screen":
|
|
35
35
|
return styles.containerStacked;
|
|
36
|
-
case "small-visual":
|
|
37
|
-
return styles.containerSmallVisual;
|
|
38
36
|
default:
|
|
39
37
|
return "";
|
|
40
38
|
}
|
|
@@ -50,8 +48,6 @@ const ImageSlideshow = ({ wcmData, imageList, altList, topperStyle, isLayoutInve
|
|
|
50
48
|
return styles.imageWrapperSideBySide;
|
|
51
49
|
case "side-by-side-portrait":
|
|
52
50
|
return styles.imageWrapperSideBySidePortrait;
|
|
53
|
-
case "small-visual":
|
|
54
|
-
return styles.imageWrapperSmallVisual;
|
|
55
51
|
default:
|
|
56
52
|
return "";
|
|
57
53
|
}
|
package/components/topper2.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import ImageSlideshow from "./slideshow/imageslideshow.mjs"
|
|
|
7
7
|
import * as topperStyles from "../styles/modules/topper2.module.less"
|
|
8
8
|
import * as imageStyles from "../styles/modules/topperimage.module.less"
|
|
9
9
|
|
|
10
|
-
const Topper2 = ({ settings, wcmData }) => {
|
|
10
|
+
const Topper2 = ({ settings, wcmData, mods }) => {
|
|
11
11
|
const {
|
|
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,
|
|
@@ -15,13 +15,18 @@ const Topper2 = ({ settings, wcmData }) => {
|
|
|
15
15
|
Topper_Background_Color
|
|
16
16
|
} = settings
|
|
17
17
|
|
|
18
|
+
// Handle mods here, in case the project modifies the title
|
|
19
|
+
if (mods){
|
|
20
|
+
if (mods.Title){
|
|
21
|
+
Title = mods.Title
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
18
25
|
const headerDekStyleList = () => {
|
|
19
26
|
switch (Topper_Style) {
|
|
20
27
|
case "stacked":
|
|
21
28
|
case "no-visual":
|
|
22
29
|
return [topperStyles.headerDekStacked, " mw-lg mt-lg mb-md"];
|
|
23
|
-
case "small-visual":
|
|
24
|
-
return [topperStyles.headerDekStacked, " mw-lg mt-sm mb-md"];
|
|
25
30
|
case "full-screen":
|
|
26
31
|
// Check if css ":root" is accessible
|
|
27
32
|
if (typeof window != "undefined") {
|
|
@@ -69,7 +74,6 @@ const Topper2 = ({ settings, wcmData }) => {
|
|
|
69
74
|
let defaultStyles = [];
|
|
70
75
|
switch (Topper_Style) {
|
|
71
76
|
case "stacked":
|
|
72
|
-
case "small-visual":
|
|
73
77
|
defaultStyles = [];
|
|
74
78
|
break;
|
|
75
79
|
case "no-visual":
|
|
@@ -96,7 +100,6 @@ const Topper2 = ({ settings, wcmData }) => {
|
|
|
96
100
|
const deckStyleList = () => {
|
|
97
101
|
switch (Topper_Style) {
|
|
98
102
|
case "stacked":
|
|
99
|
-
case "small-visual":
|
|
100
103
|
return ["deck"];
|
|
101
104
|
case "no-visual":
|
|
102
105
|
return ["deck left"];
|
|
@@ -171,13 +174,14 @@ const Topper2 = ({ settings, wcmData }) => {
|
|
|
171
174
|
|
|
172
175
|
switch (Topper_Style) {
|
|
173
176
|
case "stacked":
|
|
174
|
-
case "side-by-side":
|
|
175
|
-
case "small-visual":
|
|
176
177
|
videoCss = topperStyles.videoStacked;
|
|
177
178
|
break;
|
|
178
179
|
case "full-screen":
|
|
179
180
|
videoCss = topperStyles.videoFullscreen;
|
|
180
181
|
break;
|
|
182
|
+
case "side-by-side":
|
|
183
|
+
videoCss = topperStyles.videoStacked;
|
|
184
|
+
break;
|
|
181
185
|
case "side-by-side-portrait":
|
|
182
186
|
videoCss = `${topperStyles.videoSideBySidePortrait} ${sideBySidePortraitFloatCss()}`;
|
|
183
187
|
break;
|
|
@@ -228,16 +232,6 @@ const Topper2 = ({ settings, wcmData }) => {
|
|
|
228
232
|
imageCssList={[imageStyles.cImgFullscreen]}
|
|
229
233
|
/>
|
|
230
234
|
)
|
|
231
|
-
case "small-visual":
|
|
232
|
-
return (
|
|
233
|
-
<TopperImage
|
|
234
|
-
wcm={Image}
|
|
235
|
-
alt={Image_Alt}
|
|
236
|
-
wcmData={wcmData}
|
|
237
|
-
containerCssList={[imageStyles.cContainerSmallVisual]}
|
|
238
|
-
imageCssList={[imageStyles.cImgSmallVisual]}
|
|
239
|
-
/>
|
|
240
|
-
)
|
|
241
235
|
case "side-by-side":
|
|
242
236
|
return (
|
|
243
237
|
<TopperImage
|
|
@@ -341,29 +335,6 @@ const Topper2 = ({ settings, wcmData }) => {
|
|
|
341
335
|
</>
|
|
342
336
|
);
|
|
343
337
|
|
|
344
|
-
case "small-visual":
|
|
345
|
-
return (
|
|
346
|
-
<>
|
|
347
|
-
<div>
|
|
348
|
-
<figure className={`mw-xl ml-auto mr-auto ${topperStyles.imageSmallVisual}`}>
|
|
349
|
-
{getMediaHTML(isSlideshow(wcmIdList))}
|
|
350
|
-
</figure>
|
|
351
|
-
<div className={headerDekStyleList().join('')}>
|
|
352
|
-
<Heading
|
|
353
|
-
level={1}
|
|
354
|
-
text={Title}
|
|
355
|
-
className={headerStyleList().join(' ')}
|
|
356
|
-
/>
|
|
357
|
-
<Heading
|
|
358
|
-
level={2}
|
|
359
|
-
text={Deck}
|
|
360
|
-
className={deckStyleList().join(' ')}
|
|
361
|
-
/>
|
|
362
|
-
</div>
|
|
363
|
-
</div>
|
|
364
|
-
</>
|
|
365
|
-
);
|
|
366
|
-
|
|
367
338
|
case "no-visual":
|
|
368
339
|
return (
|
|
369
340
|
<>
|
|
@@ -61,7 +61,6 @@ const TopperImage = ({ wcm, alt, ratio, wcmData, containerCssList = [], imageCss
|
|
|
61
61
|
// This calculation is not used for the topper impl, but keeping it here just in case
|
|
62
62
|
// it is needed for the general WCMImage utils migration
|
|
63
63
|
let photoRatio = "56.25%"; // Default to 16/9
|
|
64
|
-
let photoFraction = 0.5625;
|
|
65
64
|
let photoViewport = "56.25vw";
|
|
66
65
|
let fullPath = `https://s.hdnux.com/photos/0/0/0/${wcm}/0/`;
|
|
67
66
|
if (!ratio) {
|
|
@@ -75,13 +74,11 @@ const TopperImage = ({ wcm, alt, ratio, wcmData, containerCssList = [], imageCss
|
|
|
75
74
|
// Set ratio of the actual photo like a legit hacker
|
|
76
75
|
photoRatio = (matchedPhoto.photo.ratio * 100) + "%";
|
|
77
76
|
photoViewport = (matchedPhoto.photo.ratio * 50) + "vw";
|
|
78
|
-
photoFraction = (parseFloat(matchedPhoto.photo.ratio));
|
|
79
77
|
|
|
80
78
|
// If css :root is available, set the photo ratio
|
|
81
79
|
if (r) {
|
|
82
80
|
r.style.setProperty('--img-bottom-padding-ratio', photoRatio);
|
|
83
81
|
r.style.setProperty('--img-height-viewport', photoViewport);
|
|
84
|
-
r.style.setProperty('--img-bottom-padding-fraction', photoFraction);
|
|
85
82
|
}
|
|
86
83
|
|
|
87
84
|
fullPath = matchedPhoto.photo.full_path;
|
|
@@ -97,7 +94,6 @@ const TopperImage = ({ wcm, alt, ratio, wcmData, containerCssList = [], imageCss
|
|
|
97
94
|
if (r) {
|
|
98
95
|
r.style.setProperty('--img-bottom-padding-ratio', photoRatio);
|
|
99
96
|
r.style.setProperty('--img-height-viewport', photoViewport);
|
|
100
|
-
r.style.setProperty('--img-bottom-padding-fraction', photoFraction);
|
|
101
97
|
}
|
|
102
98
|
}
|
|
103
99
|
|
|
@@ -116,7 +112,7 @@ const TopperImage = ({ wcm, alt, ratio, wcmData, containerCssList = [], imageCss
|
|
|
116
112
|
TopperImage.propTypes = {
|
|
117
113
|
wcm: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
118
114
|
alt: PropTypes.string.isRequired,
|
|
119
|
-
ratio: PropTypes.string,
|
|
115
|
+
ratio: PropTypes.string, // This prop is currently not being used, might be ok to delete?
|
|
120
116
|
wcmData: PropTypes.object,
|
|
121
117
|
containerCssList: PropTypes.array,
|
|
122
118
|
imageCssList: PropTypes.array
|
package/package.json
CHANGED
|
@@ -34,11 +34,6 @@
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
.container-small-visual {
|
|
38
|
-
width: 150px;
|
|
39
|
-
height: calc(150px*2/3);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
37
|
.image-wrapper-stacked {
|
|
43
38
|
position: absolute;
|
|
44
39
|
width: 100%;
|
|
@@ -66,12 +61,6 @@
|
|
|
66
61
|
}
|
|
67
62
|
}
|
|
68
63
|
|
|
69
|
-
.image-wrapper-small-visual {
|
|
70
|
-
position: absolute;
|
|
71
|
-
width: 150px;
|
|
72
|
-
height: calc(150px*2/3)
|
|
73
|
-
}
|
|
74
|
-
|
|
75
64
|
.image-wrapper-side-by-side-portrait {
|
|
76
65
|
position: absolute;
|
|
77
66
|
width: calc(90vh*2/3);
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
:root {
|
|
5
5
|
--img-bottom-padding-ratio: "56.25%";
|
|
6
6
|
--img-height-viewport: "56.25vw";
|
|
7
|
-
--img-bottom-padding-fraction: 0.5625;
|
|
8
7
|
}
|
|
9
8
|
|
|
10
9
|
.c-force-aspect-ratio {
|
|
@@ -69,11 +68,6 @@
|
|
|
69
68
|
padding-bottom: var(--img-bottom-padding-ratio);
|
|
70
69
|
}
|
|
71
70
|
|
|
72
|
-
.c-container-small-visual {
|
|
73
|
-
height: calc(var(--img-bottom-padding-fraction)*150px);
|
|
74
|
-
width: 150px;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
71
|
.c-img {
|
|
78
72
|
display: block;
|
|
79
73
|
position: relative;
|
|
@@ -103,12 +97,6 @@
|
|
|
103
97
|
}
|
|
104
98
|
}
|
|
105
99
|
|
|
106
|
-
.c-img-small-visual {
|
|
107
|
-
display: block;
|
|
108
|
-
position: absolute;
|
|
109
|
-
padding: 0;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
100
|
.c-container-side-by-side {
|
|
113
101
|
height: 100%;
|
|
114
102
|
}
|