@gem-sdk/components 2.0.0-dev.278 → 2.0.0-dev.289
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/components/CalloutText.js +2 -1
- package/dist/cjs/post-purchase/callout-banner/components/common/getClasses.js +5 -2
- package/dist/cjs/post-purchase/callout-banner/components/common/getStyles.js +2 -4
- package/dist/cjs/post-purchase/callout-banner/setting/config/callout-box/setting.js +4 -10
- package/dist/cjs/post-purchase/callout-banner/setting/config/callout-text/setting.js +1 -11
- 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/settings/product-image/setting-v2.js +5 -5
- 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/product/components/FileUpload/components/common/index.js +3 -0
- package/dist/cjs/product/components/Product.liquid.js +1 -1
- 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/components/CalloutText.js +2 -1
- package/dist/esm/post-purchase/callout-banner/components/common/getClasses.js +5 -2
- package/dist/esm/post-purchase/callout-banner/components/common/getStyles.js +2 -4
- package/dist/esm/post-purchase/callout-banner/setting/config/callout-box/setting.js +4 -10
- package/dist/esm/post-purchase/callout-banner/setting/config/callout-text/setting.js +1 -11
- 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/settings/product-image/setting-v2.js +5 -5
- 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/product/components/FileUpload/components/common/index.js +3 -0
- package/dist/esm/product/components/Product.liquid.js +1 -1
- 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 +174 -257
- 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
|
@@ -1,114 +1,79 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { template } from '@gem-sdk/core';
|
|
2
|
+
import { createStyle, createClass, createAttr, If } from '@gem-sdk/system';
|
|
3
|
+
import { getLinkData } from '../../helpers.js';
|
|
2
4
|
import AdaptiveImage from './AdaptiveImage.liquid.js';
|
|
3
5
|
import NextImage from './NextImage.liquid.js';
|
|
4
|
-
import {
|
|
6
|
+
import { getWrapperStyles, getImageStyles, getContainerStyles } from './common/styles.js';
|
|
7
|
+
import { getWrapperClasses, getImageClasses, getContainerClasses } from './common/classes.js';
|
|
8
|
+
import { getContainerAttrs, getAdaptiveImageAttrs, getNextImageAttrs, getLinkWrapperAttrs, getImageLiquidAttrs } from './common/attributes.js';
|
|
5
9
|
|
|
6
|
-
const Image = ({
|
|
7
|
-
const { imageLink,
|
|
8
|
-
const {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
10
|
+
const Image = ({ style, styles, setting, advanced, className, pageContext, builderAttrs, builderProps, enableLazyLoadImage = true })=>{
|
|
11
|
+
const { imageLink, isAdaptive, enableImageLink } = setting ?? {};
|
|
12
|
+
const { Wrapper: HTMLTag, urlData } = getLinkData({
|
|
13
|
+
defaultWrap: 'div',
|
|
14
|
+
setting: imageLink,
|
|
15
|
+
enableImageLink,
|
|
16
|
+
isLiquid: true
|
|
17
|
+
});
|
|
18
|
+
const wrapperStyles = createStyle(getWrapperStyles(styles));
|
|
19
|
+
const imageStyles = createStyle(getImageStyles(styles, builderProps));
|
|
20
|
+
const containerStyles = createStyle(getContainerStyles(style, styles));
|
|
21
|
+
const wrapperClasses = createClass(getWrapperClasses());
|
|
22
|
+
const imageClasses = createClass(getImageClasses(className, styles));
|
|
23
|
+
const containerClasses = createClass(getContainerClasses(builderProps?.uid, advanced?.cssClass));
|
|
24
|
+
const containerAttrs = createAttr(getContainerAttrs(builderAttrs, builderProps?.uid));
|
|
25
|
+
const linkWrapperAttrs = getLinkWrapperAttrs({
|
|
26
|
+
urlData,
|
|
27
|
+
imageLink,
|
|
28
|
+
title: setting?.title,
|
|
29
|
+
isLiquid: true
|
|
30
|
+
});
|
|
31
|
+
const adaptiveImageAttrs = getAdaptiveImageAttrs({
|
|
32
|
+
styles,
|
|
33
|
+
setting
|
|
34
|
+
});
|
|
35
|
+
const nextImageAttrs = getNextImageAttrs({
|
|
36
|
+
styles,
|
|
37
|
+
setting
|
|
38
|
+
});
|
|
39
|
+
const imageLiquidAttrs = getImageLiquidAttrs({
|
|
40
|
+
pageContext,
|
|
41
|
+
enableLazyLoadImage
|
|
42
|
+
});
|
|
43
|
+
const Image = ()=>{
|
|
44
|
+
return If(isAdaptive, AdaptiveImage({
|
|
45
|
+
...imageLiquidAttrs,
|
|
46
|
+
...adaptiveImageAttrs,
|
|
47
|
+
style: imageStyles,
|
|
48
|
+
className: imageClasses
|
|
49
|
+
}), NextImage({
|
|
50
|
+
...imageLiquidAttrs,
|
|
51
|
+
...nextImageAttrs,
|
|
52
|
+
style: imageStyles,
|
|
53
|
+
className: imageClasses
|
|
54
|
+
}));
|
|
55
|
+
};
|
|
56
|
+
const renderImage = ()=>{
|
|
57
|
+
return Image();
|
|
24
58
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
...
|
|
59
|
+
return template`
|
|
60
|
+
<div
|
|
61
|
+
role="presentation"
|
|
62
|
+
${{
|
|
63
|
+
...containerAttrs
|
|
30
64
|
}}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
class="${cls('gp-group/image', builderProps?.uid, advanced?.cssClass, `force-publish-${new Date().getTime()}`)}"
|
|
34
|
-
style="${{
|
|
35
|
-
...style,
|
|
36
|
-
...makeStyleResponsive('ta', styles?.align)
|
|
37
|
-
}}"
|
|
65
|
+
style="${containerStyles}"
|
|
66
|
+
class="${containerClasses}"
|
|
38
67
|
>
|
|
39
|
-
<${
|
|
40
|
-
|
|
41
|
-
${
|
|
42
|
-
|
|
43
|
-
title: setting?.title
|
|
44
|
-
} : {}}
|
|
45
|
-
${imageLink?.noFollow ? 'rel="nofollow"' : undefined}
|
|
46
|
-
class="gp-h-full gp-w-full"
|
|
47
|
-
style="${{
|
|
48
|
-
// ...getStyleShadowState(styles?.boxShadowImg, 'box-shadow', styles?.hasBoxShadowImg),
|
|
49
|
-
'border-radius': 'inherit',
|
|
50
|
-
overflow: 'hidden',
|
|
51
|
-
...makeStyleResponsive('jc', styles?.align)
|
|
52
|
-
}}"
|
|
68
|
+
<${HTMLTag}
|
|
69
|
+
${linkWrapperAttrs}
|
|
70
|
+
style="${wrapperStyles}"
|
|
71
|
+
class="${wrapperClasses}"
|
|
53
72
|
>
|
|
54
|
-
${
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
alt: setting.alt,
|
|
59
|
-
style: {
|
|
60
|
-
...imageWidth,
|
|
61
|
-
...imageHeight,
|
|
62
|
-
// ...handleConvertBorderStyle(styles?.borderImg),
|
|
63
|
-
// ...handleConvertBorderWidth(styles?.borderImg),
|
|
64
|
-
// ...handleConvertBorderColor(styles?.borderImg),
|
|
65
|
-
...overwriteDefaultRadius(builderProps?.builderData?.advanced?.rounded),
|
|
66
|
-
...getBorderStyle(styles?.wrapperBorder),
|
|
67
|
-
...getBorderRadiusStyle(styles?.borderRadius),
|
|
68
|
-
...getStyleShadow({
|
|
69
|
-
value: styles?.shadow,
|
|
70
|
-
styleAppliedFor: 'box-shadow',
|
|
71
|
-
isEnableShadow: styles?.shadow?.type !== 'none'
|
|
72
|
-
})
|
|
73
|
-
},
|
|
74
|
-
aspectRatio: getAspectRatioGlobalSize(styles?.shape),
|
|
75
|
-
layout: styles?.objectFit,
|
|
76
|
-
priority: setting?.priority,
|
|
77
|
-
enableLazyLoadImage,
|
|
78
|
-
pageContext
|
|
79
|
-
}) : NextImage({
|
|
80
|
-
...setting?.image,
|
|
81
|
-
priority: setting?.priority,
|
|
82
|
-
quality: setting?.quality,
|
|
83
|
-
className: cls(className, '!gp-inline gp-h-full gp-max-w-full gp-flex', handleConvertClassColor(styles?.borderImg)),
|
|
84
|
-
style: {
|
|
85
|
-
...imageWidth,
|
|
86
|
-
...imageHeight,
|
|
87
|
-
// ...handleConvertBorderStyle(styles?.borderImg),
|
|
88
|
-
// ...handleConvertBorderWidth(styles?.borderImg),
|
|
89
|
-
// ...handleConvertBorderColor(styles?.borderImg),
|
|
90
|
-
...overwriteDefaultRadius(builderProps?.builderData?.advanced?.rounded),
|
|
91
|
-
...getBorderStyle(styles?.wrapperBorder),
|
|
92
|
-
...getBorderRadiusStyle(styles?.borderRadius),
|
|
93
|
-
...getStyleShadow({
|
|
94
|
-
value: styles?.shadow,
|
|
95
|
-
styleAppliedFor: 'box-shadow',
|
|
96
|
-
isEnableShadow: styles?.shadow?.type !== 'none'
|
|
97
|
-
})
|
|
98
|
-
},
|
|
99
|
-
alt: setting?.alt,
|
|
100
|
-
title: setting?.title,
|
|
101
|
-
vw: setting?.vw,
|
|
102
|
-
setting: {
|
|
103
|
-
aspectRatio: getAspectRatioGlobalSize(styles?.shape),
|
|
104
|
-
layout: styles?.objectFit
|
|
105
|
-
},
|
|
106
|
-
isNotLazyload,
|
|
107
|
-
enableLazyLoadImage,
|
|
108
|
-
pageContext
|
|
109
|
-
})}
|
|
110
|
-
</${WrapLink}>
|
|
111
|
-
</div>`;
|
|
73
|
+
${renderImage()}
|
|
74
|
+
</${HTMLTag}>
|
|
75
|
+
</div>
|
|
76
|
+
`;
|
|
112
77
|
};
|
|
113
78
|
|
|
114
79
|
export { Image as default };
|
|
@@ -1,31 +1,64 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createAttr, createStyle, createClass } from '@gem-sdk/system';
|
|
2
|
+
import { template, getResponsiveValueByScreen, makeStyleResponsive } from '@gem-sdk/core';
|
|
2
3
|
|
|
3
|
-
const Model3d = ({ src, alt,
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
const Model3d = ({ src, alt, style, poster, reveal, loaded, loading, arStatus, aspectRatio, modelIsVisible, cameraControls, dataJsFocusVisible, dataShopifyFeature = '1.12' })=>{
|
|
5
|
+
const getModelViewerClasses = ()=>{
|
|
6
|
+
return {
|
|
7
|
+
'gp-w-full gp-h-full model-viewer gp-z-[90]': true
|
|
8
|
+
};
|
|
8
9
|
};
|
|
10
|
+
const getModelViewerStyles = ()=>{
|
|
11
|
+
const customAspectRatio = {
|
|
12
|
+
desktop: getResponsiveValueByScreen(aspectRatio, 'desktop') || '1/1',
|
|
13
|
+
tablet: getResponsiveValueByScreen(aspectRatio, 'tablet') || '1/1',
|
|
14
|
+
mobile: getResponsiveValueByScreen(aspectRatio, 'mobile') || '1/1'
|
|
15
|
+
};
|
|
16
|
+
return {
|
|
17
|
+
...makeStyleResponsive('aspect', customAspectRatio)
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
const getModelViewerAttrs = ()=>{
|
|
21
|
+
return {
|
|
22
|
+
src,
|
|
23
|
+
alt,
|
|
24
|
+
'data-shopify-feature': dataShopifyFeature,
|
|
25
|
+
...style,
|
|
26
|
+
...poster ? {
|
|
27
|
+
poster
|
|
28
|
+
} : {},
|
|
29
|
+
...reveal ? {
|
|
30
|
+
reveal
|
|
31
|
+
} : {},
|
|
32
|
+
...loaded ? {
|
|
33
|
+
loaded
|
|
34
|
+
} : {},
|
|
35
|
+
...loading ? {
|
|
36
|
+
loading
|
|
37
|
+
} : {},
|
|
38
|
+
...modelIsVisible ? {
|
|
39
|
+
modelIsVisible
|
|
40
|
+
} : {},
|
|
41
|
+
...arStatus ? {
|
|
42
|
+
'ar-status': arStatus
|
|
43
|
+
} : {},
|
|
44
|
+
...cameraControls ? {
|
|
45
|
+
'camera-controls': cameraControls
|
|
46
|
+
} : {},
|
|
47
|
+
...dataJsFocusVisible ? {
|
|
48
|
+
'data-js-focus-visible': dataJsFocusVisible
|
|
49
|
+
} : {}
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
const modelViewerAttrs = createAttr(getModelViewerAttrs());
|
|
53
|
+
const modelViewerStyles = createStyle(getModelViewerStyles());
|
|
54
|
+
const modelViewerClasses = createClass(getModelViewerClasses());
|
|
9
55
|
return template`
|
|
10
56
|
<model-viewer
|
|
11
|
-
class="gp-w-full gp-h-full model-viewer gp-z-[90]"
|
|
12
57
|
${{
|
|
13
|
-
...
|
|
58
|
+
...modelViewerAttrs
|
|
14
59
|
}}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
${loaded ? `loaded="${loaded}"` : ''}
|
|
18
|
-
${modelIsVisible ? `modelIsVisible="${modelIsVisible}"` : ''}
|
|
19
|
-
src="${src}"
|
|
20
|
-
alt="${alt}"
|
|
21
|
-
camera-controls="${cameraControls}"
|
|
22
|
-
poster="${poster}"
|
|
23
|
-
data-js-focus-visible="${dataJsFocusVisible}"
|
|
24
|
-
data-shopify-feature="${dataShopifyFeature}"
|
|
25
|
-
ar-status="${arStatus}"
|
|
26
|
-
style="${{
|
|
27
|
-
...makeStyleResponsive('aspect', customAspectRatio)
|
|
28
|
-
}}">
|
|
60
|
+
class="${modelViewerClasses}"
|
|
61
|
+
style="${modelViewerStyles}">
|
|
29
62
|
</model-viewer>
|
|
30
63
|
`;
|
|
31
64
|
};
|
|
@@ -1,70 +1,37 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import Image from 'next/image';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { createStyle, createClass } from '@gem-sdk/system';
|
|
5
|
+
import { getNextImageClasses } from './common/classes.js';
|
|
6
|
+
import { getNextImageStyles } from './common/styles.js';
|
|
7
|
+
import { getNextImageReactAttrs } from './helpers/getNextImageReactAttrs.js';
|
|
8
|
+
import { NEXT_IMAGE_CONFIG } from './common/constants.js';
|
|
7
9
|
|
|
8
10
|
const NextImage = (props)=>{
|
|
9
|
-
const {
|
|
10
|
-
const { layout, aspectRatio } = setting ?? {};
|
|
11
|
-
const newWidth = width ? width : 800;
|
|
12
|
-
const newHeight = height ? height : 533;
|
|
11
|
+
const { style, imgRef, setting, priority, className, width = NEXT_IMAGE_CONFIG.DEFAULT_WIDTH_PROPS, height = NEXT_IMAGE_CONFIG.DEFAULT_HEIGHT_PROPS, isNotLazyload, isDisableAspectStyle, enableLazyLoadImage = true } = props;
|
|
13
12
|
const hasLazyLoad = !isNotLazyload && enableLazyLoadImage && !priority;
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
const value = aspectRatio?.[device] !== 'auto' && !!aspectRatio?.[device] ? aspectRatio?.[device] : `${width}/${height}`;
|
|
33
|
-
result = {
|
|
34
|
-
...result,
|
|
35
|
-
[device]: value
|
|
36
|
-
};
|
|
37
|
-
});
|
|
38
|
-
return result;
|
|
39
|
-
}, [
|
|
40
|
-
aspectRatio,
|
|
41
|
-
objectFits,
|
|
42
|
-
height,
|
|
43
|
-
width,
|
|
44
|
-
isDisableAspectStyle
|
|
45
|
-
]);
|
|
13
|
+
const nextImageStyles = createStyle({
|
|
14
|
+
...style,
|
|
15
|
+
...getNextImageStyles({
|
|
16
|
+
width,
|
|
17
|
+
height,
|
|
18
|
+
setting,
|
|
19
|
+
isDisableAspectStyle,
|
|
20
|
+
isDisableObjectFit: false
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
const nextImageClasses = createClass({
|
|
24
|
+
...getNextImageClasses({
|
|
25
|
+
className,
|
|
26
|
+
hasLazyLoad
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
const nextImageAttrs = getNextImageReactAttrs(props);
|
|
46
30
|
return /*#__PURE__*/ jsx(Image, {
|
|
47
|
-
...props,
|
|
48
31
|
ref: imgRef,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
alt,
|
|
53
|
-
...hasLazyLoad && base64 && {
|
|
54
|
-
placeholder: 'blur',
|
|
55
|
-
blurDataURL: base64
|
|
56
|
-
},
|
|
57
|
-
...!hasLazyLoad ? {
|
|
58
|
-
fetchpriority: 'high',
|
|
59
|
-
loading: 'eager'
|
|
60
|
-
} : {
|
|
61
|
-
loading: 'lazy'
|
|
62
|
-
},
|
|
63
|
-
style: {
|
|
64
|
-
...makeStyleResponsive('aspect', aspectRatioUsed),
|
|
65
|
-
...objectFits,
|
|
66
|
-
...style
|
|
67
|
-
}
|
|
32
|
+
...nextImageAttrs,
|
|
33
|
+
style: nextImageStyles,
|
|
34
|
+
className: nextImageClasses
|
|
68
35
|
});
|
|
69
36
|
};
|
|
70
37
|
|
|
@@ -1,124 +1,36 @@
|
|
|
1
|
-
import { template
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { template } from '@gem-sdk/core';
|
|
2
|
+
import { createStyle, createClass } from '@gem-sdk/system';
|
|
3
|
+
import { getNextImageClasses } from './common/classes.js';
|
|
4
|
+
import { getNextImageStyles } from './common/styles.js';
|
|
5
|
+
import { getNextImageLiquidAttrs } from './helpers/getNextImageLiquidAttrs.js';
|
|
4
6
|
|
|
5
7
|
const NextImage = (props)=>{
|
|
6
|
-
const { setting,
|
|
7
|
-
const { aspectRatio, layout, qualityPercent, qualityType } = setting ?? {};
|
|
8
|
+
const { style, setting, priority, className, pageContext, width = 2237, height = 1678, isNotLazyload, isDisableObjectFit, isDisableAspectStyle, enableLazyLoadImage = true } = props;
|
|
8
9
|
const hasLazyLoad = !isNotLazyload && enableLazyLoadImage && !priority;
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
const nextImageStyles = createStyle({
|
|
11
|
+
...style,
|
|
12
|
+
...getNextImageStyles({
|
|
13
|
+
width,
|
|
14
|
+
height,
|
|
15
|
+
setting,
|
|
16
|
+
isDisableObjectFit,
|
|
17
|
+
isDisableAspectStyle
|
|
18
|
+
})
|
|
15
19
|
});
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const objectFits = getObjectFit();
|
|
25
|
-
DEVICES.forEach((device)=>{
|
|
26
|
-
const objectFitKey = `--objf${device !== 'desktop' ? `-${device}` : ''}`;
|
|
27
|
-
const objectFitByDevice = objectFits?.[objectFitKey] || objectFits?.['--objf'];
|
|
28
|
-
if (aspectRatio?.[device] === 'auto' && objectFitByDevice === 'contain') {
|
|
29
|
-
result = {
|
|
30
|
-
...result,
|
|
31
|
-
[device]: 'auto'
|
|
32
|
-
};
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
const value = aspectRatio?.[device] !== 'auto' && !!aspectRatio?.[device] ? aspectRatio?.[device] : `${width}/${height}`;
|
|
36
|
-
result = {
|
|
37
|
-
...result,
|
|
38
|
-
[device]: value
|
|
39
|
-
};
|
|
40
|
-
});
|
|
41
|
-
return result;
|
|
42
|
-
};
|
|
43
|
-
const getAttrPropImage = ()=>{
|
|
44
|
-
const ignoreAttrInProps = [
|
|
45
|
-
'src',
|
|
46
|
-
'srcset',
|
|
47
|
-
'width',
|
|
48
|
-
'height',
|
|
49
|
-
'alt',
|
|
50
|
-
'base-src'
|
|
51
|
-
];
|
|
52
|
-
const propsImage = {
|
|
53
|
-
...props
|
|
54
|
-
};
|
|
55
|
-
ignoreAttrInProps.forEach((attr)=>{
|
|
56
|
-
if (propsImage[attr]) {
|
|
57
|
-
delete propsImage[attr];
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
return propsImage;
|
|
61
|
-
};
|
|
62
|
-
const attrProps = getAttrPropImage();
|
|
63
|
-
const imagePlaceholder = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=';
|
|
20
|
+
const nextImageClasses = createClass({
|
|
21
|
+
...getNextImageClasses({
|
|
22
|
+
className,
|
|
23
|
+
hasLazyLoad,
|
|
24
|
+
isOptimizePlan: pageContext?.isOptimizePlan
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
const nextImageAttrs = getNextImageLiquidAttrs(props);
|
|
64
28
|
return template`
|
|
65
|
-
|
|
66
|
-
${
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
draggable="false"
|
|
71
|
-
isNotLazyload="true"
|
|
72
|
-
class="${cls(className)}"
|
|
73
|
-
${{
|
|
74
|
-
src: srcImage,
|
|
75
|
-
width,
|
|
76
|
-
height,
|
|
77
|
-
alt
|
|
78
|
-
}}
|
|
79
|
-
fetchpriority="high"
|
|
80
|
-
quality-type=${JSON.stringify(qualityType) || '{}'}
|
|
81
|
-
quality-percent=${JSON.stringify(qualityPercent) || '{}'}
|
|
82
|
-
data-sizes="auto"
|
|
83
|
-
srcset="${srcset}"
|
|
84
|
-
sizes="${sizes || '100vw'}"
|
|
85
|
-
style="${{
|
|
86
|
-
...makeStyleResponsive('aspect', aspectRatioGlobalSize()),
|
|
87
|
-
...getObjectFit(),
|
|
88
|
-
...style
|
|
89
|
-
}}"
|
|
90
|
-
/>`, template`<img
|
|
91
|
-
${{
|
|
92
|
-
...attrProps
|
|
93
|
-
}}
|
|
94
|
-
${customAttrs}
|
|
95
|
-
draggable="false"
|
|
96
|
-
class="${cls(className, {
|
|
97
|
-
gp_lazyload: hasLazyLoad,
|
|
98
|
-
gp_force_load: pageContext?.isOptimizePlan
|
|
99
|
-
})}"
|
|
100
|
-
${{
|
|
101
|
-
'data-src': srcImage,
|
|
102
|
-
'data-srcset': srcSetImg,
|
|
103
|
-
src: enableLazyLoadImage ? imagePlaceholder : srcImage,
|
|
104
|
-
width,
|
|
105
|
-
height,
|
|
106
|
-
alt,
|
|
107
|
-
...baseSrc ? {
|
|
108
|
-
'base-src': baseSrc
|
|
109
|
-
} : {}
|
|
110
|
-
}}
|
|
111
|
-
quality-type=${JSON.stringify(qualityType) || '{}'}
|
|
112
|
-
quality-percent=${JSON.stringify(qualityPercent) || '{}'}
|
|
113
|
-
data-sizes="auto"
|
|
114
|
-
sizes="100vw"
|
|
115
|
-
style="${{
|
|
116
|
-
...makeStyleResponsive('aspect', aspectRatioGlobalSize()),
|
|
117
|
-
...getObjectFit(),
|
|
118
|
-
...style
|
|
119
|
-
}}"
|
|
120
|
-
/>`)}
|
|
121
|
-
`;
|
|
29
|
+
<img
|
|
30
|
+
${nextImageAttrs}
|
|
31
|
+
style="${nextImageStyles}"
|
|
32
|
+
class="${nextImageClasses}"
|
|
33
|
+
/>`;
|
|
122
34
|
};
|
|
123
35
|
|
|
124
36
|
export { NextImage as default };
|
|
@@ -1,22 +1,47 @@
|
|
|
1
1
|
import { template, makeStyleResponsive } from '@gem-sdk/core';
|
|
2
|
+
import { createAttr, createStyle, createClass } from '@gem-sdk/system';
|
|
2
3
|
|
|
3
|
-
const
|
|
4
|
+
const DEFAULT_CLASS = 'feature-video gp-w-full gp-h-full gp-relative';
|
|
5
|
+
const DEFAULT_ALLOW = 'accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture';
|
|
6
|
+
const Video = ({ src, alt, style, autoplay, controls, aspectRatio, allowfullscreen, frameborder = '0', allow = DEFAULT_ALLOW, className = DEFAULT_CLASS })=>{
|
|
7
|
+
const getVideoClasses = ()=>{
|
|
8
|
+
return {
|
|
9
|
+
[className]: true
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
const getVideoStyles = ()=>{
|
|
13
|
+
return {
|
|
14
|
+
...makeStyleResponsive('aspect', aspectRatio)
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
const getVideoAttrs = ()=>{
|
|
18
|
+
return {
|
|
19
|
+
src,
|
|
20
|
+
alt,
|
|
21
|
+
allow,
|
|
22
|
+
frameborder,
|
|
23
|
+
...style,
|
|
24
|
+
...autoplay ? {
|
|
25
|
+
autoplay
|
|
26
|
+
} : {},
|
|
27
|
+
...controls ? {
|
|
28
|
+
controls
|
|
29
|
+
} : {},
|
|
30
|
+
...allowfullscreen ? {
|
|
31
|
+
allowfullscreen
|
|
32
|
+
} : {}
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
const videoAttrs = createAttr(getVideoAttrs());
|
|
36
|
+
const videoStyles = createStyle(getVideoStyles());
|
|
37
|
+
const videoClasses = createClass(getVideoClasses());
|
|
4
38
|
return template`
|
|
5
39
|
<iframe
|
|
6
40
|
${{
|
|
7
|
-
...
|
|
41
|
+
...videoAttrs
|
|
8
42
|
}}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
controls="${controls}"
|
|
12
|
-
allowfullscreen="${allowfullscreen}"
|
|
13
|
-
allow="${allow}"
|
|
14
|
-
frameborder="${frameborder}"
|
|
15
|
-
autoplay="${autoplay}"
|
|
16
|
-
alt="${alt}"
|
|
17
|
-
style="${{
|
|
18
|
-
...makeStyleResponsive('aspect', aspectRatio)
|
|
19
|
-
}}"
|
|
43
|
+
style="${videoStyles}"
|
|
44
|
+
class="${videoClasses}"
|
|
20
45
|
>
|
|
21
46
|
</iframe>
|
|
22
47
|
`;
|