@gem-sdk/components 2.0.0-dev.708 → 2.0.0-dev.709

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.
@@ -75,7 +75,7 @@ const getBackgroundImageHeroBanner = (background, enableLazyImage = false, isNot
75
75
  const bg = core.getValueByDevice(background, device);
76
76
  result = {
77
77
  ...result,
78
- [device]: bg.type === 'color' ? 'url()' : `url('${!enableLazyImage ? getSrcSet.getImageSrc(core.getResponsiveValueByScreen(srcSet, device), device, isNotLiquid) : imagePlaceholder(background)}')`
78
+ [device]: bg?.type === 'color' ? 'url()' : `url('${!enableLazyImage ? getSrcSet.getImageSrc(core.getResponsiveValueByScreen(srcSet, device), device, isNotLiquid) : imagePlaceholder(background)}')`
79
79
  };
80
80
  });
81
81
  return core.makeStyleResponsive('bgi', result);
@@ -457,8 +457,8 @@ const showVideoType = (background)=>{
457
457
  ];
458
458
  return DEVICES.some((item)=>{
459
459
  const bg = core.getValueByDevice(background, item);
460
- if (bg.type === 'color' || bg.type === 'image') return false;
461
- if (bg) return bg.videoType === 'html5' && bg.videoHtml5 || bg.videoType === 'youtube' && bg.video;
460
+ if (bg?.type === 'color' || bg?.type === 'image') return false;
461
+ if (bg) return bg?.videoType === 'html5' && bg?.videoHtml5 || bg?.videoType === 'youtube' && bg?.video;
462
462
  return false;
463
463
  });
464
464
  };
@@ -11,7 +11,7 @@ const checkHasBackgroundVideo = (background)=>{
11
11
  ];
12
12
  return DEVICES.some((item)=>{
13
13
  const bg = core.getValueByDevice(background, item);
14
- if (bg) return bg.videoType === 'html5' && bg.videoHtml5 || bg.videoType === 'youtube' && bg.video;
14
+ if (bg) return bg?.videoType === 'html5' && bg?.videoHtml5 || bg?.videoType === 'youtube' && bg?.video;
15
15
  return false;
16
16
  });
17
17
  };
@@ -73,7 +73,7 @@ const getBackgroundImageHeroBanner = (background, enableLazyImage = false, isNot
73
73
  const bg = getValueByDevice(background, device);
74
74
  result = {
75
75
  ...result,
76
- [device]: bg.type === 'color' ? 'url()' : `url('${!enableLazyImage ? getImageSrc(getResponsiveValueByScreen(srcSet, device), device, isNotLiquid) : imagePlaceholder(background)}')`
76
+ [device]: bg?.type === 'color' ? 'url()' : `url('${!enableLazyImage ? getImageSrc(getResponsiveValueByScreen(srcSet, device), device, isNotLiquid) : imagePlaceholder(background)}')`
77
77
  };
78
78
  });
79
79
  return makeStyleResponsive('bgi', result);
@@ -455,8 +455,8 @@ const showVideoType = (background)=>{
455
455
  ];
456
456
  return DEVICES.some((item)=>{
457
457
  const bg = getValueByDevice(background, item);
458
- if (bg.type === 'color' || bg.type === 'image') return false;
459
- if (bg) return bg.videoType === 'html5' && bg.videoHtml5 || bg.videoType === 'youtube' && bg.video;
458
+ if (bg?.type === 'color' || bg?.type === 'image') return false;
459
+ if (bg) return bg?.videoType === 'html5' && bg?.videoHtml5 || bg?.videoType === 'youtube' && bg?.video;
460
460
  return false;
461
461
  });
462
462
  };
@@ -9,7 +9,7 @@ const checkHasBackgroundVideo = (background)=>{
9
9
  ];
10
10
  return DEVICES.some((item)=>{
11
11
  const bg = getValueByDevice(background, item);
12
- if (bg) return bg.videoType === 'html5' && bg.videoHtml5 || bg.videoType === 'youtube' && bg.video;
12
+ if (bg) return bg?.videoType === 'html5' && bg?.videoHtml5 || bg?.videoType === 'youtube' && bg?.video;
13
13
  return false;
14
14
  });
15
15
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.708",
3
+ "version": "2.0.0-dev.709",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",