@gem-sdk/components 2.0.0-dev.622 → 2.0.0-dev.624
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 +12 -6
- package/dist/cjs/collection/components/collection-paginator/common/styles.js +3 -4
- package/dist/cjs/collection/components/collection-paginator/components/CollectionPaginator.liquid.js +2 -1
- package/dist/cjs/collection/setting/collection-paginator/configs/settings.js +2 -3
- package/dist/cjs/index.js +34 -32
- package/dist/cjs/index.liquid.js +16 -10
- package/dist/cjs/next.js +3 -1
- package/dist/cjs/product/components/ProductImagesV3/common/common.js +360 -0
- package/dist/cjs/product/components/ProductImagesV3/common/getAttr.js +192 -0
- package/dist/cjs/product/components/ProductImagesV3/common/getBorderActiveCss.js +26 -0
- package/dist/cjs/product/components/ProductImagesV3/common/getClasses.js +94 -0
- package/dist/cjs/product/components/ProductImagesV3/common/getStyle.js +303 -0
- package/dist/cjs/product/components/ProductImagesV3/common/hoverAction.js +95 -0
- package/dist/cjs/product/components/ProductImagesV3/common/productFeaturedImage.js +59 -0
- package/dist/cjs/product/components/ProductImagesV3/common/productGallery.js +266 -0
- package/dist/cjs/product/components/ProductImagesV3/components/child/MediaIcon.js +63 -0
- package/dist/cjs/product/components/ProductImagesV3/components/child/ProductFeatureVideo.js +36 -0
- package/dist/cjs/product/components/ProductImagesV3/components/child/ProductFeaturedImageCarousel.js +109 -0
- package/dist/cjs/product/components/ProductImagesV3/components/child/ProductFeaturedImageOnly.js +139 -0
- package/dist/cjs/product/components/ProductImagesV3/components/child/ProductGalleryGrid.js +100 -0
- package/dist/cjs/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.js +77 -0
- package/dist/cjs/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.liquid.js +300 -0
- package/dist/cjs/product/components/ProductImagesV3/components/feature-only/OnlyFeatureImage.js +44 -0
- package/dist/cjs/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.js +83 -0
- package/dist/cjs/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.liquid.js +182 -0
- package/dist/cjs/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.js +30 -0
- package/dist/cjs/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.liquid.js +239 -0
- package/dist/cjs/product/components/ProductImagesV3/components/lightbox/ButtonOpenLightBox.js +28 -0
- package/dist/cjs/product/components/ProductImagesV3/components/lightbox/ProductImagesLightBox.js +144 -0
- package/dist/cjs/product/components/ProductImagesV3/composables/getProductImagesAttr.js +14 -0
- package/dist/cjs/product/components/ProductImagesV3/composables/getProductImagesClassName.js +54 -0
- package/dist/cjs/product/components/ProductImagesV3/composables/getProductImagesStyles.js +53 -0
- package/dist/cjs/product/components/ProductImagesV3/hooks/useFeatureImageWithGallery.js +55 -0
- package/dist/cjs/product/components/ProductImagesV3/hooks/useFilterImagesByVariant.js +41 -0
- package/dist/cjs/product/components/ProductImagesV3/hooks/useGalleryCarousel.js +134 -0
- package/dist/cjs/product/components/ProductImagesV3/hooks/useProductFeaturedImageCarousel.js +203 -0
- package/dist/cjs/product/components/ProductImagesV3/hooks/useProductGalleryGrid.js +87 -0
- package/dist/cjs/product/components/ProductImagesV3/index.js +291 -0
- package/dist/cjs/product/components/ProductImagesV3/index.liquid.js +153 -0
- package/dist/cjs/product/index.js +6 -4
- package/dist/cjs/product/next.js +4 -0
- package/dist/cjs/product/setting/product-image-v3/ProductFeatureImage.js +252 -0
- package/dist/cjs/product/setting/product-image-v3/ProductGalleryImage.js +251 -0
- package/dist/cjs/product/setting/product-image-v3/ProductImages.js +74 -0
- package/dist/cjs/product/setting/product-image-v3/configs/setting-v2/ProductFeatureImage.js +388 -0
- package/dist/cjs/product/setting/product-image-v3/configs/setting-v2/ProductGalleryImage.js +518 -0
- package/dist/cjs/product/setting/product-image-v3/configs/setting-v2/index.js +336 -0
- package/dist/cjs/product/setting/product-image-v3/configs/ui/FeatureNavigation.js +118 -0
- package/dist/cjs/product/setting/product-image-v3/configs/ui/ImageListNavigation.js +119 -0
- package/dist/cjs/product/setting/product-image-v3/configs/uiV1.js +237 -0
- package/dist/cjs/product/setting/product-image-v3/configs/uiV2.js +491 -0
- package/dist/cjs/setting.js +97 -95
- package/dist/cjs/swiper-carousel/arrow/Arrow.js +52 -0
- package/dist/cjs/swiper-carousel/arrow/Arrow.liquid.js +46 -0
- package/dist/cjs/swiper-carousel/arrow/common/common.js +119 -0
- package/dist/cjs/swiper-carousel/arrow/common/getClass.js +50 -0
- package/dist/cjs/swiper-carousel/arrow/common/getStyle.js +84 -0
- package/dist/cjs/swiper-carousel/carousel-item/SwiperItem.js +34 -0
- package/dist/cjs/swiper-carousel/carousel-item/SwiperItem.liquid.js +38 -0
- package/dist/cjs/swiper-carousel/carousel-item/common/getClass.js +29 -0
- package/dist/cjs/swiper-carousel/carousel-item/common/getStyle.js +79 -0
- package/dist/cjs/swiper-carousel/carousel-item/hook/useCarouseItem.js +22 -0
- package/dist/cjs/swiper-carousel/components/common/carousel.js +98 -0
- package/dist/cjs/swiper-carousel/components/const/index.js +5 -0
- package/dist/cjs/swiper-carousel/components/hooks/useTrackPreviewPause.js +34 -0
- package/dist/cjs/swiper-carousel/components/plugins/AnimationPlugin.js +42 -0
- package/dist/cjs/swiper-carousel/components/plugins/AutoPlayPlugin.js +105 -0
- package/dist/cjs/swiper-carousel/components/plugins/FixSliderMoveBackwards.js +15 -0
- package/dist/cjs/swiper-carousel/components/plugins/MutationPlugin.js +45 -0
- package/dist/cjs/swiper-carousel/dots/Dots.js +51 -0
- package/dist/cjs/swiper-carousel/dots/Dots.liquid.js +26 -0
- package/dist/cjs/swiper-carousel/dots/common/common.js +28 -0
- package/dist/cjs/swiper-carousel/dots/common/getClass.js +40 -0
- package/dist/cjs/swiper-carousel/dots/common/getStyle.js +33 -0
- package/dist/cjs/swiper-carousel/dots/hook/useDotsSetting.js +21 -0
- package/dist/cjs/swiper-carousel/index.js +17 -0
- package/dist/cjs/swiper-carousel/next.js +22 -0
- package/dist/cjs/swiper-carousel/root/Swiper.js +128 -0
- package/dist/cjs/swiper-carousel/root/Swiper.liquid.js +104 -0
- package/dist/cjs/swiper-carousel/root/common/getAttr.js +25 -0
- package/dist/cjs/swiper-carousel/root/common/getClass.js +135 -0
- package/dist/cjs/swiper-carousel/root/common/getData.js +56 -0
- package/dist/cjs/swiper-carousel/root/common/getStyle.js +64 -0
- package/dist/cjs/swiper-carousel/root/hook/useCarousel.js +482 -0
- package/dist/cjs/swiper-carousel/setting/Swiper.js +42 -0
- package/dist/cjs/swiper-carousel/setting/SwiperItem.js +40 -0
- package/dist/cjs/swiper-carousel/setting/configs/presets.js +87 -0
- package/dist/cjs/swiper-carousel/setting/configs/settingV2.js +819 -0
- package/dist/cjs/swiper-carousel/setting/configs/uiV2.js +718 -0
- package/dist/esm/builder.js +6 -0
- package/dist/esm/collection/components/collection-paginator/common/styles.js +3 -4
- package/dist/esm/collection/components/collection-paginator/components/CollectionPaginator.liquid.js +2 -1
- package/dist/esm/collection/setting/collection-paginator/configs/settings.js +2 -3
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.liquid.js +3 -0
- package/dist/esm/next.js +3 -1
- package/dist/esm/product/components/ProductImagesV3/common/common.js +344 -0
- package/dist/esm/product/components/ProductImagesV3/common/getAttr.js +189 -0
- package/dist/esm/product/components/ProductImagesV3/common/getBorderActiveCss.js +24 -0
- package/dist/esm/product/components/ProductImagesV3/common/getClasses.js +83 -0
- package/dist/esm/product/components/ProductImagesV3/common/getStyle.js +292 -0
- package/dist/esm/product/components/ProductImagesV3/common/hoverAction.js +92 -0
- package/dist/esm/product/components/ProductImagesV3/common/productFeaturedImage.js +53 -0
- package/dist/esm/product/components/ProductImagesV3/common/productGallery.js +251 -0
- package/dist/esm/product/components/ProductImagesV3/components/child/MediaIcon.js +59 -0
- package/dist/esm/product/components/ProductImagesV3/components/child/ProductFeatureVideo.js +32 -0
- package/dist/esm/product/components/ProductImagesV3/components/child/ProductFeaturedImageCarousel.js +105 -0
- package/dist/esm/product/components/ProductImagesV3/components/child/ProductFeaturedImageOnly.js +135 -0
- package/dist/esm/product/components/ProductImagesV3/components/child/ProductGalleryGrid.js +96 -0
- package/dist/esm/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.js +73 -0
- package/dist/esm/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.liquid.js +296 -0
- package/dist/esm/product/components/ProductImagesV3/components/feature-only/OnlyFeatureImage.js +40 -0
- package/dist/esm/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.js +79 -0
- package/dist/esm/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.liquid.js +178 -0
- package/dist/esm/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.js +26 -0
- package/dist/esm/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.liquid.js +235 -0
- package/dist/esm/product/components/ProductImagesV3/components/lightbox/ButtonOpenLightBox.js +24 -0
- package/dist/esm/product/components/ProductImagesV3/components/lightbox/ProductImagesLightBox.js +140 -0
- package/dist/esm/product/components/ProductImagesV3/composables/getProductImagesAttr.js +12 -0
- package/dist/esm/product/components/ProductImagesV3/composables/getProductImagesClassName.js +52 -0
- package/dist/esm/product/components/ProductImagesV3/composables/getProductImagesStyles.js +51 -0
- package/dist/esm/product/components/ProductImagesV3/hooks/useFeatureImageWithGallery.js +53 -0
- package/dist/esm/product/components/ProductImagesV3/hooks/useFilterImagesByVariant.js +39 -0
- package/dist/esm/product/components/ProductImagesV3/hooks/useGalleryCarousel.js +132 -0
- package/dist/esm/product/components/ProductImagesV3/hooks/useProductFeaturedImageCarousel.js +201 -0
- package/dist/esm/product/components/ProductImagesV3/hooks/useProductGalleryGrid.js +85 -0
- package/dist/esm/product/components/ProductImagesV3/index.js +287 -0
- package/dist/esm/product/components/ProductImagesV3/index.liquid.js +149 -0
- package/dist/esm/product/index.js +26 -24
- package/dist/esm/product/next.js +4 -0
- package/dist/esm/product/setting/product-image-v3/ProductFeatureImage.js +248 -0
- package/dist/esm/product/setting/product-image-v3/ProductGalleryImage.js +248 -0
- package/dist/esm/product/setting/product-image-v3/ProductImages.js +70 -0
- package/dist/esm/product/setting/product-image-v3/configs/setting-v2/ProductFeatureImage.js +384 -0
- package/dist/esm/product/setting/product-image-v3/configs/setting-v2/ProductGalleryImage.js +515 -0
- package/dist/esm/product/setting/product-image-v3/configs/setting-v2/index.js +334 -0
- package/dist/esm/product/setting/product-image-v3/configs/ui/FeatureNavigation.js +116 -0
- package/dist/esm/product/setting/product-image-v3/configs/ui/ImageListNavigation.js +117 -0
- package/dist/esm/product/setting/product-image-v3/configs/uiV1.js +235 -0
- package/dist/esm/product/setting/product-image-v3/configs/uiV2.js +489 -0
- package/dist/esm/setting.js +2 -0
- package/dist/esm/swiper-carousel/arrow/Arrow.js +48 -0
- package/dist/esm/swiper-carousel/arrow/Arrow.liquid.js +42 -0
- package/dist/esm/swiper-carousel/arrow/common/common.js +111 -0
- package/dist/esm/swiper-carousel/arrow/common/getClass.js +48 -0
- package/dist/esm/swiper-carousel/arrow/common/getStyle.js +82 -0
- package/dist/esm/swiper-carousel/carousel-item/SwiperItem.js +30 -0
- package/dist/esm/swiper-carousel/carousel-item/SwiperItem.liquid.js +34 -0
- package/dist/esm/swiper-carousel/carousel-item/common/getClass.js +27 -0
- package/dist/esm/swiper-carousel/carousel-item/common/getStyle.js +77 -0
- package/dist/esm/swiper-carousel/carousel-item/hook/useCarouseItem.js +20 -0
- package/dist/esm/swiper-carousel/components/common/carousel.js +93 -0
- package/dist/esm/swiper-carousel/components/const/index.js +3 -0
- package/dist/esm/swiper-carousel/components/hooks/useTrackPreviewPause.js +30 -0
- package/dist/esm/swiper-carousel/components/plugins/AnimationPlugin.js +35 -0
- package/dist/esm/swiper-carousel/components/plugins/AutoPlayPlugin.js +103 -0
- package/dist/esm/swiper-carousel/components/plugins/FixSliderMoveBackwards.js +13 -0
- package/dist/esm/swiper-carousel/components/plugins/MutationPlugin.js +43 -0
- package/dist/esm/swiper-carousel/dots/Dots.js +47 -0
- package/dist/esm/swiper-carousel/dots/Dots.liquid.js +22 -0
- package/dist/esm/swiper-carousel/dots/common/common.js +26 -0
- package/dist/esm/swiper-carousel/dots/common/getClass.js +38 -0
- package/dist/esm/swiper-carousel/dots/common/getStyle.js +31 -0
- package/dist/esm/swiper-carousel/dots/hook/useDotsSetting.js +19 -0
- package/dist/esm/swiper-carousel/index.js +15 -0
- package/dist/esm/swiper-carousel/next.js +18 -0
- package/dist/esm/swiper-carousel/root/Swiper.js +124 -0
- package/dist/esm/swiper-carousel/root/Swiper.liquid.js +100 -0
- package/dist/esm/swiper-carousel/root/common/getAttr.js +23 -0
- package/dist/esm/swiper-carousel/root/common/getClass.js +133 -0
- package/dist/esm/swiper-carousel/root/common/getData.js +54 -0
- package/dist/esm/swiper-carousel/root/common/getStyle.js +62 -0
- package/dist/esm/swiper-carousel/root/hook/useCarousel.js +480 -0
- package/dist/esm/swiper-carousel/setting/Swiper.js +38 -0
- package/dist/esm/swiper-carousel/setting/SwiperItem.js +36 -0
- package/dist/esm/swiper-carousel/setting/configs/presets.js +85 -0
- package/dist/esm/swiper-carousel/setting/configs/settingV2.js +815 -0
- package/dist/esm/swiper-carousel/setting/configs/uiV2.js +713 -0
- package/dist/types/index.d.ts +551 -116
- package/package.json +2 -2
package/dist/cjs/builder.js
CHANGED
|
@@ -22,6 +22,8 @@ var Breadcrumb = require('./breadcrumb/components/Breadcrumb.js');
|
|
|
22
22
|
var Button = require('./button/components/Button.js');
|
|
23
23
|
var Carousel = require('./carousel/root/Carousel.js');
|
|
24
24
|
var CarouselItem = require('./carousel/carousel-item/CarouselItem.js');
|
|
25
|
+
var Swiper = require('./swiper-carousel/root/Swiper.js');
|
|
26
|
+
var SwiperItem = require('./swiper-carousel/carousel-item/SwiperItem.js');
|
|
25
27
|
var Cart = require('./cart/components/Cart.js');
|
|
26
28
|
var CartList = require('./cart/components/CartList.js');
|
|
27
29
|
var CartLinePrice = require('./cart/components/CartLinePrice.js');
|
|
@@ -231,16 +233,17 @@ var ProductButton = require('./product/components/ProductButton/ProductButton.js
|
|
|
231
233
|
var index$8 = require('./product/components/ProductVariants/index.js');
|
|
232
234
|
var ProductImages = require('./product/components/ProductImages.js');
|
|
233
235
|
var index$9 = require('./product/components/ProductImagesV2/index.js');
|
|
236
|
+
var index$a = require('./product/components/ProductImagesV3/index.js');
|
|
234
237
|
var ProductProperties = require('./product/components/ProductProperties/ProductProperties.js');
|
|
235
|
-
var index$
|
|
236
|
-
var index$
|
|
238
|
+
var index$b = require('./product/components/ProductQuickView/index.js');
|
|
239
|
+
var index$c = require('./product/components/ProductDiscountTag/index.js');
|
|
237
240
|
var ProductList = require('./product/components/ProductList/ProductList.js');
|
|
238
241
|
var DynamicCheckout = require('./product/components/DynamicCheckout/DynamicCheckout.js');
|
|
239
242
|
var ProductBundleDiscount = require('./product/components/ProductBundle/components/ProductBundleDiscount.js');
|
|
240
243
|
var Vendor = require('./product/components/ProductVendor/Vendor.js');
|
|
241
244
|
var Sku = require('./product/components/ProductSKU/Sku.js');
|
|
242
245
|
var ProductViewMore = require('./product/components/ProductViewMore/ProductViewMore.js');
|
|
243
|
-
var index$
|
|
246
|
+
var index$d = require('./product/components/ProductBadge/index.js');
|
|
244
247
|
var UploadFile = require('./product/components/FileUpload/components/UploadFile.js');
|
|
245
248
|
var ProductBundleDiscountItem = require('./product/components/ProductBundle/components/ProductBundleDiscountItem.js');
|
|
246
249
|
var Radio = require('./radio/Radio.js');
|
|
@@ -282,6 +285,8 @@ var builder = {
|
|
|
282
285
|
Button: Button.default,
|
|
283
286
|
Carousel: Carousel.default,
|
|
284
287
|
CarouselItem: CarouselItem.default,
|
|
288
|
+
SwiperCarousel: Swiper.default,
|
|
289
|
+
SwiperCarouselItem: SwiperItem.default,
|
|
285
290
|
Cart: Cart.default,
|
|
286
291
|
CartList: CartList.default,
|
|
287
292
|
CartLinePrice: CartLinePrice.default,
|
|
@@ -437,9 +442,10 @@ var builder = {
|
|
|
437
442
|
ProductVariants: index$8.default,
|
|
438
443
|
ProductImages: ProductImages.default,
|
|
439
444
|
ProductImagesV2: index$9.default,
|
|
445
|
+
ProductImagesV3: index$a.default,
|
|
440
446
|
ProductProperties: ProductProperties.default,
|
|
441
|
-
ProductQuickView: index$
|
|
442
|
-
ProductTag: index$
|
|
447
|
+
ProductQuickView: index$b.default,
|
|
448
|
+
ProductTag: index$c.default,
|
|
443
449
|
ProductList: ProductList.default,
|
|
444
450
|
Radio: Radio.default,
|
|
445
451
|
Select: Select.default,
|
|
@@ -504,7 +510,7 @@ var builder = {
|
|
|
504
510
|
ProductVendor: Vendor.default,
|
|
505
511
|
KingProductOptions: KingProductOptions.default,
|
|
506
512
|
ProductViewMore: ProductViewMore.default,
|
|
507
|
-
ProductBadge: index$
|
|
513
|
+
ProductBadge: index$d.default,
|
|
508
514
|
HextomCountdownTimerBar: HextomCountdownTimerBar.default,
|
|
509
515
|
TrustBadgesBear: TrustBadgesBear.default,
|
|
510
516
|
TrustedsiteTrustBadges: TrustedsiteTrustBadges.default,
|
|
@@ -12,15 +12,14 @@ const getPaginatorStyle = (isActive, customStyle, activeColor)=>({
|
|
|
12
12
|
} : {}
|
|
13
13
|
});
|
|
14
14
|
const getCustomStyle = (setting)=>{
|
|
15
|
-
const { typo, layout, typographyPaginator, itemSpacing, buttonSizeNumber, buttonShape } = setting ?? {};
|
|
15
|
+
const { typo, layout, typographyPaginator, itemSpacing, buttonSizeNumber, buttonShape, normalColor } = setting ?? {};
|
|
16
16
|
const appendTypoStyle = core.composeTypographyStyle(typo, typographyPaginator);
|
|
17
|
-
const normalColor = typo?.attrs?.color;
|
|
18
17
|
let customStyle = core.composeMemo(()=>{
|
|
19
18
|
return core.removeNullUndefined({
|
|
20
19
|
...appendTypoStyle,
|
|
21
20
|
...core.makeStyle({
|
|
22
|
-
ml:
|
|
23
|
-
mr:
|
|
21
|
+
ml: itemSpacing,
|
|
22
|
+
mr: itemSpacing,
|
|
24
23
|
bc: core.getGlobalColorCSSProp(normalColor),
|
|
25
24
|
c: core.getGlobalColorCSSProp(normalColor)
|
|
26
25
|
})
|
package/dist/cjs/collection/components/collection-paginator/components/CollectionPaginator.liquid.js
CHANGED
|
@@ -39,7 +39,8 @@ const CollectionPaginator = ({ setting, builderProps, pageContext })=>{
|
|
|
39
39
|
...classes.getPaginatorClass()
|
|
40
40
|
});
|
|
41
41
|
const stylePaginator = system.createStyle({
|
|
42
|
-
...core.makeStyleResponsive('ta', align)
|
|
42
|
+
...core.makeStyleResponsive('ta', align),
|
|
43
|
+
...styleSetting.customStyle
|
|
43
44
|
});
|
|
44
45
|
const stateData = system.createStateOrContext({
|
|
45
46
|
setting,
|
package/dist/cjs/index.js
CHANGED
|
@@ -42,20 +42,20 @@ var index$C = require('./post-purchase/line/index.js');
|
|
|
42
42
|
var index$D = require('./post-purchase/link/index.js');
|
|
43
43
|
var index$E = require('./post-purchase/text/index.js');
|
|
44
44
|
var index$G = require('./post-purchase/product/index.js');
|
|
45
|
-
var index$
|
|
46
|
-
var index$
|
|
47
|
-
var index$
|
|
48
|
-
var index$
|
|
49
|
-
var index$
|
|
50
|
-
var index$
|
|
51
|
-
var index$
|
|
45
|
+
var index$R = require('./product/index.js');
|
|
46
|
+
var index$S = require('./radio/index.js');
|
|
47
|
+
var index$T = require('./select/index.js');
|
|
48
|
+
var index$U = require('./tab/index.js');
|
|
49
|
+
var index$V = require('./text/index.js');
|
|
50
|
+
var index$W = require('./textarea/index.js');
|
|
51
|
+
var index$X = require('./video/index.js');
|
|
52
52
|
var useInView = require('./intersection-observer/useInView.js');
|
|
53
|
-
var index$
|
|
54
|
-
var index$
|
|
55
|
-
var index$
|
|
56
|
-
var index
|
|
57
|
-
var index
|
|
58
|
-
var index$
|
|
53
|
+
var index$Y = require('./third-party/index.js');
|
|
54
|
+
var index$Z = require('./third-party-instant/index.js');
|
|
55
|
+
var index$_ = require('./stock-counter/index.js');
|
|
56
|
+
var index$$ = require('./third-party-slot/index.js');
|
|
57
|
+
var index$10 = require('./shop-pay-installment/index.js');
|
|
58
|
+
var index$11 = require('./sticky/index.js');
|
|
59
59
|
var next = require('./next.js');
|
|
60
60
|
var index_liquid = require('./index.liquid.js');
|
|
61
61
|
var builder = require('./builder.js');
|
|
@@ -177,14 +177,15 @@ var index$K = require('./product/components/ProductDescription/index.js');
|
|
|
177
177
|
var index$L = require('./product/components/ProductVariants/index.js');
|
|
178
178
|
var ProductImages = require('./product/components/ProductImages.js');
|
|
179
179
|
var index$M = require('./product/components/ProductImagesV2/index.js');
|
|
180
|
+
var index$N = require('./product/components/ProductImagesV3/index.js');
|
|
180
181
|
var ProductProperties = require('./product/components/ProductProperties/ProductProperties.js');
|
|
181
|
-
var index$
|
|
182
|
-
var index$
|
|
182
|
+
var index$O = require('./product/components/ProductQuickView/index.js');
|
|
183
|
+
var index$P = require('./product/components/ProductDiscountTag/index.js');
|
|
183
184
|
var ProductList = require('./product/components/ProductList/ProductList.js');
|
|
184
185
|
var Vendor = require('./product/components/ProductVendor/Vendor.js');
|
|
185
186
|
var DynamicCheckout = require('./product/components/DynamicCheckout/DynamicCheckout.js');
|
|
186
187
|
var ProductViewMore = require('./product/components/ProductViewMore/ProductViewMore.js');
|
|
187
|
-
var index$
|
|
188
|
+
var index$Q = require('./product/components/ProductBadge/index.js');
|
|
188
189
|
var ProductBundleDiscount = require('./product/components/ProductBundle/components/ProductBundleDiscount.js');
|
|
189
190
|
var ProductBundleDiscountItem = require('./product/components/ProductBundle/components/ProductBundleDiscountItem.js');
|
|
190
191
|
var Sku = require('./product/components/ProductSKU/Sku.js');
|
|
@@ -365,20 +366,20 @@ exports.postPurchaseLinkSetting = index$D.postPurchaseLinkSetting;
|
|
|
365
366
|
exports.PostPurchaseHeading = index$E.PostPurchaseHeading;
|
|
366
367
|
exports.postPurchaseTextSetting = index$E.postPurchaseTextSetting;
|
|
367
368
|
exports.postPurchaseProductSetting = index$G.postPurchaseProductSetting;
|
|
368
|
-
exports.productSetting = index$
|
|
369
|
-
exports.radioSetting = index$
|
|
370
|
-
exports.selectSetting = index$
|
|
371
|
-
exports.tabSetting = index$
|
|
372
|
-
exports.textSetting = index$
|
|
373
|
-
exports.textareaSetting = index$
|
|
374
|
-
exports.videoSetting = index$
|
|
369
|
+
exports.productSetting = index$R.productSetting;
|
|
370
|
+
exports.radioSetting = index$S.radioSetting;
|
|
371
|
+
exports.selectSetting = index$T.selectSetting;
|
|
372
|
+
exports.tabSetting = index$U.tabSetting;
|
|
373
|
+
exports.textSetting = index$V.textSetting;
|
|
374
|
+
exports.textareaSetting = index$W.textareaSetting;
|
|
375
|
+
exports.videoSetting = index$X.videoSetting;
|
|
375
376
|
exports.useInView = useInView.useInView;
|
|
376
|
-
exports.thirdPartySetting = index$
|
|
377
|
-
exports.thirdPartyInstantSetting = index$
|
|
378
|
-
exports.stockCounterSetting = index$
|
|
379
|
-
exports.thirdPartySlotSetting = index
|
|
380
|
-
exports.shopPayInstallmentSetting = index
|
|
381
|
-
exports.stickySetting = index$
|
|
377
|
+
exports.thirdPartySetting = index$Y.thirdPartySetting;
|
|
378
|
+
exports.thirdPartyInstantSetting = index$Z.thirdPartyInstantSetting;
|
|
379
|
+
exports.stockCounterSetting = index$_.stockCounterSetting;
|
|
380
|
+
exports.thirdPartySlotSetting = index$$.thirdPartySlotSetting;
|
|
381
|
+
exports.shopPayInstallmentSetting = index$10.shopPayInstallmentSetting;
|
|
382
|
+
exports.stickySetting = index$11.stickySetting;
|
|
382
383
|
exports.nextComponent = next.default;
|
|
383
384
|
exports.liquidComponents = index_liquid;
|
|
384
385
|
exports.builderComponent = builder.default;
|
|
@@ -512,14 +513,15 @@ exports.ProductDescription = index$K.default;
|
|
|
512
513
|
exports.ProductVariants = index$L.default;
|
|
513
514
|
exports.ProductImages = ProductImages.default;
|
|
514
515
|
exports.ProductImagesV2 = index$M.default;
|
|
516
|
+
exports.ProductImagesV3 = index$N.default;
|
|
515
517
|
exports.ProductPropertyInput = ProductProperties.default;
|
|
516
|
-
exports.ProductQuickView = index$
|
|
517
|
-
exports.ProductTag = index$
|
|
518
|
+
exports.ProductQuickView = index$O.default;
|
|
519
|
+
exports.ProductTag = index$P.default;
|
|
518
520
|
exports.ProductList = ProductList.default;
|
|
519
521
|
exports.ProductVendor = Vendor.default;
|
|
520
522
|
exports.DynamicCheckout = DynamicCheckout.default;
|
|
521
523
|
exports.ProductViewMore = ProductViewMore.default;
|
|
522
|
-
exports.ProductBadge = index$
|
|
524
|
+
exports.ProductBadge = index$Q.default;
|
|
523
525
|
exports.ProductBundleDiscount = ProductBundleDiscount.default;
|
|
524
526
|
exports.ProductBundleDiscountItem = ProductBundleDiscountItem.default;
|
|
525
527
|
exports.ProductSku = Sku.default;
|
package/dist/cjs/index.liquid.js
CHANGED
|
@@ -59,18 +59,19 @@ var Text_liquid = require('./text/components/Text.liquid.js');
|
|
|
59
59
|
var DynamicCheckout_liquid = require('./product/components/DynamicCheckout/DynamicCheckout.liquid.js');
|
|
60
60
|
var UploadFile_liquid = require('./product/components/FileUpload/components/UploadFile.liquid.js');
|
|
61
61
|
var Product_liquid = require('./product/components/ProductWrap/Product.liquid.js');
|
|
62
|
-
var index_liquid$
|
|
62
|
+
var index_liquid$8 = require('./product/components/ProductBadge/index.liquid.js');
|
|
63
63
|
var ProductBundleDiscount_liquid = require('./product/components/ProductBundle/components/ProductBundleDiscount.liquid.js');
|
|
64
64
|
var ProductBundleDiscountItem_liquid = require('./product/components/ProductBundle/components/ProductBundleDiscountItem.liquid.js');
|
|
65
65
|
var ProductButton_liquid = require('./product/components/ProductButton/ProductButton.liquid.js');
|
|
66
66
|
var index_liquid$1 = require('./product/components/ProductDescription/index.liquid.js');
|
|
67
67
|
var ProductImages_liquid = require('./product/components/ProductImages.liquid.js');
|
|
68
|
-
var index_liquid$
|
|
69
|
-
var index_liquid$
|
|
70
|
-
var index_liquid$
|
|
68
|
+
var index_liquid$5 = require('./product/components/ProductQuantity/index.liquid.js');
|
|
69
|
+
var index_liquid$6 = require('./product/components/ProductVariants/index.liquid.js');
|
|
70
|
+
var index_liquid$7 = require('./product/components/ProductDiscountTag/index.liquid.js');
|
|
71
71
|
var index_liquid$2 = require('./product/components/ProductImagesV2/index.liquid.js');
|
|
72
|
+
var index_liquid$3 = require('./product/components/ProductImagesV3/index.liquid.js');
|
|
72
73
|
var ProductList_liquid = require('./product/components/ProductList/ProductList.liquid.js');
|
|
73
|
-
var index_liquid$
|
|
74
|
+
var index_liquid$4 = require('./product/components/ProductPrice/index.liquid.js');
|
|
74
75
|
var ProductProperties_liquid = require('./product/components/ProductProperties/ProductProperties.liquid.js');
|
|
75
76
|
var index_liquid = require('./product/components/ProductTitle/index.liquid.js');
|
|
76
77
|
var ProductViewMore_liquid = require('./product/components/ProductViewMore/ProductViewMore.liquid.js');
|
|
@@ -198,6 +199,8 @@ var StellarDeliveryDatePickup_liquid = require('./third-party/components/Stellar
|
|
|
198
199
|
var ThirdPartySlot_liquid = require('./third-party-slot/components/ThirdPartySlot.liquid.js');
|
|
199
200
|
var ShopPayInstallments_liquid = require('./shop-pay-installment/components/ShopPayInstallments.liquid.js');
|
|
200
201
|
var Sticky_liquid = require('./sticky/components/Sticky.liquid.js');
|
|
202
|
+
var SwiperItem_liquid = require('./swiper-carousel/carousel-item/SwiperItem.liquid.js');
|
|
203
|
+
var Swiper_liquid = require('./swiper-carousel/root/Swiper.liquid.js');
|
|
201
204
|
|
|
202
205
|
|
|
203
206
|
|
|
@@ -259,18 +262,19 @@ exports.Text = Text_liquid.default;
|
|
|
259
262
|
exports.DynamicCheckout = DynamicCheckout_liquid.default;
|
|
260
263
|
exports.FileUpload = UploadFile_liquid.default;
|
|
261
264
|
exports.Product = Product_liquid.default;
|
|
262
|
-
exports.ProductBadge = index_liquid$
|
|
265
|
+
exports.ProductBadge = index_liquid$8.default;
|
|
263
266
|
exports.ProductBundleDiscount = ProductBundleDiscount_liquid.default;
|
|
264
267
|
exports.ProductBundleDiscountItem = ProductBundleDiscountItem_liquid.default;
|
|
265
268
|
exports.ProductButton = ProductButton_liquid.default;
|
|
266
269
|
exports.ProductDescription = index_liquid$1.default;
|
|
267
270
|
exports.ProductImages = ProductImages_liquid.default;
|
|
268
|
-
exports.ProductQuantity = index_liquid$
|
|
269
|
-
exports.ProductVariants = index_liquid$
|
|
270
|
-
exports.ProductTag = index_liquid$
|
|
271
|
+
exports.ProductQuantity = index_liquid$5.default;
|
|
272
|
+
exports.ProductVariants = index_liquid$6.default;
|
|
273
|
+
exports.ProductTag = index_liquid$7.default;
|
|
271
274
|
exports.ProductImagesV2 = index_liquid$2.default;
|
|
275
|
+
exports.ProductImagesV3 = index_liquid$3.default;
|
|
272
276
|
exports.ProductList = ProductList_liquid.default;
|
|
273
|
-
exports.ProductPrice = index_liquid$
|
|
277
|
+
exports.ProductPrice = index_liquid$4.ProductPrice;
|
|
274
278
|
exports.ProductProperties = ProductProperties_liquid.default;
|
|
275
279
|
exports.ProductTitle = index_liquid.default;
|
|
276
280
|
exports.ProductViewMore = ProductViewMore_liquid.default;
|
|
@@ -398,3 +402,5 @@ exports.StellarDeliveryDatePickup = StellarDeliveryDatePickup_liquid.default;
|
|
|
398
402
|
exports.ThirdPartySlot = ThirdPartySlot_liquid.default;
|
|
399
403
|
exports.ShopPayInstallments = ShopPayInstallments_liquid.default;
|
|
400
404
|
exports.Sticky = Sticky_liquid.default;
|
|
405
|
+
exports.SwiperCarouselItem = SwiperItem_liquid.default;
|
|
406
|
+
exports.SwiperCarousel = Swiper_liquid.default;
|
package/dist/cjs/next.js
CHANGED
|
@@ -56,6 +56,7 @@ var next$O = require('./stock-counter/next.js');
|
|
|
56
56
|
var next$P = require('./third-party-slot/next.js');
|
|
57
57
|
var next$Q = require('./shop-pay-installment/next.js');
|
|
58
58
|
var next$R = require('./sticky/next.js');
|
|
59
|
+
var next$S = require('./swiper-carousel/next.js');
|
|
59
60
|
|
|
60
61
|
var next = {
|
|
61
62
|
...next$1.default,
|
|
@@ -110,7 +111,8 @@ var next = {
|
|
|
110
111
|
...next$O.default,
|
|
111
112
|
...next$P.default,
|
|
112
113
|
...next$Q.default,
|
|
113
|
-
...next$R.default
|
|
114
|
+
...next$R.default,
|
|
115
|
+
...next$S.default
|
|
114
116
|
};
|
|
115
117
|
|
|
116
118
|
exports.default = next;
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@gem-sdk/core');
|
|
4
|
+
|
|
5
|
+
const getTypeWidthDevice = (typeWithDevice)=>{
|
|
6
|
+
const desktopType = typeWithDevice?.desktop;
|
|
7
|
+
const tabletType = typeWithDevice?.tablet === undefined ? desktopType : typeWithDevice?.tablet;
|
|
8
|
+
const mobileType = typeWithDevice?.mobile === undefined ? tabletType : typeWithDevice?.mobile;
|
|
9
|
+
return {
|
|
10
|
+
desktop: desktopType,
|
|
11
|
+
tablet: tabletType,
|
|
12
|
+
mobile: mobileType
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
const convertUnitToNumber = (value, defaultValue)=>{
|
|
16
|
+
if (!value) {
|
|
17
|
+
return defaultValue;
|
|
18
|
+
}
|
|
19
|
+
if (typeof value === 'number') {
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
const data = value.replaceAll('px', '').replaceAll('%', '').replaceAll('rem', '').replaceAll('em', '');
|
|
23
|
+
return !isNaN(Number(data)) ? Number(data) : defaultValue;
|
|
24
|
+
};
|
|
25
|
+
const convertSpacing = (spacing)=>{
|
|
26
|
+
if (!spacing) {
|
|
27
|
+
return {
|
|
28
|
+
desktop: 5
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
desktop: convertUnitToNumber(spacing.desktop, 5),
|
|
33
|
+
tablet: convertUnitToNumber(spacing.tablet, 5),
|
|
34
|
+
mobile: convertUnitToNumber(spacing.mobile, 5)
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
const getDisplayStyle = (fnCondition, defaultValue)=>{
|
|
38
|
+
let result = {};
|
|
39
|
+
const devices = [
|
|
40
|
+
'desktop',
|
|
41
|
+
'mobile',
|
|
42
|
+
'tablet'
|
|
43
|
+
];
|
|
44
|
+
devices.forEach((device)=>{
|
|
45
|
+
result = {
|
|
46
|
+
...result,
|
|
47
|
+
[`--d${device === 'desktop' ? '' : `-${device}`}`]: `${fnCondition(device) ? 'none' : defaultValue}`
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
return result;
|
|
51
|
+
};
|
|
52
|
+
const checkAddOverFlowClass = (style)=>{
|
|
53
|
+
const radius = style?.['--radius'];
|
|
54
|
+
const bblr = style?.['--bblr'] || '0px';
|
|
55
|
+
const bbrr = style?.['--bbrr'] || '0px';
|
|
56
|
+
const btlr = style?.['--btlr'] || '0px';
|
|
57
|
+
const btrr = style?.['--btrr'] || '0px';
|
|
58
|
+
return radius && !radius.toString().includes('none') && radius.toString() !== '0' || bblr !== '0px' || bbrr !== '0px' || btlr !== '0px' || btrr !== '0px';
|
|
59
|
+
};
|
|
60
|
+
const getAspectRatio = (shape)=>{
|
|
61
|
+
let result = {};
|
|
62
|
+
const DEVICES = [
|
|
63
|
+
'desktop',
|
|
64
|
+
'mobile',
|
|
65
|
+
'tablet'
|
|
66
|
+
];
|
|
67
|
+
DEVICES.forEach((device)=>{
|
|
68
|
+
const shapeValue = core.getResponsiveValueByScreen(shape, device)?.shapeValue;
|
|
69
|
+
if (shapeValue) {
|
|
70
|
+
result = {
|
|
71
|
+
...result,
|
|
72
|
+
[device]: shapeValue
|
|
73
|
+
};
|
|
74
|
+
} else {
|
|
75
|
+
const shapeConfig = core.getResponsiveValueByScreen(shape, device)?.shape;
|
|
76
|
+
switch(shapeConfig){
|
|
77
|
+
case 'square':
|
|
78
|
+
result = {
|
|
79
|
+
...result,
|
|
80
|
+
[device]: '1/1'
|
|
81
|
+
};
|
|
82
|
+
break;
|
|
83
|
+
case 'vertical':
|
|
84
|
+
result = {
|
|
85
|
+
...result,
|
|
86
|
+
[device]: '3/4'
|
|
87
|
+
};
|
|
88
|
+
break;
|
|
89
|
+
case 'horizontal':
|
|
90
|
+
result = {
|
|
91
|
+
...result,
|
|
92
|
+
[device]: '4/3'
|
|
93
|
+
};
|
|
94
|
+
break;
|
|
95
|
+
case 'original':
|
|
96
|
+
result = {
|
|
97
|
+
...result,
|
|
98
|
+
[device]: ''
|
|
99
|
+
};
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
return core.makeAspectRatio(result);
|
|
105
|
+
};
|
|
106
|
+
const getStyleGridLayout = (settings)=>{
|
|
107
|
+
const DEVICES = [
|
|
108
|
+
'desktop',
|
|
109
|
+
'tablet',
|
|
110
|
+
'mobile'
|
|
111
|
+
];
|
|
112
|
+
let result = {
|
|
113
|
+
[`--gtc`]: 'minmax(0, 12fr)',
|
|
114
|
+
[`--gtc-tablet`]: 'minmax(0, 12fr)',
|
|
115
|
+
[`--gtc-mobile`]: 'minmax(0, 12fr)'
|
|
116
|
+
};
|
|
117
|
+
if (!settings.isHiddenGalleryImages) {
|
|
118
|
+
let hasHorizontalLayout = false;
|
|
119
|
+
DEVICES.forEach((device)=>{
|
|
120
|
+
const positionDevice = core.getResponsiveValueByScreen(settings.position, device);
|
|
121
|
+
const ratioLayoutDevice = core.getResponsiveValueByScreen(settings.ratioLayout, device);
|
|
122
|
+
const ratioLayoutRightDevice = core.getResponsiveValueByScreen(settings.ratioLayoutRight, device);
|
|
123
|
+
const key = device === 'desktop' ? '--gtc' : `--gtc-${device}`;
|
|
124
|
+
const rowKey = device === 'desktop' ? '--gtr' : `--gtr-${device}`;
|
|
125
|
+
const ratioLayout = positionDevice === 'left' ? ratioLayoutDevice : ratioLayoutRightDevice;
|
|
126
|
+
const isHorizontalLayout = [
|
|
127
|
+
'left',
|
|
128
|
+
'right'
|
|
129
|
+
].includes(positionDevice || '');
|
|
130
|
+
if (isHorizontalLayout && ratioLayout) {
|
|
131
|
+
hasHorizontalLayout = true;
|
|
132
|
+
result = {
|
|
133
|
+
...result,
|
|
134
|
+
[key]: `minmax(0, ${ratioLayout[0]}fr) minmax(0, ${ratioLayout[1]}fr)`
|
|
135
|
+
};
|
|
136
|
+
Object.assign(result, {
|
|
137
|
+
[rowKey]: 'fit-content(0)'
|
|
138
|
+
});
|
|
139
|
+
} else if (hasHorizontalLayout) {
|
|
140
|
+
Object.assign(result, {
|
|
141
|
+
[rowKey]: 'unset'
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
return result;
|
|
147
|
+
};
|
|
148
|
+
const getStyleGridOrderForFeature = (settings)=>{
|
|
149
|
+
let result = {
|
|
150
|
+
[`--o`]: '0',
|
|
151
|
+
[`--o-tablet`]: '0',
|
|
152
|
+
[`--o-mobile`]: '0'
|
|
153
|
+
};
|
|
154
|
+
const DEVICES = [
|
|
155
|
+
'desktop',
|
|
156
|
+
'mobile',
|
|
157
|
+
'tablet'
|
|
158
|
+
];
|
|
159
|
+
DEVICES.forEach((device)=>{
|
|
160
|
+
const positionDevice = core.getResponsiveValueByScreen(settings.position, device);
|
|
161
|
+
const key = device === 'desktop' ? '--o' : `--o-${device}`;
|
|
162
|
+
result = {
|
|
163
|
+
...result,
|
|
164
|
+
[key]: positionDevice === 'left' ? `1` : '0'
|
|
165
|
+
};
|
|
166
|
+
});
|
|
167
|
+
return result;
|
|
168
|
+
};
|
|
169
|
+
const getStyleGridOrderForGallery = (settings)=>{
|
|
170
|
+
let result = {
|
|
171
|
+
[`--o`]: '1',
|
|
172
|
+
[`--o-tablet`]: '1',
|
|
173
|
+
[`--o-mobile`]: '1'
|
|
174
|
+
};
|
|
175
|
+
const DEVICES = [
|
|
176
|
+
'desktop',
|
|
177
|
+
'mobile',
|
|
178
|
+
'tablet'
|
|
179
|
+
];
|
|
180
|
+
DEVICES.forEach((device)=>{
|
|
181
|
+
const positionDevice = core.getResponsiveValueByScreen(settings.position, device);
|
|
182
|
+
const key = device === 'desktop' ? '--o' : `--o-${device}`;
|
|
183
|
+
result = {
|
|
184
|
+
...result,
|
|
185
|
+
[key]: positionDevice === 'left' ? `0` : '1'
|
|
186
|
+
};
|
|
187
|
+
});
|
|
188
|
+
return result;
|
|
189
|
+
};
|
|
190
|
+
const getSrcImage = (liquidSrc)=>{
|
|
191
|
+
return `{{${liquidSrc} | img_url: '480x480'}} 480w, {{${liquidSrc} | img_url: '768x768'}} 768w,{{${liquidSrc} | img_url: '1024x1024'}} 1024w,{{${liquidSrc} | img_url: '1440x1440'}} 1440w`;
|
|
192
|
+
};
|
|
193
|
+
const convertSpacingForIndisdeLayout = (spacing)=>{
|
|
194
|
+
const spacingVal = parseInt(spacing) ? `${parseInt(spacing) * 2}px` : `${spacing} * 2`;
|
|
195
|
+
return spacingVal;
|
|
196
|
+
};
|
|
197
|
+
const getStyleInsideLayout = (position, shape, spacing)=>{
|
|
198
|
+
const DEVICES = [
|
|
199
|
+
'desktop',
|
|
200
|
+
'mobile',
|
|
201
|
+
'tablet'
|
|
202
|
+
];
|
|
203
|
+
let posResponsive = {};
|
|
204
|
+
let width = {};
|
|
205
|
+
let bottom = {};
|
|
206
|
+
let top = {};
|
|
207
|
+
let right = {};
|
|
208
|
+
let left = {};
|
|
209
|
+
DEVICES.forEach((device)=>{
|
|
210
|
+
const positionDevice = core.getResponsiveValueByScreen(position, device);
|
|
211
|
+
let widthDevice = core.getResponsiveValueByScreen(shape, device)?.width;
|
|
212
|
+
const spacingDevice = core.getResponsiveValueByScreen(spacing, device);
|
|
213
|
+
posResponsive = {
|
|
214
|
+
...posResponsive,
|
|
215
|
+
[device]: [
|
|
216
|
+
'inside-bottom',
|
|
217
|
+
'inside-left',
|
|
218
|
+
'inside-right'
|
|
219
|
+
].includes(positionDevice) ? 'absolute' : 'static'
|
|
220
|
+
};
|
|
221
|
+
if ([
|
|
222
|
+
'inside-bottom'
|
|
223
|
+
].includes(positionDevice)) {
|
|
224
|
+
const spacingVal = convertSpacingForIndisdeLayout(spacingDevice);
|
|
225
|
+
widthDevice = `calc(100% - ${spacingVal})`;
|
|
226
|
+
}
|
|
227
|
+
if ([
|
|
228
|
+
'bottom-center',
|
|
229
|
+
'two-col',
|
|
230
|
+
'one-col'
|
|
231
|
+
].includes(positionDevice)) {
|
|
232
|
+
widthDevice = '100%';
|
|
233
|
+
}
|
|
234
|
+
bottom = {
|
|
235
|
+
...bottom,
|
|
236
|
+
[device]: positionDevice === 'inside-bottom' ? `${spacingDevice}` : 'auto'
|
|
237
|
+
};
|
|
238
|
+
top = {
|
|
239
|
+
...top,
|
|
240
|
+
[device]: [
|
|
241
|
+
'inside-left',
|
|
242
|
+
'inside-right'
|
|
243
|
+
].includes(positionDevice) ? `${spacingDevice}` : 'auto'
|
|
244
|
+
};
|
|
245
|
+
left = {
|
|
246
|
+
...left,
|
|
247
|
+
[device]: [
|
|
248
|
+
'inside-bottom',
|
|
249
|
+
'inside-left'
|
|
250
|
+
].includes(positionDevice) ? `${spacingDevice}` : 'auto'
|
|
251
|
+
};
|
|
252
|
+
right = {
|
|
253
|
+
...right,
|
|
254
|
+
[device]: positionDevice === 'inside-right' ? `${spacingDevice}` : 'auto'
|
|
255
|
+
};
|
|
256
|
+
width = {
|
|
257
|
+
...width,
|
|
258
|
+
[device]: widthDevice
|
|
259
|
+
};
|
|
260
|
+
});
|
|
261
|
+
return {
|
|
262
|
+
...core.makeStyleResponsive('pos', posResponsive),
|
|
263
|
+
...core.makeStyleResponsive('w', core.removeNullUndefined(width)),
|
|
264
|
+
...core.makeStyleResponsive('bottom', core.removeNullUndefined(bottom)),
|
|
265
|
+
...core.makeStyleResponsive('top', core.removeNullUndefined(top)),
|
|
266
|
+
...core.makeStyleResponsive('left', core.removeNullUndefined(left)),
|
|
267
|
+
...core.makeStyleResponsive('right', core.removeNullUndefined(right))
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
const getConditionRenderGalleryImages = (position)=>{
|
|
271
|
+
const DEVICES = [
|
|
272
|
+
'desktop',
|
|
273
|
+
'mobile',
|
|
274
|
+
'tablet'
|
|
275
|
+
];
|
|
276
|
+
let isOnlyFeatureAllDevices = true;
|
|
277
|
+
let isRenderGalleryGrid = false;
|
|
278
|
+
DEVICES.forEach((device)=>{
|
|
279
|
+
const positionDevice = core.getResponsiveValueByScreen(position, device);
|
|
280
|
+
if (positionDevice && positionDevice !== 'only-feature') isOnlyFeatureAllDevices = false;
|
|
281
|
+
if ([
|
|
282
|
+
'two-col',
|
|
283
|
+
'one-col'
|
|
284
|
+
].includes(positionDevice)) {
|
|
285
|
+
isRenderGalleryGrid = true;
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
return {
|
|
289
|
+
isOnlyFeatureAllDevices,
|
|
290
|
+
isRenderGalleryGrid
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
const setDefaultWhenUndefineSetting = (props)=>{
|
|
294
|
+
return {
|
|
295
|
+
...props,
|
|
296
|
+
setting: {
|
|
297
|
+
...props.setting
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
const getValueFromValueContainUnit = (value)=>{
|
|
302
|
+
const result = value.match(/\d+/g);
|
|
303
|
+
return result ? result[0] : value;
|
|
304
|
+
};
|
|
305
|
+
const getPaddingBottomByShapeSetting = (shapeSetting)=>{
|
|
306
|
+
const aspectRatio = getAspectRatio(shapeSetting);
|
|
307
|
+
let result = {
|
|
308
|
+
desktop: 'auto',
|
|
309
|
+
mobile: 'auto',
|
|
310
|
+
tablet: 'auto'
|
|
311
|
+
};
|
|
312
|
+
const DEVICES = [
|
|
313
|
+
'desktop',
|
|
314
|
+
'mobile',
|
|
315
|
+
'tablet'
|
|
316
|
+
];
|
|
317
|
+
DEVICES.forEach((device)=>{
|
|
318
|
+
const shapeByDevice = core.getResponsiveValueByScreen(shapeSetting, device);
|
|
319
|
+
const height = shapeByDevice?.height;
|
|
320
|
+
const width = shapeByDevice?.width || '';
|
|
321
|
+
const heightNotUnit = getValueFromValueContainUnit(height || '');
|
|
322
|
+
const widthNotUnit = width.match(/px/g) ? getValueFromValueContainUnit(width) : width;
|
|
323
|
+
if (height && width && !isNaN(Number(heightNotUnit)) && !isNaN(Number(widthNotUnit))) {
|
|
324
|
+
result = {
|
|
325
|
+
...result,
|
|
326
|
+
[device]: `${Number(heightNotUnit) / Number(widthNotUnit) * 100}%`
|
|
327
|
+
};
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
if (height && !isNaN(Number(heightNotUnit))) {
|
|
331
|
+
result = {
|
|
332
|
+
...result,
|
|
333
|
+
[device]: height
|
|
334
|
+
};
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
const value = aspectRatio?.[device] !== 'auto' && !!aspectRatio?.[device] ? aspectRatio?.[device]?.split('').reverse().join('') : '{%if media.height%} {{media.height}} / {{media.width}} {%else%} 100 / 100 {%endif%}';
|
|
338
|
+
result = {
|
|
339
|
+
...result,
|
|
340
|
+
[device]: `calc((${value})*100%)`
|
|
341
|
+
};
|
|
342
|
+
});
|
|
343
|
+
return result;
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
exports.checkAddOverFlowClass = checkAddOverFlowClass;
|
|
347
|
+
exports.convertSpacing = convertSpacing;
|
|
348
|
+
exports.convertSpacingForIndisdeLayout = convertSpacingForIndisdeLayout;
|
|
349
|
+
exports.convertUnitToNumber = convertUnitToNumber;
|
|
350
|
+
exports.getAspectRatio = getAspectRatio;
|
|
351
|
+
exports.getConditionRenderGalleryImages = getConditionRenderGalleryImages;
|
|
352
|
+
exports.getDisplayStyle = getDisplayStyle;
|
|
353
|
+
exports.getPaddingBottomByShapeSetting = getPaddingBottomByShapeSetting;
|
|
354
|
+
exports.getSrcImage = getSrcImage;
|
|
355
|
+
exports.getStyleGridLayout = getStyleGridLayout;
|
|
356
|
+
exports.getStyleGridOrderForFeature = getStyleGridOrderForFeature;
|
|
357
|
+
exports.getStyleGridOrderForGallery = getStyleGridOrderForGallery;
|
|
358
|
+
exports.getStyleInsideLayout = getStyleInsideLayout;
|
|
359
|
+
exports.getTypeWidthDevice = getTypeWidthDevice;
|
|
360
|
+
exports.setDefaultWhenUndefineSetting = setDefaultWhenUndefineSetting;
|