@gem-sdk/components 2.0.0-dev.692 → 2.0.0-dev.694
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/accordion/setting/configs/uiV2.js +1 -0
- package/dist/cjs/article/setting/configs/ArticleReadMore/settings.js +2 -0
- package/dist/cjs/breadcrumb/setting/configs/settings.js +1 -0
- package/dist/cjs/builder.js +6 -12
- package/dist/cjs/button/setting/configs/settings.js +1 -0
- package/dist/cjs/carousel/setting/configs/settingV2.js +3 -0
- package/dist/cjs/collection/setting/collection-banner/configs/settings.js +2 -2
- package/dist/cjs/countdown-timer/setting/configs/settings.js +2 -0
- package/dist/cjs/form/setting/submit-button/configs/settings.js +1 -0
- package/dist/cjs/grid/row/setting/configs/settings.js +5 -0
- package/dist/cjs/grid/section/setting/configs/settings.js +3 -0
- package/dist/cjs/icon-list/setting/configs/settings.js +2 -0
- package/dist/cjs/icon-list-hoz/setting/configs/settings.js +1 -0
- package/dist/cjs/index.js +32 -34
- package/dist/cjs/index.liquid.js +10 -16
- package/dist/cjs/marquee/setting/configs/settingsV2.js +1 -0
- package/dist/cjs/next.js +1 -3
- package/dist/cjs/product/components/ProductBundle/setting/uiV2.js +1 -0
- package/dist/cjs/product/components/ProductImagesV2/common/common.js +2 -1
- package/dist/cjs/product/index.js +4 -6
- package/dist/cjs/product/next.js +0 -4
- package/dist/cjs/product/setting/product/configs/settings.js +3 -0
- package/dist/cjs/product/setting/product-image-v2/configs/setting-v2/index.js +1 -0
- package/dist/cjs/product/setting/product-variant/configs/settings.js +2 -0
- package/dist/cjs/product/setting/product-view-more/configs/settings.js +1 -0
- package/dist/cjs/setting.js +76 -78
- package/dist/cjs/third-party/components/Bogos/BogosSampleContent.js +2 -1
- package/dist/cjs/third-party/components/Bogos.liquid.js +2 -0
- package/dist/cjs/third-party/setting/Bogos/index.js +5 -1
- package/dist/esm/accordion/setting/configs/uiV2.js +1 -0
- package/dist/esm/article/setting/configs/ArticleReadMore/settings.js +2 -0
- package/dist/esm/breadcrumb/setting/configs/settings.js +1 -0
- package/dist/esm/builder.js +0 -6
- package/dist/esm/button/setting/configs/settings.js +1 -0
- package/dist/esm/carousel/setting/configs/settingV2.js +3 -0
- package/dist/esm/collection/setting/collection-banner/configs/settings.js +2 -2
- package/dist/esm/countdown-timer/setting/configs/settings.js +2 -0
- package/dist/esm/form/setting/submit-button/configs/settings.js +1 -0
- package/dist/esm/grid/row/setting/configs/settings.js +5 -0
- package/dist/esm/grid/section/setting/configs/settings.js +3 -0
- package/dist/esm/icon-list/setting/configs/settings.js +2 -0
- package/dist/esm/icon-list-hoz/setting/configs/settings.js +1 -0
- package/dist/esm/index.js +0 -1
- package/dist/esm/index.liquid.js +0 -3
- package/dist/esm/marquee/setting/configs/settingsV2.js +1 -0
- package/dist/esm/next.js +1 -3
- package/dist/esm/product/components/ProductBundle/setting/uiV2.js +1 -0
- package/dist/esm/product/components/ProductImagesV2/common/common.js +2 -1
- package/dist/esm/product/index.js +24 -26
- package/dist/esm/product/next.js +0 -4
- package/dist/esm/product/setting/product/configs/settings.js +3 -0
- package/dist/esm/product/setting/product-image-v2/configs/setting-v2/index.js +1 -0
- package/dist/esm/product/setting/product-variant/configs/settings.js +2 -0
- package/dist/esm/product/setting/product-view-more/configs/settings.js +1 -0
- package/dist/esm/setting.js +0 -2
- package/dist/esm/third-party/components/Bogos/BogosSampleContent.js +2 -1
- package/dist/esm/third-party/components/Bogos.liquid.js +2 -0
- package/dist/esm/third-party/setting/Bogos/index.js +5 -1
- package/dist/types/index.d.ts +116 -551
- package/package.json +2 -2
- package/dist/cjs/product/components/ProductImagesV3/common/common.js +0 -360
- package/dist/cjs/product/components/ProductImagesV3/common/getAttr.js +0 -192
- package/dist/cjs/product/components/ProductImagesV3/common/getBorderActiveCss.js +0 -26
- package/dist/cjs/product/components/ProductImagesV3/common/getClasses.js +0 -94
- package/dist/cjs/product/components/ProductImagesV3/common/getStyle.js +0 -303
- package/dist/cjs/product/components/ProductImagesV3/common/hoverAction.js +0 -95
- package/dist/cjs/product/components/ProductImagesV3/common/productFeaturedImage.js +0 -59
- package/dist/cjs/product/components/ProductImagesV3/common/productGallery.js +0 -266
- package/dist/cjs/product/components/ProductImagesV3/components/child/MediaIcon.js +0 -63
- package/dist/cjs/product/components/ProductImagesV3/components/child/ProductFeatureVideo.js +0 -36
- package/dist/cjs/product/components/ProductImagesV3/components/child/ProductFeaturedImageCarousel.js +0 -109
- package/dist/cjs/product/components/ProductImagesV3/components/child/ProductFeaturedImageOnly.js +0 -139
- package/dist/cjs/product/components/ProductImagesV3/components/child/ProductGalleryGrid.js +0 -100
- package/dist/cjs/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.js +0 -77
- package/dist/cjs/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.liquid.js +0 -300
- package/dist/cjs/product/components/ProductImagesV3/components/feature-only/OnlyFeatureImage.js +0 -44
- package/dist/cjs/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.js +0 -83
- package/dist/cjs/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.liquid.js +0 -182
- package/dist/cjs/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.js +0 -30
- package/dist/cjs/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.liquid.js +0 -239
- package/dist/cjs/product/components/ProductImagesV3/components/lightbox/ButtonOpenLightBox.js +0 -28
- package/dist/cjs/product/components/ProductImagesV3/components/lightbox/ProductImagesLightBox.js +0 -144
- package/dist/cjs/product/components/ProductImagesV3/composables/getProductImagesAttr.js +0 -14
- package/dist/cjs/product/components/ProductImagesV3/composables/getProductImagesClassName.js +0 -54
- package/dist/cjs/product/components/ProductImagesV3/composables/getProductImagesStyles.js +0 -53
- package/dist/cjs/product/components/ProductImagesV3/hooks/useFeatureImageWithGallery.js +0 -55
- package/dist/cjs/product/components/ProductImagesV3/hooks/useFilterImagesByVariant.js +0 -41
- package/dist/cjs/product/components/ProductImagesV3/hooks/useGalleryCarousel.js +0 -134
- package/dist/cjs/product/components/ProductImagesV3/hooks/useProductFeaturedImageCarousel.js +0 -203
- package/dist/cjs/product/components/ProductImagesV3/hooks/useProductGalleryGrid.js +0 -87
- package/dist/cjs/product/components/ProductImagesV3/index.js +0 -291
- package/dist/cjs/product/components/ProductImagesV3/index.liquid.js +0 -153
- package/dist/cjs/product/setting/product-image-v3/ProductFeatureImage.js +0 -252
- package/dist/cjs/product/setting/product-image-v3/ProductGalleryImage.js +0 -251
- package/dist/cjs/product/setting/product-image-v3/ProductImages.js +0 -74
- package/dist/cjs/product/setting/product-image-v3/configs/setting-v2/ProductFeatureImage.js +0 -388
- package/dist/cjs/product/setting/product-image-v3/configs/setting-v2/ProductGalleryImage.js +0 -518
- package/dist/cjs/product/setting/product-image-v3/configs/setting-v2/index.js +0 -336
- package/dist/cjs/product/setting/product-image-v3/configs/ui/FeatureNavigation.js +0 -118
- package/dist/cjs/product/setting/product-image-v3/configs/ui/ImageListNavigation.js +0 -119
- package/dist/cjs/product/setting/product-image-v3/configs/uiV1.js +0 -237
- package/dist/cjs/product/setting/product-image-v3/configs/uiV2.js +0 -491
- package/dist/cjs/swiper-carousel/arrow/Arrow.js +0 -52
- package/dist/cjs/swiper-carousel/arrow/Arrow.liquid.js +0 -46
- package/dist/cjs/swiper-carousel/arrow/common/common.js +0 -119
- package/dist/cjs/swiper-carousel/arrow/common/getClass.js +0 -50
- package/dist/cjs/swiper-carousel/arrow/common/getStyle.js +0 -84
- package/dist/cjs/swiper-carousel/carousel-item/SwiperItem.js +0 -34
- package/dist/cjs/swiper-carousel/carousel-item/SwiperItem.liquid.js +0 -38
- package/dist/cjs/swiper-carousel/carousel-item/common/getClass.js +0 -29
- package/dist/cjs/swiper-carousel/carousel-item/common/getStyle.js +0 -79
- package/dist/cjs/swiper-carousel/carousel-item/hook/useCarouseItem.js +0 -22
- package/dist/cjs/swiper-carousel/components/common/carousel.js +0 -98
- package/dist/cjs/swiper-carousel/components/const/index.js +0 -5
- package/dist/cjs/swiper-carousel/components/hooks/useTrackPreviewPause.js +0 -34
- package/dist/cjs/swiper-carousel/components/plugins/AnimationPlugin.js +0 -42
- package/dist/cjs/swiper-carousel/components/plugins/AutoPlayPlugin.js +0 -105
- package/dist/cjs/swiper-carousel/components/plugins/FixSliderMoveBackwards.js +0 -15
- package/dist/cjs/swiper-carousel/components/plugins/MutationPlugin.js +0 -45
- package/dist/cjs/swiper-carousel/dots/Dots.js +0 -51
- package/dist/cjs/swiper-carousel/dots/Dots.liquid.js +0 -26
- package/dist/cjs/swiper-carousel/dots/common/common.js +0 -28
- package/dist/cjs/swiper-carousel/dots/common/getClass.js +0 -40
- package/dist/cjs/swiper-carousel/dots/common/getStyle.js +0 -33
- package/dist/cjs/swiper-carousel/dots/hook/useDotsSetting.js +0 -21
- package/dist/cjs/swiper-carousel/index.js +0 -17
- package/dist/cjs/swiper-carousel/next.js +0 -22
- package/dist/cjs/swiper-carousel/root/Swiper.js +0 -128
- package/dist/cjs/swiper-carousel/root/Swiper.liquid.js +0 -104
- package/dist/cjs/swiper-carousel/root/common/getAttr.js +0 -25
- package/dist/cjs/swiper-carousel/root/common/getClass.js +0 -135
- package/dist/cjs/swiper-carousel/root/common/getData.js +0 -56
- package/dist/cjs/swiper-carousel/root/common/getStyle.js +0 -66
- package/dist/cjs/swiper-carousel/root/hook/useCarousel.js +0 -482
- package/dist/cjs/swiper-carousel/setting/Swiper.js +0 -42
- package/dist/cjs/swiper-carousel/setting/SwiperItem.js +0 -40
- package/dist/cjs/swiper-carousel/setting/configs/presets.js +0 -87
- package/dist/cjs/swiper-carousel/setting/configs/settingV2.js +0 -819
- package/dist/cjs/swiper-carousel/setting/configs/uiV2.js +0 -718
- package/dist/esm/product/components/ProductImagesV3/common/common.js +0 -344
- package/dist/esm/product/components/ProductImagesV3/common/getAttr.js +0 -189
- package/dist/esm/product/components/ProductImagesV3/common/getBorderActiveCss.js +0 -24
- package/dist/esm/product/components/ProductImagesV3/common/getClasses.js +0 -83
- package/dist/esm/product/components/ProductImagesV3/common/getStyle.js +0 -292
- package/dist/esm/product/components/ProductImagesV3/common/hoverAction.js +0 -92
- package/dist/esm/product/components/ProductImagesV3/common/productFeaturedImage.js +0 -53
- package/dist/esm/product/components/ProductImagesV3/common/productGallery.js +0 -251
- package/dist/esm/product/components/ProductImagesV3/components/child/MediaIcon.js +0 -59
- package/dist/esm/product/components/ProductImagesV3/components/child/ProductFeatureVideo.js +0 -32
- package/dist/esm/product/components/ProductImagesV3/components/child/ProductFeaturedImageCarousel.js +0 -105
- package/dist/esm/product/components/ProductImagesV3/components/child/ProductFeaturedImageOnly.js +0 -135
- package/dist/esm/product/components/ProductImagesV3/components/child/ProductGalleryGrid.js +0 -96
- package/dist/esm/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.js +0 -73
- package/dist/esm/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.liquid.js +0 -296
- package/dist/esm/product/components/ProductImagesV3/components/feature-only/OnlyFeatureImage.js +0 -40
- package/dist/esm/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.js +0 -79
- package/dist/esm/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.liquid.js +0 -178
- package/dist/esm/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.js +0 -26
- package/dist/esm/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.liquid.js +0 -235
- package/dist/esm/product/components/ProductImagesV3/components/lightbox/ButtonOpenLightBox.js +0 -24
- package/dist/esm/product/components/ProductImagesV3/components/lightbox/ProductImagesLightBox.js +0 -140
- package/dist/esm/product/components/ProductImagesV3/composables/getProductImagesAttr.js +0 -12
- package/dist/esm/product/components/ProductImagesV3/composables/getProductImagesClassName.js +0 -52
- package/dist/esm/product/components/ProductImagesV3/composables/getProductImagesStyles.js +0 -51
- package/dist/esm/product/components/ProductImagesV3/hooks/useFeatureImageWithGallery.js +0 -53
- package/dist/esm/product/components/ProductImagesV3/hooks/useFilterImagesByVariant.js +0 -39
- package/dist/esm/product/components/ProductImagesV3/hooks/useGalleryCarousel.js +0 -132
- package/dist/esm/product/components/ProductImagesV3/hooks/useProductFeaturedImageCarousel.js +0 -201
- package/dist/esm/product/components/ProductImagesV3/hooks/useProductGalleryGrid.js +0 -85
- package/dist/esm/product/components/ProductImagesV3/index.js +0 -287
- package/dist/esm/product/components/ProductImagesV3/index.liquid.js +0 -149
- package/dist/esm/product/setting/product-image-v3/ProductFeatureImage.js +0 -248
- package/dist/esm/product/setting/product-image-v3/ProductGalleryImage.js +0 -248
- package/dist/esm/product/setting/product-image-v3/ProductImages.js +0 -70
- package/dist/esm/product/setting/product-image-v3/configs/setting-v2/ProductFeatureImage.js +0 -384
- package/dist/esm/product/setting/product-image-v3/configs/setting-v2/ProductGalleryImage.js +0 -515
- package/dist/esm/product/setting/product-image-v3/configs/setting-v2/index.js +0 -334
- package/dist/esm/product/setting/product-image-v3/configs/ui/FeatureNavigation.js +0 -116
- package/dist/esm/product/setting/product-image-v3/configs/ui/ImageListNavigation.js +0 -117
- package/dist/esm/product/setting/product-image-v3/configs/uiV1.js +0 -235
- package/dist/esm/product/setting/product-image-v3/configs/uiV2.js +0 -489
- package/dist/esm/swiper-carousel/arrow/Arrow.js +0 -48
- package/dist/esm/swiper-carousel/arrow/Arrow.liquid.js +0 -42
- package/dist/esm/swiper-carousel/arrow/common/common.js +0 -111
- package/dist/esm/swiper-carousel/arrow/common/getClass.js +0 -48
- package/dist/esm/swiper-carousel/arrow/common/getStyle.js +0 -82
- package/dist/esm/swiper-carousel/carousel-item/SwiperItem.js +0 -30
- package/dist/esm/swiper-carousel/carousel-item/SwiperItem.liquid.js +0 -34
- package/dist/esm/swiper-carousel/carousel-item/common/getClass.js +0 -27
- package/dist/esm/swiper-carousel/carousel-item/common/getStyle.js +0 -77
- package/dist/esm/swiper-carousel/carousel-item/hook/useCarouseItem.js +0 -20
- package/dist/esm/swiper-carousel/components/common/carousel.js +0 -93
- package/dist/esm/swiper-carousel/components/const/index.js +0 -3
- package/dist/esm/swiper-carousel/components/hooks/useTrackPreviewPause.js +0 -30
- package/dist/esm/swiper-carousel/components/plugins/AnimationPlugin.js +0 -35
- package/dist/esm/swiper-carousel/components/plugins/AutoPlayPlugin.js +0 -103
- package/dist/esm/swiper-carousel/components/plugins/FixSliderMoveBackwards.js +0 -13
- package/dist/esm/swiper-carousel/components/plugins/MutationPlugin.js +0 -43
- package/dist/esm/swiper-carousel/dots/Dots.js +0 -47
- package/dist/esm/swiper-carousel/dots/Dots.liquid.js +0 -22
- package/dist/esm/swiper-carousel/dots/common/common.js +0 -26
- package/dist/esm/swiper-carousel/dots/common/getClass.js +0 -38
- package/dist/esm/swiper-carousel/dots/common/getStyle.js +0 -31
- package/dist/esm/swiper-carousel/dots/hook/useDotsSetting.js +0 -19
- package/dist/esm/swiper-carousel/index.js +0 -15
- package/dist/esm/swiper-carousel/next.js +0 -18
- package/dist/esm/swiper-carousel/root/Swiper.js +0 -124
- package/dist/esm/swiper-carousel/root/Swiper.liquid.js +0 -100
- package/dist/esm/swiper-carousel/root/common/getAttr.js +0 -23
- package/dist/esm/swiper-carousel/root/common/getClass.js +0 -133
- package/dist/esm/swiper-carousel/root/common/getData.js +0 -54
- package/dist/esm/swiper-carousel/root/common/getStyle.js +0 -64
- package/dist/esm/swiper-carousel/root/hook/useCarousel.js +0 -480
- package/dist/esm/swiper-carousel/setting/Swiper.js +0 -38
- package/dist/esm/swiper-carousel/setting/SwiperItem.js +0 -36
- package/dist/esm/swiper-carousel/setting/configs/presets.js +0 -85
- package/dist/esm/swiper-carousel/setting/configs/settingV2.js +0 -815
- package/dist/esm/swiper-carousel/setting/configs/uiV2.js +0 -713
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var core = require('@gem-sdk/core');
|
|
7
|
-
var React = require('react');
|
|
8
|
-
var common = require('../../common/common.js');
|
|
9
|
-
var NextImage = require('../../../../../image/components/NextImage.js');
|
|
10
|
-
var ButtonOpenLightBox = require('../lightbox/ButtonOpenLightBox.js');
|
|
11
|
-
var MediaIcon = require('./MediaIcon.js');
|
|
12
|
-
var productFeaturedImage = require('../../common/productFeaturedImage.js');
|
|
13
|
-
var hoverAction = require('../../common/hoverAction.js');
|
|
14
|
-
var getProductImagesClassName = require('../../composables/getProductImagesClassName.js');
|
|
15
|
-
var getProductImagesStyles = require('../../composables/getProductImagesStyles.js');
|
|
16
|
-
var useProductGalleryGrid = require('../../hooks/useProductGalleryGrid.js');
|
|
17
|
-
|
|
18
|
-
const ProductGalleryGrid = (props)=>{
|
|
19
|
-
const { builderPropUID, productImages, onHandleClick, activeIndexFormFeatureImage, children, isHiddenInteraction, ...setting } = props;
|
|
20
|
-
const { isDisplay, shapeByLayout, imageActiveIndex, enableOpenLightBox, isEnableBorderActive, filteredProductImages } = useProductGalleryGrid.useProductGalleryGrid(props);
|
|
21
|
-
const currentDevice = core.useCurrentDevice();
|
|
22
|
-
const { galleryGridWrapperClasses, galleryItemClasses } = getProductImagesClassName.getProductImagesClassName(setting);
|
|
23
|
-
const { galleryGridStyles, galleryGridItemStyles } = getProductImagesStyles.getProductImagesStyles(setting);
|
|
24
|
-
return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
25
|
-
children: isDisplay && /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
26
|
-
"data-slot": "children",
|
|
27
|
-
"data-id": builderPropUID,
|
|
28
|
-
className: galleryGridWrapperClasses,
|
|
29
|
-
style: galleryGridStyles,
|
|
30
|
-
"gp-data-hidden": `${isHiddenInteraction}`,
|
|
31
|
-
children: [
|
|
32
|
-
filteredProductImages?.map((image, index)=>{
|
|
33
|
-
const canActive = index === imageActiveIndex;
|
|
34
|
-
const imageSrc = productFeaturedImage.isFeatureMedia(image.contentType) ? image.previewImage : image.src;
|
|
35
|
-
return(// eslint-disable-next-line jsx-a11y/mouse-events-have-key-events
|
|
36
|
-
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
37
|
-
"aria-hidden": true,
|
|
38
|
-
className: galleryItemClasses(`gem-slider-item-${builderPropUID}
|
|
39
|
-
${canActive && isEnableBorderActive ? 'gem-slider-item-active' : ''}`),
|
|
40
|
-
onClick: ()=>onHandleClick(image?.id || '', enableOpenLightBox),
|
|
41
|
-
style: galleryGridItemStyles,
|
|
42
|
-
onMouseMove: (e)=>hoverAction.handleMouseMove(e, {
|
|
43
|
-
hoverEffect: setting.galleryHoverEffect,
|
|
44
|
-
zoom: setting.galleryZoom,
|
|
45
|
-
zoomType: setting.galleryZoomType
|
|
46
|
-
}),
|
|
47
|
-
onMouseOut: (e)=>hoverAction.handleMouseOut(e),
|
|
48
|
-
"data-border": canActive && !!setting?.borderActive ? 'active' : 'deactive',
|
|
49
|
-
children: [
|
|
50
|
-
/*#__PURE__*/ jsxRuntime.jsx(NextImage.default, {
|
|
51
|
-
src: imageSrc,
|
|
52
|
-
width: image?.width,
|
|
53
|
-
height: image?.height,
|
|
54
|
-
alt: image?.alt,
|
|
55
|
-
setting: {
|
|
56
|
-
aspectRatio: common.getAspectRatio(shapeByLayout),
|
|
57
|
-
layout: setting?.layout
|
|
58
|
-
},
|
|
59
|
-
style: {
|
|
60
|
-
width: '100%',
|
|
61
|
-
height: '100%'
|
|
62
|
-
}
|
|
63
|
-
}, image?.id),
|
|
64
|
-
/*#__PURE__*/ jsxRuntime.jsx(MediaIcon.default, {
|
|
65
|
-
contentType: image?.contentType || ''
|
|
66
|
-
}),
|
|
67
|
-
setting?.galleryHoverEffect !== 'none' && !productFeaturedImage.isFeatureMedia(image?.contentType) && /*#__PURE__*/ jsxRuntime.jsx(NextImage.default, {
|
|
68
|
-
src: imageSrc,
|
|
69
|
-
width: image?.width,
|
|
70
|
-
height: image?.height,
|
|
71
|
-
alt: image?.alt,
|
|
72
|
-
setting: {
|
|
73
|
-
layout: setting.layout,
|
|
74
|
-
aspectRatio: common.getAspectRatio(shapeByLayout)
|
|
75
|
-
},
|
|
76
|
-
className: core.cls('hover-image !gp-max-w-none', productFeaturedImage.getZoomImageClass())
|
|
77
|
-
}),
|
|
78
|
-
setting?.galleryHoverEffect == 'zoom' && setting?.galleryZoomType == 'glasses' && [
|
|
79
|
-
'one-col',
|
|
80
|
-
'two-col'
|
|
81
|
-
].includes(core.getResponsiveValueByScreen(setting.position, currentDevice) || '') && !productFeaturedImage.isFeatureMedia(image?.contentType) && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
82
|
-
className: core.cls(productFeaturedImage.getZoomLenClass(), 'room-len'),
|
|
83
|
-
style: {
|
|
84
|
-
...core.makeStyle({
|
|
85
|
-
bgi: `url("${image?.src}")`
|
|
86
|
-
})
|
|
87
|
-
}
|
|
88
|
-
}),
|
|
89
|
-
core.getResponsiveValueByScreen(setting?.clickOpenLightBox, currentDevice) && /*#__PURE__*/ jsxRuntime.jsx(ButtonOpenLightBox.default, {})
|
|
90
|
-
]
|
|
91
|
-
}, image?.id));
|
|
92
|
-
}),
|
|
93
|
-
children
|
|
94
|
-
]
|
|
95
|
-
})
|
|
96
|
-
});
|
|
97
|
-
};
|
|
98
|
-
var ProductGalleryGrid$1 = /*#__PURE__*/ React.memo(ProductGalleryGrid);
|
|
99
|
-
|
|
100
|
-
exports.default = ProductGalleryGrid$1;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var core = require('@gem-sdk/core');
|
|
7
|
-
var GalleryCarousel = require('../gallery-carousel/GalleryCarousel.js');
|
|
8
|
-
var ProductGalleryGrid = require('../child/ProductGalleryGrid.js');
|
|
9
|
-
var ProductFeaturedImageCarousel = require('../child/ProductFeaturedImageCarousel.js');
|
|
10
|
-
var getProductImagesStyles = require('../../composables/getProductImagesStyles.js');
|
|
11
|
-
var getProductImagesClassName = require('../../composables/getProductImagesClassName.js');
|
|
12
|
-
var useFeatureImageWithGallery = require('../../hooks/useFeatureImageWithGallery.js');
|
|
13
|
-
|
|
14
|
-
const FeatureImageWithGallery = (props)=>{
|
|
15
|
-
const { setting, styles, builderProps, gallery, onHandleClickImage, priorityFeatureImage, children, noDataChildren } = props;
|
|
16
|
-
const settings = {
|
|
17
|
-
...setting,
|
|
18
|
-
...styles
|
|
19
|
-
};
|
|
20
|
-
const { isShowCarousel, featureImageHeight, featureWrapperImage, onClickFeatureArrow, activeIndexFromFeatureImage, setOnClickFeatureArrow, onHandleLoadedFeatureImage, setActiveIndexFromFeatureImage } = useFeatureImageWithGallery.useFeatureImageWithGallery(props);
|
|
21
|
-
if (gallery?.[0]?.id === 'noImageError') {
|
|
22
|
-
return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
23
|
-
children: noDataChildren
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
const { ftImageGalleryClasses, imageGalleryWrapperClasses } = getProductImagesClassName.getProductImagesClassName(props);
|
|
27
|
-
const { wrapperFeaturedImageStyle, featureImageStyle, galleryImageStyle } = getProductImagesStyles.getProductImagesStyles(settings, {
|
|
28
|
-
gallery,
|
|
29
|
-
featureImageHeight
|
|
30
|
-
});
|
|
31
|
-
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
32
|
-
className: core.cls('gp-grid gp-w-full gp-relative'),
|
|
33
|
-
style: wrapperFeaturedImageStyle,
|
|
34
|
-
children: [
|
|
35
|
-
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
36
|
-
className: ftImageGalleryClasses,
|
|
37
|
-
style: featureImageStyle,
|
|
38
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(ProductFeaturedImageCarousel.default, {
|
|
39
|
-
imgRef: featureWrapperImage,
|
|
40
|
-
productImages: gallery,
|
|
41
|
-
...settings,
|
|
42
|
-
onHandleClick: (imageID, enableOpenLightBox)=>onHandleClickImage(imageID || '', enableOpenLightBox),
|
|
43
|
-
onHandleLoaded: onHandleLoadedFeatureImage,
|
|
44
|
-
onHandleUpdateActiveIndex: setActiveIndexFromFeatureImage,
|
|
45
|
-
onClickArrow: (randomKey)=>setOnClickFeatureArrow(randomKey),
|
|
46
|
-
builderPropUID: builderProps?.uid,
|
|
47
|
-
builderPropsClass: `gp-product-images-feature-${builderProps?.uid}`,
|
|
48
|
-
children: children
|
|
49
|
-
})
|
|
50
|
-
}),
|
|
51
|
-
gallery.length > 1 && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
52
|
-
className: imageGalleryWrapperClasses,
|
|
53
|
-
style: galleryImageStyle,
|
|
54
|
-
children: isShowCarousel ? /*#__PURE__*/ jsxRuntime.jsx(GalleryCarousel.default, {
|
|
55
|
-
productImages: gallery,
|
|
56
|
-
position: settings?.position,
|
|
57
|
-
...settings,
|
|
58
|
-
builderPropUID: builderProps?.uid,
|
|
59
|
-
onHandleClick: (imageID, enableOpenLightBox)=>onHandleClickImage(imageID || '', enableOpenLightBox),
|
|
60
|
-
activeIndexFormFeatureImage: activeIndexFromFeatureImage,
|
|
61
|
-
priorityFeatureImage: priorityFeatureImage,
|
|
62
|
-
onClickFeatureArrow: onClickFeatureArrow,
|
|
63
|
-
builderPropsClass: `gp-product-images-gallery-${builderProps?.uid}`
|
|
64
|
-
}) : /*#__PURE__*/ jsxRuntime.jsx(ProductGalleryGrid.default, {
|
|
65
|
-
productImages: gallery,
|
|
66
|
-
...settings,
|
|
67
|
-
builderPropUID: builderProps?.uid,
|
|
68
|
-
onHandleClick: (imageID, enableOpenLightBox)=>onHandleClickImage(imageID || '', enableOpenLightBox),
|
|
69
|
-
activeIndexFormFeatureImage: activeIndexFromFeatureImage,
|
|
70
|
-
isHiddenInteraction: true
|
|
71
|
-
})
|
|
72
|
-
})
|
|
73
|
-
]
|
|
74
|
-
});
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
exports.default = FeatureImageWithGallery;
|
|
@@ -1,300 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var core = require('@gem-sdk/core');
|
|
6
|
-
var common = require('../../common/common.js');
|
|
7
|
-
var productFeaturedImage = require('../../common/productFeaturedImage.js');
|
|
8
|
-
var HTML5Embed_liquid = require('../../../../../video/components/HTML5Embed.liquid.js');
|
|
9
|
-
var Modal3d_liquid = require('../../../../../image/components/Modal3d.liquid.js');
|
|
10
|
-
var NextImage_liquid = require('../../../../../image/components/NextImage.liquid.js');
|
|
11
|
-
var Video_liquid = require('../../../../../image/components/Video.liquid.js');
|
|
12
|
-
var _function = require('../../../../helpers/function.js');
|
|
13
|
-
var getProductImagesStyles = require('../../composables/getProductImagesStyles.js');
|
|
14
|
-
var getProductImagesClassName = require('../../composables/getProductImagesClassName.js');
|
|
15
|
-
var getProductImagesAttr = require('../../composables/getProductImagesAttr.js');
|
|
16
|
-
var system = require('@gem-sdk/system');
|
|
17
|
-
var SwiperItem_liquid = require('../../../../../swiper-carousel/carousel-item/SwiperItem.liquid.js');
|
|
18
|
-
var Swiper_liquid = require('../../../../../swiper-carousel/root/Swiper.liquid.js');
|
|
19
|
-
|
|
20
|
-
const FeatureImageWithGallery = ({ builderPropUID, children, enableLazyLoadImage, ...setting })=>{
|
|
21
|
-
const { featuredImageCarouselClasses, galleryItemClasses, featuredCarouselItemClasses } = getProductImagesClassName.getProductImagesClassName(setting);
|
|
22
|
-
const { featuredImageCarouselStyle, featureImageStyle, featureImageCarouselOnlyOneImageStyle, featureImageOnlyOneImageStyle, featureImageCarouselItemStyle } = getProductImagesStyles.getProductImagesStyles(setting);
|
|
23
|
-
const { featuredImageCarouselSettingAttrs } = getProductImagesAttr.getProductImagesAttr(setting);
|
|
24
|
-
const ftAspectRatio = common.getAspectRatio(setting.ftShape);
|
|
25
|
-
const renderFeatured = ()=>{
|
|
26
|
-
return `
|
|
27
|
-
{% case featureMedia.media_type %}
|
|
28
|
-
{% when 'image' %}
|
|
29
|
-
${renderImageWithHoverAction()}
|
|
30
|
-
{% when 'external_video' %}
|
|
31
|
-
{% assign mediaSourceVideo = featureMedia | external_video_url %}
|
|
32
|
-
${renderExternalVideo()}
|
|
33
|
-
{% when 'video' %}
|
|
34
|
-
{% assign mediaSourceVideo = featureMedia.sources.last.url %}
|
|
35
|
-
${renderVideo()}
|
|
36
|
-
{% when 'model' %}
|
|
37
|
-
${renderModel3d()}
|
|
38
|
-
{% else %}
|
|
39
|
-
${renderNoImage()}
|
|
40
|
-
{% endcase %}
|
|
41
|
-
`;
|
|
42
|
-
};
|
|
43
|
-
const renderModel3d = ()=>{
|
|
44
|
-
return Modal3d_liquid.default({
|
|
45
|
-
src: system.LiquidIf(`featureMedia.sources.first.url contains '.glb'`, `{{ featureMedia.sources.first.url }}`, `{{featureMedia.sources.last.url}}`),
|
|
46
|
-
alt: '{{featureMedia.preview_image.alt}}',
|
|
47
|
-
poster: `{{featureMedia.preview_image.src | product_img_url: '1024x1024'}}`,
|
|
48
|
-
cameraControls: true,
|
|
49
|
-
arStatus: 'not-presenting',
|
|
50
|
-
style: {
|
|
51
|
-
width: '100%'
|
|
52
|
-
},
|
|
53
|
-
aspectRatio: ftAspectRatio
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
const renderExternalVideo = ()=>{
|
|
57
|
-
return Video_liquid.default({
|
|
58
|
-
src: `{{mediaSourceVideo}}`,
|
|
59
|
-
alt: '{{featureMedia.alt}}',
|
|
60
|
-
autoplay: false,
|
|
61
|
-
allowfullscreen: true,
|
|
62
|
-
controls: true,
|
|
63
|
-
style: {
|
|
64
|
-
width: '100%',
|
|
65
|
-
height: '100%'
|
|
66
|
-
},
|
|
67
|
-
aspectRatio: ftAspectRatio
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
const renderVideo = ()=>{
|
|
71
|
-
return HTML5Embed_liquid.default({
|
|
72
|
-
src: `{{mediaSourceVideo}}`,
|
|
73
|
-
title: '{{featureMedia.alt}}',
|
|
74
|
-
autoplay: false,
|
|
75
|
-
controls: true,
|
|
76
|
-
style: {
|
|
77
|
-
width: '100%',
|
|
78
|
-
'max-height': '100%'
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
};
|
|
82
|
-
const renderImageWithHoverAction = ()=>{
|
|
83
|
-
return core.template`
|
|
84
|
-
${renderFeaturedImageOnly(core.cls('gp-w-full gp-transition-opacity', {
|
|
85
|
-
'group-hover:gp-opacity-0': setting.hoverEffect == 'other'
|
|
86
|
-
}, `{{shouldHidden}}`))}
|
|
87
|
-
${system.If(setting?.hoverEffect !== 'none', `<div class="${core.cls('zoom-element !gp-max-w-none', productFeaturedImage.getZoomImageClass())}">
|
|
88
|
-
${renderFeaturedImageOnly('image-zoom', true)}
|
|
89
|
-
</div>`, ' ')}
|
|
90
|
-
${system.If(setting?.hoverEffect == 'zoom' && setting?.zoomType == 'glasses', `<div class="${core.cls('zoom-lens-element', productFeaturedImage.getZoomLenClass())}" style="opacity: 0; background-image: url('{{ featureMedia.src | img_url: "1024x1024"}}')"></div>`, ' ')}
|
|
91
|
-
`;
|
|
92
|
-
};
|
|
93
|
-
const renderFeaturedImageOnly = (className, hasHoverEffect)=>{
|
|
94
|
-
return core.template`
|
|
95
|
-
{% assign src = featureMedia.src %}
|
|
96
|
-
${system.If(hasHoverEffect && setting.hoverEffect == 'other', `{% assign otherImage = product.media[${setting.otherImage}] %}
|
|
97
|
-
{% assign src = otherImage.src %}
|
|
98
|
-
${system.LiquidIf(`otherImage.media_type != 'image'`, `{% assign src = otherImage.preview_image.src %}`)}
|
|
99
|
-
`)}
|
|
100
|
-
${NextImage_liquid.default({
|
|
101
|
-
srcIsLiquidCode: true,
|
|
102
|
-
src: system.LiquidIf(`src != null`, common.getSrcImage('src'), `{{ 'https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif' }}`),
|
|
103
|
-
id: system.LiquidIf(`featureMedia != null`, `{{featureMedia.id}}`),
|
|
104
|
-
width: `{{featureMedia.width}}`,
|
|
105
|
-
height: `{{featureMedia.height}}`,
|
|
106
|
-
alt: `{{featureMedia.alt}}`,
|
|
107
|
-
srcset: `${common.getSrcImage('src')}`,
|
|
108
|
-
baseSrc: `{{src | image_url}}`,
|
|
109
|
-
sizes: `(max-width: 768px) 50vw, 100vw`,
|
|
110
|
-
setting: {
|
|
111
|
-
layout: setting?.ftLayout,
|
|
112
|
-
aspectRatio: ftAspectRatio,
|
|
113
|
-
qualityType: setting?.qualityType,
|
|
114
|
-
qualityPercent: setting?.qualityPercent
|
|
115
|
-
},
|
|
116
|
-
priority: setting?.preload,
|
|
117
|
-
className: `gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none ${className}`,
|
|
118
|
-
enableLazyLoadImage
|
|
119
|
-
})}`;
|
|
120
|
-
};
|
|
121
|
-
const renderNoImage = ()=>{
|
|
122
|
-
return core.template`
|
|
123
|
-
${NextImage_liquid.default({
|
|
124
|
-
srcIsLiquidCode: true,
|
|
125
|
-
src: 'https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif',
|
|
126
|
-
alt: `No Image`,
|
|
127
|
-
sizes: `(max-width: 768px) 50vw, 100vw`,
|
|
128
|
-
setting: {
|
|
129
|
-
layout: setting?.ftLayout,
|
|
130
|
-
aspectRatio: ftAspectRatio,
|
|
131
|
-
qualityType: setting?.qualityType,
|
|
132
|
-
qualityPercent: setting?.qualityPercent
|
|
133
|
-
},
|
|
134
|
-
priority: setting?.preload,
|
|
135
|
-
className: `gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none`,
|
|
136
|
-
enableLazyLoadImage
|
|
137
|
-
})}`;
|
|
138
|
-
};
|
|
139
|
-
const paddingBottomValue = common.getPaddingBottomByShapeSetting(setting.ftShape);
|
|
140
|
-
const renderCarouselGalleryItem = (className)=>{
|
|
141
|
-
return `
|
|
142
|
-
${system.Liquid(`{% assign productImageWidth = 0 %}
|
|
143
|
-
{% case featureMedia.media_type %}
|
|
144
|
-
{% when 'image' %}
|
|
145
|
-
{% assign productImageWidth = featureMedia.width %}
|
|
146
|
-
{% else %}
|
|
147
|
-
{% assign productImageWidth = featureMedia.preview_image.width %}
|
|
148
|
-
{% endcase %}`)}
|
|
149
|
-
${SwiperItem_liquid.default({
|
|
150
|
-
id: '{{section.id}}-{{imageID}}',
|
|
151
|
-
contentType: 'productImage',
|
|
152
|
-
className: `${galleryItemClasses(`gp-ft-image-item ${className}`)}`,
|
|
153
|
-
parentId: `${builderPropUID}-{{section.id}}-{{product.id}}`,
|
|
154
|
-
style: featureImageCarouselItemStyle,
|
|
155
|
-
customStyle: {
|
|
156
|
-
width: '{{productImageWidth}}px'
|
|
157
|
-
},
|
|
158
|
-
children: `
|
|
159
|
-
<div
|
|
160
|
-
class="gp-w-full gp-relative ${system.LiquidIf(`featureMedia == null or featureMedia.media_type == 'image'`, `{{ 'gp-h-0' }}`, `{{ 'gp-h-full !gp-pb-0' }}`)}"
|
|
161
|
-
style="${_function.getStyleOfObject(core.makeStyleResponsive('pb', paddingBottomValue))} ${system.LiquidIf(`featureMedia.media_type == 'video' or featureMedia.media_type == 'external_video'`, `{{ 'display: flex; align-items: center; justify-content: center' }}`)}"
|
|
162
|
-
>
|
|
163
|
-
${renderFeatured()}
|
|
164
|
-
</div>
|
|
165
|
-
`
|
|
166
|
-
})}`;
|
|
167
|
-
};
|
|
168
|
-
const isRenderFeatureCarousel = productFeaturedImage.checkRenderFeaturedCarousel(setting);
|
|
169
|
-
const FEATURE_IMAGE_WRAPPER_CLASS = 'gp-featured-image-wrapper';
|
|
170
|
-
const carouselChildren = system.LiquidIf(`product.media.size > 0`, `${system.LiquidFor(`media in product.media`, `${children || ''} {% assign largestRatio = 0 %}
|
|
171
|
-
${system.LiquidFor(`featureMedia in product.media`, `{% assign height = featureMedia.height | times: 1.0 %}
|
|
172
|
-
{% assign width = featureMedia.width | times: 1.0 %}
|
|
173
|
-
{% assign ratio = height | divided_by: width %}
|
|
174
|
-
${system.LiquidIf(`ratio > largestRatio`, `{% assign largestRatio = ratio %}`)}`)}
|
|
175
|
-
${system.LiquidFor(`featureMedia in product.media`, `${system.LiquidIf(`featureMedia.media_type == 'image'`, `${system.LiquidFor(`image in product.images`, system.LiquidIf(`image.src == featureMedia.src`, `{% assign imageID = image.id %}{% break %}`))}`, `{% assign imageID = '' %}`)}
|
|
176
|
-
${renderCarouselGalleryItem()}`)}`)}`, NextImage_liquid.default({
|
|
177
|
-
src: `{{ 'https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif' }}`,
|
|
178
|
-
id: `noImageError`,
|
|
179
|
-
width: `480`,
|
|
180
|
-
height: `480`,
|
|
181
|
-
alt: `no image`,
|
|
182
|
-
priority: setting?.preload,
|
|
183
|
-
setting: {
|
|
184
|
-
layout: setting?.ftLayout,
|
|
185
|
-
aspectRatio: ftAspectRatio,
|
|
186
|
-
qualityType: setting?.qualityType,
|
|
187
|
-
qualityPercent: setting?.qualityPercent
|
|
188
|
-
},
|
|
189
|
-
style: {
|
|
190
|
-
height: '100%'
|
|
191
|
-
},
|
|
192
|
-
className: `gp-w-full featured-image-only !gp-rounded-none`,
|
|
193
|
-
customLazyload: true,
|
|
194
|
-
enableLazyLoadImage
|
|
195
|
-
}));
|
|
196
|
-
const renderFeatureImageCarousel = ()=>{
|
|
197
|
-
return `
|
|
198
|
-
${Swiper_liquid.default({
|
|
199
|
-
builderProps: {
|
|
200
|
-
uid: builderPropUID
|
|
201
|
-
},
|
|
202
|
-
rootId: `ft-${builderPropUID}-{{section.id}}-{{product.id}}`,
|
|
203
|
-
conditionAppendJs: 'product.media.size > 1',
|
|
204
|
-
wrapperClass: FEATURE_IMAGE_WRAPPER_CLASS,
|
|
205
|
-
rootClass: `${featuredImageCarouselClasses}`,
|
|
206
|
-
rootAttrs: {
|
|
207
|
-
type: 'gp-feature-image-carousel',
|
|
208
|
-
'product-id': '{{product.id}}',
|
|
209
|
-
'product-media': '{{product.media.size}}'
|
|
210
|
-
},
|
|
211
|
-
isHiddenArrowWhenDisabled: true,
|
|
212
|
-
setting: featuredImageCarouselSettingAttrs,
|
|
213
|
-
rootStyles: featureImageStyle,
|
|
214
|
-
styles: featuredImageCarouselStyle,
|
|
215
|
-
style: {
|
|
216
|
-
playSpeed: 600
|
|
217
|
-
},
|
|
218
|
-
disableMarginAuto: true,
|
|
219
|
-
children: carouselChildren
|
|
220
|
-
})}
|
|
221
|
-
`;
|
|
222
|
-
};
|
|
223
|
-
const getVariantByPreDisplay = ()=>{
|
|
224
|
-
switch(setting?.preDisplay){
|
|
225
|
-
case '1st-images':
|
|
226
|
-
return `
|
|
227
|
-
{% assign featureMedia = product.media.first %}
|
|
228
|
-
`;
|
|
229
|
-
case '1st-3d-mode':
|
|
230
|
-
return system.LiquidFor(`media in product.media`, system.LiquidIf(`media.media_type == 'model'`, `{% assign featureMedia = media %}{% break %}`));
|
|
231
|
-
case '1st-video':
|
|
232
|
-
return system.LiquidFor(`media in product.media`, system.LiquidIf(`media.media_type == 'video' or media.media_type == 'external_video'`, `{% assign featureMedia = media %}{% break %}`));
|
|
233
|
-
default:
|
|
234
|
-
return `
|
|
235
|
-
{% assign featureMedia = variant.featured_media %}
|
|
236
|
-
{% unless featureMedia %}
|
|
237
|
-
{% assign featureMedia = product.featured_media %}
|
|
238
|
-
{% endunless %}
|
|
239
|
-
`;
|
|
240
|
-
}
|
|
241
|
-
};
|
|
242
|
-
const renderFeatureImageCarouselOnlyOneImage = ()=>{
|
|
243
|
-
return system.Liquid(`
|
|
244
|
-
{% assign featureMedia = variant.featured_media %}
|
|
245
|
-
{% unless featureMedia %}
|
|
246
|
-
{% assign featureMedia = product.featured_media %}
|
|
247
|
-
{% endunless %}
|
|
248
|
-
${system.LiquidIf(`product.media.size > 1`, getVariantByPreDisplay())}
|
|
249
|
-
{% assign largestRatio = 0 %}
|
|
250
|
-
{% assign height = featureMedia.height | times: 1.0 %}
|
|
251
|
-
{% assign width = featureMedia.width | times: 1.0 %}
|
|
252
|
-
{% assign ratio = height | divided_by: width %}
|
|
253
|
-
${system.LiquidIf(`ratio > largestRatio`, `{% assign largestRatio = ratio %}`)}
|
|
254
|
-
{% assign productImageWidth = 0 %}
|
|
255
|
-
{% case featureMedia.media_type %}
|
|
256
|
-
{% when 'image' %}
|
|
257
|
-
{% assign productImageWidth = featureMedia.width %}
|
|
258
|
-
{% else %}
|
|
259
|
-
{% assign productImageWidth = featureMedia.preview_image.width %}
|
|
260
|
-
{% endcase %}
|
|
261
|
-
${system.LiquidIf(`featureMedia == null`, `{% assign productImageWidth = 1600 %}`)}
|
|
262
|
-
<div
|
|
263
|
-
class='gp-feature-image-carousel gp-feature-image-only'
|
|
264
|
-
style="${_function.getStyleOfObject(featureImageStyle)}"
|
|
265
|
-
>
|
|
266
|
-
<div
|
|
267
|
-
class="gp-relative"
|
|
268
|
-
style="${_function.getStyleOfObject(featureImageOnlyOneImageStyle)}"
|
|
269
|
-
>
|
|
270
|
-
${children}
|
|
271
|
-
<div
|
|
272
|
-
type="gp-feature-image-only"
|
|
273
|
-
product-id="{{product.id}}"
|
|
274
|
-
product-media="{{product.media.size}}"
|
|
275
|
-
class="${featuredCarouselItemClasses(FEATURE_IMAGE_WRAPPER_CLASS)}
|
|
276
|
-
style="${_function.getStyleOfObject(featureImageCarouselOnlyOneImageStyle)}"
|
|
277
|
-
>
|
|
278
|
-
<div
|
|
279
|
-
class="gp-w-full gp-relative ${system.LiquidIf(`featureMedia == null or featureMedia.media_type == 'image'`, `{{ 'gp-h-0' }}`, `{{ 'gp-h-full !gp-pb-0' }}`)}"
|
|
280
|
-
style="${_function.getStyleOfObject(core.makeStyleResponsive('pb', paddingBottomValue))} ${system.LiquidIf(`featureMedia.media_type == 'video' or featureMedia.media_type == 'external_video'`, `{{ 'display: flex; align-items: center; justify-content: center' }}`)}"
|
|
281
|
-
>
|
|
282
|
-
${renderFeatured()}
|
|
283
|
-
</div>
|
|
284
|
-
</div>
|
|
285
|
-
</div>
|
|
286
|
-
</div>
|
|
287
|
-
`);
|
|
288
|
-
};
|
|
289
|
-
return system.Liquid(`
|
|
290
|
-
{% capture featureImageOnlyOne %}
|
|
291
|
-
${renderFeatureImageCarouselOnlyOneImage()}
|
|
292
|
-
{% endcapture %}
|
|
293
|
-
${system.LiquidIf(`product.media.size > 1`, `
|
|
294
|
-
${system.If(isRenderFeatureCarousel, renderFeatureImageCarousel(), ' ')}
|
|
295
|
-
${system.If(!isRenderFeatureCarousel, `{{ featureImageOnlyOne }}`, ' ')}
|
|
296
|
-
`, `{{ featureImageOnlyOne }}`)}
|
|
297
|
-
`);
|
|
298
|
-
};
|
|
299
|
-
|
|
300
|
-
exports.default = FeatureImageWithGallery;
|
package/dist/cjs/product/components/ProductImagesV3/components/feature-only/OnlyFeatureImage.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
-
|
|
6
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
-
var ProductFeaturedImageCarousel = require('../child/ProductFeaturedImageCarousel.js');
|
|
8
|
-
var getProductImagesClassName = require('../../composables/getProductImagesClassName.js');
|
|
9
|
-
var getProductImagesStyles = require('../../composables/getProductImagesStyles.js');
|
|
10
|
-
|
|
11
|
-
const OnlyFeatureImage = (productImageProps)=>{
|
|
12
|
-
const { setting, styles, gallery, builderProps, noDataChildren, onHandleClickImage, children } = productImageProps;
|
|
13
|
-
const settings = {
|
|
14
|
-
...setting,
|
|
15
|
-
...styles
|
|
16
|
-
};
|
|
17
|
-
if (gallery?.[0]?.id === 'noImageError') {
|
|
18
|
-
return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
19
|
-
children: noDataChildren
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
23
|
-
const { featureImageOnlyOneImageClasses } = getProductImagesClassName.getProductImagesClassName(settings);
|
|
24
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
25
|
-
const { featureImageStyle } = getProductImagesStyles.getProductImagesStyles(settings);
|
|
26
|
-
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
27
|
-
className: featureImageOnlyOneImageClasses,
|
|
28
|
-
style: featureImageStyle,
|
|
29
|
-
children: [
|
|
30
|
-
/*#__PURE__*/ jsxRuntime.jsx(ProductFeaturedImageCarousel.default, {
|
|
31
|
-
productImages: gallery,
|
|
32
|
-
...settings,
|
|
33
|
-
onHandleClick: (imageID, enableOpenLightBox)=>{
|
|
34
|
-
onHandleClickImage(imageID || '', enableOpenLightBox);
|
|
35
|
-
},
|
|
36
|
-
builderPropUID: builderProps?.uid,
|
|
37
|
-
builderPropsClass: `gp-product-images-gallery-${builderProps?.uid}`
|
|
38
|
-
}),
|
|
39
|
-
children
|
|
40
|
-
]
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
exports.default = OnlyFeatureImage;
|
package/dist/cjs/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var core = require('@gem-sdk/core');
|
|
7
|
-
var common = require('../../common/common.js');
|
|
8
|
-
var productGallery = require('../../common/productGallery.js');
|
|
9
|
-
var getProductImagesClassName = require('../../composables/getProductImagesClassName.js');
|
|
10
|
-
var getProductImagesStyles = require('../../composables/getProductImagesStyles.js');
|
|
11
|
-
var getProductImagesAttr = require('../../composables/getProductImagesAttr.js');
|
|
12
|
-
var productFeaturedImage = require('../../common/productFeaturedImage.js');
|
|
13
|
-
var MediaIcon = require('../child/MediaIcon.js');
|
|
14
|
-
var ButtonOpenLightBox = require('../lightbox/ButtonOpenLightBox.js');
|
|
15
|
-
var NextImage = require('../../../../../image/components/NextImage.js');
|
|
16
|
-
var Carousel = require('../../../../../carousel/root/Carousel.js');
|
|
17
|
-
var CarouselItem = require('../../../../../carousel/carousel-item/CarouselItem.js');
|
|
18
|
-
var useGalleryCarousel = require('../../hooks/useGalleryCarousel.js');
|
|
19
|
-
var system = require('@gem-sdk/system');
|
|
20
|
-
|
|
21
|
-
const ProductGalleryCarousel = (props)=>{
|
|
22
|
-
const { builderPropUID, productImages, // onHandleClick,
|
|
23
|
-
activeIndexFormFeatureImage, onClickFeatureArrow, builderPropsClass, arrow, priorityFeatureImage, ...setting } = props;
|
|
24
|
-
const currentDevice = core.useCurrentDevice();
|
|
25
|
-
const { galleryItemClasses } = getProductImagesClassName.getProductImagesClassName(setting);
|
|
26
|
-
const { galleryCarouselSettingAttrs } = getProductImagesAttr.getProductImagesAttr(setting);
|
|
27
|
-
const { galleryCarouselStyle, galleryCarouselItemStyle } = getProductImagesStyles.getProductImagesStyles(setting);
|
|
28
|
-
const { moveToIdx, isDisplay, shapeByLayout, isEnableBorderActive, isShowButtonLightbox, filteredProductImages, handleClickCarouselItem } = useGalleryCarousel.useGalleryCarousel(props);
|
|
29
|
-
return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
30
|
-
children: isDisplay && /*#__PURE__*/ jsxRuntime.jsx(Carousel.default, {
|
|
31
|
-
parentClass: builderPropsClass,
|
|
32
|
-
rootClass: builderPropsClass,
|
|
33
|
-
setting: galleryCarouselSettingAttrs,
|
|
34
|
-
styles: galleryCarouselStyle,
|
|
35
|
-
slidesClass: productGallery.getEditorMinHeightClass(currentDevice, setting.position, setting.navigationPosition),
|
|
36
|
-
builderProps: {
|
|
37
|
-
uid: `${builderPropUID}-carousel`
|
|
38
|
-
},
|
|
39
|
-
moveToIdx: moveToIdx,
|
|
40
|
-
isHiddenArrowWhenDisabled: true,
|
|
41
|
-
disableMarginAuto: true,
|
|
42
|
-
children: filteredProductImages?.map((image, index)=>{
|
|
43
|
-
const canActive = index === moveToIdx;
|
|
44
|
-
const imageSrc = productFeaturedImage.isFeatureMedia(image.contentType) ? image.previewImage : image.src;
|
|
45
|
-
return /*#__PURE__*/ jsxRuntime.jsxs(CarouselItem.default, {
|
|
46
|
-
contentType: "productImage",
|
|
47
|
-
className: galleryItemClasses(`gp-gallery-image-item gem-slider-item-${builderPropUID} ${canActive && isEnableBorderActive ? 'gem-slider-item-active' : ''}`),
|
|
48
|
-
onClickItem: ()=>handleClickCarouselItem(image?.id),
|
|
49
|
-
style: galleryCarouselItemStyle,
|
|
50
|
-
"data-id": image?.id,
|
|
51
|
-
"data-border": canActive && !!setting?.borderActive ? 'active' : 'deactive',
|
|
52
|
-
children: [
|
|
53
|
-
/*#__PURE__*/ jsxRuntime.jsx(NextImage.default, {
|
|
54
|
-
draggable: "false",
|
|
55
|
-
src: imageSrc,
|
|
56
|
-
width: image?.width,
|
|
57
|
-
height: image?.height,
|
|
58
|
-
alt: image?.alt,
|
|
59
|
-
setting: {
|
|
60
|
-
aspectRatio: common.getAspectRatio(shapeByLayout),
|
|
61
|
-
layout: setting?.layout,
|
|
62
|
-
qualityPercent: setting?.qualityPercent,
|
|
63
|
-
qualityType: setting?.qualityType
|
|
64
|
-
},
|
|
65
|
-
style: {
|
|
66
|
-
width: '100%',
|
|
67
|
-
height: '100%',
|
|
68
|
-
cursor: 'pointer'
|
|
69
|
-
},
|
|
70
|
-
className: "product-list-image"
|
|
71
|
-
}),
|
|
72
|
-
/*#__PURE__*/ jsxRuntime.jsx(MediaIcon.default, {
|
|
73
|
-
contentType: image?.contentType || ''
|
|
74
|
-
}),
|
|
75
|
-
system.If(isShowButtonLightbox, /*#__PURE__*/ jsxRuntime.jsx(ButtonOpenLightBox.default, {}))
|
|
76
|
-
]
|
|
77
|
-
}, image?.id);
|
|
78
|
-
})
|
|
79
|
-
})
|
|
80
|
-
});
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
exports.default = ProductGalleryCarousel;
|