@gem-sdk/core 12.0.0-dev.30 → 12.0.0-dev.31
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})}})),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})},setBuyerConsentPreCheck:e=>{t({buyerConsentPreCheck:e})}})),PageProvider=({children:e,dynamicProduct:t,dynamicCollection:r,productOffers:a,dynamicDiscountOffer:n,publicStoreFrontData:i,assignedProductIds:o,isApplyAllProducts:s,sellingPlanMeta:c,buyerConsentPreCheck:P,...u})=>{let d=react.useMemo(()=>createPageStoreProvider({dynamicProduct:t,dynamicCollection:r,productOffers:a,assignedProductIds:o,isApplyAllProducts:s,dynamicDiscountOffer:n,publicStoreFrontData:i,interactionData:{selectType:"ELEMENT"},sellingPlanMeta:c,buyerConsentPreCheck:P}),[t,r,a,n,i,o,s,c,P]);return jsxRuntime.jsx(PageContext.Provider,{...u,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 n,createStore as o}from"zustand";let PageContext=r(null),createPageStoreProvider=e=>o(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})},setBuyerConsentPreCheck:e=>{t({buyerConsentPreCheck:e})}})),PageProvider=({children:a,dynamicProduct:r,dynamicCollection:n,productOffers:o,dynamicDiscountOffer:i,publicStoreFrontData:c,assignedProductIds:s,isApplyAllProducts:P,sellingPlanMeta:l,buyerConsentPreCheck:d,...u})=>{let g=t(()=>createPageStoreProvider({dynamicProduct:r,dynamicCollection:n,productOffers:o,assignedProductIds:s,isApplyAllProducts:P,dynamicDiscountOffer:i,publicStoreFrontData:c,interactionData:{selectType:"ELEMENT"},sellingPlanMeta:l,buyerConsentPreCheck:d}),[r,n,o,i,c,s,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 n(r,e,t)};export{PageProvider,usePageStore};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -35575,6 +35575,7 @@ type PageContextProps = {
|
|
|
35575
35575
|
};
|
|
35576
35576
|
sidebarMode?: string;
|
|
35577
35577
|
sellingPlanMeta?: any;
|
|
35578
|
+
buyerConsentPreCheck?: Record<string, boolean>;
|
|
35578
35579
|
setDynamicProduct: (data: DynamicProduct) => void;
|
|
35579
35580
|
setAssignedProductIds: (assignedIds: string[]) => void;
|
|
35580
35581
|
setIsApplyAllProducts: (isApplyAllProducts: boolean) => void;
|
|
@@ -35589,8 +35590,9 @@ type PageContextProps = {
|
|
|
35589
35590
|
setInteractionSettingType: (settingType?: 'TRIGGER' | 'TARGET') => void;
|
|
35590
35591
|
setSidebarMode: (mode: string) => void;
|
|
35591
35592
|
setSellingPlanMeta: (value: any) => void;
|
|
35593
|
+
setBuyerConsentPreCheck: (value: Record<string, boolean>) => void;
|
|
35592
35594
|
};
|
|
35593
|
-
type PageProviderProps = Pick<PageContextProps, 'dynamicProduct' | 'dynamicCollection' | 'productOffers' | 'dynamicDiscountOffer' | 'assignedProductIds' | 'isApplyAllProducts' | 'sellingPlanMeta'> & {
|
|
35595
|
+
type PageProviderProps = Pick<PageContextProps, 'dynamicProduct' | 'dynamicCollection' | 'productOffers' | 'dynamicDiscountOffer' | 'assignedProductIds' | 'isApplyAllProducts' | 'sellingPlanMeta' | 'buyerConsentPreCheck'> & {
|
|
35594
35596
|
children: React.ReactNode;
|
|
35595
35597
|
key?: React.Key;
|
|
35596
35598
|
publicStoreFrontData?: PublicStoreFrontData | null;
|
|
@@ -38318,6 +38320,11 @@ type PickSubscriptionControlType<T> = {
|
|
|
38318
38320
|
[K in keyof T]-?: MappedPickSubscription<K, T[K]>;
|
|
38319
38321
|
}[keyof T];
|
|
38320
38322
|
|
|
38323
|
+
type ToggleBuyerConsentControlType<T> = SharedControlType<T> & {
|
|
38324
|
+
type: 'toggle-buyer-consent';
|
|
38325
|
+
readonly?: boolean;
|
|
38326
|
+
};
|
|
38327
|
+
|
|
38321
38328
|
type BehaviorStateControlType<T> = {
|
|
38322
38329
|
id: string;
|
|
38323
38330
|
type: 'behavior-state';
|
|
@@ -38339,7 +38346,7 @@ type GroupControlType<T> = {
|
|
|
38339
38346
|
mobileOnly?: boolean;
|
|
38340
38347
|
};
|
|
38341
38348
|
};
|
|
38342
|
-
type ControlProp<T> = (ProductBundleChildControlType<T> | SelectProductBundleControlType<T> | AngleControlType<T> | CheckboxControlType<T> | ColorPickerControlType<T> | GroupControlType<T> | IconControlType<T> | InputFixContentControlType<T> | InputNumberControlType<T> | InputStepperControlType<T> | InputUnitControlType<T> | InputUnitSpacingControlType<T> | InputUnitWidthControlType<T> | InputControlType<T> | MarginControlType<T> | PaddingControlType<T> | PositionControlType<T> | RadioGroupControlType | RangeControlType<T> | SegmentControlType<T> | Option$7<T> | OptionValueControlType<T> | OptionIllustrationControlType<T> | OpenLinkControlType<T> | SelectControlType<T> | Option$4<T> | TextareaControlType<T> | ToggleControlType<T> | ImageControlType<T> | ChildrensControlType | GridControlType<T> | FlexControlType<T> | TextEditorControlType<T> | ProductControlType<T> | TypographyControlType<T> | TypographyV2ControlType<T> | MenuControlType<T> | BehaviorStateControlType<T> | PickLinkControlType<T> | BoxShadowControlType<T> | TextShadowControlType<T> | BorderControlType<T> | BorderRadiusControlType<T> | RadiusPresetControlType<T> | SizeControlType<T> | ChildItemType<T> | PickMultiProductControlType<T> | CollectionControlType<T> | BackgroundControlType<T> | VisibilityControlType<T> | SelectVariantControlType | VariantListingControlType | CountdownEvergreenType | Timezone<T> | CustomContentControlType<T> | DateTimePickerControlType | CountdownDailyType | KlaviyoCodes | YotpoLoyaltyCodes | InputWidthControlType<T> | LayoutSegmentControlType<T> | InputSpacing<T> | UniqueIdControlType<T> | PositionSquareControlType<T> | CustomCodeEditor | LayoutControlType<T> | LayoutBannerControlType<T> | SwatchesLinkControlType<T> | VariantSwatchesPresetControlType<T> | VariantSwatchesOnlyDefaultVariantControlType<T> | ProductListControlType<T> | ArticleListControlType<T> | CollectionBannerControlType<T> | Ratio<T> | StickyDisplayControlType<T> | SyncProductPropertiesControlType<T> | StepsGuide<T> | ImageShape<T> | GridArrange<T> | SizeSetting<T> | ChildIconType<T> | DropdownInput<T> | Dropdown<T> | AliPickSectionControlType<T> | ParallaxScrollingType<T> | BackgroundColorPickerType<T> | PlayPauseControlType<T> | LayoutCustomSegmentControlType<T> | SneakPeakRange<T> | SneakPeakTypeControlType<T> | SneakPeakControlType<T> | ProductInputCurrencyUnitControlType<T> | TypographyPostPurchaseControlType<T> | ProductOffersControlType<T> | DiscountAndShippingFee<T> | PostPurchaseTextareaControlType<T> | NotesControlType<T> | ButtonLayoutType<T> | ShapeSelectorControlType<T> | DisplayTriggerControlType<T> | CustomPositionControlType<T> | DealControlType<T> | ProductHandleType<T> | ColorPickerV2ControlType<T> | BorderV2ControlType<T> | CornerV2ControlType<T> | PaddingV2ControlType<T> | BackgroundImageType<T> | BackgroundVideoType<T> | ShadowV2ControlType<T> | BackgroundMediaControlType<T> | BackgroundMediaComboControlType<T> | BackgroundVideoType<T> | ImageV2ControlType<T> | LayoutSelectorControlType<T> | ComboControlType<T> | DynamicOfferQuantity<T> | ImagePostPurchase<T> | ImageSelect<T> | InputSliderControlType<T> | VariantSwatchesPresetV2ControlType<T> | LayoutCarouselSelectorControlType<T> | BannerControlType<T> | ProductSourceControlType<T> | ColumnWithSlider<T> | SellingPlanControlType<T> | PickSubscriptionControlType<T>) & {
|
|
38349
|
+
type ControlProp<T> = (ProductBundleChildControlType<T> | SelectProductBundleControlType<T> | AngleControlType<T> | CheckboxControlType<T> | ColorPickerControlType<T> | GroupControlType<T> | IconControlType<T> | InputFixContentControlType<T> | InputNumberControlType<T> | InputStepperControlType<T> | InputUnitControlType<T> | InputUnitSpacingControlType<T> | InputUnitWidthControlType<T> | InputControlType<T> | MarginControlType<T> | PaddingControlType<T> | PositionControlType<T> | RadioGroupControlType | RangeControlType<T> | SegmentControlType<T> | Option$7<T> | OptionValueControlType<T> | OptionIllustrationControlType<T> | OpenLinkControlType<T> | SelectControlType<T> | Option$4<T> | TextareaControlType<T> | ToggleControlType<T> | ImageControlType<T> | ChildrensControlType | GridControlType<T> | FlexControlType<T> | TextEditorControlType<T> | ProductControlType<T> | TypographyControlType<T> | TypographyV2ControlType<T> | MenuControlType<T> | BehaviorStateControlType<T> | PickLinkControlType<T> | BoxShadowControlType<T> | TextShadowControlType<T> | BorderControlType<T> | BorderRadiusControlType<T> | RadiusPresetControlType<T> | SizeControlType<T> | ChildItemType<T> | PickMultiProductControlType<T> | CollectionControlType<T> | BackgroundControlType<T> | VisibilityControlType<T> | SelectVariantControlType | VariantListingControlType | CountdownEvergreenType | Timezone<T> | CustomContentControlType<T> | DateTimePickerControlType | CountdownDailyType | KlaviyoCodes | YotpoLoyaltyCodes | InputWidthControlType<T> | LayoutSegmentControlType<T> | InputSpacing<T> | UniqueIdControlType<T> | PositionSquareControlType<T> | CustomCodeEditor | LayoutControlType<T> | LayoutBannerControlType<T> | SwatchesLinkControlType<T> | VariantSwatchesPresetControlType<T> | VariantSwatchesOnlyDefaultVariantControlType<T> | ProductListControlType<T> | ArticleListControlType<T> | CollectionBannerControlType<T> | Ratio<T> | StickyDisplayControlType<T> | SyncProductPropertiesControlType<T> | StepsGuide<T> | ImageShape<T> | GridArrange<T> | SizeSetting<T> | ChildIconType<T> | DropdownInput<T> | Dropdown<T> | AliPickSectionControlType<T> | ParallaxScrollingType<T> | BackgroundColorPickerType<T> | PlayPauseControlType<T> | LayoutCustomSegmentControlType<T> | SneakPeakRange<T> | SneakPeakTypeControlType<T> | SneakPeakControlType<T> | ProductInputCurrencyUnitControlType<T> | TypographyPostPurchaseControlType<T> | ProductOffersControlType<T> | DiscountAndShippingFee<T> | PostPurchaseTextareaControlType<T> | NotesControlType<T> | ButtonLayoutType<T> | ShapeSelectorControlType<T> | DisplayTriggerControlType<T> | CustomPositionControlType<T> | DealControlType<T> | ProductHandleType<T> | ColorPickerV2ControlType<T> | BorderV2ControlType<T> | CornerV2ControlType<T> | PaddingV2ControlType<T> | BackgroundImageType<T> | BackgroundVideoType<T> | ShadowV2ControlType<T> | BackgroundMediaControlType<T> | BackgroundMediaComboControlType<T> | BackgroundVideoType<T> | ImageV2ControlType<T> | LayoutSelectorControlType<T> | ComboControlType<T> | DynamicOfferQuantity<T> | ImagePostPurchase<T> | ImageSelect<T> | InputSliderControlType<T> | VariantSwatchesPresetV2ControlType<T> | LayoutCarouselSelectorControlType<T> | BannerControlType<T> | ProductSourceControlType<T> | ColumnWithSlider<T> | SellingPlanControlType<T> | PickSubscriptionControlType<T> | ToggleBuyerConsentControlType<T>) & {
|
|
38343
38350
|
validate?: ValidateType;
|
|
38344
38351
|
};
|
|
38345
38352
|
type ValidateType = {
|