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

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.
@@ -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,
@@ -11,10 +11,10 @@ const useAnimationConfig = (props)=>{
11
11
  ]);
12
12
  const getAnimationConfig = react.useCallback(()=>{
13
13
  const { trigger, triggerConfig } = configByDevices;
14
- const { animation, setting } = triggerConfig[trigger];
14
+ const { animation, setting } = triggerConfig?.[trigger] ?? {};
15
15
  return {
16
16
  type: animation,
17
- setting: setting[animation],
17
+ setting: setting?.[animation],
18
18
  reverse: trigger === "hidden"
19
19
  };
20
20
  }, [
@@ -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,
@@ -9,10 +9,10 @@ const useAnimationConfig = (props)=>{
9
9
  ]);
10
10
  const getAnimationConfig = useCallback(()=>{
11
11
  const { trigger, triggerConfig } = configByDevices;
12
- const { animation, setting } = triggerConfig[trigger];
12
+ const { animation, setting } = triggerConfig?.[trigger] ?? {};
13
13
  return {
14
14
  type: animation,
15
- setting: setting[animation],
15
+ setting: setting?.[animation],
16
16
  reverse: trigger === "hidden"
17
17
  };
18
18
  }, [
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.53.0-dev.162",
3
+ "version": "1.53.0-dev.172",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "devDependencies": {
30
30
  "@gem-sdk/adapter-shopify": "1.53.0-dev.105",
31
- "@gem-sdk/styles": "1.53.0-dev.151",
31
+ "@gem-sdk/styles": "1.53.0-dev.168",
32
32
  "@types/classnames": "^2.3.1"
33
33
  },
34
34
  "dependencies": {