@gem-sdk/core 1.9.35 → 1.9.36

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.
@@ -4,8 +4,9 @@ var useSWR = require('swr');
4
4
  var getCollection = require('./queries/get-collection.js');
5
5
  var getProduct = require('./queries/get-product.js');
6
6
  var getProducts = require('./queries/get-products.js');
7
+ var query = require('./query.js');
7
8
 
8
- const prefetchQueries = (input, isSample)=>{
9
+ const prefetchQueries = (input, options)=>{
9
10
  const queries = [];
10
11
  Object.keys(input).forEach((key)=>{
11
12
  const item = input[key];
@@ -16,13 +17,11 @@ const prefetchQueries = (input, isSample)=>{
16
17
  if (item.settings?.isAuto) break;
17
18
  const variables = {
18
19
  id: item.settings?.productSetting?.productId ?? 'latest',
19
- isSample
20
+ isSample: options?.isSample,
21
+ isStorefront: options?.isStorefront
20
22
  };
21
23
  data = {
22
- key: useSWR.unstable_serialize([
23
- 'query/product',
24
- variables
25
- ]),
24
+ key: useSWR.unstable_serialize(query.generateProductQueryKey(variables)),
26
25
  func: getProduct.getProduct,
27
26
  variables
28
27
  };
@@ -35,13 +34,11 @@ const prefetchQueries = (input, isSample)=>{
35
34
  id: item.settings?.collectionId ?? 'latest',
36
35
  numberOfProducts: item.settings?.numberOfProducts ?? 4,
37
36
  orderBy: item.settings?.orderBy,
38
- isSample
37
+ isSample: options?.isSample,
38
+ isStorefront: options?.isStorefront
39
39
  };
40
40
  data = {
41
- key: useSWR.unstable_serialize([
42
- 'query/collection',
43
- variables
44
- ]),
41
+ key: useSWR.unstable_serialize(query.generateCollectionQueryKey(variables)),
45
42
  func: getCollection.getCollection,
46
43
  variables
47
44
  };
@@ -50,13 +47,11 @@ const prefetchQueries = (input, isSample)=>{
50
47
  ids: [
51
48
  ...item?.settings?.productIds ?? []
52
49
  ].sort(),
53
- isSample
50
+ isSample: options?.isSample,
51
+ isStorefront: options?.isStorefront
54
52
  };
55
53
  data = {
56
- key: useSWR.unstable_serialize([
57
- 'query/products',
58
- variables
59
- ]),
54
+ key: useSWR.unstable_serialize(query.generateProductsQueryKey(variables)),
60
55
  func: getProducts.getProducts,
61
56
  variables
62
57
  };
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ const generateProductQueryKey = (args)=>{
4
+ return [
5
+ 'query/product',
6
+ args
7
+ ];
8
+ };
9
+ const generateCollectionQueryKey = (args)=>{
10
+ return [
11
+ 'query/collection',
12
+ args
13
+ ];
14
+ };
15
+ const generateProductsQueryKey = (args)=>{
16
+ return [
17
+ 'query/products',
18
+ {
19
+ ...args,
20
+ ids: [
21
+ ...args.ids
22
+ ].sort()
23
+ }
24
+ ];
25
+ };
26
+
27
+ exports.generateCollectionQueryKey = generateCollectionQueryKey;
28
+ exports.generateProductQueryKey = generateProductQueryKey;
29
+ exports.generateProductsQueryKey = generateProductsQueryKey;
@@ -4,17 +4,15 @@ var useSWR = require('swr');
4
4
  var getCollection = require('../../helpers/queries/get-collection.js');
5
5
  var shop = require('../shop.js');
6
6
  var useFetchHandle = require('../useFetchHandle.js');
7
+ var query = require('../../helpers/query.js');
7
8
 
8
9
  const useCollectionQuery = (args, options)=>{
9
10
  const fetcher = useFetchHandle.useFetchHandle();
10
11
  const isSample = shop.useIsSampleProduct();
11
- return useSWR(args ? [
12
- 'query/collection',
13
- {
14
- ...args,
15
- isSample
16
- }
17
- ] : null, ([, arg])=>{
12
+ return useSWR(args ? query.generateCollectionQueryKey({
13
+ ...args,
14
+ isSample
15
+ }) : null, ([, arg])=>{
18
16
  return getCollection.getCollection(fetcher, arg);
19
17
  }, options);
20
18
  };
@@ -4,19 +4,17 @@ var useSWR = require('swr');
4
4
  var getProduct = require('../../helpers/queries/get-product.js');
5
5
  var shop = require('../shop.js');
6
6
  var useFetchHandle = require('../useFetchHandle.js');
7
+ var query = require('../../helpers/query.js');
7
8
 
8
9
  const useProductQuery = (productId, options)=>{
9
10
  const fetcher = useFetchHandle.useFetchHandle();
10
11
  const isSample = shop.useIsSampleProduct();
11
12
  const isStorefront = shop.useIsStorefrontProduct();
12
- return useSWR(productId ? [
13
- 'query/product',
14
- {
15
- id: productId ?? 'latest',
16
- isSample,
17
- isStorefront
18
- }
19
- ] : null, async ([, arg])=>{
13
+ return useSWR(productId ? query.generateProductQueryKey({
14
+ id: productId,
15
+ isSample,
16
+ isStorefront
17
+ }) : null, async ([, arg])=>{
20
18
  return getProduct.getProduct(fetcher, arg);
21
19
  }, options);
22
20
  };
@@ -4,21 +4,17 @@ var useSWR = require('swr');
4
4
  var getProducts = require('../../helpers/queries/get-products.js');
5
5
  var shop = require('../shop.js');
6
6
  var useFetchHandle = require('../useFetchHandle.js');
7
+ var query = require('../../helpers/query.js');
7
8
 
8
9
  const useProductsQuery = (ids, options)=>{
9
10
  const fetcher = useFetchHandle.useFetchHandle();
10
11
  const isSample = shop.useIsSampleProduct();
11
12
  const isStorefront = shop.useIsStorefrontProduct();
12
- return useSWR(ids ? [
13
- 'query/products',
14
- {
15
- ids: [
16
- ...ids
17
- ].sort(),
18
- isSample,
19
- isStorefront
20
- }
21
- ] : null, async ([, arg])=>{
13
+ return useSWR(ids ? query.generateProductsQueryKey({
14
+ ids,
15
+ isSample,
16
+ isStorefront
17
+ }) : null, async ([, arg])=>{
22
18
  return getProducts.getProducts(fetcher, arg);
23
19
  }, options);
24
20
  };
package/dist/cjs/index.js CHANGED
@@ -53,6 +53,7 @@ var convert = require('./helpers/convert.js');
53
53
  var size = require('./helpers/size.js');
54
54
  var shadow = require('./helpers/shadow.js');
55
55
  var background = require('./helpers/background.js');
56
+ var query = require('./helpers/query.js');
56
57
  var useAddToCart = require('./hooks/cart/use-add-to-cart.js');
57
58
  var useCartData = require('./hooks/cart/use-cart-data.js');
58
59
  var useCartDiscountCodesUpdate = require('./hooks/cart/use-cart-discount-codes-update.js');
@@ -203,6 +204,9 @@ exports.getStyleShadowState = shadow.getStyleShadowState;
203
204
  exports.parseValueWithUnit = shadow.parseValueWithUnit;
204
205
  exports.composeBackgroundCss = background.composeBackgroundCss;
205
206
  exports.getStyleBackgroundByDevice = background.getStyleBackgroundByDevice;
207
+ exports.generateCollectionQueryKey = query.generateCollectionQueryKey;
208
+ exports.generateProductQueryKey = query.generateProductQueryKey;
209
+ exports.generateProductsQueryKey = query.generateProductsQueryKey;
206
210
  exports.useAddToCart = useAddToCart.useAddToCart;
207
211
  exports.useCartData = useCartData.useCartData;
208
212
  exports.useCartDiscountCodesUpdate = useCartDiscountCodesUpdate.useCartDiscountCodesUpdate;
@@ -2,8 +2,9 @@ import { unstable_serialize } from 'swr';
2
2
  import { getCollection } from './queries/get-collection.js';
3
3
  import { getProduct } from './queries/get-product.js';
4
4
  import { getProducts } from './queries/get-products.js';
5
+ import { generateCollectionQueryKey, generateProductsQueryKey, generateProductQueryKey } from './query.js';
5
6
 
6
- const prefetchQueries = (input, isSample)=>{
7
+ const prefetchQueries = (input, options)=>{
7
8
  const queries = [];
8
9
  Object.keys(input).forEach((key)=>{
9
10
  const item = input[key];
@@ -14,13 +15,11 @@ const prefetchQueries = (input, isSample)=>{
14
15
  if (item.settings?.isAuto) break;
15
16
  const variables = {
16
17
  id: item.settings?.productSetting?.productId ?? 'latest',
17
- isSample
18
+ isSample: options?.isSample,
19
+ isStorefront: options?.isStorefront
18
20
  };
19
21
  data = {
20
- key: unstable_serialize([
21
- 'query/product',
22
- variables
23
- ]),
22
+ key: unstable_serialize(generateProductQueryKey(variables)),
24
23
  func: getProduct,
25
24
  variables
26
25
  };
@@ -33,13 +32,11 @@ const prefetchQueries = (input, isSample)=>{
33
32
  id: item.settings?.collectionId ?? 'latest',
34
33
  numberOfProducts: item.settings?.numberOfProducts ?? 4,
35
34
  orderBy: item.settings?.orderBy,
36
- isSample
35
+ isSample: options?.isSample,
36
+ isStorefront: options?.isStorefront
37
37
  };
38
38
  data = {
39
- key: unstable_serialize([
40
- 'query/collection',
41
- variables
42
- ]),
39
+ key: unstable_serialize(generateCollectionQueryKey(variables)),
43
40
  func: getCollection,
44
41
  variables
45
42
  };
@@ -48,13 +45,11 @@ const prefetchQueries = (input, isSample)=>{
48
45
  ids: [
49
46
  ...item?.settings?.productIds ?? []
50
47
  ].sort(),
51
- isSample
48
+ isSample: options?.isSample,
49
+ isStorefront: options?.isStorefront
52
50
  };
53
51
  data = {
54
- key: unstable_serialize([
55
- 'query/products',
56
- variables
57
- ]),
52
+ key: unstable_serialize(generateProductsQueryKey(variables)),
58
53
  func: getProducts,
59
54
  variables
60
55
  };
@@ -0,0 +1,25 @@
1
+ const generateProductQueryKey = (args)=>{
2
+ return [
3
+ 'query/product',
4
+ args
5
+ ];
6
+ };
7
+ const generateCollectionQueryKey = (args)=>{
8
+ return [
9
+ 'query/collection',
10
+ args
11
+ ];
12
+ };
13
+ const generateProductsQueryKey = (args)=>{
14
+ return [
15
+ 'query/products',
16
+ {
17
+ ...args,
18
+ ids: [
19
+ ...args.ids
20
+ ].sort()
21
+ }
22
+ ];
23
+ };
24
+
25
+ export { generateCollectionQueryKey, generateProductQueryKey, generateProductsQueryKey };
@@ -2,17 +2,15 @@ import useSWR from 'swr';
2
2
  import { getCollection } from '../../helpers/queries/get-collection.js';
3
3
  import { useIsSampleProduct } from '../shop.js';
4
4
  import { useFetchHandle } from '../useFetchHandle.js';
5
+ import { generateCollectionQueryKey } from '../../helpers/query.js';
5
6
 
6
7
  const useCollectionQuery = (args, options)=>{
7
8
  const fetcher = useFetchHandle();
8
9
  const isSample = useIsSampleProduct();
9
- return useSWR(args ? [
10
- 'query/collection',
11
- {
12
- ...args,
13
- isSample
14
- }
15
- ] : null, ([, arg])=>{
10
+ return useSWR(args ? generateCollectionQueryKey({
11
+ ...args,
12
+ isSample
13
+ }) : null, ([, arg])=>{
16
14
  return getCollection(fetcher, arg);
17
15
  }, options);
18
16
  };
@@ -2,19 +2,17 @@ import useSWR from 'swr';
2
2
  import { getProduct } from '../../helpers/queries/get-product.js';
3
3
  import { useIsSampleProduct, useIsStorefrontProduct } from '../shop.js';
4
4
  import { useFetchHandle } from '../useFetchHandle.js';
5
+ import { generateProductQueryKey } from '../../helpers/query.js';
5
6
 
6
7
  const useProductQuery = (productId, options)=>{
7
8
  const fetcher = useFetchHandle();
8
9
  const isSample = useIsSampleProduct();
9
10
  const isStorefront = useIsStorefrontProduct();
10
- return useSWR(productId ? [
11
- 'query/product',
12
- {
13
- id: productId ?? 'latest',
14
- isSample,
15
- isStorefront
16
- }
17
- ] : null, async ([, arg])=>{
11
+ return useSWR(productId ? generateProductQueryKey({
12
+ id: productId,
13
+ isSample,
14
+ isStorefront
15
+ }) : null, async ([, arg])=>{
18
16
  return getProduct(fetcher, arg);
19
17
  }, options);
20
18
  };
@@ -2,21 +2,17 @@ import useSWR from 'swr';
2
2
  import { getProducts } from '../../helpers/queries/get-products.js';
3
3
  import { useIsSampleProduct, useIsStorefrontProduct } from '../shop.js';
4
4
  import { useFetchHandle } from '../useFetchHandle.js';
5
+ import { generateProductsQueryKey } from '../../helpers/query.js';
5
6
 
6
7
  const useProductsQuery = (ids, options)=>{
7
8
  const fetcher = useFetchHandle();
8
9
  const isSample = useIsSampleProduct();
9
10
  const isStorefront = useIsStorefrontProduct();
10
- return useSWR(ids ? [
11
- 'query/products',
12
- {
13
- ids: [
14
- ...ids
15
- ].sort(),
16
- isSample,
17
- isStorefront
18
- }
19
- ] : null, async ([, arg])=>{
11
+ return useSWR(ids ? generateProductsQueryKey({
12
+ ids,
13
+ isSample,
14
+ isStorefront
15
+ }) : null, async ([, arg])=>{
20
16
  return getProducts(fetcher, arg);
21
17
  }, options);
22
18
  };
package/dist/esm/index.js CHANGED
@@ -54,6 +54,7 @@ export { isLocalEnv } from './helpers/convert.js';
54
54
  export { composeSize, composeSizeCss, genSizeClass } from './helpers/size.js';
55
55
  export { composeShadowCss, getStyleShadow, getStyleShadowState, parseValueWithUnit } from './helpers/shadow.js';
56
56
  export { composeBackgroundCss, getStyleBackgroundByDevice } from './helpers/background.js';
57
+ export { generateCollectionQueryKey, generateProductQueryKey, generateProductsQueryKey } from './helpers/query.js';
57
58
  export { useAddToCart } from './hooks/cart/use-add-to-cart.js';
58
59
  export { useCartData } from './hooks/cart/use-cart-data.js';
59
60
  export { useCartDiscountCodesUpdate } from './hooks/cart/use-cart-discount-codes-update.js';
@@ -7366,7 +7366,10 @@ type Result = {
7366
7366
  variables?: any;
7367
7367
  func?: (fetcher: FetchFunc, args?: any) => Promise<any>;
7368
7368
  };
7369
- declare const prefetchQueries: (input: BuilderState, isSample?: boolean) => Result[];
7369
+ declare const prefetchQueries: (input: BuilderState, options?: {
7370
+ isSample?: boolean;
7371
+ isStorefront?: boolean;
7372
+ }) => Result[];
7370
7373
 
7371
7374
  declare function getSpacingVariable(key?: SpacingType): string;
7372
7375
  declare const composeSpacing: (spacingValue?: ObjectDevices<SpacingType>) => React.CSSProperties;
@@ -7502,10 +7505,30 @@ type Options = {
7502
7505
  declare const getStyleBackgroundByDevice: (background?: ObjectDevices<Background>, options?: Options) => {};
7503
7506
  declare const composeBackgroundCss: (backgroundColor?: ColorValueType) => string;
7504
7507
 
7508
+ type ProductQueryKeyInput = {
7509
+ id?: string;
7510
+ isSample?: boolean;
7511
+ isStorefront?: boolean;
7512
+ };
7513
+ declare const generateProductQueryKey: (args: ProductQueryKeyInput) => ['query/product', ProductQueryKeyInput];
7514
+ type CollectionArgs = {
7515
+ id?: string;
7516
+ numberOfProducts?: number;
7517
+ orderBy?: 'TITLE_ASC' | 'TITLE_DESC' | 'CREATED_AT_ASC' | 'none' | 'CREATED_AT_DESC';
7518
+ isSample?: boolean;
7519
+ };
7520
+ declare const generateCollectionQueryKey: (args: CollectionArgs) => ['query/collection', CollectionArgs];
7521
+ type ProductsQueryKeyInput = {
7522
+ ids: string[];
7523
+ isSample?: boolean;
7524
+ isStorefront?: boolean;
7525
+ };
7526
+ declare const generateProductsQueryKey: (args: ProductsQueryKeyInput) => ['query/products', ProductsQueryKeyInput];
7527
+
7505
7528
  type Func$6 = ReturnType<typeof addToCartOperation>;
7506
7529
  type Response$6 = Awaited<ReturnType<Func$6>>;
7507
- type Args$7 = Parameters<Func$6>[0];
7508
- declare const useAddToCart: (options?: SWRMutationConfiguration<Response$6, any, Args$7, '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">;
7530
+ type Args$6 = Parameters<Func$6>[0];
7531
+ declare const useAddToCart: (options?: SWRMutationConfiguration<Response$6, any, Args$6, '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">;
7509
7532
 
7510
7533
  type Func$5 = ReturnType<typeof getCartOperation>;
7511
7534
  type Response$5 = Awaited<ReturnType<Func$5>>;
@@ -7513,28 +7536,28 @@ declare const useCartData: (options?: SWRConfiguration<Response$5 | undefined, a
7513
7536
 
7514
7537
  type Func$4 = ReturnType<typeof cartDiscountCodesUpdateOperation>;
7515
7538
  type Response$4 = Awaited<ReturnType<Func$4>>;
7516
- type Args$6 = Parameters<Func$4>[0];
7517
- declare const useCartDiscountCodesUpdate: (options?: SWRMutationConfiguration<Response$4, any, Args$6, '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">;
7539
+ type Args$5 = Parameters<Func$4>[0];
7540
+ declare const useCartDiscountCodesUpdate: (options?: SWRMutationConfiguration<Response$4, any, Args$5, '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">;
7518
7541
 
7519
7542
  type Func$3 = ReturnType<typeof cartNoteUpdateOperation>;
7520
7543
  type Response$3 = Awaited<ReturnType<Func$3>>;
7521
- type Args$5 = Parameters<Func$3>[0];
7522
- declare const useCartNoteUpdate: (options?: SWRMutationConfiguration<Response$3, any, Args$5, '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">;
7544
+ type Args$4 = Parameters<Func$3>[0];
7545
+ declare const useCartNoteUpdate: (options?: SWRMutationConfiguration<Response$3, any, Args$4, '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">;
7523
7546
 
7524
7547
  type Func$2 = ReturnType<typeof createCartOperation>;
7525
7548
  type Response$2 = Awaited<ReturnType<Func$2>>;
7526
- type Args$4 = Parameters<Func$2>[0];
7527
- declare const useCreateCart: (options?: SWRMutationConfiguration<Response$2, any, Args$4, '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">;
7549
+ type Args$3 = Parameters<Func$2>[0];
7550
+ declare const useCreateCart: (options?: SWRMutationConfiguration<Response$2, any, Args$3, '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">;
7528
7551
 
7529
7552
  type Func$1 = ReturnType<typeof removeCartItemOperation>;
7530
7553
  type Response$1 = Awaited<ReturnType<Func$1>>;
7531
- type Args$3 = Parameters<Func$1>[0];
7532
- declare const useRemoveCartItem: (options?: SWRMutationConfiguration<Response$1, any, Args$3, '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">;
7554
+ type Args$2 = Parameters<Func$1>[0];
7555
+ declare const useRemoveCartItem: (options?: SWRMutationConfiguration<Response$1, any, Args$2, '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">;
7533
7556
 
7534
7557
  type Func = ReturnType<typeof updateCartLineOperation>;
7535
7558
  type Response = Awaited<ReturnType<Func>>;
7536
- type Args$2 = Parameters<Func>[0];
7537
- declare const useUpdateCartItem: (options?: SWRMutationConfiguration<Response, any, Args$2, '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">;
7559
+ type Args$1 = Parameters<Func>[0];
7560
+ declare const useUpdateCartItem: (options?: SWRMutationConfiguration<Response, any, Args$1, '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">;
7538
7561
 
7539
7562
  declare const useLocale: () => {
7540
7563
  locale: string | undefined;
@@ -7563,13 +7586,7 @@ declare function useIsSampleProduct(): boolean | undefined;
7563
7586
  declare function useIsStorefrontProduct(): boolean | undefined;
7564
7587
  declare function useCheckoutUrl(url?: string): string | undefined;
7565
7588
 
7566
- type Args$1 = {
7567
- id?: string;
7568
- numberOfProducts?: number;
7569
- orderBy?: 'TITLE_ASC' | 'TITLE_DESC' | 'CREATED_AT_ASC' | undefined | 'none' | 'CREATED_AT_DESC';
7570
- isSample?: boolean;
7571
- };
7572
- declare const useCollectionQuery: (args?: Args$1, options?: SWRConfiguration<CollectionDetailFilterQueryResponse>) => swr__internal.SWRResponse<CollectionDetailFilterQueryResponse, any, Partial<swr__internal.PublicConfiguration<CollectionDetailFilterQueryResponse, any, (arg: ["query/collection", Args$1]) => swr__internal.FetcherResponse<CollectionDetailFilterQueryResponse>>> | undefined>;
7589
+ declare const useCollectionQuery: (args?: CollectionArgs, options?: SWRConfiguration<CollectionDetailFilterQueryResponse>) => swr__internal.SWRResponse<CollectionDetailFilterQueryResponse, any, Partial<swr__internal.PublicConfiguration<CollectionDetailFilterQueryResponse, any, (arg: ["query/collection", CollectionArgs]) => swr__internal.FetcherResponse<CollectionDetailFilterQueryResponse>>> | undefined>;
7573
7590
 
7574
7591
  declare const useCollectionsQuery: (variable: CollectionsQueryVariables, options?: SWRConfiguration<CollectionsQueryResponse>) => swr__internal.SWRResponse<CollectionsQueryResponse, any, Partial<swr__internal.PublicConfiguration<CollectionsQueryResponse, any, (arg: ["query/collections", Exact<{
7575
7592
  after?: InputMaybe<string>;
@@ -7580,17 +7597,9 @@ declare const useCollectionsQuery: (variable: CollectionsQueryVariables, options
7580
7597
  orderBy?: InputMaybe<CollectionOrder>;
7581
7598
  }>]) => swr__internal.FetcherResponse<CollectionsQueryResponse>>> | undefined>;
7582
7599
 
7583
- declare const useProductQuery: (productId?: string, options?: SWRConfiguration<ProductSelectFragment>) => swr__internal.SWRResponse<ProductSelectFragment, any, Partial<swr__internal.PublicConfiguration<ProductSelectFragment, any, (arg: ["query/product", {
7584
- id?: string | undefined;
7585
- isSample?: boolean | undefined;
7586
- isStorefront?: boolean | undefined;
7587
- }]) => swr__internal.FetcherResponse<ProductSelectFragment>>> | undefined>;
7600
+ declare const useProductQuery: (productId?: string, options?: SWRConfiguration<ProductSelectFragment>) => swr__internal.SWRResponse<ProductSelectFragment, any, Partial<swr__internal.PublicConfiguration<ProductSelectFragment, any, (arg: ["query/product", ProductQueryKeyInput]) => swr__internal.FetcherResponse<ProductSelectFragment>>> | undefined>;
7588
7601
 
7589
- declare const useProductsQuery: (ids?: string[], options?: SWRConfiguration<ProductsQueryResponse>) => swr__internal.SWRResponse<ProductsQueryResponse, any, Partial<swr__internal.PublicConfiguration<ProductsQueryResponse, any, (arg: ["query/products", {
7590
- ids?: string[] | undefined;
7591
- isSample?: boolean | undefined;
7592
- isStorefront?: boolean | undefined;
7593
- }]) => swr__internal.FetcherResponse<ProductsQueryResponse>>> | undefined>;
7602
+ declare const useProductsQuery: (ids?: string[], options?: SWRConfiguration<ProductsQueryResponse>) => swr__internal.SWRResponse<ProductsQueryResponse, any, Partial<swr__internal.PublicConfiguration<ProductsQueryResponse, any, (arg: ["query/products", ProductsQueryKeyInput]) => swr__internal.FetcherResponse<ProductsQueryResponse>>> | undefined>;
7594
7603
 
7595
7604
  declare const useCurrentDevice: () => NameDevices;
7596
7605
 
@@ -7737,4 +7746,4 @@ declare const fetchMedias: (fetcher: FetchFunc, { id, isSample, isStorefront }:
7737
7746
 
7738
7747
  declare const getProductBySlug: (fetcher: FetchFunc, slug?: string) => Promise<ProductSelectFragment>;
7739
7748
 
7740
- 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, FetchFunc, 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, 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 };
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, CollectionArgs, 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, FetchFunc, 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, ProductQueryKeyInput, ProductReviewsWidgetType, ProductSelectFragment, ProductsDocument, ProductsQueryKeyInput, 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.9.35",
3
+ "version": "1.9.36",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",