@gem-sdk/core 1.53.0-dev.161 → 1.53.0-dev.165
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.
- package/dist/cjs/contexts/PageContext.js +10 -3
- package/dist/cjs/helpers/compose-advance-style.js +13 -6
- package/dist/cjs/helpers/shadow.js +2 -2
- package/dist/esm/contexts/PageContext.js +10 -3
- package/dist/esm/helpers/compose-advance-style.js +13 -6
- package/dist/esm/helpers/shadow.js +2 -2
- package/dist/types/index.d.ts +3 -1
- package/package.json +1 -1
|
@@ -64,9 +64,14 @@ const createPageStoreProvider = (data)=>zustand.createStore((set)=>({
|
|
|
64
64
|
settingType
|
|
65
65
|
}
|
|
66
66
|
}));
|
|
67
|
+
},
|
|
68
|
+
setNumberOfProduct: (numberOfProduct)=>{
|
|
69
|
+
set({
|
|
70
|
+
numberOfProduct
|
|
71
|
+
});
|
|
67
72
|
}
|
|
68
73
|
}));
|
|
69
|
-
const PageProvider = ({ children, dynamicProduct, dynamicCollection, productOffers, publicStoreFrontData, ...passProps })=>{
|
|
74
|
+
const PageProvider = ({ children, dynamicProduct, dynamicCollection, productOffers, publicStoreFrontData, numberOfProduct, ...passProps })=>{
|
|
70
75
|
const store = react.useMemo(()=>createPageStoreProvider({
|
|
71
76
|
dynamicProduct,
|
|
72
77
|
dynamicCollection,
|
|
@@ -74,12 +79,14 @@ const PageProvider = ({ children, dynamicProduct, dynamicCollection, productOffe
|
|
|
74
79
|
publicStoreFrontData,
|
|
75
80
|
interactionData: {
|
|
76
81
|
selectType: 'ELEMENT'
|
|
77
|
-
}
|
|
82
|
+
},
|
|
83
|
+
numberOfProduct
|
|
78
84
|
}), [
|
|
79
85
|
dynamicProduct,
|
|
80
86
|
dynamicCollection,
|
|
81
87
|
productOffers,
|
|
82
|
-
publicStoreFrontData
|
|
88
|
+
publicStoreFrontData,
|
|
89
|
+
numberOfProduct
|
|
83
90
|
]);
|
|
84
91
|
return /*#__PURE__*/ jsxRuntime.jsx(PageContext.Provider, {
|
|
85
92
|
...passProps,
|
|
@@ -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
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
};
|
|
@@ -62,9 +62,14 @@ const createPageStoreProvider = (data)=>createStore((set)=>({
|
|
|
62
62
|
settingType
|
|
63
63
|
}
|
|
64
64
|
}));
|
|
65
|
+
},
|
|
66
|
+
setNumberOfProduct: (numberOfProduct)=>{
|
|
67
|
+
set({
|
|
68
|
+
numberOfProduct
|
|
69
|
+
});
|
|
65
70
|
}
|
|
66
71
|
}));
|
|
67
|
-
const PageProvider = ({ children, dynamicProduct, dynamicCollection, productOffers, publicStoreFrontData, ...passProps })=>{
|
|
72
|
+
const PageProvider = ({ children, dynamicProduct, dynamicCollection, productOffers, publicStoreFrontData, numberOfProduct, ...passProps })=>{
|
|
68
73
|
const store = useMemo(()=>createPageStoreProvider({
|
|
69
74
|
dynamicProduct,
|
|
70
75
|
dynamicCollection,
|
|
@@ -72,12 +77,14 @@ const PageProvider = ({ children, dynamicProduct, dynamicCollection, productOffe
|
|
|
72
77
|
publicStoreFrontData,
|
|
73
78
|
interactionData: {
|
|
74
79
|
selectType: 'ELEMENT'
|
|
75
|
-
}
|
|
80
|
+
},
|
|
81
|
+
numberOfProduct
|
|
76
82
|
}), [
|
|
77
83
|
dynamicProduct,
|
|
78
84
|
dynamicCollection,
|
|
79
85
|
productOffers,
|
|
80
|
-
publicStoreFrontData
|
|
86
|
+
publicStoreFrontData,
|
|
87
|
+
numberOfProduct
|
|
81
88
|
]);
|
|
82
89
|
return /*#__PURE__*/ jsx(PageContext.Provider, {
|
|
83
90
|
...passProps,
|
|
@@ -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
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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/dist/types/index.d.ts
CHANGED
|
@@ -31535,6 +31535,7 @@ type PageContextProps = {
|
|
|
31535
31535
|
selectType?: 'ELEMENT' | 'PAGE';
|
|
31536
31536
|
settingType?: 'TRIGGER' | 'TARGET';
|
|
31537
31537
|
};
|
|
31538
|
+
numberOfProduct?: number;
|
|
31538
31539
|
setDynamicProduct: (data: DynamicProduct) => void;
|
|
31539
31540
|
setDynamicCollection: (data: DynamicCollection) => void;
|
|
31540
31541
|
setPostPurchaseProductOffers: (productOffers: ProductOffer[]) => void;
|
|
@@ -31544,8 +31545,9 @@ type PageContextProps = {
|
|
|
31544
31545
|
setInteractionIsSelectOnPage: (value: boolean) => void;
|
|
31545
31546
|
setInteractionSelectType: (selectType: 'ELEMENT' | 'PAGE') => void;
|
|
31546
31547
|
setInteractionSettingType: (settingType?: 'TRIGGER' | 'TARGET') => void;
|
|
31548
|
+
setNumberOfProduct: (numberOfProduct: number) => void;
|
|
31547
31549
|
};
|
|
31548
|
-
type PageProviderProps = Pick<PageContextProps, 'dynamicProduct' | 'dynamicCollection' | 'productOffers'> & {
|
|
31550
|
+
type PageProviderProps = Pick<PageContextProps, 'dynamicProduct' | 'dynamicCollection' | 'productOffers' | 'numberOfProduct'> & {
|
|
31549
31551
|
children: React.ReactNode;
|
|
31550
31552
|
key?: React.Key;
|
|
31551
31553
|
publicStoreFrontData?: PublicStoreFrontData | null;
|