@gem-sdk/core 1.44.0-dev.60 → 1.44.0-dev.69

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.
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  /* eslint-disable */ const PageViewUpDocument = `
4
- mutation pageViewUp($pageHandle: String!, $userAgent: String!) {
5
- pageViewUp(pageHandle: $pageHandle, userAgent: $userAgent)
4
+ mutation pageViewUp($pageHandle: String!) {
5
+ pageViewUp(pageHandle: $pageHandle)
6
6
  }
7
7
  `;
8
8
 
@@ -181,6 +181,9 @@ function getCustomPaddingSizeCSSByDevice(globalSize, device) {
181
181
  const getPaddingGlobalSize = (globalSize)=>{
182
182
  return Object.assign({}, getCustomPaddingSizeCSSByDevice(globalSize, 'desktop'), getCustomPaddingSizeCSSByDevice(globalSize, 'tablet'), getCustomPaddingSizeCSSByDevice(globalSize, 'mobile'));
183
183
  };
184
+ const getValueByDevice = (value, device)=>{
185
+ return value?.[device] === undefined ? value?.desktop === undefined ? value?.tablet : value?.desktop : value?.[device];
186
+ };
184
187
 
185
188
  exports.composeSize = composeSize;
186
189
  exports.composeSizeCss = composeSizeCss;
@@ -189,6 +192,7 @@ exports.getAspectRatioGlobalSize = getAspectRatioGlobalSize;
189
192
  exports.getGlobalSizeGap = getGlobalSizeGap;
190
193
  exports.getHeightByShapeGlobalSize = getHeightByShapeGlobalSize;
191
194
  exports.getPaddingGlobalSize = getPaddingGlobalSize;
195
+ exports.getValueByDevice = getValueByDevice;
192
196
  exports.getWidthByShapeGlobalSize = getWidthByShapeGlobalSize;
193
197
  exports.getWidthHeightGlobalSize = getWidthHeightGlobalSize;
194
198
  exports.makeGlobalSize = makeGlobalSize;
package/dist/cjs/index.js CHANGED
@@ -273,6 +273,7 @@ exports.getAspectRatioGlobalSize = size.getAspectRatioGlobalSize;
273
273
  exports.getGlobalSizeGap = size.getGlobalSizeGap;
274
274
  exports.getHeightByShapeGlobalSize = size.getHeightByShapeGlobalSize;
275
275
  exports.getPaddingGlobalSize = size.getPaddingGlobalSize;
276
+ exports.getValueByDevice = size.getValueByDevice;
276
277
  exports.getWidthByShapeGlobalSize = size.getWidthByShapeGlobalSize;
277
278
  exports.getWidthHeightGlobalSize = size.getWidthHeightGlobalSize;
278
279
  exports.makeGlobalSize = size.makeGlobalSize;
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable */ const PageViewUpDocument = `
2
- mutation pageViewUp($pageHandle: String!, $userAgent: String!) {
3
- pageViewUp(pageHandle: $pageHandle, userAgent: $userAgent)
2
+ mutation pageViewUp($pageHandle: String!) {
3
+ pageViewUp(pageHandle: $pageHandle)
4
4
  }
5
5
  `;
6
6
 
@@ -179,5 +179,8 @@ function getCustomPaddingSizeCSSByDevice(globalSize, device) {
179
179
  const getPaddingGlobalSize = (globalSize)=>{
180
180
  return Object.assign({}, getCustomPaddingSizeCSSByDevice(globalSize, 'desktop'), getCustomPaddingSizeCSSByDevice(globalSize, 'tablet'), getCustomPaddingSizeCSSByDevice(globalSize, 'mobile'));
181
181
  };
182
+ const getValueByDevice = (value, device)=>{
183
+ return value?.[device] === undefined ? value?.desktop === undefined ? value?.tablet : value?.desktop : value?.[device];
184
+ };
182
185
 
183
- export { composeSize, composeSizeCss, genSizeClass, getAspectRatioGlobalSize, getGlobalSizeGap, getHeightByShapeGlobalSize, getPaddingGlobalSize, getWidthByShapeGlobalSize, getWidthHeightGlobalSize, makeGlobalSize, makeGlobalSizeIcon, makeStyleWithDefault };
186
+ export { composeSize, composeSizeCss, genSizeClass, getAspectRatioGlobalSize, getGlobalSizeGap, getHeightByShapeGlobalSize, getPaddingGlobalSize, getValueByDevice, getWidthByShapeGlobalSize, getWidthHeightGlobalSize, makeGlobalSize, makeGlobalSizeIcon, makeStyleWithDefault };
package/dist/esm/index.js CHANGED
@@ -67,7 +67,7 @@ export { generateCollectionQueryKey, generateProductQueryKey, generateProductsQu
67
67
  export { composeCornerCss, composeRadius, composeRadiusResponsive, getCornerCSSFromGlobal, getCustomRadius, getRadiusCSSFromGlobal, getRadiusStyleActiveState } from './helpers/radius.js';
68
68
  export { RenderIf, composeMemo, dataStringify, props, removeUndefinedValuesFromObject, styles, template } from './helpers/render.js';
69
69
  export { composeShadowCss, getStyleShadow, getStyleShadowState, parseValueWithUnit } from './helpers/shadow.js';
70
- export { composeSize, composeSizeCss, genSizeClass, getAspectRatioGlobalSize, getGlobalSizeGap, getHeightByShapeGlobalSize, getPaddingGlobalSize, getWidthByShapeGlobalSize, getWidthHeightGlobalSize, makeGlobalSize, makeGlobalSizeIcon, makeStyleWithDefault } from './helpers/size.js';
70
+ export { composeSize, composeSizeCss, genSizeClass, getAspectRatioGlobalSize, getGlobalSizeGap, getHeightByShapeGlobalSize, getPaddingGlobalSize, getValueByDevice, getWidthByShapeGlobalSize, getWidthHeightGlobalSize, makeGlobalSize, makeGlobalSizeIcon, makeStyleWithDefault } from './helpers/size.js';
71
71
  export { composeFallbackTypographyStyle, composeFontFamilyTypographyV2, composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, genTypoClass } from './helpers/typography.js';
72
72
  export { useAddToCart } from './hooks/cart/use-add-to-cart.js';
73
73
  export { useCartData } from './hooks/cart/use-cart-data.js';