@gem-sdk/components 2.1.32 → 2.1.35

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.
@@ -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 `${link} 768w,${link} 1024w,${link} 1440w`;
33
+ return link; // Since image src didn't change in size so this line of code is pointless
34
+ // return `${link} 768w,${link} 1024w,${link} 1440w`;
34
35
  };
35
36
  const getImageSrc = (image, currentDevice)=>{
36
37
  let src = image?.backupFilePath;
@@ -73,7 +73,7 @@ const Marquee = ({ children, style, builderAttrs, rawChildren, advanced, ...prop
73
73
  const itemMaxWidthValue = core.getResponsiveValueByScreen(styles?.itemMaxWidth, currentDevice);
74
74
  return itemMaxWidthValue?.includes('%');
75
75
  };
76
- const itemMaxWidthValueByScreen = (device)=>{
76
+ const getItemMaxWidthValueByScreen = (device)=>{
77
77
  let value = core.getResponsiveValueByScreen(styles?.itemMaxWidth, device);
78
78
  const itemWidthTypeValue = core.getResponsiveValueByScreen(itemWidthType, device);
79
79
  if (itemWidthTypeValue === 'FIT_CONTENT') {
@@ -84,22 +84,25 @@ const Marquee = ({ children, style, builderAttrs, rawChildren, advanced, ...prop
84
84
  }
85
85
  return value;
86
86
  };
87
+ const getMaxWidth = (device)=>{
88
+ return getItemMaxWidthValueByScreen(device) === 'auto' ? 'unset' : getItemMaxWidthValueByScreen(device);
89
+ };
87
90
  const getWidthForWrapperItem = ()=>{
88
91
  return {
89
92
  ...core.makeStyleResponsive('w', {
90
- desktop: itemMaxWidthValueByScreen('desktop'),
91
- tablet: itemMaxWidthValueByScreen('tablet'),
92
- mobile: itemMaxWidthValueByScreen('mobile')
93
+ desktop: getItemMaxWidthValueByScreen('desktop'),
94
+ tablet: getItemMaxWidthValueByScreen('tablet'),
95
+ mobile: getItemMaxWidthValueByScreen('mobile')
93
96
  }),
94
97
  ...core.makeStyleResponsive('minw', {
95
- desktop: itemMaxWidthValueByScreen('desktop'),
96
- tablet: itemMaxWidthValueByScreen('tablet'),
97
- mobile: itemMaxWidthValueByScreen('mobile')
98
+ desktop: getItemMaxWidthValueByScreen('desktop'),
99
+ tablet: getItemMaxWidthValueByScreen('tablet'),
100
+ mobile: getItemMaxWidthValueByScreen('mobile')
98
101
  }),
99
102
  ...core.makeStyleResponsive('maxw', {
100
- desktop: itemMaxWidthValueByScreen('desktop'),
101
- tablet: itemMaxWidthValueByScreen('tablet'),
102
- mobile: itemMaxWidthValueByScreen('mobile')
103
+ desktop: getMaxWidth('desktop'),
104
+ tablet: getMaxWidth('tablet'),
105
+ mobile: getMaxWidth('mobile')
103
106
  })
104
107
  };
105
108
  };
@@ -28,7 +28,8 @@ const getSrcSetLiquid = (liquid, storage)=>{
28
28
  return `{{ '${liquid}' | asset_img_url: '768x' }} 768w, {{ '${liquid}' | asset_img_url: '1024x' }} 1024w, {{ '${liquid}' | asset_img_url: 'master' }} 1440w`;
29
29
  };
30
30
  const getSrcSetLink = (link)=>{
31
- return `${link} 768w,${link} 1024w,${link} 1440w`;
31
+ return link; // Since image src didn't change in size so this line of code is pointless
32
+ // return `${link} 768w,${link} 1024w,${link} 1440w`;
32
33
  };
33
34
  const getImageSrc = (image, currentDevice)=>{
34
35
  let src = image?.backupFilePath;
@@ -69,7 +69,7 @@ const Marquee = ({ children, style, builderAttrs, rawChildren, advanced, ...prop
69
69
  const itemMaxWidthValue = getResponsiveValueByScreen(styles?.itemMaxWidth, currentDevice);
70
70
  return itemMaxWidthValue?.includes('%');
71
71
  };
72
- const itemMaxWidthValueByScreen = (device)=>{
72
+ const getItemMaxWidthValueByScreen = (device)=>{
73
73
  let value = getResponsiveValueByScreen(styles?.itemMaxWidth, device);
74
74
  const itemWidthTypeValue = getResponsiveValueByScreen(itemWidthType, device);
75
75
  if (itemWidthTypeValue === 'FIT_CONTENT') {
@@ -80,22 +80,25 @@ const Marquee = ({ children, style, builderAttrs, rawChildren, advanced, ...prop
80
80
  }
81
81
  return value;
82
82
  };
83
+ const getMaxWidth = (device)=>{
84
+ return getItemMaxWidthValueByScreen(device) === 'auto' ? 'unset' : getItemMaxWidthValueByScreen(device);
85
+ };
83
86
  const getWidthForWrapperItem = ()=>{
84
87
  return {
85
88
  ...makeStyleResponsive('w', {
86
- desktop: itemMaxWidthValueByScreen('desktop'),
87
- tablet: itemMaxWidthValueByScreen('tablet'),
88
- mobile: itemMaxWidthValueByScreen('mobile')
89
+ desktop: getItemMaxWidthValueByScreen('desktop'),
90
+ tablet: getItemMaxWidthValueByScreen('tablet'),
91
+ mobile: getItemMaxWidthValueByScreen('mobile')
89
92
  }),
90
93
  ...makeStyleResponsive('minw', {
91
- desktop: itemMaxWidthValueByScreen('desktop'),
92
- tablet: itemMaxWidthValueByScreen('tablet'),
93
- mobile: itemMaxWidthValueByScreen('mobile')
94
+ desktop: getItemMaxWidthValueByScreen('desktop'),
95
+ tablet: getItemMaxWidthValueByScreen('tablet'),
96
+ mobile: getItemMaxWidthValueByScreen('mobile')
94
97
  }),
95
98
  ...makeStyleResponsive('maxw', {
96
- desktop: itemMaxWidthValueByScreen('desktop'),
97
- tablet: itemMaxWidthValueByScreen('tablet'),
98
- mobile: itemMaxWidthValueByScreen('mobile')
99
+ desktop: getMaxWidth('desktop'),
100
+ tablet: getMaxWidth('tablet'),
101
+ mobile: getMaxWidth('mobile')
99
102
  })
100
103
  };
101
104
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.1.32",
3
+ "version": "2.1.35",
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": "2.1.30",
24
+ "@gem-sdk/core": "2.1.33",
25
25
  "@gem-sdk/styles": "2.1.31",
26
26
  "@types/react-transition-group": "^4.4.5"
27
27
  },