sfc-utils 1.4.5 → 1.4.6
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 +3 -39
- 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
|
@@ -20,8 +20,6 @@ const Topper2 = ({ settings, wcmData }) => {
|
|
|
20
20
|
case "stacked":
|
|
21
21
|
case "no-visual":
|
|
22
22
|
return [topperStyles.headerDekStacked, " mw-lg mt-lg mb-md"];
|
|
23
|
-
case "small-visual":
|
|
24
|
-
return [topperStyles.headerDekStacked, " mw-lg mt-sm mb-md"];
|
|
25
23
|
case "full-screen":
|
|
26
24
|
// Check if css ":root" is accessible
|
|
27
25
|
if (typeof window != "undefined") {
|
|
@@ -69,7 +67,6 @@ const Topper2 = ({ settings, wcmData }) => {
|
|
|
69
67
|
let defaultStyles = [];
|
|
70
68
|
switch (Topper_Style) {
|
|
71
69
|
case "stacked":
|
|
72
|
-
case "small-visual":
|
|
73
70
|
defaultStyles = [];
|
|
74
71
|
break;
|
|
75
72
|
case "no-visual":
|
|
@@ -96,7 +93,6 @@ const Topper2 = ({ settings, wcmData }) => {
|
|
|
96
93
|
const deckStyleList = () => {
|
|
97
94
|
switch (Topper_Style) {
|
|
98
95
|
case "stacked":
|
|
99
|
-
case "small-visual":
|
|
100
96
|
return ["deck"];
|
|
101
97
|
case "no-visual":
|
|
102
98
|
return ["deck left"];
|
|
@@ -171,13 +167,14 @@ const Topper2 = ({ settings, wcmData }) => {
|
|
|
171
167
|
|
|
172
168
|
switch (Topper_Style) {
|
|
173
169
|
case "stacked":
|
|
174
|
-
case "side-by-side":
|
|
175
|
-
case "small-visual":
|
|
176
170
|
videoCss = topperStyles.videoStacked;
|
|
177
171
|
break;
|
|
178
172
|
case "full-screen":
|
|
179
173
|
videoCss = topperStyles.videoFullscreen;
|
|
180
174
|
break;
|
|
175
|
+
case "side-by-side":
|
|
176
|
+
videoCss = topperStyles.videoStacked;
|
|
177
|
+
break;
|
|
181
178
|
case "side-by-side-portrait":
|
|
182
179
|
videoCss = `${topperStyles.videoSideBySidePortrait} ${sideBySidePortraitFloatCss()}`;
|
|
183
180
|
break;
|
|
@@ -228,16 +225,6 @@ const Topper2 = ({ settings, wcmData }) => {
|
|
|
228
225
|
imageCssList={[imageStyles.cImgFullscreen]}
|
|
229
226
|
/>
|
|
230
227
|
)
|
|
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
228
|
case "side-by-side":
|
|
242
229
|
return (
|
|
243
230
|
<TopperImage
|
|
@@ -341,29 +328,6 @@ const Topper2 = ({ settings, wcmData }) => {
|
|
|
341
328
|
</>
|
|
342
329
|
);
|
|
343
330
|
|
|
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
331
|
case "no-visual":
|
|
368
332
|
return (
|
|
369
333
|
<>
|
|
@@ -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
|
}
|