@gem-sdk/components 2.1.13-staging.3 → 2.1.13-staging.30
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/article/components/ArticleImage.js +2 -1
- package/dist/cjs/article/components/ArticleList.js +1 -1
- package/dist/cjs/banner/components/hero-banner/index.liquid.js +12 -13
- package/dist/cjs/banner/components/hero-banner/utils/index.js +5 -3
- package/dist/cjs/builder.js +21 -1
- package/dist/cjs/carousel/components/Carousel.liquid.js +3 -2
- package/dist/cjs/collection/components/CollectionDescription.js +101 -7
- package/dist/cjs/collection/components/CollectionDescription.liquid.js +102 -9
- package/dist/cjs/collection/setting/CollectionDescription.js +128 -0
- package/dist/cjs/form/components/textarea/TextArea.liquid.js +2 -2
- package/dist/cjs/image/components/AdaptiveImage.liquid.js +6 -5
- package/dist/cjs/image/components/Image.js +0 -1
- package/dist/cjs/image/components/Image.liquid.js +6 -5
- package/dist/cjs/image/components/NextImage.liquid.js +4 -3
- package/dist/cjs/image-comparison/components/CompareImage.liquid.js +7 -3
- package/dist/cjs/index.js +20 -0
- package/dist/cjs/index.liquid.js +22 -2
- package/dist/cjs/marquee/components/MarqueeBase.liquid.js +7 -26
- package/dist/cjs/product/components/Product.liquid.js +3 -2
- package/dist/cjs/product/components/ProductBadge/index.liquid.js +13 -4
- package/dist/cjs/product/components/ProductBadge/utils/generateLiquidContent.js +2 -2
- package/dist/cjs/product/components/ProductDescription.liquid.js +21 -5
- package/dist/cjs/product/components/ProductImagesV2/jsx/ProductImages.js +2 -9
- package/dist/cjs/product/components/ProductImagesV2/jsx/components/ProductFeaturedImageCarousel.js +12 -4
- package/dist/cjs/product/components/ProductImagesV2/liquid/ProductFeaturedImageCarousel.liquid.js +6 -5
- package/dist/cjs/product/components/ProductImagesV2/liquid/ProductGalleryCarousel.liquid.js +2 -2
- package/dist/cjs/product/components/ProductImagesV2/liquid/ProductGalleryGrid.liquid.js +4 -4
- package/dist/cjs/product/components/ProductImagesV2/liquid/ProductImages.liquid.js +4 -4
- package/dist/cjs/product/components/ProductVariants/index.liquid.js +11 -18
- package/dist/cjs/product/components/ProductVariants/variants/Base.liquid.js +1 -0
- package/dist/cjs/product/components/ProductVariants/variants/Dropdown.liquid.js +26 -12
- package/dist/cjs/product/components/ProductVariants/variants/DropdownGroup.liquid.js +4 -37
- package/dist/cjs/product/components/ProductVariants/variants/combine/index.js +47 -0
- package/dist/cjs/product/components/Sku.js +2 -14
- package/dist/cjs/product/setting/ProductBadge.js +5 -0
- package/dist/cjs/product/setting/ProductDescription.js +5 -0
- package/dist/cjs/tab/hooks/useTabInteraction.js +13 -9
- package/dist/cjs/third-party/components/AlsoBoughtCbb.js +32 -0
- package/dist/cjs/third-party/components/AlsoBoughtCbb.liquid.js +21 -0
- package/dist/cjs/third-party/components/BfSizeChartSizeGuide.js +32 -0
- package/dist/cjs/third-party/components/BfSizeChartSizeGuide.liquid.js +12 -0
- package/dist/cjs/third-party/components/EssentialAnnouncementBar.js +32 -0
- package/dist/cjs/third-party/components/EssentialAnnouncementBar.liquid.js +12 -0
- package/dist/cjs/third-party/components/EssentialCountdownTimerBar.js +32 -0
- package/dist/cjs/third-party/components/EssentialCountdownTimerBar.liquid.js +12 -0
- package/dist/cjs/third-party/components/EstimatedDeliveryDatePlus.js +32 -0
- package/dist/cjs/third-party/components/EstimatedDeliveryDatePlus.liquid.js +12 -0
- package/dist/cjs/third-party/components/GloColorSwatchvariantImage.js +32 -0
- package/dist/cjs/third-party/components/GloColorSwatchvariantImage.liquid.js +12 -0
- package/dist/cjs/third-party/components/HextomFreeShippingBar.js +32 -0
- package/dist/cjs/third-party/components/HextomFreeShippingBar.liquid.js +12 -0
- package/dist/cjs/third-party/components/NotifyBackInStockPreOrder.js +1 -1
- package/dist/cjs/third-party/components/OkendoReviewsLoyalty.js +32 -0
- package/dist/cjs/third-party/components/OkendoReviewsLoyalty.liquid.js +12 -0
- package/dist/cjs/third-party/components/QikifyUpsell.js +22 -10
- package/dist/cjs/third-party/components/QikifyUpsell.liquid.js +3 -46
- package/dist/cjs/third-party/components/ShopifySubscriptions.liquid.js +3 -2
- package/dist/cjs/third-party/components/StellarDeliveryDatePickup.js +32 -0
- package/dist/cjs/third-party/components/StellarDeliveryDatePickup.liquid.js +21 -0
- package/dist/cjs/third-party/components/TrustedsiteTrustBadges.js +32 -0
- package/dist/cjs/third-party/components/TrustedsiteTrustBadges.liquid.js +12 -0
- package/dist/cjs/third-party/configs/AlsoBoughtCbb.js +12 -0
- package/dist/cjs/third-party/configs/BfSizeChartSizeGuide.js +12 -0
- package/dist/cjs/third-party/configs/EssentialAnnouncementBar.js +12 -0
- package/dist/cjs/third-party/configs/EssentialCountdownTimerBar.js +12 -0
- package/dist/cjs/third-party/configs/EstimatedDeliveryDatePlus.js +12 -0
- package/dist/cjs/third-party/configs/GloColorSwatchvariantImage.js +12 -0
- package/dist/cjs/third-party/configs/HextomFreeShippingBar.js +12 -0
- package/dist/cjs/third-party/configs/OkendoReviewsLoyalty.js +12 -0
- package/dist/cjs/third-party/configs/StellarDeliveryDatePickup.js +12 -0
- package/dist/cjs/third-party/configs/TrustedsiteTrustBadges.js +12 -0
- package/dist/cjs/third-party/helpers/thirdParty.js +1 -1
- package/dist/cjs/third-party/next.js +51 -1
- package/dist/cjs/third-party/setting/AlsoBoughtCbb.js +127 -0
- package/dist/cjs/third-party/setting/BfSizeChartSizeGuide.js +131 -0
- package/dist/cjs/third-party/setting/EssentialAnnouncementBar.js +142 -0
- package/dist/cjs/third-party/setting/EssentialCountdownTimerBar.js +142 -0
- package/dist/cjs/third-party/setting/EstimatedDeliveryDatePlus.js +128 -0
- package/dist/cjs/third-party/setting/GloColorSwatchvariantImage.js +152 -0
- package/dist/cjs/third-party/setting/HextomFreeShippingBar.js +128 -0
- package/dist/cjs/third-party/setting/NotifyBackInStockPreOrder.js +2 -2
- package/dist/cjs/third-party/setting/OkendoReviewsLoyalty.js +171 -0
- package/dist/cjs/third-party/setting/QikifyUpsell.js +11 -1
- package/dist/cjs/third-party/setting/ShopifySubscriptions.js +22 -0
- package/dist/cjs/third-party/setting/StellarDeliveryDatePickup.js +127 -0
- package/dist/cjs/third-party/setting/TrustedsiteTrustBadges.js +177 -0
- package/dist/cjs/third-party/setting/index.js +21 -1
- package/dist/cjs/video/components/HTML5Embed.js +2 -2
- package/dist/cjs/video/components/HTML5Embed.liquid.js +6 -3
- package/dist/cjs/video/components/LiteYouTubeEmbed.liquid.js +5 -3
- package/dist/esm/article/components/ArticleImage.js +2 -1
- package/dist/esm/article/components/ArticleList.js +1 -1
- package/dist/esm/banner/components/hero-banner/index.liquid.js +12 -13
- package/dist/esm/banner/components/hero-banner/utils/index.js +5 -3
- package/dist/esm/builder.js +21 -1
- package/dist/esm/carousel/components/Carousel.liquid.js +3 -2
- package/dist/esm/collection/components/CollectionDescription.js +103 -9
- package/dist/esm/collection/components/CollectionDescription.liquid.js +103 -10
- package/dist/esm/collection/setting/CollectionDescription.js +128 -0
- package/dist/esm/form/components/textarea/TextArea.liquid.js +2 -2
- package/dist/esm/image/components/AdaptiveImage.liquid.js +6 -5
- package/dist/esm/image/components/Image.js +0 -1
- package/dist/esm/image/components/Image.liquid.js +6 -5
- package/dist/esm/image/components/NextImage.liquid.js +4 -3
- package/dist/esm/image-comparison/components/CompareImage.liquid.js +7 -3
- package/dist/esm/index.js +10 -0
- package/dist/esm/index.liquid.js +11 -1
- package/dist/esm/marquee/components/MarqueeBase.liquid.js +7 -26
- package/dist/esm/product/components/Product.liquid.js +3 -2
- package/dist/esm/product/components/ProductBadge/index.liquid.js +14 -5
- package/dist/esm/product/components/ProductBadge/utils/generateLiquidContent.js +2 -2
- package/dist/esm/product/components/ProductDescription.liquid.js +22 -6
- package/dist/esm/product/components/ProductImagesV2/jsx/ProductImages.js +2 -9
- package/dist/esm/product/components/ProductImagesV2/jsx/components/ProductFeaturedImageCarousel.js +13 -5
- package/dist/esm/product/components/ProductImagesV2/liquid/ProductFeaturedImageCarousel.liquid.js +6 -5
- package/dist/esm/product/components/ProductImagesV2/liquid/ProductGalleryCarousel.liquid.js +2 -2
- package/dist/esm/product/components/ProductImagesV2/liquid/ProductGalleryGrid.liquid.js +4 -4
- package/dist/esm/product/components/ProductImagesV2/liquid/ProductImages.liquid.js +4 -4
- package/dist/esm/product/components/ProductVariants/index.liquid.js +12 -19
- package/dist/esm/product/components/ProductVariants/variants/Base.liquid.js +1 -0
- package/dist/esm/product/components/ProductVariants/variants/Dropdown.liquid.js +26 -12
- package/dist/esm/product/components/ProductVariants/variants/DropdownGroup.liquid.js +4 -37
- package/dist/esm/product/components/ProductVariants/variants/combine/index.js +44 -0
- package/dist/esm/product/components/Sku.js +3 -15
- package/dist/esm/product/setting/ProductBadge.js +5 -0
- package/dist/esm/product/setting/ProductDescription.js +5 -0
- package/dist/esm/tab/hooks/useTabInteraction.js +14 -10
- package/dist/esm/third-party/components/AlsoBoughtCbb.js +28 -0
- package/dist/esm/third-party/components/AlsoBoughtCbb.liquid.js +17 -0
- package/dist/esm/third-party/components/BfSizeChartSizeGuide.js +28 -0
- package/dist/esm/third-party/components/BfSizeChartSizeGuide.liquid.js +8 -0
- package/dist/esm/third-party/components/EssentialAnnouncementBar.js +28 -0
- package/dist/esm/third-party/components/EssentialAnnouncementBar.liquid.js +8 -0
- package/dist/esm/third-party/components/EssentialCountdownTimerBar.js +28 -0
- package/dist/esm/third-party/components/EssentialCountdownTimerBar.liquid.js +8 -0
- package/dist/esm/third-party/components/EstimatedDeliveryDatePlus.js +28 -0
- package/dist/esm/third-party/components/EstimatedDeliveryDatePlus.liquid.js +8 -0
- package/dist/esm/third-party/components/GloColorSwatchvariantImage.js +28 -0
- package/dist/esm/third-party/components/GloColorSwatchvariantImage.liquid.js +8 -0
- package/dist/esm/third-party/components/HextomFreeShippingBar.js +28 -0
- package/dist/esm/third-party/components/HextomFreeShippingBar.liquid.js +8 -0
- package/dist/esm/third-party/components/NotifyBackInStockPreOrder.js +1 -1
- package/dist/esm/third-party/components/OkendoReviewsLoyalty.js +28 -0
- package/dist/esm/third-party/components/OkendoReviewsLoyalty.liquid.js +8 -0
- package/dist/esm/third-party/components/QikifyUpsell.js +22 -10
- package/dist/esm/third-party/components/QikifyUpsell.liquid.js +3 -46
- package/dist/esm/third-party/components/ShopifySubscriptions.liquid.js +3 -2
- package/dist/esm/third-party/components/StellarDeliveryDatePickup.js +28 -0
- package/dist/esm/third-party/components/StellarDeliveryDatePickup.liquid.js +17 -0
- package/dist/esm/third-party/components/TrustedsiteTrustBadges.js +28 -0
- package/dist/esm/third-party/components/TrustedsiteTrustBadges.liquid.js +8 -0
- package/dist/esm/third-party/configs/AlsoBoughtCbb.js +8 -0
- package/dist/esm/third-party/configs/BfSizeChartSizeGuide.js +8 -0
- package/dist/esm/third-party/configs/EssentialAnnouncementBar.js +8 -0
- package/dist/esm/third-party/configs/EssentialCountdownTimerBar.js +8 -0
- package/dist/esm/third-party/configs/EstimatedDeliveryDatePlus.js +8 -0
- package/dist/esm/third-party/configs/GloColorSwatchvariantImage.js +8 -0
- package/dist/esm/third-party/configs/HextomFreeShippingBar.js +8 -0
- package/dist/esm/third-party/configs/OkendoReviewsLoyalty.js +8 -0
- package/dist/esm/third-party/configs/StellarDeliveryDatePickup.js +8 -0
- package/dist/esm/third-party/configs/TrustedsiteTrustBadges.js +8 -0
- package/dist/esm/third-party/helpers/thirdParty.js +1 -1
- package/dist/esm/third-party/next.js +51 -1
- package/dist/esm/third-party/setting/AlsoBoughtCbb.js +123 -0
- package/dist/esm/third-party/setting/BfSizeChartSizeGuide.js +127 -0
- package/dist/esm/third-party/setting/EssentialAnnouncementBar.js +138 -0
- package/dist/esm/third-party/setting/EssentialCountdownTimerBar.js +138 -0
- package/dist/esm/third-party/setting/EstimatedDeliveryDatePlus.js +124 -0
- package/dist/esm/third-party/setting/GloColorSwatchvariantImage.js +148 -0
- package/dist/esm/third-party/setting/HextomFreeShippingBar.js +124 -0
- package/dist/esm/third-party/setting/NotifyBackInStockPreOrder.js +2 -2
- package/dist/esm/third-party/setting/OkendoReviewsLoyalty.js +167 -0
- package/dist/esm/third-party/setting/QikifyUpsell.js +11 -1
- package/dist/esm/third-party/setting/ShopifySubscriptions.js +22 -0
- package/dist/esm/third-party/setting/StellarDeliveryDatePickup.js +123 -0
- package/dist/esm/third-party/setting/TrustedsiteTrustBadges.js +173 -0
- package/dist/esm/third-party/setting/index.js +224 -204
- package/dist/esm/video/components/HTML5Embed.js +2 -2
- package/dist/esm/video/components/HTML5Embed.liquid.js +6 -3
- package/dist/esm/video/components/LiteYouTubeEmbed.liquid.js +5 -3
- package/dist/types/index.d.ts +257 -36
- package/package.json +2 -2
|
@@ -35,6 +35,59 @@ const config = {
|
|
|
35
35
|
}
|
|
36
36
|
]
|
|
37
37
|
},
|
|
38
|
+
{
|
|
39
|
+
id: 'hasLineClamp',
|
|
40
|
+
label: 'Enable View More',
|
|
41
|
+
type: 'toggle',
|
|
42
|
+
devices: {
|
|
43
|
+
desktop: {
|
|
44
|
+
default: true
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: 'lineClamp',
|
|
50
|
+
label: 'Maximum Row(s) To Show',
|
|
51
|
+
type: 'input:number',
|
|
52
|
+
min: 1,
|
|
53
|
+
hide: true,
|
|
54
|
+
devices: {
|
|
55
|
+
desktop: {
|
|
56
|
+
default: 12
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: 'viewMoreText',
|
|
62
|
+
label: 'View More Text',
|
|
63
|
+
type: 'input',
|
|
64
|
+
default: 'Show more',
|
|
65
|
+
hide: true
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: 'showMoreColor',
|
|
69
|
+
type: 'colorpicker',
|
|
70
|
+
default: 'text-1'
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 'viewLessText',
|
|
74
|
+
label: 'View Less Text',
|
|
75
|
+
type: 'input',
|
|
76
|
+
default: 'Show less',
|
|
77
|
+
hide: true
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: 'enableViewMoreIcon',
|
|
81
|
+
label: 'Enable Icon',
|
|
82
|
+
type: 'toggle',
|
|
83
|
+
default: true,
|
|
84
|
+
hide: true
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: 'translate',
|
|
88
|
+
type: 'input',
|
|
89
|
+
default: 'viewLessText,viewMoreText'
|
|
90
|
+
},
|
|
38
91
|
{
|
|
39
92
|
id: 'textAlign',
|
|
40
93
|
label: 'Align',
|
|
@@ -70,11 +123,86 @@ const config = {
|
|
|
70
123
|
default: 'center'
|
|
71
124
|
}
|
|
72
125
|
}
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
id: 'color',
|
|
129
|
+
type: 'colorpicker',
|
|
130
|
+
default: 'text-1'
|
|
73
131
|
}
|
|
74
132
|
]
|
|
75
133
|
}
|
|
76
134
|
],
|
|
77
135
|
ui: [
|
|
136
|
+
{
|
|
137
|
+
type: 'group',
|
|
138
|
+
label: {
|
|
139
|
+
en: ''
|
|
140
|
+
},
|
|
141
|
+
controls: [
|
|
142
|
+
{
|
|
143
|
+
type: 'control',
|
|
144
|
+
label: {
|
|
145
|
+
en: 'Show more'
|
|
146
|
+
},
|
|
147
|
+
options: {
|
|
148
|
+
label: 'large'
|
|
149
|
+
},
|
|
150
|
+
setting: {
|
|
151
|
+
id: 'hasLineClamp'
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
type: 'control',
|
|
156
|
+
label: {
|
|
157
|
+
en: 'Text color'
|
|
158
|
+
},
|
|
159
|
+
setting: {
|
|
160
|
+
id: 'showMoreColor'
|
|
161
|
+
},
|
|
162
|
+
condition: 'hasLineClamp == true'
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
type: 'control',
|
|
166
|
+
label: {
|
|
167
|
+
en: 'Max lines'
|
|
168
|
+
},
|
|
169
|
+
setting: {
|
|
170
|
+
id: 'lineClamp'
|
|
171
|
+
},
|
|
172
|
+
condition: 'hasLineClamp == true'
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
type: 'control',
|
|
176
|
+
label: {
|
|
177
|
+
en: 'Show more label'
|
|
178
|
+
},
|
|
179
|
+
setting: {
|
|
180
|
+
id: 'viewMoreText'
|
|
181
|
+
},
|
|
182
|
+
condition: 'hasLineClamp == true'
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
type: 'control',
|
|
186
|
+
label: {
|
|
187
|
+
en: 'Show less label'
|
|
188
|
+
},
|
|
189
|
+
setting: {
|
|
190
|
+
id: 'viewLessText'
|
|
191
|
+
},
|
|
192
|
+
condition: 'hasLineClamp == true'
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
type: 'control',
|
|
196
|
+
label: {
|
|
197
|
+
en: 'Icon'
|
|
198
|
+
},
|
|
199
|
+
setting: {
|
|
200
|
+
id: 'enableViewMoreIcon'
|
|
201
|
+
},
|
|
202
|
+
condition: 'hasLineClamp == true'
|
|
203
|
+
}
|
|
204
|
+
]
|
|
205
|
+
},
|
|
78
206
|
{
|
|
79
207
|
label: {
|
|
80
208
|
en: 'Text'
|
|
@@ -2,10 +2,10 @@ import { makeStyleResponsive, makeWidth, composeAdvanceStyle, composeTypographyC
|
|
|
2
2
|
import { getDynamicSourceLocales } from '../../../helpers.js';
|
|
3
3
|
|
|
4
4
|
const FormTextarea = ({ setting, builderProps, className, builderAttrs, advanced, pageContext })=>{
|
|
5
|
-
const { text, name, placeholder, required, width, fullWidth, typography } = setting ?? {};
|
|
5
|
+
const { text, name, placeholder, required, width, fullWidth, typography, translate } = setting ?? {};
|
|
6
6
|
const textAreaWidth = makeStyleResponsive('w', makeWidth(width, fullWidth));
|
|
7
7
|
const defaultName = name === '' || name === undefined ? 'contact[note]' : name;
|
|
8
|
-
const { border, rounded, hasBoxShadow, boxShadow, pos, d, op, right, top, left, bottom, z, margin, padding
|
|
8
|
+
const { border, rounded, hasBoxShadow, boxShadow, pos, d, op, right, top, left, bottom, z, margin, padding } = advanced ?? {};
|
|
9
9
|
const spacingSetting = advanced?.['spacing-setting'];
|
|
10
10
|
const inputStyle = composeAdvanceStyle({
|
|
11
11
|
border,
|
|
@@ -2,7 +2,7 @@ import { template, cls, RenderIf, makeStyleResponsive } from '@gem-sdk/core';
|
|
|
2
2
|
import { getImageSrc } from '../helpers/getSrcSet.js';
|
|
3
3
|
import { createBlurDataURL } from './helpers.js';
|
|
4
4
|
|
|
5
|
-
const AdaptiveImage = ({ srcSet, priority, alt, aspectRatio, layout, className, pictureClass, style, imagePlaceholder,
|
|
5
|
+
const AdaptiveImage = ({ srcSet, priority, alt, aspectRatio, layout, className, pictureClass, style, imagePlaceholder, enableLazyLoadImage = true, pageContext, ...props })=>{
|
|
6
6
|
const fallBackImage = 'https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif';
|
|
7
7
|
const srcDesktop = getImageSrc(srcSet?.desktop, 'desktop') || fallBackImage;
|
|
8
8
|
const srcTablet = (getImageSrc(srcSet?.tablet, 'tablet') ?? getImageSrc(srcSet?.desktop, 'tablet')) || fallBackImage;
|
|
@@ -27,16 +27,17 @@ const AdaptiveImage = ({ srcSet, priority, alt, aspectRatio, layout, className,
|
|
|
27
27
|
}}"
|
|
28
28
|
/>
|
|
29
29
|
`, template`
|
|
30
|
-
${srcMobile ? `<source media="(max-width: 767px)" data-srcSet="${srcMobile}" srcset="${
|
|
31
|
-
${srcTablet ? `<source media="(max-width: 1024px)" data-srcSet="${srcTablet}" srcset="${
|
|
30
|
+
${srcMobile ? `<source media="(max-width: 767px)" data-srcSet="${srcMobile}" srcset="${enableLazyLoadImage ? imagePlaceholder?.['mobile'] ?? createBlurDataURL(srcSet?.mobile?.width ?? srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.mobile?.height ?? srcSet?.tablet?.height ?? srcSet?.desktop?.height ?? 0) : srcMobile}" />` : ''}
|
|
31
|
+
${srcTablet ? `<source media="(max-width: 1024px)" data-srcSet="${srcTablet}" srcset="${enableLazyLoadImage ? imagePlaceholder?.['tablet'] ?? createBlurDataURL(srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.tablet?.height ?? srcSet?.desktop?.height ?? 0) : srcTablet}" />` : ''}
|
|
32
32
|
<img
|
|
33
33
|
${{
|
|
34
34
|
...props
|
|
35
35
|
}}
|
|
36
36
|
class="${cls(className, {
|
|
37
|
-
gp_lazyload:
|
|
37
|
+
gp_lazyload: enableLazyLoadImage,
|
|
38
|
+
gp_force_load: pageContext?.isOptimizePlan
|
|
38
39
|
})}"
|
|
39
|
-
src="${
|
|
40
|
+
src="${enableLazyLoadImage ? imagePlaceholder?.['desktop'] ?? createBlurDataURL(srcSet?.desktop?.width ?? 0, srcSet?.desktop?.height ?? 0) : srcDesktop}"
|
|
40
41
|
data-src="${srcDesktop}"
|
|
41
42
|
width="100%"
|
|
42
43
|
alt="${alt}"
|
|
@@ -91,7 +91,6 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
|
|
|
91
91
|
style: {
|
|
92
92
|
...getStyleShadowState(styles?.boxShadowImg, 'box-shadow', styles?.hasBoxShadowImg),
|
|
93
93
|
borderRadius: 'inherit',
|
|
94
|
-
overflow: 'hidden',
|
|
95
94
|
...makeStyleResponsive('jc', styles?.align)
|
|
96
95
|
},
|
|
97
96
|
children: [
|
|
@@ -3,7 +3,7 @@ import AdaptiveImage from './AdaptiveImage.liquid.js';
|
|
|
3
3
|
import NextImage from './NextImage.liquid.js';
|
|
4
4
|
import { getInsertLinkData } from '../../helpers.js';
|
|
5
5
|
|
|
6
|
-
const Image = ({ styles, className, setting, builderAttrs, builderProps, style, advanced,
|
|
6
|
+
const Image = ({ styles, className, setting, builderAttrs, builderProps, style, advanced, enableLazyLoadImage = true, pageContext })=>{
|
|
7
7
|
const { imageLink, isNotLazyload } = setting ?? {};
|
|
8
8
|
const { shape } = styles ?? {};
|
|
9
9
|
const { Wrap: WrapLink, urlData } = getInsertLinkData('div', imageLink);
|
|
@@ -30,7 +30,7 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
|
|
|
30
30
|
}}
|
|
31
31
|
data-id="${builderProps?.uid}"
|
|
32
32
|
role="presentation"
|
|
33
|
-
class="${cls('gp-group/image', builderProps?.uid, advanced?.cssClass)}"
|
|
33
|
+
class="${cls('gp-group/image', builderProps?.uid, advanced?.cssClass, `force-publish-${new Date().getTime()}`)}"
|
|
34
34
|
style="${{
|
|
35
35
|
...style,
|
|
36
36
|
...makeStyleResponsive('ta', styles?.align)
|
|
@@ -46,7 +46,6 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
|
|
|
46
46
|
style="${{
|
|
47
47
|
...getStyleShadowState(styles?.boxShadowImg, 'box-shadow', styles?.hasBoxShadowImg),
|
|
48
48
|
'border-radius': 'inherit',
|
|
49
|
-
overflow: 'hidden',
|
|
50
49
|
...makeStyleResponsive('jc', styles?.align)
|
|
51
50
|
}}"
|
|
52
51
|
>
|
|
@@ -73,7 +72,8 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
|
|
|
73
72
|
aspectRatio: getAspectRatioGlobalSize(styles?.shape),
|
|
74
73
|
layout: styles?.objectFit,
|
|
75
74
|
priority: setting?.priority,
|
|
76
|
-
|
|
75
|
+
enableLazyLoadImage,
|
|
76
|
+
pageContext
|
|
77
77
|
}) : NextImage({
|
|
78
78
|
...setting?.image,
|
|
79
79
|
priority: setting?.priority,
|
|
@@ -102,7 +102,8 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
|
|
|
102
102
|
layout: styles?.objectFit
|
|
103
103
|
},
|
|
104
104
|
isNotLazyload,
|
|
105
|
-
|
|
105
|
+
enableLazyLoadImage,
|
|
106
|
+
pageContext
|
|
106
107
|
})}
|
|
107
108
|
</${WrapLink}>
|
|
108
109
|
</div>`;
|
|
@@ -3,7 +3,7 @@ import { getNewBackupFileKey, getImageSrc, getSrcSet } from '../helpers/getSrcSe
|
|
|
3
3
|
import { DEVICES } from '../../product/components/ProductVariants/index.js';
|
|
4
4
|
import { createBlurDataURL } from './helpers.js';
|
|
5
5
|
|
|
6
|
-
const NextImage = ({ setting, src = 'https://ucarecdn.com/465c7cbb-f087-4d1d-8f08-f6665179f02f/-/format/auto/-/quality/lighter/placeholder-1.png', srcIsLiquidCode, alt = 'Alt image', width = 2237, height = 1678, backupFileKey, backupFilePath, storage, style, priority, vw, className, base64, baseSrc, isDisableAspectStyle, isDisableObjectFit, customAttrs, customLazyload, isNotLazyload,
|
|
6
|
+
const NextImage = ({ setting, src = 'https://ucarecdn.com/465c7cbb-f087-4d1d-8f08-f6665179f02f/-/format/auto/-/quality/lighter/placeholder-1.png', srcIsLiquidCode, alt = 'Alt image', width = 2237, height = 1678, backupFileKey, backupFilePath, storage, style, priority, vw, className, base64, baseSrc, isDisableAspectStyle, isDisableObjectFit, customAttrs, customLazyload, isNotLazyload, enableLazyLoadImage = true, pageContext, srcset, sizes, ...props })=>{
|
|
7
7
|
const { aspectRatio, layout, qualityPercent, qualityType } = setting ?? {};
|
|
8
8
|
const newBackupFilekey = backupFileKey ? getNewBackupFileKey(backupFileKey ?? '', src) : '';
|
|
9
9
|
const srcImage = srcIsLiquidCode ? baseSrc : getImageSrc({
|
|
@@ -93,12 +93,13 @@ const NextImage = ({ setting, src = 'https://ucarecdn.com/465c7cbb-f087-4d1d-8f0
|
|
|
93
93
|
${customAttrs}
|
|
94
94
|
draggable="false"
|
|
95
95
|
class="${cls(className, {
|
|
96
|
-
gp_lazyload: !customLazyload &&
|
|
96
|
+
gp_lazyload: !customLazyload && enableLazyLoadImage,
|
|
97
|
+
gp_force_load: pageContext?.isOptimizePlan
|
|
97
98
|
})}"
|
|
98
99
|
${{
|
|
99
100
|
'data-src': srcImage,
|
|
100
101
|
'data-srcset': srcSetImg,
|
|
101
|
-
src:
|
|
102
|
+
src: enableLazyLoadImage ? imagePlaceholder : srcImage,
|
|
102
103
|
width,
|
|
103
104
|
height,
|
|
104
105
|
alt,
|
|
@@ -7,7 +7,7 @@ import { getSettingPreloadData } from '../../helpers.js';
|
|
|
7
7
|
import { styleLazyPlaceholder } from './common/helpers.js';
|
|
8
8
|
|
|
9
9
|
const CompareImage = (props)=>{
|
|
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;
|
|
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, enableLazyLoadImage, pageContext, translate } = props;
|
|
11
11
|
const horizontal = !vertical;
|
|
12
12
|
const leftRatio = (leftImage?.width ?? 0) / (leftImage?.height ?? 1);
|
|
13
13
|
const rightRatio = (rightImage?.width ?? 0) / (rightImage?.height ?? 1);
|
|
@@ -267,7 +267,9 @@ const CompareImage = (props)=>{
|
|
|
267
267
|
style: {
|
|
268
268
|
...initStyles.rightImage,
|
|
269
269
|
...makeStyleResponsive('objf', styles?.imageScale)
|
|
270
|
-
}
|
|
270
|
+
},
|
|
271
|
+
enableLazyLoadImage,
|
|
272
|
+
pageContext
|
|
271
273
|
})}
|
|
272
274
|
${NextImage({
|
|
273
275
|
customAttrs: {
|
|
@@ -283,7 +285,9 @@ const CompareImage = (props)=>{
|
|
|
283
285
|
style: {
|
|
284
286
|
...initStyles.rightImage,
|
|
285
287
|
...makeStyleResponsive('objf', styles?.imageScale)
|
|
286
|
-
}
|
|
288
|
+
},
|
|
289
|
+
enableLazyLoadImage,
|
|
290
|
+
pageContext
|
|
287
291
|
})}
|
|
288
292
|
<div id="image-comparison-slider-${componentUid}" style="${{
|
|
289
293
|
...initStyles.slider
|
package/dist/esm/index.js
CHANGED
|
@@ -205,8 +205,18 @@ export { default as TrustreviewsProductReviews } from './third-party/components/
|
|
|
205
205
|
export { default as MyappgurusProductReviews } from './third-party/components/MyappgurusProductReviews.js';
|
|
206
206
|
export { default as HulkProductOptions } from './third-party/components/HulkProductOptions.js';
|
|
207
207
|
export { default as TrustshopProductReviews } from './third-party/components/TrustshopProductReviews.js';
|
|
208
|
+
export { default as StellarDeliveryDatePickup } from './third-party/components/StellarDeliveryDatePickup.js';
|
|
209
|
+
export { default as EssentialCountdownTimerBar } from './third-party/components/EssentialCountdownTimerBar.js';
|
|
210
|
+
export { default as EssentialAnnouncementBar } from './third-party/components/EssentialAnnouncementBar.js';
|
|
211
|
+
export { default as OkendoReviewsLoyalty } from './third-party/components/OkendoReviewsLoyalty.js';
|
|
212
|
+
export { default as EstimatedDeliveryDatePlus } from './third-party/components/EstimatedDeliveryDatePlus.js';
|
|
208
213
|
export { default as HextomCountdownTimerBar } from './third-party/components/HextomCountdownTimerBar.js';
|
|
209
214
|
export { default as TrustBadgesBear } from './third-party/components/TrustBadgesBear.js';
|
|
215
|
+
export { default as TrustedsiteTrustBadges } from './third-party/components/TrustedsiteTrustBadges.js';
|
|
216
|
+
export { default as GloColorSwatchvariantImage } from './third-party/components/GloColorSwatchvariantImage.js';
|
|
217
|
+
export { default as BfSizeChartSizeGuide } from './third-party/components/BfSizeChartSizeGuide.js';
|
|
218
|
+
export { default as AlsoBoughtCbb } from './third-party/components/AlsoBoughtCbb.js';
|
|
219
|
+
export { default as HextomFreeShippingBar } from './third-party/components/HextomFreeShippingBar.js';
|
|
210
220
|
export { default as thirdPartyInstantSetting } from './third-party-instant/setting/index.js';
|
|
211
221
|
export { default as InstantJudgemeReviews } from './third-party-instant/components/InstantJudgemeReviews.js';
|
|
212
222
|
export { default as InstantLooxReviews } from './third-party-instant/components/InstantLooxReviews.js';
|
package/dist/esm/index.liquid.js
CHANGED
|
@@ -159,9 +159,19 @@ export { default as SeoantTrustBadgesIcon } from './third-party/components/Seoan
|
|
|
159
159
|
export { default as TrustreviewsProductReviews } from './third-party/components/TrustreviewsProductReviews.liquid.js';
|
|
160
160
|
export { default as MyappgurusProductReviews } from './third-party/components/MyappgurusProductReviews.liquid.js';
|
|
161
161
|
export { default as HulkProductOptions } from './third-party/components/HulkProductOptions.liquid.js';
|
|
162
|
+
export { default as TrustshopProductReviews } from './third-party/components/TrustshopProductReviews.liquid.js';
|
|
163
|
+
export { default as StellarDeliveryDatePickup } from './third-party/components/StellarDeliveryDatePickup.liquid.js';
|
|
164
|
+
export { default as EssentialCountdownTimerBar } from './third-party/components/EssentialCountdownTimerBar.liquid.js';
|
|
165
|
+
export { default as EssentialAnnouncementBar } from './third-party/components/EssentialAnnouncementBar.liquid.js';
|
|
166
|
+
export { default as OkendoReviewsLoyalty } from './third-party/components/OkendoReviewsLoyalty.liquid.js';
|
|
167
|
+
export { default as EstimatedDeliveryDatePlus } from './third-party/components/EstimatedDeliveryDatePlus.liquid.js';
|
|
162
168
|
export { default as HextomCountdownTimerBar } from './third-party/components/HextomCountdownTimerBar.liquid.js';
|
|
163
169
|
export { default as TrustBadgesBear } from './third-party/components/TrustBadgesBear.liquid.js';
|
|
164
|
-
export { default as
|
|
170
|
+
export { default as TrustedsiteTrustBadges } from './third-party/components/TrustedsiteTrustBadges.liquid.js';
|
|
171
|
+
export { default as GloColorSwatchvariantImage } from './third-party/components/GloColorSwatchvariantImage.liquid.js';
|
|
172
|
+
export { default as BfSizeChartSizeGuide } from './third-party/components/BfSizeChartSizeGuide.liquid.js';
|
|
173
|
+
export { default as AlsoBoughtCbb } from './third-party/components/AlsoBoughtCbb.liquid.js';
|
|
174
|
+
export { default as HextomFreeShippingBar } from './third-party/components/HextomFreeShippingBar.liquid.js';
|
|
165
175
|
export { default as ImageComparison } from './image-comparison/components/ImageComparison.liquid.js';
|
|
166
176
|
export { default as ThirdPartySlot } from './third-party-slot/components/ThirdPartySlot.liquid.js';
|
|
167
177
|
export { default as Sticky } from './sticky/components/Sticky.liquid.js';
|
|
@@ -42,7 +42,6 @@ const MarqueeBase = ({ style = {}, autoFill = false, play = true, pauseOnHover =
|
|
|
42
42
|
};
|
|
43
43
|
return template`
|
|
44
44
|
<div
|
|
45
|
-
|
|
46
45
|
style="${containerStyle()}"
|
|
47
46
|
class="rfm-marquee-container"
|
|
48
47
|
>
|
|
@@ -51,35 +50,17 @@ const MarqueeBase = ({ style = {}, autoFill = false, play = true, pauseOnHover =
|
|
|
51
50
|
style="${marqueeStyle()}"
|
|
52
51
|
>
|
|
53
52
|
<div class="rfm-initial-child-container">
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
`}
|
|
60
|
-
</div>
|
|
61
|
-
<div class="rfm-child-placeholder">
|
|
62
|
-
${template`
|
|
63
|
-
<div style="${childStyle()}" class="${`rfm-child`}">
|
|
64
|
-
${children}
|
|
65
|
-
</div>
|
|
66
|
-
`}
|
|
67
|
-
</div>
|
|
68
|
-
<div class="rfm-child-placeholder">
|
|
69
|
-
|
|
70
|
-
${template`
|
|
71
|
-
<div style="${childStyle()}" class="${`rfm-child`}">
|
|
72
|
-
${children}
|
|
73
|
-
</div>
|
|
74
|
-
`}
|
|
53
|
+
${template`
|
|
54
|
+
<div style="${childStyle()}" class="${`rfm-child`}">
|
|
55
|
+
${children}
|
|
56
|
+
</div>
|
|
57
|
+
`}
|
|
75
58
|
</div>
|
|
76
59
|
</div>
|
|
77
|
-
|
|
60
|
+
<div
|
|
78
61
|
class="rfm-marquee placeholder-marquee"
|
|
79
62
|
style="${marqueeStyle()}"
|
|
80
|
-
>
|
|
81
|
-
|
|
82
|
-
</div>
|
|
63
|
+
></div>
|
|
83
64
|
</div>
|
|
84
65
|
`;
|
|
85
66
|
};
|
|
@@ -5,6 +5,7 @@ import { getStaticLocale, getSettingPreloadData } from '../../helpers.js';
|
|
|
5
5
|
const PRODUCT_ID_LATEST = 'latest';
|
|
6
6
|
const PREFIX_PRODUCT_ID = 'gid://shopify/Product/';
|
|
7
7
|
const PREFIX_PRODUCT_VARIANT_ID = 'gid://shopify/ProductVariant/';
|
|
8
|
+
const PREFIX_PRODUCT_OPTION_VALUE_ID = 'gid://shopify/ProductOptionValue/';
|
|
8
9
|
const STATIC_PRODUCT_STATUS = 'static';
|
|
9
10
|
const DYNAMIC_PRODUCT_STATUS = 'dynamic';
|
|
10
11
|
const Product = ({ children, setting, styles, style, builderProps, rawChildren, advanced })=>{
|
|
@@ -20,8 +21,8 @@ const Product = ({ children, setting, styles, style, builderProps, rawChildren,
|
|
|
20
21
|
const formatProductId = productSetting?.productId?.replace(PREFIX_PRODUCT_ID, '').toLowerCase() || PRODUCT_ID_LATEST;
|
|
21
22
|
const formatVariantId = initVariantId?.replace(PREFIX_PRODUCT_VARIANT_ID, '') || '';
|
|
22
23
|
const productStatus = productSetting?.productStatus ?? STATIC_PRODUCT_STATUS;
|
|
24
|
+
const preSelectedOptionIds = productSetting?.selectedOptions?.map((option)=>option?.valueBaseID?.replace(PREFIX_PRODUCT_OPTION_VALUE_ID, ''));
|
|
23
25
|
return template /* liquid */ `
|
|
24
|
-
|
|
25
26
|
{%- assign gpBkProduct = product -%}
|
|
26
27
|
${productStatus !== DYNAMIC_PRODUCT_STATUS ? `
|
|
27
28
|
{%- liquid
|
|
@@ -96,7 +97,7 @@ const Product = ({ children, setting, styles, style, builderProps, rawChildren,
|
|
|
96
97
|
{%- endif -%}
|
|
97
98
|
<gp-product data-uid="${builderProps?.uid}" data-id="${builderProps?.uid}" style="${{
|
|
98
99
|
...advancedStyle
|
|
99
|
-
}}" class="${advanced?.cssClass}" gp-context='{"productId": {{ product.id }}, "isSyncProduct": "${isSyncProduct}", "variantSelected": {{ variant | json | escape }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
|
|
100
|
+
}}" class="${advanced?.cssClass}" gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${preSelectedOptionIds}], "isSyncProduct": "${isSyncProduct}", "variantSelected": {{ variant | json | escape }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
|
|
100
101
|
gp-data='{"variantSelected": {{ variant | json | escape }}, "quantity": 1, "productUrl":{{ product.url | json | escape }}, "productHandle":{{ product.handle | json | escape }}, "collectionUrl": {{ collection.url | json | escape }}, "collectionHandle": {{ collection.handle | json | escape }}}'>
|
|
101
102
|
<product-form class="product-form">
|
|
102
103
|
{%- form 'product', product, id: product_form_id, class: 'form contents', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
|
|
@@ -6,11 +6,12 @@ import { getAlignShape, getSize, getShapeBorderStyle, getFilterDropShadow, conve
|
|
|
6
6
|
import { getShapePosition } from './utils/getShapePosition.js';
|
|
7
7
|
import { composeShapeStyleByPosition, composeTextStyleByPosition } from './utils/getRotateShape.js';
|
|
8
8
|
import { getStyleAdvanced } from './utils/getStyleAdvanced.js';
|
|
9
|
-
import { getSettingPreloadData } from '../../../helpers.js';
|
|
9
|
+
import { getDynamicSourceLocales, getSettingPreloadData } from '../../../helpers.js';
|
|
10
10
|
import { renderBadgeInFirstTime } from './utils/renderBadgeLiquid.js';
|
|
11
11
|
import { getWhiteSpaceStyle } from './utils/getWhiteSpace.js';
|
|
12
12
|
|
|
13
|
-
const ProductBadge = ({ styles, builderProps, isInsideProductImage, builderAttrs, setting, style, imageData, dotData })=>{
|
|
13
|
+
const ProductBadge = ({ styles, builderProps, isInsideProductImage, builderAttrs, setting, style, imageData, dotData, pageContext })=>{
|
|
14
|
+
const { displayContent, translate } = setting ?? {};
|
|
14
15
|
const isTextBadge = setting?.contentType === 'text';
|
|
15
16
|
const shape = getShape(setting?.shape);
|
|
16
17
|
const shapeAlignClass = getAlignShape(styles?.align, isInsideProductImage);
|
|
@@ -30,17 +31,25 @@ const ProductBadge = ({ styles, builderProps, isInsideProductImage, builderAttrs
|
|
|
30
31
|
const paddingShape = getShapeWrapperPadding(shape?.ratio);
|
|
31
32
|
const composeGlobalSize = makeGlobalSize(badgeSize);
|
|
32
33
|
const isDropOutsideProductImage = setting?.positionWithImage === 'outside';
|
|
33
|
-
const isDiscountContent = checkDiscountContentProductBadge(
|
|
34
|
+
const isDiscountContent = checkDiscountContentProductBadge(displayContent);
|
|
35
|
+
const displayContentVal = getDynamicSourceLocales({
|
|
36
|
+
val: displayContent?.trim(),
|
|
37
|
+
uid: builderProps?.uid,
|
|
38
|
+
settingId: 'displayContent',
|
|
39
|
+
isLiquid: true,
|
|
40
|
+
pageContext,
|
|
41
|
+
translate
|
|
42
|
+
});
|
|
34
43
|
return template`
|
|
35
44
|
{% if product %}
|
|
36
|
-
${generateBadgeContent(
|
|
45
|
+
${generateBadgeContent(displayContent, pageContext.isPreviewing)}
|
|
37
46
|
${renderBadgeInFirstTime(setting?.displayTrigger, isDiscountContent, isTextBadge)}
|
|
38
47
|
<gp-product-badge
|
|
39
48
|
data-id="${builderProps?.uid}"
|
|
40
49
|
class="gp-product-badge !gp-max-w-none gp-shrink-0 ${builderProps?.uid} ${builderProps?.builderData?.advanced?.cssClass || ''} {{className}}"
|
|
41
50
|
id="g-product-badge-${builderProps?.uid}"
|
|
42
51
|
gp-data='${dataStringify({
|
|
43
|
-
displayContent:
|
|
52
|
+
displayContent: `${pageContext?.isPreviewing ? displayContentVal : `{{${displayContentVal}}}`}`,
|
|
44
53
|
minPrice: '{{ minPriceValue }}',
|
|
45
54
|
variantIDs: '{{ product.variants | map: "id" | json | escape }}',
|
|
46
55
|
variantInventoryQuantities: '{{ product.variants | map: "inventory_quantity" | json | escape }}',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const generateBadgeContent = (content)=>{
|
|
1
|
+
const generateBadgeContent = (content, isPreviewing)=>{
|
|
2
2
|
return `
|
|
3
|
-
{% assign content =
|
|
3
|
+
{% assign content = ${isPreviewing ? JSON.stringify(content) : content} %}
|
|
4
4
|
|
|
5
5
|
{%if content.size > 0 %}
|
|
6
6
|
{% if variant.compare_at_price and variant.compare_at_price > 0 %}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { composeTypographyClassName, composeTypographyStyle, getStyleShadow, makeStyleResponsive, getGlobalColorStyle, makeStyle, makeLineClamp, template, cls, getGlobalColorClass, RenderIf, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
|
|
2
|
-
import { getSettingPreloadData } from '../../helpers.js';
|
|
2
|
+
import { getDynamicSourceLocales, getSettingPreloadData } from '../../helpers.js';
|
|
3
3
|
|
|
4
4
|
const devices = [
|
|
5
5
|
'desktop',
|
|
@@ -16,8 +16,8 @@ const getDisplayStyle = (fnCondition, defaultValue)=>{
|
|
|
16
16
|
});
|
|
17
17
|
return result;
|
|
18
18
|
};
|
|
19
|
-
const ProductDescription = ({ setting, advanced, builderProps })=>{
|
|
20
|
-
const { htmlTag } = setting ?? {};
|
|
19
|
+
const ProductDescription = ({ setting, advanced, builderProps, pageContext })=>{
|
|
20
|
+
const { htmlTag, translate, viewMoreText, viewLessText } = setting ?? {};
|
|
21
21
|
const appendTypoClass = composeTypographyClassName(setting?.typo, setting?.typography);
|
|
22
22
|
const appendTypoStyle = composeTypographyStyle(setting?.typo, setting?.typography);
|
|
23
23
|
const defaultStyle = {
|
|
@@ -41,13 +41,29 @@ const ProductDescription = ({ setting, advanced, builderProps })=>{
|
|
|
41
41
|
return getDisplayStyle((device)=>!!setting?.hasLineClamp && setting.hasLineClamp[device] !== undefined && !setting.hasLineClamp[device], 'block');
|
|
42
42
|
};
|
|
43
43
|
const Tag = htmlTag === 'html' ? 'div' : 'p';
|
|
44
|
+
const viewMoreTextDisplay = getDynamicSourceLocales({
|
|
45
|
+
val: viewMoreText,
|
|
46
|
+
uid: builderProps?.uid,
|
|
47
|
+
settingId: 'viewMoreText',
|
|
48
|
+
isLiquid: true,
|
|
49
|
+
pageContext,
|
|
50
|
+
translate
|
|
51
|
+
});
|
|
52
|
+
const viewLessTextDisplay = getDynamicSourceLocales({
|
|
53
|
+
val: viewLessText,
|
|
54
|
+
uid: builderProps?.uid,
|
|
55
|
+
settingId: 'viewLessText',
|
|
56
|
+
isLiquid: true,
|
|
57
|
+
pageContext,
|
|
58
|
+
translate
|
|
59
|
+
});
|
|
44
60
|
return template`
|
|
45
61
|
<gp-product-description data-id="${builderProps?.uid}" class="${advanced?.cssClass} gp-product-description" gp-data='${JSON.stringify({
|
|
46
62
|
setting: {
|
|
47
63
|
lineClamp: setting?.lineClamp,
|
|
48
64
|
hasLineClamp: setting?.hasLineClamp,
|
|
49
|
-
viewMoreText:
|
|
50
|
-
viewLessText:
|
|
65
|
+
viewMoreText: pageContext?.isPreviewing ? viewMoreTextDisplay : `{{${viewMoreTextDisplay}}}`,
|
|
66
|
+
viewLessText: pageContext?.isPreviewing ? viewLessTextDisplay : `{{${viewLessTextDisplay}}}`,
|
|
51
67
|
enableViewMoreIcon: setting?.enableViewMoreIcon
|
|
52
68
|
},
|
|
53
69
|
defaultStyle,
|
|
@@ -81,7 +97,7 @@ const ProductDescription = ({ setting, advanced, builderProps })=>{
|
|
|
81
97
|
}}"
|
|
82
98
|
>
|
|
83
99
|
|
|
84
|
-
${
|
|
100
|
+
${pageContext?.isPreviewing ? viewMoreTextDisplay : `{{${viewMoreTextDisplay}}}`}
|
|
85
101
|
${setting?.enableViewMoreIcon ? `<svg
|
|
86
102
|
class="gp-ml-1 gp-inline-block"
|
|
87
103
|
style="display: inline-block; margin-left: 1px;"
|
|
@@ -38,7 +38,6 @@ const ProductImagesV2 = (productImageProps)=>{
|
|
|
38
38
|
const extraClass = advanced?.cssClass;
|
|
39
39
|
// State
|
|
40
40
|
const [openLightBox, setOpenLightBox] = useState(false);
|
|
41
|
-
const [hasVariantAvailable, setHasVariantAvailable] = useState(true);
|
|
42
41
|
const getFirstVideo = (product)=>{
|
|
43
42
|
return product?.medias?.edges.find((item)=>[
|
|
44
43
|
'VIDEO',
|
|
@@ -53,24 +52,19 @@ const ProductImagesV2 = (productImageProps)=>{
|
|
|
53
52
|
};
|
|
54
53
|
const priorityFeatureImage = useMemo(()=>{
|
|
55
54
|
if (setting?.typeDisplay === 'all-images') {
|
|
56
|
-
setHasVariantAvailable(true);
|
|
57
55
|
let priorityItem;
|
|
58
56
|
switch(setting?.preDisplay){
|
|
59
57
|
case '1st-images':
|
|
60
58
|
priorityItem = getFirstImage(product);
|
|
61
|
-
setHasVariantAvailable(false);
|
|
62
59
|
break;
|
|
63
60
|
case '1st-3d-mode':
|
|
64
61
|
priorityItem = getFirst3DModal(product);
|
|
65
|
-
setHasVariantAvailable(false);
|
|
66
62
|
break;
|
|
67
63
|
case '1st-video':
|
|
68
64
|
priorityItem = getFirstVideo(product);
|
|
69
|
-
setHasVariantAvailable(false);
|
|
70
65
|
break;
|
|
71
66
|
case '1st-available-variant':
|
|
72
67
|
priorityItem = currentVariant?.media;
|
|
73
|
-
setHasVariantAvailable(false);
|
|
74
68
|
break;
|
|
75
69
|
}
|
|
76
70
|
setProductFeaturedImage(priorityItem);
|
|
@@ -137,7 +131,7 @@ const ProductImagesV2 = (productImageProps)=>{
|
|
|
137
131
|
}
|
|
138
132
|
};
|
|
139
133
|
useEffect(()=>{
|
|
140
|
-
if (currentVariant
|
|
134
|
+
if (currentVariant) {
|
|
141
135
|
const index = galleryIndex[currentVariant?.mediaId];
|
|
142
136
|
if (index !== undefined) {
|
|
143
137
|
const fImage = gallery[index] ?? product?.featuredImage;
|
|
@@ -151,8 +145,7 @@ const ProductImagesV2 = (productImageProps)=>{
|
|
|
151
145
|
galleryIndex,
|
|
152
146
|
gallery,
|
|
153
147
|
product?.featuredImage,
|
|
154
|
-
setProductFeaturedImage
|
|
155
|
-
hasVariantAvailable
|
|
148
|
+
setProductFeaturedImage
|
|
156
149
|
]);
|
|
157
150
|
const isRenderLightBox = useMemo(()=>{
|
|
158
151
|
const isRender = getResponsiveValueByScreen(setting?.ftClickOpenLightBox, currentDevice) === 'popup' || getResponsiveValueByScreen(setting?.clickOpenLightBox, currentDevice);
|
package/dist/esm/product/components/ProductImagesV2/jsx/components/ProductFeaturedImageCarousel.js
CHANGED
|
@@ -6,7 +6,7 @@ import { getAspectRatio } from '../../common/common.js';
|
|
|
6
6
|
import { checkRenderFeaturedCarousel, getDotSettingByLayout } from '../../common/productFeaturedImage.js';
|
|
7
7
|
import { handleMouseMove, handleMouseOut } from '../../common/hoverAction.js';
|
|
8
8
|
import ProductFeaturedImageOnly from './ProductFeaturedImageOnly.js';
|
|
9
|
-
import { memo,
|
|
9
|
+
import { memo, useCallback, useState, useEffect, useMemo, createRef } from 'react';
|
|
10
10
|
import { handleSetSrcForFeatureProductImage } from '../../../../../image/helpers/getSrcSet.js';
|
|
11
11
|
|
|
12
12
|
const ProductFeaturedImageCarousel = ({ productImages, imgRef, onHandleClick, onClickArrow, onHandleLoaded, onHandleUpdateActiveIndex, builderPropUID, builderPropsClass, children, parentUid, ...setting })=>{
|
|
@@ -16,12 +16,20 @@ const ProductFeaturedImageCarousel = ({ productImages, imgRef, onHandleClick, on
|
|
|
16
16
|
const { onListener, ref } = useInteraction();
|
|
17
17
|
let delayTimeout;
|
|
18
18
|
const mode = useEditorMode();
|
|
19
|
-
const
|
|
19
|
+
const getImageActiveIndex = useCallback(()=>{
|
|
20
20
|
const index = productImages?.findIndex((item)=>item.id === featuredImageGlobal?.id);
|
|
21
|
-
return index;
|
|
21
|
+
return index ?? 0;
|
|
22
22
|
}, [
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
featuredImageGlobal?.id,
|
|
24
|
+
productImages
|
|
25
|
+
]);
|
|
26
|
+
const [imageActiveIndex, setImageActiveIndex] = useState(getImageActiveIndex());
|
|
27
|
+
useEffect(()=>{
|
|
28
|
+
setImageActiveIndex(getImageActiveIndex());
|
|
29
|
+
}, [
|
|
30
|
+
featuredImageGlobal,
|
|
31
|
+
getImageActiveIndex,
|
|
32
|
+
productImages
|
|
25
33
|
]);
|
|
26
34
|
const imageActive = useMemo(()=>{
|
|
27
35
|
if (productImages?.length) return featuredImageGlobal || productImages?.[0];
|