@gem-sdk/components 2.0.0-dev.633 → 2.0.0-dev.635
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/common/classes.js +1 -1
- package/dist/cjs/countdown-timer/setting/configs/settings.js +0 -6
- package/dist/cjs/swiper-carousel/root/common/getStyle.js +2 -0
- package/dist/cjs/video/components/LiteVimeoEmbed.js +3 -3
- package/dist/cjs/video/components/LiteVimeoEmbed.liquid.js +3 -4
- package/dist/cjs/video/components/common/getClasses.js +3 -2
- package/dist/cjs/video/components/common/index.js +1 -1
- package/dist/esm/button/components/common/classes.js +1 -1
- package/dist/esm/countdown-timer/setting/configs/settings.js +0 -6
- package/dist/esm/swiper-carousel/root/common/getStyle.js +2 -0
- package/dist/esm/video/components/LiteVimeoEmbed.js +4 -4
- package/dist/esm/video/components/LiteVimeoEmbed.liquid.js +3 -4
- package/dist/esm/video/components/common/getClasses.js +3 -2
- package/dist/esm/video/components/common/index.js +1 -1
- package/package.json +1 -1
|
@@ -37,7 +37,7 @@ const getButtonContentWrapperClasses = (setting)=>{
|
|
|
37
37
|
};
|
|
38
38
|
const getButtonLabelClasses = (styles, isEditable)=>{
|
|
39
39
|
return {
|
|
40
|
-
'gp-content-product-button gp-relative gp-flex gp-h-full gp-items-center gp-overflow-hidden gp-break-words group-data-[state=loading]:gp-invisible [&_p]:gp-whitespace-pre-line': true,
|
|
40
|
+
'gp-content-product-button group-active/button:!gp-text-inherit gp-relative gp-flex gp-h-full gp-items-center gp-overflow-hidden gp-break-words group-data-[state=loading]:gp-invisible [&_p]:gp-whitespace-pre-line': true,
|
|
41
41
|
'[&:not(:has(p))]:gp-pr-[0.2em] [&_p]:[&:has(p)]:gp-pr-[0.2em]': styles?.typo?.attrs?.italic,
|
|
42
42
|
'gp-text button-text': isEditable
|
|
43
43
|
};
|
|
@@ -29,7 +29,7 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
29
29
|
...getClasses.getImageVimeoClasses(iframe)
|
|
30
30
|
});
|
|
31
31
|
const buttonVimeoClasses = system.createClass({
|
|
32
|
-
...getClasses.getButtonVimeoClasses()
|
|
32
|
+
...getClasses.getButtonVimeoClasses(iframe)
|
|
33
33
|
});
|
|
34
34
|
const iframeVimeoClasses = system.createClass({
|
|
35
35
|
...getClasses.getIframeVimeoClasses()
|
|
@@ -48,7 +48,7 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
48
48
|
className: imageVimeoClasses,
|
|
49
49
|
onClick: addIframe
|
|
50
50
|
}),
|
|
51
|
-
|
|
51
|
+
/*#__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,
|
|
@@ -38,7 +38,7 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
38
38
|
...getClasses.getImageVimeoClasses(iframe)
|
|
39
39
|
});
|
|
40
40
|
const buttonVimeoClasses = system.createClass({
|
|
41
|
-
...getClasses.getButtonVimeoClasses()
|
|
41
|
+
...getClasses.getButtonVimeoClasses(iframe)
|
|
42
42
|
});
|
|
43
43
|
const iframeVimeoClasses = system.createClass({
|
|
44
44
|
...getClasses.getIframeVimeoClasses()
|
|
@@ -51,14 +51,13 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
51
51
|
data-title="${title}"
|
|
52
52
|
style="${articleVimeoStyle}"
|
|
53
53
|
>
|
|
54
|
-
${
|
|
55
|
-
${NextImage_liquid.default({
|
|
54
|
+
${NextImage_liquid.default({
|
|
56
55
|
src: posterUrl,
|
|
57
56
|
alt: title,
|
|
58
57
|
className: imageVimeoClasses,
|
|
59
58
|
enableLazyLoadImage: true,
|
|
60
59
|
priority: preload
|
|
61
|
-
})}
|
|
60
|
+
})}
|
|
62
61
|
${system.If(!iframe, core.template`
|
|
63
62
|
<button type="button" class="${buttonVimeoClasses}" aria-label="Play">
|
|
64
63
|
<svg class="gp-w-5 gp-text-white" viewBox="0 0 24 24">
|
|
@@ -78,8 +78,9 @@ const getImageVimeoClasses = (iframe)=>{
|
|
|
78
78
|
...composeClasses(classList)
|
|
79
79
|
};
|
|
80
80
|
};
|
|
81
|
-
const getButtonVimeoClasses = ()=>{
|
|
82
|
-
|
|
81
|
+
const getButtonVimeoClasses = (iframe)=>{
|
|
82
|
+
let 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`;
|
|
83
|
+
if (iframe) classList += ` gp-invisible gp-opacity-0`;
|
|
83
84
|
return {
|
|
84
85
|
...composeClasses(classList)
|
|
85
86
|
};
|
|
@@ -52,7 +52,7 @@ const getYoutubeParams = (props)=>{
|
|
|
52
52
|
const getVimeoParams = (props)=>{
|
|
53
53
|
const { id, autoplay, muted, controls, loop, lazy } = props;
|
|
54
54
|
const videoId = encodeURIComponent(id);
|
|
55
|
-
const params = `?&autoplay=${lazy ? 1 : autoplay ? 1 : 0}` + `&muted=${muted ? 1 : 0}` + `&loop=${loop ? 1 : 0}` + `&controls=${controls}` + `&background=${lazy ? 1 : 0}` + '&autopause=false';
|
|
55
|
+
const params = `?&autoplay=${lazy ? 1 : autoplay ? 1 : 0}` + `&muted=${muted ? 1 : 0}` + `&loop=${loop ? 1 : 0}` + `&controls=${controls}` + `&background=${lazy ? 1 : autoplay ? 1 : 0}` + '&autopause=false';
|
|
56
56
|
const iframeSrc = `https://player.vimeo.com/video/${videoId}${params}`;
|
|
57
57
|
return {
|
|
58
58
|
videoId,
|
|
@@ -35,7 +35,7 @@ const getButtonContentWrapperClasses = (setting)=>{
|
|
|
35
35
|
};
|
|
36
36
|
const getButtonLabelClasses = (styles, isEditable)=>{
|
|
37
37
|
return {
|
|
38
|
-
'gp-content-product-button gp-relative gp-flex gp-h-full gp-items-center gp-overflow-hidden gp-break-words group-data-[state=loading]:gp-invisible [&_p]:gp-whitespace-pre-line': true,
|
|
38
|
+
'gp-content-product-button group-active/button:!gp-text-inherit gp-relative gp-flex gp-h-full gp-items-center gp-overflow-hidden gp-break-words group-data-[state=loading]:gp-invisible [&_p]:gp-whitespace-pre-line': true,
|
|
39
39
|
'[&:not(:has(p))]:gp-pr-[0.2em] [&_p]:[&:has(p)]:gp-pr-[0.2em]': styles?.typo?.attrs?.italic,
|
|
40
40
|
'gp-text button-text': isEditable
|
|
41
41
|
};
|
|
@@ -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
|
|
4
|
+
import { createStyle, createClass } 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(iframe)
|
|
26
26
|
});
|
|
27
27
|
const buttonVimeoClasses = createClass({
|
|
28
|
-
...getButtonVimeoClasses()
|
|
28
|
+
...getButtonVimeoClasses(iframe)
|
|
29
29
|
});
|
|
30
30
|
const iframeVimeoClasses = createClass({
|
|
31
31
|
...getIframeVimeoClasses()
|
|
@@ -44,7 +44,7 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
44
44
|
className: imageVimeoClasses,
|
|
45
45
|
onClick: addIframe
|
|
46
46
|
}),
|
|
47
|
-
|
|
47
|
+
/*#__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,
|
|
@@ -34,7 +34,7 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
34
34
|
...getImageVimeoClasses(iframe)
|
|
35
35
|
});
|
|
36
36
|
const buttonVimeoClasses = createClass({
|
|
37
|
-
...getButtonVimeoClasses()
|
|
37
|
+
...getButtonVimeoClasses(iframe)
|
|
38
38
|
});
|
|
39
39
|
const iframeVimeoClasses = createClass({
|
|
40
40
|
...getIframeVimeoClasses()
|
|
@@ -47,14 +47,13 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
47
47
|
data-title="${title}"
|
|
48
48
|
style="${articleVimeoStyle}"
|
|
49
49
|
>
|
|
50
|
-
${
|
|
51
|
-
${NextImage({
|
|
50
|
+
${NextImage({
|
|
52
51
|
src: posterUrl,
|
|
53
52
|
alt: title,
|
|
54
53
|
className: imageVimeoClasses,
|
|
55
54
|
enableLazyLoadImage: true,
|
|
56
55
|
priority: preload
|
|
57
|
-
})}
|
|
56
|
+
})}
|
|
58
57
|
${If(!iframe, template`
|
|
59
58
|
<button type="button" class="${buttonVimeoClasses}" aria-label="Play">
|
|
60
59
|
<svg class="gp-w-5 gp-text-white" viewBox="0 0 24 24">
|
|
@@ -76,8 +76,9 @@ const getImageVimeoClasses = (iframe)=>{
|
|
|
76
76
|
...composeClasses(classList)
|
|
77
77
|
};
|
|
78
78
|
};
|
|
79
|
-
const getButtonVimeoClasses = ()=>{
|
|
80
|
-
|
|
79
|
+
const getButtonVimeoClasses = (iframe)=>{
|
|
80
|
+
let 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`;
|
|
81
|
+
if (iframe) classList += ` gp-invisible gp-opacity-0`;
|
|
81
82
|
return {
|
|
82
83
|
...composeClasses(classList)
|
|
83
84
|
};
|
|
@@ -50,7 +50,7 @@ const getYoutubeParams = (props)=>{
|
|
|
50
50
|
const getVimeoParams = (props)=>{
|
|
51
51
|
const { id, autoplay, muted, controls, loop, lazy } = props;
|
|
52
52
|
const videoId = encodeURIComponent(id);
|
|
53
|
-
const params = `?&autoplay=${lazy ? 1 : autoplay ? 1 : 0}` + `&muted=${muted ? 1 : 0}` + `&loop=${loop ? 1 : 0}` + `&controls=${controls}` + `&background=${lazy ? 1 : 0}` + '&autopause=false';
|
|
53
|
+
const params = `?&autoplay=${lazy ? 1 : autoplay ? 1 : 0}` + `&muted=${muted ? 1 : 0}` + `&loop=${loop ? 1 : 0}` + `&controls=${controls}` + `&background=${lazy ? 1 : autoplay ? 1 : 0}` + '&autopause=false';
|
|
54
54
|
const iframeSrc = `https://player.vimeo.com/video/${videoId}${params}`;
|
|
55
55
|
return {
|
|
56
56
|
videoId,
|