@gem-sdk/components 2.0.0-dev.277 → 2.0.0-dev.288
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/components/Accordion.js +60 -179
- package/dist/cjs/accordion/components/Accordion.liquid.js +77 -101
- package/dist/cjs/accordion/components/AccordionItem.js +126 -280
- package/dist/cjs/accordion/components/AccordionItem.liquid.js +77 -215
- package/dist/cjs/accordion/components/common/classes.js +55 -0
- package/dist/cjs/accordion/components/common/index.js +146 -0
- package/dist/cjs/accordion/components/common/styles.js +131 -0
- package/dist/cjs/accordion/hooks/useAccordion.js +145 -0
- package/dist/cjs/accordion/hooks/useAccordionItem.js +119 -0
- package/dist/cjs/article/components/ArticleImage.js +0 -1
- package/dist/cjs/article/components/ArticlePagination.js +1 -1
- package/dist/cjs/article/components/ArticlePagination.liquid.js +3 -3
- package/dist/cjs/article/setting/configs/ArticleImage/settings.js +5 -5
- package/dist/cjs/banner/components/HeroBannerItem.js +0 -6
- package/dist/cjs/banner/components/HeroBannerItem.liquid.js +3 -0
- package/dist/cjs/banner/setting/setting.js +28 -3
- package/dist/cjs/banner/setting/uiV2.js +10 -97
- package/dist/cjs/builder.js +18 -20
- package/dist/cjs/cart/components/CartLineImage.js +0 -2
- package/dist/cjs/code/common/classes.js +11 -0
- package/dist/cjs/code/common/styles.js +15 -0
- package/dist/cjs/code/components/CSSCode.js +9 -99
- package/dist/cjs/code/components/CSSCode.liquid.js +11 -11
- package/dist/cjs/code/hooks/useCSSCode.js +102 -0
- package/dist/cjs/code/setting/CSSCode.js +7 -121
- package/dist/cjs/code/setting/config/setting.js +77 -0
- package/dist/cjs/code/setting/config/uiV1.js +52 -0
- package/dist/cjs/code/setting/config/uiV2.js +58 -0
- package/dist/cjs/estimate-delivery/components/EstimateDate.liquid.js +4 -1
- package/dist/cjs/form/components/contact/Contact.js +6 -2
- package/dist/cjs/form/components/contact/common/composeStyles.js +21 -0
- package/dist/cjs/form/components/form-checkbox/FormCheckbox.js +6 -4
- package/dist/cjs/form/components/form-checkbox/FormCheckbox.liquid.js +2 -4
- package/dist/cjs/form/components/form-checkbox/common/composeClasses.js +2 -2
- package/dist/cjs/form/components/form-checkbox/common/composeStyles.js +23 -10
- package/dist/cjs/form/components/form-dropdown/common/composeClasses.js +1 -1
- package/dist/cjs/form/components/form-email/FormEmail.js +18 -10
- package/dist/cjs/form/components/form-email/common/composeClasses.js +2 -1
- package/dist/cjs/form/components/newsletter/Newsletter.js +7 -2
- package/dist/cjs/form/components/newsletter/Newsletter.liquid.js +1 -1
- package/dist/cjs/form/components/newsletter/common/composeStyles.js +4 -2
- package/dist/cjs/form/components/textarea/TextArea.js +16 -8
- package/dist/cjs/form/components/textarea/common/composeClasses.js +1 -1
- package/dist/cjs/form/components/textfield/TextField.js +17 -9
- package/dist/cjs/form/components/textfield/common/composeClasses.js +2 -2
- package/dist/cjs/form/setting/contact/Contact.js +5 -1
- package/dist/cjs/form/setting/form-checkbox/configs/settings.js +153 -6
- package/dist/cjs/form/setting/form-checkbox/configs/uiV2.js +137 -0
- package/dist/cjs/form/setting/form-dropdown/configs/settings.js +147 -0
- package/dist/cjs/form/setting/form-dropdown/configs/uiV2.js +156 -4
- package/dist/cjs/form/setting/newsletter/configs/settings.js +132 -3
- package/dist/cjs/form/setting/newsletter/configs/uiV2.js +93 -0
- package/dist/cjs/form/setting/submit-button/configs/settings.js +37 -0
- package/dist/cjs/form/setting/submit-button/configs/uiV2.js +13 -0
- package/dist/cjs/grid/row/commons/getInnerRadius.js +11 -10
- package/dist/cjs/grid/row/setting/configs/uiV2.js +1 -1
- package/dist/cjs/header/components/kind/basic/index.js +1 -0
- package/dist/cjs/header/components/kind/modern/index.js +1 -1
- package/dist/cjs/helpers.js +53 -0
- package/dist/cjs/icon-list/setting/configs/uiV2.js +1 -1
- package/dist/cjs/icon-list-v2/setting/configs/settings.js +5 -5
- package/dist/cjs/image/components/AdaptiveImage.js +63 -49
- package/dist/cjs/image/components/AdaptiveImage.liquid.js +56 -44
- package/dist/cjs/image/components/Image.js +65 -154
- package/dist/cjs/image/components/Image.liquid.js +68 -103
- package/dist/cjs/image/components/Modal3d.liquid.js +54 -21
- package/dist/cjs/image/components/NextImage.js +26 -59
- package/dist/cjs/image/components/NextImage.liquid.js +27 -115
- package/dist/cjs/image/components/Video.liquid.js +38 -13
- package/dist/cjs/image/components/common/attributes.js +115 -0
- package/dist/cjs/image/components/common/classes.js +57 -0
- package/dist/cjs/image/components/common/constants.js +15 -0
- package/dist/cjs/image/components/common/data.js +24 -0
- package/dist/cjs/image/components/common/helpers.js +75 -0
- package/dist/cjs/image/components/common/styles.js +88 -0
- package/dist/cjs/image/components/helpers/getNextImageLiquidAttrs.js +80 -0
- package/dist/cjs/image/components/helpers/getNextImageReactAttrs.js +40 -0
- package/dist/cjs/image/components/hooks/useCheckNoImage.js +25 -0
- package/dist/cjs/image/helpers/getSrcSet.js +0 -2
- package/dist/cjs/image/next.js +1 -5
- package/dist/cjs/image/setting/configs/settings.js +14 -8
- package/dist/cjs/image/setting/configs/uiV2.js +61 -15
- package/dist/cjs/image/setting/index.js +1 -3
- package/dist/cjs/image-comparison/components/CompareImage.js +1 -1
- package/dist/cjs/image-comparison/components/CompareImage.liquid.js +1 -1
- package/dist/cjs/index.js +91 -91
- package/dist/cjs/index.liquid.js +8 -8
- package/dist/cjs/post-purchase/callout-banner/setting/config/callout-box/setting.js +4 -10
- package/dist/cjs/post-purchase/countdown-timer/components/PostPurchaseCountdownTimer.js +9 -23
- package/dist/cjs/post-purchase/countdown-timer/components/TextCountdown.js +12 -26
- package/dist/cjs/post-purchase/countdown-timer/components/common/getClasses.js +24 -0
- package/dist/cjs/post-purchase/countdown-timer/components/common/getStyles.js +21 -0
- package/dist/cjs/post-purchase/countdown-timer/hooks/useCountdownTimer.js +18 -1
- package/dist/cjs/post-purchase/countdown-timer/hooks/useGetTimeExpired.js +18 -0
- package/dist/cjs/post-purchase/countdown-timer/settings/CountdownTimer.js +9 -358
- package/dist/cjs/post-purchase/countdown-timer/settings/config/preset.js +26 -0
- package/dist/cjs/post-purchase/countdown-timer/settings/config/setting.js +243 -0
- package/dist/cjs/post-purchase/countdown-timer/settings/config/uiV1.js +125 -0
- package/dist/cjs/post-purchase/countdown-timer/settings/config/uiV2.js +185 -0
- package/dist/cjs/post-purchase/image/common/getClasses.js +1 -1
- package/dist/cjs/post-purchase/image/setting/setting-v2.js +5 -5
- package/dist/cjs/post-purchase/product/components/product-image/carousel-post-purchase/CarouselWrapperPostPurchase.js +24 -26
- package/dist/cjs/post-purchase/product/hooks/product-image/useListCarousel.js +1 -1
- package/dist/cjs/post-purchase/product/hooks/product-image/useProductImagePostPurchase.js +4 -1
- package/dist/cjs/post-purchase/product/settings/product-image/setting-v2.js +20 -7
- package/dist/cjs/post-purchase/product/settings/product-image/uiV2.js +3 -1
- package/dist/cjs/post-purchase/product/settings/product-price-breakdown/configs/settings.js +2 -2
- package/dist/cjs/post-purchase/product/settings/product-quantity/configs/settings.js +1 -1
- package/dist/cjs/post-purchase/utils/constants.js +1 -1
- package/dist/cjs/product/components/FileUpload/components/common/index.js +3 -0
- package/dist/cjs/product/components/ProductBundle/common/classes.js +25 -0
- package/dist/cjs/product/components/ProductBundle/common/index.js +5 -0
- package/dist/cjs/product/components/ProductBundle/common/styles.js +89 -0
- package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscount.js +82 -0
- package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscount.liquid.js +74 -0
- package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.js +69 -0
- package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.liquid.js +46 -0
- package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountItem.js +23 -0
- package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountItem.liquid.js +14 -0
- package/dist/cjs/product/components/{ProductBundleDiscount.js → ProductBundle/hooks/useProductBundleDataState.js} +20 -215
- package/dist/cjs/product/components/ProductBundle/hooks/useProductBundleDiscountState.js +56 -0
- package/dist/cjs/product/{setting → components/ProductBundle/setting}/ProductBundleDiscount.js +7 -7
- package/dist/cjs/product/{setting → components/ProductBundle/setting}/ProductBundleDiscountItem.js +3 -0
- package/dist/cjs/product/components/ProductButton.js +2 -2
- package/dist/cjs/product/components/ProductButton.liquid.js +2 -2
- package/dist/cjs/product/components/ProductPrice/common/getAttr.js +23 -0
- package/dist/cjs/product/components/ProductPrice/common/getClasses.js +19 -0
- package/dist/cjs/product/components/ProductPrice/common/getTextData.js +40 -0
- package/dist/cjs/product/components/ProductPrice/hooks/useGpPrice.js +126 -0
- package/dist/cjs/product/components/ProductPrice/index.js +54 -0
- package/dist/cjs/product/components/ProductPrice/index.liquid.js +43 -0
- package/dist/cjs/product/components/ProductQuickView/ProductQuickView.js +5 -5
- package/dist/cjs/product/next.js +3 -3
- package/dist/cjs/product/setting/index.js +2 -2
- package/dist/cjs/product/setting/product/configs/presets.js +1 -0
- package/dist/cjs/product/setting/product-image-v2/configs/setting-v2/ProductFeatureImage.js +6 -7
- package/dist/cjs/product/setting/product-image-v2/configs/setting-v2/ProductGalleryImage.js +11 -12
- package/dist/cjs/product/setting/product-image-v2/configs/setting-v2/index.js +6 -5
- package/dist/cjs/product/setting/product-list/configs/settingsV2.js +10 -8
- package/dist/cjs/setting.js +5 -2
- package/dist/esm/accordion/components/Accordion.js +61 -180
- package/dist/esm/accordion/components/Accordion.liquid.js +78 -102
- package/dist/esm/accordion/components/AccordionItem.js +129 -281
- package/dist/esm/accordion/components/AccordionItem.liquid.js +76 -214
- package/dist/esm/accordion/components/common/classes.js +44 -0
- package/dist/esm/accordion/components/common/index.js +136 -0
- package/dist/esm/accordion/components/common/styles.js +122 -0
- package/dist/esm/accordion/hooks/useAccordion.js +141 -0
- package/dist/esm/accordion/hooks/useAccordionItem.js +115 -0
- package/dist/esm/article/components/ArticleImage.js +0 -1
- package/dist/esm/article/components/ArticlePagination.js +1 -1
- package/dist/esm/article/components/ArticlePagination.liquid.js +3 -3
- package/dist/esm/article/setting/configs/ArticleImage/settings.js +5 -5
- package/dist/esm/banner/components/HeroBannerItem.js +0 -6
- package/dist/esm/banner/components/HeroBannerItem.liquid.js +3 -0
- package/dist/esm/banner/setting/setting.js +28 -3
- package/dist/esm/banner/setting/uiV2.js +10 -97
- package/dist/esm/builder.js +3 -5
- package/dist/esm/cart/components/CartLineImage.js +0 -2
- package/dist/esm/code/common/classes.js +9 -0
- package/dist/esm/code/common/styles.js +13 -0
- package/dist/esm/code/components/CSSCode.js +9 -99
- package/dist/esm/code/components/CSSCode.liquid.js +12 -12
- package/dist/esm/code/hooks/useCSSCode.js +98 -0
- package/dist/esm/code/setting/CSSCode.js +7 -121
- package/dist/esm/code/setting/config/setting.js +75 -0
- package/dist/esm/code/setting/config/uiV1.js +50 -0
- package/dist/esm/code/setting/config/uiV2.js +56 -0
- package/dist/esm/estimate-delivery/components/EstimateDate.liquid.js +4 -1
- package/dist/esm/form/components/contact/Contact.js +7 -3
- package/dist/esm/form/components/contact/common/composeStyles.js +19 -0
- package/dist/esm/form/components/form-checkbox/FormCheckbox.js +7 -5
- package/dist/esm/form/components/form-checkbox/FormCheckbox.liquid.js +3 -5
- package/dist/esm/form/components/form-checkbox/common/composeClasses.js +2 -2
- package/dist/esm/form/components/form-checkbox/common/composeStyles.js +25 -11
- package/dist/esm/form/components/form-dropdown/common/composeClasses.js +1 -1
- package/dist/esm/form/components/form-email/FormEmail.js +18 -10
- package/dist/esm/form/components/form-email/common/composeClasses.js +2 -1
- package/dist/esm/form/components/newsletter/Newsletter.js +8 -3
- package/dist/esm/form/components/newsletter/Newsletter.liquid.js +1 -1
- package/dist/esm/form/components/newsletter/common/composeStyles.js +4 -2
- package/dist/esm/form/components/textarea/TextArea.js +16 -8
- package/dist/esm/form/components/textarea/common/composeClasses.js +1 -1
- package/dist/esm/form/components/textfield/TextField.js +17 -9
- package/dist/esm/form/components/textfield/common/composeClasses.js +2 -2
- package/dist/esm/form/setting/contact/Contact.js +5 -1
- package/dist/esm/form/setting/form-checkbox/configs/settings.js +153 -6
- package/dist/esm/form/setting/form-checkbox/configs/uiV2.js +137 -0
- package/dist/esm/form/setting/form-dropdown/configs/settings.js +147 -0
- package/dist/esm/form/setting/form-dropdown/configs/uiV2.js +156 -4
- package/dist/esm/form/setting/newsletter/configs/settings.js +132 -3
- package/dist/esm/form/setting/newsletter/configs/uiV2.js +93 -0
- package/dist/esm/form/setting/submit-button/configs/settings.js +37 -0
- package/dist/esm/form/setting/submit-button/configs/uiV2.js +13 -0
- package/dist/esm/grid/row/commons/getInnerRadius.js +11 -10
- package/dist/esm/grid/row/setting/configs/uiV2.js +1 -1
- package/dist/esm/header/components/kind/basic/index.js +1 -0
- package/dist/esm/header/components/kind/modern/index.js +1 -1
- package/dist/esm/helpers.js +52 -1
- package/dist/esm/icon-list/setting/configs/uiV2.js +1 -1
- package/dist/esm/icon-list-v2/setting/configs/settings.js +5 -5
- package/dist/esm/image/components/AdaptiveImage.js +64 -50
- package/dist/esm/image/components/AdaptiveImage.liquid.js +57 -45
- package/dist/esm/image/components/Image.js +66 -155
- package/dist/esm/image/components/Image.liquid.js +69 -104
- package/dist/esm/image/components/Modal3d.liquid.js +55 -22
- package/dist/esm/image/components/NextImage.js +26 -59
- package/dist/esm/image/components/NextImage.liquid.js +28 -116
- package/dist/esm/image/components/Video.liquid.js +38 -13
- package/dist/esm/image/components/common/attributes.js +108 -0
- package/dist/esm/image/components/common/classes.js +51 -0
- package/dist/esm/image/components/common/constants.js +11 -0
- package/dist/esm/image/components/common/data.js +22 -0
- package/dist/esm/image/components/common/helpers.js +69 -0
- package/dist/esm/image/components/common/styles.js +80 -0
- package/dist/esm/image/components/helpers/getNextImageLiquidAttrs.js +78 -0
- package/dist/esm/image/components/helpers/getNextImageReactAttrs.js +38 -0
- package/dist/esm/image/components/hooks/useCheckNoImage.js +23 -0
- package/dist/esm/image/helpers/getSrcSet.js +1 -2
- package/dist/esm/image/next.js +1 -5
- package/dist/esm/image/setting/configs/settings.js +14 -8
- package/dist/esm/image/setting/configs/uiV2.js +61 -15
- package/dist/esm/image/setting/index.js +1 -3
- package/dist/esm/image-comparison/components/CompareImage.js +1 -1
- package/dist/esm/image-comparison/components/CompareImage.liquid.js +1 -1
- package/dist/esm/index.js +4 -5
- package/dist/esm/index.liquid.js +3 -3
- package/dist/esm/post-purchase/callout-banner/setting/config/callout-box/setting.js +4 -10
- package/dist/esm/post-purchase/countdown-timer/components/PostPurchaseCountdownTimer.js +9 -23
- package/dist/esm/post-purchase/countdown-timer/components/TextCountdown.js +13 -27
- package/dist/esm/post-purchase/countdown-timer/components/common/getClasses.js +21 -0
- package/dist/esm/post-purchase/countdown-timer/components/common/getStyles.js +19 -0
- package/dist/esm/post-purchase/countdown-timer/hooks/useCountdownTimer.js +19 -3
- package/dist/esm/post-purchase/countdown-timer/hooks/useGetTimeExpired.js +16 -0
- package/dist/esm/post-purchase/countdown-timer/settings/CountdownTimer.js +9 -358
- package/dist/esm/post-purchase/countdown-timer/settings/config/preset.js +24 -0
- package/dist/esm/post-purchase/countdown-timer/settings/config/setting.js +241 -0
- package/dist/esm/post-purchase/countdown-timer/settings/config/uiV1.js +123 -0
- package/dist/esm/post-purchase/countdown-timer/settings/config/uiV2.js +183 -0
- package/dist/esm/post-purchase/image/common/getClasses.js +1 -1
- package/dist/esm/post-purchase/image/setting/setting-v2.js +5 -5
- package/dist/esm/post-purchase/product/components/product-image/carousel-post-purchase/CarouselWrapperPostPurchase.js +25 -27
- package/dist/esm/post-purchase/product/hooks/product-image/useListCarousel.js +1 -1
- package/dist/esm/post-purchase/product/hooks/product-image/useProductImagePostPurchase.js +4 -1
- package/dist/esm/post-purchase/product/settings/product-image/setting-v2.js +20 -7
- package/dist/esm/post-purchase/product/settings/product-image/uiV2.js +3 -1
- package/dist/esm/post-purchase/product/settings/product-price-breakdown/configs/settings.js +2 -2
- package/dist/esm/post-purchase/product/settings/product-quantity/configs/settings.js +1 -1
- package/dist/esm/post-purchase/utils/constants.js +1 -1
- package/dist/esm/product/components/FileUpload/components/common/index.js +3 -0
- package/dist/esm/product/components/ProductBundle/common/classes.js +19 -0
- package/dist/esm/product/components/ProductBundle/common/index.js +3 -0
- package/dist/esm/product/components/ProductBundle/common/styles.js +80 -0
- package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscount.js +78 -0
- package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscount.liquid.js +70 -0
- package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.js +65 -0
- package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.liquid.js +42 -0
- package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountItem.js +19 -0
- package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountItem.liquid.js +10 -0
- package/dist/esm/product/components/{ProductBundleDiscount.js → ProductBundle/hooks/useProductBundleDataState.js} +21 -216
- package/dist/esm/product/components/ProductBundle/hooks/useProductBundleDiscountState.js +52 -0
- package/dist/esm/product/{setting → components/ProductBundle/setting}/ProductBundleDiscount.js +7 -7
- package/dist/esm/product/{setting → components/ProductBundle/setting}/ProductBundleDiscountItem.js +3 -0
- package/dist/esm/product/components/ProductButton.js +1 -1
- package/dist/esm/product/components/ProductButton.liquid.js +1 -1
- package/dist/esm/product/components/ProductPrice/common/getAttr.js +21 -0
- package/dist/esm/product/components/ProductPrice/common/getClasses.js +17 -0
- package/dist/esm/product/components/ProductPrice/common/getTextData.js +38 -0
- package/dist/esm/product/components/ProductPrice/hooks/useGpPrice.js +124 -0
- package/dist/esm/product/components/ProductPrice/index.js +50 -0
- package/dist/esm/product/components/ProductPrice/index.liquid.js +38 -0
- package/dist/esm/product/components/ProductQuickView/ProductQuickView.js +1 -1
- package/dist/esm/product/next.js +3 -3
- package/dist/esm/product/setting/index.js +2 -2
- package/dist/esm/product/setting/product/configs/presets.js +1 -0
- package/dist/esm/product/setting/product-image-v2/configs/setting-v2/ProductFeatureImage.js +6 -7
- package/dist/esm/product/setting/product-image-v2/configs/setting-v2/ProductGalleryImage.js +11 -12
- package/dist/esm/product/setting/product-image-v2/configs/setting-v2/index.js +6 -5
- package/dist/esm/product/setting/product-list/configs/settingsV2.js +10 -8
- package/dist/esm/setting.js +5 -2
- package/dist/types/index.d.ts +173 -256
- package/package.json +2 -2
- package/dist/cjs/image/components/BackgroundImage.js +0 -102
- package/dist/cjs/image/components/Img.js +0 -28
- package/dist/cjs/image/components/helpers.js +0 -12
- package/dist/cjs/image/setting/BackgroundImage.js +0 -364
- package/dist/cjs/product/components/ProductBundleDiscount.liquid.js +0 -81
- package/dist/cjs/product/components/ProductBundleDiscountItem.js +0 -42
- package/dist/cjs/product/components/ProductBundleDiscountItem.liquid.js +0 -103
- package/dist/cjs/product/components/ProductPrice.js +0 -209
- package/dist/cjs/product/components/ProductPrice.liquid.js +0 -88
- package/dist/esm/image/components/BackgroundImage.js +0 -98
- package/dist/esm/image/components/Img.js +0 -24
- package/dist/esm/image/components/helpers.js +0 -9
- package/dist/esm/image/setting/BackgroundImage.js +0 -360
- package/dist/esm/product/components/ProductBundleDiscount.liquid.js +0 -77
- package/dist/esm/product/components/ProductBundleDiscountItem.js +0 -36
- package/dist/esm/product/components/ProductBundleDiscountItem.liquid.js +0 -99
- package/dist/esm/product/components/ProductPrice.js +0 -205
- package/dist/esm/product/components/ProductPrice.liquid.js +0 -83
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var system = require('@gem-sdk/system');
|
|
4
|
+
var constants = require('../common/constants.js');
|
|
5
|
+
|
|
6
|
+
const getNextImageReactAttrs = (props)=>{
|
|
7
|
+
const { width = constants.NEXT_IMAGE_CONFIG.DEFAULT_WIDTH_PROPS, height = constants.NEXT_IMAGE_CONFIG.DEFAULT_HEIGHT_PROPS, priority, isNotLazyload, enableLazyLoadImage, base64 = constants.IMAGE_PLACEHOLDER, alt = constants.NEXT_IMAGE_CONFIG.DEFAULT_ALT, src = constants.NEXT_IMAGE_CONFIG.DEFAULT_SRC } = props;
|
|
8
|
+
const hasLazyLoad = !isNotLazyload && enableLazyLoadImage && !priority;
|
|
9
|
+
const getLoadingAttrs = ()=>{
|
|
10
|
+
const lazyLoadAttrs = {
|
|
11
|
+
loading: 'lazy',
|
|
12
|
+
placeholder: 'blur',
|
|
13
|
+
...base64 && {
|
|
14
|
+
blurDataURL: base64
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const priorityLoadAttrs = {
|
|
18
|
+
loading: 'eager',
|
|
19
|
+
fetchpriority: 'high'
|
|
20
|
+
};
|
|
21
|
+
return {
|
|
22
|
+
...hasLazyLoad ? lazyLoadAttrs : priorityLoadAttrs
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
const getBaseAttrs = ()=>({
|
|
26
|
+
src,
|
|
27
|
+
alt,
|
|
28
|
+
width,
|
|
29
|
+
height
|
|
30
|
+
});
|
|
31
|
+
const baseAttrs = getBaseAttrs();
|
|
32
|
+
const loadingAttrs = system.createAttr(getLoadingAttrs());
|
|
33
|
+
return {
|
|
34
|
+
...props,
|
|
35
|
+
...baseAttrs,
|
|
36
|
+
...loadingAttrs
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
exports.getNextImageReactAttrs = getNextImageReactAttrs;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@gem-sdk/core');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
|
|
6
|
+
const useCheckNoImage = (setting)=>{
|
|
7
|
+
const currentDevice = core.useCurrentDevice();
|
|
8
|
+
const isShowNoDataState = React.useMemo(()=>{
|
|
9
|
+
if (setting?.disableNoDataState) return false;
|
|
10
|
+
if (currentDevice === 'mobile') return !setting?.srcSet?.mobile?.src && !setting?.srcSet?.tablet?.src && !setting?.srcSet?.desktop?.src;
|
|
11
|
+
if (currentDevice === 'tablet') return !setting?.srcSet?.tablet?.src && !setting?.srcSet?.desktop?.src;
|
|
12
|
+
return !setting?.srcSet?.desktop?.src;
|
|
13
|
+
}, [
|
|
14
|
+
currentDevice,
|
|
15
|
+
setting?.disableNoDataState,
|
|
16
|
+
setting?.srcSet?.desktop?.src,
|
|
17
|
+
setting?.srcSet?.mobile?.src,
|
|
18
|
+
setting?.srcSet?.tablet?.src
|
|
19
|
+
]);
|
|
20
|
+
return {
|
|
21
|
+
isShowNoDataState
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
exports.useCheckNoImage = useCheckNoImage;
|
|
@@ -255,7 +255,6 @@ const getCurrentDevice = ()=>{
|
|
|
255
255
|
return 'desktop';
|
|
256
256
|
}
|
|
257
257
|
};
|
|
258
|
-
const imagePlaceholder = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=';
|
|
259
258
|
|
|
260
259
|
exports.DEVICES = DEVICES;
|
|
261
260
|
exports.getCurrentDevice = getCurrentDevice;
|
|
@@ -265,7 +264,6 @@ exports.getNewBackupFileKey = getNewBackupFileKey;
|
|
|
265
264
|
exports.getSrcSet = getSrcSet;
|
|
266
265
|
exports.handleSetSrcForFeatureProductImage = handleSetSrcForFeatureProductImage;
|
|
267
266
|
exports.handleSetSrcForProductImageList = handleSetSrcForProductImageList;
|
|
268
|
-
exports.imagePlaceholder = imagePlaceholder;
|
|
269
267
|
exports.isCannotResizeImage = isCannotResizeImage;
|
|
270
268
|
exports.regexReplaceEndDot = regexReplaceEndDot;
|
|
271
269
|
exports.replaceBackupFileKeyFileContent = replaceBackupFileKeyFileContent;
|
package/dist/cjs/image/next.js
CHANGED
|
@@ -11,12 +11,8 @@ require('@gem-sdk/core');
|
|
|
11
11
|
const Image = dynamic(()=>Promise.resolve().then(function () { return require('./components/Image.js'); }), {
|
|
12
12
|
loading: Loading.default
|
|
13
13
|
});
|
|
14
|
-
const BackgroundImage = dynamic(()=>Promise.resolve().then(function () { return require('./components/BackgroundImage.js'); }), {
|
|
15
|
-
loading: Loading.default
|
|
16
|
-
});
|
|
17
14
|
var image = {
|
|
18
|
-
Image
|
|
19
|
-
BackgroundImage
|
|
15
|
+
Image
|
|
20
16
|
};
|
|
21
17
|
|
|
22
18
|
exports.default = image;
|
|
@@ -21,7 +21,7 @@ const ImageSettings = [
|
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
id: 'srcSet',
|
|
24
|
-
type: 'image',
|
|
24
|
+
type: 'image-select',
|
|
25
25
|
hide: true,
|
|
26
26
|
dynamicSource: true,
|
|
27
27
|
devices: {
|
|
@@ -45,6 +45,12 @@ const ImageSettings = [
|
|
|
45
45
|
}
|
|
46
46
|
]
|
|
47
47
|
},
|
|
48
|
+
{
|
|
49
|
+
id: 'enableImageLink',
|
|
50
|
+
type: 'toggle',
|
|
51
|
+
default: false,
|
|
52
|
+
compoDefaultValue: false
|
|
53
|
+
},
|
|
48
54
|
{
|
|
49
55
|
id: 'imageLink',
|
|
50
56
|
type: 'pick-link',
|
|
@@ -67,9 +73,9 @@ const ImageSettings = [
|
|
|
67
73
|
id: 'alt',
|
|
68
74
|
label: 'Alt Text',
|
|
69
75
|
type: 'textarea',
|
|
70
|
-
minHeight:
|
|
76
|
+
minHeight: 76,
|
|
71
77
|
autoHeight: true,
|
|
72
|
-
placeholder: 'E.g: Classic white crewneck t-shirt with minimalist
|
|
78
|
+
placeholder: 'E.g: Classic white crewneck t-shirt with minimalist design'
|
|
73
79
|
},
|
|
74
80
|
{
|
|
75
81
|
id: 'title',
|
|
@@ -140,21 +146,21 @@ const ImageSettings = [
|
|
|
140
146
|
},
|
|
141
147
|
{
|
|
142
148
|
id: 'objectFit',
|
|
143
|
-
type: '
|
|
144
|
-
iconViewBox: '0 0 66 48',
|
|
145
|
-
enableItemBackground: true,
|
|
149
|
+
type: 'option:illustration',
|
|
146
150
|
enableTooltip: true,
|
|
147
151
|
label: 'Image scale',
|
|
148
152
|
options: [
|
|
149
153
|
{
|
|
150
154
|
label: 'Fill image',
|
|
151
155
|
value: 'cover',
|
|
152
|
-
type: 'image'
|
|
156
|
+
type: 'image',
|
|
157
|
+
svgName: 'gp-image-cover'
|
|
153
158
|
},
|
|
154
159
|
{
|
|
155
160
|
label: 'Fit image',
|
|
156
161
|
value: 'contain',
|
|
157
|
-
type: 'image'
|
|
162
|
+
type: 'image',
|
|
163
|
+
svgName: 'gp-image-contain'
|
|
158
164
|
}
|
|
159
165
|
],
|
|
160
166
|
devices: {
|
|
@@ -7,12 +7,10 @@ const SettingUIV2 = [
|
|
|
7
7
|
},
|
|
8
8
|
controls: [
|
|
9
9
|
{
|
|
10
|
-
label: {
|
|
11
|
-
en: 'Image'
|
|
12
|
-
},
|
|
13
10
|
setting: {
|
|
14
11
|
id: 'srcSet'
|
|
15
12
|
},
|
|
13
|
+
layout: 'vertical',
|
|
16
14
|
options: {
|
|
17
15
|
updateFields: [
|
|
18
16
|
{
|
|
@@ -63,6 +61,15 @@ const SettingUIV2 = [
|
|
|
63
61
|
noRecordHistory: true
|
|
64
62
|
}
|
|
65
63
|
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
conditionDisplay: "shape.shape !== 'original'",
|
|
67
|
+
label: {
|
|
68
|
+
en: 'Scale'
|
|
69
|
+
},
|
|
70
|
+
setting: {
|
|
71
|
+
id: 'objectFit'
|
|
72
|
+
}
|
|
66
73
|
}
|
|
67
74
|
]
|
|
68
75
|
},
|
|
@@ -76,15 +83,6 @@ const SettingUIV2 = [
|
|
|
76
83
|
id: 'shape'
|
|
77
84
|
},
|
|
78
85
|
layout: 'vertical'
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
conditionDisplay: "shape.shape !== 'original'",
|
|
82
|
-
label: {
|
|
83
|
-
en: 'Image scale'
|
|
84
|
-
},
|
|
85
|
-
setting: {
|
|
86
|
-
id: 'objectFit'
|
|
87
|
-
}
|
|
88
86
|
}
|
|
89
87
|
]
|
|
90
88
|
},
|
|
@@ -132,18 +130,66 @@ const SettingUIV2 = [
|
|
|
132
130
|
]
|
|
133
131
|
},
|
|
134
132
|
{
|
|
135
|
-
label: {
|
|
136
|
-
en: 'Link'
|
|
137
|
-
},
|
|
138
133
|
controls: [
|
|
134
|
+
{
|
|
135
|
+
label: {
|
|
136
|
+
en: 'Link'
|
|
137
|
+
},
|
|
138
|
+
setting: {
|
|
139
|
+
id: 'enableImageLink'
|
|
140
|
+
},
|
|
141
|
+
options: {
|
|
142
|
+
labelVariant: 'primary',
|
|
143
|
+
toggleStyle: 'switch'
|
|
144
|
+
}
|
|
145
|
+
},
|
|
139
146
|
{
|
|
140
147
|
setting: {
|
|
141
148
|
id: 'imageLink'
|
|
142
149
|
},
|
|
150
|
+
conditionDisplay: 'enableImageLink === true',
|
|
143
151
|
layout: 'vertical'
|
|
144
152
|
}
|
|
145
153
|
]
|
|
146
154
|
},
|
|
155
|
+
{
|
|
156
|
+
label: {
|
|
157
|
+
en: 'SEO'
|
|
158
|
+
},
|
|
159
|
+
controls: [
|
|
160
|
+
{
|
|
161
|
+
label: {
|
|
162
|
+
en: 'Alt text'
|
|
163
|
+
},
|
|
164
|
+
setting: {
|
|
165
|
+
id: 'alt'
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
label: {
|
|
170
|
+
en: 'Image title'
|
|
171
|
+
},
|
|
172
|
+
setting: {
|
|
173
|
+
id: 'title'
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
label: {
|
|
180
|
+
en: 'Optimize LCP'
|
|
181
|
+
},
|
|
182
|
+
controls: [
|
|
183
|
+
{
|
|
184
|
+
label: {
|
|
185
|
+
en: 'Preload'
|
|
186
|
+
},
|
|
187
|
+
setting: {
|
|
188
|
+
id: 'priority'
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
]
|
|
192
|
+
},
|
|
147
193
|
{
|
|
148
194
|
controls: [
|
|
149
195
|
{
|
|
@@ -3,11 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var Image = require('./Image.js');
|
|
6
|
-
var BackgroundImage = require('./BackgroundImage.js');
|
|
7
6
|
|
|
8
7
|
var imageSetting = {
|
|
9
|
-
Image: Image.default
|
|
10
|
-
BackgroundImage: BackgroundImage.default
|
|
8
|
+
Image: Image.default
|
|
11
9
|
};
|
|
12
10
|
|
|
13
11
|
exports.default = imageSetting;
|
|
@@ -7,8 +7,8 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var commonStyles = require('../constants/commonStyles.js');
|
|
9
9
|
var core = require('@gem-sdk/core');
|
|
10
|
-
var helpers = require('../../image/components/helpers.js');
|
|
11
10
|
var helpers$1 = require('./common/helpers.js');
|
|
11
|
+
var helpers = require('../../image/components/common/helpers.js');
|
|
12
12
|
|
|
13
13
|
const CompareImage = (props)=>{
|
|
14
14
|
const { handle = null, handleSize = 40, hover = false, leftImage, leftImageAlt = '', leftImageTitle = '', leftImageCss = {}, leftImageLabel = null, onSliderPositionChange, rightImage, rightImageAlt = '', rightImageTitle = '', rightImageCss = {}, rightImageLabel = null, sliderLineColor = '#ffffff', sliderLineWidth = 2, sliderPositionPercentage = 0.5, vertical = false, enableLabel = false, componentUid, styles = {}, builderData, preload } = props;
|
|
@@ -5,10 +5,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var core = require('@gem-sdk/core');
|
|
6
6
|
var Label_liquid = require('./Label.liquid.js');
|
|
7
7
|
var NextImage_liquid = require('../../image/components/NextImage.liquid.js');
|
|
8
|
-
var helpers$2 = require('../../image/components/helpers.js');
|
|
9
8
|
var getSrcSet = require('../../image/helpers/getSrcSet.js');
|
|
10
9
|
var helpers$1 = require('../../helpers.js');
|
|
11
10
|
var helpers = require('./common/helpers.js');
|
|
11
|
+
var helpers$2 = require('../../image/components/common/helpers.js');
|
|
12
12
|
|
|
13
13
|
const CompareImage = (props)=>{
|
|
14
14
|
const { handle = null, handleSize = 40, hover = false, leftImage, leftImageAlt = '', leftImageTitle = '', leftImageCss = {}, leftImageLabel = null, onSliderPositionChange, rightImage, rightImageAlt = '', rightImageTitle = '', rightImageCss = {}, rightImageLabel = null, sliderLineColor = '#ffffff', sliderLineWidth = 2, sliderPositionPercentage = 0.5, vertical = false, enableLabel = false, componentUid = '', styles, advanced, builderData, preload = false, pageContext, translate } = props;
|