@gem-sdk/core 1.9.36 → 1.9.39
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.
|
@@ -108,7 +108,6 @@ const loopFetchCollection = async (fetcher, arg)=>{
|
|
|
108
108
|
productsAfter: productAfterFetcher
|
|
109
109
|
} : undefined
|
|
110
110
|
};
|
|
111
|
-
console.log(111, variables);
|
|
112
111
|
const pageData = await fetchCollection(fetcher, variables);
|
|
113
112
|
productAfterFetcher = pageData?.collections?.edges?.[0]?.node?.products?.pageInfo?.endCursor;
|
|
114
113
|
if (currentPage === 1) {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
var useSWR = require('swr');
|
|
4
4
|
var getProducts = require('../../helpers/queries/get-products.js');
|
|
5
|
+
var query = require('../../helpers/query.js');
|
|
5
6
|
var shop = require('../shop.js');
|
|
6
7
|
var useFetchHandle = require('../useFetchHandle.js');
|
|
7
|
-
var query = require('../../helpers/query.js');
|
|
8
8
|
|
|
9
9
|
const useProductsQuery = (ids, options)=>{
|
|
10
10
|
const fetcher = useFetchHandle.useFetchHandle();
|
|
@@ -106,7 +106,6 @@ const loopFetchCollection = async (fetcher, arg)=>{
|
|
|
106
106
|
productsAfter: productAfterFetcher
|
|
107
107
|
} : undefined
|
|
108
108
|
};
|
|
109
|
-
console.log(111, variables);
|
|
110
109
|
const pageData = await fetchCollection(fetcher, variables);
|
|
111
110
|
productAfterFetcher = pageData?.collections?.edges?.[0]?.node?.products?.pageInfo?.endCursor;
|
|
112
111
|
if (currentPage === 1) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import useSWR from 'swr';
|
|
2
2
|
import { getProducts } from '../../helpers/queries/get-products.js';
|
|
3
|
+
import { generateProductsQueryKey } from '../../helpers/query.js';
|
|
3
4
|
import { useIsSampleProduct, useIsStorefrontProduct } from '../shop.js';
|
|
4
5
|
import { useFetchHandle } from '../useFetchHandle.js';
|
|
5
|
-
import { generateProductsQueryKey } from '../../helpers/query.js';
|
|
6
6
|
|
|
7
7
|
const useProductsQuery = (ids, options)=>{
|
|
8
8
|
const fetcher = useFetchHandle();
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7505,30 +7505,46 @@ type Options = {
|
|
|
7505
7505
|
declare const getStyleBackgroundByDevice: (background?: ObjectDevices<Background>, options?: Options) => {};
|
|
7506
7506
|
declare const composeBackgroundCss: (backgroundColor?: ColorValueType) => string;
|
|
7507
7507
|
|
|
7508
|
-
type
|
|
7508
|
+
type OrderByType = 'TITLE_ASC' | 'TITLE_DESC' | 'CREATED_AT_ASC' | undefined | 'none' | 'CREATED_AT_DESC';
|
|
7509
|
+
type FetchCollectionArgs = {
|
|
7509
7510
|
id?: string;
|
|
7511
|
+
numberOfProducts?: number;
|
|
7512
|
+
orderBy?: OrderByType;
|
|
7510
7513
|
isSample?: boolean;
|
|
7511
7514
|
isStorefront?: boolean;
|
|
7512
7515
|
};
|
|
7513
|
-
declare const
|
|
7514
|
-
|
|
7516
|
+
declare const getCollection: (fetcher: FetchFunc, arg: FetchCollectionArgs) => Promise<CollectionDetailFilterQueryResponse>;
|
|
7517
|
+
declare const calculateFirstProduct: (numberOfProducts: number, currentPage: number, productsPerPage: number) => number;
|
|
7518
|
+
|
|
7519
|
+
type FetchProductParams = {
|
|
7515
7520
|
id?: string;
|
|
7516
|
-
numberOfProducts?: number;
|
|
7517
|
-
orderBy?: 'TITLE_ASC' | 'TITLE_DESC' | 'CREATED_AT_ASC' | 'none' | 'CREATED_AT_DESC';
|
|
7518
7521
|
isSample?: boolean;
|
|
7522
|
+
isStorefront?: boolean;
|
|
7523
|
+
};
|
|
7524
|
+
declare const getProduct: (fetcher: FetchFunc, { id, isSample, isStorefront }: FetchProductParams) => Promise<ProductSelectFragment>;
|
|
7525
|
+
type RequiredCursorEdge<T> = {
|
|
7526
|
+
cursor: string;
|
|
7527
|
+
node?: T;
|
|
7519
7528
|
};
|
|
7520
|
-
declare const
|
|
7521
|
-
|
|
7529
|
+
declare const fetchVariants: (fetcher: FetchFunc, { id, isSample, isStorefront }: FetchProductParams) => Promise<RequiredCursorEdge<VariantSelectFragment>[]>;
|
|
7530
|
+
declare const fetchMedias: (fetcher: FetchFunc, { id, isSample, isStorefront }: FetchProductParams) => Promise<(Pick<MediaEdge, "cursor"> & {
|
|
7531
|
+
node?: Maybe<Pick<Media, "width" | "height" | "id" | "contentType" | "src" | "alt">>;
|
|
7532
|
+
})[]>;
|
|
7533
|
+
|
|
7534
|
+
type FetchProductsParams = {
|
|
7522
7535
|
ids: string[];
|
|
7523
7536
|
isSample?: boolean;
|
|
7524
7537
|
isStorefront?: boolean;
|
|
7525
7538
|
};
|
|
7526
|
-
|
|
7539
|
+
|
|
7540
|
+
declare const generateProductQueryKey: (args: FetchProductParams) => ['query/product', FetchProductParams];
|
|
7541
|
+
declare const generateCollectionQueryKey: (args: FetchCollectionArgs) => ['query/collection', FetchCollectionArgs];
|
|
7542
|
+
declare const generateProductsQueryKey: (args: FetchProductsParams) => ['query/products', FetchProductsParams];
|
|
7527
7543
|
|
|
7528
7544
|
type Func$6 = ReturnType<typeof addToCartOperation>;
|
|
7529
7545
|
type Response$6 = Awaited<ReturnType<Func$6>>;
|
|
7530
|
-
type Args$
|
|
7531
|
-
declare const useAddToCart: (options?: SWRMutationConfiguration<Response$6, any, Args$
|
|
7546
|
+
type Args$5 = Parameters<Func$6>[0];
|
|
7547
|
+
declare const useAddToCart: (options?: SWRMutationConfiguration<Response$6, any, Args$5, 'add-to-cart'>) => swr_mutation.SWRMutationResponse<_gem_sdk_adapter_common_dist_types_types_cart.Cart, any, _gem_sdk_adapter_common_dist_types_types_cart.AddCartLineInput, "add-to-cart">;
|
|
7532
7548
|
|
|
7533
7549
|
type Func$5 = ReturnType<typeof getCartOperation>;
|
|
7534
7550
|
type Response$5 = Awaited<ReturnType<Func$5>>;
|
|
@@ -7536,28 +7552,28 @@ declare const useCartData: (options?: SWRConfiguration<Response$5 | undefined, a
|
|
|
7536
7552
|
|
|
7537
7553
|
type Func$4 = ReturnType<typeof cartDiscountCodesUpdateOperation>;
|
|
7538
7554
|
type Response$4 = Awaited<ReturnType<Func$4>>;
|
|
7539
|
-
type Args$
|
|
7540
|
-
declare const useCartDiscountCodesUpdate: (options?: SWRMutationConfiguration<Response$4, any, Args$
|
|
7555
|
+
type Args$4 = Parameters<Func$4>[0];
|
|
7556
|
+
declare const useCartDiscountCodesUpdate: (options?: SWRMutationConfiguration<Response$4, any, Args$4, 'cart-discount-codes-update'>) => swr_mutation.SWRMutationResponse<_gem_sdk_adapter_common_dist_types_types_cart.Cart, any, _gem_sdk_adapter_common_dist_types_types_cart.CartDiscountCodesUpdateInput, "cart-discount-codes-update">;
|
|
7541
7557
|
|
|
7542
7558
|
type Func$3 = ReturnType<typeof cartNoteUpdateOperation>;
|
|
7543
7559
|
type Response$3 = Awaited<ReturnType<Func$3>>;
|
|
7544
|
-
type Args$
|
|
7545
|
-
declare const useCartNoteUpdate: (options?: SWRMutationConfiguration<Response$3, any, Args$
|
|
7560
|
+
type Args$3 = Parameters<Func$3>[0];
|
|
7561
|
+
declare const useCartNoteUpdate: (options?: SWRMutationConfiguration<Response$3, any, Args$3, 'cart-note-update'>) => swr_mutation.SWRMutationResponse<_gem_sdk_adapter_common_dist_types_types_cart.Cart, any, _gem_sdk_adapter_common_dist_types_types_cart.CartNoteUpdateInput, "cart-note-update">;
|
|
7546
7562
|
|
|
7547
7563
|
type Func$2 = ReturnType<typeof createCartOperation>;
|
|
7548
7564
|
type Response$2 = Awaited<ReturnType<Func$2>>;
|
|
7549
|
-
type Args$
|
|
7550
|
-
declare const useCreateCart: (options?: SWRMutationConfiguration<Response$2, any, Args$
|
|
7565
|
+
type Args$2 = Parameters<Func$2>[0];
|
|
7566
|
+
declare const useCreateCart: (options?: SWRMutationConfiguration<Response$2, any, Args$2, 'create-cart'>) => swr_mutation.SWRMutationResponse<_gem_sdk_adapter_common_dist_types_types_cart.Cart, any, _gem_sdk_adapter_common_dist_types_types_cart.CreateCartInput, "create-cart">;
|
|
7551
7567
|
|
|
7552
7568
|
type Func$1 = ReturnType<typeof removeCartItemOperation>;
|
|
7553
7569
|
type Response$1 = Awaited<ReturnType<Func$1>>;
|
|
7554
|
-
type Args$
|
|
7555
|
-
declare const useRemoveCartItem: (options?: SWRMutationConfiguration<Response$1, any, Args$
|
|
7570
|
+
type Args$1 = Parameters<Func$1>[0];
|
|
7571
|
+
declare const useRemoveCartItem: (options?: SWRMutationConfiguration<Response$1, any, Args$1, 'remove-cart-item'>) => swr_mutation.SWRMutationResponse<_gem_sdk_adapter_common_dist_types_types_cart.Cart, any, _gem_sdk_adapter_common_dist_types_types_cart.RemoveCartLineInput, "remove-cart-item">;
|
|
7556
7572
|
|
|
7557
7573
|
type Func = ReturnType<typeof updateCartLineOperation>;
|
|
7558
7574
|
type Response = Awaited<ReturnType<Func>>;
|
|
7559
|
-
type Args
|
|
7560
|
-
declare const useUpdateCartItem: (options?: SWRMutationConfiguration<Response, any, Args
|
|
7575
|
+
type Args = Parameters<Func>[0];
|
|
7576
|
+
declare const useUpdateCartItem: (options?: SWRMutationConfiguration<Response, any, Args, 'update-cart-item'>) => swr_mutation.SWRMutationResponse<_gem_sdk_adapter_common_dist_types_types_cart.Cart, any, _gem_sdk_adapter_common_dist_types_types_cart.UpdateCartLineInput, "update-cart-item">;
|
|
7561
7577
|
|
|
7562
7578
|
declare const useLocale: () => {
|
|
7563
7579
|
locale: string | undefined;
|
|
@@ -7586,7 +7602,7 @@ declare function useIsSampleProduct(): boolean | undefined;
|
|
|
7586
7602
|
declare function useIsStorefrontProduct(): boolean | undefined;
|
|
7587
7603
|
declare function useCheckoutUrl(url?: string): string | undefined;
|
|
7588
7604
|
|
|
7589
|
-
declare const useCollectionQuery: (args?:
|
|
7605
|
+
declare const useCollectionQuery: (args?: FetchCollectionArgs, options?: SWRConfiguration<CollectionDetailFilterQueryResponse>) => swr__internal.SWRResponse<CollectionDetailFilterQueryResponse, any, Partial<swr__internal.PublicConfiguration<CollectionDetailFilterQueryResponse, any, (arg: ["query/collection", FetchCollectionArgs]) => swr__internal.FetcherResponse<CollectionDetailFilterQueryResponse>>> | undefined>;
|
|
7590
7606
|
|
|
7591
7607
|
declare const useCollectionsQuery: (variable: CollectionsQueryVariables, options?: SWRConfiguration<CollectionsQueryResponse>) => swr__internal.SWRResponse<CollectionsQueryResponse, any, Partial<swr__internal.PublicConfiguration<CollectionsQueryResponse, any, (arg: ["query/collections", Exact<{
|
|
7592
7608
|
after?: InputMaybe<string>;
|
|
@@ -7597,9 +7613,9 @@ declare const useCollectionsQuery: (variable: CollectionsQueryVariables, options
|
|
|
7597
7613
|
orderBy?: InputMaybe<CollectionOrder>;
|
|
7598
7614
|
}>]) => swr__internal.FetcherResponse<CollectionsQueryResponse>>> | undefined>;
|
|
7599
7615
|
|
|
7600
|
-
declare const useProductQuery: (productId?: string, options?: SWRConfiguration<ProductSelectFragment>) => swr__internal.SWRResponse<ProductSelectFragment, any, Partial<swr__internal.PublicConfiguration<ProductSelectFragment, any, (arg: ["query/product",
|
|
7616
|
+
declare const useProductQuery: (productId?: string, options?: SWRConfiguration<ProductSelectFragment>) => swr__internal.SWRResponse<ProductSelectFragment, any, Partial<swr__internal.PublicConfiguration<ProductSelectFragment, any, (arg: ["query/product", FetchProductParams]) => swr__internal.FetcherResponse<ProductSelectFragment>>> | undefined>;
|
|
7601
7617
|
|
|
7602
|
-
declare const useProductsQuery: (ids?: string[], options?: SWRConfiguration<ProductsQueryResponse>) => swr__internal.SWRResponse<ProductsQueryResponse, any, Partial<swr__internal.PublicConfiguration<ProductsQueryResponse, any, (arg: ["query/products",
|
|
7618
|
+
declare const useProductsQuery: (ids?: string[], options?: SWRConfiguration<ProductsQueryResponse>) => swr__internal.SWRResponse<ProductsQueryResponse, any, Partial<swr__internal.PublicConfiguration<ProductsQueryResponse, any, (arg: ["query/products", FetchProductsParams]) => swr__internal.FetcherResponse<ProductsQueryResponse>>> | undefined>;
|
|
7603
7619
|
|
|
7604
7620
|
declare const useCurrentDevice: () => NameDevices;
|
|
7605
7621
|
|
|
@@ -7718,32 +7734,6 @@ type PublishedThemePageSelectFragment = Pick<PublishedThemePage, 'id' | 'name' |
|
|
|
7718
7734
|
themePageCustomCode?: Maybe<Pick<CustomCode, 'body' | 'header'>>;
|
|
7719
7735
|
};
|
|
7720
7736
|
|
|
7721
|
-
type OrderByType = 'TITLE_ASC' | 'TITLE_DESC' | 'CREATED_AT_ASC' | undefined | 'none' | 'CREATED_AT_DESC';
|
|
7722
|
-
type Args = {
|
|
7723
|
-
id?: string;
|
|
7724
|
-
numberOfProducts?: number;
|
|
7725
|
-
orderBy?: OrderByType;
|
|
7726
|
-
isSample?: boolean;
|
|
7727
|
-
isStorefront?: boolean;
|
|
7728
|
-
};
|
|
7729
|
-
declare const getCollection: (fetcher: FetchFunc, arg: Args) => Promise<CollectionDetailFilterQueryResponse>;
|
|
7730
|
-
declare const calculateFirstProduct: (numberOfProducts: number, currentPage: number, productsPerPage: number) => number;
|
|
7731
|
-
|
|
7732
|
-
type FetchParams = {
|
|
7733
|
-
id?: string;
|
|
7734
|
-
isSample?: boolean;
|
|
7735
|
-
isStorefront?: boolean;
|
|
7736
|
-
};
|
|
7737
|
-
declare const getProduct: (fetcher: FetchFunc, { id, isSample, isStorefront }: FetchParams) => Promise<ProductSelectFragment>;
|
|
7738
|
-
type RequiredCursorEdge<T> = {
|
|
7739
|
-
cursor: string;
|
|
7740
|
-
node?: T;
|
|
7741
|
-
};
|
|
7742
|
-
declare const fetchVariants: (fetcher: FetchFunc, { id, isSample, isStorefront }: FetchParams) => Promise<RequiredCursorEdge<VariantSelectFragment>[]>;
|
|
7743
|
-
declare const fetchMedias: (fetcher: FetchFunc, { id, isSample, isStorefront }: FetchParams) => Promise<(Pick<MediaEdge, "cursor"> & {
|
|
7744
|
-
node?: Maybe<Pick<Media, "width" | "height" | "id" | "contentType" | "src" | "alt">>;
|
|
7745
|
-
})[]>;
|
|
7746
|
-
|
|
7747
7737
|
declare const getProductBySlug: (fetcher: FetchFunc, slug?: string) => Promise<ProductSelectFragment>;
|
|
7748
7738
|
|
|
7749
|
-
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,
|
|
7739
|
+
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, JudgeMeReviewsWidgetType, KlaviyoWidgetType, LooxReviewsWidgetType, ModalProvider, ModalProviderProps, NameDevices, NestedKeys, ObjectDeviceGlobalType, ObjectDevices, ObjectLayoutValue, OptionNormalStyle, OptionSpecialStyle, PageViewUpDocument, PageViewUpMutationResponse, PageViewUpMutationVariables, PickyStoryWidgetType, PreviewPageDocument, PreviewPageQueryResponse, PreviewPageQueryVariables, Primitive, ProductInputAnalytic, ProductListProvider, ProductListProviderProps, ProductProvider, ProductProviderProps, ProductReviewsWidgetType, ProductSelectFragment, ProductsDocument, ProductsQueryResponse, ProductsQueryVariables, PublishedThemePageSelectFragment, PublishedThemePagesDocument, PublishedThemePagesQueryResponse, PublishedThemePagesQueryVariables, RGBAColorType, RGBColorType, RenderMemo as Render, 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, StateProp, StateSelector, StateType, StoreConfig, StorePropertyDocument, StorePropertyQueryResponse, StorePropertyQueryVariables, SwatchesOptionType, SwatchesOptionValue, TransformProp, TypographyProps, TypographySetting, TypographyType, VariantSelectFragment, calculateFirstProduct, cls, composeAdvanceStyle, composeBackgroundCss, composeBorderCss, composeCornerCss, composeGridLayout, composeRadius, composeShadowCss, composeSize, composeSizeCss, composeSpacing, composeTextColorCss, composeTypographyCss, convertOldLayout, 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, isDefined, isEmptyChildren, isLocalEnv, loadScript, makeAspectRatio, makeHeight, makeLineClamp, makeStyle, makeStyleResponsive, makeStyleResponsiveState, makeStyleState, makeWidth, normalizeBuilderData, optionLayoutStyle, parseSelectedOption, parseValueWithUnit, prefetchQueries, props, styles, template, tiktokpixel, useAddToCart, useAddon, useAddons, useBuilderComponent, useBuilderPreviewStore, useBuilderStore, useCartData, useCartDiscountCodesUpdate, useCartId, useCartLine, useCartLineStore, useCartNoteUpdate, useCartUI, useCheckoutUrl, useCollection, useCollectionQuery, useCollectionStore, useCollectionsQuery, useConnectedShopify, useCreateCart, useCurrency, useCurrentDevice, useCurrentVariant, useCurrentVariantInStock, useEditorMode, useFeaturedImageGlobal, useFormatMoney, useIsSampleProduct, useIsStorefrontProduct, useIsomorphicLayoutEffect, useLazyVideo, useLoadScript, useLocale, useMatchMutate, useMobileOnly, useModalStore, useMoney, 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 };
|