@gem-sdk/core 2.0.0-dev.160 → 2.0.0-dev.170

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.
@@ -23,6 +23,11 @@ const createPageStoreProvider = (data)=>zustand.createStore((set)=>({
23
23
  productOffers: productOffers
24
24
  });
25
25
  },
26
+ setDynamicDiscountOffer: (dynamicDiscountOffer)=>{
27
+ set({
28
+ dynamicDiscountOffer: dynamicDiscountOffer
29
+ });
30
+ },
26
31
  setSalePageProductId: (id)=>{
27
32
  set({
28
33
  salePageProductId: id
@@ -72,11 +77,12 @@ const createPageStoreProvider = (data)=>zustand.createStore((set)=>({
72
77
  }));
73
78
  }
74
79
  }));
75
- const PageProvider = ({ children, dynamicProduct, dynamicCollection, productOffers, publicStoreFrontData, ...passProps })=>{
80
+ const PageProvider = ({ children, dynamicProduct, dynamicCollection, productOffers, dynamicDiscountOffer, publicStoreFrontData, ...passProps })=>{
76
81
  const store = react.useMemo(()=>createPageStoreProvider({
77
82
  dynamicProduct,
78
83
  dynamicCollection,
79
84
  productOffers,
85
+ dynamicDiscountOffer,
80
86
  publicStoreFrontData,
81
87
  interactionData: {
82
88
  selectType: 'ELEMENT'
@@ -85,6 +91,7 @@ const PageProvider = ({ children, dynamicProduct, dynamicCollection, productOffe
85
91
  dynamicProduct,
86
92
  dynamicCollection,
87
93
  productOffers,
94
+ dynamicDiscountOffer,
88
95
  publicStoreFrontData
89
96
  ]);
90
97
  return /*#__PURE__*/ jsxRuntime.jsx(PageContext.Provider, {
@@ -79,6 +79,25 @@ const getResponsiveStyleShadowWithoutState = (value, styleAppliedFor, isEnableSh
79
79
  };
80
80
  }
81
81
  };
82
+ const composeShadow = (shadowInput)=>{
83
+ return {
84
+ ...getStyleShadowState(shadowInput?.desktop, 'box-shadow', {
85
+ normal: shadowInput?.desktop?.normal?.type !== 'none',
86
+ focus: shadowInput?.desktop?.focus?.type !== 'none',
87
+ hover: shadowInput?.desktop?.hover?.type !== 'none'
88
+ }),
89
+ ...getStyleShadowState(shadowInput?.tablet, 'box-shadow', {
90
+ normal: shadowInput?.tablet?.normal?.type !== 'none',
91
+ focus: shadowInput?.tablet?.focus?.type !== 'none',
92
+ hover: shadowInput?.tablet?.hover?.type !== 'none'
93
+ }, 'tablet'),
94
+ ...getStyleShadowState(shadowInput?.mobile, 'box-shadow', {
95
+ normal: shadowInput?.mobile?.normal?.type !== 'none',
96
+ focus: shadowInput?.mobile?.focus?.type !== 'none',
97
+ hover: shadowInput?.mobile?.hover?.type !== 'none'
98
+ }, 'mobile')
99
+ };
100
+ };
82
101
  const composeShadowCss = ({ hasBoxShadow, boxShadowValue, important })=>{
83
102
  if (!hasBoxShadow) return undefined;
84
103
  if (!boxShadowValue) return undefined;
@@ -87,6 +106,7 @@ const composeShadowCss = ({ hasBoxShadow, boxShadowValue, important })=>{
87
106
  return `box-shadow: ${Math.cos(parseFloat(`${boxShadowValue?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${Math.sin(parseFloat(`${boxShadowValue?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${boxShadowValue?.blur} ${boxShadowValue?.spread + ' '}${colors.getSingleColorVariable(boxShadowValue?.color)}${sub};`;
88
107
  };
89
108
 
109
+ exports.composeShadow = composeShadow;
90
110
  exports.composeShadowCss = composeShadowCss;
91
111
  exports.getResponsiveStyleShadow = getResponsiveStyleShadow;
92
112
  exports.getResponsiveStyleShadowWithoutState = getResponsiveStyleShadowWithoutState;
package/dist/cjs/index.js CHANGED
@@ -284,6 +284,7 @@ exports.props = render.props;
284
284
  exports.removeUndefinedValuesFromObject = render.removeUndefinedValuesFromObject;
285
285
  exports.styles = render.styles;
286
286
  exports.template = render.template;
287
+ exports.composeShadow = shadow.composeShadow;
287
288
  exports.composeShadowCss = shadow.composeShadowCss;
288
289
  exports.getResponsiveStyleShadow = shadow.getResponsiveStyleShadow;
289
290
  exports.getResponsiveStyleShadowWithoutState = shadow.getResponsiveStyleShadowWithoutState;
@@ -21,6 +21,11 @@ const createPageStoreProvider = (data)=>createStore((set)=>({
21
21
  productOffers: productOffers
22
22
  });
23
23
  },
24
+ setDynamicDiscountOffer: (dynamicDiscountOffer)=>{
25
+ set({
26
+ dynamicDiscountOffer: dynamicDiscountOffer
27
+ });
28
+ },
24
29
  setSalePageProductId: (id)=>{
25
30
  set({
26
31
  salePageProductId: id
@@ -70,11 +75,12 @@ const createPageStoreProvider = (data)=>createStore((set)=>({
70
75
  }));
71
76
  }
72
77
  }));
73
- const PageProvider = ({ children, dynamicProduct, dynamicCollection, productOffers, publicStoreFrontData, ...passProps })=>{
78
+ const PageProvider = ({ children, dynamicProduct, dynamicCollection, productOffers, dynamicDiscountOffer, publicStoreFrontData, ...passProps })=>{
74
79
  const store = useMemo(()=>createPageStoreProvider({
75
80
  dynamicProduct,
76
81
  dynamicCollection,
77
82
  productOffers,
83
+ dynamicDiscountOffer,
78
84
  publicStoreFrontData,
79
85
  interactionData: {
80
86
  selectType: 'ELEMENT'
@@ -83,6 +89,7 @@ const PageProvider = ({ children, dynamicProduct, dynamicCollection, productOffe
83
89
  dynamicProduct,
84
90
  dynamicCollection,
85
91
  productOffers,
92
+ dynamicDiscountOffer,
86
93
  publicStoreFrontData
87
94
  ]);
88
95
  return /*#__PURE__*/ jsx(PageContext.Provider, {
@@ -77,6 +77,25 @@ const getResponsiveStyleShadowWithoutState = (value, styleAppliedFor, isEnableSh
77
77
  };
78
78
  }
79
79
  };
80
+ const composeShadow = (shadowInput)=>{
81
+ return {
82
+ ...getStyleShadowState(shadowInput?.desktop, 'box-shadow', {
83
+ normal: shadowInput?.desktop?.normal?.type !== 'none',
84
+ focus: shadowInput?.desktop?.focus?.type !== 'none',
85
+ hover: shadowInput?.desktop?.hover?.type !== 'none'
86
+ }),
87
+ ...getStyleShadowState(shadowInput?.tablet, 'box-shadow', {
88
+ normal: shadowInput?.tablet?.normal?.type !== 'none',
89
+ focus: shadowInput?.tablet?.focus?.type !== 'none',
90
+ hover: shadowInput?.tablet?.hover?.type !== 'none'
91
+ }, 'tablet'),
92
+ ...getStyleShadowState(shadowInput?.mobile, 'box-shadow', {
93
+ normal: shadowInput?.mobile?.normal?.type !== 'none',
94
+ focus: shadowInput?.mobile?.focus?.type !== 'none',
95
+ hover: shadowInput?.mobile?.hover?.type !== 'none'
96
+ }, 'mobile')
97
+ };
98
+ };
80
99
  const composeShadowCss = ({ hasBoxShadow, boxShadowValue, important })=>{
81
100
  if (!hasBoxShadow) return undefined;
82
101
  if (!boxShadowValue) return undefined;
@@ -85,4 +104,4 @@ const composeShadowCss = ({ hasBoxShadow, boxShadowValue, important })=>{
85
104
  return `box-shadow: ${Math.cos(parseFloat(`${boxShadowValue?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${Math.sin(parseFloat(`${boxShadowValue?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${boxShadowValue?.blur} ${boxShadowValue?.spread + ' '}${getSingleColorVariable(boxShadowValue?.color)}${sub};`;
86
105
  };
87
106
 
88
- export { composeShadowCss, getResponsiveStyleShadow, getResponsiveStyleShadowWithoutState, getStyleShadow, getStyleShadowState, parseValueWithUnit };
107
+ export { composeShadow, composeShadowCss, getResponsiveStyleShadow, getResponsiveStyleShadowWithoutState, getStyleShadow, getStyleShadowState, parseValueWithUnit };
package/dist/esm/index.js CHANGED
@@ -71,7 +71,7 @@ export { checkAvailableVariantInStock, getSelectedVariant, parseSelectedOption }
71
71
  export { generateCollectionQueryKey, generateProductQueryKey, generateProductsQueryKey } from './helpers/query.js';
72
72
  export { composeCornerCss, composeRadius, composeRadiusResponsive, getCornerCSSFromGlobal, getCustomRadius, getRadiusCSSFromGlobal, getRadiusStyleActiveState } from './helpers/radius.js';
73
73
  export { RenderIf, composeMemo, dataStringify, props, removeUndefinedValuesFromObject, styles, template } from './helpers/render.js';
74
- export { composeShadowCss, getResponsiveStyleShadow, getResponsiveStyleShadowWithoutState, getStyleShadow, getStyleShadowState, parseValueWithUnit } from './helpers/shadow.js';
74
+ export { composeShadow, composeShadowCss, getResponsiveStyleShadow, getResponsiveStyleShadowWithoutState, getStyleShadow, getStyleShadowState, parseValueWithUnit } from './helpers/shadow.js';
75
75
  export { composeSize, composeSizeCss, genSizeClass, getAspectRatioGlobalSize, getGlobalSizeGap, getHeightByShapeGlobalSize, getPaddingGlobalSize, getPaddingStyleByDevice, getResponsiveStylePadding, getValueByDevice, getWidthByShapeGlobalSize, getWidthHeightGlobalSize, makeGlobalSize, makeGlobalSizeIcon, makeStyleWithDefault } from './helpers/size.js';
76
76
  export { composeFallbackTypographyStyle, composeFontFamilyTypographyV2, composeTextHoverColorCss, composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, genTypoClass } from './helpers/typography.js';
77
77
  export { useArticlesQuery, useBlogsQuery } from './hooks/articles/useArticlesQuery.js';