@gem-sdk/core 1.53.0-dev.161 → 1.53.0-dev.162

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.
@@ -102,12 +102,19 @@ function composeAdvanceStyle(data, tag, pageType) {
102
102
  Object.assign(styles, radius.composeRadius(value));
103
103
  }
104
104
  if (attr === 'boxShadow') {
105
- const hasBoxShadow = {
106
- desktop: value.desktop ?? false,
107
- tablet: value.tablet ?? value.desktop ?? false,
108
- mobile: value.mobile ?? value.tablet ?? value.desktop ?? false
109
- };
110
- Object.assign(styles, shadow.getResponsiveStyleShadow(value, 'box-shadow', hasBoxShadow));
105
+ const listElementShadowV2 = [
106
+ 'Row',
107
+ 'Section'
108
+ ];
109
+ let hasBoxShadowV2 = hasBoxShadow;
110
+ if (listElementShadowV2.includes(tag || '')) {
111
+ hasBoxShadowV2 = {
112
+ desktop: value.desktop ?? {},
113
+ tablet: value.tablet ?? value.desktop ?? {},
114
+ mobile: value.mobile ?? value.tablet ?? value.desktop ?? {}
115
+ };
116
+ }
117
+ Object.assign(styles, shadow.getResponsiveStyleShadow(value, 'box-shadow', hasBoxShadowV2 ?? hasBoxShadow));
111
118
  }
112
119
  if (composeAttr === 'desktop') {
113
120
  switch(attr){
@@ -24,9 +24,9 @@ const getStyleShadow = (shadowStyle, isActiveState = false)=>{
24
24
  let { state } = shadowStyle || {};
25
25
  if (!state) state = 'normal';
26
26
  if (!styleAppliedFor || !value) return {};
27
- if (typeof value.distance == 'undefined') return {};
28
- const { value: distance, unit: unitDistance } = parseValueWithUnit(`${value?.distance}`);
29
27
  const isNoneValue = value.type === 'none';
28
+ if (typeof value.distance == 'undefined' && !isNoneValue) return {};
29
+ const { value: distance, unit: unitDistance } = parseValueWithUnit(`${value?.distance}`);
30
30
  return {
31
31
  [`-${!isActiveState ? constant.stateMapping?.[state] || '' : ''}-${getShortname.getShortName(styleAppliedFor)}${shadowStyle.screen ? `-${shadowStyle.screen}` : ''}`]: isEnableShadow && !isNoneValue ? `${Math.cos(parseFloat(`${value?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${Math.sin(parseFloat(`${value?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${value?.blur} ${styleAppliedFor === 'box-shadow' ? value?.spread + ' ' : ''}${colors.getSingleColorVariable(value?.color)}` : 'none'
32
32
  };
@@ -100,12 +100,19 @@ function composeAdvanceStyle(data, tag, pageType) {
100
100
  Object.assign(styles, composeRadius(value));
101
101
  }
102
102
  if (attr === 'boxShadow') {
103
- const hasBoxShadow = {
104
- desktop: value.desktop ?? false,
105
- tablet: value.tablet ?? value.desktop ?? false,
106
- mobile: value.mobile ?? value.tablet ?? value.desktop ?? false
107
- };
108
- Object.assign(styles, getResponsiveStyleShadow(value, 'box-shadow', hasBoxShadow));
103
+ const listElementShadowV2 = [
104
+ 'Row',
105
+ 'Section'
106
+ ];
107
+ let hasBoxShadowV2 = hasBoxShadow;
108
+ if (listElementShadowV2.includes(tag || '')) {
109
+ hasBoxShadowV2 = {
110
+ desktop: value.desktop ?? {},
111
+ tablet: value.tablet ?? value.desktop ?? {},
112
+ mobile: value.mobile ?? value.tablet ?? value.desktop ?? {}
113
+ };
114
+ }
115
+ Object.assign(styles, getResponsiveStyleShadow(value, 'box-shadow', hasBoxShadowV2 ?? hasBoxShadow));
109
116
  }
110
117
  if (composeAttr === 'desktop') {
111
118
  switch(attr){
@@ -22,9 +22,9 @@ const getStyleShadow = (shadowStyle, isActiveState = false)=>{
22
22
  let { state } = shadowStyle || {};
23
23
  if (!state) state = 'normal';
24
24
  if (!styleAppliedFor || !value) return {};
25
- if (typeof value.distance == 'undefined') return {};
26
- const { value: distance, unit: unitDistance } = parseValueWithUnit(`${value?.distance}`);
27
25
  const isNoneValue = value.type === 'none';
26
+ if (typeof value.distance == 'undefined' && !isNoneValue) return {};
27
+ const { value: distance, unit: unitDistance } = parseValueWithUnit(`${value?.distance}`);
28
28
  return {
29
29
  [`-${!isActiveState ? stateMapping?.[state] || '' : ''}-${getShortName(styleAppliedFor)}${shadowStyle.screen ? `-${shadowStyle.screen}` : ''}`]: isEnableShadow && !isNoneValue ? `${Math.cos(parseFloat(`${value?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${Math.sin(parseFloat(`${value?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${value?.blur} ${styleAppliedFor === 'box-shadow' ? value?.spread + ' ' : ''}${getSingleColorVariable(value?.color)}` : 'none'
30
30
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.53.0-dev.161",
3
+ "version": "1.53.0-dev.162",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",