@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
|
@@ -3,8 +3,8 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
3
3
|
import { useState, useRef, useEffect, useMemo, useCallback } from 'react';
|
|
4
4
|
import styles from '../constants/commonStyles.js';
|
|
5
5
|
import { useEditorMode, usePageType, useInteraction, getResponsiveValueByScreen, composeTypographyClassName, composeTypographyStyle, cls, makeStyle, makeStyleResponsive, getStyleShadow, getResponsiveStyleShadowWithoutState, getResponsiveStylePadding, getBorderStyle, makeWidth, getCornerCSSFromGlobal } from '@gem-sdk/core';
|
|
6
|
-
import { composeAspectRatio } from '../../image/components/helpers.js';
|
|
7
6
|
import { styleLazyPlaceholder } from './common/helpers.js';
|
|
7
|
+
import { composeAspectRatio } from '../../image/components/common/helpers.js';
|
|
8
8
|
|
|
9
9
|
const CompareImage = (props)=>{
|
|
10
10
|
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: styles$1 = {}, builderData, preload } = props;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { makeStyleResponsive, makeWidth, template, getCornerCSSFromGlobal, RenderIf, isLocalEnv, baseAssetURL, getResponsiveValueByScreen } from '@gem-sdk/core';
|
|
2
2
|
import Label from './Label.liquid.js';
|
|
3
3
|
import NextImage from '../../image/components/NextImage.liquid.js';
|
|
4
|
-
import { composeAspectRatio } from '../../image/components/helpers.js';
|
|
5
4
|
import { getImageSrc } from '../../image/helpers/getSrcSet.js';
|
|
6
5
|
import { getSettingPreloadData } from '../../helpers.js';
|
|
7
6
|
import { styleLazyPlaceholder } from './common/helpers.js';
|
|
7
|
+
import { composeAspectRatio } from '../../image/components/common/helpers.js';
|
|
8
8
|
|
|
9
9
|
const CompareImage = (props)=>{
|
|
10
10
|
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;
|
package/dist/esm/index.js
CHANGED
|
@@ -51,7 +51,6 @@ export { default as iconSetting } from './icon/setting/index.js';
|
|
|
51
51
|
export { default as Icon } from './icon/components/Icon.js';
|
|
52
52
|
export { default as imageSetting } from './image/setting/index.js';
|
|
53
53
|
export { default as Image } from './image/components/Image.js';
|
|
54
|
-
export { default as BackgroundImage } from './image/components/BackgroundImage.js';
|
|
55
54
|
export { default as inputSetting } from './input/setting/index.js';
|
|
56
55
|
export { default as Input } from './input/Input.js';
|
|
57
56
|
export { default as lineSetting } from './line/setting/index.js';
|
|
@@ -68,7 +67,7 @@ export { default as Product } from './product/components/Product.js';
|
|
|
68
67
|
export { default as ProductTitle } from './product/components/ProductTitle/index.js';
|
|
69
68
|
export { default as ProductQuantity } from './product/components/ProductQuantity.js';
|
|
70
69
|
export { default as ProductDescription } from './product/components/ProductDescription/index.js';
|
|
71
|
-
export { default as ProductPrice } from './product/components/ProductPrice.js';
|
|
70
|
+
export { default as ProductPrice } from './product/components/ProductPrice/index.js';
|
|
72
71
|
export { default as ProductButton } from './product/components/ProductButton.js';
|
|
73
72
|
export { default as ProductVariants } from './product/components/ProductVariants/index.js';
|
|
74
73
|
export { default as ProductImages } from './product/components/ProductImages.js';
|
|
@@ -78,13 +77,13 @@ export { default as ProductQuickView } from './product/components/ProductQuickVi
|
|
|
78
77
|
export { default as ProductTag } from './product/components/ProductTag.js';
|
|
79
78
|
export { default as ProductList } from './product/components/ProductList.js';
|
|
80
79
|
export { default as DynamicCheckout } from './product/components/DynamicCheckout/DynamicCheckout.js';
|
|
81
|
-
export { default as ProductBundleDiscount } from './product/components/ProductBundleDiscount.js';
|
|
82
|
-
export { default as ProductBundleDiscountItem } from './product/components/ProductBundleDiscountItem.js';
|
|
80
|
+
export { default as ProductBundleDiscount } from './product/components/ProductBundle/components/ProductBundleDiscount.js';
|
|
83
81
|
export { default as ProductVendor } from './product/components/Vendor.js';
|
|
84
82
|
export { default as ProductSku } from './product/components/Sku.js';
|
|
85
83
|
export { default as ProductViewMore } from './product/components/ProductViewMore.js';
|
|
86
84
|
export { default as ProductBadge } from './product/components/ProductBadge/index.js';
|
|
87
85
|
export { default as FileUpload } from './product/components/FileUpload/components/UploadFile.js';
|
|
86
|
+
export { default as ProductBundleDiscountItem } from './product/components/ProductBundle/components/ProductBundleDiscountItem.js';
|
|
88
87
|
export { default as radioSetting } from './radio/setting/index.js';
|
|
89
88
|
export { default as Radio } from './radio/Radio.js';
|
|
90
89
|
export { default as selectSetting } from './select/setting/index.js';
|
|
@@ -313,6 +312,6 @@ import 'react/jsx-runtime';
|
|
|
313
312
|
import 'react';
|
|
314
313
|
import '@gem-sdk/core';
|
|
315
314
|
export { ELEMENT_Z_INDEX } from './common/const.js';
|
|
316
|
-
export { filterTruthyStyles, getDynamicSourceLocales, getInsertLinkData, getSettingPreloadData, getStaticLocale, isHexTransparent, isTransparentColor, isTransparentRGBA, replaceLinkData, youtubeShortsRegex } from './helpers.js';
|
|
315
|
+
export { filterTruthyObject, filterTruthyStyles, getDynamicSourceLocales, getInsertLinkData, getLinkData, getSettingPreloadData, getStaticLocale, isHexTransparent, isTransparentColor, isTransparentRGBA, replaceLinkData, youtubeShortsRegex } from './helpers.js';
|
|
317
316
|
export { default as postPurchaseTextSetting } from './post-purchase/text/settings/index.js';
|
|
318
317
|
export { default as PostPurchaseText } from './post-purchase/text/components/Text.js';
|
package/dist/esm/index.liquid.js
CHANGED
|
@@ -9,7 +9,7 @@ export { default as Icon } from './icon/components/Icon.liquid.js';
|
|
|
9
9
|
export { default as Text } from './text/components/Text.liquid.js';
|
|
10
10
|
export { default as Product } from './product/components/Product.liquid.js';
|
|
11
11
|
export { default as ProductTitle } from './product/components/ProductTitle/index.liquid.js';
|
|
12
|
-
export { ProductPrice } from './product/components/ProductPrice.liquid.js';
|
|
12
|
+
export { ProductPrice } from './product/components/ProductPrice/index.liquid.js';
|
|
13
13
|
export { default as ProductButton } from './product/components/ProductButton.liquid.js';
|
|
14
14
|
export { default as ProductDescription } from './product/components/ProductDescription/index.liquid.js';
|
|
15
15
|
export { default as ProductImages } from './product/components/ProductImages.liquid.js';
|
|
@@ -21,8 +21,8 @@ export { default as ProductProperties } from './product/components/ProductProper
|
|
|
21
21
|
export { default as ProductList } from './product/components/ProductList.liquid.js';
|
|
22
22
|
export { default as DynamicCheckout } from './product/components/DynamicCheckout/DynamicCheckout.liquid.js';
|
|
23
23
|
export { default as ProductVendor } from './product/components/Vendor.liquid.js';
|
|
24
|
-
export { default as ProductBundleDiscount } from './product/components/ProductBundleDiscount.liquid.js';
|
|
25
|
-
export { default as ProductBundleDiscountItem } from './product/components/ProductBundleDiscountItem.liquid.js';
|
|
24
|
+
export { default as ProductBundleDiscount } from './product/components/ProductBundle/components/ProductBundleDiscount.liquid.js';
|
|
25
|
+
export { default as ProductBundleDiscountItem } from './product/components/ProductBundle/components/ProductBundleDiscountItem.liquid.js';
|
|
26
26
|
export { default as ProductViewMore } from './product/components/ProductViewMore.liquid.js';
|
|
27
27
|
export { default as ProductBadge } from './product/components/ProductBadge/index.liquid.js';
|
|
28
28
|
export { default as ProductSku } from './product/components/Sku.liquid.js';
|
|
@@ -205,22 +205,22 @@ const CalloutBoxSettings = [
|
|
|
205
205
|
{
|
|
206
206
|
label: 'Red',
|
|
207
207
|
value: 'critical',
|
|
208
|
-
icon: 'gp-bg-red'
|
|
208
|
+
icon: 'gp-bg-color-red'
|
|
209
209
|
},
|
|
210
210
|
{
|
|
211
211
|
label: 'Blue',
|
|
212
212
|
value: 'info',
|
|
213
|
-
icon: 'gp-bg-blue'
|
|
213
|
+
icon: 'gp-bg-color-blue'
|
|
214
214
|
},
|
|
215
215
|
{
|
|
216
216
|
label: 'Green',
|
|
217
217
|
value: 'success',
|
|
218
|
-
icon: 'gp-bg-green'
|
|
218
|
+
icon: 'gp-bg-color-green'
|
|
219
219
|
},
|
|
220
220
|
{
|
|
221
221
|
label: 'Yellow',
|
|
222
222
|
value: 'warning',
|
|
223
|
-
icon: 'gp-bg-yellow'
|
|
223
|
+
icon: 'gp-bg-color-yellow'
|
|
224
224
|
}
|
|
225
225
|
],
|
|
226
226
|
default: 'none'
|
|
@@ -238,12 +238,6 @@ const CalloutBoxSettings = [
|
|
|
238
238
|
devices: {
|
|
239
239
|
desktop: {
|
|
240
240
|
default: 'default'
|
|
241
|
-
},
|
|
242
|
-
tablet: {
|
|
243
|
-
default: '100%'
|
|
244
|
-
},
|
|
245
|
-
mobile: {
|
|
246
|
-
default: '100%'
|
|
247
241
|
}
|
|
248
242
|
},
|
|
249
243
|
displayOptions: [
|
|
@@ -1,41 +1,27 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { createClass, createStyle } from '@gem-sdk/system';
|
|
4
|
+
import { useGetTimeExpired } from '../hooks/useGetTimeExpired.js';
|
|
5
|
+
import { getCountdownTimerWrapperClasses } from './common/getClasses.js';
|
|
6
|
+
import { getTextCountdownWrapperStyles } from './common/getStyles.js';
|
|
5
7
|
import { TextCountdown } from './TextCountdown.js';
|
|
6
|
-
import { makeBgColor, makeBorderColor } from '../../utils/helper.js';
|
|
7
8
|
|
|
8
|
-
const pdBanner = '17px';
|
|
9
|
-
const brBanner = '3px';
|
|
10
9
|
const PostPurchaseCountdownTimer = ({ setting = {}, styles = {}, style, builderAttrs, builderProps, children })=>{
|
|
11
10
|
const { width, align, bgColor } = styles;
|
|
12
11
|
const { expired } = setting;
|
|
13
|
-
const dateTimeExpired =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return NOW_IN_MS + EXPIRED_IN_MS;
|
|
17
|
-
}, [
|
|
18
|
-
expired
|
|
19
|
-
]);
|
|
20
|
-
const alignClass = `${align === 'left' ? 'gp-justify-start' : align === 'right' ? 'gp-justify-end' : 'gp-justify-center'}`;
|
|
12
|
+
const { dateTimeExpired } = useGetTimeExpired(expired);
|
|
13
|
+
const countdownTimerWrapperClasses = createClass(getCountdownTimerWrapperClasses(align, builderProps?.uid));
|
|
14
|
+
const textCountdownWrapperStyles = createStyle(getTextCountdownWrapperStyles(width, bgColor));
|
|
21
15
|
return /*#__PURE__*/ jsxs("div", {
|
|
22
16
|
...builderAttrs,
|
|
23
|
-
className:
|
|
17
|
+
className: countdownTimerWrapperClasses,
|
|
24
18
|
style: {
|
|
25
19
|
...style
|
|
26
20
|
},
|
|
27
21
|
id: `countdown-timer-${builderProps?.uid}`,
|
|
28
22
|
children: [
|
|
29
23
|
/*#__PURE__*/ jsx("div", {
|
|
30
|
-
style:
|
|
31
|
-
...makeStyleResponsive('w', width),
|
|
32
|
-
backgroundColor: makeBgColor(bgColor),
|
|
33
|
-
borderWidth: '1px',
|
|
34
|
-
borderStyle: 'solid',
|
|
35
|
-
borderColor: makeBorderColor(bgColor),
|
|
36
|
-
padding: pdBanner,
|
|
37
|
-
borderRadius: brBanner
|
|
38
|
-
},
|
|
24
|
+
style: textCountdownWrapperStyles,
|
|
39
25
|
children: /*#__PURE__*/ jsx(TextCountdown, {
|
|
40
26
|
dateTime: dateTimeExpired,
|
|
41
27
|
setting: setting,
|
|
@@ -1,41 +1,27 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import {
|
|
3
|
+
import { createClass } from '@gem-sdk/system';
|
|
4
4
|
import Text from '../../text/components/Text.js';
|
|
5
|
-
import { useCountdown } from '../hooks/useCountdownTimer.js';
|
|
5
|
+
import { useCountdown, useGetTextExpired } from '../hooks/useCountdownTimer.js';
|
|
6
|
+
import { getTextCountdownClass } from './common/getClasses.js';
|
|
6
7
|
|
|
7
8
|
const TextCountdown = (props)=>{
|
|
8
9
|
const { dateTime, setting, styles } = props;
|
|
9
|
-
const { typo, textAlign } = styles || {};
|
|
10
|
+
const { typo, textAlign, direction } = styles || {};
|
|
10
11
|
const { conditionText, expiredText } = setting || {};
|
|
11
|
-
const { format,
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
typo,
|
|
15
|
-
textAlign
|
|
16
|
-
};
|
|
17
|
-
return data;
|
|
18
|
-
}, [
|
|
19
|
-
textAlign,
|
|
20
|
-
typo
|
|
21
|
-
]);
|
|
22
|
-
const text = useMemo(()=>{
|
|
23
|
-
if (isExpried) {
|
|
24
|
-
return expiredText;
|
|
25
|
-
}
|
|
26
|
-
return `${conditionText} ${format}`;
|
|
27
|
-
}, [
|
|
28
|
-
isExpried,
|
|
29
|
-
format,
|
|
30
|
-
conditionText,
|
|
31
|
-
expiredText
|
|
32
|
-
]);
|
|
12
|
+
const { format, isExpired } = useCountdown(dateTime);
|
|
13
|
+
const { text } = useGetTextExpired(isExpired, expiredText, conditionText, format);
|
|
14
|
+
const textClass = createClass(getTextCountdownClass());
|
|
33
15
|
return /*#__PURE__*/ jsx(Text, {
|
|
34
16
|
setting: {
|
|
35
17
|
text
|
|
36
18
|
},
|
|
37
|
-
styles:
|
|
38
|
-
|
|
19
|
+
styles: {
|
|
20
|
+
typo,
|
|
21
|
+
textAlign,
|
|
22
|
+
direction
|
|
23
|
+
},
|
|
24
|
+
textClass: textClass
|
|
39
25
|
});
|
|
40
26
|
};
|
|
41
27
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { composeClasses } from '@gem-sdk/core';
|
|
2
|
+
|
|
3
|
+
const getCountdownTimerWrapperClasses = (align, uid)=>{
|
|
4
|
+
const classList = 'gp-flex gp-w-full';
|
|
5
|
+
return {
|
|
6
|
+
...composeClasses(classList),
|
|
7
|
+
'gp-justify-start': align === 'left',
|
|
8
|
+
'gp-justify-end': align === 'right',
|
|
9
|
+
'gp-justify-center': align === 'center',
|
|
10
|
+
...uid && {
|
|
11
|
+
[uid]: uid
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
const getTextCountdownClass = ()=>{
|
|
16
|
+
return {
|
|
17
|
+
...composeClasses('!gp-break-normal')
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { getCountdownTimerWrapperClasses, getTextCountdownClass };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { makeStyleResponsive, filterTruthyStyles } from '@gem-sdk/core';
|
|
2
|
+
import { makeBgColor, makeBorderColor } from '../../../utils/helper.js';
|
|
3
|
+
|
|
4
|
+
const pdBanner = '17px';
|
|
5
|
+
const brBanner = '3px';
|
|
6
|
+
const getTextCountdownWrapperStyles = (width, bgColor)=>{
|
|
7
|
+
const styles = {
|
|
8
|
+
...makeStyleResponsive('w', width),
|
|
9
|
+
backgroundColor: makeBgColor(bgColor),
|
|
10
|
+
borderWidth: '1px',
|
|
11
|
+
borderStyle: 'solid',
|
|
12
|
+
borderColor: makeBorderColor(bgColor),
|
|
13
|
+
padding: pdBanner,
|
|
14
|
+
borderRadius: brBanner
|
|
15
|
+
};
|
|
16
|
+
return filterTruthyStyles(styles);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { getTextCountdownWrapperStyles };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
1
|
+
import { useState, useEffect, useMemo } from 'react';
|
|
2
2
|
|
|
3
3
|
const getCountDownTime = (targetDate)=>{
|
|
4
4
|
return new Date(targetDate).getTime() - new Date().getTime();
|
|
@@ -37,9 +37,25 @@ const getReturnValues = (countDown)=>{
|
|
|
37
37
|
const seconds = Math.floor(countDown % (1000 * 60) / 1000);
|
|
38
38
|
const format = `${minutes < 10 ? '0' : ''}${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
|
|
39
39
|
return {
|
|
40
|
-
|
|
40
|
+
isExpired: minutes + seconds <= 0,
|
|
41
41
|
format
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
|
+
const useGetTextExpired = (isExpired, expiredText, conditionText, format)=>{
|
|
45
|
+
const text = useMemo(()=>{
|
|
46
|
+
if (isExpired) {
|
|
47
|
+
return expiredText;
|
|
48
|
+
}
|
|
49
|
+
return `${conditionText} ${format}`;
|
|
50
|
+
}, [
|
|
51
|
+
isExpired,
|
|
52
|
+
format,
|
|
53
|
+
conditionText,
|
|
54
|
+
expiredText
|
|
55
|
+
]);
|
|
56
|
+
return {
|
|
57
|
+
text
|
|
58
|
+
};
|
|
59
|
+
};
|
|
44
60
|
|
|
45
|
-
export { useCountdown };
|
|
61
|
+
export { useCountdown, useGetTextExpired };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
|
|
3
|
+
const useGetTimeExpired = (expired)=>{
|
|
4
|
+
const dateTimeExpired = useMemo(()=>{
|
|
5
|
+
const EXPIRED_IN_MS = Number(parseInt(expired === '' || expired === 'Auto' ? '0' : expired ?? '', 10) ?? 0) * 60 * 1000;
|
|
6
|
+
const NOW_IN_MS = new Date().getTime();
|
|
7
|
+
return NOW_IN_MS + EXPIRED_IN_MS;
|
|
8
|
+
}, [
|
|
9
|
+
expired
|
|
10
|
+
]);
|
|
11
|
+
return {
|
|
12
|
+
dateTimeExpired
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { useGetTimeExpired };
|