@gem-sdk/components 2.1.24 → 2.1.25
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/product/components/ProductImagesV2/jsx/ProductImages.js +1 -5
- package/dist/cjs/product/components/ProductImagesV2/jsx/components/ProductFeatureVideo.js +34 -0
- package/dist/cjs/product/components/ProductImagesV2/jsx/components/ProductFeaturedImageOnly.js +81 -51
- package/dist/cjs/product/components/ProductImagesV2/jsx/components/ProductGalleryCarousel.js +3 -1
- package/dist/cjs/product/components/ProductImagesV2/jsx/components/ProductGalleryGrid.js +3 -2
- package/dist/cjs/product/components/ProductImagesV2/jsx/components/ProductImagesLightBox.js +29 -11
- package/dist/cjs/third-party/components/ProductOptionsVariantOption.js +2 -2
- package/dist/cjs/third-party/components/ProductOptionsVariantOption.liquid.js +2 -2
- package/dist/cjs/third-party/setting/ProductOptionsVariantOption.js +1 -10
- package/dist/cjs/video/components/Video.js +1 -1
- package/dist/esm/product/components/ProductImagesV2/jsx/ProductImages.js +1 -5
- package/dist/esm/product/components/ProductImagesV2/jsx/components/ProductFeatureVideo.js +30 -0
- package/dist/esm/product/components/ProductImagesV2/jsx/components/ProductFeaturedImageOnly.js +82 -52
- package/dist/esm/product/components/ProductImagesV2/jsx/components/ProductGalleryCarousel.js +3 -1
- package/dist/esm/product/components/ProductImagesV2/jsx/components/ProductGalleryGrid.js +3 -2
- package/dist/esm/product/components/ProductImagesV2/jsx/components/ProductImagesLightBox.js +31 -13
- package/dist/esm/third-party/components/ProductOptionsVariantOption.js +2 -2
- package/dist/esm/third-party/components/ProductOptionsVariantOption.liquid.js +2 -2
- package/dist/esm/third-party/setting/ProductOptionsVariantOption.js +1 -10
- package/dist/esm/video/components/Video.js +2 -2
- package/package.json +1 -1
|
@@ -11,7 +11,6 @@ var GalleryOneCol = require('./layouts/GalleryOneCol.js');
|
|
|
11
11
|
var GalleryTwoCol = require('./layouts/GalleryTwoCol.js');
|
|
12
12
|
var OnlyFeatureImage = require('./layouts/OnlyFeatureImage.js');
|
|
13
13
|
var ProductImagesLightBox = require('./components/ProductImagesLightBox.js');
|
|
14
|
-
var productFeaturedImage = require('../common/productFeaturedImage.js');
|
|
15
14
|
|
|
16
15
|
const getProductGallery = (product)=>{
|
|
17
16
|
return product?.medias?.edges.map((img)=>{
|
|
@@ -82,10 +81,7 @@ const ProductImagesV2 = (productImageProps)=>{
|
|
|
82
81
|
currentVariant?.media
|
|
83
82
|
]);
|
|
84
83
|
const gallery = React.useMemo(()=>{
|
|
85
|
-
const images = getProductGallery(product)
|
|
86
|
-
if (item) item.src = productFeaturedImage.isFeatureMedia(item.contentType) ? item?.previewImage : item.src;
|
|
87
|
-
return item;
|
|
88
|
-
});
|
|
84
|
+
const images = getProductGallery(product);
|
|
89
85
|
if (!images?.length) return [
|
|
90
86
|
{
|
|
91
87
|
id: product?.featuredImage?.id || 'noImageError',
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var Video = require('../../../../../video/components/Video.js');
|
|
8
|
+
|
|
9
|
+
const ProductFeatureVideo = (props)=>{
|
|
10
|
+
const { url, aspectRatio } = props;
|
|
11
|
+
const videoType = React.useMemo(()=>{
|
|
12
|
+
if (url.includes('youtu.be')) return 'youtube';
|
|
13
|
+
if (url.includes('vimeo')) return 'vimeo';
|
|
14
|
+
return 'html5';
|
|
15
|
+
}, [
|
|
16
|
+
url
|
|
17
|
+
]);
|
|
18
|
+
return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
19
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(Video.default, {
|
|
20
|
+
setting: {
|
|
21
|
+
type: videoType,
|
|
22
|
+
html5Url: url,
|
|
23
|
+
youtubeUrl: url,
|
|
24
|
+
vimeoUrl: url,
|
|
25
|
+
preload: true,
|
|
26
|
+
controls: true,
|
|
27
|
+
aspectRatio
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
var ProductFeatureVideo$1 = /*#__PURE__*/ React.memo(ProductFeatureVideo);
|
|
33
|
+
|
|
34
|
+
exports.default = ProductFeatureVideo$1;
|
package/dist/cjs/product/components/ProductImagesV2/jsx/components/ProductFeaturedImageOnly.js
CHANGED
|
@@ -8,6 +8,7 @@ var React = require('react');
|
|
|
8
8
|
var NextImage = require('../../../../../image/components/NextImage.js');
|
|
9
9
|
var MediaIcon = require('./MediaIcon.js');
|
|
10
10
|
var productFeaturedImage = require('../../common/productFeaturedImage.js');
|
|
11
|
+
var ProductFeatureVideo = require('./ProductFeatureVideo.js');
|
|
11
12
|
|
|
12
13
|
const defaultImage = {
|
|
13
14
|
src: 'https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif',
|
|
@@ -21,14 +22,28 @@ const ProductFeaturedImageOnly = ({ image, imageShowWhenHover, setting, aspectRa
|
|
|
21
22
|
const product = core.useProduct();
|
|
22
23
|
const currentDevice = core.useCurrentDevice();
|
|
23
24
|
const storefrontUrl = core.useShopStore((state)=>state.storefrontUrl);
|
|
25
|
+
const mode = core.useEditorMode();
|
|
26
|
+
const isClickEffect = React.useMemo(()=>core.getResponsiveValueByScreen(setting.ftClickOpenLightBox, currentDevice) !== 'none', [
|
|
27
|
+
currentDevice,
|
|
28
|
+
setting.ftClickOpenLightBox
|
|
29
|
+
]);
|
|
30
|
+
const isRenderVideo = React.useMemo(()=>mode !== 'edit' && [
|
|
31
|
+
'VIDEO',
|
|
32
|
+
'EXTERNAL_VIDEO'
|
|
33
|
+
].includes(image?.contentType || '') && !isClickEffect, [
|
|
34
|
+
mode,
|
|
35
|
+
image?.contentType,
|
|
36
|
+
isClickEffect
|
|
37
|
+
]);
|
|
24
38
|
const renderImage = React.useMemo(()=>{
|
|
25
39
|
if (!image) return defaultImage;
|
|
26
40
|
return {
|
|
27
41
|
...image,
|
|
28
|
-
src: productFeaturedImage.isFeatureMedia(image?.contentType) ? image?.previewImage : image.src
|
|
42
|
+
src: isRenderVideo ? image.src : productFeaturedImage.isFeatureMedia(image?.contentType) ? image?.previewImage : image.src
|
|
29
43
|
};
|
|
30
44
|
}, [
|
|
31
|
-
image
|
|
45
|
+
image,
|
|
46
|
+
isRenderVideo
|
|
32
47
|
]);
|
|
33
48
|
const shopifyProductLink = React.useMemo(()=>{
|
|
34
49
|
if (!storefrontUrl) return `#`;
|
|
@@ -50,56 +65,71 @@ const ProductFeaturedImageOnly = ({ image, imageShowWhenHover, setting, aspectRa
|
|
|
50
65
|
});
|
|
51
66
|
return children;
|
|
52
67
|
};
|
|
68
|
+
const isRenderHoverImage = React.useMemo(()=>setting?.hoverEffect !== 'none' && !productFeaturedImage.isFeatureMedia(renderImage?.contentType), [
|
|
69
|
+
renderImage?.contentType,
|
|
70
|
+
setting?.hoverEffect
|
|
71
|
+
]);
|
|
72
|
+
const isZoomImage = React.useMemo(()=>setting?.hoverEffect == 'zoom' && setting?.zoomType == 'glasses' && !productFeaturedImage.isFeatureMedia(renderImage?.contentType), [
|
|
73
|
+
renderImage?.contentType,
|
|
74
|
+
setting?.hoverEffect,
|
|
75
|
+
setting?.zoomType
|
|
76
|
+
]);
|
|
53
77
|
return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
54
|
-
children: handleProductLink(/*#__PURE__*/ jsxRuntime.
|
|
55
|
-
children:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
78
|
+
children: handleProductLink(/*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
79
|
+
children: isRenderVideo ? /*#__PURE__*/ jsxRuntime.jsx(ProductFeatureVideo.default, {
|
|
80
|
+
type: renderImage?.contentType,
|
|
81
|
+
url: renderImage.src ?? '',
|
|
82
|
+
aspectRatio: aspectRatio
|
|
83
|
+
}) : /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
84
|
+
children: [
|
|
85
|
+
/*#__PURE__*/ jsxRuntime.jsx(NextImage.default, {
|
|
86
|
+
draggable: "false",
|
|
87
|
+
src: renderImage.src,
|
|
88
|
+
width: renderImage?.width,
|
|
89
|
+
height: renderImage?.height,
|
|
90
|
+
alt: renderImage?.alt,
|
|
91
|
+
setting: {
|
|
92
|
+
aspectRatio: aspectRatio,
|
|
93
|
+
layout: setting?.ftLayout
|
|
94
|
+
},
|
|
95
|
+
priority: setting?.preload,
|
|
96
|
+
className: "featured-image-only",
|
|
97
|
+
style: {
|
|
98
|
+
width: '100%',
|
|
99
|
+
height: '100%',
|
|
100
|
+
cursor: 'pointer'
|
|
101
|
+
}
|
|
102
|
+
}),
|
|
103
|
+
/*#__PURE__*/ jsxRuntime.jsx(MediaIcon.default, {
|
|
104
|
+
contentType: renderImage?.contentType ?? ''
|
|
105
|
+
}),
|
|
106
|
+
isRenderHoverImage && /*#__PURE__*/ jsxRuntime.jsx(NextImage.default, {
|
|
107
|
+
draggable: "false",
|
|
108
|
+
src: setting?.hoverEffect === 'other' ? imageShowWhenHover?.src : renderImage.src,
|
|
109
|
+
width: setting?.hoverEffect === 'other' ? imageShowWhenHover?.width : renderImage.width,
|
|
110
|
+
height: setting?.hoverEffect === 'other' ? imageShowWhenHover?.height : renderImage.height,
|
|
111
|
+
alt: setting?.hoverEffect === 'other' ? imageShowWhenHover?.alt : renderImage.alt,
|
|
112
|
+
setting: {
|
|
113
|
+
layout: setting.ftLayout,
|
|
114
|
+
aspectRatio: aspectRatio
|
|
115
|
+
},
|
|
116
|
+
style: {
|
|
117
|
+
width: '100%',
|
|
118
|
+
height: '100%'
|
|
119
|
+
},
|
|
120
|
+
className: core.cls('hover-image featured-image-only !gp-max-w-none', productFeaturedImage.getZoomImageClass()),
|
|
121
|
+
priority: setting?.preload
|
|
122
|
+
}),
|
|
123
|
+
isZoomImage && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
124
|
+
className: core.cls(productFeaturedImage.getZoomLenClass(), 'room-len'),
|
|
125
|
+
style: {
|
|
126
|
+
...core.makeStyle({
|
|
127
|
+
bgi: `url("${renderImage?.src}")`
|
|
128
|
+
})
|
|
129
|
+
}
|
|
130
|
+
})
|
|
131
|
+
]
|
|
132
|
+
})
|
|
103
133
|
}))
|
|
104
134
|
});
|
|
105
135
|
};
|
package/dist/cjs/product/components/ProductImagesV2/jsx/components/ProductGalleryCarousel.js
CHANGED
|
@@ -13,6 +13,7 @@ var productGallery = require('../../common/productGallery.js');
|
|
|
13
13
|
var ButtonOpenLightBox = require('./ButtonOpenLightBox.js');
|
|
14
14
|
var MediaIcon = require('./MediaIcon.js');
|
|
15
15
|
var getSrcSet = require('../../../../../image/helpers/getSrcSet.js');
|
|
16
|
+
var productFeaturedImage = require('../../common/productFeaturedImage.js');
|
|
16
17
|
|
|
17
18
|
const ProductGalleryCarousel = ({ builderPropUID, productImages, onHandleClick, activeIndexFormFeatureImage, onClickFeatureArrow, builderPropsClass, arrow, priorityFeatureImage, ...setting })=>{
|
|
18
19
|
const currentDevice = core.useCurrentDevice();
|
|
@@ -247,6 +248,7 @@ const ProductGalleryCarousel = ({ builderPropUID, productImages, onHandleClick,
|
|
|
247
248
|
disableMarginAuto: true,
|
|
248
249
|
children: productImages?.map((image, index)=>{
|
|
249
250
|
const canActive = index === moveToIdx;
|
|
251
|
+
const imageSrc = productFeaturedImage.isFeatureMedia(image.contentType) ? image.previewImage : image.src;
|
|
250
252
|
return /*#__PURE__*/ jsxRuntime.jsxs(CarouselItem.default, {
|
|
251
253
|
contentType: "productImage",
|
|
252
254
|
className: core.cls(`gem-slider-item gem-slider-item-${builderPropUID} gp-gallery-image-item gp-group gp-flex gp-w-full gp-items-center gp-justify-center gp-overflow-hidden gp-outline-1 -gp-outline-offset-1 data-[border=deactive]:after:!gp-border-transparent`, {
|
|
@@ -270,7 +272,7 @@ const ProductGalleryCarousel = ({ builderPropUID, productImages, onHandleClick,
|
|
|
270
272
|
children: [
|
|
271
273
|
/*#__PURE__*/ jsxRuntime.jsx(NextImage.default, {
|
|
272
274
|
draggable: "false",
|
|
273
|
-
src:
|
|
275
|
+
src: imageSrc,
|
|
274
276
|
width: image?.width,
|
|
275
277
|
height: image?.height,
|
|
276
278
|
alt: image?.alt,
|
|
@@ -124,6 +124,7 @@ const ProductGalleryGrid = ({ builderPropUID, productImages, onHandleClick, acti
|
|
|
124
124
|
children: [
|
|
125
125
|
productImages?.map((image, index)=>{
|
|
126
126
|
const canActive = index === imageActiveIndex;
|
|
127
|
+
const imageSrc = productFeaturedImage.isFeatureMedia(image.contentType) ? image.previewImage : image.src;
|
|
127
128
|
return(// eslint-disable-next-line jsx-a11y/mouse-events-have-key-events
|
|
128
129
|
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
129
130
|
"aria-hidden": true,
|
|
@@ -149,7 +150,7 @@ const ProductGalleryGrid = ({ builderPropUID, productImages, onHandleClick, acti
|
|
|
149
150
|
"data-border": canActive && !!setting?.borderActive ? 'active' : 'deactive',
|
|
150
151
|
children: [
|
|
151
152
|
/*#__PURE__*/ jsxRuntime.jsx(NextImage.default, {
|
|
152
|
-
src:
|
|
153
|
+
src: imageSrc,
|
|
153
154
|
width: image?.width,
|
|
154
155
|
height: image?.height,
|
|
155
156
|
alt: image?.alt,
|
|
@@ -166,7 +167,7 @@ const ProductGalleryGrid = ({ builderPropUID, productImages, onHandleClick, acti
|
|
|
166
167
|
contentType: image?.contentType || ''
|
|
167
168
|
}),
|
|
168
169
|
setting?.galleryHoverEffect !== 'none' && !productFeaturedImage.isFeatureMedia(image?.contentType) && /*#__PURE__*/ jsxRuntime.jsx(NextImage.default, {
|
|
169
|
-
src:
|
|
170
|
+
src: imageSrc,
|
|
170
171
|
width: image?.width,
|
|
171
172
|
height: image?.height,
|
|
172
173
|
alt: image?.alt,
|
|
@@ -11,6 +11,8 @@ require('../../../../../modal/components/confirm.js');
|
|
|
11
11
|
var Modal = require('../../../../../modal/components/Modal.js');
|
|
12
12
|
var React = require('react');
|
|
13
13
|
var productFeaturedImage = require('../../common/productFeaturedImage.js');
|
|
14
|
+
var ProductFeatureVideo = require('./ProductFeatureVideo.js');
|
|
15
|
+
var MediaIcon = require('./MediaIcon.js');
|
|
14
16
|
|
|
15
17
|
const ProductImagesLightBox = ({ builderPropUID, productImages, open, imageRatio, onHandleClose })=>{
|
|
16
18
|
const featuredImageGlobal = core.useFeaturedImageGlobal();
|
|
@@ -31,6 +33,11 @@ const ProductImagesLightBox = ({ builderPropUID, productImages, open, imageRatio
|
|
|
31
33
|
mobile: false,
|
|
32
34
|
tablet: false
|
|
33
35
|
};
|
|
36
|
+
const mode = core.useEditorMode();
|
|
37
|
+
const isRenderVideo = (image)=>mode !== 'edit' && [
|
|
38
|
+
'VIDEO',
|
|
39
|
+
'EXTERNAL_VIDEO'
|
|
40
|
+
].includes(image?.contentType || '');
|
|
34
41
|
return /*#__PURE__*/ jsxRuntime.jsx(Modal.default, {
|
|
35
42
|
setting: {
|
|
36
43
|
open: open
|
|
@@ -106,17 +113,28 @@ const ProductImagesLightBox = ({ builderPropUID, productImages, open, imageRatio
|
|
|
106
113
|
fullHeight: true,
|
|
107
114
|
children: productImages?.map((image)=>/*#__PURE__*/ jsxRuntime.jsx(CarouselItem.default, {
|
|
108
115
|
className: `gem-slider-item gem-slider-item-${builderPropUID} gp-flex gp-items-center gp-justify-center gp-px-4`,
|
|
109
|
-
children: /*#__PURE__*/ jsxRuntime.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
116
|
+
children: !isRenderVideo(image) ? /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
117
|
+
children: [
|
|
118
|
+
/*#__PURE__*/ jsxRuntime.jsx(NextImage.default, {
|
|
119
|
+
src: productFeaturedImage.isFeatureMedia(image?.contentType) ? image?.previewImage : image?.src,
|
|
120
|
+
width: image?.width,
|
|
121
|
+
height: image?.height,
|
|
122
|
+
alt: image?.alt,
|
|
123
|
+
"content-type": image?.contentType,
|
|
124
|
+
setting: {
|
|
125
|
+
aspectRatio: imageRatio
|
|
126
|
+
},
|
|
127
|
+
className: core.cls('gp-h-full gp-w-full gp-object-contain')
|
|
128
|
+
}, image?.id),
|
|
129
|
+
/*#__PURE__*/ jsxRuntime.jsx(MediaIcon.default, {
|
|
130
|
+
contentType: image?.contentType ?? ''
|
|
131
|
+
})
|
|
132
|
+
]
|
|
133
|
+
}) : /*#__PURE__*/ jsxRuntime.jsx(ProductFeatureVideo.default, {
|
|
134
|
+
type: image?.contentType,
|
|
135
|
+
url: image.src ?? '',
|
|
136
|
+
aspectRatio: imageRatio
|
|
137
|
+
})
|
|
120
138
|
}, image?.id))
|
|
121
139
|
})
|
|
122
140
|
});
|
|
@@ -8,7 +8,7 @@ var ThirdPartyPreview = require('./ThirdPartyPreview.js');
|
|
|
8
8
|
|
|
9
9
|
const AppConfig = {
|
|
10
10
|
id: 'product-options-variant-option',
|
|
11
|
-
label: 'Product Options
|
|
11
|
+
label: 'Avis Product Options, Variants',
|
|
12
12
|
logoUrl: 'https://cdn.shopify.com/app-store/listing_images/5ee1f244b087cfbec9b19c8b3f62c8f6/icon/CMCq1s7J5vQCEAE=.png',
|
|
13
13
|
tag: 'ProductOptionsVariantOption'
|
|
14
14
|
};
|
|
@@ -18,7 +18,7 @@ const ProductOptionsVariantOptionContent = ()=>{
|
|
|
18
18
|
className: "gp-p-2",
|
|
19
19
|
children: /*#__PURE__*/ jsxRuntime.jsx(ThirdPartyPreview.default, {
|
|
20
20
|
setting: {
|
|
21
|
-
label: 'Product Options
|
|
21
|
+
label: 'Avis Product Options, Variants',
|
|
22
22
|
iconSvg: `<img class="gp-w-6 gp-border gp-border-[#494949] gp-rounded-[3px]" src="${AppConfig.logoUrl}">`
|
|
23
23
|
}
|
|
24
24
|
})
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var core = require('@gem-sdk/core');
|
|
6
6
|
|
|
7
7
|
const ProductOptionsVariantOption = ({ setting, advanced })=>{
|
|
8
|
-
const { align
|
|
8
|
+
const { align } = setting ?? {};
|
|
9
9
|
return core.template`
|
|
10
10
|
<div
|
|
11
11
|
class="${advanced?.cssClass}"
|
|
@@ -13,7 +13,7 @@ const ProductOptionsVariantOption = ({ setting, advanced })=>{
|
|
|
13
13
|
...core.makeStyleResponsive('ta', align)
|
|
14
14
|
}}"
|
|
15
15
|
>
|
|
16
|
-
<div class="
|
|
16
|
+
<div class="avpoptions-container__v2"></div>
|
|
17
17
|
</div>
|
|
18
18
|
`;
|
|
19
19
|
};
|
|
@@ -28,7 +28,7 @@ const config = {
|
|
|
28
28
|
icon: {
|
|
29
29
|
desktop: `<div class="w-full flex flex-col items-center">
|
|
30
30
|
<img class="w-24 border border-dark-200 rounded-medium" src="https://cdn.shopify.com/app-store/listing_images/5ee1f244b087cfbec9b19c8b3f62c8f6/icon/CMCq1s7J5vQCEAE=.png">
|
|
31
|
-
<span class="preset-item-title">Product Options
|
|
31
|
+
<span class="preset-item-title">Avis Product Options, Variants</span>
|
|
32
32
|
</div>`
|
|
33
33
|
},
|
|
34
34
|
components: [
|
|
@@ -107,15 +107,6 @@ const config = {
|
|
|
107
107
|
id: 'openApp'
|
|
108
108
|
}
|
|
109
109
|
},
|
|
110
|
-
{
|
|
111
|
-
type: 'control',
|
|
112
|
-
setting: {
|
|
113
|
-
id: 'idTrigger'
|
|
114
|
-
},
|
|
115
|
-
label: {
|
|
116
|
-
en: 'ID Element'
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
110
|
{
|
|
120
111
|
type: 'control',
|
|
121
112
|
label: {
|
|
@@ -49,7 +49,7 @@ const Video = ({ className, setting, style, builderAttrs, builderProps, children
|
|
|
49
49
|
case 'vimeo':
|
|
50
50
|
{
|
|
51
51
|
const videoId = common.getVimeoVideoId(vimeoUrl);
|
|
52
|
-
if (!
|
|
52
|
+
if (!videoId) return undefined;
|
|
53
53
|
return /*#__PURE__*/ jsxRuntime.jsx(LiteVimeoEmbed, {
|
|
54
54
|
muted: !mute,
|
|
55
55
|
loop: loopVideo,
|
|
@@ -7,7 +7,6 @@ import GalleryOneCol from './layouts/GalleryOneCol.js';
|
|
|
7
7
|
import GalleryTwoCol from './layouts/GalleryTwoCol.js';
|
|
8
8
|
import OnlyFeatureImage from './layouts/OnlyFeatureImage.js';
|
|
9
9
|
import ProductImagesLightBox from './components/ProductImagesLightBox.js';
|
|
10
|
-
import { isFeatureMedia } from '../common/productFeaturedImage.js';
|
|
11
10
|
|
|
12
11
|
const getProductGallery = (product)=>{
|
|
13
12
|
return product?.medias?.edges.map((img)=>{
|
|
@@ -78,10 +77,7 @@ const ProductImagesV2 = (productImageProps)=>{
|
|
|
78
77
|
currentVariant?.media
|
|
79
78
|
]);
|
|
80
79
|
const gallery = useMemo(()=>{
|
|
81
|
-
const images = getProductGallery(product)
|
|
82
|
-
if (item) item.src = isFeatureMedia(item.contentType) ? item?.previewImage : item.src;
|
|
83
|
-
return item;
|
|
84
|
-
});
|
|
80
|
+
const images = getProductGallery(product);
|
|
85
81
|
if (!images?.length) return [
|
|
86
82
|
{
|
|
87
83
|
id: product?.featuredImage?.id || 'noImageError',
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { memo, useMemo } from 'react';
|
|
3
|
+
import Video from '../../../../../video/components/Video.js';
|
|
4
|
+
|
|
5
|
+
const ProductFeatureVideo = (props)=>{
|
|
6
|
+
const { url, aspectRatio } = props;
|
|
7
|
+
const videoType = useMemo(()=>{
|
|
8
|
+
if (url.includes('youtu.be')) return 'youtube';
|
|
9
|
+
if (url.includes('vimeo')) return 'vimeo';
|
|
10
|
+
return 'html5';
|
|
11
|
+
}, [
|
|
12
|
+
url
|
|
13
|
+
]);
|
|
14
|
+
return /*#__PURE__*/ jsx(Fragment, {
|
|
15
|
+
children: /*#__PURE__*/ jsx(Video, {
|
|
16
|
+
setting: {
|
|
17
|
+
type: videoType,
|
|
18
|
+
html5Url: url,
|
|
19
|
+
youtubeUrl: url,
|
|
20
|
+
vimeoUrl: url,
|
|
21
|
+
preload: true,
|
|
22
|
+
controls: true,
|
|
23
|
+
aspectRatio
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
var ProductFeatureVideo$1 = /*#__PURE__*/ memo(ProductFeatureVideo);
|
|
29
|
+
|
|
30
|
+
export { ProductFeatureVideo$1 as default };
|
package/dist/esm/product/components/ProductImagesV2/jsx/components/ProductFeaturedImageOnly.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { useProduct, useCurrentDevice, useShopStore, cls, makeStyle
|
|
2
|
+
import { useProduct, useCurrentDevice, useShopStore, useEditorMode, getResponsiveValueByScreen, cls, makeStyle } from '@gem-sdk/core';
|
|
3
3
|
import { memo, useMemo } from 'react';
|
|
4
4
|
import NextImage from '../../../../../image/components/NextImage.js';
|
|
5
5
|
import MediaIcon from './MediaIcon.js';
|
|
6
6
|
import { isFeatureMedia, getZoomImageClass, getZoomLenClass } from '../../common/productFeaturedImage.js';
|
|
7
|
+
import ProductFeatureVideo from './ProductFeatureVideo.js';
|
|
7
8
|
|
|
8
9
|
const defaultImage = {
|
|
9
10
|
src: 'https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif',
|
|
@@ -17,14 +18,28 @@ const ProductFeaturedImageOnly = ({ image, imageShowWhenHover, setting, aspectRa
|
|
|
17
18
|
const product = useProduct();
|
|
18
19
|
const currentDevice = useCurrentDevice();
|
|
19
20
|
const storefrontUrl = useShopStore((state)=>state.storefrontUrl);
|
|
21
|
+
const mode = useEditorMode();
|
|
22
|
+
const isClickEffect = useMemo(()=>getResponsiveValueByScreen(setting.ftClickOpenLightBox, currentDevice) !== 'none', [
|
|
23
|
+
currentDevice,
|
|
24
|
+
setting.ftClickOpenLightBox
|
|
25
|
+
]);
|
|
26
|
+
const isRenderVideo = useMemo(()=>mode !== 'edit' && [
|
|
27
|
+
'VIDEO',
|
|
28
|
+
'EXTERNAL_VIDEO'
|
|
29
|
+
].includes(image?.contentType || '') && !isClickEffect, [
|
|
30
|
+
mode,
|
|
31
|
+
image?.contentType,
|
|
32
|
+
isClickEffect
|
|
33
|
+
]);
|
|
20
34
|
const renderImage = useMemo(()=>{
|
|
21
35
|
if (!image) return defaultImage;
|
|
22
36
|
return {
|
|
23
37
|
...image,
|
|
24
|
-
src: isFeatureMedia(image?.contentType) ? image?.previewImage : image.src
|
|
38
|
+
src: isRenderVideo ? image.src : isFeatureMedia(image?.contentType) ? image?.previewImage : image.src
|
|
25
39
|
};
|
|
26
40
|
}, [
|
|
27
|
-
image
|
|
41
|
+
image,
|
|
42
|
+
isRenderVideo
|
|
28
43
|
]);
|
|
29
44
|
const shopifyProductLink = useMemo(()=>{
|
|
30
45
|
if (!storefrontUrl) return `#`;
|
|
@@ -46,56 +61,71 @@ const ProductFeaturedImageOnly = ({ image, imageShowWhenHover, setting, aspectRa
|
|
|
46
61
|
});
|
|
47
62
|
return children;
|
|
48
63
|
};
|
|
64
|
+
const isRenderHoverImage = useMemo(()=>setting?.hoverEffect !== 'none' && !isFeatureMedia(renderImage?.contentType), [
|
|
65
|
+
renderImage?.contentType,
|
|
66
|
+
setting?.hoverEffect
|
|
67
|
+
]);
|
|
68
|
+
const isZoomImage = useMemo(()=>setting?.hoverEffect == 'zoom' && setting?.zoomType == 'glasses' && !isFeatureMedia(renderImage?.contentType), [
|
|
69
|
+
renderImage?.contentType,
|
|
70
|
+
setting?.hoverEffect,
|
|
71
|
+
setting?.zoomType
|
|
72
|
+
]);
|
|
49
73
|
return /*#__PURE__*/ jsx(Fragment, {
|
|
50
|
-
children: handleProductLink(/*#__PURE__*/
|
|
51
|
-
children:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
74
|
+
children: handleProductLink(/*#__PURE__*/ jsx(Fragment, {
|
|
75
|
+
children: isRenderVideo ? /*#__PURE__*/ jsx(ProductFeatureVideo, {
|
|
76
|
+
type: renderImage?.contentType,
|
|
77
|
+
url: renderImage.src ?? '',
|
|
78
|
+
aspectRatio: aspectRatio
|
|
79
|
+
}) : /*#__PURE__*/ jsxs(Fragment, {
|
|
80
|
+
children: [
|
|
81
|
+
/*#__PURE__*/ jsx(NextImage, {
|
|
82
|
+
draggable: "false",
|
|
83
|
+
src: renderImage.src,
|
|
84
|
+
width: renderImage?.width,
|
|
85
|
+
height: renderImage?.height,
|
|
86
|
+
alt: renderImage?.alt,
|
|
87
|
+
setting: {
|
|
88
|
+
aspectRatio: aspectRatio,
|
|
89
|
+
layout: setting?.ftLayout
|
|
90
|
+
},
|
|
91
|
+
priority: setting?.preload,
|
|
92
|
+
className: "featured-image-only",
|
|
93
|
+
style: {
|
|
94
|
+
width: '100%',
|
|
95
|
+
height: '100%',
|
|
96
|
+
cursor: 'pointer'
|
|
97
|
+
}
|
|
98
|
+
}),
|
|
99
|
+
/*#__PURE__*/ jsx(MediaIcon, {
|
|
100
|
+
contentType: renderImage?.contentType ?? ''
|
|
101
|
+
}),
|
|
102
|
+
isRenderHoverImage && /*#__PURE__*/ jsx(NextImage, {
|
|
103
|
+
draggable: "false",
|
|
104
|
+
src: setting?.hoverEffect === 'other' ? imageShowWhenHover?.src : renderImage.src,
|
|
105
|
+
width: setting?.hoverEffect === 'other' ? imageShowWhenHover?.width : renderImage.width,
|
|
106
|
+
height: setting?.hoverEffect === 'other' ? imageShowWhenHover?.height : renderImage.height,
|
|
107
|
+
alt: setting?.hoverEffect === 'other' ? imageShowWhenHover?.alt : renderImage.alt,
|
|
108
|
+
setting: {
|
|
109
|
+
layout: setting.ftLayout,
|
|
110
|
+
aspectRatio: aspectRatio
|
|
111
|
+
},
|
|
112
|
+
style: {
|
|
113
|
+
width: '100%',
|
|
114
|
+
height: '100%'
|
|
115
|
+
},
|
|
116
|
+
className: cls('hover-image featured-image-only !gp-max-w-none', getZoomImageClass()),
|
|
117
|
+
priority: setting?.preload
|
|
118
|
+
}),
|
|
119
|
+
isZoomImage && /*#__PURE__*/ jsx("div", {
|
|
120
|
+
className: cls(getZoomLenClass(), 'room-len'),
|
|
121
|
+
style: {
|
|
122
|
+
...makeStyle({
|
|
123
|
+
bgi: `url("${renderImage?.src}")`
|
|
124
|
+
})
|
|
125
|
+
}
|
|
126
|
+
})
|
|
127
|
+
]
|
|
128
|
+
})
|
|
99
129
|
}))
|
|
100
130
|
});
|
|
101
131
|
};
|
package/dist/esm/product/components/ProductImagesV2/jsx/components/ProductGalleryCarousel.js
CHANGED
|
@@ -9,6 +9,7 @@ import { getShapeByLayout, getSliderPerShowConfig, getSettingWidthForCarouselIte
|
|
|
9
9
|
import ButtonOpenLightBox from './ButtonOpenLightBox.js';
|
|
10
10
|
import MediaIcon from './MediaIcon.js';
|
|
11
11
|
import { handleSetSrcForProductImageList } from '../../../../../image/helpers/getSrcSet.js';
|
|
12
|
+
import { isFeatureMedia } from '../../common/productFeaturedImage.js';
|
|
12
13
|
|
|
13
14
|
const ProductGalleryCarousel = ({ builderPropUID, productImages, onHandleClick, activeIndexFormFeatureImage, onClickFeatureArrow, builderPropsClass, arrow, priorityFeatureImage, ...setting })=>{
|
|
14
15
|
const currentDevice = useCurrentDevice();
|
|
@@ -243,6 +244,7 @@ const ProductGalleryCarousel = ({ builderPropUID, productImages, onHandleClick,
|
|
|
243
244
|
disableMarginAuto: true,
|
|
244
245
|
children: productImages?.map((image, index)=>{
|
|
245
246
|
const canActive = index === moveToIdx;
|
|
247
|
+
const imageSrc = isFeatureMedia(image.contentType) ? image.previewImage : image.src;
|
|
246
248
|
return /*#__PURE__*/ jsxs(CarouselItem, {
|
|
247
249
|
contentType: "productImage",
|
|
248
250
|
className: cls(`gem-slider-item gem-slider-item-${builderPropUID} gp-gallery-image-item gp-group gp-flex gp-w-full gp-items-center gp-justify-center gp-overflow-hidden gp-outline-1 -gp-outline-offset-1 data-[border=deactive]:after:!gp-border-transparent`, {
|
|
@@ -266,7 +268,7 @@ const ProductGalleryCarousel = ({ builderPropUID, productImages, onHandleClick,
|
|
|
266
268
|
children: [
|
|
267
269
|
/*#__PURE__*/ jsx(NextImage, {
|
|
268
270
|
draggable: "false",
|
|
269
|
-
src:
|
|
271
|
+
src: imageSrc,
|
|
270
272
|
width: image?.width,
|
|
271
273
|
height: image?.height,
|
|
272
274
|
alt: image?.alt,
|
|
@@ -120,6 +120,7 @@ const ProductGalleryGrid = ({ builderPropUID, productImages, onHandleClick, acti
|
|
|
120
120
|
children: [
|
|
121
121
|
productImages?.map((image, index)=>{
|
|
122
122
|
const canActive = index === imageActiveIndex;
|
|
123
|
+
const imageSrc = isFeatureMedia(image.contentType) ? image.previewImage : image.src;
|
|
123
124
|
return(// eslint-disable-next-line jsx-a11y/mouse-events-have-key-events
|
|
124
125
|
/*#__PURE__*/ jsxs("div", {
|
|
125
126
|
"aria-hidden": true,
|
|
@@ -145,7 +146,7 @@ const ProductGalleryGrid = ({ builderPropUID, productImages, onHandleClick, acti
|
|
|
145
146
|
"data-border": canActive && !!setting?.borderActive ? 'active' : 'deactive',
|
|
146
147
|
children: [
|
|
147
148
|
/*#__PURE__*/ jsx(NextImage, {
|
|
148
|
-
src:
|
|
149
|
+
src: imageSrc,
|
|
149
150
|
width: image?.width,
|
|
150
151
|
height: image?.height,
|
|
151
152
|
alt: image?.alt,
|
|
@@ -162,7 +163,7 @@ const ProductGalleryGrid = ({ builderPropUID, productImages, onHandleClick, acti
|
|
|
162
163
|
contentType: image?.contentType || ''
|
|
163
164
|
}),
|
|
164
165
|
setting?.galleryHoverEffect !== 'none' && !isFeatureMedia(image?.contentType) && /*#__PURE__*/ jsx(NextImage, {
|
|
165
|
-
src:
|
|
166
|
+
src: imageSrc,
|
|
166
167
|
width: image?.width,
|
|
167
168
|
height: image?.height,
|
|
168
169
|
alt: image?.alt,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useFeaturedImageGlobal, cls } from '@gem-sdk/core';
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { useFeaturedImageGlobal, useEditorMode, cls } from '@gem-sdk/core';
|
|
3
3
|
import Carousel from '../../../../../carousel/components/Carousel.js';
|
|
4
4
|
import CarouselItem from '../../../../../carousel/components/CarouselItem.js';
|
|
5
5
|
import NextImage from '../../../../../image/components/NextImage.js';
|
|
@@ -7,6 +7,8 @@ import '../../../../../modal/components/confirm.js';
|
|
|
7
7
|
import Modal from '../../../../../modal/components/Modal.js';
|
|
8
8
|
import { useMemo } from 'react';
|
|
9
9
|
import { isFeatureMedia } from '../../common/productFeaturedImage.js';
|
|
10
|
+
import ProductFeatureVideo from './ProductFeatureVideo.js';
|
|
11
|
+
import MediaIcon from './MediaIcon.js';
|
|
10
12
|
|
|
11
13
|
const ProductImagesLightBox = ({ builderPropUID, productImages, open, imageRatio, onHandleClose })=>{
|
|
12
14
|
const featuredImageGlobal = useFeaturedImageGlobal();
|
|
@@ -27,6 +29,11 @@ const ProductImagesLightBox = ({ builderPropUID, productImages, open, imageRatio
|
|
|
27
29
|
mobile: false,
|
|
28
30
|
tablet: false
|
|
29
31
|
};
|
|
32
|
+
const mode = useEditorMode();
|
|
33
|
+
const isRenderVideo = (image)=>mode !== 'edit' && [
|
|
34
|
+
'VIDEO',
|
|
35
|
+
'EXTERNAL_VIDEO'
|
|
36
|
+
].includes(image?.contentType || '');
|
|
30
37
|
return /*#__PURE__*/ jsx(Modal, {
|
|
31
38
|
setting: {
|
|
32
39
|
open: open
|
|
@@ -102,17 +109,28 @@ const ProductImagesLightBox = ({ builderPropUID, productImages, open, imageRatio
|
|
|
102
109
|
fullHeight: true,
|
|
103
110
|
children: productImages?.map((image)=>/*#__PURE__*/ jsx(CarouselItem, {
|
|
104
111
|
className: `gem-slider-item gem-slider-item-${builderPropUID} gp-flex gp-items-center gp-justify-center gp-px-4`,
|
|
105
|
-
children: /*#__PURE__*/
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
children: !isRenderVideo(image) ? /*#__PURE__*/ jsxs(Fragment, {
|
|
113
|
+
children: [
|
|
114
|
+
/*#__PURE__*/ jsx(NextImage, {
|
|
115
|
+
src: isFeatureMedia(image?.contentType) ? image?.previewImage : image?.src,
|
|
116
|
+
width: image?.width,
|
|
117
|
+
height: image?.height,
|
|
118
|
+
alt: image?.alt,
|
|
119
|
+
"content-type": image?.contentType,
|
|
120
|
+
setting: {
|
|
121
|
+
aspectRatio: imageRatio
|
|
122
|
+
},
|
|
123
|
+
className: cls('gp-h-full gp-w-full gp-object-contain')
|
|
124
|
+
}, image?.id),
|
|
125
|
+
/*#__PURE__*/ jsx(MediaIcon, {
|
|
126
|
+
contentType: image?.contentType ?? ''
|
|
127
|
+
})
|
|
128
|
+
]
|
|
129
|
+
}) : /*#__PURE__*/ jsx(ProductFeatureVideo, {
|
|
130
|
+
type: image?.contentType,
|
|
131
|
+
url: image.src ?? '',
|
|
132
|
+
aspectRatio: imageRatio
|
|
133
|
+
})
|
|
116
134
|
}, image?.id))
|
|
117
135
|
})
|
|
118
136
|
});
|
|
@@ -4,7 +4,7 @@ import ThirdPartyPreview from './ThirdPartyPreview.js';
|
|
|
4
4
|
|
|
5
5
|
const AppConfig = {
|
|
6
6
|
id: 'product-options-variant-option',
|
|
7
|
-
label: 'Product Options
|
|
7
|
+
label: 'Avis Product Options, Variants',
|
|
8
8
|
logoUrl: 'https://cdn.shopify.com/app-store/listing_images/5ee1f244b087cfbec9b19c8b3f62c8f6/icon/CMCq1s7J5vQCEAE=.png',
|
|
9
9
|
tag: 'ProductOptionsVariantOption'
|
|
10
10
|
};
|
|
@@ -14,7 +14,7 @@ const ProductOptionsVariantOptionContent = ()=>{
|
|
|
14
14
|
className: "gp-p-2",
|
|
15
15
|
children: /*#__PURE__*/ jsx(ThirdPartyPreview, {
|
|
16
16
|
setting: {
|
|
17
|
-
label: 'Product Options
|
|
17
|
+
label: 'Avis Product Options, Variants',
|
|
18
18
|
iconSvg: `<img class="gp-w-6 gp-border gp-border-[#494949] gp-rounded-[3px]" src="${AppConfig.logoUrl}">`
|
|
19
19
|
}
|
|
20
20
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { template, makeStyleResponsive } from '@gem-sdk/core';
|
|
2
2
|
|
|
3
3
|
const ProductOptionsVariantOption = ({ setting, advanced })=>{
|
|
4
|
-
const { align
|
|
4
|
+
const { align } = setting ?? {};
|
|
5
5
|
return template`
|
|
6
6
|
<div
|
|
7
7
|
class="${advanced?.cssClass}"
|
|
@@ -9,7 +9,7 @@ const ProductOptionsVariantOption = ({ setting, advanced })=>{
|
|
|
9
9
|
...makeStyleResponsive('ta', align)
|
|
10
10
|
}}"
|
|
11
11
|
>
|
|
12
|
-
<div class="
|
|
12
|
+
<div class="avpoptions-container__v2"></div>
|
|
13
13
|
</div>
|
|
14
14
|
`;
|
|
15
15
|
};
|
|
@@ -24,7 +24,7 @@ const config = {
|
|
|
24
24
|
icon: {
|
|
25
25
|
desktop: `<div class="w-full flex flex-col items-center">
|
|
26
26
|
<img class="w-24 border border-dark-200 rounded-medium" src="https://cdn.shopify.com/app-store/listing_images/5ee1f244b087cfbec9b19c8b3f62c8f6/icon/CMCq1s7J5vQCEAE=.png">
|
|
27
|
-
<span class="preset-item-title">Product Options
|
|
27
|
+
<span class="preset-item-title">Avis Product Options, Variants</span>
|
|
28
28
|
</div>`
|
|
29
29
|
},
|
|
30
30
|
components: [
|
|
@@ -103,15 +103,6 @@ const config = {
|
|
|
103
103
|
id: 'openApp'
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
|
-
{
|
|
107
|
-
type: 'control',
|
|
108
|
-
setting: {
|
|
109
|
-
id: 'idTrigger'
|
|
110
|
-
},
|
|
111
|
-
label: {
|
|
112
|
-
en: 'ID Element'
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
106
|
{
|
|
116
107
|
type: 'control',
|
|
117
108
|
label: {
|
|
@@ -2,7 +2,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
2
2
|
import { useEditorMode, makeStyleResponsive, cls } from '@gem-sdk/core';
|
|
3
3
|
import dynamic from 'next/dynamic';
|
|
4
4
|
import { useMemo } from 'react';
|
|
5
|
-
import { getVimeoVideoId,
|
|
5
|
+
import { getVimeoVideoId, getYoutubeVideoId, youtubeVideoRegex, parseTimeVideo } from '../helpers/common.js';
|
|
6
6
|
import useAspectRatioSettings from '../../banner/components/hero-banner/hooks/useAspectRatioSettings.js';
|
|
7
7
|
|
|
8
8
|
const HTML5Embed = dynamic(()=>import('./HTML5Embed.js'));
|
|
@@ -45,7 +45,7 @@ const Video = ({ className, setting, style, builderAttrs, builderProps, children
|
|
|
45
45
|
case 'vimeo':
|
|
46
46
|
{
|
|
47
47
|
const videoId = getVimeoVideoId(vimeoUrl);
|
|
48
|
-
if (!
|
|
48
|
+
if (!videoId) return undefined;
|
|
49
49
|
return /*#__PURE__*/ jsx(LiteVimeoEmbed, {
|
|
50
50
|
muted: !mute,
|
|
51
51
|
loop: loopVideo,
|