@gem-sdk/core 1.5.7 → 1.5.14

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.
Files changed (30) hide show
  1. package/dist/cjs/components/Render.liquid.js +1 -0
  2. package/dist/cjs/graphql/fragments/product.generated.js +1 -1
  3. package/dist/cjs/graphql/queries/collection-detail-filter.generated.js +1 -1
  4. package/dist/cjs/graphql/queries/collection.generated.js +1 -1
  5. package/dist/cjs/graphql/queries/product-medias.generated.js +2 -2
  6. package/dist/cjs/graphql/queries/products.generated.js +1 -1
  7. package/dist/cjs/helpers/colors.js +25 -8
  8. package/dist/cjs/helpers/convert.js +5 -0
  9. package/dist/cjs/helpers/queries/get-collection.js +4 -0
  10. package/dist/cjs/helpers/queries/get-product-by-slug.js +4 -0
  11. package/dist/cjs/helpers/queries/get-product.js +4 -0
  12. package/dist/cjs/helpers/queries/get-products.js +4 -0
  13. package/dist/cjs/hooks/useProduct.js +1 -0
  14. package/dist/cjs/index.js +2 -0
  15. package/dist/esm/components/Render.liquid.js +1 -0
  16. package/dist/esm/graphql/fragments/product.generated.js +1 -1
  17. package/dist/esm/graphql/queries/collection-detail-filter.generated.js +1 -1
  18. package/dist/esm/graphql/queries/collection.generated.js +1 -1
  19. package/dist/esm/graphql/queries/product-medias.generated.js +2 -2
  20. package/dist/esm/graphql/queries/products.generated.js +1 -1
  21. package/dist/esm/helpers/colors.js +25 -8
  22. package/dist/esm/helpers/convert.js +3 -0
  23. package/dist/esm/helpers/queries/get-collection.js +4 -0
  24. package/dist/esm/helpers/queries/get-product-by-slug.js +4 -0
  25. package/dist/esm/helpers/queries/get-product.js +4 -0
  26. package/dist/esm/helpers/queries/get-products.js +4 -0
  27. package/dist/esm/hooks/useProduct.js +1 -0
  28. package/dist/esm/index.js +1 -0
  29. package/dist/types/index.d.ts +19 -5
  30. package/package.json +3 -3
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  require('react');
6
6
  require('swr');
7
7
  var render = require('../helpers/render.js');
8
+ require('../helpers/convert.js');
8
9
  var composeAdvanceStyle = require('../helpers/compose-advance-style.js');
9
10
  var constant = require('./constant.js');
10
11
 
@@ -3,7 +3,7 @@
3
3
  const ProductSelect = `
4
4
  fragment ProductSelect on Product {
5
5
  ...ProductLittleSelect
6
- medias(first: $firstMedia, after: $afterMedia) {
6
+ medias(first: $firstMedia, after: $afterMedia, orderBy: $orderByMedia) {
7
7
  edges {
8
8
  cursor
9
9
  node {
@@ -11,7 +11,7 @@ var variant_generated = require('../fragments/variant.generated.js');
11
11
  var selectedOption_generated = require('../fragments/selected-option.generated.js');
12
12
 
13
13
  const CollectionDetailFilterDocument = `
14
- query collectionDetailFilter($firstProduct: Int = 10, $orderBy: CollectionOrder, $where: CollectionWhereInput, $orderByProduct: ProductOrder, $productsAfter: Cursor, $firstVariant: Int, $afterVariant: Cursor, $afterMedia: Cursor, $firstMedia: Int, $whereProduct: ProductWhereInput) {
14
+ query collectionDetailFilter($firstProduct: Int = 10, $orderBy: CollectionOrder, $where: CollectionWhereInput, $orderByProduct: ProductOrder, $productsAfter: Cursor, $firstVariant: Int, $afterVariant: Cursor, $afterMedia: Cursor, $firstMedia: Int, $orderByMedia: MediaOrder, $whereProduct: ProductWhereInput) {
15
15
  collections(first: 1, orderBy: $orderBy, where: $where) {
16
16
  edges {
17
17
  cursor
@@ -9,7 +9,7 @@ var variant_generated = require('../fragments/variant.generated.js');
9
9
  var selectedOption_generated = require('../fragments/selected-option.generated.js');
10
10
 
11
11
  const CollectionDocument = `
12
- query collection($first: Int = 5, $firstMedia: Int = 20, $afterMedia: Cursor, $firstVariant: Int = 20, $afterVariant: Cursor, $handle: String, $id: ID) {
12
+ query collection($first: Int = 5, $firstMedia: Int = 20, $orderByMedia: MediaOrder, $afterMedia: Cursor, $firstVariant: Int = 20, $afterVariant: Cursor, $handle: String, $id: ID) {
13
13
  collection(handle: $handle, id: $id) {
14
14
  baseID
15
15
  createdAt
@@ -3,12 +3,12 @@
3
3
  var media_generated = require('../fragments/media.generated.js');
4
4
 
5
5
  const ProductMediasDocument = `
6
- query productMedias($firstMedia: Int = 50, $afterMedia: Cursor, $orderBy: ProductOrder, $where: ProductWhereInput) {
6
+ query productMedias($firstMedia: Int = 50, $afterMedia: Cursor, $orderBy: ProductOrder, $where: ProductWhereInput, $orderByMedia: MediaOrder) {
7
7
  medias: products(first: 1, orderBy: $orderBy, where: $where) {
8
8
  edges {
9
9
  node {
10
10
  id
11
- medias(first: $firstMedia, after: $afterMedia) {
11
+ medias(first: $firstMedia, after: $afterMedia, orderBy: $orderByMedia) {
12
12
  edges {
13
13
  cursor
14
14
  node {
@@ -17,7 +17,7 @@ const ProductsEdgeDetail = `
17
17
  }
18
18
  `;
19
19
  const ProductsDocument = `
20
- query products($first: Int, $where: ProductWhereInput, $firstMedia: Int, $orderBy: ProductOrder, $after: Cursor, $firstVariant: Int, $afterVariant: Cursor, $afterMedia: Cursor) {
20
+ query products($first: Int, $where: ProductWhereInput, $firstMedia: Int, $orderBy: ProductOrder, $after: Cursor, $firstVariant: Int, $afterVariant: Cursor, $afterMedia: Cursor, $orderByMedia: MediaOrder) {
21
21
  products(first: $first, where: $where, orderBy: $orderBy, after: $after) {
22
22
  edges {
23
23
  ...ProductsEdgeDetail
@@ -21,13 +21,17 @@ const getGlobalColorResponsiveClass = (type, data) => {
21
21
  return '';
22
22
  return Object.entries(data)
23
23
  .map(([device, value]) => {
24
+ const clName = getGlobalColorClass(type, value);
25
+ if (!clName)
26
+ return undefined;
24
27
  if (device === 'desktop') {
25
- return getGlobalColorClass(type, value);
28
+ return clName;
26
29
  }
27
30
  else {
28
- return `${device}:${getGlobalColorClass(type, value)}`;
31
+ return `${device}:${clName}`;
29
32
  }
30
33
  })
34
+ .filter(isDefined.isDefined)
31
35
  .join(' ');
32
36
  };
33
37
  const getGlobalColorStateClass = (type, data) => {
@@ -35,13 +39,17 @@ const getGlobalColorStateClass = (type, data) => {
35
39
  return '';
36
40
  return Object.entries(data)
37
41
  .map(([state, value]) => {
42
+ const clName = getGlobalColorClass(type, value);
43
+ if (!clName)
44
+ return undefined;
38
45
  if (state === 'normal') {
39
- return getGlobalColorClass(type, value);
46
+ return clName;
40
47
  }
41
48
  else {
42
- return `${state}:${getGlobalColorClass(type, value)}`;
49
+ return `${state}:${clName}`;
43
50
  }
44
51
  })
52
+ .filter(isDefined.isDefined)
45
53
  .join(' ');
46
54
  };
47
55
  const getGlobalColorStateResponsiveClass = (type, data) => {
@@ -52,28 +60,37 @@ const getGlobalColorStateResponsiveClass = (type, data) => {
52
60
  if (device === 'desktop') {
53
61
  return Object.entries(objectState)
54
62
  .map(([state, value]) => {
63
+ const clName = getGlobalColorClass(type, value);
64
+ if (!clName)
65
+ return undefined;
55
66
  if (state === 'normal') {
56
- return getGlobalColorClass(type, value);
67
+ return clName;
57
68
  }
58
69
  else {
59
- return `${state}:${getGlobalColorClass(type, value)}`;
70
+ return `${state}:${clName}`;
60
71
  }
61
72
  })
73
+ .filter(isDefined.isDefined)
62
74
  .join(' ');
63
75
  }
64
76
  else {
65
77
  return Object.entries(objectState)
66
78
  .map(([state, value]) => {
79
+ const clName = getGlobalColorClass(type, value);
80
+ if (!clName)
81
+ return undefined;
67
82
  if (state === 'normal') {
68
- return `${device}:${getGlobalColorClass(type, value)}`;
83
+ return `${device}:${clName}`;
69
84
  }
70
85
  else {
71
- return `${device}:${state}:${getGlobalColorClass(type, value)}`;
86
+ return `${device}:${state}:${clName}`;
72
87
  }
73
88
  })
89
+ .filter(isDefined.isDefined)
74
90
  .join(' ');
75
91
  }
76
92
  })
93
+ .filter(Boolean)
77
94
  .join(' ');
78
95
  };
79
96
  const getGlobalColorResponsiveStyle = (type, data) => {
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ const isLocalEnv = process.env.NEXT_CONVERT_ENV === 'local';
4
+
5
+ exports.isLocalEnv = isLocalEnv;
@@ -59,6 +59,10 @@ const loopFetchCollection = async (fetcher, arg) => {
59
59
  field: 'UPDATED_AT',
60
60
  direction: 'DESC',
61
61
  },
62
+ orderByMedia: {
63
+ field: 'POSITION',
64
+ direction: 'ASC',
65
+ },
62
66
  firstProduct: calculateFirstProduct(arg.numberOfProducts, currentPage, productsPerPage),
63
67
  ...(!arg.id || arg.id.toLowerCase() === 'latest'
64
68
  ? { where: { hasCollectionProducts: true, isSample: arg.isSample } }
@@ -66,6 +66,10 @@ const fetchMedias = async (fetcher, handle) => {
66
66
  const initVariables = {
67
67
  orderBy,
68
68
  where: { handle, isStorefront: true },
69
+ orderByMedia: {
70
+ field: 'POSITION',
71
+ direction: 'ASC',
72
+ },
69
73
  };
70
74
  const query = async (variables) => {
71
75
  try {
@@ -78,6 +78,10 @@ const fetchMedias = async (fetcher, { id, isSample }) => {
78
78
  isSample,
79
79
  ...(id && id.toLowerCase() !== 'latest' && { baseID: id }),
80
80
  },
81
+ orderByMedia: {
82
+ field: 'POSITION',
83
+ direction: 'ASC',
84
+ },
81
85
  };
82
86
  const query = async (variables) => {
83
87
  try {
@@ -64,6 +64,10 @@ const loopFetchProducts = async (fetcher, { ids, isSample }) => {
64
64
  direction: 'DESC',
65
65
  field: 'UPDATED_AT',
66
66
  },
67
+ orderByMedia: {
68
+ field: 'POSITION',
69
+ direction: 'ASC',
70
+ },
67
71
  where: {
68
72
  isStorefront: true,
69
73
  isSample: isSample,
@@ -5,6 +5,7 @@ var ProductContext = require('../contexts/ProductContext.js');
5
5
  var flattenConnection = require('../helpers/flatten-connection.js');
6
6
  require('swr');
7
7
  var product = require('../helpers/product.js');
8
+ require('../helpers/convert.js');
8
9
 
9
10
  const useUniqProductID = () => {
10
11
  return ProductContext.useProductStore((s) => s.uiqueId);
package/dist/cjs/index.js CHANGED
@@ -49,6 +49,7 @@ var fpixel = require('./helpers/tracking/fpixel.js');
49
49
  var gtag = require('./helpers/tracking/gtag.js');
50
50
  var tiktokpixel = require('./helpers/tracking/tiktokpixel.js');
51
51
  var render = require('./helpers/render.js');
52
+ var convert = require('./helpers/convert.js');
52
53
  var useAddToCart = require('./hooks/cart/use-add-to-cart.js');
53
54
  var useCartData = require('./hooks/cart/use-cart-data.js');
54
55
  var useCartDiscountCodesUpdate = require('./hooks/cart/use-cart-discount-codes-update.js');
@@ -175,6 +176,7 @@ exports.RenderIf = render.RenderIf;
175
176
  exports.props = render.props;
176
177
  exports.styles = render.styles;
177
178
  exports.template = render.template;
179
+ exports.isLocalEnv = convert.isLocalEnv;
178
180
  exports.useAddToCart = useAddToCart.useAddToCart;
179
181
  exports.useCartData = useCartData.useCartData;
180
182
  exports.useCartDiscountCodesUpdate = useCartDiscountCodesUpdate.useCartDiscountCodesUpdate;
@@ -1,6 +1,7 @@
1
1
  import 'react';
2
2
  import 'swr';
3
3
  import { RenderIf, template } from '../helpers/render.js';
4
+ import '../helpers/convert.js';
4
5
  import { composeAdvanceStyle } from '../helpers/compose-advance-style.js';
5
6
  import { disableWrap } from './constant.js';
6
7
 
@@ -1,7 +1,7 @@
1
1
  const ProductSelect = `
2
2
  fragment ProductSelect on Product {
3
3
  ...ProductLittleSelect
4
- medias(first: $firstMedia, after: $afterMedia) {
4
+ medias(first: $firstMedia, after: $afterMedia, orderBy: $orderByMedia) {
5
5
  edges {
6
6
  cursor
7
7
  node {
@@ -9,7 +9,7 @@ import { VariantSelect } from '../fragments/variant.generated.js';
9
9
  import { SelectedOptionSelect } from '../fragments/selected-option.generated.js';
10
10
 
11
11
  const CollectionDetailFilterDocument = `
12
- query collectionDetailFilter($firstProduct: Int = 10, $orderBy: CollectionOrder, $where: CollectionWhereInput, $orderByProduct: ProductOrder, $productsAfter: Cursor, $firstVariant: Int, $afterVariant: Cursor, $afterMedia: Cursor, $firstMedia: Int, $whereProduct: ProductWhereInput) {
12
+ query collectionDetailFilter($firstProduct: Int = 10, $orderBy: CollectionOrder, $where: CollectionWhereInput, $orderByProduct: ProductOrder, $productsAfter: Cursor, $firstVariant: Int, $afterVariant: Cursor, $afterMedia: Cursor, $firstMedia: Int, $orderByMedia: MediaOrder, $whereProduct: ProductWhereInput) {
13
13
  collections(first: 1, orderBy: $orderBy, where: $where) {
14
14
  edges {
15
15
  cursor
@@ -7,7 +7,7 @@ import { VariantSelect } from '../fragments/variant.generated.js';
7
7
  import { SelectedOptionSelect } from '../fragments/selected-option.generated.js';
8
8
 
9
9
  const CollectionDocument = `
10
- query collection($first: Int = 5, $firstMedia: Int = 20, $afterMedia: Cursor, $firstVariant: Int = 20, $afterVariant: Cursor, $handle: String, $id: ID) {
10
+ query collection($first: Int = 5, $firstMedia: Int = 20, $orderByMedia: MediaOrder, $afterMedia: Cursor, $firstVariant: Int = 20, $afterVariant: Cursor, $handle: String, $id: ID) {
11
11
  collection(handle: $handle, id: $id) {
12
12
  baseID
13
13
  createdAt
@@ -1,12 +1,12 @@
1
1
  import { MediaSelect } from '../fragments/media.generated.js';
2
2
 
3
3
  const ProductMediasDocument = `
4
- query productMedias($firstMedia: Int = 50, $afterMedia: Cursor, $orderBy: ProductOrder, $where: ProductWhereInput) {
4
+ query productMedias($firstMedia: Int = 50, $afterMedia: Cursor, $orderBy: ProductOrder, $where: ProductWhereInput, $orderByMedia: MediaOrder) {
5
5
  medias: products(first: 1, orderBy: $orderBy, where: $where) {
6
6
  edges {
7
7
  node {
8
8
  id
9
- medias(first: $firstMedia, after: $afterMedia) {
9
+ medias(first: $firstMedia, after: $afterMedia, orderBy: $orderByMedia) {
10
10
  edges {
11
11
  cursor
12
12
  node {
@@ -15,7 +15,7 @@ const ProductsEdgeDetail = `
15
15
  }
16
16
  `;
17
17
  const ProductsDocument = `
18
- query products($first: Int, $where: ProductWhereInput, $firstMedia: Int, $orderBy: ProductOrder, $after: Cursor, $firstVariant: Int, $afterVariant: Cursor, $afterMedia: Cursor) {
18
+ query products($first: Int, $where: ProductWhereInput, $firstMedia: Int, $orderBy: ProductOrder, $after: Cursor, $firstVariant: Int, $afterVariant: Cursor, $afterMedia: Cursor, $orderByMedia: MediaOrder) {
19
19
  products(first: $first, where: $where, orderBy: $orderBy, after: $after) {
20
20
  edges {
21
21
  ...ProductsEdgeDetail
@@ -19,13 +19,17 @@ const getGlobalColorResponsiveClass = (type, data) => {
19
19
  return '';
20
20
  return Object.entries(data)
21
21
  .map(([device, value]) => {
22
+ const clName = getGlobalColorClass(type, value);
23
+ if (!clName)
24
+ return undefined;
22
25
  if (device === 'desktop') {
23
- return getGlobalColorClass(type, value);
26
+ return clName;
24
27
  }
25
28
  else {
26
- return `${device}:${getGlobalColorClass(type, value)}`;
29
+ return `${device}:${clName}`;
27
30
  }
28
31
  })
32
+ .filter(isDefined)
29
33
  .join(' ');
30
34
  };
31
35
  const getGlobalColorStateClass = (type, data) => {
@@ -33,13 +37,17 @@ const getGlobalColorStateClass = (type, data) => {
33
37
  return '';
34
38
  return Object.entries(data)
35
39
  .map(([state, value]) => {
40
+ const clName = getGlobalColorClass(type, value);
41
+ if (!clName)
42
+ return undefined;
36
43
  if (state === 'normal') {
37
- return getGlobalColorClass(type, value);
44
+ return clName;
38
45
  }
39
46
  else {
40
- return `${state}:${getGlobalColorClass(type, value)}`;
47
+ return `${state}:${clName}`;
41
48
  }
42
49
  })
50
+ .filter(isDefined)
43
51
  .join(' ');
44
52
  };
45
53
  const getGlobalColorStateResponsiveClass = (type, data) => {
@@ -50,28 +58,37 @@ const getGlobalColorStateResponsiveClass = (type, data) => {
50
58
  if (device === 'desktop') {
51
59
  return Object.entries(objectState)
52
60
  .map(([state, value]) => {
61
+ const clName = getGlobalColorClass(type, value);
62
+ if (!clName)
63
+ return undefined;
53
64
  if (state === 'normal') {
54
- return getGlobalColorClass(type, value);
65
+ return clName;
55
66
  }
56
67
  else {
57
- return `${state}:${getGlobalColorClass(type, value)}`;
68
+ return `${state}:${clName}`;
58
69
  }
59
70
  })
71
+ .filter(isDefined)
60
72
  .join(' ');
61
73
  }
62
74
  else {
63
75
  return Object.entries(objectState)
64
76
  .map(([state, value]) => {
77
+ const clName = getGlobalColorClass(type, value);
78
+ if (!clName)
79
+ return undefined;
65
80
  if (state === 'normal') {
66
- return `${device}:${getGlobalColorClass(type, value)}`;
81
+ return `${device}:${clName}`;
67
82
  }
68
83
  else {
69
- return `${device}:${state}:${getGlobalColorClass(type, value)}`;
84
+ return `${device}:${state}:${clName}`;
70
85
  }
71
86
  })
87
+ .filter(isDefined)
72
88
  .join(' ');
73
89
  }
74
90
  })
91
+ .filter(Boolean)
75
92
  .join(' ');
76
93
  };
77
94
  const getGlobalColorResponsiveStyle = (type, data) => {
@@ -0,0 +1,3 @@
1
+ const isLocalEnv = process.env.NEXT_CONVERT_ENV === 'local';
2
+
3
+ export { isLocalEnv };
@@ -57,6 +57,10 @@ const loopFetchCollection = async (fetcher, arg) => {
57
57
  field: 'UPDATED_AT',
58
58
  direction: 'DESC',
59
59
  },
60
+ orderByMedia: {
61
+ field: 'POSITION',
62
+ direction: 'ASC',
63
+ },
60
64
  firstProduct: calculateFirstProduct(arg.numberOfProducts, currentPage, productsPerPage),
61
65
  ...(!arg.id || arg.id.toLowerCase() === 'latest'
62
66
  ? { where: { hasCollectionProducts: true, isSample: arg.isSample } }
@@ -64,6 +64,10 @@ const fetchMedias = async (fetcher, handle) => {
64
64
  const initVariables = {
65
65
  orderBy,
66
66
  where: { handle, isStorefront: true },
67
+ orderByMedia: {
68
+ field: 'POSITION',
69
+ direction: 'ASC',
70
+ },
67
71
  };
68
72
  const query = async (variables) => {
69
73
  try {
@@ -76,6 +76,10 @@ const fetchMedias = async (fetcher, { id, isSample }) => {
76
76
  isSample,
77
77
  ...(id && id.toLowerCase() !== 'latest' && { baseID: id }),
78
78
  },
79
+ orderByMedia: {
80
+ field: 'POSITION',
81
+ direction: 'ASC',
82
+ },
79
83
  };
80
84
  const query = async (variables) => {
81
85
  try {
@@ -62,6 +62,10 @@ const loopFetchProducts = async (fetcher, { ids, isSample }) => {
62
62
  direction: 'DESC',
63
63
  field: 'UPDATED_AT',
64
64
  },
65
+ orderByMedia: {
66
+ field: 'POSITION',
67
+ direction: 'ASC',
68
+ },
65
69
  where: {
66
70
  isStorefront: true,
67
71
  isSample: isSample,
@@ -3,6 +3,7 @@ import { useProductStore } from '../contexts/ProductContext.js';
3
3
  import { flattenConnection } from '../helpers/flatten-connection.js';
4
4
  import 'swr';
5
5
  import { getSelectedVariant } from '../helpers/product.js';
6
+ import '../helpers/convert.js';
6
7
 
7
8
  const useUniqProductID = () => {
8
9
  return useProductStore((s) => s.uiqueId);
package/dist/esm/index.js CHANGED
@@ -50,6 +50,7 @@ export { gtag };
50
50
  import * as tiktokpixel from './helpers/tracking/tiktokpixel.js';
51
51
  export { tiktokpixel };
52
52
  export { RenderIf, props, styles, template } from './helpers/render.js';
53
+ export { isLocalEnv } from './helpers/convert.js';
53
54
  export { useAddToCart } from './hooks/cart/use-add-to-cart.js';
54
55
  export { useCartData } from './hooks/cart/use-cart-data.js';
55
56
  export { useCartDiscountCodesUpdate } from './hooks/cart/use-cart-discount-codes-update.js';
@@ -755,6 +755,7 @@ type ComponentSetting<P extends BaseProps> = {
755
755
  };
756
756
  };
757
757
  };
758
+ order?: string[];
758
759
  };
759
760
 
760
761
  type Maybe<T> = T | undefined;
@@ -3958,6 +3959,8 @@ type ProductOptionValue = {
3958
3959
  label?: Maybe<Scalars['String']>;
3959
3960
  platform?: Maybe<ProductOptionValuePlatform>;
3960
3961
  position?: Maybe<Scalars['Int']>;
3962
+ /** @deprecated Use "position" instead. */
3963
+ sortOrder?: Maybe<Scalars['Float']>;
3961
3964
  updatedAt?: Maybe<Scalars['Time']>;
3962
3965
  };
3963
3966
  type ProductOptionValuePlatform = 'BIG' | 'SHOPIFY' | 'WOO';
@@ -6950,6 +6953,7 @@ type CollectionDetailFilterQueryVariables = Exact<{
6950
6953
  afterVariant?: InputMaybe<Scalars['Cursor']>;
6951
6954
  afterMedia?: InputMaybe<Scalars['Cursor']>;
6952
6955
  firstMedia?: InputMaybe<Scalars['Int']>;
6956
+ orderByMedia?: InputMaybe<MediaOrder>;
6953
6957
  whereProduct?: InputMaybe<ProductWhereInput>;
6954
6958
  }>;
6955
6959
  type CollectionDetailFilterQueryResponse = {
@@ -6991,6 +6995,7 @@ declare const CollectionDetailFilterDocument: string;
6991
6995
  type CollectionQueryVariables = Exact<{
6992
6996
  first?: InputMaybe<Scalars['Int']>;
6993
6997
  firstMedia?: InputMaybe<Scalars['Int']>;
6998
+ orderByMedia?: InputMaybe<MediaOrder>;
6994
6999
  afterMedia?: InputMaybe<Scalars['Cursor']>;
6995
7000
  firstVariant?: InputMaybe<Scalars['Int']>;
6996
7001
  afterVariant?: InputMaybe<Scalars['Cursor']>;
@@ -7054,6 +7059,7 @@ type ProductsQueryVariables = Exact<{
7054
7059
  firstVariant?: InputMaybe<Scalars['Int']>;
7055
7060
  afterVariant?: InputMaybe<Scalars['Cursor']>;
7056
7061
  afterMedia?: InputMaybe<Scalars['Cursor']>;
7062
+ orderByMedia?: InputMaybe<MediaOrder>;
7057
7063
  }>;
7058
7064
  type ProductsQueryResponse = {
7059
7065
  products?: Maybe<{
@@ -7282,6 +7288,8 @@ declare const props: (strings: any, ...keys: any[]) => string;
7282
7288
  declare const styles: (strings: any, ...keys: any[]) => string;
7283
7289
  declare const template: (strings: any, ...keys: any[]) => string;
7284
7290
 
7291
+ declare const isLocalEnv: boolean;
7292
+
7285
7293
  type Func$6 = ReturnType<typeof addToCartOperation>;
7286
7294
  type Response$6 = Awaited<ReturnType<Func$6>>;
7287
7295
  type Args$7 = Parameters<Func$6>[0];
@@ -7289,7 +7297,7 @@ declare const useAddToCart: (options?: SWRMutationConfiguration<Response$6, any,
7289
7297
 
7290
7298
  type Func$5 = ReturnType<typeof getCartOperation>;
7291
7299
  type Response$5 = Awaited<ReturnType<Func$5>>;
7292
- declare const useCartData: (options?: SWRConfiguration<Response$5 | undefined, any>) => swr__internal.SWRResponse<_gem_sdk_adapter_common_dist_types_types_cart.Cart | undefined, any>;
7300
+ declare const useCartData: (options?: SWRConfiguration<Response$5 | undefined, any>) => swr__internal.SWRResponse<_gem_sdk_adapter_common_dist_types_types_cart.Cart | undefined, any, Partial<swr__internal.PublicConfiguration<_gem_sdk_adapter_common_dist_types_types_cart.Cart | undefined, any, (arg: "cart") => swr__internal.FetcherResponse<_gem_sdk_adapter_common_dist_types_types_cart.Cart | undefined>>> | undefined>;
7293
7301
 
7294
7302
  type Func$4 = ReturnType<typeof cartDiscountCodesUpdateOperation>;
7295
7303
  type Response$4 = Awaited<ReturnType<Func$4>>;
@@ -7343,11 +7351,17 @@ type Args$1 = {
7343
7351
  orderBy?: 'TITLE_ASC' | 'TITLE_DESC' | 'CREATED_AT_ASC' | undefined | 'none' | 'CREATED_AT_DESC';
7344
7352
  isSample?: boolean;
7345
7353
  };
7346
- declare const useCollectionQuery: (args: Args$1, options?: SWRConfiguration<CollectionDetailFilterQueryResponse>) => swr__internal.SWRResponse<CollectionDetailFilterQueryResponse, any>;
7354
+ 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>;
7347
7355
 
7348
- declare const useProductQuery: (productId?: string, options?: SWRConfiguration<ProductSelectFragment>) => swr__internal.SWRResponse<ProductSelectFragment, any>;
7356
+ declare const useProductQuery: (productId?: string, options?: SWRConfiguration<ProductSelectFragment>) => swr__internal.SWRResponse<ProductSelectFragment, any, Partial<swr__internal.PublicConfiguration<ProductSelectFragment, any, (arg: ["query/product", {
7357
+ id?: string | undefined;
7358
+ isSample?: boolean | undefined;
7359
+ }]) => swr__internal.FetcherResponse<ProductSelectFragment>>> | undefined>;
7349
7360
 
7350
- declare const useProductsQuery: (ids?: string[], options?: SWRConfiguration<ProductsQueryResponse>) => swr__internal.SWRResponse<ProductsQueryResponse, any>;
7361
+ declare const useProductsQuery: (ids?: string[], options?: SWRConfiguration<ProductsQueryResponse>) => swr__internal.SWRResponse<ProductsQueryResponse, any, Partial<swr__internal.PublicConfiguration<ProductsQueryResponse, any, (arg: ["query/products", {
7362
+ ids?: string[] | undefined;
7363
+ isSample?: boolean | undefined;
7364
+ }]) => swr__internal.FetcherResponse<ProductsQueryResponse>>> | undefined>;
7351
7365
 
7352
7366
  declare const useCurrentDevice: () => NameDevices;
7353
7367
 
@@ -7492,4 +7506,4 @@ declare const fetchMedias: (fetcher: FetchFunc, { id, isSample }: FetchParams) =
7492
7506
 
7493
7507
  declare const getProductBySlug: (fetcher: FetchFunc, slug?: string) => Promise<ProductSelectFragment>;
7494
7508
 
7495
- export { AddOn, AddonProvider, AddonProviderProps, AlignItemProp, AlignProp, Background, BaseProps, BasePropsWrap, BlockEntity, Border, BuilderComponentProvider, BuilderComponentProviderProps, BuilderEntity, BuilderEntityNested, BuilderPreviewProvider, BuilderPreviewProviderProps, BuilderProvider, BuilderProviderProps, BuilderState, Builtin, CartLineProvider, CartLineProviderProps, CollectionDetailFilterDocument, CollectionDetailFilterQueryResponse, CollectionDetailFilterQueryVariables, CollectionDocument, CollectionProvider, CollectionProviderProps, CollectionQueryResponse, CollectionQueryVariables, ColorKey, ColorType$1 as ColorType, ColorValueType, Component, ComponentSetting, ContainerProp, ControlProp, CornerRadius, CornerRadiusType, CustomComponentConfig, DeepPartial, ExtractState, FetchFunc, FlexDirectionProp, FontName, GlobalStyleConfig, GlobalStyleResponsiveConfig, GlobalSwatchesData, GraphQLConnection, GroupPropType, HSLAColorType, HSLColorType, HexColorType, InitComponentType, JudgeMeReviewsWidgetType, KlaviyoWidgetType, LooxReviewsWidgetType, NameDevices, NestedKeys, ObjectDeviceGlobalType, ObjectDevices, OptionNormalStyle, OptionSpecialStyle, PageViewUpDocument, PageViewUpMutationResponse, PageViewUpMutationVariables, PreviewPageDocument, PreviewPageQueryResponse, PreviewPageQueryVariables, Primitive, ProductInputAnalytic, ProductListProvider, ProductListProviderProps, ProductProvider, ProductProviderProps, ProductSelectFragment, ProductsDocument, ProductsQueryResponse, ProductsQueryVariables, PublishedThemePageSelectFragment, PublishedThemePagesDocument, PublishedThemePagesQueryResponse, PublishedThemePagesQueryVariables, RGBAColorType, RGBColorType, RenderMemo as Render, RenderIf, Render as RenderLiquid, RenderMode, RenderPreviewMemo as RenderPreview, RequiredCursorEdge, ResponsiveStateProp, RoundedSize, 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, composeRadius, composeSize, composeSpacing, fetchMedias, fetchVariants, flattenConnection, fpixel, genTypoClass, genVariable, getCollection, getCustomRadius, getGlobalColorCSSProp, getGlobalColorClass, getGlobalColorResponsiveClass, getGlobalColorResponsiveStyle, getGlobalColorStateClass, getGlobalColorStateResponsiveClass, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle, getGlobalColorStyle, getProduct, getProductBySlug, getRadiusCSSFromGlobal, getRadiusStyleActiveState, getResponsiveStateValue, getResponsiveValue, getResponsiveValueByScreen, getSelectedVariant, getShortName, getSingleColorVariable, getSpacingVariable, getStyleBackgroundByDevice, getStyleShadow, getStyleShadowState, globalEvent, gtag, handleConvertBorderColor, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertClassColor, isBrowser, isColor, isDefined, isEmptyChildren, loadScript, makeAspectRatio, makeHeight, makeStyle, makeStyleResponsive, makeStyleResponsiveState, makeStyleState, makeWidth, normalizeBuilderData, optionLayoutStyle, parseSelectedOption, prefetchQueries, props, styles, template, tiktokpixel, useAddToCart, useAddon, useAddons, useBuilderComponent, useBuilderPreviewStore, useBuilderStore, useCartData, useCartDiscountCodesUpdate, useCartId, useCartLine, useCartLineStore, useCartNoteUpdate, useCartUI, useCollection, useCollectionQuery, useCollectionStore, useConnectedShopify, useCreateCart, useCurrency, useCurrentDevice, useCurrentVariant, useCurrentVariantInStock, useEditorMode, useFeaturedImageGlobal, useFormatMoney, useIsSampleProduct, useIsomorphicLayoutEffect, useLazyVideo, useLoadScript, useLocale, useMatchMutate, useMobileOnly, useMoney, usePageType, usePluginEnable, usePrevious, useProduct, useProductList, useProductListProducts, useProductListSettings, useProductListStore, useProductListStyles, useProductProperties, useProductQuery, useProductStore, useProductsQuery, useQuantity, useRemoveCartItem, useSection, useSectionStore, useSelectedOption, useShopStore, useStoreFront, useSuspenseFetch, useSwatchesOptions, useUniqProductID, useUpdateCartItem, useVariant, useVariantOutStock, useVariants, validateEmail };
7509
+ export { AddOn, AddonProvider, AddonProviderProps, AlignItemProp, AlignProp, Background, BaseProps, BasePropsWrap, BlockEntity, Border, BuilderComponentProvider, BuilderComponentProviderProps, BuilderEntity, BuilderEntityNested, BuilderPreviewProvider, BuilderPreviewProviderProps, BuilderProvider, BuilderProviderProps, BuilderState, Builtin, CartLineProvider, CartLineProviderProps, CollectionDetailFilterDocument, CollectionDetailFilterQueryResponse, CollectionDetailFilterQueryVariables, CollectionDocument, CollectionProvider, CollectionProviderProps, CollectionQueryResponse, CollectionQueryVariables, ColorKey, ColorType$1 as ColorType, ColorValueType, Component, ComponentSetting, ContainerProp, ControlProp, CornerRadius, CornerRadiusType, CustomComponentConfig, DeepPartial, ExtractState, FetchFunc, FlexDirectionProp, FontName, GlobalStyleConfig, GlobalStyleResponsiveConfig, GlobalSwatchesData, GraphQLConnection, GroupPropType, HSLAColorType, HSLColorType, HexColorType, InitComponentType, JudgeMeReviewsWidgetType, KlaviyoWidgetType, LooxReviewsWidgetType, NameDevices, NestedKeys, ObjectDeviceGlobalType, ObjectDevices, OptionNormalStyle, OptionSpecialStyle, PageViewUpDocument, PageViewUpMutationResponse, PageViewUpMutationVariables, PreviewPageDocument, PreviewPageQueryResponse, PreviewPageQueryVariables, Primitive, ProductInputAnalytic, ProductListProvider, ProductListProviderProps, ProductProvider, ProductProviderProps, ProductSelectFragment, ProductsDocument, ProductsQueryResponse, ProductsQueryVariables, PublishedThemePageSelectFragment, PublishedThemePagesDocument, PublishedThemePagesQueryResponse, PublishedThemePagesQueryVariables, RGBAColorType, RGBColorType, RenderMemo as Render, RenderIf, Render as RenderLiquid, RenderMode, RenderPreviewMemo as RenderPreview, RequiredCursorEdge, ResponsiveStateProp, RoundedSize, 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, composeRadius, composeSize, composeSpacing, fetchMedias, fetchVariants, flattenConnection, fpixel, genTypoClass, genVariable, getCollection, getCustomRadius, getGlobalColorCSSProp, getGlobalColorClass, getGlobalColorResponsiveClass, getGlobalColorResponsiveStyle, getGlobalColorStateClass, getGlobalColorStateResponsiveClass, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle, getGlobalColorStyle, getProduct, getProductBySlug, getRadiusCSSFromGlobal, getRadiusStyleActiveState, getResponsiveStateValue, getResponsiveValue, getResponsiveValueByScreen, getSelectedVariant, getShortName, getSingleColorVariable, getSpacingVariable, getStyleBackgroundByDevice, getStyleShadow, getStyleShadowState, globalEvent, gtag, handleConvertBorderColor, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertClassColor, isBrowser, isColor, isDefined, isEmptyChildren, isLocalEnv, loadScript, makeAspectRatio, makeHeight, makeStyle, makeStyleResponsive, makeStyleResponsiveState, makeStyleState, makeWidth, normalizeBuilderData, optionLayoutStyle, parseSelectedOption, prefetchQueries, props, styles, template, tiktokpixel, useAddToCart, useAddon, useAddons, useBuilderComponent, useBuilderPreviewStore, useBuilderStore, useCartData, useCartDiscountCodesUpdate, useCartId, useCartLine, useCartLineStore, useCartNoteUpdate, useCartUI, useCollection, useCollectionQuery, useCollectionStore, useConnectedShopify, useCreateCart, useCurrency, useCurrentDevice, useCurrentVariant, useCurrentVariantInStock, useEditorMode, useFeaturedImageGlobal, useFormatMoney, useIsSampleProduct, useIsomorphicLayoutEffect, useLazyVideo, useLoadScript, useLocale, useMatchMutate, useMobileOnly, useMoney, usePageType, usePluginEnable, usePrevious, useProduct, useProductList, useProductListProducts, useProductListSettings, useProductListStore, useProductListStyles, useProductProperties, useProductQuery, useProductStore, useProductsQuery, useQuantity, useRemoveCartItem, useSection, useSectionStore, useSelectedOption, useShopStore, useStoreFront, useSuspenseFetch, 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.5.7",
3
+ "version": "1.5.14",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -29,9 +29,9 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "react-error-boundary": "^3.1.4",
32
- "swr": "^2.0.0",
32
+ "swr": "^2.0.3",
33
33
  "vanilla-lazyload": "17.8.3",
34
- "zustand": "^4.3.0"
34
+ "zustand": "^4.3.2"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "react": "^17 || ^18",