@gem-sdk/components 2.0.0-dev.624 → 2.0.0-dev.625
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/dist/cjs/button/components/Button.js +1 -0
- package/dist/cjs/button/components/Button.liquid.js +1 -0
- package/dist/cjs/image/components/AdaptiveImage.js +6 -6
- package/dist/cjs/image/components/AdaptiveImage.liquid.js +8 -8
- package/dist/cjs/image/components/common/attributes.js +0 -20
- package/dist/cjs/image/components/common/helpers.js +19 -0
- package/dist/cjs/image-comparison/components/CompareImage.liquid.js +1 -1
- package/dist/cjs/image-comparison/components/ImageComparison.js +1 -1
- package/dist/cjs/image-comparison/components/ImageComparison.liquid.js +1 -1
- package/dist/cjs/image-comparison/components/common/classes.js +23 -2
- package/dist/cjs/image-comparison/setting/configs/settings.js +22 -0
- package/dist/cjs/image-comparison/setting/configs/uiV2.js +12 -44
- package/dist/cjs/product/setting/product-button/configs/uiV2.js +36 -0
- package/dist/cjs/video/components/LiteVimeoEmbed.js +7 -7
- package/dist/cjs/video/components/LiteVimeoEmbed.liquid.js +10 -8
- package/dist/cjs/video/components/common/getClasses.js +4 -6
- package/dist/cjs/video/components/common/index.js +2 -2
- package/dist/cjs/video/setting/configs/uiV2.js +0 -2
- package/dist/esm/button/components/Button.js +1 -0
- package/dist/esm/button/components/Button.liquid.js +1 -0
- package/dist/esm/image/components/AdaptiveImage.js +6 -6
- package/dist/esm/image/components/AdaptiveImage.liquid.js +8 -8
- package/dist/esm/image/components/common/attributes.js +1 -20
- package/dist/esm/image/components/common/helpers.js +17 -1
- package/dist/esm/image-comparison/components/CompareImage.liquid.js +1 -1
- package/dist/esm/image-comparison/components/ImageComparison.js +1 -1
- package/dist/esm/image-comparison/components/ImageComparison.liquid.js +1 -1
- package/dist/esm/image-comparison/components/common/classes.js +24 -4
- package/dist/esm/image-comparison/setting/configs/settings.js +22 -0
- package/dist/esm/image-comparison/setting/configs/uiV2.js +12 -44
- package/dist/esm/product/setting/product-button/configs/uiV2.js +36 -0
- package/dist/esm/video/components/LiteVimeoEmbed.js +8 -8
- package/dist/esm/video/components/LiteVimeoEmbed.liquid.js +10 -8
- package/dist/esm/video/components/common/getClasses.js +4 -6
- package/dist/esm/video/components/common/index.js +2 -2
- package/dist/esm/video/setting/configs/uiV2.js +0 -2
- package/dist/types/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -34,6 +34,7 @@ const Button = (props)=>{
|
|
|
34
34
|
...styles.getTypoStyles(styles$1)
|
|
35
35
|
});
|
|
36
36
|
const buttonIconStyles = system.createStyle({
|
|
37
|
+
...styles.getTypoStyles(styles$1),
|
|
37
38
|
...styles.getButtonIconStyles(styles$1, setting)
|
|
38
39
|
});
|
|
39
40
|
const buttonWrapperStyles = system.createStyle({
|
|
@@ -33,6 +33,7 @@ const Button = (props)=>{
|
|
|
33
33
|
...styles.getTypoStyles(styles$1)
|
|
34
34
|
});
|
|
35
35
|
const buttonIconStyles = system.createStyle({
|
|
36
|
+
...styles.getTypoStyles(styles$1),
|
|
36
37
|
...styles.getButtonIconStyles(styles$1, setting)
|
|
37
38
|
});
|
|
38
39
|
const buttonWrapperStyles = system.createStyle({
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var constants = require('./common/constants.js');
|
|
8
8
|
var system = require('@gem-sdk/system');
|
|
9
|
-
var attributes = require('./common/attributes.js');
|
|
10
9
|
var classes = require('./common/classes.js');
|
|
11
10
|
var data = require('./common/data.js');
|
|
12
11
|
var styles = require('./common/styles.js');
|
|
@@ -14,11 +13,11 @@ var styles = require('./common/styles.js');
|
|
|
14
13
|
const AdaptiveImage = (props)=>{
|
|
15
14
|
const { alt, style, srcSet, layout, priority, className, aspectRatio, borderRadius, pictureClass, enableLazyloadImage, ...restProps } = props;
|
|
16
15
|
const { getDeviceSource } = data.getAdaptiveImageData(props);
|
|
17
|
-
const {
|
|
18
|
-
const loadingAttrs = system.createAttr(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
})
|
|
16
|
+
const { srcTablet, srcMobile } = getDeviceSource();
|
|
17
|
+
const loadingAttrs = system.createAttr({
|
|
18
|
+
loading: priority ? 'eager' : 'lazy',
|
|
19
|
+
src: srcSet?.desktop?.src || constants.IMAGE_PLACEHOLDER
|
|
20
|
+
});
|
|
22
21
|
const pictureStyle = system.createStyleReact({
|
|
23
22
|
...styles.getAdaptivePictureStyles()
|
|
24
23
|
});
|
|
@@ -55,6 +54,7 @@ const AdaptiveImage = (props)=>{
|
|
|
55
54
|
...restProps,
|
|
56
55
|
...loadingAttrs,
|
|
57
56
|
alt: alt,
|
|
57
|
+
width: '100%',
|
|
58
58
|
style: adaptiveImageStyles,
|
|
59
59
|
className: adaptiveImageClasses,
|
|
60
60
|
draggable: "false"
|
|
@@ -4,11 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var core = require('@gem-sdk/core');
|
|
6
6
|
var system = require('@gem-sdk/system');
|
|
7
|
-
var attributes = require('./common/attributes.js');
|
|
8
7
|
var classes = require('./common/classes.js');
|
|
9
|
-
var constants = require('./common/constants.js');
|
|
10
8
|
var data = require('./common/data.js');
|
|
11
9
|
var styles = require('./common/styles.js');
|
|
10
|
+
var helpers = require('./common/helpers.js');
|
|
12
11
|
|
|
13
12
|
const AdaptiveImage = (props)=>{
|
|
14
13
|
const { alt, style, layout, srcSet, priority, className, aspectRatio, pageContext, pictureClass, borderRadius, enableLazyLoadImage = true, ...restProps } = props;
|
|
@@ -16,10 +15,10 @@ const AdaptiveImage = (props)=>{
|
|
|
16
15
|
const { srcDesktop, srcTablet, srcMobile } = getDeviceSource({
|
|
17
16
|
isLiquid: true
|
|
18
17
|
});
|
|
19
|
-
const loadingAttrs = system.createAttr(
|
|
20
|
-
srcDesktop,
|
|
21
|
-
|
|
22
|
-
})
|
|
18
|
+
const loadingAttrs = system.createAttr({
|
|
19
|
+
src: enableLazyLoadImage ? helpers.createBlurDataURL(srcSet?.desktop?.width ?? 0, srcSet?.desktop?.height ?? 0) : srcDesktop,
|
|
20
|
+
'data-src': srcDesktop
|
|
21
|
+
});
|
|
23
22
|
const pictureStyle = system.createStyle({
|
|
24
23
|
...styles.getAdaptivePictureStyles()
|
|
25
24
|
});
|
|
@@ -40,8 +39,8 @@ const AdaptiveImage = (props)=>{
|
|
|
40
39
|
});
|
|
41
40
|
const renderSource = ()=>{
|
|
42
41
|
return core.template`
|
|
43
|
-
${srcMobile ? `<source media="(max-width: 767px)" data-srcSet="${srcMobile}" srcset="${enableLazyLoadImage ?
|
|
44
|
-
${srcTablet ? `<source media="(max-width: 1024px)" data-srcSet="${srcTablet}" srcset="${enableLazyLoadImage ?
|
|
42
|
+
${srcMobile ? `<source media="(max-width: 767px)" data-srcSet="${srcMobile}" srcset="${enableLazyLoadImage ? helpers.createBlurDataURL(srcSet?.mobile?.width ?? srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.mobile?.height ?? srcSet?.tablet?.height ?? srcSet?.desktop?.height ?? 0) : srcMobile}" />` : ''}
|
|
43
|
+
${srcTablet ? `<source media="(max-width: 1024px)" data-srcSet="${srcTablet}" srcset="${enableLazyLoadImage ? helpers.createBlurDataURL(srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.tablet?.height ?? srcSet?.desktop?.height ?? 0) : srcTablet}" />` : ''}
|
|
45
44
|
`;
|
|
46
45
|
};
|
|
47
46
|
const renderImage = ()=>{
|
|
@@ -54,6 +53,7 @@ const AdaptiveImage = (props)=>{
|
|
|
54
53
|
...loadingAttrs
|
|
55
54
|
}}
|
|
56
55
|
alt="${alt}"
|
|
56
|
+
width="100%"
|
|
57
57
|
style="${adaptiveImageStyles}"
|
|
58
58
|
class="${adaptiveImageClasses}"
|
|
59
59
|
/>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var constants = require('./constants.js');
|
|
4
3
|
var helpers = require('./helpers.js');
|
|
5
4
|
|
|
6
5
|
const getContainerAttrs = (builderAttrs, uid)=>{
|
|
@@ -99,28 +98,9 @@ const getNextImageAttrs = ({ styles, setting })=>{
|
|
|
99
98
|
}
|
|
100
99
|
};
|
|
101
100
|
};
|
|
102
|
-
const getLoadingAdaptiveImageAttrs = ({ srcDesktop, enableLazyLoadImage })=>{
|
|
103
|
-
const lazyLoadAttrs = {
|
|
104
|
-
width: '100%',
|
|
105
|
-
src: constants.IMAGE_PLACEHOLDER,
|
|
106
|
-
loading: 'lazy',
|
|
107
|
-
...srcDesktop ? {
|
|
108
|
-
'data-src': srcDesktop
|
|
109
|
-
} : {}
|
|
110
|
-
};
|
|
111
|
-
const priorityLoadAttrs = {
|
|
112
|
-
src: srcDesktop || '',
|
|
113
|
-
fetchpriority: 'high',
|
|
114
|
-
loading: 'lazy'
|
|
115
|
-
};
|
|
116
|
-
return {
|
|
117
|
-
...enableLazyLoadImage ? lazyLoadAttrs : priorityLoadAttrs
|
|
118
|
-
};
|
|
119
|
-
};
|
|
120
101
|
|
|
121
102
|
exports.getAdaptiveImageAttrs = getAdaptiveImageAttrs;
|
|
122
103
|
exports.getContainerAttrs = getContainerAttrs;
|
|
123
104
|
exports.getImageLiquidAttrs = getImageLiquidAttrs;
|
|
124
105
|
exports.getLinkWrapperAttrs = getLinkWrapperAttrs;
|
|
125
|
-
exports.getLoadingAdaptiveImageAttrs = getLoadingAdaptiveImageAttrs;
|
|
126
106
|
exports.getNextImageAttrs = getNextImageAttrs;
|
|
@@ -70,10 +70,29 @@ const getAspectRatioNextImage = ({ isDisableAspectStyle, aspectRatio, objectFits
|
|
|
70
70
|
const safeStringify = (obj)=>{
|
|
71
71
|
return JSON.stringify(obj || {}).replace(/"/g, '"');
|
|
72
72
|
};
|
|
73
|
+
const shimmer = (w, h)=>`<svg width="${w}" height="${h}" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
74
|
+
<defs>
|
|
75
|
+
<linearGradient id="g-${w}-${h}">
|
|
76
|
+
<stop stop-color="rgba(51, 51, 51, 0)" offset="20%" />
|
|
77
|
+
<stop stop-color="rgba(51, 51, 51, 0)" offset="50%" />
|
|
78
|
+
<stop stop-color="rgba(51, 51, 51, 0)" offset="70%" />
|
|
79
|
+
</linearGradient>
|
|
80
|
+
</defs>
|
|
81
|
+
<rect width="${w}" height="${h}" fill="rgba(51, 51, 51, 0)" />
|
|
82
|
+
<rect id="r" width="${w}" height="${h}" fill="url(#g-${w}-${h})" />
|
|
83
|
+
<animate xlink:href="#r" attributeName="x" from="-${w}" to="${w}" dur="1s" repeatCount="indefinite" />
|
|
84
|
+
</svg>`;
|
|
85
|
+
const toBase64 = (str)=>typeof window === 'undefined' ? Buffer.from(str).toString('base64') : window.btoa(str);
|
|
86
|
+
const createBlurDataURL = (width, height)=>{
|
|
87
|
+
return `data:image/svg+xml;base64,${toBase64(shimmer(width, height))}`;
|
|
88
|
+
};
|
|
73
89
|
|
|
74
90
|
exports.composeAspectRatio = composeAspectRatio;
|
|
91
|
+
exports.createBlurDataURL = createBlurDataURL;
|
|
75
92
|
exports.getAspectRatio = getAspectRatio;
|
|
76
93
|
exports.getAspectRatioNextImage = getAspectRatioNextImage;
|
|
77
94
|
exports.getResponsiveObjectFit = getResponsiveObjectFit;
|
|
78
95
|
exports.overwriteDefaultRadius = overwriteDefaultRadius;
|
|
79
96
|
exports.safeStringify = safeStringify;
|
|
97
|
+
exports.shimmer = shimmer;
|
|
98
|
+
exports.toBase64 = toBase64;
|
|
@@ -253,7 +253,7 @@ const CompareImage = (props)=>{
|
|
|
253
253
|
class="${outerWrapperClasses}"
|
|
254
254
|
gp-data='${JSON.stringify(compareImageState)}'
|
|
255
255
|
>
|
|
256
|
-
<div id="img-comparison-wrapper-${componentUid}" style="${wrapperStyles}
|
|
256
|
+
<div id="img-comparison-wrapper-${componentUid}" style="${wrapperStyles}">
|
|
257
257
|
<div
|
|
258
258
|
id="img-comparison-container-${componentUid}"
|
|
259
259
|
data-testid="container"
|
|
@@ -12,7 +12,7 @@ var CompareImage = require('./CompareImage.js');
|
|
|
12
12
|
const ImageComparison = ({ setting, styles, builderProps, advanced, ...props })=>{
|
|
13
13
|
const { imageLeft, altLeft, titleLeft, imageRight, altRight, titleRight, direction, defaultPercentage, leftImageLabel, rightImageLabel, sliderLineWidth, hoverToSlide, enableLabel, preload } = setting ?? {};
|
|
14
14
|
const wrapperClasses = system.createClass(classes.getImageComparisonWrapperClasses());
|
|
15
|
-
const wrapperStyles = system.createStyleReact(classes.getImageComparisonWrapperStyles());
|
|
15
|
+
const wrapperStyles = system.createStyleReact(classes.getImageComparisonWrapperStyles(styles));
|
|
16
16
|
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
17
17
|
style: wrapperStyles,
|
|
18
18
|
className: wrapperClasses,
|
|
@@ -11,7 +11,7 @@ var CompareImage_liquid = require('./CompareImage.liquid.js');
|
|
|
11
11
|
const ImageComparison = ({ setting, styles, builderProps, advanced, ...props })=>{
|
|
12
12
|
const { imageLeft, altLeft, titleLeft, imageRight, altRight, titleRight, direction, defaultPercentage, leftImageLabel, rightImageLabel, sliderLineWidth, hoverToSlide, enableLabel, preload, translate, qualityType, qualityPercent } = setting ?? {};
|
|
13
13
|
const wrapperClasses = system.createClass(classes.getImageComparisonWrapperClasses());
|
|
14
|
-
const wrapperStyles = system.createStyle(classes.getImageComparisonWrapperStyles());
|
|
14
|
+
const wrapperStyles = system.createStyle(classes.getImageComparisonWrapperStyles(styles));
|
|
15
15
|
return core.template`
|
|
16
16
|
<div class="${wrapperClasses}" style="${wrapperStyles}">
|
|
17
17
|
${CompareImage_liquid.default({
|
|
@@ -27,9 +27,29 @@ const getImageComparisonWrapperClasses = ()=>{
|
|
|
27
27
|
'gp-flex gp-w-full gp-overflow-hidden': true
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
|
-
const getImageComparisonWrapperStyles = ()=>{
|
|
30
|
+
const getImageComparisonWrapperStyles = (styles)=>{
|
|
31
31
|
return {
|
|
32
|
-
'border-radius': 'inherit'
|
|
32
|
+
'border-radius': 'inherit',
|
|
33
|
+
...getShadowStyles(styles)
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
const getShadowStyles = (styles)=>{
|
|
37
|
+
return {
|
|
38
|
+
...core.getStyleShadow({
|
|
39
|
+
styleAppliedFor: 'box-shadow',
|
|
40
|
+
value: styles?.wrapperShadow?.desktop,
|
|
41
|
+
isEnableShadow: styles?.wrapperShadow?.desktop?.enable
|
|
42
|
+
}),
|
|
43
|
+
...core.getStyleShadow({
|
|
44
|
+
styleAppliedFor: 'box-shadow',
|
|
45
|
+
value: styles?.wrapperShadow?.tablet,
|
|
46
|
+
isEnableShadow: styles?.wrapperShadow?.tablet?.enable
|
|
47
|
+
}),
|
|
48
|
+
...core.getStyleShadow({
|
|
49
|
+
styleAppliedFor: 'box-shadow',
|
|
50
|
+
value: styles?.wrapperShadow?.mobile,
|
|
51
|
+
isEnableShadow: styles?.wrapperShadow?.mobile?.enable
|
|
52
|
+
})
|
|
33
53
|
};
|
|
34
54
|
};
|
|
35
55
|
|
|
@@ -38,3 +58,4 @@ exports.getImageComparisonWrapperStyles = getImageComparisonWrapperStyles;
|
|
|
38
58
|
exports.getLabelClasses = getLabelClasses;
|
|
39
59
|
exports.getLabelContainerClasses = getLabelContainerClasses;
|
|
40
60
|
exports.getOuterWrapperClasses = getOuterWrapperClasses;
|
|
61
|
+
exports.getShadowStyles = getShadowStyles;
|
|
@@ -599,6 +599,28 @@ const ImageComparisonSettings = [
|
|
|
599
599
|
],
|
|
600
600
|
default: 'default'
|
|
601
601
|
},
|
|
602
|
+
{
|
|
603
|
+
id: 'wrapperShadow',
|
|
604
|
+
type: 'shadow-v2',
|
|
605
|
+
devices: {
|
|
606
|
+
desktop: {
|
|
607
|
+
default: {}
|
|
608
|
+
}
|
|
609
|
+
},
|
|
610
|
+
compoDefaultValue: {
|
|
611
|
+
desktop: {
|
|
612
|
+
default: {
|
|
613
|
+
type: 'shadow-1',
|
|
614
|
+
distance: '4px',
|
|
615
|
+
blur: '4px',
|
|
616
|
+
spread: '0px',
|
|
617
|
+
color: 'rgba(18, 18, 18, 0.2)',
|
|
618
|
+
angle: 45,
|
|
619
|
+
enable: true
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
},
|
|
602
624
|
{
|
|
603
625
|
id: 'align',
|
|
604
626
|
label: 'Alignment',
|
|
@@ -352,51 +352,19 @@ const SettingUIV2 = [
|
|
|
352
352
|
en: 'Shadow'
|
|
353
353
|
},
|
|
354
354
|
setting: {
|
|
355
|
-
id: '
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
controlChangeTrigger: {
|
|
368
|
-
settings: [
|
|
369
|
-
{
|
|
370
|
-
condition: `boxShadow.normal.enable === true`,
|
|
371
|
-
source: [
|
|
372
|
-
'boxShadow',
|
|
373
|
-
'hasBoxShadow'
|
|
374
|
-
],
|
|
375
|
-
action: {
|
|
376
|
-
controlId: 'hasBoxShadow',
|
|
377
|
-
groupType: 'advanced',
|
|
378
|
-
controlType: 'advanced',
|
|
379
|
-
state: 'normal',
|
|
380
|
-
newValue: true
|
|
381
|
-
}
|
|
382
|
-
},
|
|
383
|
-
{
|
|
384
|
-
condition: `boxShadow.normal.enable === false`,
|
|
385
|
-
source: [
|
|
386
|
-
'boxShadow',
|
|
387
|
-
'hasBoxShadow'
|
|
388
|
-
],
|
|
389
|
-
action: {
|
|
390
|
-
controlId: 'hasBoxShadow',
|
|
391
|
-
groupType: 'advanced',
|
|
392
|
-
controlType: 'advanced',
|
|
393
|
-
state: 'normal',
|
|
394
|
-
newValue: false
|
|
395
|
-
}
|
|
355
|
+
id: 'wrapperShadow'
|
|
356
|
+
},
|
|
357
|
+
compoDefaultValue: {
|
|
358
|
+
desktop: {
|
|
359
|
+
default: {
|
|
360
|
+
type: 'shadow-1',
|
|
361
|
+
distance: '4px',
|
|
362
|
+
blur: '4px',
|
|
363
|
+
spread: '0px',
|
|
364
|
+
color: 'rgba(18, 18, 18, 0.2)',
|
|
365
|
+
angle: 45,
|
|
366
|
+
enable: true
|
|
396
367
|
}
|
|
397
|
-
],
|
|
398
|
-
options: {
|
|
399
|
-
noRecordHistory: true
|
|
400
368
|
}
|
|
401
369
|
}
|
|
402
370
|
}
|
|
@@ -61,6 +61,18 @@ const SettingUIV2 = [
|
|
|
61
61
|
newValue: false
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
|
+
{
|
|
65
|
+
condition: 'buttonLayout === "cart-full"',
|
|
66
|
+
source: [
|
|
67
|
+
'buttonLayout'
|
|
68
|
+
],
|
|
69
|
+
action: {
|
|
70
|
+
controlId: 'priceLayout',
|
|
71
|
+
groupType: 'setting',
|
|
72
|
+
controlType: 'setting',
|
|
73
|
+
newValue: 'price-before'
|
|
74
|
+
}
|
|
75
|
+
},
|
|
64
76
|
{
|
|
65
77
|
condition: 'buttonLayout === "cart-price"',
|
|
66
78
|
source: [
|
|
@@ -121,6 +133,18 @@ const SettingUIV2 = [
|
|
|
121
133
|
newValue: false
|
|
122
134
|
}
|
|
123
135
|
},
|
|
136
|
+
{
|
|
137
|
+
condition: 'buttonLayout === "cart-price"',
|
|
138
|
+
source: [
|
|
139
|
+
'buttonLayout'
|
|
140
|
+
],
|
|
141
|
+
action: {
|
|
142
|
+
controlId: 'priceLayout',
|
|
143
|
+
groupType: 'setting',
|
|
144
|
+
controlType: 'setting',
|
|
145
|
+
newValue: 'price-only'
|
|
146
|
+
}
|
|
147
|
+
},
|
|
124
148
|
{
|
|
125
149
|
condition: 'buttonLayout === "cart-only"',
|
|
126
150
|
source: [
|
|
@@ -217,6 +241,18 @@ const SettingUIV2 = [
|
|
|
217
241
|
newValue: false
|
|
218
242
|
}
|
|
219
243
|
},
|
|
244
|
+
{
|
|
245
|
+
condition: 'buttonLayout === "cart-price-icon"',
|
|
246
|
+
source: [
|
|
247
|
+
'buttonLayout'
|
|
248
|
+
],
|
|
249
|
+
action: {
|
|
250
|
+
controlId: 'priceLayout',
|
|
251
|
+
groupType: 'setting',
|
|
252
|
+
controlType: 'setting',
|
|
253
|
+
newValue: 'price-only'
|
|
254
|
+
}
|
|
255
|
+
},
|
|
220
256
|
{
|
|
221
257
|
condition: 'buttonLayout === "cart-icon"',
|
|
222
258
|
source: [
|
|
@@ -29,7 +29,7 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
29
29
|
...getClasses.getImageVimeoClasses()
|
|
30
30
|
});
|
|
31
31
|
const buttonVimeoClasses = system.createClass({
|
|
32
|
-
...getClasses.getButtonVimeoClasses(
|
|
32
|
+
...getClasses.getButtonVimeoClasses()
|
|
33
33
|
});
|
|
34
34
|
const iframeVimeoClasses = system.createClass({
|
|
35
35
|
...getClasses.getIframeVimeoClasses()
|
|
@@ -42,13 +42,13 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
42
42
|
style: articleVimeoStyle,
|
|
43
43
|
onClick: addIframe,
|
|
44
44
|
children: [
|
|
45
|
-
/*#__PURE__*/ jsxRuntime.jsx(NextImage.default, {
|
|
45
|
+
system.If(!iframe, /*#__PURE__*/ jsxRuntime.jsx(NextImage.default, {
|
|
46
46
|
src: posterUrl,
|
|
47
47
|
alt: "Poster",
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}),
|
|
51
|
-
/*#__PURE__*/ jsxRuntime.jsx("button", {
|
|
48
|
+
className: imageVimeoClasses,
|
|
49
|
+
onClick: addIframe
|
|
50
|
+
})),
|
|
51
|
+
system.If(!iframe, /*#__PURE__*/ jsxRuntime.jsx("button", {
|
|
52
52
|
type: "button",
|
|
53
53
|
className: buttonVimeoClasses,
|
|
54
54
|
"aria-label": "Play",
|
|
@@ -60,7 +60,7 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
60
60
|
d: "M5 5.274c0-1.707 1.826-2.792 3.325-1.977l12.362 6.726c1.566.853 1.566 3.101 0 3.953L8.325 20.702C6.826 21.518 5 20.432 5 18.726V5.274Z"
|
|
61
61
|
})
|
|
62
62
|
})
|
|
63
|
-
}),
|
|
63
|
+
})),
|
|
64
64
|
iframe && /*#__PURE__*/ jsxRuntime.jsx("iframe", {
|
|
65
65
|
style: iframeVimeoStyle,
|
|
66
66
|
title: title,
|
|
@@ -11,7 +11,7 @@ var index = require('./common/index.js');
|
|
|
11
11
|
var NextImage_liquid = require('../../image/components/NextImage.liquid.js');
|
|
12
12
|
|
|
13
13
|
const LiteVimeoEmbed = (props)=>{
|
|
14
|
-
const { title, id, lazy, aspectRatio, autoplay } = props;
|
|
14
|
+
const { title, id, lazy, aspectRatio, autoplay, muted } = props;
|
|
15
15
|
const { iframeSrc } = index.getVimeoParams(props);
|
|
16
16
|
const iframe = !lazy;
|
|
17
17
|
const posterUrl = props.thumbnail;
|
|
@@ -22,6 +22,7 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
22
22
|
iframeSrc,
|
|
23
23
|
title,
|
|
24
24
|
autoplay,
|
|
25
|
+
muted,
|
|
25
26
|
style: props?.vimeoStyleIframe || ''
|
|
26
27
|
});
|
|
27
28
|
const iframeVimeoStyle = system.createStyle({
|
|
@@ -37,7 +38,7 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
37
38
|
...getClasses.getImageVimeoClasses()
|
|
38
39
|
});
|
|
39
40
|
const buttonVimeoClasses = system.createClass({
|
|
40
|
-
...getClasses.getButtonVimeoClasses(
|
|
41
|
+
...getClasses.getButtonVimeoClasses()
|
|
41
42
|
});
|
|
42
43
|
const iframeVimeoClasses = system.createClass({
|
|
43
44
|
...getClasses.getIframeVimeoClasses()
|
|
@@ -50,20 +51,21 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
50
51
|
data-title="${title}"
|
|
51
52
|
style="${articleVimeoStyle}"
|
|
52
53
|
>
|
|
53
|
-
|
|
54
|
+
${system.If(!iframe, core.template`
|
|
55
|
+
${NextImage_liquid.default({
|
|
54
56
|
src: posterUrl,
|
|
55
57
|
alt: title,
|
|
56
|
-
className: imageVimeoClasses
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
className: imageVimeoClasses
|
|
59
|
+
})}}`)}
|
|
60
|
+
${system.If(!iframe, core.template`
|
|
61
|
+
<button type="button" class="${buttonVimeoClasses}" aria-label="Play">
|
|
60
62
|
<svg class="gp-w-5 gp-text-white" viewBox="0 0 24 24">
|
|
61
63
|
<path
|
|
62
64
|
fill="currentColor"
|
|
63
65
|
d="M5 5.274c0-1.707 1.826-2.792 3.325-1.977l12.362 6.726c1.566.853 1.566 3.101 0 3.953L8.325 20.702C6.826 21.518 5 20.432 5 18.726V5.274Z"
|
|
64
66
|
/>
|
|
65
67
|
</svg>
|
|
66
|
-
</button
|
|
68
|
+
</button>`)}
|
|
67
69
|
${system.If(iframe, core.template`
|
|
68
70
|
<iframe
|
|
69
71
|
style="${iframeVimeoStyle}"
|
|
@@ -72,15 +72,13 @@ const getVideoYoutubeClasses = (className, offLazyLoad)=>{
|
|
|
72
72
|
};
|
|
73
73
|
};
|
|
74
74
|
const getImageVimeoClasses = ()=>{
|
|
75
|
-
const classList = `gp-
|
|
75
|
+
const classList = `gp-h-full gp-w-full gp-absolute gp-top-0 gp-left-0 gp-z-9`;
|
|
76
76
|
return {
|
|
77
77
|
...composeClasses(classList)
|
|
78
78
|
};
|
|
79
79
|
};
|
|
80
|
-
const getButtonVimeoClasses = (
|
|
81
|
-
|
|
82
|
-
if (lazy) classList += ` gp-visible gp-opacity-100`;
|
|
83
|
-
else classList += ` gp-invisible gp-opacity-0`;
|
|
80
|
+
const getButtonVimeoClasses = ()=>{
|
|
81
|
+
const classList = `gp-absolute gp-left-1/2 gp-top-1/2 gp-flex gp-aspect-[56/32] gp-w-14 -gp-translate-x-1/2 -gp-translate-y-1/2 gp-items-center gp-justify-center gp-rounded gp-bg-black/80 gp-transition-colors hover:gp-bg-[#ef0800] gp-z-10 gp-lite-vimeo-embed-button gp-pointer-events-none`;
|
|
84
82
|
return {
|
|
85
83
|
...composeClasses(classList)
|
|
86
84
|
};
|
|
@@ -93,7 +91,7 @@ const getIframeVimeoClasses = ()=>{
|
|
|
93
91
|
};
|
|
94
92
|
const getButtonYoutubeClasses = (lazy)=>{
|
|
95
93
|
let classList = `gp-absolute gp-left-1/2 gp-top-1/2 gp-w-[68px] -gp-translate-x-1/2 -gp-translate-y-1/2 gp-lite-youtube-embed-button`;
|
|
96
|
-
if (lazy) classList += ` gp-
|
|
94
|
+
if (lazy) classList += ` gp-opacity-0`;
|
|
97
95
|
else classList += ` gp-visible gp-opacity-100`;
|
|
98
96
|
return {
|
|
99
97
|
...composeClasses(classList)
|
|
@@ -50,9 +50,9 @@ const getYoutubeParams = (props)=>{
|
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
52
|
const getVimeoParams = (props)=>{
|
|
53
|
-
const { id, autoplay, muted, controls, loop } = props;
|
|
53
|
+
const { id, autoplay, muted, controls, loop, lazy } = props;
|
|
54
54
|
const videoId = encodeURIComponent(id);
|
|
55
|
-
const params = `?&autoplay=${autoplay ? 1 : 0}` + `&muted=${muted ? 1 : 0}` + `&loop=${loop ? 1 : 0}` + `&controls=${controls}` + '&autopause=false';
|
|
55
|
+
const params = `?&autoplay=${lazy ? 1 : autoplay ? 1 : 0}` + `&muted=${muted ? 1 : 0}` + `&loop=${loop ? 1 : 0}` + `&controls=${controls}` + '&autopause=false';
|
|
56
56
|
const iframeSrc = `https://player.vimeo.com/video/${videoId}${params}`;
|
|
57
57
|
return {
|
|
58
58
|
videoId,
|
|
@@ -139,8 +139,6 @@ const SettingUIV2 = [
|
|
|
139
139
|
id: 'autoplay'
|
|
140
140
|
},
|
|
141
141
|
options: {
|
|
142
|
-
labelVariant: 'primary',
|
|
143
|
-
fullWidth: true,
|
|
144
142
|
disableMessage: `YouTube videos will not autoplay when lazy load is enabled`
|
|
145
143
|
},
|
|
146
144
|
conditionEnable: "type === 'html5' || (type !== 'html5' && lazy != true)"
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { IMAGE_PLACEHOLDER } from './common/constants.js';
|
|
4
4
|
import { createAttr, createStyleReact, createStyle, createClass } from '@gem-sdk/system';
|
|
5
|
-
import { getLoadingAdaptiveImageAttrs } from './common/attributes.js';
|
|
6
5
|
import { getAdaptiveImageClasses } from './common/classes.js';
|
|
7
6
|
import { getAdaptiveImageData } from './common/data.js';
|
|
8
7
|
import { getAdaptivePictureStyles, getAdaptiveImageStyles } from './common/styles.js';
|
|
@@ -10,11 +9,11 @@ import { getAdaptivePictureStyles, getAdaptiveImageStyles } from './common/style
|
|
|
10
9
|
const AdaptiveImage = (props)=>{
|
|
11
10
|
const { alt, style, srcSet, layout, priority, className, aspectRatio, borderRadius, pictureClass, enableLazyloadImage, ...restProps } = props;
|
|
12
11
|
const { getDeviceSource } = getAdaptiveImageData(props);
|
|
13
|
-
const {
|
|
14
|
-
const loadingAttrs = createAttr(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
})
|
|
12
|
+
const { srcTablet, srcMobile } = getDeviceSource();
|
|
13
|
+
const loadingAttrs = createAttr({
|
|
14
|
+
loading: priority ? 'eager' : 'lazy',
|
|
15
|
+
src: srcSet?.desktop?.src || IMAGE_PLACEHOLDER
|
|
16
|
+
});
|
|
18
17
|
const pictureStyle = createStyleReact({
|
|
19
18
|
...getAdaptivePictureStyles()
|
|
20
19
|
});
|
|
@@ -51,6 +50,7 @@ const AdaptiveImage = (props)=>{
|
|
|
51
50
|
...restProps,
|
|
52
51
|
...loadingAttrs,
|
|
53
52
|
alt: alt,
|
|
53
|
+
width: '100%',
|
|
54
54
|
style: adaptiveImageStyles,
|
|
55
55
|
className: adaptiveImageClasses,
|
|
56
56
|
draggable: "false"
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { template } from '@gem-sdk/core';
|
|
2
2
|
import { createAttr, createStyle, createClass } from '@gem-sdk/system';
|
|
3
|
-
import { getLoadingAdaptiveImageAttrs } from './common/attributes.js';
|
|
4
3
|
import { getAdaptiveImageClasses } from './common/classes.js';
|
|
5
|
-
import { IMAGE_PLACEHOLDER } from './common/constants.js';
|
|
6
4
|
import { getAdaptiveImageData } from './common/data.js';
|
|
7
5
|
import { getAdaptivePictureStyles, getAdaptiveImageStyles } from './common/styles.js';
|
|
6
|
+
import { createBlurDataURL } from './common/helpers.js';
|
|
8
7
|
|
|
9
8
|
const AdaptiveImage = (props)=>{
|
|
10
9
|
const { alt, style, layout, srcSet, priority, className, aspectRatio, pageContext, pictureClass, borderRadius, enableLazyLoadImage = true, ...restProps } = props;
|
|
@@ -12,10 +11,10 @@ const AdaptiveImage = (props)=>{
|
|
|
12
11
|
const { srcDesktop, srcTablet, srcMobile } = getDeviceSource({
|
|
13
12
|
isLiquid: true
|
|
14
13
|
});
|
|
15
|
-
const loadingAttrs = createAttr(
|
|
16
|
-
srcDesktop,
|
|
17
|
-
|
|
18
|
-
})
|
|
14
|
+
const loadingAttrs = createAttr({
|
|
15
|
+
src: enableLazyLoadImage ? createBlurDataURL(srcSet?.desktop?.width ?? 0, srcSet?.desktop?.height ?? 0) : srcDesktop,
|
|
16
|
+
'data-src': srcDesktop
|
|
17
|
+
});
|
|
19
18
|
const pictureStyle = createStyle({
|
|
20
19
|
...getAdaptivePictureStyles()
|
|
21
20
|
});
|
|
@@ -36,8 +35,8 @@ const AdaptiveImage = (props)=>{
|
|
|
36
35
|
});
|
|
37
36
|
const renderSource = ()=>{
|
|
38
37
|
return template`
|
|
39
|
-
${srcMobile ? `<source media="(max-width: 767px)" data-srcSet="${srcMobile}" srcset="${enableLazyLoadImage ?
|
|
40
|
-
${srcTablet ? `<source media="(max-width: 1024px)" data-srcSet="${srcTablet}" srcset="${enableLazyLoadImage ?
|
|
38
|
+
${srcMobile ? `<source media="(max-width: 767px)" data-srcSet="${srcMobile}" srcset="${enableLazyLoadImage ? createBlurDataURL(srcSet?.mobile?.width ?? srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.mobile?.height ?? srcSet?.tablet?.height ?? srcSet?.desktop?.height ?? 0) : srcMobile}" />` : ''}
|
|
39
|
+
${srcTablet ? `<source media="(max-width: 1024px)" data-srcSet="${srcTablet}" srcset="${enableLazyLoadImage ? createBlurDataURL(srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.tablet?.height ?? srcSet?.desktop?.height ?? 0) : srcTablet}" />` : ''}
|
|
41
40
|
`;
|
|
42
41
|
};
|
|
43
42
|
const renderImage = ()=>{
|
|
@@ -50,6 +49,7 @@ const AdaptiveImage = (props)=>{
|
|
|
50
49
|
...loadingAttrs
|
|
51
50
|
}}
|
|
52
51
|
alt="${alt}"
|
|
52
|
+
width="100%"
|
|
53
53
|
style="${adaptiveImageStyles}"
|
|
54
54
|
class="${adaptiveImageClasses}"
|
|
55
55
|
/>
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IMAGE_PLACEHOLDER } from './constants.js';
|
|
2
1
|
import { getAspectRatio } from './helpers.js';
|
|
3
2
|
|
|
4
3
|
const getContainerAttrs = (builderAttrs, uid)=>{
|
|
@@ -97,23 +96,5 @@ const getNextImageAttrs = ({ styles, setting })=>{
|
|
|
97
96
|
}
|
|
98
97
|
};
|
|
99
98
|
};
|
|
100
|
-
const getLoadingAdaptiveImageAttrs = ({ srcDesktop, enableLazyLoadImage })=>{
|
|
101
|
-
const lazyLoadAttrs = {
|
|
102
|
-
width: '100%',
|
|
103
|
-
src: IMAGE_PLACEHOLDER,
|
|
104
|
-
loading: 'lazy',
|
|
105
|
-
...srcDesktop ? {
|
|
106
|
-
'data-src': srcDesktop
|
|
107
|
-
} : {}
|
|
108
|
-
};
|
|
109
|
-
const priorityLoadAttrs = {
|
|
110
|
-
src: srcDesktop || '',
|
|
111
|
-
fetchpriority: 'high',
|
|
112
|
-
loading: 'lazy'
|
|
113
|
-
};
|
|
114
|
-
return {
|
|
115
|
-
...enableLazyLoadImage ? lazyLoadAttrs : priorityLoadAttrs
|
|
116
|
-
};
|
|
117
|
-
};
|
|
118
99
|
|
|
119
|
-
export { getAdaptiveImageAttrs, getContainerAttrs, getImageLiquidAttrs, getLinkWrapperAttrs,
|
|
100
|
+
export { getAdaptiveImageAttrs, getContainerAttrs, getImageLiquidAttrs, getLinkWrapperAttrs, getNextImageAttrs };
|
|
@@ -68,5 +68,21 @@ const getAspectRatioNextImage = ({ isDisableAspectStyle, aspectRatio, objectFits
|
|
|
68
68
|
const safeStringify = (obj)=>{
|
|
69
69
|
return JSON.stringify(obj || {}).replace(/"/g, '"');
|
|
70
70
|
};
|
|
71
|
+
const shimmer = (w, h)=>`<svg width="${w}" height="${h}" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
72
|
+
<defs>
|
|
73
|
+
<linearGradient id="g-${w}-${h}">
|
|
74
|
+
<stop stop-color="rgba(51, 51, 51, 0)" offset="20%" />
|
|
75
|
+
<stop stop-color="rgba(51, 51, 51, 0)" offset="50%" />
|
|
76
|
+
<stop stop-color="rgba(51, 51, 51, 0)" offset="70%" />
|
|
77
|
+
</linearGradient>
|
|
78
|
+
</defs>
|
|
79
|
+
<rect width="${w}" height="${h}" fill="rgba(51, 51, 51, 0)" />
|
|
80
|
+
<rect id="r" width="${w}" height="${h}" fill="url(#g-${w}-${h})" />
|
|
81
|
+
<animate xlink:href="#r" attributeName="x" from="-${w}" to="${w}" dur="1s" repeatCount="indefinite" />
|
|
82
|
+
</svg>`;
|
|
83
|
+
const toBase64 = (str)=>typeof window === 'undefined' ? Buffer.from(str).toString('base64') : window.btoa(str);
|
|
84
|
+
const createBlurDataURL = (width, height)=>{
|
|
85
|
+
return `data:image/svg+xml;base64,${toBase64(shimmer(width, height))}`;
|
|
86
|
+
};
|
|
71
87
|
|
|
72
|
-
export { composeAspectRatio, getAspectRatio, getAspectRatioNextImage, getResponsiveObjectFit, overwriteDefaultRadius, safeStringify };
|
|
88
|
+
export { composeAspectRatio, createBlurDataURL, getAspectRatio, getAspectRatioNextImage, getResponsiveObjectFit, overwriteDefaultRadius, safeStringify, shimmer, toBase64 };
|
|
@@ -249,7 +249,7 @@ const CompareImage = (props)=>{
|
|
|
249
249
|
class="${outerWrapperClasses}"
|
|
250
250
|
gp-data='${JSON.stringify(compareImageState)}'
|
|
251
251
|
>
|
|
252
|
-
<div id="img-comparison-wrapper-${componentUid}" style="${wrapperStyles}
|
|
252
|
+
<div id="img-comparison-wrapper-${componentUid}" style="${wrapperStyles}">
|
|
253
253
|
<div
|
|
254
254
|
id="img-comparison-container-${componentUid}"
|
|
255
255
|
data-testid="container"
|
|
@@ -8,7 +8,7 @@ import CompareImage from './CompareImage.js';
|
|
|
8
8
|
const ImageComparison = ({ setting, styles, builderProps, advanced, ...props })=>{
|
|
9
9
|
const { imageLeft, altLeft, titleLeft, imageRight, altRight, titleRight, direction, defaultPercentage, leftImageLabel, rightImageLabel, sliderLineWidth, hoverToSlide, enableLabel, preload } = setting ?? {};
|
|
10
10
|
const wrapperClasses = createClass(getImageComparisonWrapperClasses());
|
|
11
|
-
const wrapperStyles = createStyleReact(getImageComparisonWrapperStyles());
|
|
11
|
+
const wrapperStyles = createStyleReact(getImageComparisonWrapperStyles(styles));
|
|
12
12
|
return /*#__PURE__*/ jsx("div", {
|
|
13
13
|
style: wrapperStyles,
|
|
14
14
|
className: wrapperClasses,
|
|
@@ -7,7 +7,7 @@ import CompareImage from './CompareImage.liquid.js';
|
|
|
7
7
|
const ImageComparison = ({ setting, styles, builderProps, advanced, ...props })=>{
|
|
8
8
|
const { imageLeft, altLeft, titleLeft, imageRight, altRight, titleRight, direction, defaultPercentage, leftImageLabel, rightImageLabel, sliderLineWidth, hoverToSlide, enableLabel, preload, translate, qualityType, qualityPercent } = setting ?? {};
|
|
9
9
|
const wrapperClasses = createClass(getImageComparisonWrapperClasses());
|
|
10
|
-
const wrapperStyles = createStyle(getImageComparisonWrapperStyles());
|
|
10
|
+
const wrapperStyles = createStyle(getImageComparisonWrapperStyles(styles));
|
|
11
11
|
return template`
|
|
12
12
|
<div class="${wrapperClasses}" style="${wrapperStyles}">
|
|
13
13
|
${CompareImage({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { composeTypographyClassName } from '@gem-sdk/core';
|
|
1
|
+
import { getStyleShadow, composeTypographyClassName } from '@gem-sdk/core';
|
|
2
2
|
|
|
3
3
|
const getOuterWrapperClasses = (cssClass)=>{
|
|
4
4
|
return {
|
|
@@ -25,10 +25,30 @@ const getImageComparisonWrapperClasses = ()=>{
|
|
|
25
25
|
'gp-flex gp-w-full gp-overflow-hidden': true
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
-
const getImageComparisonWrapperStyles = ()=>{
|
|
28
|
+
const getImageComparisonWrapperStyles = (styles)=>{
|
|
29
29
|
return {
|
|
30
|
-
'border-radius': 'inherit'
|
|
30
|
+
'border-radius': 'inherit',
|
|
31
|
+
...getShadowStyles(styles)
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
const getShadowStyles = (styles)=>{
|
|
35
|
+
return {
|
|
36
|
+
...getStyleShadow({
|
|
37
|
+
styleAppliedFor: 'box-shadow',
|
|
38
|
+
value: styles?.wrapperShadow?.desktop,
|
|
39
|
+
isEnableShadow: styles?.wrapperShadow?.desktop?.enable
|
|
40
|
+
}),
|
|
41
|
+
...getStyleShadow({
|
|
42
|
+
styleAppliedFor: 'box-shadow',
|
|
43
|
+
value: styles?.wrapperShadow?.tablet,
|
|
44
|
+
isEnableShadow: styles?.wrapperShadow?.tablet?.enable
|
|
45
|
+
}),
|
|
46
|
+
...getStyleShadow({
|
|
47
|
+
styleAppliedFor: 'box-shadow',
|
|
48
|
+
value: styles?.wrapperShadow?.mobile,
|
|
49
|
+
isEnableShadow: styles?.wrapperShadow?.mobile?.enable
|
|
50
|
+
})
|
|
31
51
|
};
|
|
32
52
|
};
|
|
33
53
|
|
|
34
|
-
export { getImageComparisonWrapperClasses, getImageComparisonWrapperStyles, getLabelClasses, getLabelContainerClasses, getOuterWrapperClasses };
|
|
54
|
+
export { getImageComparisonWrapperClasses, getImageComparisonWrapperStyles, getLabelClasses, getLabelContainerClasses, getOuterWrapperClasses, getShadowStyles };
|
|
@@ -597,6 +597,28 @@ const ImageComparisonSettings = [
|
|
|
597
597
|
],
|
|
598
598
|
default: 'default'
|
|
599
599
|
},
|
|
600
|
+
{
|
|
601
|
+
id: 'wrapperShadow',
|
|
602
|
+
type: 'shadow-v2',
|
|
603
|
+
devices: {
|
|
604
|
+
desktop: {
|
|
605
|
+
default: {}
|
|
606
|
+
}
|
|
607
|
+
},
|
|
608
|
+
compoDefaultValue: {
|
|
609
|
+
desktop: {
|
|
610
|
+
default: {
|
|
611
|
+
type: 'shadow-1',
|
|
612
|
+
distance: '4px',
|
|
613
|
+
blur: '4px',
|
|
614
|
+
spread: '0px',
|
|
615
|
+
color: 'rgba(18, 18, 18, 0.2)',
|
|
616
|
+
angle: 45,
|
|
617
|
+
enable: true
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
},
|
|
600
622
|
{
|
|
601
623
|
id: 'align',
|
|
602
624
|
label: 'Alignment',
|
|
@@ -350,51 +350,19 @@ const SettingUIV2 = [
|
|
|
350
350
|
en: 'Shadow'
|
|
351
351
|
},
|
|
352
352
|
setting: {
|
|
353
|
-
id: '
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
controlChangeTrigger: {
|
|
366
|
-
settings: [
|
|
367
|
-
{
|
|
368
|
-
condition: `boxShadow.normal.enable === true`,
|
|
369
|
-
source: [
|
|
370
|
-
'boxShadow',
|
|
371
|
-
'hasBoxShadow'
|
|
372
|
-
],
|
|
373
|
-
action: {
|
|
374
|
-
controlId: 'hasBoxShadow',
|
|
375
|
-
groupType: 'advanced',
|
|
376
|
-
controlType: 'advanced',
|
|
377
|
-
state: 'normal',
|
|
378
|
-
newValue: true
|
|
379
|
-
}
|
|
380
|
-
},
|
|
381
|
-
{
|
|
382
|
-
condition: `boxShadow.normal.enable === false`,
|
|
383
|
-
source: [
|
|
384
|
-
'boxShadow',
|
|
385
|
-
'hasBoxShadow'
|
|
386
|
-
],
|
|
387
|
-
action: {
|
|
388
|
-
controlId: 'hasBoxShadow',
|
|
389
|
-
groupType: 'advanced',
|
|
390
|
-
controlType: 'advanced',
|
|
391
|
-
state: 'normal',
|
|
392
|
-
newValue: false
|
|
393
|
-
}
|
|
353
|
+
id: 'wrapperShadow'
|
|
354
|
+
},
|
|
355
|
+
compoDefaultValue: {
|
|
356
|
+
desktop: {
|
|
357
|
+
default: {
|
|
358
|
+
type: 'shadow-1',
|
|
359
|
+
distance: '4px',
|
|
360
|
+
blur: '4px',
|
|
361
|
+
spread: '0px',
|
|
362
|
+
color: 'rgba(18, 18, 18, 0.2)',
|
|
363
|
+
angle: 45,
|
|
364
|
+
enable: true
|
|
394
365
|
}
|
|
395
|
-
],
|
|
396
|
-
options: {
|
|
397
|
-
noRecordHistory: true
|
|
398
366
|
}
|
|
399
367
|
}
|
|
400
368
|
}
|
|
@@ -59,6 +59,18 @@ const SettingUIV2 = [
|
|
|
59
59
|
newValue: false
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
|
+
{
|
|
63
|
+
condition: 'buttonLayout === "cart-full"',
|
|
64
|
+
source: [
|
|
65
|
+
'buttonLayout'
|
|
66
|
+
],
|
|
67
|
+
action: {
|
|
68
|
+
controlId: 'priceLayout',
|
|
69
|
+
groupType: 'setting',
|
|
70
|
+
controlType: 'setting',
|
|
71
|
+
newValue: 'price-before'
|
|
72
|
+
}
|
|
73
|
+
},
|
|
62
74
|
{
|
|
63
75
|
condition: 'buttonLayout === "cart-price"',
|
|
64
76
|
source: [
|
|
@@ -119,6 +131,18 @@ const SettingUIV2 = [
|
|
|
119
131
|
newValue: false
|
|
120
132
|
}
|
|
121
133
|
},
|
|
134
|
+
{
|
|
135
|
+
condition: 'buttonLayout === "cart-price"',
|
|
136
|
+
source: [
|
|
137
|
+
'buttonLayout'
|
|
138
|
+
],
|
|
139
|
+
action: {
|
|
140
|
+
controlId: 'priceLayout',
|
|
141
|
+
groupType: 'setting',
|
|
142
|
+
controlType: 'setting',
|
|
143
|
+
newValue: 'price-only'
|
|
144
|
+
}
|
|
145
|
+
},
|
|
122
146
|
{
|
|
123
147
|
condition: 'buttonLayout === "cart-only"',
|
|
124
148
|
source: [
|
|
@@ -215,6 +239,18 @@ const SettingUIV2 = [
|
|
|
215
239
|
newValue: false
|
|
216
240
|
}
|
|
217
241
|
},
|
|
242
|
+
{
|
|
243
|
+
condition: 'buttonLayout === "cart-price-icon"',
|
|
244
|
+
source: [
|
|
245
|
+
'buttonLayout'
|
|
246
|
+
],
|
|
247
|
+
action: {
|
|
248
|
+
controlId: 'priceLayout',
|
|
249
|
+
groupType: 'setting',
|
|
250
|
+
controlType: 'setting',
|
|
251
|
+
newValue: 'price-only'
|
|
252
|
+
}
|
|
253
|
+
},
|
|
218
254
|
{
|
|
219
255
|
condition: 'buttonLayout === "cart-icon"',
|
|
220
256
|
source: [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { useLiteVimeoEmbed } from '../hooks/useLiteVimeoEmbed.js';
|
|
4
|
-
import { createStyle, createClass } from '@gem-sdk/system';
|
|
4
|
+
import { createStyle, createClass, If } from '@gem-sdk/system';
|
|
5
5
|
import { getArticleVimeoClasses, getImageVimeoClasses, getButtonVimeoClasses, getIframeVimeoClasses } from './common/getClasses.js';
|
|
6
6
|
import { getIframeVimeoStyle, getArticleVimeoStyle } from './common/getStyle.js';
|
|
7
7
|
import { getVimeoParams } from './common/index.js';
|
|
@@ -25,7 +25,7 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
25
25
|
...getImageVimeoClasses()
|
|
26
26
|
});
|
|
27
27
|
const buttonVimeoClasses = createClass({
|
|
28
|
-
...getButtonVimeoClasses(
|
|
28
|
+
...getButtonVimeoClasses()
|
|
29
29
|
});
|
|
30
30
|
const iframeVimeoClasses = createClass({
|
|
31
31
|
...getIframeVimeoClasses()
|
|
@@ -38,13 +38,13 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
38
38
|
style: articleVimeoStyle,
|
|
39
39
|
onClick: addIframe,
|
|
40
40
|
children: [
|
|
41
|
-
/*#__PURE__*/ jsx(NextImage, {
|
|
41
|
+
If(!iframe, /*#__PURE__*/ jsx(NextImage, {
|
|
42
42
|
src: posterUrl,
|
|
43
43
|
alt: "Poster",
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}),
|
|
47
|
-
/*#__PURE__*/ jsx("button", {
|
|
44
|
+
className: imageVimeoClasses,
|
|
45
|
+
onClick: addIframe
|
|
46
|
+
})),
|
|
47
|
+
If(!iframe, /*#__PURE__*/ jsx("button", {
|
|
48
48
|
type: "button",
|
|
49
49
|
className: buttonVimeoClasses,
|
|
50
50
|
"aria-label": "Play",
|
|
@@ -56,7 +56,7 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
56
56
|
d: "M5 5.274c0-1.707 1.826-2.792 3.325-1.977l12.362 6.726c1.566.853 1.566 3.101 0 3.953L8.325 20.702C6.826 21.518 5 20.432 5 18.726V5.274Z"
|
|
57
57
|
})
|
|
58
58
|
})
|
|
59
|
-
}),
|
|
59
|
+
})),
|
|
60
60
|
iframe && /*#__PURE__*/ jsx("iframe", {
|
|
61
61
|
style: iframeVimeoStyle,
|
|
62
62
|
title: title,
|
|
@@ -7,7 +7,7 @@ import { getVimeoParams } from './common/index.js';
|
|
|
7
7
|
import NextImage from '../../image/components/NextImage.liquid.js';
|
|
8
8
|
|
|
9
9
|
const LiteVimeoEmbed = (props)=>{
|
|
10
|
-
const { title, id, lazy, aspectRatio, autoplay } = props;
|
|
10
|
+
const { title, id, lazy, aspectRatio, autoplay, muted } = props;
|
|
11
11
|
const { iframeSrc } = getVimeoParams(props);
|
|
12
12
|
const iframe = !lazy;
|
|
13
13
|
const posterUrl = props.thumbnail;
|
|
@@ -18,6 +18,7 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
18
18
|
iframeSrc,
|
|
19
19
|
title,
|
|
20
20
|
autoplay,
|
|
21
|
+
muted,
|
|
21
22
|
style: props?.vimeoStyleIframe || ''
|
|
22
23
|
});
|
|
23
24
|
const iframeVimeoStyle = createStyle({
|
|
@@ -33,7 +34,7 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
33
34
|
...getImageVimeoClasses()
|
|
34
35
|
});
|
|
35
36
|
const buttonVimeoClasses = createClass({
|
|
36
|
-
...getButtonVimeoClasses(
|
|
37
|
+
...getButtonVimeoClasses()
|
|
37
38
|
});
|
|
38
39
|
const iframeVimeoClasses = createClass({
|
|
39
40
|
...getIframeVimeoClasses()
|
|
@@ -46,20 +47,21 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
46
47
|
data-title="${title}"
|
|
47
48
|
style="${articleVimeoStyle}"
|
|
48
49
|
>
|
|
49
|
-
|
|
50
|
+
${If(!iframe, template`
|
|
51
|
+
${NextImage({
|
|
50
52
|
src: posterUrl,
|
|
51
53
|
alt: title,
|
|
52
|
-
className: imageVimeoClasses
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
className: imageVimeoClasses
|
|
55
|
+
})}}`)}
|
|
56
|
+
${If(!iframe, template`
|
|
57
|
+
<button type="button" class="${buttonVimeoClasses}" aria-label="Play">
|
|
56
58
|
<svg class="gp-w-5 gp-text-white" viewBox="0 0 24 24">
|
|
57
59
|
<path
|
|
58
60
|
fill="currentColor"
|
|
59
61
|
d="M5 5.274c0-1.707 1.826-2.792 3.325-1.977l12.362 6.726c1.566.853 1.566 3.101 0 3.953L8.325 20.702C6.826 21.518 5 20.432 5 18.726V5.274Z"
|
|
60
62
|
/>
|
|
61
63
|
</svg>
|
|
62
|
-
</button
|
|
64
|
+
</button>`)}
|
|
63
65
|
${If(iframe, template`
|
|
64
66
|
<iframe
|
|
65
67
|
style="${iframeVimeoStyle}"
|
|
@@ -70,15 +70,13 @@ const getVideoYoutubeClasses = (className, offLazyLoad)=>{
|
|
|
70
70
|
};
|
|
71
71
|
};
|
|
72
72
|
const getImageVimeoClasses = ()=>{
|
|
73
|
-
const classList = `gp-
|
|
73
|
+
const classList = `gp-h-full gp-w-full gp-absolute gp-top-0 gp-left-0 gp-z-9`;
|
|
74
74
|
return {
|
|
75
75
|
...composeClasses(classList)
|
|
76
76
|
};
|
|
77
77
|
};
|
|
78
|
-
const getButtonVimeoClasses = (
|
|
79
|
-
|
|
80
|
-
if (lazy) classList += ` gp-visible gp-opacity-100`;
|
|
81
|
-
else classList += ` gp-invisible gp-opacity-0`;
|
|
78
|
+
const getButtonVimeoClasses = ()=>{
|
|
79
|
+
const classList = `gp-absolute gp-left-1/2 gp-top-1/2 gp-flex gp-aspect-[56/32] gp-w-14 -gp-translate-x-1/2 -gp-translate-y-1/2 gp-items-center gp-justify-center gp-rounded gp-bg-black/80 gp-transition-colors hover:gp-bg-[#ef0800] gp-z-10 gp-lite-vimeo-embed-button gp-pointer-events-none`;
|
|
82
80
|
return {
|
|
83
81
|
...composeClasses(classList)
|
|
84
82
|
};
|
|
@@ -91,7 +89,7 @@ const getIframeVimeoClasses = ()=>{
|
|
|
91
89
|
};
|
|
92
90
|
const getButtonYoutubeClasses = (lazy)=>{
|
|
93
91
|
let classList = `gp-absolute gp-left-1/2 gp-top-1/2 gp-w-[68px] -gp-translate-x-1/2 -gp-translate-y-1/2 gp-lite-youtube-embed-button`;
|
|
94
|
-
if (lazy) classList += ` gp-
|
|
92
|
+
if (lazy) classList += ` gp-opacity-0`;
|
|
95
93
|
else classList += ` gp-visible gp-opacity-100`;
|
|
96
94
|
return {
|
|
97
95
|
...composeClasses(classList)
|
|
@@ -48,9 +48,9 @@ const getYoutubeParams = (props)=>{
|
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
50
|
const getVimeoParams = (props)=>{
|
|
51
|
-
const { id, autoplay, muted, controls, loop } = props;
|
|
51
|
+
const { id, autoplay, muted, controls, loop, lazy } = props;
|
|
52
52
|
const videoId = encodeURIComponent(id);
|
|
53
|
-
const params = `?&autoplay=${autoplay ? 1 : 0}` + `&muted=${muted ? 1 : 0}` + `&loop=${loop ? 1 : 0}` + `&controls=${controls}` + '&autopause=false';
|
|
53
|
+
const params = `?&autoplay=${lazy ? 1 : autoplay ? 1 : 0}` + `&muted=${muted ? 1 : 0}` + `&loop=${loop ? 1 : 0}` + `&controls=${controls}` + '&autopause=false';
|
|
54
54
|
const iframeSrc = `https://player.vimeo.com/video/${videoId}${params}`;
|
|
55
55
|
return {
|
|
56
56
|
videoId,
|
|
@@ -137,8 +137,6 @@ const SettingUIV2 = [
|
|
|
137
137
|
id: 'autoplay'
|
|
138
138
|
},
|
|
139
139
|
options: {
|
|
140
|
-
labelVariant: 'primary',
|
|
141
|
-
fullWidth: true,
|
|
142
140
|
disableMessage: `YouTube videos will not autoplay when lazy load is enabled`
|
|
143
141
|
},
|
|
144
142
|
conditionEnable: "type === 'html5' || (type !== 'html5' && lazy != true)"
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2099,6 +2099,7 @@ type ImageComparisonStyle = {
|
|
|
2099
2099
|
labelBorder?: ObjectDevices$1<Border>;
|
|
2100
2100
|
labelRounded?: ObjectDevices$1<CornerRadius>;
|
|
2101
2101
|
labelShadow?: ObjectDevices$1<ShadowProps$1>;
|
|
2102
|
+
wrapperShadow?: ObjectDevices$1<ShadowProps$1>;
|
|
2102
2103
|
align?: ObjectDevices$1<AlignProp>;
|
|
2103
2104
|
typo?: TypographySettingV2;
|
|
2104
2105
|
transform?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.625",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"scan-all-text": "node ./scripts/scan-all-text.js"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@gem-sdk/core": "2.0.0-dev.
|
|
28
|
+
"@gem-sdk/core": "2.0.0-dev.625",
|
|
29
29
|
"@gem-sdk/styles": "2.0.0-dev.571",
|
|
30
30
|
"@gem-sdk/system": "2.0.0-dev.504",
|
|
31
31
|
"@types/react-transition-group": "^4.4.5",
|