@gem-sdk/components 2.0.0-dev.370 → 2.0.0-dev.371
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/builder.js +2 -2
- package/dist/cjs/button/setting/configs/settings.js +0 -14
- package/dist/cjs/carousel/arrow/Arrow.js +52 -0
- package/dist/cjs/carousel/arrow/Arrow.liquid.js +46 -0
- package/dist/cjs/carousel/{components/common/arrow.js → arrow/common/common.js} +13 -11
- package/dist/cjs/carousel/arrow/common/getClass.js +50 -0
- package/dist/cjs/carousel/arrow/common/getStyle.js +84 -0
- package/dist/cjs/carousel/carousel-item/CarouselItem.js +32 -0
- package/dist/cjs/carousel/carousel-item/CarouselItem.liquid.js +38 -0
- package/dist/cjs/carousel/carousel-item/common/getClass.js +29 -0
- package/dist/cjs/carousel/{components/CarouselItem.liquid.js → carousel-item/common/getStyle.js} +30 -47
- package/dist/cjs/carousel/carousel-item/hook/useCarouseItem.js +14 -0
- package/dist/cjs/carousel/components/const/index.js +5 -0
- package/dist/cjs/carousel/dots/Dots.js +51 -0
- package/dist/cjs/carousel/dots/Dots.liquid.js +26 -0
- package/dist/cjs/carousel/dots/common/common.js +46 -0
- package/dist/cjs/carousel/dots/common/getClass.js +40 -0
- package/dist/cjs/carousel/dots/common/getStyle.js +33 -0
- package/dist/cjs/carousel/dots/hook/useDotsSetting.js +21 -0
- package/dist/cjs/carousel/index.js +1 -2
- package/dist/cjs/carousel/next.js +2 -2
- package/dist/cjs/carousel/root/Carousel.js +129 -0
- package/dist/cjs/carousel/root/Carousel.liquid.js +104 -0
- package/dist/cjs/carousel/root/common/getAttr.js +25 -0
- package/dist/cjs/carousel/root/common/getClass.js +135 -0
- package/dist/cjs/carousel/root/common/getData.js +56 -0
- package/dist/cjs/carousel/root/common/getStyle.js +64 -0
- package/dist/cjs/carousel/{components/Carousel.js → root/hook/useCarousel.js} +153 -321
- package/dist/cjs/carousel/setting/Carousel.js +8 -1555
- package/dist/cjs/carousel/setting/configs/presets.js +380 -0
- package/dist/cjs/carousel/setting/configs/settingV2.js +771 -0
- package/dist/cjs/carousel/setting/configs/uiV1.js +434 -0
- package/dist/cjs/carousel/setting/configs/uiV2.js +627 -0
- package/dist/cjs/common/components/NoDataState.js +5 -5
- package/dist/cjs/grid/row/commons/common.js +3 -3
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.liquid.js +2 -2
- package/dist/cjs/product/components/ProductImages/ProductGalleryCarousel.js +2 -2
- package/dist/cjs/product/components/ProductImages/ProductImagesLightBox.js +2 -2
- package/dist/cjs/product/components/ProductImages/liquid/ProductGalleryCarousel.liquid.js +5 -3
- package/dist/cjs/product/components/ProductImagesV2/common/getAttr.js +1 -0
- package/dist/cjs/product/components/ProductImagesV2/common/productFeaturedImage.js +1 -1
- package/dist/cjs/product/components/ProductImagesV2/common/productGallery.js +1 -1
- package/dist/cjs/product/components/ProductImagesV2/components/child/ProductFeaturedImageCarousel.js +5 -5
- package/dist/cjs/product/components/ProductImagesV2/components/feature-gallery/FeatureImageWithGallery.liquid.js +8 -4
- package/dist/cjs/product/components/ProductImagesV2/components/gallery-carousel/GalleryCarousel.js +2 -2
- package/dist/cjs/product/components/ProductImagesV2/components/gallery-carousel/GalleryCarousel.liquid.js +6 -3
- package/dist/cjs/product/components/ProductImagesV2/components/lightbox/ProductImagesLightBox.js +2 -2
- package/dist/cjs/product/components/ProductImagesV2/hooks/useProductFeaturedImageCarousel.js +3 -3
- package/dist/cjs/product/components/ProductList/ProductListCarouselLayout.js +2 -2
- package/dist/cjs/product/components/ProductList/ProductListCarouselLayout.liquid.js +5 -3
- package/dist/cjs/product/components/ProductList/common/index.js +5 -5
- package/dist/cjs/product/components/ProductVariants/common/main/getAttr.js +1 -1
- package/dist/cjs/text/components/Text.js +3 -3
- package/dist/esm/builder.js +2 -2
- package/dist/esm/button/setting/configs/settings.js +0 -14
- package/dist/esm/carousel/arrow/Arrow.js +48 -0
- package/dist/esm/carousel/arrow/Arrow.liquid.js +42 -0
- package/dist/esm/carousel/{components/common/arrow.js → arrow/common/common.js} +12 -10
- package/dist/esm/carousel/arrow/common/getClass.js +48 -0
- package/dist/esm/carousel/arrow/common/getStyle.js +82 -0
- package/dist/esm/carousel/carousel-item/CarouselItem.js +28 -0
- package/dist/esm/carousel/carousel-item/CarouselItem.liquid.js +34 -0
- package/dist/esm/carousel/carousel-item/common/getClass.js +27 -0
- package/dist/esm/carousel/{components/CarouselItem.liquid.js → carousel-item/common/getStyle.js} +31 -46
- package/dist/esm/carousel/carousel-item/hook/useCarouseItem.js +12 -0
- package/dist/esm/carousel/components/const/index.js +3 -0
- package/dist/esm/carousel/dots/Dots.js +47 -0
- package/dist/esm/carousel/dots/Dots.liquid.js +22 -0
- package/dist/esm/carousel/dots/common/common.js +43 -0
- package/dist/esm/carousel/dots/common/getClass.js +38 -0
- package/dist/esm/carousel/dots/common/getStyle.js +31 -0
- package/dist/esm/carousel/dots/hook/useDotsSetting.js +19 -0
- package/dist/esm/carousel/index.js +1 -2
- package/dist/esm/carousel/next.js +2 -2
- package/dist/esm/carousel/root/Carousel.js +125 -0
- package/dist/esm/carousel/root/Carousel.liquid.js +100 -0
- package/dist/esm/carousel/root/common/getAttr.js +23 -0
- package/dist/esm/carousel/root/common/getClass.js +133 -0
- package/dist/esm/carousel/root/common/getData.js +54 -0
- package/dist/esm/carousel/root/common/getStyle.js +62 -0
- package/dist/esm/carousel/{components/Carousel.js → root/hook/useCarousel.js} +150 -316
- package/dist/esm/carousel/setting/Carousel.js +8 -1555
- package/dist/esm/carousel/setting/configs/presets.js +378 -0
- package/dist/esm/carousel/setting/configs/settingV2.js +769 -0
- package/dist/esm/carousel/setting/configs/uiV1.js +432 -0
- package/dist/esm/carousel/setting/configs/uiV2.js +625 -0
- package/dist/esm/common/components/NoDataState.js +6 -6
- package/dist/esm/grid/row/commons/common.js +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.liquid.js +2 -2
- package/dist/esm/product/components/ProductImages/ProductGalleryCarousel.js +2 -2
- package/dist/esm/product/components/ProductImages/ProductImagesLightBox.js +2 -2
- package/dist/esm/product/components/ProductImages/liquid/ProductGalleryCarousel.liquid.js +5 -3
- package/dist/esm/product/components/ProductImagesV2/common/getAttr.js +1 -0
- package/dist/esm/product/components/ProductImagesV2/common/productFeaturedImage.js +1 -1
- package/dist/esm/product/components/ProductImagesV2/common/productGallery.js +1 -1
- package/dist/esm/product/components/ProductImagesV2/components/child/ProductFeaturedImageCarousel.js +5 -5
- package/dist/esm/product/components/ProductImagesV2/components/feature-gallery/FeatureImageWithGallery.liquid.js +8 -4
- package/dist/esm/product/components/ProductImagesV2/components/gallery-carousel/GalleryCarousel.js +2 -2
- package/dist/esm/product/components/ProductImagesV2/components/gallery-carousel/GalleryCarousel.liquid.js +6 -3
- package/dist/esm/product/components/ProductImagesV2/components/lightbox/ProductImagesLightBox.js +2 -2
- package/dist/esm/product/components/ProductImagesV2/hooks/useProductFeaturedImageCarousel.js +3 -3
- package/dist/esm/product/components/ProductList/ProductListCarouselLayout.js +2 -2
- package/dist/esm/product/components/ProductList/ProductListCarouselLayout.liquid.js +5 -3
- package/dist/esm/product/components/ProductList/common/index.js +3 -3
- package/dist/esm/product/components/ProductVariants/common/main/getAttr.js +1 -1
- package/dist/esm/text/components/Text.js +4 -4
- package/dist/types/index.d.ts +164 -67
- package/package.json +3 -3
- package/dist/cjs/carousel/components/Arrow.js +0 -110
- package/dist/cjs/carousel/components/Arrow.liquid.js +0 -103
- package/dist/cjs/carousel/components/Carousel.liquid.js +0 -256
- package/dist/cjs/carousel/components/CarouselItem.js +0 -88
- package/dist/cjs/carousel/components/Dots.js +0 -69
- package/dist/cjs/carousel/components/Dots.liquid.js +0 -23
- package/dist/cjs/carousel/components/common/dots.js +0 -57
- package/dist/esm/carousel/components/Arrow.js +0 -106
- package/dist/esm/carousel/components/Arrow.liquid.js +0 -99
- package/dist/esm/carousel/components/Carousel.liquid.js +0 -252
- package/dist/esm/carousel/components/CarouselItem.js +0 -84
- package/dist/esm/carousel/components/Dots.js +0 -65
- package/dist/esm/carousel/components/Dots.liquid.js +0 -19
- package/dist/esm/carousel/components/common/dots.js +0 -53
package/dist/cjs/index.liquid.js
CHANGED
|
@@ -17,8 +17,8 @@ var ArticleReadMore_liquid = require('./article/components/ArticleReadMore.liqui
|
|
|
17
17
|
var HeroBanner_liquid = require('./banner/components/HeroBanner.liquid.js');
|
|
18
18
|
var Breadcrumb_liquid = require('./breadcrumb/components/Breadcrumb.liquid.js');
|
|
19
19
|
var Button_liquid = require('./button/components/Button.liquid.js');
|
|
20
|
-
var CarouselItem_liquid = require('./carousel/
|
|
21
|
-
var Carousel_liquid = require('./carousel/
|
|
20
|
+
var CarouselItem_liquid = require('./carousel/carousel-item/CarouselItem.liquid.js');
|
|
21
|
+
var Carousel_liquid = require('./carousel/root/Carousel.liquid.js');
|
|
22
22
|
var ShopPayButton_liquid = require('./cart/components/ShopPayButton/ShopPayButton.liquid.js');
|
|
23
23
|
var CSSCode_liquid = require('./code/components/CSSCode.liquid.js');
|
|
24
24
|
var CollectionToolbar_liquid = require('./collection/components/collection-toolbar/components/CollectionToolbar.liquid.js');
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var React = require('react');
|
|
8
|
-
var Carousel = require('../../../carousel/
|
|
9
|
-
var CarouselItem = require('../../../carousel/
|
|
8
|
+
var Carousel = require('../../../carousel/root/Carousel.js');
|
|
9
|
+
var CarouselItem = require('../../../carousel/carousel-item/CarouselItem.js');
|
|
10
10
|
var core = require('@gem-sdk/core');
|
|
11
11
|
var common = require('./common/common.js');
|
|
12
12
|
var NextImage = require('../../../image/components/NextImage.js');
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var core = require('@gem-sdk/core');
|
|
8
|
-
var Carousel = require('../../../carousel/
|
|
9
|
-
var CarouselItem = require('../../../carousel/
|
|
8
|
+
var Carousel = require('../../../carousel/root/Carousel.js');
|
|
9
|
+
var CarouselItem = require('../../../carousel/carousel-item/CarouselItem.js');
|
|
10
10
|
var NextImage = require('../../../image/components/NextImage.js');
|
|
11
11
|
var Modal = require('../../../modal/components/Modal.js');
|
|
12
12
|
require('../../../modal/components/confirm.js');
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var core = require('@gem-sdk/core');
|
|
6
|
-
var Carousel_liquid = require('../../../../carousel/
|
|
7
|
-
var CarouselItem_liquid = require('../../../../carousel/
|
|
6
|
+
var Carousel_liquid = require('../../../../carousel/root/Carousel.liquid.js');
|
|
7
|
+
var CarouselItem_liquid = require('../../../../carousel/carousel-item/CarouselItem.liquid.js');
|
|
8
8
|
var NextImage_liquid = require('../../../../image/components/NextImage.liquid.js');
|
|
9
9
|
var common = require('../common/common.js');
|
|
10
10
|
var productGallery = require('../common/productGallery.js');
|
|
@@ -102,7 +102,9 @@ const ProductGalleryCarousel = ({ builderPropUID, ...setting })=>{
|
|
|
102
102
|
return core.template`${Carousel_liquid.default({
|
|
103
103
|
rootId: `${builderPropUID}-{{product.id}}`,
|
|
104
104
|
rootClass: 'gp-flex-1 gp-w-full carousel-gallery',
|
|
105
|
-
|
|
105
|
+
rootAttrs: {
|
|
106
|
+
type: 'grid-carousel'
|
|
107
|
+
},
|
|
106
108
|
isHiddenArrowWhenDisabled: true,
|
|
107
109
|
setting: {
|
|
108
110
|
navigationStyle: {
|
|
@@ -103,6 +103,7 @@ const getFeaturedCarouselSettingAttr = (setting)=>{
|
|
|
103
103
|
itemNumber: {
|
|
104
104
|
desktop: 1
|
|
105
105
|
},
|
|
106
|
+
dot: productGallery.getAllowDotConfig(),
|
|
106
107
|
dotStyle: productFeaturedImage.getDotStyleForOnlyFeaturedImage({
|
|
107
108
|
position: setting.position,
|
|
108
109
|
dotStyle: setting.ftDotStyle
|
|
@@ -23,7 +23,7 @@ const getZoomImageClass = ()=>{
|
|
|
23
23
|
};
|
|
24
24
|
const getDotStyleForOnlyFeaturedImage = (setting)=>{
|
|
25
25
|
let result = {};
|
|
26
|
-
devices.
|
|
26
|
+
devices.forEach((device)=>{
|
|
27
27
|
const position = core.getResponsiveValueByScreen(setting.position, device);
|
|
28
28
|
const dotStyle = core.getResponsiveValueByScreen(setting.dotStyle, device);
|
|
29
29
|
result = {
|
|
@@ -155,7 +155,7 @@ const checkDisplayGalleryByWidth = (setting)=>{
|
|
|
155
155
|
'tablet'
|
|
156
156
|
];
|
|
157
157
|
DEVICES.forEach((device)=>{
|
|
158
|
-
const itemWidth = core.getResponsiveValueByScreen(setting.shapeByLayout, device)?.width
|
|
158
|
+
const itemWidth = core.getResponsiveValueByScreen(setting.shapeByLayout, device)?.width ?? '100%';
|
|
159
159
|
const isDisplay = parseInt(itemWidth) !== 0;
|
|
160
160
|
result = {
|
|
161
161
|
...result,
|
package/dist/cjs/product/components/ProductImagesV2/components/child/ProductFeaturedImageCarousel.js
CHANGED
|
@@ -11,8 +11,8 @@ var getProductImagesClassName = require('../../composables/getProductImagesClass
|
|
|
11
11
|
var getProductImagesAttr = require('../../composables/getProductImagesAttr.js');
|
|
12
12
|
var system = require('@gem-sdk/system');
|
|
13
13
|
var getStyle = require('../../common/getStyle.js');
|
|
14
|
-
var Carousel = require('../../../../../carousel/
|
|
15
|
-
var CarouselItem = require('../../../../../carousel/
|
|
14
|
+
var Carousel = require('../../../../../carousel/root/Carousel.js');
|
|
15
|
+
var CarouselItem = require('../../../../../carousel/carousel-item/CarouselItem.js');
|
|
16
16
|
var ProductFeaturedImageOnly = require('./ProductFeaturedImageOnly.js');
|
|
17
17
|
var useProductFeaturedImageCarousel = require('../../hooks/useProductFeaturedImageCarousel.js');
|
|
18
18
|
|
|
@@ -53,7 +53,7 @@ const ProductFeaturedImageCarousel = (props)=>{
|
|
|
53
53
|
onHandleChangeSlideByInteraction: (idx)=>{
|
|
54
54
|
const length = filteredProductImages?.length ?? 0;
|
|
55
55
|
const index = idx >= length ? 0 : idx;
|
|
56
|
-
onHandleClick(filteredProductImages?.[index]?.id
|
|
56
|
+
onHandleClick(filteredProductImages?.[index]?.id ?? '', enableOpenLightBox);
|
|
57
57
|
},
|
|
58
58
|
children: [
|
|
59
59
|
children,
|
|
@@ -63,7 +63,7 @@ const ProductFeaturedImageCarousel = (props)=>{
|
|
|
63
63
|
className: galleryItemClasses('gp-ft-image-item'),
|
|
64
64
|
onClickItem: ()=>{
|
|
65
65
|
const clickEffect = core.getResponsiveValueByScreen(setting?.ftClickOpenLightBox, currentDevice);
|
|
66
|
-
if (clickEffect !== 'none') onHandleClick(image?.id
|
|
66
|
+
if (clickEffect !== 'none') onHandleClick(image?.id ?? '', enableOpenLightBox);
|
|
67
67
|
},
|
|
68
68
|
style: featureImageCarouselItemStyle,
|
|
69
69
|
onMouseMove: (e)=>hoverAction.handleMouseMove(e, setting),
|
|
@@ -92,7 +92,7 @@ const ProductFeaturedImageCarousel = (props)=>{
|
|
|
92
92
|
onMouseOut: (e)=>hoverAction.handleMouseOut(e),
|
|
93
93
|
onBlur: ()=>void 0,
|
|
94
94
|
onClick: ()=>{
|
|
95
|
-
onHandleClick(imageActive?.id
|
|
95
|
+
onHandleClick(imageActive?.id ?? '', enableOpenLightBox);
|
|
96
96
|
},
|
|
97
97
|
children: /*#__PURE__*/ jsxRuntime.jsx(ProductFeaturedImageOnly.default, {
|
|
98
98
|
image: imageActive,
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var core = require('@gem-sdk/core');
|
|
6
6
|
var common = require('../../common/common.js');
|
|
7
7
|
var productFeaturedImage = require('../../common/productFeaturedImage.js');
|
|
8
|
-
var Carousel_liquid = require('../../../../../carousel/
|
|
9
|
-
var CarouselItem_liquid = require('../../../../../carousel/
|
|
8
|
+
var Carousel_liquid = require('../../../../../carousel/root/Carousel.liquid.js');
|
|
9
|
+
var CarouselItem_liquid = require('../../../../../carousel/carousel-item/CarouselItem.liquid.js');
|
|
10
10
|
var HTML5Embed_liquid = require('../../../../../video/components/HTML5Embed.liquid.js');
|
|
11
11
|
var Modal3d_liquid = require('../../../../../image/components/Modal3d.liquid.js');
|
|
12
12
|
var NextImage_liquid = require('../../../../../image/components/NextImage.liquid.js');
|
|
@@ -167,7 +167,7 @@ const FeatureImageWithGallery = ({ builderPropUID, children, enableLazyLoadImage
|
|
|
167
167
|
};
|
|
168
168
|
const isRenderFeatureCarousel = productFeaturedImage.checkRenderFeaturedCarousel(setting);
|
|
169
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
|
|
170
|
+
const carouselChildren = system.LiquidIf(`product.media.size > 0`, `${system.LiquidFor(`media in product.media`, `${children || ''} {% assign largestRatio = 0 %}
|
|
171
171
|
${system.LiquidFor(`featureMedia in product.media`, `{% assign height = featureMedia.height | times: 1.0 %}
|
|
172
172
|
{% assign width = featureMedia.width | times: 1.0 %}
|
|
173
173
|
{% assign ratio = height | divided_by: width %}
|
|
@@ -203,7 +203,11 @@ const FeatureImageWithGallery = ({ builderPropUID, children, enableLazyLoadImage
|
|
|
203
203
|
conditionAppendJs: 'product.media.size > 1',
|
|
204
204
|
wrapperClass: FEATURE_IMAGE_WRAPPER_CLASS,
|
|
205
205
|
rootClass: `${featuredImageCarouselClasses}`,
|
|
206
|
-
|
|
206
|
+
rootAttrs: {
|
|
207
|
+
type: 'gp-feature-image-carousel',
|
|
208
|
+
'product-id': '{{product.id}}',
|
|
209
|
+
'product-media': '{{product.media.size}}'
|
|
210
|
+
},
|
|
207
211
|
isHiddenArrowWhenDisabled: true,
|
|
208
212
|
setting: featuredImageCarouselSettingAttrs,
|
|
209
213
|
rootStyles: featureImageStyle,
|
package/dist/cjs/product/components/ProductImagesV2/components/gallery-carousel/GalleryCarousel.js
CHANGED
|
@@ -13,8 +13,8 @@ var productFeaturedImage = require('../../common/productFeaturedImage.js');
|
|
|
13
13
|
var MediaIcon = require('../child/MediaIcon.js');
|
|
14
14
|
var ButtonOpenLightBox = require('../lightbox/ButtonOpenLightBox.js');
|
|
15
15
|
var NextImage = require('../../../../../image/components/NextImage.js');
|
|
16
|
-
var Carousel = require('../../../../../carousel/
|
|
17
|
-
var CarouselItem = require('../../../../../carousel/
|
|
16
|
+
var Carousel = require('../../../../../carousel/root/Carousel.js');
|
|
17
|
+
var CarouselItem = require('../../../../../carousel/carousel-item/CarouselItem.js');
|
|
18
18
|
var useGalleryCarousel = require('../../hooks/useGalleryCarousel.js');
|
|
19
19
|
var system = require('@gem-sdk/system');
|
|
20
20
|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var core = require('@gem-sdk/core');
|
|
6
|
-
var Carousel_liquid = require('../../../../../carousel/
|
|
7
|
-
var CarouselItem_liquid = require('../../../../../carousel/
|
|
6
|
+
var Carousel_liquid = require('../../../../../carousel/root/Carousel.liquid.js');
|
|
7
|
+
var CarouselItem_liquid = require('../../../../../carousel/carousel-item/CarouselItem.liquid.js');
|
|
8
8
|
var NextImage_liquid = require('../../../../../image/components/NextImage.liquid.js');
|
|
9
9
|
var common = require('../../common/common.js');
|
|
10
10
|
var productGallery = require('../../common/productGallery.js');
|
|
@@ -148,7 +148,10 @@ const ProductGalleryCarousel = ({ builderPropUID, children, enableLazyLoadImage,
|
|
|
148
148
|
},
|
|
149
149
|
rootId: `${builderPropUID}-{{product.id}}`,
|
|
150
150
|
rootClass: `${featuredImageGalleryClasses}`,
|
|
151
|
-
|
|
151
|
+
rootAttrs: {
|
|
152
|
+
type: 'grid-carousel',
|
|
153
|
+
'product-media': '{{product.media.size}}'
|
|
154
|
+
},
|
|
152
155
|
wrapperClass: getSpacingClassByVerticalConfig(),
|
|
153
156
|
slidesClass: productGallery.getMinHeightByPosition(setting.position, setting.navigationPosition),
|
|
154
157
|
isHiddenArrowWhenDisabled: true,
|
package/dist/cjs/product/components/ProductImagesV2/components/lightbox/ProductImagesLightBox.js
CHANGED
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var core = require('@gem-sdk/core');
|
|
8
|
-
var Carousel = require('../../../../../carousel/
|
|
9
|
-
var CarouselItem = require('../../../../../carousel/
|
|
8
|
+
var Carousel = require('../../../../../carousel/root/Carousel.js');
|
|
9
|
+
var CarouselItem = require('../../../../../carousel/carousel-item/CarouselItem.js');
|
|
10
10
|
var NextImage = require('../../../../../image/components/NextImage.js');
|
|
11
11
|
var Modal = require('../../../../../modal/components/Modal.js');
|
|
12
12
|
require('../../../../../modal/components/confirm.js');
|
package/dist/cjs/product/components/ProductImagesV2/hooks/useProductFeaturedImageCarousel.js
CHANGED
|
@@ -96,9 +96,9 @@ const useProductFeaturedImageCarousel = (props)=>{
|
|
|
96
96
|
const result = common.getAspectRatio(setting.ftShape);
|
|
97
97
|
const defaultRatio = getDefaultAspectRatio(image);
|
|
98
98
|
return {
|
|
99
|
-
desktop: result.desktop
|
|
100
|
-
tablet: result.tablet
|
|
101
|
-
mobile: result.mobile
|
|
99
|
+
desktop: result.desktop ?? defaultRatio,
|
|
100
|
+
tablet: result.tablet ?? defaultRatio,
|
|
101
|
+
mobile: result.mobile ?? defaultRatio
|
|
102
102
|
};
|
|
103
103
|
};
|
|
104
104
|
const handleSetSrc = React.useCallback(()=>{
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var core = require('@gem-sdk/core');
|
|
7
|
-
var Carousel = require('../../../carousel/
|
|
8
|
-
var CarouselItem = require('../../../carousel/
|
|
7
|
+
var Carousel = require('../../../carousel/root/Carousel.js');
|
|
8
|
+
var CarouselItem = require('../../../carousel/carousel-item/CarouselItem.js');
|
|
9
9
|
var ChildrenDroppable = require('../../../grid/components/ChildrenDroppable.js');
|
|
10
10
|
var index = require('./common/index.js');
|
|
11
11
|
var getAttr = require('./common/getAttr.js');
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var core = require('@gem-sdk/core');
|
|
6
|
-
var CarouselItem_liquid = require('../../../carousel/
|
|
7
|
-
var Carousel_liquid = require('../../../carousel/
|
|
6
|
+
var CarouselItem_liquid = require('../../../carousel/carousel-item/CarouselItem.liquid.js');
|
|
7
|
+
var Carousel_liquid = require('../../../carousel/root/Carousel.liquid.js');
|
|
8
8
|
var index = require('./common/index.js');
|
|
9
9
|
var getClass = require('./common/getClass.js');
|
|
10
10
|
var getStyle = require('./common/getStyle.js');
|
|
@@ -22,7 +22,9 @@ const ProductListCarouselLayout = (props)=>{
|
|
|
22
22
|
builderProps: {
|
|
23
23
|
...builderProps
|
|
24
24
|
},
|
|
25
|
-
|
|
25
|
+
rootAttrs: {
|
|
26
|
+
'items-repeat': 'true'
|
|
27
|
+
},
|
|
26
28
|
rootId: `product-list-carousel-${builderProps?.uid}`,
|
|
27
29
|
rootClass: carouselClass,
|
|
28
30
|
setting: carouselConfigSetting,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var common = require('../../../../carousel/arrow/common/common.js');
|
|
4
|
+
var common$1 = require('../../../../carousel/dots/common/common.js');
|
|
5
5
|
var product = require('../../../helpers/product.js');
|
|
6
6
|
var productFeaturedImage = require('../../ProductImages/common/productFeaturedImage.js');
|
|
7
7
|
var _const = require('./const.js');
|
|
@@ -10,8 +10,8 @@ const getData = (props)=>{
|
|
|
10
10
|
const { setting, styles } = props;
|
|
11
11
|
const productSetting = setting?.productSetting ?? {};
|
|
12
12
|
const isRelatedProduct = productSetting.productSrc === 'RelatedProduct';
|
|
13
|
-
const navigationStyle =
|
|
14
|
-
const dotStyle =
|
|
13
|
+
const navigationStyle = common.getUpdatedArrowDisplay(setting?.arrow, setting?.controlOverContent);
|
|
14
|
+
const dotStyle = common$1.getUpdatedDotStyle(setting?.dot, setting?.dotStyle);
|
|
15
15
|
const carouselConfigSetting = {
|
|
16
16
|
dotStyle,
|
|
17
17
|
navigationStyle,
|
|
@@ -71,7 +71,7 @@ const getDataLiquid = (props)=>{
|
|
|
71
71
|
const productSetting = setting?.productSetting;
|
|
72
72
|
const relatedTag = productSetting?.relatedTag;
|
|
73
73
|
const hasRelatedExclude = productSetting?.hasRelatedExclude;
|
|
74
|
-
const mainRelatedExclude = (relatedTag && relatedTag[0] === 'collection' ? productSetting?.relatedCollectionExclude : productSetting?.relatedTagsExclude)
|
|
74
|
+
const mainRelatedExclude = (relatedTag && relatedTag[0] === 'collection' ? productSetting?.relatedCollectionExclude : productSetting?.relatedTagsExclude) ?? '';
|
|
75
75
|
const relatedExcludeTrim = mainRelatedExclude?.split(',').map((item)=>item.trim()).toString();
|
|
76
76
|
const productSrc = productSetting?.productSrc ?? 'Collection';
|
|
77
77
|
const collectionID = productSetting?.collectionId?.replace(_const.PREFIX_COLLECTION_ID, '') ?? 'latest';
|
|
@@ -23,13 +23,13 @@ const Text = /*#__PURE__*/ React.forwardRef(({ styles, builderAttrs, style, sett
|
|
|
23
23
|
const textAttrs = system.createAttr({
|
|
24
24
|
...getAttr.getTextAttr(options)
|
|
25
25
|
});
|
|
26
|
-
const wrapperStyle = system.
|
|
26
|
+
const wrapperStyle = system.createStyleReact({
|
|
27
27
|
...getStyle.getStyle(styles, style)
|
|
28
28
|
});
|
|
29
|
-
const containerStyle = system.
|
|
29
|
+
const containerStyle = system.createStyleReact({
|
|
30
30
|
...getStyle.getContainerStyle(styles, setting)
|
|
31
31
|
});
|
|
32
|
-
const gpTextStyle = system.
|
|
32
|
+
const gpTextStyle = system.createStyleReact({
|
|
33
33
|
...getStyle.getTextStyle(styles, setting)
|
|
34
34
|
});
|
|
35
35
|
const wrapperClasses = system.createClass({
|
package/dist/esm/builder.js
CHANGED
|
@@ -16,8 +16,8 @@ import ArticleReadMore from './article/components/ArticleReadMore.js';
|
|
|
16
16
|
import HeroBanner from './banner/components/HeroBanner.js';
|
|
17
17
|
import Breadcrumb from './breadcrumb/components/Breadcrumb.js';
|
|
18
18
|
import Button from './button/components/Button.js';
|
|
19
|
-
import Carousel from './carousel/
|
|
20
|
-
import CarouselItem from './carousel/
|
|
19
|
+
import Carousel from './carousel/root/Carousel.js';
|
|
20
|
+
import CarouselItem from './carousel/carousel-item/CarouselItem.js';
|
|
21
21
|
import Cart from './cart/components/Cart.js';
|
|
22
22
|
import CartList from './cart/components/CartList.js';
|
|
23
23
|
import CartLinePrice from './cart/components/CartLinePrice.js';
|
|
@@ -195,13 +195,6 @@ const ButtonSettings = [
|
|
|
195
195
|
bbrr: '0px',
|
|
196
196
|
btlr: '0px',
|
|
197
197
|
radiusType: 'none'
|
|
198
|
-
},
|
|
199
|
-
hover: {
|
|
200
|
-
btrr: '0px',
|
|
201
|
-
bblr: '0px',
|
|
202
|
-
bbrr: '0px',
|
|
203
|
-
btlr: '0px',
|
|
204
|
-
radiusType: 'none'
|
|
205
198
|
}
|
|
206
199
|
}
|
|
207
200
|
}
|
|
@@ -215,13 +208,6 @@ const ButtonSettings = [
|
|
|
215
208
|
bbrr: '8px',
|
|
216
209
|
btlr: '8px',
|
|
217
210
|
radiusType: 'rounded'
|
|
218
|
-
},
|
|
219
|
-
hover: {
|
|
220
|
-
btrr: '8px',
|
|
221
|
-
bblr: '8px',
|
|
222
|
-
bbrr: '8px',
|
|
223
|
-
btlr: '8px',
|
|
224
|
-
radiusType: 'rounded'
|
|
225
211
|
}
|
|
226
212
|
}
|
|
227
213
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { getClass } from './common/getClass.js';
|
|
4
|
+
import { getStyle } from './common/getStyle.js';
|
|
5
|
+
import { getData } from './common/common.js';
|
|
6
|
+
import { If } from '@gem-sdk/system';
|
|
7
|
+
|
|
8
|
+
const Arrow = (props)=>{
|
|
9
|
+
const { custom, left, onClick } = props;
|
|
10
|
+
const { isRenderCustomIcon } = getData(props);
|
|
11
|
+
const { buttonClass, buttonContentClass } = getClass(props);
|
|
12
|
+
const { buttonStyle, buttonContentStyle, innerBorderCss } = getStyle(props, 'react');
|
|
13
|
+
const customIcon = If(isRenderCustomIcon, custom ?? '', /*#__PURE__*/ jsx("svg", {
|
|
14
|
+
height: "100%",
|
|
15
|
+
width: "100%",
|
|
16
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
17
|
+
viewBox: "0 0 24 24",
|
|
18
|
+
fill: "currentColor",
|
|
19
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
20
|
+
d: "M5 3l3.057-3 11.943 12-11.943 12-3.057-3 9-9z"
|
|
21
|
+
})
|
|
22
|
+
}));
|
|
23
|
+
const buttonContent = /*#__PURE__*/ jsx("div", {
|
|
24
|
+
className: buttonContentClass,
|
|
25
|
+
style: buttonContentStyle,
|
|
26
|
+
dangerouslySetInnerHTML: {
|
|
27
|
+
__html: customIcon || ''
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
return /*#__PURE__*/ jsxs("button", {
|
|
31
|
+
type: "button",
|
|
32
|
+
"aria-label": `Carousel ${left ? 'Back' : 'Next'} Arrow`,
|
|
33
|
+
className: buttonClass,
|
|
34
|
+
style: buttonStyle,
|
|
35
|
+
onClick: onClick,
|
|
36
|
+
children: [
|
|
37
|
+
/*#__PURE__*/ jsx("style", {
|
|
38
|
+
type: "text/css",
|
|
39
|
+
dangerouslySetInnerHTML: {
|
|
40
|
+
__html: innerBorderCss
|
|
41
|
+
}
|
|
42
|
+
}),
|
|
43
|
+
buttonContent
|
|
44
|
+
]
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export { Arrow as default };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { template } from '@gem-sdk/core';
|
|
2
|
+
import { getClass } from './common/getClass.js';
|
|
3
|
+
import { getStyle } from './common/getStyle.js';
|
|
4
|
+
import { getData } from './common/common.js';
|
|
5
|
+
import { If } from '@gem-sdk/system';
|
|
6
|
+
|
|
7
|
+
const Arrow = (props)=>{
|
|
8
|
+
const { custom, left } = props;
|
|
9
|
+
const { isRenderCustomIcon } = getData(props);
|
|
10
|
+
const { buttonClass, buttonContentClass } = getClass(props);
|
|
11
|
+
const { buttonStyle, buttonContentStyle, innerBorderCss } = getStyle(props);
|
|
12
|
+
const customIcon = If(isRenderCustomIcon, custom ?? '', `<svg
|
|
13
|
+
height="100%"
|
|
14
|
+
width="100%"
|
|
15
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
16
|
+
viewBox="0 0 24 24"
|
|
17
|
+
fill="currentColor"
|
|
18
|
+
>
|
|
19
|
+
<path d="M5 3l3.057-3 11.943 12-11.943 12-3.057-3 9-9z" />
|
|
20
|
+
</svg>`);
|
|
21
|
+
const buttonContent = template`
|
|
22
|
+
<div
|
|
23
|
+
class="${buttonContentClass}"
|
|
24
|
+
style="${buttonContentStyle}"
|
|
25
|
+
>
|
|
26
|
+
${customIcon || ''}
|
|
27
|
+
</div>
|
|
28
|
+
`;
|
|
29
|
+
return template`
|
|
30
|
+
<button
|
|
31
|
+
type="button"
|
|
32
|
+
aria-label='Carousel ${left ? 'Back' : 'Next'} Arrow'
|
|
33
|
+
class="${buttonClass}"
|
|
34
|
+
style="${buttonStyle}"
|
|
35
|
+
>
|
|
36
|
+
<style type="text/css">${innerBorderCss}</style>
|
|
37
|
+
${buttonContent}
|
|
38
|
+
</button>
|
|
39
|
+
`;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export { Arrow as default };
|
|
@@ -15,7 +15,7 @@ const getResponsiveSetting = (setting)=>{
|
|
|
15
15
|
mobile
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
|
-
const
|
|
18
|
+
const getArrowPositionStyle = ({ vertical, arrowType, gapToEachSize, left })=>{
|
|
19
19
|
const result = {};
|
|
20
20
|
devices.forEach((item)=>{
|
|
21
21
|
const verticalResponsive = getResponsiveValueByScreen(vertical, item, false);
|
|
@@ -46,13 +46,9 @@ const getClassArrowRotate = (left, vertical)=>{
|
|
|
46
46
|
});
|
|
47
47
|
return result;
|
|
48
48
|
};
|
|
49
|
-
const getArrowRotate = (left, vertical)=>{
|
|
50
|
-
const rotation = left ? vertical ? '[-90deg]' : '180' : vertical ? '90' : '0';
|
|
51
|
-
return `gp-rotate-${rotation}`;
|
|
52
|
-
};
|
|
53
49
|
const getClassArrowDisplay = (arrowType, vertical)=>{
|
|
54
50
|
const result = {};
|
|
55
|
-
devices.
|
|
51
|
+
devices.forEach((device)=>{
|
|
56
52
|
const verticalResponsive = getResponsiveValueByScreen(vertical, device, false);
|
|
57
53
|
const deviceRes = device === 'desktop' ? '' : `${device}:`;
|
|
58
54
|
result[`${deviceRes}!gp-flex ${deviceRes}!gp-absolute ${deviceRes}gp-z-2`] = arrowType[device] === 'inside' || !!verticalResponsive;
|
|
@@ -63,7 +59,7 @@ const getClassArrowDisplay = (arrowType, vertical)=>{
|
|
|
63
59
|
};
|
|
64
60
|
const getArrowDisplayStyle = (arrowType)=>{
|
|
65
61
|
let result = {};
|
|
66
|
-
devices.
|
|
62
|
+
devices.forEach((device)=>{
|
|
67
63
|
const arrowTypeResponsive = getResponsiveValueByScreen(arrowType, device, 'none');
|
|
68
64
|
result = {
|
|
69
65
|
...result,
|
|
@@ -90,7 +86,7 @@ const mappingNavigationCarousel = (setting)=>{
|
|
|
90
86
|
...value
|
|
91
87
|
};
|
|
92
88
|
const deviceNotExits = devices.filter((x)=>!Object.keys(newValue).includes(x));
|
|
93
|
-
deviceNotExits.
|
|
89
|
+
deviceNotExits.forEach((el)=>{
|
|
94
90
|
if (el === 'tablet') {
|
|
95
91
|
newValue[el] = newValue['desktop'];
|
|
96
92
|
}
|
|
@@ -105,7 +101,7 @@ const mappingNavigationCarousel = (setting)=>{
|
|
|
105
101
|
const newArrow = generateValueByDevices(arrow);
|
|
106
102
|
const newControlOverContent = generateValueByDevices(controlOverContent);
|
|
107
103
|
const navigationStyle = {};
|
|
108
|
-
devices.
|
|
104
|
+
devices.forEach((el)=>{
|
|
109
105
|
if (!newArrow[el]) navigationStyle[el] = 'none';
|
|
110
106
|
else if (newArrow[el] && newControlOverContent[el]) navigationStyle[el] = 'inside';
|
|
111
107
|
else navigationStyle[el] = 'outside';
|
|
@@ -117,5 +113,11 @@ const mappingNavigationCarousel = (setting)=>{
|
|
|
117
113
|
}
|
|
118
114
|
return setting;
|
|
119
115
|
};
|
|
116
|
+
const getData = (props)=>{
|
|
117
|
+
const isRenderCustomIcon = !!props.custom && props.custom !== '';
|
|
118
|
+
return {
|
|
119
|
+
isRenderCustomIcon
|
|
120
|
+
};
|
|
121
|
+
};
|
|
120
122
|
|
|
121
|
-
export { getArrowDisplayStyle,
|
|
123
|
+
export { getArrowDisplayStyle, getArrowPositionStyle, getClassArrowDisplay, getClassArrowRotate, getData, getResponsiveSetting, getUpdatedArrowDisplay, mappingNavigationCarousel };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { createClass } from '@gem-sdk/system';
|
|
2
|
+
import { getClassArrowDisplay, getClassArrowRotate, getResponsiveSetting } from './common.js';
|
|
3
|
+
|
|
4
|
+
const getClass = (props)=>{
|
|
5
|
+
const { className, componentId, rootId, left, uid, isHiddenWhenDisabled, disabled, showWhenHover, showArrow, vertical } = props;
|
|
6
|
+
const idClass = 'gp-carousel-arrow-' + uid;
|
|
7
|
+
const arrowType = getResponsiveSetting(showArrow || {});
|
|
8
|
+
const classAction = left ? 'gp-carousel-action-back gem-slider-previous' : 'gp-carousel-action-next gem-slider-next';
|
|
9
|
+
const buttonClass = createClass({
|
|
10
|
+
...{
|
|
11
|
+
'gp-z-1 gp-items-center gp-justify-center gp-overflow-hidden gp-shrink-0': true
|
|
12
|
+
},
|
|
13
|
+
...{
|
|
14
|
+
[idClass]: true
|
|
15
|
+
},
|
|
16
|
+
...className && {
|
|
17
|
+
[className]: true
|
|
18
|
+
},
|
|
19
|
+
...componentId && {
|
|
20
|
+
[componentId]: true
|
|
21
|
+
},
|
|
22
|
+
...rootId && {
|
|
23
|
+
[rootId]: true
|
|
24
|
+
},
|
|
25
|
+
...classAction && {
|
|
26
|
+
[classAction]: true
|
|
27
|
+
},
|
|
28
|
+
...{
|
|
29
|
+
hidden: isHiddenWhenDisabled && disabled,
|
|
30
|
+
'gp-cursor-default gp-text-gray-300': disabled,
|
|
31
|
+
'gp-cursor-pointer gp-text-gray-500': !disabled,
|
|
32
|
+
'!gp-invisible group-hover/carousel:!gp-visible': showWhenHover,
|
|
33
|
+
...getClassArrowDisplay(arrowType, vertical)
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const buttonContentClass = createClass({
|
|
37
|
+
...{
|
|
38
|
+
'gp-flex gp-items-center gp-justify-center [&>svg]:gp-h-full [&>svg]:gp-w-full': true
|
|
39
|
+
},
|
|
40
|
+
...getClassArrowRotate(Boolean(left), vertical)
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
buttonClass,
|
|
44
|
+
buttonContentClass
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export { getClass };
|