@gem-sdk/components 3.0.0-pre-production.6 → 3.0.0-pre-production.8

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.
@@ -9,8 +9,8 @@ var helpers = require('./helpers.js');
9
9
  const AdaptiveImage = ({ srcSet, priority, alt, aspectRatio, layout, className, pictureClass, style, imagePlaceholder, pageContext, fallBackImg, ...props })=>{
10
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
- const srcTablet = (getSrcSet.getImageSrc(srcSet?.tablet, 'tablet') ?? getSrcSet.getImageSrc(srcSet?.desktop, 'tablet')) || fallBackImage;
13
- const srcMobile = (getSrcSet.getImageSrc(srcSet?.mobile, 'mobile') ?? getSrcSet.getImageSrc(srcSet?.tablet, 'mobile') ?? getSrcSet.getImageSrc(srcSet?.desktop, 'mobile')) || fallBackImage;
12
+ const srcTablet = getSrcSet.getImageSrc(srcSet?.tablet, 'tablet') || getSrcSet.getImageSrc(srcSet?.desktop, 'tablet') || fallBackImage;
13
+ const srcMobile = getSrcSet.getImageSrc(srcSet?.mobile, 'mobile') || getSrcSet.getImageSrc(srcSet?.tablet, 'mobile') || getSrcSet.getImageSrc(srcSet?.desktop, 'mobile') || fallBackImage;
14
14
  const { enableLazyLoadImage } = pageContext ?? {};
15
15
  return core.template`
16
16
  <picture style="border-radius: inherit" class="${core.cls(pictureClass)}">
@@ -75,7 +75,7 @@ const ProductBadge = ({ styles, builderProps, isInsideProductImage, builderAttrs
75
75
  ...sizeStyles
76
76
  } : {}, style)
77
77
  }}"
78
- data-display-content="${pageContext?.isPreviewing ? displayContentVal : `{{${displayContentVal}}}`}"
78
+ data-display-content="${pageContext?.isPreviewing ? displayContentVal : core.sanitizeLiquid(`{{${displayContentVal}}}`)}"
79
79
  >
80
80
  <div class="${shapeAlignClass} ${isDropOutsideProductImage && isTextBadge ? '' : 'gp-h-full'}">
81
81
  <div
@@ -5,8 +5,8 @@ import { createBlurDataURL } from './helpers.js';
5
5
  const AdaptiveImage = ({ srcSet, priority, alt, aspectRatio, layout, className, pictureClass, style, imagePlaceholder, pageContext, fallBackImg, ...props })=>{
6
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
- const srcTablet = (getImageSrc(srcSet?.tablet, 'tablet') ?? getImageSrc(srcSet?.desktop, 'tablet')) || fallBackImage;
9
- const srcMobile = (getImageSrc(srcSet?.mobile, 'mobile') ?? getImageSrc(srcSet?.tablet, 'mobile') ?? getImageSrc(srcSet?.desktop, 'mobile')) || fallBackImage;
8
+ const srcTablet = getImageSrc(srcSet?.tablet, 'tablet') || getImageSrc(srcSet?.desktop, 'tablet') || fallBackImage;
9
+ const srcMobile = getImageSrc(srcSet?.mobile, 'mobile') || getImageSrc(srcSet?.tablet, 'mobile') || getImageSrc(srcSet?.desktop, 'mobile') || fallBackImage;
10
10
  const { enableLazyLoadImage } = pageContext ?? {};
11
11
  return template`
12
12
  <picture style="border-radius: inherit" class="${cls(pictureClass)}">
@@ -1,4 +1,4 @@
1
- import { makeGlobalSize, template, dataStringify, RenderIf, composeTypographyClassName, composeTypographyStyle, getStyleShadow, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
1
+ import { makeGlobalSize, template, dataStringify, sanitizeLiquid, RenderIf, composeTypographyClassName, composeTypographyStyle, getStyleShadow, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
2
2
  import { getShape } from './utils/shape.js';
3
3
  import { WRAPPER_CLASS, SHAPE_CLASS, CONTENT_CLASS, IS_LIQUID } from './constants.js';
4
4
  import { generateBadgeContent } from './utils/generateLiquidContent.js';
@@ -71,7 +71,7 @@ const ProductBadge = ({ styles, builderProps, isInsideProductImage, builderAttrs
71
71
  ...sizeStyles
72
72
  } : {}, style)
73
73
  }}"
74
- data-display-content="${pageContext?.isPreviewing ? displayContentVal : `{{${displayContentVal}}}`}"
74
+ data-display-content="${pageContext?.isPreviewing ? displayContentVal : sanitizeLiquid(`{{${displayContentVal}}}`)}"
75
75
  >
76
76
  <div class="${shapeAlignClass} ${isDropOutsideProductImage && isTextBadge ? '' : 'gp-h-full'}">
77
77
  <div
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "3.0.0-pre-production.6",
3
+ "version": "3.0.0-pre-production.8",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -21,7 +21,7 @@
21
21
  "format": "prettier --write \"./src/**/*.{ts,tsx}\""
22
22
  },
23
23
  "devDependencies": {
24
- "@gem-sdk/core": "3.0.0-pre-production.6",
24
+ "@gem-sdk/core": "3.0.0-pre-production.8",
25
25
  "@gem-sdk/styles": "3.0.0-pre-production.1",
26
26
  "@types/react-transition-group": "^4.4.5"
27
27
  },