@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
|
@@ -14,7 +14,7 @@ var useHeroBanner = require('./hooks/useHeroBanner.js');
|
|
|
14
14
|
var common = require('./common/common.js');
|
|
15
15
|
|
|
16
16
|
const HeroBanner = (props)=>{
|
|
17
|
-
const { builderAttrs, builderProps, setting, styles, style, children, advanced,
|
|
17
|
+
const { builderAttrs, builderProps, setting, styles, style, children, advanced, enableLazyLoadImage = true } = props;
|
|
18
18
|
const mode = core.useEditorMode();
|
|
19
19
|
const { enableLink } = setting ?? {};
|
|
20
20
|
const link = common.getBannerLink(setting);
|
|
@@ -50,7 +50,7 @@ const HeroBanner = (props)=>{
|
|
|
50
50
|
children: children,
|
|
51
51
|
rawChildren: props.rawChildren,
|
|
52
52
|
builderProps: builderProps,
|
|
53
|
-
|
|
53
|
+
enableLazyLoadImage: enableLazyLoadImage,
|
|
54
54
|
elementRef: elementRef,
|
|
55
55
|
transform: transform,
|
|
56
56
|
dataVideo: dataVideo,
|
|
@@ -12,7 +12,8 @@ var helpers = require('../../helpers.js');
|
|
|
12
12
|
var common = require('./common/common.js');
|
|
13
13
|
|
|
14
14
|
const HeroBanner = (props)=>{
|
|
15
|
-
const { builderAttrs, builderProps, setting, styles, style, children, advanced,
|
|
15
|
+
const { builderAttrs, builderProps, setting, styles, style, children, advanced, pageContext } = props;
|
|
16
|
+
const { enableLazyLoadImage } = pageContext ?? {};
|
|
16
17
|
const { enableLink } = setting ?? {};
|
|
17
18
|
const link = common.getBannerLink(setting);
|
|
18
19
|
const { cssClass } = advanced ?? {};
|
|
@@ -57,7 +58,7 @@ const HeroBanner = (props)=>{
|
|
|
57
58
|
setting,
|
|
58
59
|
styles,
|
|
59
60
|
children,
|
|
60
|
-
|
|
61
|
+
enableLazyLoadImage,
|
|
61
62
|
rawChildren: props.rawChildren,
|
|
62
63
|
builderProps
|
|
63
64
|
});
|
|
@@ -18,10 +18,10 @@ var common$1 = require('../../video/helpers/common.js');
|
|
|
18
18
|
|
|
19
19
|
const HeroBannerItem = (props)=>{
|
|
20
20
|
const mode = core.useEditorMode();
|
|
21
|
-
const {
|
|
21
|
+
const { enableLazyLoadImage, setting, styles, children, elementRef, transform, dataVideo, bgRef, isShowVideoHtml5, layoutResponsive } = props;
|
|
22
22
|
const { layout, verticalAlign, enableParallax, alt, title } = setting ?? {};
|
|
23
23
|
const { background, overlayColor, verticalGutter, sizeSetting, contentWidth, hoverEffect, contentPosition1Col, contentPosition2Col } = styles ?? {};
|
|
24
|
-
const enableLazyImage = !(background?.desktop?.preload || background?.tablet?.preload || background?.mobile?.preload) &&
|
|
24
|
+
const enableLazyImage = !(background?.desktop?.preload || background?.tablet?.preload || background?.mobile?.preload) && enableLazyLoadImage && mode !== 'edit' && mode !== 'preview-post-purchase';
|
|
25
25
|
const isNotLiquid = true;
|
|
26
26
|
const aspectRatio = common.getAspectRatioSettings(setting?.ratioOptions, setting?.aspectRatio);
|
|
27
27
|
const containerStyle = system.createStyle({
|
|
@@ -184,7 +184,7 @@ const HeroBannerItem = (props)=>{
|
|
|
184
184
|
style: adaptiveStyle,
|
|
185
185
|
alt: alt,
|
|
186
186
|
title: title,
|
|
187
|
-
|
|
187
|
+
enableLazyLoadImage: enableLazyImage,
|
|
188
188
|
fallbackImg: common.fallbackImg
|
|
189
189
|
})
|
|
190
190
|
]
|
|
@@ -17,11 +17,11 @@ var common$2 = require('../../video/helpers/common.js');
|
|
|
17
17
|
var common$1 = require('../../grid/row/commons/common.js');
|
|
18
18
|
|
|
19
19
|
const HeroBannerItem = (props)=>{
|
|
20
|
-
const {
|
|
20
|
+
const { enableLazyLoadImage, setting, styles, children, builderProps, rawChildren } = props;
|
|
21
21
|
const { layout, verticalAlign, enableParallax, alt, title } = setting ?? {};
|
|
22
22
|
const { background, overlayColor, verticalGutter, sizeSetting, contentWidth, hoverEffect, contentPosition1Col, contentPosition2Col } = styles ?? {};
|
|
23
23
|
const transform = '';
|
|
24
|
-
const enableLazyImage = !(background?.desktop?.preload || background?.tablet?.preload || background?.mobile?.preload) &&
|
|
24
|
+
const enableLazyImage = !(background?.desktop?.preload || background?.tablet?.preload || background?.mobile?.preload) && enableLazyLoadImage;
|
|
25
25
|
const isNotLiquid = false;
|
|
26
26
|
const aspectRatio = common.getAspectRatioSettings(setting?.ratioOptions, setting?.aspectRatio);
|
|
27
27
|
const dataVideo = common.getResponsiveSetting(background || {}).desktop;
|
|
@@ -91,7 +91,7 @@ const HeroBannerItem = (props)=>{
|
|
|
91
91
|
alt: `lazy image ${device}`,
|
|
92
92
|
className: lazyBackgroundClasses(device),
|
|
93
93
|
isDisableAspectStyle: true,
|
|
94
|
-
enableLazyLoadImage
|
|
94
|
+
enableLazyLoadImage
|
|
95
95
|
}));
|
|
96
96
|
}).join('');
|
|
97
97
|
};
|
|
@@ -86,7 +86,10 @@ const Button = (props)=>{
|
|
|
86
86
|
className: buttonWrapperClasses,
|
|
87
87
|
children: [
|
|
88
88
|
/*#__PURE__*/ jsxRuntime.jsx("style", {
|
|
89
|
-
|
|
89
|
+
type: "text/css",
|
|
90
|
+
dangerouslySetInnerHTML: {
|
|
91
|
+
__html: customCss
|
|
92
|
+
}
|
|
90
93
|
}),
|
|
91
94
|
system.If(isScrollToElement, // eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
92
95
|
/*#__PURE__*/ jsxRuntime.jsx("a", {
|
|
@@ -17,7 +17,7 @@ const getClass = (props)=>{
|
|
|
17
17
|
...builderProps?.uid && {
|
|
18
18
|
[builderProps.uid]: true
|
|
19
19
|
},
|
|
20
|
-
'gp-relative gp-mx-auto gp-mb-0 gp-grid gp-max-w-full gp-transition-colors gp-duration-200 gp-ease-in-out [&_*]:gp-max-w-full': true,
|
|
20
|
+
'gp-relative gp-mx-auto gp-mb-0 gp-grid gp-max-w-full gp-transition-colors gp-duration-200 gp-ease-in-out [&_*]:gp-max-w-full gp-grid-rows-[1fr]': true,
|
|
21
21
|
...advanced?.cssClass && {
|
|
22
22
|
[advanced?.cssClass]: true
|
|
23
23
|
}
|
|
@@ -10,7 +10,7 @@ var helper = require('../../../post-purchase/utils/helper.js');
|
|
|
10
10
|
const getRowStyle = (rowProps)=>{
|
|
11
11
|
const { children, setting, builderProps, styles, style, advanced, isNotFullWidth, parentStyle } = rowProps;
|
|
12
12
|
const { isSection, layout, horizontalAlign, responsive, inlineAlignment } = setting ?? {};
|
|
13
|
-
const { width, columnGap, rowGap, fullWidth, background, verticalGutter, verticalGutterMobile, enablePagePadding } = styles ?? {};
|
|
13
|
+
const { width, columnGap, rowGap, fullWidth, background, verticalGutter, verticalGutterMobile, enablePagePadding, height } = styles ?? {};
|
|
14
14
|
const innerRadius = getInnerRadius.getInnerRadiusExcludeBorder(advanced?.border, advanced?.rounded);
|
|
15
15
|
const checkHasRadius = (corner)=>{
|
|
16
16
|
const cornerNormal = corner?.normal;
|
|
@@ -51,6 +51,7 @@ const getRowStyle = (rowProps)=>{
|
|
|
51
51
|
...core.makeStyleResponsive('rg', verticalGutterMobile),
|
|
52
52
|
...layout ? core.composeGridLayout(layout) : core.makeStyleResponsive('gtc', responsive),
|
|
53
53
|
...core.makeStyleResponsive('w', sizeStyles.content),
|
|
54
|
+
...core.makeStyleResponsive('h', height),
|
|
54
55
|
...isSection ? {} : overFlowStyle
|
|
55
56
|
};
|
|
56
57
|
};
|
|
@@ -187,6 +187,27 @@ const RowSettings = [
|
|
|
187
187
|
}
|
|
188
188
|
]
|
|
189
189
|
},
|
|
190
|
+
{
|
|
191
|
+
id: 'height',
|
|
192
|
+
type: 'option:value',
|
|
193
|
+
devices: {
|
|
194
|
+
desktop: {
|
|
195
|
+
default: 'auto'
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
options: [
|
|
199
|
+
{
|
|
200
|
+
label: 'Full',
|
|
201
|
+
value: '100%',
|
|
202
|
+
tooltip: 'Stretch to fill <br> vertical space'
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
label: 'Fit',
|
|
206
|
+
value: 'auto',
|
|
207
|
+
tooltip: 'Adjust size <br> based on content'
|
|
208
|
+
}
|
|
209
|
+
]
|
|
210
|
+
},
|
|
190
211
|
{
|
|
191
212
|
id: 'verticalGutter',
|
|
192
213
|
type: 'input:slider',
|
|
@@ -108,8 +108,15 @@ const SettingUIV2 = [
|
|
|
108
108
|
en: 'Width',
|
|
109
109
|
es: 'Ancho',
|
|
110
110
|
cn: '宽度'
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
setting: {
|
|
115
|
+
id: 'height'
|
|
111
116
|
},
|
|
112
|
-
|
|
117
|
+
label: {
|
|
118
|
+
en: 'Height'
|
|
119
|
+
}
|
|
113
120
|
},
|
|
114
121
|
{
|
|
115
122
|
label: {
|
|
@@ -260,7 +267,6 @@ const SettingUIV2 = [
|
|
|
260
267
|
label: {
|
|
261
268
|
en: 'Align column'
|
|
262
269
|
},
|
|
263
|
-
conditionDisplay: `pageType != "POST_PURCHASE" && (layout.display !== 'fill' || (!!layout.cols && layout.cols.length > 1))`,
|
|
264
270
|
controls: [
|
|
265
271
|
{
|
|
266
272
|
id: 'verticalAlign',
|
|
@@ -270,7 +276,7 @@ const SettingUIV2 = [
|
|
|
270
276
|
setting: {
|
|
271
277
|
id: 'verticalAlign'
|
|
272
278
|
},
|
|
273
|
-
conditionDisplay:
|
|
279
|
+
conditionDisplay: `((!!layout.cols && layout.cols.length > 1) || (!!layout.cols && layout.cols.length == 1 && height == '100%')) && pageType != "POST_PURCHASE"`
|
|
274
280
|
},
|
|
275
281
|
{
|
|
276
282
|
id: 'horizontalAlign',
|
|
@@ -280,7 +286,7 @@ const SettingUIV2 = [
|
|
|
280
286
|
setting: {
|
|
281
287
|
id: 'horizontalAlign'
|
|
282
288
|
},
|
|
283
|
-
conditionDisplay: `layout.display !== 'fill'`,
|
|
289
|
+
conditionDisplay: `layout.display !== 'fill' && pageType != "POST_PURCHASE"`,
|
|
284
290
|
options: {
|
|
285
291
|
disableMessage: `Horizontal Align is available when layout is "Fit to content"`
|
|
286
292
|
}
|
package/dist/cjs/helpers.js
CHANGED
|
@@ -66,6 +66,10 @@ const getStaticLocale = (tag, key)=>{
|
|
|
66
66
|
const getSettingPreloadData = (disabledValue, enabledValue)=>{
|
|
67
67
|
return `{% if section.settings.section_preload == "false" %}${disabledValue} ${enabledValue ? `{% else %}${enabledValue}` : ''}{% endif %}`;
|
|
68
68
|
};
|
|
69
|
+
const getHttpUrl = (link)=>{
|
|
70
|
+
if (!link) return '';
|
|
71
|
+
return link.match(/^https?:\/\//i) ? link : `http://${link}`;
|
|
72
|
+
};
|
|
69
73
|
const getInsertLinkData = (defaultWrap, setting, htmlType)=>{
|
|
70
74
|
const URL_START_WITH = [
|
|
71
75
|
'#',
|
|
@@ -78,7 +82,7 @@ const getInsertLinkData = (defaultWrap, setting, htmlType)=>{
|
|
|
78
82
|
const isHyperlink = setting?.link !== undefined && setting.link !== '';
|
|
79
83
|
let urlHref = setting?.link ?? '';
|
|
80
84
|
const isHomePageHref = urlHref === '/';
|
|
81
|
-
const regexHttp = new RegExp(/^https
|
|
85
|
+
const regexHttp = new RegExp(/^(?:https?:\/\/)?[\w.-]+\.[a-z]{2,}/i);
|
|
82
86
|
const regexPageType = new RegExp(/^\/?(?:collections|pages|products|blogs|checkout|cart)\/?/i);
|
|
83
87
|
const isShopifyDomain = isHyperlink && !regexHttp.test(urlHref) && regexPageType.test(urlHref);
|
|
84
88
|
const isDomain = isHyperlink && regexHttp.test(urlHref);
|
|
@@ -89,6 +93,7 @@ const getInsertLinkData = (defaultWrap, setting, htmlType)=>{
|
|
|
89
93
|
urlHref = "{{ request.origin }}{{ routes.root_url | split: '/' | join: '/' }}" + urlHref;
|
|
90
94
|
}
|
|
91
95
|
}
|
|
96
|
+
if (isDomain) urlHref = getHttpUrl(urlHref);
|
|
92
97
|
const isLink = ()=>{
|
|
93
98
|
if (URL_START_WITH.find((el)=>urlHref.startsWith(el))) return true;
|
|
94
99
|
if (URL_INCLUDES.find((el)=>urlHref.includes(el))) return true;
|
|
@@ -214,10 +219,34 @@ const convertUnitToNumber = (value, defaultValue)=>{
|
|
|
214
219
|
const data = typeof value === 'string' ? value.replaceAll('px', '').replaceAll('%', '').replaceAll('rem', '').replaceAll('em', '') : defaultValue;
|
|
215
220
|
return !isNaN(Number(data)) ? Number(data) : defaultValue;
|
|
216
221
|
};
|
|
222
|
+
const getAllHrefFromString = (htmlString)=>{
|
|
223
|
+
if (!htmlString) return [];
|
|
224
|
+
const regex = /href="([^"]*)"/g;
|
|
225
|
+
const hrefs = [];
|
|
226
|
+
let match;
|
|
227
|
+
while((match = regex.exec(htmlString)) !== null){
|
|
228
|
+
match[1] && hrefs.push(match[1]);
|
|
229
|
+
}
|
|
230
|
+
return hrefs;
|
|
231
|
+
};
|
|
232
|
+
const replaceAllHrefFromString = (htmlString, hrefs)=>{
|
|
233
|
+
if (!htmlString) return '';
|
|
234
|
+
const regex = /href="([^"]*)"/g;
|
|
235
|
+
let match;
|
|
236
|
+
let i = 0;
|
|
237
|
+
while((match = regex.exec(htmlString)) !== null){
|
|
238
|
+
if (match[1]) {
|
|
239
|
+
htmlString = htmlString.replace(match[1], hrefs[i] ?? '');
|
|
240
|
+
i++;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return htmlString;
|
|
244
|
+
};
|
|
217
245
|
|
|
218
246
|
exports.convertUnitToNumber = convertUnitToNumber;
|
|
219
247
|
exports.filterTruthyObject = filterTruthyObject;
|
|
220
248
|
exports.filterTruthyStyles = filterTruthyStyles;
|
|
249
|
+
exports.getAllHrefFromString = getAllHrefFromString;
|
|
221
250
|
exports.getDisplayStyle = getDisplayStyle;
|
|
222
251
|
exports.getDynamicSourceLocales = getDynamicSourceLocales;
|
|
223
252
|
exports.getInsertLinkData = getInsertLinkData;
|
|
@@ -229,5 +258,6 @@ exports.isHexTransparent = isHexTransparent;
|
|
|
229
258
|
exports.isLinkedToSalesPage = isLinkedToSalesPage;
|
|
230
259
|
exports.isTransparentColor = isTransparentColor;
|
|
231
260
|
exports.isTransparentRGBA = isTransparentRGBA;
|
|
261
|
+
exports.replaceAllHrefFromString = replaceAllHrefFromString;
|
|
232
262
|
exports.replaceLinkData = replaceLinkData;
|
|
233
263
|
exports.youtubeShortsRegex = youtubeShortsRegex;
|
|
@@ -11,7 +11,7 @@ var data = require('./common/data.js');
|
|
|
11
11
|
var styles = require('./common/styles.js');
|
|
12
12
|
|
|
13
13
|
const AdaptiveImage = (props)=>{
|
|
14
|
-
const { alt, style, srcSet, layout, priority, className, aspectRatio, borderRadius, pictureClass,
|
|
14
|
+
const { alt, style, srcSet, layout, priority, className, aspectRatio, borderRadius, pictureClass, enableLazyLoadImage, ...restProps } = props;
|
|
15
15
|
const { getDeviceSource } = data.getAdaptiveImageData(props);
|
|
16
16
|
const { srcTablet, srcMobile } = getDeviceSource();
|
|
17
17
|
const loadingAttrs = system.createAttr({
|
|
@@ -32,7 +32,7 @@ const AdaptiveImage = (props)=>{
|
|
|
32
32
|
const adaptiveImageClasses = system.createClass({
|
|
33
33
|
...classes.getAdaptiveImageClasses({
|
|
34
34
|
className,
|
|
35
|
-
hasLazyLoad:
|
|
35
|
+
hasLazyLoad: enableLazyLoadImage
|
|
36
36
|
})
|
|
37
37
|
});
|
|
38
38
|
const renderSource = ()=>{
|
|
@@ -40,11 +40,11 @@ const AdaptiveImage = (props)=>{
|
|
|
40
40
|
children: [
|
|
41
41
|
srcMobile && /*#__PURE__*/ jsxRuntime.jsx("source", {
|
|
42
42
|
media: "(max-width: 767px)",
|
|
43
|
-
srcSet:
|
|
43
|
+
srcSet: enableLazyLoadImage ? constants.IMAGE_PLACEHOLDER : srcMobile
|
|
44
44
|
}),
|
|
45
45
|
srcTablet && /*#__PURE__*/ jsxRuntime.jsx("source", {
|
|
46
46
|
media: "(max-width: 1024px)",
|
|
47
|
-
srcSet:
|
|
47
|
+
srcSet: enableLazyLoadImage ? constants.IMAGE_PLACEHOLDER : srcTablet
|
|
48
48
|
})
|
|
49
49
|
]
|
|
50
50
|
});
|
|
@@ -28,7 +28,7 @@ const Image = ({ style, styles: styles$1, setting, children, advanced, className
|
|
|
28
28
|
const containerStyles = system.createStyle(styles.getContainerStyles(style, styles$1));
|
|
29
29
|
const wrapperClasses = system.createClass(classes.getWrapperClasses());
|
|
30
30
|
const imageClasses = system.createClass(classes.getImageClasses(className, styles$1));
|
|
31
|
-
const containerClasses = system.createClass(classes.getContainerClasses(builderProps?.uid, advanced?.cssClass));
|
|
31
|
+
const containerClasses = system.createClass(classes.getContainerClasses(builderProps?.uid, advanced?.cssClass, styles$1?.shape));
|
|
32
32
|
const containerAttrs = system.createAttr(attributes.getContainerAttrs(builderAttrs, builderProps?.uid));
|
|
33
33
|
const linkWrapperAttrs = attributes.getLinkWrapperAttrs({
|
|
34
34
|
urlData,
|
|
@@ -11,8 +11,9 @@ var styles = require('./common/styles.js');
|
|
|
11
11
|
var classes = require('./common/classes.js');
|
|
12
12
|
var attributes = require('./common/attributes.js');
|
|
13
13
|
|
|
14
|
-
const Image = ({ style, styles: styles$1, setting, advanced, className, pageContext, builderAttrs, builderProps
|
|
14
|
+
const Image = ({ style, styles: styles$1, setting, advanced, className, pageContext, builderAttrs, builderProps })=>{
|
|
15
15
|
const { imageLink, isAdaptive, enableImageLink } = setting ?? {};
|
|
16
|
+
const { enableLazyLoadImage } = pageContext ?? {};
|
|
16
17
|
const { Wrapper: HTMLTag, urlData } = helpers.getLinkData({
|
|
17
18
|
defaultWrap: 'div',
|
|
18
19
|
setting: imageLink,
|
|
@@ -24,7 +25,7 @@ const Image = ({ style, styles: styles$1, setting, advanced, className, pageCont
|
|
|
24
25
|
const containerStyles = system.createStyle(styles.getContainerStyles(style, styles$1));
|
|
25
26
|
const wrapperClasses = system.createClass(classes.getWrapperClasses());
|
|
26
27
|
const imageClasses = system.createClass(classes.getImageClasses(className, styles$1));
|
|
27
|
-
const containerClasses = system.createClass(classes.getContainerClasses(builderProps?.uid, advanced?.cssClass));
|
|
28
|
+
const containerClasses = system.createClass(classes.getContainerClasses(builderProps?.uid, advanced?.cssClass, styles$1?.shape));
|
|
28
29
|
const containerAttrs = system.createAttr(attributes.getContainerAttrs(builderAttrs, builderProps?.uid));
|
|
29
30
|
const linkWrapperAttrs = attributes.getLinkWrapperAttrs({
|
|
30
31
|
urlData,
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
var core = require('@gem-sdk/core');
|
|
4
4
|
|
|
5
|
-
const getContainerClasses = (uid, cssClass)=>{
|
|
5
|
+
const getContainerClasses = (uid, cssClass, shape)=>{
|
|
6
|
+
const imageFlexGrowClass = core.getFlexGrowClassByShapeGlobalSize(shape);
|
|
6
7
|
return {
|
|
7
8
|
'gp-group/image gp-relative': true,
|
|
8
9
|
[`force-publish-${new Date().getTime()}`]: true,
|
|
10
|
+
...imageFlexGrowClass,
|
|
9
11
|
...uid && {
|
|
10
12
|
[uid]: true
|
|
11
13
|
},
|
|
@@ -30,7 +30,8 @@ const getSrcSetLiquid = (liquid, storage)=>{
|
|
|
30
30
|
return `{{ '${liquid}' | asset_img_url: '768x' }} 768w, {{ '${liquid}' | asset_img_url: '1024x' }} 1024w, {{ '${liquid}' | asset_img_url: 'master' }} 1440w`;
|
|
31
31
|
};
|
|
32
32
|
const getSrcSetLink = (link)=>{
|
|
33
|
-
return
|
|
33
|
+
return link;
|
|
34
|
+
// return `${link} 768w,${link} 1024w,${link} 1440w`; // Since image src didn't change in size so this line of code is pointless
|
|
34
35
|
};
|
|
35
36
|
const getImageSrc = (image, currentDevice, isNotLiquid)=>{
|
|
36
37
|
if (image?.metafieldDefinitionKey) {
|
package/dist/cjs/index.js
CHANGED
|
@@ -390,6 +390,7 @@ exports.ELEMENT_Z_INDEX = _const.ELEMENT_Z_INDEX;
|
|
|
390
390
|
exports.convertUnitToNumber = helpers.convertUnitToNumber;
|
|
391
391
|
exports.filterTruthyObject = helpers.filterTruthyObject;
|
|
392
392
|
exports.filterTruthyStyles = helpers.filterTruthyStyles;
|
|
393
|
+
exports.getAllHrefFromString = helpers.getAllHrefFromString;
|
|
393
394
|
exports.getDisplayStyle = helpers.getDisplayStyle;
|
|
394
395
|
exports.getDynamicSourceLocales = helpers.getDynamicSourceLocales;
|
|
395
396
|
exports.getInsertLinkData = helpers.getInsertLinkData;
|
|
@@ -401,6 +402,7 @@ exports.isHexTransparent = helpers.isHexTransparent;
|
|
|
401
402
|
exports.isLinkedToSalesPage = helpers.isLinkedToSalesPage;
|
|
402
403
|
exports.isTransparentColor = helpers.isTransparentColor;
|
|
403
404
|
exports.isTransparentRGBA = helpers.isTransparentRGBA;
|
|
405
|
+
exports.replaceAllHrefFromString = helpers.replaceAllHrefFromString;
|
|
404
406
|
exports.replaceLinkData = helpers.replaceLinkData;
|
|
405
407
|
exports.youtubeShortsRegex = helpers.youtubeShortsRegex;
|
|
406
408
|
exports.Accordion = Accordion.default;
|
|
@@ -15,8 +15,12 @@ const getProductOfferWrapperClasses = ()=>{
|
|
|
15
15
|
const getProductOfferItemClasses = (index, setting, totalProduct)=>{
|
|
16
16
|
const { productOfferLayout } = setting ?? {};
|
|
17
17
|
let className = '';
|
|
18
|
-
constants.DEVICES.
|
|
18
|
+
constants.DEVICES.forEach((device)=>{
|
|
19
19
|
const key = device === 'desktop' ? '' : `${device}:`;
|
|
20
|
+
if (device === 'mobile') {
|
|
21
|
+
className += ` mobile:gp-col-span-2`;
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
20
24
|
if (productOfferLayout?.[device] === '1col' && index % 3 === 0 || (totalProduct || 0) <= 1) {
|
|
21
25
|
className += ` ${key}gp-col-span-2`;
|
|
22
26
|
}
|
|
@@ -61,11 +61,11 @@ const getSvgActiveStyles = (styles)=>{
|
|
|
61
61
|
})
|
|
62
62
|
};
|
|
63
63
|
};
|
|
64
|
-
const getSvgStyles = (
|
|
64
|
+
const getSvgStyles = (styles)=>{
|
|
65
65
|
return {
|
|
66
66
|
...core.getGlobalColorStateStyle('c', {
|
|
67
67
|
...styles?.iconColor,
|
|
68
|
-
normal:
|
|
68
|
+
normal: styles?.iconColor?.normal
|
|
69
69
|
})
|
|
70
70
|
};
|
|
71
71
|
};
|
package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.js
CHANGED
|
@@ -15,7 +15,7 @@ const ProductBundleDiscountChildrenItem = (props)=>{
|
|
|
15
15
|
const composeLayoutClasses = system.createClass(classes.getLayoutClasses(setting));
|
|
16
16
|
const composeIconStyles = system.createStyle(styles.getIconStyles(setting));
|
|
17
17
|
const composeSvgActiveStyles = system.createStyle(styles.getSvgActiveStyles(styles$1));
|
|
18
|
-
const composeSvgStyles = system.createStyle(styles.getSvgStyles(
|
|
18
|
+
const composeSvgStyles = system.createStyle(styles.getSvgStyles(styles$1));
|
|
19
19
|
const composeIconSectionClasses = system.createClass(classes.getIconSectionClasses);
|
|
20
20
|
const composeItemClasses = system.createClass(classes.getItemClasses);
|
|
21
21
|
const composeFlexChildren = system.createClass(styles.getFlexChildren);
|
|
@@ -13,7 +13,7 @@ const ProductBundleDiscountChildrenItemLiquid = (props)=>{
|
|
|
13
13
|
const composeLayoutClasses = system.createClass(classes.getLayoutClasses(setting));
|
|
14
14
|
const composeIconStyles = system.createStyle(styles.getIconStyles(setting));
|
|
15
15
|
const composeSvgActiveStyles = system.createStyle(styles.getSvgActiveStyles(styles$1));
|
|
16
|
-
const composeSvgStyles = system.createStyle(styles.getSvgStyles(
|
|
16
|
+
const composeSvgStyles = system.createStyle(styles.getSvgStyles(styles$1));
|
|
17
17
|
const composeIconSectionClasses = system.createClass(classes.getIconSectionClasses);
|
|
18
18
|
const composeItemClasses = system.createClass(classes.getItemClasses);
|
|
19
19
|
const composeFlexChildren = system.createClass(styles.getFlexChildren);
|
|
@@ -434,10 +434,7 @@ const config = {
|
|
|
434
434
|
childItem: [],
|
|
435
435
|
layout: 'vertical-layout'
|
|
436
436
|
},
|
|
437
|
-
childrens: []
|
|
438
|
-
advanced: {
|
|
439
|
-
of: 'hidden'
|
|
440
|
-
}
|
|
437
|
+
childrens: []
|
|
441
438
|
}
|
|
442
439
|
]
|
|
443
440
|
},
|
|
@@ -467,10 +464,7 @@ const config = {
|
|
|
467
464
|
layout: 'horizontal-layout',
|
|
468
465
|
enableIcon: false
|
|
469
466
|
},
|
|
470
|
-
childrens: []
|
|
471
|
-
advanced: {
|
|
472
|
-
of: 'hidden'
|
|
473
|
-
}
|
|
467
|
+
childrens: []
|
|
474
468
|
}
|
|
475
469
|
]
|
|
476
470
|
}
|
|
@@ -335,7 +335,7 @@ const getPaddingBottomByShapeSetting = (shapeSetting)=>{
|
|
|
335
335
|
};
|
|
336
336
|
return;
|
|
337
337
|
}
|
|
338
|
-
const value = aspectRatio?.[device] !== 'auto' && !!aspectRatio?.[device] ? aspectRatio?.[device]?.split('').reverse().join('') : '{%if media.height%} {{media.height}} / {{media.width}} {%else%} 100 / 100 {%endif%}';
|
|
338
|
+
const value = aspectRatio?.[device] !== 'auto' && !!aspectRatio?.[device] ? aspectRatio?.[device]?.split('/').reverse().join('') : '{%if media.height%} {{media.height}} / {{media.width}} {%else%} 100 / 100 {%endif%}';
|
|
339
339
|
result = {
|
|
340
340
|
...result,
|
|
341
341
|
[device]: `calc((${value})*100%)`
|
|
@@ -18,7 +18,8 @@ var _function = require('../../helpers/function.js');
|
|
|
18
18
|
const ProductImages = (props)=>{
|
|
19
19
|
const productImageProps = common.setDefaultWhenUndefineSetting(props);
|
|
20
20
|
const { setting, styles, builderProps, style } = productImageProps;
|
|
21
|
-
const { rawChildren, pageContext
|
|
21
|
+
const { rawChildren, pageContext } = props;
|
|
22
|
+
const { enableLazyLoadImage } = pageContext ?? {};
|
|
22
23
|
const settings = {
|
|
23
24
|
...setting,
|
|
24
25
|
...styles
|
|
@@ -97,7 +98,8 @@ const ProductImages = (props)=>{
|
|
|
97
98
|
>
|
|
98
99
|
${GalleryCarousel_liquid.default({
|
|
99
100
|
builderPropUID: `gp-gallery-${builderProps?.uid}`,
|
|
100
|
-
...settings
|
|
101
|
+
...settings,
|
|
102
|
+
enableLazyLoadImage
|
|
101
103
|
})}
|
|
102
104
|
</div>
|
|
103
105
|
${GalleryGrid_liquid.default({
|
|
@@ -106,7 +108,8 @@ const ProductImages = (props)=>{
|
|
|
106
108
|
...styleInsideLayout
|
|
107
109
|
},
|
|
108
110
|
children: renderProductBadge(),
|
|
109
|
-
...settings
|
|
111
|
+
...settings,
|
|
112
|
+
enableLazyLoadImage
|
|
110
113
|
})}
|
|
111
114
|
`;
|
|
112
115
|
};
|
|
@@ -22,11 +22,16 @@ const DEVICES = [
|
|
|
22
22
|
'tablet',
|
|
23
23
|
'mobile'
|
|
24
24
|
];
|
|
25
|
+
const DEFAULT_ADVANCED_DISPLAY_SETTING = {
|
|
26
|
+
desktop: true,
|
|
27
|
+
tablet: true,
|
|
28
|
+
mobile: true
|
|
29
|
+
};
|
|
25
30
|
const ProductVariants = (props)=>{
|
|
26
31
|
const { builderProps, styles: styles$1, setting, advanced } = props;
|
|
27
32
|
const { align, swatchItemWidth, dropdownItemWidth, swatchSpacing, optionTypo } = styles$1 ?? {};
|
|
28
33
|
const { label, optionType, showAsSwatches, layout, hasPreSelected } = setting ?? {};
|
|
29
|
-
const advancedDisplay = advanced?.d;
|
|
34
|
+
const advancedDisplay = advanced?.d ?? DEFAULT_ADVANCED_DISPLAY_SETTING;
|
|
30
35
|
const { uid } = builderProps ?? {};
|
|
31
36
|
const variantGroup = optionType === 'groupOption';
|
|
32
37
|
const getSwatchAutoWidth = ()=>{
|
|
@@ -243,7 +248,7 @@ const ProductVariants = (props)=>{
|
|
|
243
248
|
productId: `{{ product.id | json | escape }}`,
|
|
244
249
|
productUrl: `{{ product.url | json | escape }}`,
|
|
245
250
|
productHandle: `{{ product.handle | json | escape }}`,
|
|
246
|
-
displayState: advancedDisplay
|
|
251
|
+
displayState: `${JSON.stringify(advancedDisplay)}`,
|
|
247
252
|
totalVariantCombinations: `{{ total_combinations }}`,
|
|
248
253
|
firstAvailableVariant: `{{ product.selected_or_first_available_variant | json | escape }}`
|
|
249
254
|
});
|
|
@@ -283,7 +288,7 @@ const ProductVariants = (props)=>{
|
|
|
283
288
|
'>
|
|
284
289
|
${system.Liquid(`{%- assign options = product.options_with_values -%}`)}
|
|
285
290
|
${system.Liquid(`{%- assign variants = product.variants -%}`)}
|
|
286
|
-
${system.LiquidIf(`options.size == 0 or options.size == 1 and
|
|
291
|
+
${system.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>`, core.template`<div
|
|
287
292
|
class="${pVariantClass}"
|
|
288
293
|
style="${pVariantStyle}"
|
|
289
294
|
>
|
|
@@ -14,7 +14,7 @@ const horizontalThree = [
|
|
|
14
14
|
tablet: true
|
|
15
15
|
},
|
|
16
16
|
editorData: {
|
|
17
|
-
css: '.{{rootClassName}} > div > div
|
|
17
|
+
css: '.{{rootClassName}} > div > div{\nwidth:100%;\n}',
|
|
18
18
|
rootClassName: '{{rootClassName}}'
|
|
19
19
|
},
|
|
20
20
|
hasBoxShadow: {
|
|
@@ -29,7 +29,7 @@ const horizontalThree = [
|
|
|
29
29
|
desktop: '100%'
|
|
30
30
|
},
|
|
31
31
|
pos: {
|
|
32
|
-
desktop: '
|
|
32
|
+
desktop: 'static'
|
|
33
33
|
},
|
|
34
34
|
right: {
|
|
35
35
|
desktop: '0px'
|
|
@@ -52,9 +52,6 @@ const horizontalThree = [
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
|
-
top: {
|
|
56
|
-
desktop: '-44px'
|
|
57
|
-
},
|
|
58
55
|
z: {
|
|
59
56
|
desktop: 1
|
|
60
57
|
}
|
|
@@ -154,7 +151,8 @@ const horizontalThree = [
|
|
|
154
151
|
}
|
|
155
152
|
},
|
|
156
153
|
tag: 'ProductBadge',
|
|
157
|
-
uid: '
|
|
154
|
+
uid: 'gHRinlrdow',
|
|
155
|
+
childrens: []
|
|
158
156
|
},
|
|
159
157
|
{
|
|
160
158
|
advanced: {
|
|
@@ -28,7 +28,7 @@ const horizontalTwo = [
|
|
|
28
28
|
desktop: '100%'
|
|
29
29
|
},
|
|
30
30
|
pos: {
|
|
31
|
-
desktop: '
|
|
31
|
+
desktop: 'static'
|
|
32
32
|
},
|
|
33
33
|
right: {
|
|
34
34
|
desktop: '0px'
|
|
@@ -51,9 +51,6 @@ const horizontalTwo = [
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
|
-
top: {
|
|
55
|
-
desktop: '-44px'
|
|
56
|
-
},
|
|
57
54
|
z: {
|
|
58
55
|
desktop: 1
|
|
59
56
|
}
|
|
@@ -153,7 +150,8 @@ const horizontalTwo = [
|
|
|
153
150
|
}
|
|
154
151
|
},
|
|
155
152
|
tag: 'ProductBadge',
|
|
156
|
-
uid: '
|
|
153
|
+
uid: 'gHRinlrdow',
|
|
154
|
+
childrens: []
|
|
157
155
|
},
|
|
158
156
|
{
|
|
159
157
|
advanced: {
|