@gem-sdk/core 12.0.0-dev.81 → 12.0.0-dev.82
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})}})),PageProvider=({children:e,dynamicProduct:t,dynamicCollection:
|
|
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})},setSubscriptionVisible:({isShow:e,productID:r})=>{t(t=>({subscriptionVisible:{...t.subscriptionVisible??{},[r]:e}}))}})),PageProvider=({children:e,dynamicProduct:t,dynamicCollection:r,productOffers:a,dynamicDiscountOffer:i,publicStoreFrontData:n,assignedProductIds:s,isApplyAllProducts:o,sellingPlanMeta:c,buyerConsentChecked:u,...P})=>{let d=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,{...P,value:d,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 a,createContext as r}from"react";import{useStore as
|
|
2
|
+
import{jsx as e}from"react/jsx-runtime";import{useMemo as t,useContext as a,createContext as r}from"react";import{useStore as i,createStore as n}from"zustand";let PageContext=r(null),createPageStoreProvider=e=>n(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})},setSubscriptionVisible:({isShow:e,productID:a})=>{t(t=>({subscriptionVisible:{...t.subscriptionVisible??{},[a]:e}}))}})),PageProvider=({children:a,dynamicProduct:r,dynamicCollection:i,productOffers:n,dynamicDiscountOffer:o,publicStoreFrontData:s,assignedProductIds:c,isApplyAllProducts:P,sellingPlanMeta:l,buyerConsentChecked:d,...u})=>{let g=t(()=>createPageStoreProvider({dynamicProduct:r,dynamicCollection:i,productOffers:n,assignedProductIds:c,isApplyAllProducts:P,dynamicDiscountOffer:o,publicStoreFrontData:s,interactionData:{selectType:"ELEMENT"},sellingPlanMeta:l,buyerConsentChecked:d}),[r,i,n,o,s,c,P,l,d]);return e(PageContext.Provider,{...u,value:g,children:a})},usePageStore=(e,t)=>{let r=a(PageContext);if(!r)throw Error("usePageStore must be used within a PageProvider");return i(r,e,t)};export{PageProvider,usePageStore};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -43184,6 +43184,7 @@ type PageContextProps = {
|
|
|
43184
43184
|
sidebarMode?: string;
|
|
43185
43185
|
sellingPlanMeta?: any;
|
|
43186
43186
|
buyerConsentChecked?: Record<string, boolean>;
|
|
43187
|
+
subscriptionVisible?: Record<string, boolean>;
|
|
43187
43188
|
setDynamicProduct: (data: DynamicProduct) => void;
|
|
43188
43189
|
setAssignedProductIds: (assignedIds: string[]) => void;
|
|
43189
43190
|
setIsApplyAllProducts: (isApplyAllProducts: boolean) => void;
|
|
@@ -43199,6 +43200,10 @@ type PageContextProps = {
|
|
|
43199
43200
|
setSidebarMode: (mode: string) => void;
|
|
43200
43201
|
setSellingPlanMeta: (value: any) => void;
|
|
43201
43202
|
setBuyerConsentChecked: (value: Record<string, boolean>) => void;
|
|
43203
|
+
setSubscriptionVisible: (params: {
|
|
43204
|
+
productID: string;
|
|
43205
|
+
isShow: boolean;
|
|
43206
|
+
}) => void;
|
|
43202
43207
|
};
|
|
43203
43208
|
type PageProviderProps = Pick<PageContextProps, 'dynamicProduct' | 'dynamicCollection' | 'productOffers' | 'dynamicDiscountOffer' | 'assignedProductIds' | 'isApplyAllProducts' | 'sellingPlanMeta' | 'buyerConsentChecked'> & {
|
|
43204
43209
|
children: React.ReactNode;
|