@gem-sdk/components 2.4.14 → 2.4.16
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/hero-banner/index.liquid.js +4 -3
- package/dist/cjs/banner/helpers/common.js +2 -0
- package/dist/cjs/banner/setting/HeroBanner.js +2 -1
- package/dist/cjs/button/components/Button.liquid.js +1 -1
- package/dist/cjs/image/components/AdaptiveImage.liquid.js +2 -2
- package/dist/cjs/product/components/ProductButton.liquid.js +1 -1
- package/dist/esm/banner/components/hero-banner/index.liquid.js +5 -4
- package/dist/esm/banner/helpers/common.js +2 -1
- package/dist/esm/banner/setting/HeroBanner.js +2 -1
- package/dist/esm/button/components/Button.liquid.js +1 -1
- package/dist/esm/image/components/AdaptiveImage.liquid.js +2 -2
- package/dist/esm/product/components/ProductButton.liquid.js +1 -1
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -184,7 +184,8 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
184
184
|
alt,
|
|
185
185
|
title,
|
|
186
186
|
imagePlaceholder,
|
|
187
|
-
enableLazyloadImage
|
|
187
|
+
enableLazyloadImage,
|
|
188
|
+
fallBackImg: common.fallBackImg
|
|
188
189
|
})}
|
|
189
190
|
<div class="${core.cls('gp-absolute gp-w-full gp-h-full')}">
|
|
190
191
|
<div
|
|
@@ -197,7 +198,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
197
198
|
style="${{
|
|
198
199
|
'clip-path': index.getClipPath(borderBg?.width, cornerBg)
|
|
199
200
|
}}"
|
|
200
|
-
>
|
|
201
|
+
>
|
|
201
202
|
<div class="${core.cls('hero-banner-bg-parallax gp-hero-banner-image-background', {
|
|
202
203
|
'gp-duration-[var(--duration)] group-hover/hero:gp-scale-[var(--scale)]': hoverEffect,
|
|
203
204
|
'gp-transition-transform': hoverEffect,
|
|
@@ -241,7 +242,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
241
242
|
'--top': 0,
|
|
242
243
|
'--left': 0,
|
|
243
244
|
...core.makeStyleState('op', overlayOpacity)
|
|
244
|
-
}}">
|
|
245
|
+
}}">
|
|
245
246
|
</div>`)}
|
|
246
247
|
</div>
|
|
247
248
|
${Row_liquid.default({
|
|
@@ -319,7 +319,9 @@ const mapContentPositionToHorizontal = (contentPosition)=>{
|
|
|
319
319
|
}
|
|
320
320
|
return result;
|
|
321
321
|
};
|
|
322
|
+
const fallBackImg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+';
|
|
322
323
|
|
|
324
|
+
exports.fallBackImg = fallBackImg;
|
|
323
325
|
exports.filterStyleByKeys = filterStyleByKeys;
|
|
324
326
|
exports.getBgImage = getBgImage;
|
|
325
327
|
exports.getClassAlignBanner = getClassAlignBanner;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var core = require('@gem-sdk/core');
|
|
6
6
|
var helpers = require('../../helpers.js');
|
|
7
7
|
|
|
8
|
-
const Button = ({ className, builderProps, customAttrs, pageContext, setting = {}, styles = {}, style, wrapClassName = '', advanced, nodePrice, dataId, isUseTranslatedValue =
|
|
8
|
+
const Button = ({ className, builderProps, customAttrs, pageContext, setting = {}, styles = {}, style, wrapClassName = '', advanced, nodePrice, dataId, isUseTranslatedValue = true })=>{
|
|
9
9
|
const { align, size, backgroundColor, textColor, roundedBtn, iconSpacing, globalSize } = styles;
|
|
10
10
|
const { label, iconSvg, btnLink, htmlType, disabled, loading, iconAlign, iconVisible, translate, disabledLoading = true } = setting;
|
|
11
11
|
const [wrapStyle, restStyle] = core.splitStyle([
|
|
@@ -6,8 +6,8 @@ var core = require('@gem-sdk/core');
|
|
|
6
6
|
var getSrcSet = require('../helpers/getSrcSet.js');
|
|
7
7
|
var helpers = require('./helpers.js');
|
|
8
8
|
|
|
9
|
-
const AdaptiveImage = ({ srcSet, priority, alt, aspectRatio, layout, className, pictureClass, style, imagePlaceholder, enableLazyloadImage = true, ...props })=>{
|
|
10
|
-
const fallBackImage = 'https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif';
|
|
9
|
+
const AdaptiveImage = ({ srcSet, priority, alt, aspectRatio, layout, className, pictureClass, style, imagePlaceholder, enableLazyloadImage = true, fallBackImg, ...props })=>{
|
|
10
|
+
const fallBackImage = fallBackImg || 'https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif';
|
|
11
11
|
const srcDesktop = getSrcSet.getImageSrc(srcSet?.desktop, 'desktop') || fallBackImage;
|
|
12
12
|
const srcTablet = (getSrcSet.getImageSrc(srcSet?.tablet, 'tablet') ?? getSrcSet.getImageSrc(srcSet?.desktop, 'tablet')) || fallBackImage;
|
|
13
13
|
const srcMobile = (getSrcSet.getImageSrc(srcSet?.mobile, 'mobile') ?? getSrcSet.getImageSrc(srcSet?.tablet, 'mobile') ?? getSrcSet.getImageSrc(srcSet?.desktop, 'mobile')) || fallBackImage;
|
|
@@ -310,7 +310,7 @@ const ProductButton = ({ setting, builderProps, builderAttrs, style, styles, adv
|
|
|
310
310
|
},
|
|
311
311
|
pageContext,
|
|
312
312
|
nodePrice: composeNodePrice(),
|
|
313
|
-
isUseTranslatedValue:
|
|
313
|
+
isUseTranslatedValue: false
|
|
314
314
|
})}
|
|
315
315
|
</gp-product-button>
|
|
316
316
|
${core.RenderIf(core.isLocalEnv, `<script ${helpers.getSettingPreloadData('class="gps-link" delay', 'src')}="{{ 'gp-product-button.js' | asset_url }}" defer="defer"></script>`, `<script ${helpers.getSettingPreloadData('class="gps-link" delay', 'src')}="${core.baseAssetURL}/assets-v2/gp-product-button.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { makeStyleResponsive, getHeightByShapeGlobalSize, makeStyleWithDefault, getWidthByShapeGlobalSize, getPaddingGlobalSize, removeUndefinedValuesFromObject, template, cls, dataStringify, RenderIf, isLocalEnv, baseAssetURL, getResponsiveValueByScreen, makeStyle, getSingleColorVariable, getRadiusStyleActiveState, getStyleBgColor, getGradientBgrStyleByDevice, getStyleShadow, getAspectRatioGlobalSize, getStyleBackgroundByDevice, getGlobalColorStateClass, getGlobalColorStateStyle, makeStyleState } from '@gem-sdk/core';
|
|
2
2
|
import Row from '../../../grid/components/Row.liquid.js';
|
|
3
3
|
import AdaptiveImage from '../../../image/components/AdaptiveImage.liquid.js';
|
|
4
|
-
import { getVisibilityStyle, getMarginStyle, getStyleAspectRatioHeroBannerCustom, removeMarginStyle, getContentPosition, mapContentPositionToHorizontal, getClassJustify, getResponsiveSetting, getClassContentPosition, getDisplayStyleByFitContent, getClassForContentByFitContent, getClassForStretchContent, getClassSpaceBetween, getWidth, getBgImage } from '../../helpers/common.js';
|
|
4
|
+
import { getVisibilityStyle, getMarginStyle, getStyleAspectRatioHeroBannerCustom, removeMarginStyle, getContentPosition, mapContentPositionToHorizontal, getClassJustify, getResponsiveSetting, getClassContentPosition, getDisplayStyleByFitContent, fallBackImg, getClassForContentByFitContent, getClassForStretchContent, getClassSpaceBetween, getWidth, getBgImage } from '../../helpers/common.js';
|
|
5
5
|
import { getInsertLinkData, getSettingPreloadData } from '../../../helpers.js';
|
|
6
6
|
import HTML5Embed from '../../../video/components/HTML5Embed.liquid.js';
|
|
7
7
|
import { getClipPath, getStyleHeroBannerBg } from './utils/index.js';
|
|
@@ -180,7 +180,8 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
180
180
|
alt,
|
|
181
181
|
title,
|
|
182
182
|
imagePlaceholder,
|
|
183
|
-
enableLazyloadImage
|
|
183
|
+
enableLazyloadImage,
|
|
184
|
+
fallBackImg
|
|
184
185
|
})}
|
|
185
186
|
<div class="${cls('gp-absolute gp-w-full gp-h-full')}">
|
|
186
187
|
<div
|
|
@@ -193,7 +194,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
193
194
|
style="${{
|
|
194
195
|
'clip-path': getClipPath(borderBg?.width, cornerBg)
|
|
195
196
|
}}"
|
|
196
|
-
>
|
|
197
|
+
>
|
|
197
198
|
<div class="${cls('hero-banner-bg-parallax gp-hero-banner-image-background', {
|
|
198
199
|
'gp-duration-[var(--duration)] group-hover/hero:gp-scale-[var(--scale)]': hoverEffect,
|
|
199
200
|
'gp-transition-transform': hoverEffect,
|
|
@@ -237,7 +238,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
237
238
|
'--top': 0,
|
|
238
239
|
'--left': 0,
|
|
239
240
|
...makeStyleState('op', overlayOpacity)
|
|
240
|
-
}}">
|
|
241
|
+
}}">
|
|
241
242
|
</div>`)}
|
|
242
243
|
</div>
|
|
243
244
|
${Row({
|
|
@@ -317,5 +317,6 @@ const mapContentPositionToHorizontal = (contentPosition)=>{
|
|
|
317
317
|
}
|
|
318
318
|
return result;
|
|
319
319
|
};
|
|
320
|
+
const fallBackImg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+';
|
|
320
321
|
|
|
321
|
-
export { filterStyleByKeys, getBgImage, getClassAlignBanner, getClassContentPosition, getClassForContentByFitContent, getClassForStretchContent, getClassJustify, getClassSpaceBetween, getContentPosition, getDataVideoHeroBannerResponsive, getDisplayStyleByFitContent, getMarginStyle, getResponsiveSetting, getStyleAspectRatioHeroBannerCustom, getVisibilityStyle, getWidth, mapContentPositionToHorizontal, removeMarginStyle };
|
|
322
|
+
export { fallBackImg, filterStyleByKeys, getBgImage, getClassAlignBanner, getClassContentPosition, getClassForContentByFitContent, getClassForStretchContent, getClassJustify, getClassSpaceBetween, getContentPosition, getDataVideoHeroBannerResponsive, getDisplayStyleByFitContent, getMarginStyle, getResponsiveSetting, getStyleAspectRatioHeroBannerCustom, getVisibilityStyle, getWidth, mapContentPositionToHorizontal, removeMarginStyle };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { splitStyle, makeStyleResponsive, makeGlobalSize, composeTypographyClassName, composeTypographyStyle, composeBorderCss, composeCornerCss, getSingleColorVariable, template, cls, getGlobalColorStateClass, getGlobalColorStateStyle, composeRadius, getStyleShadowState, composeSize, getGradientBgrStyleForButton, RenderIf } from '@gem-sdk/core';
|
|
2
2
|
import { getInsertLinkData, getDynamicSourceLocales } from '../../helpers.js';
|
|
3
3
|
|
|
4
|
-
const Button = ({ className, builderProps, customAttrs, pageContext, setting = {}, styles = {}, style, wrapClassName = '', advanced, nodePrice, dataId, isUseTranslatedValue =
|
|
4
|
+
const Button = ({ className, builderProps, customAttrs, pageContext, setting = {}, styles = {}, style, wrapClassName = '', advanced, nodePrice, dataId, isUseTranslatedValue = true })=>{
|
|
5
5
|
const { align, size, backgroundColor, textColor, roundedBtn, iconSpacing, globalSize } = styles;
|
|
6
6
|
const { label, iconSvg, btnLink, htmlType, disabled, loading, iconAlign, iconVisible, translate, disabledLoading = true } = setting;
|
|
7
7
|
const [wrapStyle, restStyle] = splitStyle([
|
|
@@ -2,8 +2,8 @@ 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, enableLazyloadImage = true, ...props })=>{
|
|
6
|
-
const fallBackImage = 'https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif';
|
|
5
|
+
const AdaptiveImage = ({ srcSet, priority, alt, aspectRatio, layout, className, pictureClass, style, imagePlaceholder, enableLazyloadImage = true, fallBackImg, ...props })=>{
|
|
6
|
+
const fallBackImage = fallBackImg || '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;
|
|
9
9
|
const srcMobile = (getImageSrc(srcSet?.mobile, 'mobile') ?? getImageSrc(srcSet?.tablet, 'mobile') ?? getImageSrc(srcSet?.desktop, 'mobile')) || fallBackImage;
|
|
@@ -306,7 +306,7 @@ const ProductButton = ({ setting, builderProps, builderAttrs, style, styles, adv
|
|
|
306
306
|
},
|
|
307
307
|
pageContext,
|
|
308
308
|
nodePrice: composeNodePrice(),
|
|
309
|
-
isUseTranslatedValue:
|
|
309
|
+
isUseTranslatedValue: false
|
|
310
310
|
})}
|
|
311
311
|
</gp-product-button>
|
|
312
312
|
${RenderIf(isLocalEnv, `<script ${getSettingPreloadData('class="gps-link" delay', 'src')}="{{ 'gp-product-button.js' | asset_url }}" defer="defer"></script>`, `<script ${getSettingPreloadData('class="gps-link" delay', 'src')}="${baseAssetURL}/assets-v2/gp-product-button.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
package/dist/types/index.d.ts
CHANGED