@gem-sdk/components 2.0.0-dev.614 → 2.0.0-dev.616

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.
@@ -184,7 +184,8 @@ const HeroBannerItem = (props)=>{
184
184
  style: adaptiveStyle,
185
185
  alt: alt,
186
186
  title: title,
187
- enableLazyloadImage: enableLazyImage
187
+ enableLazyloadImage: enableLazyImage,
188
+ fallbackImg: common.fallbackImg
188
189
  })
189
190
  ]
190
191
  });
@@ -177,7 +177,8 @@ const HeroBannerItem = (props)=>{
177
177
  style: adaptiveStyle,
178
178
  alt,
179
179
  title,
180
- enableLazyLoadImage: enableLazyImage
180
+ enableLazyLoadImage: enableLazyImage,
181
+ fallbackImg: common.fallbackImg
181
182
  })}
182
183
  </div>
183
184
  `;
@@ -455,9 +455,11 @@ function debounce(func, wait) {
455
455
  timeout = setTimeout(()=>func.apply(this, args), wait);
456
456
  };
457
457
  }
458
+ const fallbackImg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+';
458
459
 
459
460
  exports.bgiEnableByDevice = bgiEnableByDevice;
460
461
  exports.debounce = debounce;
462
+ exports.fallbackImg = fallbackImg;
461
463
  exports.getAspectRatioSettings = getAspectRatioSettings;
462
464
  exports.getAttachmentDevice = getAttachmentDevice;
463
465
  exports.getBackgroundImageHeroBanner = getBackgroundImageHeroBanner;
@@ -90,7 +90,7 @@ const getIframeYoutubeClasses = ()=>{
90
90
  const getLazyBackgroundClasses = (device)=>{
91
91
  let classList = `gp-absolute gp-top-0 gp-invisible gp-w-full gp_lazyload gp-h-full gp_lazyforbg`;
92
92
  if (device === 'tablet') classList += ` gp_lazybg_tl`;
93
- if (device === 'tablet') classList += ` gp_lazybg_mb`;
93
+ if (device === 'mobile') classList += ` gp_lazybg_mb`;
94
94
  return composeClasses(classList);
95
95
  };
96
96
 
@@ -174,7 +174,8 @@ const SettingsV2 = [
174
174
  max: 1,
175
175
  step: 0.1,
176
176
  compoDefaultValue: 0.6,
177
- default: 0.6
177
+ default: 0.6,
178
+ ignoreMax: true
178
179
  },
179
180
  {
180
181
  id: 'alignBanner',
@@ -4,12 +4,12 @@ var getSrcSet = require('../../helpers/getSrcSet.js');
4
4
  var constants = require('./constants.js');
5
5
 
6
6
  const getAdaptiveImageData = (props)=>{
7
- const { srcSet } = props;
7
+ const { srcSet, fallbackImg } = props;
8
8
  const getDeviceSource = (props)=>{
9
9
  const { isLiquid } = props ?? {};
10
- const srcDesktop = getSrcSet.getImageSrc(srcSet?.desktop, 'desktop', !isLiquid) || constants.FALLBACK_IMAGE;
11
- const srcTablet = getSrcSet.getImageSrc(srcSet?.tablet, 'tablet', !isLiquid) || getSrcSet.getImageSrc(srcSet?.desktop, 'tablet', !isLiquid) || constants.FALLBACK_IMAGE;
12
- const srcMobile = getSrcSet.getImageSrc(srcSet?.mobile, 'mobile', !isLiquid) || getSrcSet.getImageSrc(srcSet?.tablet, 'mobile', !isLiquid) || getSrcSet.getImageSrc(srcSet?.desktop, 'mobile', !isLiquid) || constants.FALLBACK_IMAGE;
10
+ const srcDesktop = getSrcSet.getImageSrc(srcSet?.desktop, 'desktop', !isLiquid) || fallbackImg || constants.FALLBACK_IMAGE;
11
+ const srcTablet = getSrcSet.getImageSrc(srcSet?.tablet, 'tablet', !isLiquid) || getSrcSet.getImageSrc(srcSet?.desktop, 'tablet', !isLiquid) || fallbackImg || constants.FALLBACK_IMAGE;
12
+ const srcMobile = getSrcSet.getImageSrc(srcSet?.mobile, 'mobile', !isLiquid) || getSrcSet.getImageSrc(srcSet?.tablet, 'mobile', !isLiquid) || getSrcSet.getImageSrc(srcSet?.desktop, 'mobile', !isLiquid) || fallbackImg || constants.FALLBACK_IMAGE;
13
13
  return {
14
14
  srcTablet,
15
15
  srcMobile,
@@ -19,7 +19,7 @@ const Tabs = (props)=>{
19
19
  const { panelWidth, childItem, labelAlign, labelTypo, labelTypoV2 } = setting ?? {};
20
20
  const { currentDevice, productID, dispatchEventTabActive, activeTab, setActiveKey, refContainer } = useTab.useTab(setting, builderProps);
21
21
  const isNotLiquid = true;
22
- const ulClass = `wrap-width_full_${currentDevice}_${setting?.position?.[currentDevice]}_${setting?.panelWidth?.[currentDevice] === '100%'}`;
22
+ const ulClass = `wrap-width_full_${currentDevice}_${setting?.position?.[currentDevice]}_${core.getValueByDevice(setting?.panelWidth, currentDevice) === '100%'}`;
23
23
  if (setting && !setting?.labelWidth) {
24
24
  setting.labelWidth = {
25
25
  desktop: '200px'
@@ -94,9 +94,6 @@ const config = {
94
94
  desktop: {
95
95
  margin: {
96
96
  bottom: 0
97
- },
98
- padding: {
99
- bottom: 0
100
97
  }
101
98
  }
102
99
  }
@@ -8,7 +8,7 @@ import AdaptiveImage from '../../image/components/AdaptiveImage.js';
8
8
  import HTML5Embed from '../../video/components/HTML5Embed.js';
9
9
  import { getContainerStyle, getOverlayStyle, getRowStyle, getAdaptiveStyle, getBackgroundStyle, getContainBackgroundStyle, getYoutubeIframeStyle, getHtml5VideoStyle } from './common/getStyle.js';
10
10
  import { getContainerClasses, getOverlayClasses, getRowClasses, getAdaptivePictureClasses, getAdaptiveClasses, getBackgroundClasses, getContainBackgroundClasses, getHtml5VideoClasses, getWrapperYoutubeClasses, getIframeYoutubeClasses } from './common/getClasses.js';
11
- import { getAspectRatioSettings, getBackgroundImageHeroBanner, showVideoType, horizontalAlign, getWidth, scrollToContentBanner, getBgImage } from './common/common.js';
11
+ import { getAspectRatioSettings, getBackgroundImageHeroBanner, showVideoType, horizontalAlign, getWidth, scrollToContentBanner, getBgImage, fallbackImg } from './common/common.js';
12
12
  import LiteYouTubeEmbed from '../../video/components/LiteYouTubeEmbed.js';
13
13
  import { getYoutubeVideoId, youtubeVideoRegex } from '../../video/helpers/common.js';
14
14
 
@@ -180,7 +180,8 @@ const HeroBannerItem = (props)=>{
180
180
  style: adaptiveStyle,
181
181
  alt: alt,
182
182
  title: title,
183
- enableLazyloadImage: enableLazyImage
183
+ enableLazyloadImage: enableLazyImage,
184
+ fallbackImg: fallbackImg
184
185
  })
185
186
  ]
186
187
  });
@@ -5,7 +5,7 @@ import AdaptiveImage from '../../image/components/AdaptiveImage.liquid.js';
5
5
  import HTML5Embed from '../../video/components/HTML5Embed.liquid.js';
6
6
  import { getContainerStyle, getOverlayStyle, getRowStyle, getAdaptiveStyle, getBackgroundStyle, getContainBackgroundStyle, getYoutubeIframeStyle, getHtml5VideoStyle } from './common/getStyle.js';
7
7
  import { getContainerClasses, getOverlayClasses, getRowClasses, getAdaptivePictureClasses, getAdaptiveClasses, getBackgroundClasses, getContainBackgroundClasses, getHtml5VideoClasses, getWrapperYoutubeClasses, getIframeYoutubeClasses, getLazyBackgroundClasses } from './common/getClasses.js';
8
- import { getAspectRatioSettings, getBackgroundImageHeroBanner, horizontalAlign, getWidth, getBgImage, getEnableBgImageByDevice, showVideoType, getResponsiveSetting } from './common/common.js';
8
+ import { getAspectRatioSettings, getBackgroundImageHeroBanner, horizontalAlign, getWidth, getBgImage, fallbackImg, getEnableBgImageByDevice, showVideoType, getResponsiveSetting } from './common/common.js';
9
9
  import { DEVICES, getImageSrc } from '../../image/helpers/getSrcSet.js';
10
10
  import NextImage from '../../image/components/NextImage.liquid.js';
11
11
  import LiteYouTubeEmbed from '../../video/components/LiteYouTubeEmbed.liquid.js';
@@ -173,7 +173,8 @@ const HeroBannerItem = (props)=>{
173
173
  style: adaptiveStyle,
174
174
  alt,
175
175
  title,
176
- enableLazyLoadImage: enableLazyImage
176
+ enableLazyLoadImage: enableLazyImage,
177
+ fallbackImg
177
178
  })}
178
179
  </div>
179
180
  `;
@@ -453,5 +453,6 @@ function debounce(func, wait) {
453
453
  timeout = setTimeout(()=>func.apply(this, args), wait);
454
454
  };
455
455
  }
456
+ const fallbackImg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+';
456
457
 
457
- export { bgiEnableByDevice, debounce, getAspectRatioSettings, getAttachmentDevice, getBackgroundImageHeroBanner, getBgImage, getClassAlignBanner, getClassContentPosition, getClassForContentByFitContent, getClassForStretchContent, getClassSpaceBetween, getClipPath, getContentPosition, getDataVideoHeroBannerResponsive, getDisplayStyleByFitContent, getEnableBgImageByDevice, getPercentageVisible, getResponsiveSetting, getStyleAspectRatioHeroBannerCustom, getStyleHeroBannerBg, getVisibilityStyle, getWidth, horizontalAlign, imagePlaceholder, isScaleImage, mapContentPositionToHorizontal, scrollToContentBanner, showVideoType };
458
+ export { bgiEnableByDevice, debounce, fallbackImg, getAspectRatioSettings, getAttachmentDevice, getBackgroundImageHeroBanner, getBgImage, getClassAlignBanner, getClassContentPosition, getClassForContentByFitContent, getClassForStretchContent, getClassSpaceBetween, getClipPath, getContentPosition, getDataVideoHeroBannerResponsive, getDisplayStyleByFitContent, getEnableBgImageByDevice, getPercentageVisible, getResponsiveSetting, getStyleAspectRatioHeroBannerCustom, getStyleHeroBannerBg, getVisibilityStyle, getWidth, horizontalAlign, imagePlaceholder, isScaleImage, mapContentPositionToHorizontal, scrollToContentBanner, showVideoType };
@@ -88,7 +88,7 @@ const getIframeYoutubeClasses = ()=>{
88
88
  const getLazyBackgroundClasses = (device)=>{
89
89
  let classList = `gp-absolute gp-top-0 gp-invisible gp-w-full gp_lazyload gp-h-full gp_lazyforbg`;
90
90
  if (device === 'tablet') classList += ` gp_lazybg_tl`;
91
- if (device === 'tablet') classList += ` gp_lazybg_mb`;
91
+ if (device === 'mobile') classList += ` gp_lazybg_mb`;
92
92
  return composeClasses(classList);
93
93
  };
94
94
 
@@ -172,7 +172,8 @@ const SettingsV2 = [
172
172
  max: 1,
173
173
  step: 0.1,
174
174
  compoDefaultValue: 0.6,
175
- default: 0.6
175
+ default: 0.6,
176
+ ignoreMax: true
176
177
  },
177
178
  {
178
179
  id: 'alignBanner',
@@ -2,12 +2,12 @@ import { getImageSrc } from '../../helpers/getSrcSet.js';
2
2
  import { FALLBACK_IMAGE } from './constants.js';
3
3
 
4
4
  const getAdaptiveImageData = (props)=>{
5
- const { srcSet } = props;
5
+ const { srcSet, fallbackImg } = props;
6
6
  const getDeviceSource = (props)=>{
7
7
  const { isLiquid } = props ?? {};
8
- const srcDesktop = getImageSrc(srcSet?.desktop, 'desktop', !isLiquid) || FALLBACK_IMAGE;
9
- const srcTablet = getImageSrc(srcSet?.tablet, 'tablet', !isLiquid) || getImageSrc(srcSet?.desktop, 'tablet', !isLiquid) || FALLBACK_IMAGE;
10
- const srcMobile = getImageSrc(srcSet?.mobile, 'mobile', !isLiquid) || getImageSrc(srcSet?.tablet, 'mobile', !isLiquid) || getImageSrc(srcSet?.desktop, 'mobile', !isLiquid) || FALLBACK_IMAGE;
8
+ const srcDesktop = getImageSrc(srcSet?.desktop, 'desktop', !isLiquid) || fallbackImg || FALLBACK_IMAGE;
9
+ const srcTablet = getImageSrc(srcSet?.tablet, 'tablet', !isLiquid) || getImageSrc(srcSet?.desktop, 'tablet', !isLiquid) || fallbackImg || FALLBACK_IMAGE;
10
+ const srcMobile = getImageSrc(srcSet?.mobile, 'mobile', !isLiquid) || getImageSrc(srcSet?.tablet, 'mobile', !isLiquid) || getImageSrc(srcSet?.desktop, 'mobile', !isLiquid) || fallbackImg || FALLBACK_IMAGE;
11
11
  return {
12
12
  srcTablet,
13
13
  srcMobile,
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
- import { filterToolbarPreview } from '@gem-sdk/core';
3
+ import { getValueByDevice, filterToolbarPreview } from '@gem-sdk/core';
4
4
  import { Children, isValidElement } from 'react';
5
5
  import { useTab } from './hooks/useTab.js';
6
6
  import { createAttr, createStyle, createClass } from '@gem-sdk/system';
@@ -15,7 +15,7 @@ const Tabs = (props)=>{
15
15
  const { panelWidth, childItem, labelAlign, labelTypo, labelTypoV2 } = setting ?? {};
16
16
  const { currentDevice, productID, dispatchEventTabActive, activeTab, setActiveKey, refContainer } = useTab(setting, builderProps);
17
17
  const isNotLiquid = true;
18
- const ulClass = `wrap-width_full_${currentDevice}_${setting?.position?.[currentDevice]}_${setting?.panelWidth?.[currentDevice] === '100%'}`;
18
+ const ulClass = `wrap-width_full_${currentDevice}_${setting?.position?.[currentDevice]}_${getValueByDevice(setting?.panelWidth, currentDevice) === '100%'}`;
19
19
  if (setting && !setting?.labelWidth) {
20
20
  setting.labelWidth = {
21
21
  desktop: '200px'
@@ -90,9 +90,6 @@ const config = {
90
90
  desktop: {
91
91
  margin: {
92
92
  bottom: 0
93
- },
94
- padding: {
95
- bottom: 0
96
93
  }
97
94
  }
98
95
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.614",
3
+ "version": "2.0.0-dev.616",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -20,19 +20,22 @@
20
20
  "type-check": "yarn tsc --noEmit",
21
21
  "format": "prettier --write \"./src/**/*.{ts,tsx}\"",
22
22
  "relationship": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/get-control-relationship.js && node ./scripts/get-element-relationship.js",
23
- "update-img-src-3rd": "node ./scripts/update-img-src-3rd.js"
23
+ "update-img-src-3rd": "node ./scripts/update-img-src-3rd.js",
24
+ "scan-all-and-translate": "node ./scripts/scan-all-and-translate.js",
25
+ "scan-all-text": "node ./scripts/scan-all-text.js"
24
26
  },
25
27
  "devDependencies": {
26
28
  "@gem-sdk/core": "2.0.0-dev.604",
27
29
  "@gem-sdk/styles": "2.0.0-dev.571",
28
30
  "@gem-sdk/system": "2.0.0-dev.504",
29
- "@types/react-transition-group": "^4.4.5"
31
+ "@types/react-transition-group": "^4.4.5",
32
+ "xlsx": "^0.18.5"
30
33
  },
31
34
  "dependencies": {
32
35
  "@gem-sdk/keen-slider": "^6.8.8",
36
+ "node-html-parser": "^6.1.13",
33
37
  "react-transition-group": "^4.4.5",
34
- "react-youtube": "^10.1.0",
35
- "node-html-parser": "^6.1.13"
38
+ "react-youtube": "^10.1.0"
36
39
  },
37
40
  "peerDependencies": {
38
41
  "next": ">=13"