@gem-sdk/core 12.0.0-dev.87 → 12.0.0-dev.98
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,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),zustand=require("zustand");const PageContext=react.createContext(null),createPageStoreProvider=e=>zustand.createStore(t=>({...e,setAssignedProductIds:e=>{t({assignedProductIds:e})},setIsApplyAllProducts:e=>{t({isApplyAllProducts:e})},setDynamicProduct:e=>{t({dynamicProduct:e})},setDynamicCollection:e=>{t({dynamicCollection:e})},setPostPurchaseProductOffers:e=>{t({productOffers:e})},setDynamicDiscountOffer:e=>{t({dynamicDiscountOffer:e})},setSalePageProductId:e=>{t({salePageProductId:e})},setPublicStoreFrontData:e=>{t({publicStoreFrontData:e})},setInteractionIsSelectOnPage:e=>{t(t=>({interactionData:{...t.interactionData,isSelectOnPage:e}}))},setInteractionItem:e=>{t(t=>({interactionData:{...t.interactionData,item:e,isSelectOnPage:t.interactionData?.isSelectOnPage||!1}}))},setInteractionSelectType:e=>{t(t=>({interactionData:{...t.interactionData,selectType:e}}))},setInteractionSettingType:e=>{t(t=>({interactionData:{...t.interactionData,settingType:e}}))},setSidebarMode:e=>{t(()=>({sidebarMode:e}))},setSellingPlanMeta:e=>{t({sellingPlanMeta:e})},setBuyerConsentChecked:e=>{t({buyerConsentChecked:e})},
|
|
2
|
+
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),zustand=require("zustand");const PageContext=react.createContext(null),createPageStoreProvider=e=>zustand.createStore((t,r)=>({...e,setAssignedProductIds:e=>{t({assignedProductIds:e})},setIsApplyAllProducts:e=>{t({isApplyAllProducts:e})},setDynamicProduct:e=>{t({dynamicProduct:e})},setDynamicCollection:e=>{t({dynamicCollection:e})},setPostPurchaseProductOffers:e=>{t({productOffers:e})},setDynamicDiscountOffer:e=>{t({dynamicDiscountOffer:e})},setSalePageProductId:e=>{t({salePageProductId:e})},setPublicStoreFrontData:e=>{t({publicStoreFrontData:e})},setInteractionIsSelectOnPage:e=>{t(t=>({interactionData:{...t.interactionData,isSelectOnPage:e}}))},setInteractionItem:e=>{t(t=>({interactionData:{...t.interactionData,item:e,isSelectOnPage:t.interactionData?.isSelectOnPage||!1}}))},setInteractionSelectType:e=>{t(t=>({interactionData:{...t.interactionData,selectType:e}}))},setInteractionSettingType:e=>{t(t=>({interactionData:{...t.interactionData,settingType:e}}))},setSidebarMode:e=>{t(()=>({sidebarMode:e}))},setSellingPlanMeta:e=>{t({sellingPlanMeta:e})},setBuyerConsentChecked:e=>{t({buyerConsentChecked:e})},getBuyerConsentChecked:()=>r().buyerConsentChecked,setSubscriptionVisible:e=>{t({subscriptionVisible:e})},getSubscriptionVisible:()=>r().subscriptionVisible})),PageProvider=({children:e,dynamicProduct:t,dynamicCollection:r,productOffers:a,dynamicDiscountOffer:i,publicStoreFrontData:n,assignedProductIds:s,isApplyAllProducts:o,sellingPlanMeta:c,buyerConsentChecked:u,...d})=>{let P=react.useMemo(()=>createPageStoreProvider({dynamicProduct:t,dynamicCollection:r,productOffers:a,assignedProductIds:s,isApplyAllProducts:o,dynamicDiscountOffer:i,publicStoreFrontData:n,interactionData:{selectType:"ELEMENT"},sellingPlanMeta:c,buyerConsentChecked:u}),[t,r,a,i,n,s,o,c,u]);return jsxRuntime.jsx(PageContext.Provider,{...d,value:P,children:e})},usePageStore=(e,t)=>{let r=react.useContext(PageContext);if(!r)throw Error("usePageStore must be used within a PageProvider");return zustand.useStore(r,e,t)};exports.PageProvider=PageProvider,exports.usePageStore=usePageStore;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{jsx as e}from"react/jsx-runtime";import{useMemo as t,useContext as
|
|
2
|
+
import{jsx as e}from"react/jsx-runtime";import{useMemo as t,useContext as r,createContext as a}from"react";import{useStore as i,createStore as n}from"zustand";let PageContext=a(null),createPageStoreProvider=e=>n((t,r)=>({...e,setAssignedProductIds:e=>{t({assignedProductIds:e})},setIsApplyAllProducts:e=>{t({isApplyAllProducts:e})},setDynamicProduct:e=>{t({dynamicProduct:e})},setDynamicCollection:e=>{t({dynamicCollection:e})},setPostPurchaseProductOffers:e=>{t({productOffers:e})},setDynamicDiscountOffer:e=>{t({dynamicDiscountOffer:e})},setSalePageProductId:e=>{t({salePageProductId:e})},setPublicStoreFrontData:e=>{t({publicStoreFrontData:e})},setInteractionIsSelectOnPage:e=>{t(t=>({interactionData:{...t.interactionData,isSelectOnPage:e}}))},setInteractionItem:e=>{t(t=>({interactionData:{...t.interactionData,item:e,isSelectOnPage:t.interactionData?.isSelectOnPage||!1}}))},setInteractionSelectType:e=>{t(t=>({interactionData:{...t.interactionData,selectType:e}}))},setInteractionSettingType:e=>{t(t=>({interactionData:{...t.interactionData,settingType:e}}))},setSidebarMode:e=>{t(()=>({sidebarMode:e}))},setSellingPlanMeta:e=>{t({sellingPlanMeta:e})},setBuyerConsentChecked:e=>{t({buyerConsentChecked:e})},getBuyerConsentChecked:()=>r().buyerConsentChecked,setSubscriptionVisible:e=>{t({subscriptionVisible:e})},getSubscriptionVisible:()=>r().subscriptionVisible})),PageProvider=({children:r,dynamicProduct:a,dynamicCollection:i,productOffers:n,dynamicDiscountOffer:o,publicStoreFrontData:s,assignedProductIds:c,isApplyAllProducts:l,sellingPlanMeta:P,buyerConsentChecked:d,...u})=>{let g=t(()=>createPageStoreProvider({dynamicProduct:a,dynamicCollection:i,productOffers:n,assignedProductIds:c,isApplyAllProducts:l,dynamicDiscountOffer:o,publicStoreFrontData:s,interactionData:{selectType:"ELEMENT"},sellingPlanMeta:P,buyerConsentChecked:d}),[a,i,n,o,s,c,l,P,d]);return e(PageContext.Provider,{...u,value:g,children:r})},usePageStore=(e,t)=>{let a=r(PageContext);if(!a)throw Error("usePageStore must be used within a PageProvider");return i(a,e,t)};export{PageProvider,usePageStore};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -43184,7 +43184,7 @@ type PageContextProps = {
|
|
|
43184
43184
|
sidebarMode?: string;
|
|
43185
43185
|
sellingPlanMeta?: any;
|
|
43186
43186
|
buyerConsentChecked?: Record<string, boolean>;
|
|
43187
|
-
subscriptionVisible?: Record<string,
|
|
43187
|
+
subscriptionVisible?: Record<string, string[]>;
|
|
43188
43188
|
setDynamicProduct: (data: DynamicProduct) => void;
|
|
43189
43189
|
setAssignedProductIds: (assignedIds: string[]) => void;
|
|
43190
43190
|
setIsApplyAllProducts: (isApplyAllProducts: boolean) => void;
|
|
@@ -43200,10 +43200,9 @@ type PageContextProps = {
|
|
|
43200
43200
|
setSidebarMode: (mode: string) => void;
|
|
43201
43201
|
setSellingPlanMeta: (value: any) => void;
|
|
43202
43202
|
setBuyerConsentChecked: (value: Record<string, boolean>) => void;
|
|
43203
|
-
|
|
43204
|
-
|
|
43205
|
-
|
|
43206
|
-
}) => void;
|
|
43203
|
+
getBuyerConsentChecked: () => Record<string, boolean> | undefined;
|
|
43204
|
+
setSubscriptionVisible: (value: Record<string, string[]>) => void;
|
|
43205
|
+
getSubscriptionVisible: () => Record<string, string[]> | undefined;
|
|
43207
43206
|
};
|
|
43208
43207
|
type PageProviderProps = Pick<PageContextProps, 'dynamicProduct' | 'dynamicCollection' | 'productOffers' | 'dynamicDiscountOffer' | 'assignedProductIds' | 'isApplyAllProducts' | 'sellingPlanMeta' | 'buyerConsentChecked'> & {
|
|
43209
43208
|
children: React.ReactNode;
|