@gem-sdk/components 2.0.0-dev.699 → 2.0.0-dev.701
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/banner/components/HeroBanner.js +2 -2
- package/dist/cjs/banner/components/HeroBanner.liquid.js +3 -2
- package/dist/cjs/banner/components/HeroBannerItem.js +3 -3
- package/dist/cjs/banner/components/HeroBannerItem.liquid.js +3 -3
- package/dist/cjs/button/components/Button.js +4 -1
- package/dist/cjs/carousel/carousel-item/common/getClass.js +1 -1
- package/dist/cjs/grid/row/commons/getClass.js +1 -1
- package/dist/cjs/grid/row/commons/getStyle.js +2 -1
- package/dist/cjs/grid/row/setting/configs/settings.js +21 -0
- package/dist/cjs/grid/row/setting/configs/uiV2.js +10 -4
- package/dist/cjs/helpers.js +31 -1
- package/dist/cjs/icon-list-v2/components/IconList.liquid.js +1 -0
- package/dist/cjs/image/components/AdaptiveImage.js +4 -4
- package/dist/cjs/image/components/Image.js +1 -1
- package/dist/cjs/image/components/Image.liquid.js +3 -2
- package/dist/cjs/image/components/common/classes.js +3 -1
- package/dist/cjs/image/helpers/getSrcSet.js +2 -1
- package/dist/cjs/image/setting/configs/settings.js +9 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/post-purchase/product/components/product-offer/common/classes.js +5 -1
- package/dist/cjs/product/components/ProductBundle/common/styles.js +2 -2
- package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.js +1 -1
- package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.liquid.js +1 -1
- package/dist/cjs/product/components/ProductBundle/setting/ProductBundleDiscount.js +2 -8
- package/dist/cjs/product/components/ProductImagesV2/common/common.js +1 -1
- package/dist/cjs/product/components/ProductImagesV2/index.liquid.js +6 -3
- package/dist/cjs/product/components/ProductVariants/index.liquid.js +8 -3
- package/dist/cjs/product/setting/constant/bundle-layout/horizontalThree.js +4 -6
- package/dist/cjs/product/setting/constant/bundle-layout/horizontalTwo.js +3 -5
- package/dist/cjs/product/setting/constant/bundle-layout/verticalThree.js +2 -1
- package/dist/cjs/product/setting/constant/bundle-layout/verticalTwo.js +2 -1
- package/dist/cjs/stock-counter/components/common/getContent.js +1 -1
- package/dist/cjs/text/components/Text.liquid.js +1 -0
- package/dist/cjs/text/components/common/getDisplayText.js +11 -20
- package/dist/cjs/third-party/components/EcomsendBackInStockAlert.liquid.js +8 -8
- package/dist/cjs/third-party/components/ProductOptionsVariantOption.js +2 -2
- package/dist/cjs/third-party/components/ProductOptionsVariantOption.liquid.js +2 -2
- package/dist/cjs/third-party/components/UnlimitedBundlesDiscounts.liquid.js +1 -1
- package/dist/cjs/third-party/configs/EcoboostifyShoppableReelUgc.js +1 -1
- package/dist/cjs/third-party/configs/NotifyBackInStockPreOrder.js +1 -1
- package/dist/cjs/third-party/setting/EcoboostifyShoppableReelUgc/index.js +2 -2
- package/dist/cjs/third-party/setting/EcomsendBackInStockAlert/index.js +5 -0
- package/dist/cjs/third-party/setting/EcomsendBackInStockAlert/uiV1.js +14 -0
- package/dist/cjs/third-party/setting/EcomsendBackInStockAlert/uiV2.js +31 -0
- package/dist/cjs/third-party/setting/FlyBundlesUpsellsFbt/uiV1.js +5 -0
- package/dist/cjs/third-party/setting/NotifyBackInStockPreOrder/index.js +2 -2
- package/dist/cjs/third-party/setting/ProductOptionsVariantOption/index.js +1 -7
- package/dist/cjs/third-party/setting/ProductOptionsVariantOption/uiV1.js +0 -9
- package/dist/cjs/third-party/setting/ProductOptionsVariantOption/uiV2.js +0 -30
- package/dist/cjs/third-party/setting/RequestQuoteHidePrice/index.js +2 -1
- package/dist/cjs/third-party/setting/UnlimitedBundlesDiscounts/index.js +5 -1
- package/dist/cjs/third-party/setting/UnlimitedBundlesDiscounts/uiV1.js +9 -0
- package/dist/cjs/third-party/setting/UnlimitedBundlesDiscounts/uiV2.js +12 -0
- package/dist/esm/banner/components/HeroBanner.js +2 -2
- package/dist/esm/banner/components/HeroBanner.liquid.js +3 -2
- package/dist/esm/banner/components/HeroBannerItem.js +3 -3
- package/dist/esm/banner/components/HeroBannerItem.liquid.js +3 -3
- package/dist/esm/button/components/Button.js +4 -1
- package/dist/esm/carousel/carousel-item/common/getClass.js +1 -1
- package/dist/esm/grid/row/commons/getClass.js +1 -1
- package/dist/esm/grid/row/commons/getStyle.js +2 -1
- package/dist/esm/grid/row/setting/configs/settings.js +21 -0
- package/dist/esm/grid/row/setting/configs/uiV2.js +10 -4
- package/dist/esm/helpers.js +30 -2
- package/dist/esm/icon-list-v2/components/IconList.liquid.js +1 -0
- package/dist/esm/image/components/AdaptiveImage.js +4 -4
- package/dist/esm/image/components/Image.js +1 -1
- package/dist/esm/image/components/Image.liquid.js +3 -2
- package/dist/esm/image/components/common/classes.js +4 -2
- package/dist/esm/image/helpers/getSrcSet.js +2 -1
- package/dist/esm/image/setting/configs/settings.js +9 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/post-purchase/product/components/product-offer/common/classes.js +5 -1
- package/dist/esm/product/components/ProductBundle/common/styles.js +2 -2
- package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.js +1 -1
- package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.liquid.js +1 -1
- package/dist/esm/product/components/ProductBundle/setting/ProductBundleDiscount.js +2 -8
- package/dist/esm/product/components/ProductImagesV2/common/common.js +1 -1
- package/dist/esm/product/components/ProductImagesV2/index.liquid.js +6 -3
- package/dist/esm/product/components/ProductVariants/index.liquid.js +8 -3
- package/dist/esm/product/setting/constant/bundle-layout/horizontalThree.js +4 -6
- package/dist/esm/product/setting/constant/bundle-layout/horizontalTwo.js +3 -5
- package/dist/esm/product/setting/constant/bundle-layout/verticalThree.js +2 -1
- package/dist/esm/product/setting/constant/bundle-layout/verticalTwo.js +2 -1
- package/dist/esm/stock-counter/components/common/getContent.js +1 -1
- package/dist/esm/text/components/Text.liquid.js +1 -0
- package/dist/esm/text/components/common/getDisplayText.js +12 -21
- package/dist/esm/third-party/components/EcomsendBackInStockAlert.liquid.js +8 -8
- package/dist/esm/third-party/components/ProductOptionsVariantOption.js +2 -2
- package/dist/esm/third-party/components/ProductOptionsVariantOption.liquid.js +2 -2
- package/dist/esm/third-party/components/UnlimitedBundlesDiscounts.liquid.js +1 -1
- package/dist/esm/third-party/configs/EcoboostifyShoppableReelUgc.js +1 -1
- package/dist/esm/third-party/configs/NotifyBackInStockPreOrder.js +1 -1
- package/dist/esm/third-party/setting/EcoboostifyShoppableReelUgc/index.js +2 -2
- package/dist/esm/third-party/setting/EcomsendBackInStockAlert/index.js +5 -0
- package/dist/esm/third-party/setting/EcomsendBackInStockAlert/uiV1.js +14 -0
- package/dist/esm/third-party/setting/EcomsendBackInStockAlert/uiV2.js +31 -0
- package/dist/esm/third-party/setting/FlyBundlesUpsellsFbt/uiV1.js +5 -0
- package/dist/esm/third-party/setting/NotifyBackInStockPreOrder/index.js +2 -2
- package/dist/esm/third-party/setting/ProductOptionsVariantOption/index.js +1 -7
- package/dist/esm/third-party/setting/ProductOptionsVariantOption/uiV1.js +0 -9
- package/dist/esm/third-party/setting/ProductOptionsVariantOption/uiV2.js +0 -30
- package/dist/esm/third-party/setting/RequestQuoteHidePrice/index.js +2 -1
- package/dist/esm/third-party/setting/UnlimitedBundlesDiscounts/index.js +5 -1
- package/dist/esm/third-party/setting/UnlimitedBundlesDiscounts/uiV1.js +9 -0
- package/dist/esm/third-party/setting/UnlimitedBundlesDiscounts/uiV2.js +12 -0
- package/dist/types/index.d.ts +8 -3
- package/package.json +2 -2
|
@@ -106,8 +106,15 @@ const SettingUIV2 = [
|
|
|
106
106
|
en: 'Width',
|
|
107
107
|
es: 'Ancho',
|
|
108
108
|
cn: '宽度'
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
setting: {
|
|
113
|
+
id: 'height'
|
|
109
114
|
},
|
|
110
|
-
|
|
115
|
+
label: {
|
|
116
|
+
en: 'Height'
|
|
117
|
+
}
|
|
111
118
|
},
|
|
112
119
|
{
|
|
113
120
|
label: {
|
|
@@ -258,7 +265,6 @@ const SettingUIV2 = [
|
|
|
258
265
|
label: {
|
|
259
266
|
en: 'Align column'
|
|
260
267
|
},
|
|
261
|
-
conditionDisplay: `pageType != "POST_PURCHASE" && (layout.display !== 'fill' || (!!layout.cols && layout.cols.length > 1))`,
|
|
262
268
|
controls: [
|
|
263
269
|
{
|
|
264
270
|
id: 'verticalAlign',
|
|
@@ -268,7 +274,7 @@ const SettingUIV2 = [
|
|
|
268
274
|
setting: {
|
|
269
275
|
id: 'verticalAlign'
|
|
270
276
|
},
|
|
271
|
-
conditionDisplay:
|
|
277
|
+
conditionDisplay: `((!!layout.cols && layout.cols.length > 1) || (!!layout.cols && layout.cols.length == 1 && height == '100%')) && pageType != "POST_PURCHASE"`
|
|
272
278
|
},
|
|
273
279
|
{
|
|
274
280
|
id: 'horizontalAlign',
|
|
@@ -278,7 +284,7 @@ const SettingUIV2 = [
|
|
|
278
284
|
setting: {
|
|
279
285
|
id: 'horizontalAlign'
|
|
280
286
|
},
|
|
281
|
-
conditionDisplay: `layout.display !== 'fill'`,
|
|
287
|
+
conditionDisplay: `layout.display !== 'fill' && pageType != "POST_PURCHASE"`,
|
|
282
288
|
options: {
|
|
283
289
|
disableMessage: `Horizontal Align is available when layout is "Fit to content"`
|
|
284
290
|
}
|
package/dist/esm/helpers.js
CHANGED
|
@@ -64,6 +64,10 @@ const getStaticLocale = (tag, key)=>{
|
|
|
64
64
|
const getSettingPreloadData = (disabledValue, enabledValue)=>{
|
|
65
65
|
return `{% if section.settings.section_preload == "false" %}${disabledValue} ${enabledValue ? `{% else %}${enabledValue}` : ''}{% endif %}`;
|
|
66
66
|
};
|
|
67
|
+
const getHttpUrl = (link)=>{
|
|
68
|
+
if (!link) return '';
|
|
69
|
+
return link.match(/^https?:\/\//i) ? link : `http://${link}`;
|
|
70
|
+
};
|
|
67
71
|
const getInsertLinkData = (defaultWrap, setting, htmlType)=>{
|
|
68
72
|
const URL_START_WITH = [
|
|
69
73
|
'#',
|
|
@@ -76,7 +80,7 @@ const getInsertLinkData = (defaultWrap, setting, htmlType)=>{
|
|
|
76
80
|
const isHyperlink = setting?.link !== undefined && setting.link !== '';
|
|
77
81
|
let urlHref = setting?.link ?? '';
|
|
78
82
|
const isHomePageHref = urlHref === '/';
|
|
79
|
-
const regexHttp = new RegExp(/^https
|
|
83
|
+
const regexHttp = new RegExp(/^(?:https?:\/\/)?[\w.-]+\.[a-z]{2,}/i);
|
|
80
84
|
const regexPageType = new RegExp(/^\/?(?:collections|pages|products|blogs|checkout|cart)\/?/i);
|
|
81
85
|
const isShopifyDomain = isHyperlink && !regexHttp.test(urlHref) && regexPageType.test(urlHref);
|
|
82
86
|
const isDomain = isHyperlink && regexHttp.test(urlHref);
|
|
@@ -87,6 +91,7 @@ const getInsertLinkData = (defaultWrap, setting, htmlType)=>{
|
|
|
87
91
|
urlHref = "{{ request.origin }}{{ routes.root_url | split: '/' | join: '/' }}" + urlHref;
|
|
88
92
|
}
|
|
89
93
|
}
|
|
94
|
+
if (isDomain) urlHref = getHttpUrl(urlHref);
|
|
90
95
|
const isLink = ()=>{
|
|
91
96
|
if (URL_START_WITH.find((el)=>urlHref.startsWith(el))) return true;
|
|
92
97
|
if (URL_INCLUDES.find((el)=>urlHref.includes(el))) return true;
|
|
@@ -212,5 +217,28 @@ const convertUnitToNumber = (value, defaultValue)=>{
|
|
|
212
217
|
const data = typeof value === 'string' ? value.replaceAll('px', '').replaceAll('%', '').replaceAll('rem', '').replaceAll('em', '') : defaultValue;
|
|
213
218
|
return !isNaN(Number(data)) ? Number(data) : defaultValue;
|
|
214
219
|
};
|
|
220
|
+
const getAllHrefFromString = (htmlString)=>{
|
|
221
|
+
if (!htmlString) return [];
|
|
222
|
+
const regex = /href="([^"]*)"/g;
|
|
223
|
+
const hrefs = [];
|
|
224
|
+
let match;
|
|
225
|
+
while((match = regex.exec(htmlString)) !== null){
|
|
226
|
+
match[1] && hrefs.push(match[1]);
|
|
227
|
+
}
|
|
228
|
+
return hrefs;
|
|
229
|
+
};
|
|
230
|
+
const replaceAllHrefFromString = (htmlString, hrefs)=>{
|
|
231
|
+
if (!htmlString) return '';
|
|
232
|
+
const regex = /href="([^"]*)"/g;
|
|
233
|
+
let match;
|
|
234
|
+
let i = 0;
|
|
235
|
+
while((match = regex.exec(htmlString)) !== null){
|
|
236
|
+
if (match[1]) {
|
|
237
|
+
htmlString = htmlString.replace(match[1], hrefs[i] ?? '');
|
|
238
|
+
i++;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return htmlString;
|
|
242
|
+
};
|
|
215
243
|
|
|
216
|
-
export { convertUnitToNumber, filterTruthyObject, filterTruthyStyles, getDisplayStyle, getDynamicSourceLocales, getInsertLinkData, getLinkArticle, getLinkData, getSettingPreloadData, getStaticLocale, isHexTransparent, isLinkedToSalesPage, isTransparentColor, isTransparentRGBA, replaceLinkData, youtubeShortsRegex };
|
|
244
|
+
export { convertUnitToNumber, filterTruthyObject, filterTruthyStyles, getAllHrefFromString, getDisplayStyle, getDynamicSourceLocales, getInsertLinkData, getLinkArticle, getLinkData, getSettingPreloadData, getStaticLocale, isHexTransparent, isLinkedToSalesPage, isTransparentColor, isTransparentRGBA, replaceAllHrefFromString, replaceLinkData, youtubeShortsRegex };
|
|
@@ -7,7 +7,7 @@ import { getAdaptiveImageData } from './common/data.js';
|
|
|
7
7
|
import { getAdaptivePictureStyles, getAdaptiveImageStyles } from './common/styles.js';
|
|
8
8
|
|
|
9
9
|
const AdaptiveImage = (props)=>{
|
|
10
|
-
const { alt, style, srcSet, layout, priority, className, aspectRatio, borderRadius, pictureClass,
|
|
10
|
+
const { alt, style, srcSet, layout, priority, className, aspectRatio, borderRadius, pictureClass, enableLazyLoadImage, ...restProps } = props;
|
|
11
11
|
const { getDeviceSource } = getAdaptiveImageData(props);
|
|
12
12
|
const { srcTablet, srcMobile } = getDeviceSource();
|
|
13
13
|
const loadingAttrs = createAttr({
|
|
@@ -28,7 +28,7 @@ const AdaptiveImage = (props)=>{
|
|
|
28
28
|
const adaptiveImageClasses = createClass({
|
|
29
29
|
...getAdaptiveImageClasses({
|
|
30
30
|
className,
|
|
31
|
-
hasLazyLoad:
|
|
31
|
+
hasLazyLoad: enableLazyLoadImage
|
|
32
32
|
})
|
|
33
33
|
});
|
|
34
34
|
const renderSource = ()=>{
|
|
@@ -36,11 +36,11 @@ const AdaptiveImage = (props)=>{
|
|
|
36
36
|
children: [
|
|
37
37
|
srcMobile && /*#__PURE__*/ jsx("source", {
|
|
38
38
|
media: "(max-width: 767px)",
|
|
39
|
-
srcSet:
|
|
39
|
+
srcSet: enableLazyLoadImage ? IMAGE_PLACEHOLDER : srcMobile
|
|
40
40
|
}),
|
|
41
41
|
srcTablet && /*#__PURE__*/ jsx("source", {
|
|
42
42
|
media: "(max-width: 1024px)",
|
|
43
|
-
srcSet:
|
|
43
|
+
srcSet: enableLazyLoadImage ? IMAGE_PLACEHOLDER : srcTablet
|
|
44
44
|
})
|
|
45
45
|
]
|
|
46
46
|
});
|
|
@@ -24,7 +24,7 @@ const Image = ({ style, styles, setting, children, advanced, className, builderA
|
|
|
24
24
|
const containerStyles = createStyle(getContainerStyles(style, styles));
|
|
25
25
|
const wrapperClasses = createClass(getWrapperClasses());
|
|
26
26
|
const imageClasses = createClass(getImageClasses(className, styles));
|
|
27
|
-
const containerClasses = createClass(getContainerClasses(builderProps?.uid, advanced?.cssClass));
|
|
27
|
+
const containerClasses = createClass(getContainerClasses(builderProps?.uid, advanced?.cssClass, styles?.shape));
|
|
28
28
|
const containerAttrs = createAttr(getContainerAttrs(builderAttrs, builderProps?.uid));
|
|
29
29
|
const linkWrapperAttrs = getLinkWrapperAttrs({
|
|
30
30
|
urlData,
|
|
@@ -7,8 +7,9 @@ import { getWrapperStyles, getImageStyles, getContainerStyles } from './common/s
|
|
|
7
7
|
import { getWrapperClasses, getImageClasses, getContainerClasses } from './common/classes.js';
|
|
8
8
|
import { getContainerAttrs, getAdaptiveImageAttrs, getNextImageAttrs, getLinkWrapperAttrs, getImageLiquidAttrs } from './common/attributes.js';
|
|
9
9
|
|
|
10
|
-
const Image = ({ style, styles, setting, advanced, className, pageContext, builderAttrs, builderProps
|
|
10
|
+
const Image = ({ style, styles, setting, advanced, className, pageContext, builderAttrs, builderProps })=>{
|
|
11
11
|
const { imageLink, isAdaptive, enableImageLink } = setting ?? {};
|
|
12
|
+
const { enableLazyLoadImage } = pageContext ?? {};
|
|
12
13
|
const { Wrapper: HTMLTag, urlData } = getLinkData({
|
|
13
14
|
defaultWrap: 'div',
|
|
14
15
|
setting: imageLink,
|
|
@@ -20,7 +21,7 @@ const Image = ({ style, styles, setting, advanced, className, pageContext, build
|
|
|
20
21
|
const containerStyles = createStyle(getContainerStyles(style, styles));
|
|
21
22
|
const wrapperClasses = createClass(getWrapperClasses());
|
|
22
23
|
const imageClasses = createClass(getImageClasses(className, styles));
|
|
23
|
-
const containerClasses = createClass(getContainerClasses(builderProps?.uid, advanced?.cssClass));
|
|
24
|
+
const containerClasses = createClass(getContainerClasses(builderProps?.uid, advanced?.cssClass, styles?.shape));
|
|
24
25
|
const containerAttrs = createAttr(getContainerAttrs(builderAttrs, builderProps?.uid));
|
|
25
26
|
const linkWrapperAttrs = getLinkWrapperAttrs({
|
|
26
27
|
urlData,
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { handleConvertClassColor } from '@gem-sdk/core';
|
|
1
|
+
import { getFlexGrowClassByShapeGlobalSize, handleConvertClassColor } from '@gem-sdk/core';
|
|
2
2
|
|
|
3
|
-
const getContainerClasses = (uid, cssClass)=>{
|
|
3
|
+
const getContainerClasses = (uid, cssClass, shape)=>{
|
|
4
|
+
const imageFlexGrowClass = getFlexGrowClassByShapeGlobalSize(shape);
|
|
4
5
|
return {
|
|
5
6
|
'gp-group/image gp-relative': true,
|
|
6
7
|
[`force-publish-${new Date().getTime()}`]: true,
|
|
8
|
+
...imageFlexGrowClass,
|
|
7
9
|
...uid && {
|
|
8
10
|
[uid]: true
|
|
9
11
|
},
|
|
@@ -28,7 +28,8 @@ const getSrcSetLiquid = (liquid, storage)=>{
|
|
|
28
28
|
return `{{ '${liquid}' | asset_img_url: '768x' }} 768w, {{ '${liquid}' | asset_img_url: '1024x' }} 1024w, {{ '${liquid}' | asset_img_url: 'master' }} 1440w`;
|
|
29
29
|
};
|
|
30
30
|
const getSrcSetLink = (link)=>{
|
|
31
|
-
return
|
|
31
|
+
return link;
|
|
32
|
+
// return `${link} 768w,${link} 1024w,${link} 1440w`; // Since image src didn't change in size so this line of code is pointless
|
|
32
33
|
};
|
|
33
34
|
const getImageSrc = (image, currentDevice, isNotLiquid)=>{
|
|
34
35
|
if (image?.metafieldDefinitionKey) {
|
package/dist/esm/index.js
CHANGED
|
@@ -64,7 +64,7 @@ import 'react/jsx-runtime';
|
|
|
64
64
|
import 'react';
|
|
65
65
|
import '@gem-sdk/core';
|
|
66
66
|
export { ELEMENT_Z_INDEX } from './common/const.js';
|
|
67
|
-
export { convertUnitToNumber, filterTruthyObject, filterTruthyStyles, getDisplayStyle, getDynamicSourceLocales, getInsertLinkData, getLinkArticle, getLinkData, getSettingPreloadData, getStaticLocale, isHexTransparent, isLinkedToSalesPage, isTransparentColor, isTransparentRGBA, replaceLinkData, youtubeShortsRegex } from './helpers.js';
|
|
67
|
+
export { convertUnitToNumber, filterTruthyObject, filterTruthyStyles, getAllHrefFromString, getDisplayStyle, getDynamicSourceLocales, getInsertLinkData, getLinkArticle, getLinkData, getSettingPreloadData, getStaticLocale, isHexTransparent, isLinkedToSalesPage, isTransparentColor, isTransparentRGBA, replaceAllHrefFromString, replaceLinkData, youtubeShortsRegex } from './helpers.js';
|
|
68
68
|
export { default as Accordion } from './accordion/components/Accordion.js';
|
|
69
69
|
export { default as AccordionItem } from './accordion/components/AccordionItem.js';
|
|
70
70
|
export { default as ArticleList } from './article/components/ArticleList.js';
|
|
@@ -13,8 +13,12 @@ const getProductOfferWrapperClasses = ()=>{
|
|
|
13
13
|
const getProductOfferItemClasses = (index, setting, totalProduct)=>{
|
|
14
14
|
const { productOfferLayout } = setting ?? {};
|
|
15
15
|
let className = '';
|
|
16
|
-
DEVICES.
|
|
16
|
+
DEVICES.forEach((device)=>{
|
|
17
17
|
const key = device === 'desktop' ? '' : `${device}:`;
|
|
18
|
+
if (device === 'mobile') {
|
|
19
|
+
className += ` mobile:gp-col-span-2`;
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
18
22
|
if (productOfferLayout?.[device] === '1col' && index % 3 === 0 || (totalProduct || 0) <= 1) {
|
|
19
23
|
className += ` ${key}gp-col-span-2`;
|
|
20
24
|
}
|
|
@@ -59,11 +59,11 @@ const getSvgActiveStyles = (styles)=>{
|
|
|
59
59
|
})
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
|
-
const getSvgStyles = (
|
|
62
|
+
const getSvgStyles = (styles)=>{
|
|
63
63
|
return {
|
|
64
64
|
...getGlobalColorStateStyle('c', {
|
|
65
65
|
...styles?.iconColor,
|
|
66
|
-
normal:
|
|
66
|
+
normal: styles?.iconColor?.normal
|
|
67
67
|
})
|
|
68
68
|
};
|
|
69
69
|
};
|
package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.js
CHANGED
|
@@ -11,7 +11,7 @@ const ProductBundleDiscountChildrenItem = (props)=>{
|
|
|
11
11
|
const composeLayoutClasses = createClass(getLayoutClasses(setting));
|
|
12
12
|
const composeIconStyles = createStyle(getIconStyles(setting));
|
|
13
13
|
const composeSvgActiveStyles = createStyle(getSvgActiveStyles(styles));
|
|
14
|
-
const composeSvgStyles = createStyle(getSvgStyles(
|
|
14
|
+
const composeSvgStyles = createStyle(getSvgStyles(styles));
|
|
15
15
|
const composeIconSectionClasses = createClass(getIconSectionClasses);
|
|
16
16
|
const composeItemClasses = createClass(getItemClasses);
|
|
17
17
|
const composeFlexChildren = createClass(getFlexChildren);
|
|
@@ -9,7 +9,7 @@ const ProductBundleDiscountChildrenItemLiquid = (props)=>{
|
|
|
9
9
|
const composeLayoutClasses = createClass(getLayoutClasses(setting));
|
|
10
10
|
const composeIconStyles = createStyle(getIconStyles(setting));
|
|
11
11
|
const composeSvgActiveStyles = createStyle(getSvgActiveStyles(styles));
|
|
12
|
-
const composeSvgStyles = createStyle(getSvgStyles(
|
|
12
|
+
const composeSvgStyles = createStyle(getSvgStyles(styles));
|
|
13
13
|
const composeIconSectionClasses = createClass(getIconSectionClasses);
|
|
14
14
|
const composeItemClasses = createClass(getItemClasses);
|
|
15
15
|
const composeFlexChildren = createClass(getFlexChildren);
|
|
@@ -430,10 +430,7 @@ const config = {
|
|
|
430
430
|
childItem: [],
|
|
431
431
|
layout: 'vertical-layout'
|
|
432
432
|
},
|
|
433
|
-
childrens: []
|
|
434
|
-
advanced: {
|
|
435
|
-
of: 'hidden'
|
|
436
|
-
}
|
|
433
|
+
childrens: []
|
|
437
434
|
}
|
|
438
435
|
]
|
|
439
436
|
},
|
|
@@ -463,10 +460,7 @@ const config = {
|
|
|
463
460
|
layout: 'horizontal-layout',
|
|
464
461
|
enableIcon: false
|
|
465
462
|
},
|
|
466
|
-
childrens: []
|
|
467
|
-
advanced: {
|
|
468
|
-
of: 'hidden'
|
|
469
|
-
}
|
|
463
|
+
childrens: []
|
|
470
464
|
}
|
|
471
465
|
]
|
|
472
466
|
}
|
|
@@ -333,7 +333,7 @@ const getPaddingBottomByShapeSetting = (shapeSetting)=>{
|
|
|
333
333
|
};
|
|
334
334
|
return;
|
|
335
335
|
}
|
|
336
|
-
const value = aspectRatio?.[device] !== 'auto' && !!aspectRatio?.[device] ? aspectRatio?.[device]?.split('').reverse().join('') : '{%if media.height%} {{media.height}} / {{media.width}} {%else%} 100 / 100 {%endif%}';
|
|
336
|
+
const value = aspectRatio?.[device] !== 'auto' && !!aspectRatio?.[device] ? aspectRatio?.[device]?.split('/').reverse().join('') : '{%if media.height%} {{media.height}} / {{media.width}} {%else%} 100 / 100 {%endif%}';
|
|
337
337
|
result = {
|
|
338
338
|
...result,
|
|
339
339
|
[device]: `calc((${value})*100%)`
|
|
@@ -14,7 +14,8 @@ import { getStyleOfObject } from '../../helpers/function.js';
|
|
|
14
14
|
const ProductImages = (props)=>{
|
|
15
15
|
const productImageProps = setDefaultWhenUndefineSetting(props);
|
|
16
16
|
const { setting, styles, builderProps, style } = productImageProps;
|
|
17
|
-
const { rawChildren, pageContext
|
|
17
|
+
const { rawChildren, pageContext } = props;
|
|
18
|
+
const { enableLazyLoadImage } = pageContext ?? {};
|
|
18
19
|
const settings = {
|
|
19
20
|
...setting,
|
|
20
21
|
...styles
|
|
@@ -93,7 +94,8 @@ const ProductImages = (props)=>{
|
|
|
93
94
|
>
|
|
94
95
|
${ProductGalleryCarousel({
|
|
95
96
|
builderPropUID: `gp-gallery-${builderProps?.uid}`,
|
|
96
|
-
...settings
|
|
97
|
+
...settings,
|
|
98
|
+
enableLazyLoadImage
|
|
97
99
|
})}
|
|
98
100
|
</div>
|
|
99
101
|
${ProductGalleryGrid({
|
|
@@ -102,7 +104,8 @@ const ProductImages = (props)=>{
|
|
|
102
104
|
...styleInsideLayout
|
|
103
105
|
},
|
|
104
106
|
children: renderProductBadge(),
|
|
105
|
-
...settings
|
|
107
|
+
...settings,
|
|
108
|
+
enableLazyLoadImage
|
|
106
109
|
})}
|
|
107
110
|
`;
|
|
108
111
|
};
|
|
@@ -18,11 +18,16 @@ const DEVICES = [
|
|
|
18
18
|
'tablet',
|
|
19
19
|
'mobile'
|
|
20
20
|
];
|
|
21
|
+
const DEFAULT_ADVANCED_DISPLAY_SETTING = {
|
|
22
|
+
desktop: true,
|
|
23
|
+
tablet: true,
|
|
24
|
+
mobile: true
|
|
25
|
+
};
|
|
21
26
|
const ProductVariants = (props)=>{
|
|
22
27
|
const { builderProps, styles, setting, advanced } = props;
|
|
23
28
|
const { align, swatchItemWidth, dropdownItemWidth, swatchSpacing, optionTypo } = styles ?? {};
|
|
24
29
|
const { label, optionType, showAsSwatches, layout, hasPreSelected } = setting ?? {};
|
|
25
|
-
const advancedDisplay = advanced?.d;
|
|
30
|
+
const advancedDisplay = advanced?.d ?? DEFAULT_ADVANCED_DISPLAY_SETTING;
|
|
26
31
|
const { uid } = builderProps ?? {};
|
|
27
32
|
const variantGroup = optionType === 'groupOption';
|
|
28
33
|
const getSwatchAutoWidth = ()=>{
|
|
@@ -239,7 +244,7 @@ const ProductVariants = (props)=>{
|
|
|
239
244
|
productId: `{{ product.id | json | escape }}`,
|
|
240
245
|
productUrl: `{{ product.url | json | escape }}`,
|
|
241
246
|
productHandle: `{{ product.handle | json | escape }}`,
|
|
242
|
-
displayState: advancedDisplay
|
|
247
|
+
displayState: `${JSON.stringify(advancedDisplay)}`,
|
|
243
248
|
totalVariantCombinations: `{{ total_combinations }}`,
|
|
244
249
|
firstAvailableVariant: `{{ product.selected_or_first_available_variant | json | escape }}`
|
|
245
250
|
});
|
|
@@ -279,7 +284,7 @@ const ProductVariants = (props)=>{
|
|
|
279
284
|
'>
|
|
280
285
|
${Liquid(`{%- assign options = product.options_with_values -%}`)}
|
|
281
286
|
${Liquid(`{%- assign variants = product.variants -%}`)}
|
|
282
|
-
${LiquidIf(`options.size == 0 or options.size == 1 and
|
|
287
|
+
${LiquidIf(`options.size == 0 or options.size == 1 and variants.size == 1 and variants[0].title == 'Default Title' and variants[0].option1 == 'Default Title'`, `<div></div>`, template`<div
|
|
283
288
|
class="${pVariantClass}"
|
|
284
289
|
style="${pVariantStyle}"
|
|
285
290
|
>
|
|
@@ -12,7 +12,7 @@ const horizontalThree = [
|
|
|
12
12
|
tablet: true
|
|
13
13
|
},
|
|
14
14
|
editorData: {
|
|
15
|
-
css: '.{{rootClassName}} > div > div
|
|
15
|
+
css: '.{{rootClassName}} > div > div{\nwidth:100%;\n}',
|
|
16
16
|
rootClassName: '{{rootClassName}}'
|
|
17
17
|
},
|
|
18
18
|
hasBoxShadow: {
|
|
@@ -27,7 +27,7 @@ const horizontalThree = [
|
|
|
27
27
|
desktop: '100%'
|
|
28
28
|
},
|
|
29
29
|
pos: {
|
|
30
|
-
desktop: '
|
|
30
|
+
desktop: 'static'
|
|
31
31
|
},
|
|
32
32
|
right: {
|
|
33
33
|
desktop: '0px'
|
|
@@ -50,9 +50,6 @@ const horizontalThree = [
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
|
-
top: {
|
|
54
|
-
desktop: '-44px'
|
|
55
|
-
},
|
|
56
53
|
z: {
|
|
57
54
|
desktop: 1
|
|
58
55
|
}
|
|
@@ -152,7 +149,8 @@ const horizontalThree = [
|
|
|
152
149
|
}
|
|
153
150
|
},
|
|
154
151
|
tag: 'ProductBadge',
|
|
155
|
-
uid: '
|
|
152
|
+
uid: 'gHRinlrdow',
|
|
153
|
+
childrens: []
|
|
156
154
|
},
|
|
157
155
|
{
|
|
158
156
|
advanced: {
|
|
@@ -26,7 +26,7 @@ const horizontalTwo = [
|
|
|
26
26
|
desktop: '100%'
|
|
27
27
|
},
|
|
28
28
|
pos: {
|
|
29
|
-
desktop: '
|
|
29
|
+
desktop: 'static'
|
|
30
30
|
},
|
|
31
31
|
right: {
|
|
32
32
|
desktop: '0px'
|
|
@@ -49,9 +49,6 @@ const horizontalTwo = [
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
|
-
top: {
|
|
53
|
-
desktop: '-44px'
|
|
54
|
-
},
|
|
55
52
|
z: {
|
|
56
53
|
desktop: 1
|
|
57
54
|
}
|
|
@@ -151,7 +148,8 @@ const horizontalTwo = [
|
|
|
151
148
|
}
|
|
152
149
|
},
|
|
153
150
|
tag: 'ProductBadge',
|
|
154
|
-
uid: '
|
|
151
|
+
uid: 'gHRinlrdow',
|
|
152
|
+
childrens: []
|
|
155
153
|
},
|
|
156
154
|
{
|
|
157
155
|
advanced: {
|
|
@@ -6,7 +6,7 @@ const getLiquidTextContent = (setting, styles)=>{
|
|
|
6
6
|
const { template: templateString, outOfStockMessage, continueSelling, unlimitedQuantityMessage } = setting ?? {};
|
|
7
7
|
const { textColor } = styles ?? {};
|
|
8
8
|
const mainColor = textColor || 'brand';
|
|
9
|
-
return `{% if inventory_management == null
|
|
9
|
+
return `{% if inventory_management == null and inventory_quantity <= 0 %}
|
|
10
10
|
${transformHighlighTag(unlimitedQuantityMessage ?? getStaticLocale('StockCounter', 'let_buy_now'), mainColor)}
|
|
11
11
|
{% elsif available == false %}
|
|
12
12
|
${transformHighlighTag(outOfStockMessage || '', mainColor)}
|
|
@@ -58,6 +58,7 @@ const Text = ({ id, styles, builderAttrs, style, setting, advanced, builderProps
|
|
|
58
58
|
});
|
|
59
59
|
const outputText = createContent(displayText);
|
|
60
60
|
return template`
|
|
61
|
+
{% assign locationOrigin = request.origin | append: routes.root_url | split: '/' | join: '/' %}
|
|
61
62
|
<div ${{
|
|
62
63
|
...attrs
|
|
63
64
|
}}
|
|
@@ -1,26 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { replaceLinkData, getDynamicSourceLocales } from '../../../helpers.js';
|
|
2
2
|
|
|
3
3
|
const getDisplayText = ({ type, styles, setting, builderProps, pageContext })=>{
|
|
4
4
|
const { text, isForceValue } = setting ?? {};
|
|
5
5
|
let displayText = '';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
let newText = text.toString();
|
|
12
|
-
let match;
|
|
13
|
-
while((match = regex.exec(newText)) !== null){
|
|
14
|
-
const href = match[1];
|
|
15
|
-
const { urlData } = getInsertLinkData('', {
|
|
16
|
-
link: href
|
|
17
|
-
});
|
|
18
|
-
newText = newText.replace(match[0], match[0].replace(/(href=['"])([^'"]*)(['"])/i, `$1${urlData.href}$3`));
|
|
19
|
-
}
|
|
20
|
-
renderText = newText;
|
|
21
|
-
} else {
|
|
22
|
-
renderText = text;
|
|
23
|
-
}
|
|
6
|
+
const isViewliveHeadingOrTextComponent = [
|
|
7
|
+
'Heading',
|
|
8
|
+
'Text'
|
|
9
|
+
].includes(builderProps?.builderData?.tag ?? '') && !pageContext?.isPreviewing;
|
|
10
|
+
const renderText = replaceLinkData(text?.toString());
|
|
24
11
|
const isCapitalize = styles?.typo?.attrs?.transform === 'capitalize';
|
|
25
12
|
if (type === 'React') {
|
|
26
13
|
displayText = isCapitalize ? text?.toString().toLocaleLowerCase() : text?.toString();
|
|
@@ -29,13 +16,17 @@ const getDisplayText = ({ type, styles, setting, builderProps, pageContext })=>{
|
|
|
29
16
|
displayText = renderText;
|
|
30
17
|
} else if (setting?.translate) {
|
|
31
18
|
displayText = getDynamicSourceLocales({
|
|
32
|
-
val:
|
|
19
|
+
val: text,
|
|
33
20
|
uid: builderProps?.uid,
|
|
34
21
|
settingId: setting?.translate,
|
|
35
22
|
pageContext,
|
|
36
23
|
isCapitalize,
|
|
37
|
-
translate: setting.translate
|
|
24
|
+
translate: setting.translate,
|
|
25
|
+
isReplaceLocationOrigin: isViewliveHeadingOrTextComponent
|
|
38
26
|
});
|
|
27
|
+
if (displayText == text) {
|
|
28
|
+
displayText = renderText;
|
|
29
|
+
}
|
|
39
30
|
} else {
|
|
40
31
|
displayText = isCapitalize ? renderText?.toString().toLocaleLowerCase() : renderText;
|
|
41
32
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { template, makeStyleResponsive } from '@gem-sdk/core';
|
|
2
2
|
|
|
3
3
|
const EcomsendBackInStockAlert = ({ setting, advanced })=>{
|
|
4
|
-
const { align } = setting ?? {};
|
|
4
|
+
const { align, productId } = setting ?? {};
|
|
5
5
|
return template`
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
<div
|
|
7
|
+
class="${advanced?.cssClass}"
|
|
8
|
+
style="${{
|
|
9
9
|
...makeStyleResponsive('ta', align)
|
|
10
10
|
}}"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
`;
|
|
11
|
+
>
|
|
12
|
+
${productId ? `<div style="display: block" class="ecomsend-bis-block" data-product-id="${productId}"></div>` : `<div id="sealapps-bis-widget"></div>`}
|
|
13
|
+
</div>
|
|
14
|
+
`;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export { EcomsendBackInStockAlert as default };
|
|
@@ -4,7 +4,7 @@ import ThirdPartyPreview from './ThirdPartyPreview.js';
|
|
|
4
4
|
|
|
5
5
|
const AppConfig = {
|
|
6
6
|
id: 'product-options-variant-option',
|
|
7
|
-
label: 'Product Options
|
|
7
|
+
label: 'Avis Product Options, Variants',
|
|
8
8
|
logoUrl: 'https://cdn.shopify.com/app-store/listing_images/5ee1f244b087cfbec9b19c8b3f62c8f6/icon/CMCq1s7J5vQCEAE=.png',
|
|
9
9
|
tag: 'ProductOptionsVariantOption'
|
|
10
10
|
};
|
|
@@ -14,7 +14,7 @@ const ProductOptionsVariantOptionContent = ()=>{
|
|
|
14
14
|
className: "gp-p-2",
|
|
15
15
|
children: /*#__PURE__*/ jsx(ThirdPartyPreview, {
|
|
16
16
|
setting: {
|
|
17
|
-
label: 'Product Options
|
|
17
|
+
label: 'Avis Product Options, Variants',
|
|
18
18
|
iconSvg: `<img class="gp-w-6 gp-border gp-border-[#494949] gp-rounded-[3px]" src="${AppConfig.logoUrl}">`
|
|
19
19
|
}
|
|
20
20
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { template, makeStyleResponsive } from '@gem-sdk/core';
|
|
2
2
|
|
|
3
3
|
const ProductOptionsVariantOption = ({ setting, advanced })=>{
|
|
4
|
-
const { align
|
|
4
|
+
const { align } = setting ?? {};
|
|
5
5
|
return template`
|
|
6
6
|
<div
|
|
7
7
|
class="${advanced?.cssClass}"
|
|
@@ -9,7 +9,7 @@ const ProductOptionsVariantOption = ({ setting, advanced })=>{
|
|
|
9
9
|
...makeStyleResponsive('ta', align)
|
|
10
10
|
}}"
|
|
11
11
|
>
|
|
12
|
-
<div class="
|
|
12
|
+
<div class="avpoptions-container__v2"></div>
|
|
13
13
|
</div>
|
|
14
14
|
`;
|
|
15
15
|
};
|
|
@@ -2,7 +2,7 @@ import { getLiquidForAppBlock } from '../helpers/thirdParty.js';
|
|
|
2
2
|
|
|
3
3
|
const UnlimitedBundlesDiscounts = ({ setting, advanced })=>{
|
|
4
4
|
const { align, appBlockId } = setting ?? {};
|
|
5
|
-
return getLiquidForAppBlock(appBlockId, align, advanced?.cssClass);
|
|
5
|
+
return getLiquidForAppBlock(appBlockId, align, `${advanced?.cssClass ?? ''} !gp-block`);
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
export { UnlimitedBundlesDiscounts as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var AppConfig = {
|
|
2
2
|
id: 'ecoboostify-shoppable-reel-ugc',
|
|
3
3
|
label: 'EcoBoostify Shoppable Reel UGC',
|
|
4
|
-
logoUrl: 'https://cdn.shopify.com/app-store/listing_images/cdbdfc53291cf8d2908e72deae77f94e/icon/
|
|
4
|
+
logoUrl: 'https://cdn.shopify.com/app-store/listing_images/cdbdfc53291cf8d2908e72deae77f94e/icon/COuT9MaKvosDEAE=.png?width=22&height=22',
|
|
5
5
|
tag: 'EcoboostifyShoppableReelUgc'
|
|
6
6
|
};
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var AppConfig = {
|
|
2
2
|
id: 'notify-back-in-stockpreorder',
|
|
3
3
|
label: 'Notify! Back in Stock|PreOrder',
|
|
4
|
-
logoUrl: 'https://cdn.shopify.com/
|
|
4
|
+
logoUrl: 'https://cdn.shopify.com/s/files/1/0643/0497/1949/files/Notify_Me_Logo.png?v=1736234550',
|
|
5
5
|
tag: 'NotifyBackInStockPreOrder'
|
|
6
6
|
};
|
|
7
7
|
|