@gem-sdk/core 1.21.9 → 1.21.10
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/ProductContext.js +5 -3
- package/dist/cjs/hooks/useProduct.js +4 -0
- package/dist/cjs/index.js +1 -0
- package/dist/esm/contexts/ProductContext.js +5 -3
- package/dist/esm/hooks/useProduct.js +4 -1
- package/dist/esm/index.js +1 -1
- package/dist/types/index.d.ts +4 -2
- package/package.json +1 -1
|
@@ -96,7 +96,7 @@ const createProductStoreProvider = (data)=>zustand.createStore((set, get)=>({
|
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
98
|
}));
|
|
99
|
-
const ProductProvider = ({ children, product, initialVariantId, quantity = 1 })=>{
|
|
99
|
+
const ProductProvider = ({ children, product, initialVariantId, quantity = 1, isSyncProduct })=>{
|
|
100
100
|
const uiqueId = react.useId();
|
|
101
101
|
const store = react.useMemo(()=>{
|
|
102
102
|
let selectedOptions = {};
|
|
@@ -122,13 +122,15 @@ const ProductProvider = ({ children, product, initialVariantId, quantity = 1 })=
|
|
|
122
122
|
quantity,
|
|
123
123
|
selectedOptions,
|
|
124
124
|
uiqueId,
|
|
125
|
-
featuredImageGlobal
|
|
125
|
+
featuredImageGlobal,
|
|
126
|
+
isSyncProduct
|
|
126
127
|
});
|
|
127
128
|
}, [
|
|
128
129
|
initialVariantId,
|
|
129
130
|
product,
|
|
130
131
|
quantity,
|
|
131
|
-
uiqueId
|
|
132
|
+
uiqueId,
|
|
133
|
+
isSyncProduct
|
|
132
134
|
]);
|
|
133
135
|
return /*#__PURE__*/ jsxRuntime.jsx(ProductContext.Provider, {
|
|
134
136
|
value: store,
|
|
@@ -20,6 +20,9 @@ const useFeaturedImageGlobal = ()=>{
|
|
|
20
20
|
const useProductProperties = ()=>{
|
|
21
21
|
return ProductContext.useProductStore((s)=>s.properties);
|
|
22
22
|
};
|
|
23
|
+
const useIsSyncProduct = ()=>{
|
|
24
|
+
return ProductContext.useProductStore((s)=>s.isSyncProduct);
|
|
25
|
+
};
|
|
23
26
|
const useQuantity = ()=>{
|
|
24
27
|
const quantity = ProductContext.useProductStore((s)=>s.quantity);
|
|
25
28
|
const decrement = ProductContext.useProductStore((s)=>s.decrementQuantity);
|
|
@@ -144,6 +147,7 @@ exports.useCheckAvailableVariantInStock = useCheckAvailableVariantInStock;
|
|
|
144
147
|
exports.useCurrentVariant = useCurrentVariant;
|
|
145
148
|
exports.useCurrentVariantInStock = useCurrentVariantInStock;
|
|
146
149
|
exports.useFeaturedImageGlobal = useFeaturedImageGlobal;
|
|
150
|
+
exports.useIsSyncProduct = useIsSyncProduct;
|
|
147
151
|
exports.useProduct = useProduct;
|
|
148
152
|
exports.useProductProperties = useProductProperties;
|
|
149
153
|
exports.useQuantity = useQuantity;
|
package/dist/cjs/index.js
CHANGED
|
@@ -268,6 +268,7 @@ exports.useCheckAvailableVariantInStock = useProduct.useCheckAvailableVariantInS
|
|
|
268
268
|
exports.useCurrentVariant = useProduct.useCurrentVariant;
|
|
269
269
|
exports.useCurrentVariantInStock = useProduct.useCurrentVariantInStock;
|
|
270
270
|
exports.useFeaturedImageGlobal = useProduct.useFeaturedImageGlobal;
|
|
271
|
+
exports.useIsSyncProduct = useProduct.useIsSyncProduct;
|
|
271
272
|
exports.useProduct = useProduct.useProduct;
|
|
272
273
|
exports.useProductProperties = useProduct.useProductProperties;
|
|
273
274
|
exports.useQuantity = useProduct.useQuantity;
|
|
@@ -94,7 +94,7 @@ const createProductStoreProvider = (data)=>createStore((set, get)=>({
|
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
}));
|
|
97
|
-
const ProductProvider = ({ children, product, initialVariantId, quantity = 1 })=>{
|
|
97
|
+
const ProductProvider = ({ children, product, initialVariantId, quantity = 1, isSyncProduct })=>{
|
|
98
98
|
const uiqueId = useId();
|
|
99
99
|
const store = useMemo(()=>{
|
|
100
100
|
let selectedOptions = {};
|
|
@@ -120,13 +120,15 @@ const ProductProvider = ({ children, product, initialVariantId, quantity = 1 })=
|
|
|
120
120
|
quantity,
|
|
121
121
|
selectedOptions,
|
|
122
122
|
uiqueId,
|
|
123
|
-
featuredImageGlobal
|
|
123
|
+
featuredImageGlobal,
|
|
124
|
+
isSyncProduct
|
|
124
125
|
});
|
|
125
126
|
}, [
|
|
126
127
|
initialVariantId,
|
|
127
128
|
product,
|
|
128
129
|
quantity,
|
|
129
|
-
uiqueId
|
|
130
|
+
uiqueId,
|
|
131
|
+
isSyncProduct
|
|
130
132
|
]);
|
|
131
133
|
return /*#__PURE__*/ jsx(ProductContext.Provider, {
|
|
132
134
|
value: store,
|
|
@@ -18,6 +18,9 @@ const useFeaturedImageGlobal = ()=>{
|
|
|
18
18
|
const useProductProperties = ()=>{
|
|
19
19
|
return useProductStore((s)=>s.properties);
|
|
20
20
|
};
|
|
21
|
+
const useIsSyncProduct = ()=>{
|
|
22
|
+
return useProductStore((s)=>s.isSyncProduct);
|
|
23
|
+
};
|
|
21
24
|
const useQuantity = ()=>{
|
|
22
25
|
const quantity = useProductStore((s)=>s.quantity);
|
|
23
26
|
const decrement = useProductStore((s)=>s.decrementQuantity);
|
|
@@ -138,4 +141,4 @@ const useCheckAvailableVariantInStock = (optionId, optionValue)=>{
|
|
|
138
141
|
}) : false;
|
|
139
142
|
};
|
|
140
143
|
|
|
141
|
-
export { useCheckAvailableVariantInStock, useCurrentVariant, useCurrentVariantInStock, useFeaturedImageGlobal, useProduct, useProductProperties, useQuantity, useSelectedOption, useUniqProductID, useVariant, useVariantOutStock, useVariants };
|
|
144
|
+
export { useCheckAvailableVariantInStock, useCurrentVariant, useCurrentVariantInStock, useFeaturedImageGlobal, useIsSyncProduct, useProduct, useProductProperties, useQuantity, useSelectedOption, useUniqProductID, useVariant, useVariantOutStock, useVariants };
|
package/dist/esm/index.js
CHANGED
|
@@ -80,7 +80,7 @@ export { default as useIsomorphicLayoutEffect } from './hooks/useIsomorphicLayou
|
|
|
80
80
|
export { default as useLoadScript } from './hooks/useLoadScript.js';
|
|
81
81
|
export { default as useMoney } from './hooks/useMoney.js';
|
|
82
82
|
export { usePrevious } from './hooks/usePrevious.js';
|
|
83
|
-
export { useCheckAvailableVariantInStock, useCurrentVariant, useCurrentVariantInStock, useFeaturedImageGlobal, useProduct, useProductProperties, useQuantity, useSelectedOption, useUniqProductID, useVariant, useVariantOutStock, useVariants } from './hooks/useProduct.js';
|
|
83
|
+
export { useCheckAvailableVariantInStock, useCurrentVariant, useCurrentVariantInStock, useFeaturedImageGlobal, useIsSyncProduct, useProduct, useProductProperties, useQuantity, useSelectedOption, useUniqProductID, useVariant, useVariantOutStock, useVariants } from './hooks/useProduct.js';
|
|
84
84
|
export { useProductList, useProductListProducts, useProductListSettings, useProductListStyles } from './hooks/useProductList.js';
|
|
85
85
|
export { default as useSuspenseFetch } from './hooks/useSuspenseFetch.js';
|
|
86
86
|
export { default as useSwatchesOptions } from './hooks/useSwatchesOptions.js';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7400,8 +7400,9 @@ type ProductContextProps = {
|
|
|
7400
7400
|
forceSelectedOption: (value?: Record<string, any>) => void;
|
|
7401
7401
|
isSubmit?: boolean;
|
|
7402
7402
|
updateIsSubmit: (value: boolean) => void;
|
|
7403
|
+
isSyncProduct?: boolean;
|
|
7403
7404
|
};
|
|
7404
|
-
type ProductProviderProps = Pick<ProductContextProps, 'product' | 'quantity' | 'selectedOptions'> & {
|
|
7405
|
+
type ProductProviderProps = Pick<ProductContextProps, 'product' | 'quantity' | 'selectedOptions' | 'isSyncProduct'> & {
|
|
7405
7406
|
initialVariantId?: string;
|
|
7406
7407
|
readOnly?: boolean;
|
|
7407
7408
|
children: React.ReactNode;
|
|
@@ -9610,6 +9611,7 @@ declare const useProductProperties: () => {
|
|
|
9610
9611
|
value?: string | undefined;
|
|
9611
9612
|
required?: boolean | undefined;
|
|
9612
9613
|
}[] | undefined;
|
|
9614
|
+
declare const useIsSyncProduct: () => boolean | undefined;
|
|
9613
9615
|
declare const useQuantity: () => {
|
|
9614
9616
|
quantity: number | undefined;
|
|
9615
9617
|
increment: () => void;
|
|
@@ -9674,4 +9676,4 @@ type PublishedThemePageSelectFragment = Pick<PublishedThemePage, 'id' | 'name' |
|
|
|
9674
9676
|
|
|
9675
9677
|
declare const getProductBySlug: (fetcher: FetchFunc, slug?: string) => Promise<ProductSelectFragment>;
|
|
9676
9678
|
|
|
9677
|
-
export { AddOn, AddonProvider, AddonProviderProps, AlignItemProp, AlignProp, Background, BaseProps, BasePropsWrap, BlockEntity, BoldSubscriptionsWidgetType, Border, BorderStyle, BuilderComponentProvider, BuilderComponentProviderProps, BuilderEntity, BuilderEntityNested, BuilderPreviewProvider, BuilderPreviewProviderProps, BuilderProvider, BuilderProviderProps, BuilderState, Builtin, CartLineProvider, CartLineProviderProps, CollectionDetailFilterDocument, CollectionDetailFilterQueryResponse, CollectionDetailFilterQueryVariables, CollectionDocument, CollectionProvider, CollectionProviderProps, CollectionQueryResponse, CollectionQueryVariables, CollectionSelectFragment, CollectionsDocument, CollectionsQueryResponse, CollectionsQueryVariables, ColorKey, ColorType$1 as ColorType, ColorValueType, Component, ComponentPreset, ComponentSetting, ContainerProp, ControlProp, ControlUI, CornerRadius, CornerRadiusType, CustomComponentConfig, DeepPartial, ExtractState, FetchCollectionArgs, FetchFunc, FetchProductParams, FlexDirectionProp, FontName, GlobalStyleConfig, GlobalStyleResponsiveConfig, GlobalSwatchesData, GraphQLConnection, GroupPropType, HSLAColorType, HSLColorType, HexColorType, InitComponentType, InstantJudgeMeReviewsWidgetType, InstantKlaviyoWidgetType, InstantLooxReviewsWidgetType, JudgeMeReviewsWidgetType, KlaviyoWidgetType, LaiProductReviewsWidgetType, LooxReviewsWidgetType, ModalProvider, ModalProviderProps, NameDevices, NestedKeys, ObjectDeviceGlobalType, ObjectDevices, ObjectLayoutValue, OptionNormalStyle, OptionSpecialStyle, PageType, PageViewUpDocument, PageViewUpMutationResponse, PageViewUpMutationVariables, PickyStoryWidgetType, PreviewPageDocument, PreviewPageQueryResponse, PreviewPageQueryVariables, Primitive, ProductInputAnalytic, ProductListProvider, ProductListProviderProps, ProductProvider, ProductProviderProps, ProductReviewsWidgetType, ProductSelectFragment, ProductsDocument, ProductsQueryResponse, ProductsQueryVariables, PublishedThemePageSelectFragment, PublishedThemePagesDocument, PublishedThemePagesQueryResponse, PublishedThemePagesQueryVariables, RGBAColorType, RGBColorType, Ratio$1 as Ratio, RenderMemo as Render, RenderChildren, RenderIf, Render as RenderLiquid, RenderMode, RenderPreviewMemo as RenderPreview, RequiredCursorEdge, ResponsiveStateProp, RivyoWidgetType, RoundedSize, RyviuWidgetType, SectionData, SectionEntity, SectionProvider, SectionProviderProps, ShadowProps, ShadowStyle, ShadowStyleApplied, ShadowType, ShopProvider, ShopProviderProps, shop as ShopType, SizeProps, SizeSetting, SizeType, SpacingType, StampedWidgetType, StateProp, StateSelector, StateType, StoreConfig, StorePropertyDocument, StorePropertyQueryResponse, StorePropertyQueryVariables, SwatchesOptionType, SwatchesOptionValue, TransformProp, TypographyProps, TypographySetting, TypographySettingV2, TypographyType, TypographyV2Attrs, TypographyV2Props, VariantSelectFragment, VitalsWidgetType, WiserWidgetType, WrapRenderChildren, baseAssetURL, calculateFirstProduct, checkAvailableVariantInStock, cls, composeAdvanceStyle, composeBackgroundCss, composeBorderCss, composeCornerCss, composeGridLayout, composeMemo, composeRadius, composeShadowCss, composeSize, composeSizeCss, composeSpacing, composeTextColorCss, composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, convertOldLayout, dataStringify, fetchMedias, fetchVariants, flattenConnection, fpixel, genSizeClass, genTypoClass, genVariable, generateCollectionQueryKey, generateProductQueryKey, generateProductsQueryKey, getBorderStyle, getCollection, getCornerCSSFromGlobal, getCustomRadius, getGlobalColorCSSProp, getGlobalColorClass, getGlobalColorResponsiveClass, getGlobalColorResponsiveStyle, getGlobalColorStateClass, getGlobalColorStateClassDynamicBtn, getGlobalColorStateResponsiveClass, getGlobalColorStateResponsiveClassDynamicBtn, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle, getGlobalColorStyle, getProduct, getProductBySlug, getRadiusCSSFromGlobal, getRadiusStyleActiveState, getResponsiveStateValue, getResponsiveValue, getResponsiveValueByScreen, getSelectedVariant, getShortName, getSingleColorVariable, getSpacingVariable, getStyleBackgroundByDevice, getStyleShadow, getStyleShadowState, globalEvent, gridToArrayRegex, gtag, handleConvertBorderColor, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertClassColor, handleConvertClassColorDynamicBtn, isBrowser, isColor, isColumnDirectionExist, isDefined, isEmptyChildren, isLocalEnv, isSafari, loadScript, makeAspectRatio, makeHeight, makeLineClamp, makeStyle, makeStyleResponsive, makeStyleResponsiveState, makeStyleState, makeWidth, normalizeBuilderData, optionLayoutStyle, parseSelectedOption, parseValueWithUnit, prefetchQueries, props, removeNullUndefined, splitStyle, styles, template, tiktokpixel, useAddToCart, useAddon, useAddons, useBuilderComponent, useBuilderPreviewStore, useBuilderStore, useCartData, useCartDiscountCodesUpdate, useCartId, useCartLine, useCartLineStore, useCartNoteUpdate, useCartUI, useCheckAvailableVariantInStock, useCheckoutUrl, useCollection, useCollectionQuery, useCollectionStore, useCollectionsQuery, useConnectedShopify, useCreateCart, useCurrency, useCurrentDevice, useCurrentVariant, useCurrentVariantInStock, useEditorMode, useFeaturedImageGlobal, useFormatMoney, useIsSampleProduct, useIsStorefrontProduct, useIsomorphicLayoutEffect, useLazyVideo, useLoadScript, useLocale, useMatchMutate, useMobileOnly, useModalStore, useMoney, useMoneyFormat, usePageType, usePluginEnable, usePrevious, useProduct, useProductList, useProductListProducts, useProductListSettings, useProductListStore, useProductListStyles, useProductProperties, useProductQuery, useProductStore, useProductsQuery, useQuantity, useRemoveCartItem, useSection, useSectionStore, useSelectedOption, useShopStore, useStoreFront, useSuspenseFetch, useSwatches, useSwatchesOptions, useUniqProductID, useUpdateCartItem, useVariant, useVariantOutStock, useVariants, validateEmail };
|
|
9679
|
+
export { AddOn, AddonProvider, AddonProviderProps, AlignItemProp, AlignProp, Background, BaseProps, BasePropsWrap, BlockEntity, BoldSubscriptionsWidgetType, Border, BorderStyle, BuilderComponentProvider, BuilderComponentProviderProps, BuilderEntity, BuilderEntityNested, BuilderPreviewProvider, BuilderPreviewProviderProps, BuilderProvider, BuilderProviderProps, BuilderState, Builtin, CartLineProvider, CartLineProviderProps, CollectionDetailFilterDocument, CollectionDetailFilterQueryResponse, CollectionDetailFilterQueryVariables, CollectionDocument, CollectionProvider, CollectionProviderProps, CollectionQueryResponse, CollectionQueryVariables, CollectionSelectFragment, CollectionsDocument, CollectionsQueryResponse, CollectionsQueryVariables, ColorKey, ColorType$1 as ColorType, ColorValueType, Component, ComponentPreset, ComponentSetting, ContainerProp, ControlProp, ControlUI, CornerRadius, CornerRadiusType, CustomComponentConfig, DeepPartial, ExtractState, FetchCollectionArgs, FetchFunc, FetchProductParams, FlexDirectionProp, FontName, GlobalStyleConfig, GlobalStyleResponsiveConfig, GlobalSwatchesData, GraphQLConnection, GroupPropType, HSLAColorType, HSLColorType, HexColorType, InitComponentType, InstantJudgeMeReviewsWidgetType, InstantKlaviyoWidgetType, InstantLooxReviewsWidgetType, JudgeMeReviewsWidgetType, KlaviyoWidgetType, LaiProductReviewsWidgetType, LooxReviewsWidgetType, ModalProvider, ModalProviderProps, NameDevices, NestedKeys, ObjectDeviceGlobalType, ObjectDevices, ObjectLayoutValue, OptionNormalStyle, OptionSpecialStyle, PageType, PageViewUpDocument, PageViewUpMutationResponse, PageViewUpMutationVariables, PickyStoryWidgetType, PreviewPageDocument, PreviewPageQueryResponse, PreviewPageQueryVariables, Primitive, ProductInputAnalytic, ProductListProvider, ProductListProviderProps, ProductProvider, ProductProviderProps, ProductReviewsWidgetType, ProductSelectFragment, ProductsDocument, ProductsQueryResponse, ProductsQueryVariables, PublishedThemePageSelectFragment, PublishedThemePagesDocument, PublishedThemePagesQueryResponse, PublishedThemePagesQueryVariables, RGBAColorType, RGBColorType, Ratio$1 as Ratio, RenderMemo as Render, RenderChildren, RenderIf, Render as RenderLiquid, RenderMode, RenderPreviewMemo as RenderPreview, RequiredCursorEdge, ResponsiveStateProp, RivyoWidgetType, RoundedSize, RyviuWidgetType, SectionData, SectionEntity, SectionProvider, SectionProviderProps, ShadowProps, ShadowStyle, ShadowStyleApplied, ShadowType, ShopProvider, ShopProviderProps, shop as ShopType, SizeProps, SizeSetting, SizeType, SpacingType, StampedWidgetType, StateProp, StateSelector, StateType, StoreConfig, StorePropertyDocument, StorePropertyQueryResponse, StorePropertyQueryVariables, SwatchesOptionType, SwatchesOptionValue, TransformProp, TypographyProps, TypographySetting, TypographySettingV2, TypographyType, TypographyV2Attrs, TypographyV2Props, VariantSelectFragment, VitalsWidgetType, WiserWidgetType, WrapRenderChildren, baseAssetURL, calculateFirstProduct, checkAvailableVariantInStock, cls, composeAdvanceStyle, composeBackgroundCss, composeBorderCss, composeCornerCss, composeGridLayout, composeMemo, composeRadius, composeShadowCss, composeSize, composeSizeCss, composeSpacing, composeTextColorCss, composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, convertOldLayout, dataStringify, fetchMedias, fetchVariants, flattenConnection, fpixel, genSizeClass, genTypoClass, genVariable, generateCollectionQueryKey, generateProductQueryKey, generateProductsQueryKey, getBorderStyle, getCollection, getCornerCSSFromGlobal, getCustomRadius, getGlobalColorCSSProp, getGlobalColorClass, getGlobalColorResponsiveClass, getGlobalColorResponsiveStyle, getGlobalColorStateClass, getGlobalColorStateClassDynamicBtn, getGlobalColorStateResponsiveClass, getGlobalColorStateResponsiveClassDynamicBtn, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle, getGlobalColorStyle, getProduct, getProductBySlug, getRadiusCSSFromGlobal, getRadiusStyleActiveState, getResponsiveStateValue, getResponsiveValue, getResponsiveValueByScreen, getSelectedVariant, getShortName, getSingleColorVariable, getSpacingVariable, getStyleBackgroundByDevice, getStyleShadow, getStyleShadowState, globalEvent, gridToArrayRegex, gtag, handleConvertBorderColor, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertClassColor, handleConvertClassColorDynamicBtn, isBrowser, isColor, isColumnDirectionExist, isDefined, isEmptyChildren, isLocalEnv, isSafari, loadScript, makeAspectRatio, makeHeight, makeLineClamp, makeStyle, makeStyleResponsive, makeStyleResponsiveState, makeStyleState, makeWidth, normalizeBuilderData, optionLayoutStyle, parseSelectedOption, parseValueWithUnit, prefetchQueries, props, removeNullUndefined, splitStyle, styles, template, tiktokpixel, useAddToCart, useAddon, useAddons, useBuilderComponent, useBuilderPreviewStore, useBuilderStore, useCartData, useCartDiscountCodesUpdate, useCartId, useCartLine, useCartLineStore, useCartNoteUpdate, useCartUI, useCheckAvailableVariantInStock, useCheckoutUrl, useCollection, useCollectionQuery, useCollectionStore, useCollectionsQuery, useConnectedShopify, useCreateCart, useCurrency, useCurrentDevice, useCurrentVariant, useCurrentVariantInStock, useEditorMode, useFeaturedImageGlobal, useFormatMoney, useIsSampleProduct, useIsStorefrontProduct, useIsSyncProduct, useIsomorphicLayoutEffect, useLazyVideo, useLoadScript, useLocale, useMatchMutate, useMobileOnly, useModalStore, useMoney, useMoneyFormat, usePageType, usePluginEnable, usePrevious, useProduct, useProductList, useProductListProducts, useProductListSettings, useProductListStore, useProductListStyles, useProductProperties, useProductQuery, useProductStore, useProductsQuery, useQuantity, useRemoveCartItem, useSection, useSectionStore, useSelectedOption, useShopStore, useStoreFront, useSuspenseFetch, useSwatches, useSwatchesOptions, useUniqProductID, useUpdateCartItem, useVariant, useVariantOutStock, useVariants, validateEmail };
|