@gem-sdk/core 1.0.8 → 1.1.0

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.
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ const CustomCodeSelect = `
4
+ fragment CustomCodeSelect on CustomCode {
5
+ body
6
+ header
7
+ }
8
+ `;
9
+
10
+ exports.CustomCodeSelect = CustomCodeSelect;
@@ -5,6 +5,7 @@ const PublishedThemePageSelect = `
5
5
  id
6
6
  name
7
7
  isMobile
8
+ sectionPosition
8
9
  pageSections {
9
10
  ...PublishedPageSectionSelect
10
11
  }
@@ -17,10 +18,12 @@ const PublishedThemePageSelect = `
17
18
  pageStyle {
18
19
  ...PublishedThemeStyleSelect
19
20
  }
20
- sectionPosition
21
21
  themePageAnalytic {
22
22
  ...AnalyticSelect
23
23
  }
24
+ themePageCustomCode {
25
+ ...CustomCodeSelect
26
+ }
24
27
  }
25
28
  `;
26
29
 
@@ -6,6 +6,7 @@ var publishedCustomSection_generated = require('../fragments/published-custom-se
6
6
  var dataSeo_generated = require('../fragments/data-seo.generated.js');
7
7
  var publishedThemeStyle_generated = require('../fragments/published-theme-style.generated.js');
8
8
  var analytic_generated = require('../fragments/analytic.generated.js');
9
+ var customCode_generated = require('../fragments/custom-code.generated.js');
9
10
 
10
11
  const PreviewPageDocument = `
11
12
  query previewPage($handleURL: String, $pageType: PublishedThemePageType!) {
@@ -18,6 +19,7 @@ ${publishedPageSection_generated.PublishedPageSectionSelect}
18
19
  ${publishedCustomSection_generated.PublishedCustomSectionSelect}
19
20
  ${dataSeo_generated.DataSeoSelect}
20
21
  ${publishedThemeStyle_generated.PublishedThemeStyleSelect}
21
- ${analytic_generated.AnalyticSelect}`;
22
+ ${analytic_generated.AnalyticSelect}
23
+ ${customCode_generated.CustomCodeSelect}`;
22
24
 
23
25
  exports.PreviewPageDocument = PreviewPageDocument;
@@ -6,6 +6,7 @@ var publishedCustomSection_generated = require('../fragments/published-custom-se
6
6
  var dataSeo_generated = require('../fragments/data-seo.generated.js');
7
7
  var publishedThemeStyle_generated = require('../fragments/published-theme-style.generated.js');
8
8
  var analytic_generated = require('../fragments/analytic.generated.js');
9
+ var customCode_generated = require('../fragments/custom-code.generated.js');
9
10
 
10
11
  const PublishedThemePagesDocument = `
11
12
  query publishedThemePages($slug: String, $slugType: PublishedThemePageType!) {
@@ -18,6 +19,7 @@ ${publishedPageSection_generated.PublishedPageSectionSelect}
18
19
  ${publishedCustomSection_generated.PublishedCustomSectionSelect}
19
20
  ${dataSeo_generated.DataSeoSelect}
20
21
  ${publishedThemeStyle_generated.PublishedThemeStyleSelect}
21
- ${analytic_generated.AnalyticSelect}`;
22
+ ${analytic_generated.AnalyticSelect}
23
+ ${customCode_generated.CustomCodeSelect}`;
22
24
 
23
25
  exports.PublishedThemePagesDocument = PublishedThemePagesDocument;
@@ -37,7 +37,7 @@ const prefetchQueries = (input, isSample) => {
37
37
  };
38
38
  }
39
39
  else {
40
- const variables = { ids: item?.settings?.productIds?.sort?.(), isSample };
40
+ const variables = { ids: [...(item?.settings?.productIds ?? [])].sort(), isSample };
41
41
  data = {
42
42
  key: useSWR.unstable_serialize(['query/products', variables]),
43
43
  func: getProducts.getProducts,
@@ -13,7 +13,33 @@ const getProducts = async (fetcher, { ids, isSample }) => {
13
13
  mergeVariantsToProducts(fetcher, products, isSample),
14
14
  mergeMediasToProducts(fetcher, products, isSample),
15
15
  ]);
16
- return { ...mergedMedias, ...mergedVariant };
16
+ return {
17
+ ...products,
18
+ products: {
19
+ ...products.products,
20
+ edges: products.products?.edges.map((edge) => {
21
+ const medias = mergedMedias.find((item) => item.productId === edge.node?.baseID);
22
+ const variants = mergedVariant.find((item) => item.productId === edge.node?.baseID);
23
+ if (edge.node) {
24
+ return {
25
+ ...edge,
26
+ node: {
27
+ ...edge.node,
28
+ variants: {
29
+ ...edge.node?.variants,
30
+ edges: variants?.items ?? [],
31
+ },
32
+ medias: {
33
+ ...edge.node?.medias,
34
+ edges: medias?.items ?? [],
35
+ },
36
+ },
37
+ };
38
+ }
39
+ return edge;
40
+ }) ?? [],
41
+ },
42
+ };
17
43
  };
18
44
  const fetchProducts = async (fetcher, variables) => {
19
45
  return fetcher([products_generated.ProductsDocument, variables]);
@@ -41,7 +67,7 @@ const loopFetchProducts = async (fetcher, { ids, isSample }) => {
41
67
  where: {
42
68
  isStorefront: true,
43
69
  isSample: isSample,
44
- ...(ids?.length ? { baseIDIn: ids.sort() } : {}),
70
+ ...(ids?.length ? { baseIDIn: ids } : {}),
45
71
  },
46
72
  after: productAfterFetcher,
47
73
  };
@@ -69,54 +95,22 @@ const loopFetchProducts = async (fetcher, { ids, isSample }) => {
69
95
  };
70
96
  const mergeVariantsToProducts = async (fetcher, products, isSample) => {
71
97
  const productsWithVariants = await Promise.all(products?.products?.edges?.map(async (product) => {
72
- return getProduct.fetchVariants(fetcher, { id: product?.node?.baseID, isSample }).then((variants) => {
73
- const res = {
74
- ...product,
75
- ...(product.node
76
- ? {
77
- node: {
78
- ...product.node,
79
- variants: variants.length ? { edges: variants } : undefined,
80
- },
81
- }
82
- : {}),
83
- };
84
- return res;
85
- });
86
- }) ?? []).then((res) => {
98
+ const variants = await getProduct.fetchVariants(fetcher, { id: product?.node?.baseID, isSample });
87
99
  return {
88
- products: {
89
- edges: res,
90
- pageInfo: products?.products?.pageInfo,
91
- },
100
+ productId: product?.node?.baseID,
101
+ items: variants,
92
102
  };
93
- });
103
+ }) ?? []);
94
104
  return productsWithVariants;
95
105
  };
96
106
  const mergeMediasToProducts = async (fetcher, products, isSample) => {
97
107
  const productsWithMedias = await Promise.all(products?.products?.edges?.map(async (product) => {
98
- return getProduct.fetchMedias(fetcher, { id: product?.node?.baseID, isSample }).then((media) => {
99
- const res = {
100
- ...product,
101
- ...(product.node
102
- ? {
103
- node: {
104
- ...product.node,
105
- medias: media.length ? { edges: media } : undefined,
106
- },
107
- }
108
- : {}),
109
- };
110
- return res;
111
- });
112
- }) ?? []).then((res) => {
108
+ const medias = await getProduct.fetchMedias(fetcher, { id: product?.node?.baseID, isSample });
113
109
  return {
114
- products: {
115
- edges: res,
116
- pageInfo: products?.products?.pageInfo,
117
- },
110
+ productId: product?.node?.baseID,
111
+ items: medias,
118
112
  };
119
- });
113
+ }) ?? []);
120
114
  return productsWithMedias;
121
115
  };
122
116
  // future can be used for fetching products with paging ids
@@ -8,7 +8,7 @@ var useFetchHandle = require('../useFetchHandle.js');
8
8
  const useProductsQuery = (ids, options) => {
9
9
  const fetcher = useFetchHandle.useFetchHandle();
10
10
  const isSample = shop.useIsSampleProduct();
11
- return useSWR(['query/products', { ids, isSample }], async ([, arg]) => {
11
+ return useSWR(['query/products', { ids: [...(ids ?? [])]?.sort(), isSample }], async ([, arg]) => {
12
12
  return getProducts.getProducts(fetcher, arg);
13
13
  }, options);
14
14
  };
package/dist/cjs/index.js CHANGED
@@ -17,7 +17,7 @@ var collectionDetailFilter_generated = require('./graphql/queries/collection-det
17
17
  var collection_generated = require('./graphql/queries/collection.generated.js');
18
18
  var publishedThemePages_generated = require('./graphql/queries/published-theme-pages.generated.js');
19
19
  var products_generated = require('./graphql/queries/products.generated.js');
20
- var storeProperty_generated = require('./graphql/queries/storeProperty.generated.js');
20
+ var storeProperty_generated = require('./graphql/queries/store-property.generated.js');
21
21
  var previewPage_generated = require('./graphql/queries/preview-page.generated.js');
22
22
  var borders = require('./helpers/borders.js');
23
23
  var cls = require('./helpers/cls.js');
@@ -0,0 +1,8 @@
1
+ const CustomCodeSelect = `
2
+ fragment CustomCodeSelect on CustomCode {
3
+ body
4
+ header
5
+ }
6
+ `;
7
+
8
+ export { CustomCodeSelect };
@@ -3,6 +3,7 @@ const PublishedThemePageSelect = `
3
3
  id
4
4
  name
5
5
  isMobile
6
+ sectionPosition
6
7
  pageSections {
7
8
  ...PublishedPageSectionSelect
8
9
  }
@@ -15,10 +16,12 @@ const PublishedThemePageSelect = `
15
16
  pageStyle {
16
17
  ...PublishedThemeStyleSelect
17
18
  }
18
- sectionPosition
19
19
  themePageAnalytic {
20
20
  ...AnalyticSelect
21
21
  }
22
+ themePageCustomCode {
23
+ ...CustomCodeSelect
24
+ }
22
25
  }
23
26
  `;
24
27
 
@@ -4,6 +4,7 @@ import { PublishedCustomSectionSelect } from '../fragments/published-custom-sect
4
4
  import { DataSeoSelect } from '../fragments/data-seo.generated.js';
5
5
  import { PublishedThemeStyleSelect } from '../fragments/published-theme-style.generated.js';
6
6
  import { AnalyticSelect } from '../fragments/analytic.generated.js';
7
+ import { CustomCodeSelect } from '../fragments/custom-code.generated.js';
7
8
 
8
9
  const PreviewPageDocument = `
9
10
  query previewPage($handleURL: String, $pageType: PublishedThemePageType!) {
@@ -16,6 +17,7 @@ ${PublishedPageSectionSelect}
16
17
  ${PublishedCustomSectionSelect}
17
18
  ${DataSeoSelect}
18
19
  ${PublishedThemeStyleSelect}
19
- ${AnalyticSelect}`;
20
+ ${AnalyticSelect}
21
+ ${CustomCodeSelect}`;
20
22
 
21
23
  export { PreviewPageDocument };
@@ -4,6 +4,7 @@ import { PublishedCustomSectionSelect } from '../fragments/published-custom-sect
4
4
  import { DataSeoSelect } from '../fragments/data-seo.generated.js';
5
5
  import { PublishedThemeStyleSelect } from '../fragments/published-theme-style.generated.js';
6
6
  import { AnalyticSelect } from '../fragments/analytic.generated.js';
7
+ import { CustomCodeSelect } from '../fragments/custom-code.generated.js';
7
8
 
8
9
  const PublishedThemePagesDocument = `
9
10
  query publishedThemePages($slug: String, $slugType: PublishedThemePageType!) {
@@ -16,6 +17,7 @@ ${PublishedPageSectionSelect}
16
17
  ${PublishedCustomSectionSelect}
17
18
  ${DataSeoSelect}
18
19
  ${PublishedThemeStyleSelect}
19
- ${AnalyticSelect}`;
20
+ ${AnalyticSelect}
21
+ ${CustomCodeSelect}`;
20
22
 
21
23
  export { PublishedThemePagesDocument };
@@ -35,7 +35,7 @@ const prefetchQueries = (input, isSample) => {
35
35
  };
36
36
  }
37
37
  else {
38
- const variables = { ids: item?.settings?.productIds?.sort?.(), isSample };
38
+ const variables = { ids: [...(item?.settings?.productIds ?? [])].sort(), isSample };
39
39
  data = {
40
40
  key: unstable_serialize(['query/products', variables]),
41
41
  func: getProducts,
@@ -11,7 +11,33 @@ const getProducts = async (fetcher, { ids, isSample }) => {
11
11
  mergeVariantsToProducts(fetcher, products, isSample),
12
12
  mergeMediasToProducts(fetcher, products, isSample),
13
13
  ]);
14
- return { ...mergedMedias, ...mergedVariant };
14
+ return {
15
+ ...products,
16
+ products: {
17
+ ...products.products,
18
+ edges: products.products?.edges.map((edge) => {
19
+ const medias = mergedMedias.find((item) => item.productId === edge.node?.baseID);
20
+ const variants = mergedVariant.find((item) => item.productId === edge.node?.baseID);
21
+ if (edge.node) {
22
+ return {
23
+ ...edge,
24
+ node: {
25
+ ...edge.node,
26
+ variants: {
27
+ ...edge.node?.variants,
28
+ edges: variants?.items ?? [],
29
+ },
30
+ medias: {
31
+ ...edge.node?.medias,
32
+ edges: medias?.items ?? [],
33
+ },
34
+ },
35
+ };
36
+ }
37
+ return edge;
38
+ }) ?? [],
39
+ },
40
+ };
15
41
  };
16
42
  const fetchProducts = async (fetcher, variables) => {
17
43
  return fetcher([ProductsDocument, variables]);
@@ -39,7 +65,7 @@ const loopFetchProducts = async (fetcher, { ids, isSample }) => {
39
65
  where: {
40
66
  isStorefront: true,
41
67
  isSample: isSample,
42
- ...(ids?.length ? { baseIDIn: ids.sort() } : {}),
68
+ ...(ids?.length ? { baseIDIn: ids } : {}),
43
69
  },
44
70
  after: productAfterFetcher,
45
71
  };
@@ -67,54 +93,22 @@ const loopFetchProducts = async (fetcher, { ids, isSample }) => {
67
93
  };
68
94
  const mergeVariantsToProducts = async (fetcher, products, isSample) => {
69
95
  const productsWithVariants = await Promise.all(products?.products?.edges?.map(async (product) => {
70
- return fetchVariants(fetcher, { id: product?.node?.baseID, isSample }).then((variants) => {
71
- const res = {
72
- ...product,
73
- ...(product.node
74
- ? {
75
- node: {
76
- ...product.node,
77
- variants: variants.length ? { edges: variants } : undefined,
78
- },
79
- }
80
- : {}),
81
- };
82
- return res;
83
- });
84
- }) ?? []).then((res) => {
96
+ const variants = await fetchVariants(fetcher, { id: product?.node?.baseID, isSample });
85
97
  return {
86
- products: {
87
- edges: res,
88
- pageInfo: products?.products?.pageInfo,
89
- },
98
+ productId: product?.node?.baseID,
99
+ items: variants,
90
100
  };
91
- });
101
+ }) ?? []);
92
102
  return productsWithVariants;
93
103
  };
94
104
  const mergeMediasToProducts = async (fetcher, products, isSample) => {
95
105
  const productsWithMedias = await Promise.all(products?.products?.edges?.map(async (product) => {
96
- return fetchMedias(fetcher, { id: product?.node?.baseID, isSample }).then((media) => {
97
- const res = {
98
- ...product,
99
- ...(product.node
100
- ? {
101
- node: {
102
- ...product.node,
103
- medias: media.length ? { edges: media } : undefined,
104
- },
105
- }
106
- : {}),
107
- };
108
- return res;
109
- });
110
- }) ?? []).then((res) => {
106
+ const medias = await fetchMedias(fetcher, { id: product?.node?.baseID, isSample });
111
107
  return {
112
- products: {
113
- edges: res,
114
- pageInfo: products?.products?.pageInfo,
115
- },
108
+ productId: product?.node?.baseID,
109
+ items: medias,
116
110
  };
117
- });
111
+ }) ?? []);
118
112
  return productsWithMedias;
119
113
  };
120
114
  // future can be used for fetching products with paging ids
@@ -6,7 +6,7 @@ import { useFetchHandle } from '../useFetchHandle.js';
6
6
  const useProductsQuery = (ids, options) => {
7
7
  const fetcher = useFetchHandle();
8
8
  const isSample = useIsSampleProduct();
9
- return useSWR(['query/products', { ids, isSample }], async ([, arg]) => {
9
+ return useSWR(['query/products', { ids: [...(ids ?? [])]?.sort(), isSample }], async ([, arg]) => {
10
10
  return getProducts(fetcher, arg);
11
11
  }, options);
12
12
  };
package/dist/esm/index.js CHANGED
@@ -15,7 +15,7 @@ export { CollectionDetailFilterDocument } from './graphql/queries/collection-det
15
15
  export { CollectionDocument } from './graphql/queries/collection.generated.js';
16
16
  export { PublishedThemePagesDocument } from './graphql/queries/published-theme-pages.generated.js';
17
17
  export { ProductsDocument } from './graphql/queries/products.generated.js';
18
- export { StorePropertyDocument } from './graphql/queries/storeProperty.generated.js';
18
+ export { StorePropertyDocument } from './graphql/queries/store-property.generated.js';
19
19
  export { PreviewPageDocument } from './graphql/queries/preview-page.generated.js';
20
20
  export { handleConvertBorderColor, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertClassColor } from './helpers/borders.js';
21
21
  export { cls } from './helpers/cls.js';
@@ -1850,6 +1850,10 @@ type CollectionWhereInput = {
1850
1850
  updatedAtNEQ?: InputMaybe<Scalars['Time']>;
1851
1851
  updatedAtNotIn?: InputMaybe<Array<Scalars['Time']>>;
1852
1852
  };
1853
+ type CustomCode = {
1854
+ body?: Maybe<Scalars['String']>;
1855
+ header?: Maybe<Scalars['String']>;
1856
+ };
1853
1857
  type Customer = {
1854
1858
  acceptsMarketing?: Maybe<Scalars['Boolean']>;
1855
1859
  acceptsMarketingUpdatedAt?: Maybe<Scalars['Time']>;
@@ -5324,6 +5328,7 @@ type PublishedThemePage = {
5324
5328
  splitPercentage?: Maybe<Scalars['Float']>;
5325
5329
  status?: Maybe<PublishedThemePageStatus>;
5326
5330
  themePageAnalytic?: Maybe<Analytic>;
5331
+ themePageCustomCode?: Maybe<CustomCode>;
5327
5332
  themePageCustomSections?: Maybe<Array<Maybe<PublishedCustomSection>>>;
5328
5333
  themePageDataSEO?: Maybe<Array<Maybe<DataSeo>>>;
5329
5334
  themePageOnlineStoreData?: Maybe<Array<Maybe<PublishedThemePageOnlineStoreData>>>;
@@ -6073,21 +6078,13 @@ type _Service = {
6073
6078
  sdl?: Maybe<Scalars['String']>;
6074
6079
  };
6075
6080
 
6076
- type shop_Maybe<T> = Maybe<T>;
6077
- type shop_InputMaybe<T> = InputMaybe<T>;
6078
- type shop_Exact<T extends {
6079
- [key: string]: unknown;
6080
- }> = Exact<T>;
6081
- type shop_MakeOptional<T, K extends keyof T> = MakeOptional<T, K>;
6082
- type shop_MakeMaybe<T, K extends keyof T> = MakeMaybe<T, K>;
6083
- type shop_Scalars = Scalars;
6084
6081
  type shop_Analytic = Analytic;
6085
6082
  type shop_Article = Article;
6086
- type shop_ArticleBlogsArgs = ArticleBlogsArgs;
6087
- type shop_ArticleMetafieldArgs = ArticleMetafieldArgs;
6088
6083
  type shop_ArticleBlogWhereInput = ArticleBlogWhereInput;
6084
+ type shop_ArticleBlogsArgs = ArticleBlogsArgs;
6089
6085
  type shop_ArticleConnection = ArticleConnection;
6090
6086
  type shop_ArticleEdge = ArticleEdge;
6087
+ type shop_ArticleMetafieldArgs = ArticleMetafieldArgs;
6091
6088
  type shop_ArticleOrder = ArticleOrder;
6092
6089
  type shop_ArticleOrderField = ArticleOrderField;
6093
6090
  type shop_ArticlePlatform = ArticlePlatform;
@@ -6095,9 +6092,9 @@ type shop_ArticleWhereInput = ArticleWhereInput;
6095
6092
  type shop_AttributeInput = AttributeInput;
6096
6093
  type shop_Blog = Blog;
6097
6094
  type shop_BlogArticlesArgs = BlogArticlesArgs;
6098
- type shop_BlogMetafieldArgs = BlogMetafieldArgs;
6099
6095
  type shop_BlogConnection = BlogConnection;
6100
6096
  type shop_BlogEdge = BlogEdge;
6097
+ type shop_BlogMetafieldArgs = BlogMetafieldArgs;
6101
6098
  type shop_BlogOrder = BlogOrder;
6102
6099
  type shop_BlogOrderField = BlogOrderField;
6103
6100
  type shop_BlogPlatform = BlogPlatform;
@@ -6113,17 +6110,18 @@ type shop_CartLineUpdateInput = CartLineUpdateInput;
6113
6110
  type shop_CartPayload = CartPayload;
6114
6111
  type shop_CartPlatform = CartPlatform;
6115
6112
  type shop_CartUserError = CartUserError;
6116
- type shop_CollectionMetafieldArgs = CollectionMetafieldArgs;
6117
- type shop_CollectionProductsArgs = CollectionProductsArgs;
6118
6113
  type shop_CollectionConnection = CollectionConnection;
6119
6114
  type shop_CollectionEdge = CollectionEdge;
6120
6115
  type shop_CollectionMedia = CollectionMedia;
6121
6116
  type shop_CollectionMediaWhereInput = CollectionMediaWhereInput;
6117
+ type shop_CollectionMetafieldArgs = CollectionMetafieldArgs;
6122
6118
  type shop_CollectionOrder = CollectionOrder;
6123
6119
  type shop_CollectionOrderField = CollectionOrderField;
6124
6120
  type shop_CollectionPlatform = CollectionPlatform;
6125
6121
  type shop_CollectionProductWhereInput = CollectionProductWhereInput;
6122
+ type shop_CollectionProductsArgs = CollectionProductsArgs;
6126
6123
  type shop_CollectionWhereInput = CollectionWhereInput;
6124
+ type shop_CustomCode = CustomCode;
6127
6125
  type shop_Customer = Customer;
6128
6126
  type shop_CustomerAddress = CustomerAddress;
6129
6127
  type shop_CustomerAddressPlatform = CustomerAddressPlatform;
@@ -6148,6 +6146,13 @@ type shop_EntityFindPublishedThemePageCustomSectionByIdArgs = EntityFindPublishe
6148
6146
  type shop_EntityFindPublishedThemePageMetaByIdArgs = EntityFindPublishedThemePageMetaByIdArgs;
6149
6147
  type shop_EntityFindPublishedThemePageOnlineStoreDataByIdArgs = EntityFindPublishedThemePageOnlineStoreDataByIdArgs;
6150
6148
  type shop_EntityFindPublishedThemeStyleByIdArgs = EntityFindPublishedThemeStyleByIdArgs;
6149
+ type shop_Exact<T extends {
6150
+ [key: string]: unknown;
6151
+ }> = Exact<T>;
6152
+ type shop_InputMaybe<T> = InputMaybe<T>;
6153
+ type shop_MakeMaybe<T, K extends keyof T> = MakeMaybe<T, K>;
6154
+ type shop_MakeOptional<T, K extends keyof T> = MakeOptional<T, K>;
6155
+ type shop_Maybe<T> = Maybe<T>;
6151
6156
  type shop_Media = Media;
6152
6157
  type shop_MediaConnection = MediaConnection;
6153
6158
  type shop_MediaEdge = MediaEdge;
@@ -6166,10 +6171,10 @@ type shop_MutationCartNoteUpdateArgs = MutationCartNoteUpdateArgs;
6166
6171
  type shop_ObjectType = ObjectType;
6167
6172
  type shop_OrderDirection = OrderDirection;
6168
6173
  type shop_Page = Page;
6169
- type shop_PageMetafieldArgs = PageMetafieldArgs;
6170
6174
  type shop_PageConnection = PageConnection;
6171
6175
  type shop_PageEdge = PageEdge;
6172
6176
  type shop_PageInfo = PageInfo;
6177
+ type shop_PageMetafieldArgs = PageMetafieldArgs;
6173
6178
  type shop_PageOrder = PageOrder;
6174
6179
  type shop_PageOrderField = PageOrderField;
6175
6180
  type shop_PagePlatform = PagePlatform;
@@ -6183,11 +6188,10 @@ type shop_PriceRulePlatform = PriceRulePlatform;
6183
6188
  type shop_PriceRuleWhereInput = PriceRuleWhereInput;
6184
6189
  type shop_Product = Product;
6185
6190
  type shop_ProductCollectionsArgs = ProductCollectionsArgs;
6186
- type shop_ProductMediasArgs = ProductMediasArgs;
6187
- type shop_ProductMetafieldArgs = ProductMetafieldArgs;
6188
- type shop_ProductVariantsArgs = ProductVariantsArgs;
6189
6191
  type shop_ProductConnection = ProductConnection;
6190
6192
  type shop_ProductEdge = ProductEdge;
6193
+ type shop_ProductMediasArgs = ProductMediasArgs;
6194
+ type shop_ProductMetafieldArgs = ProductMetafieldArgs;
6191
6195
  type shop_ProductOption = ProductOption;
6192
6196
  type shop_ProductOptionPlatform = ProductOptionPlatform;
6193
6197
  type shop_ProductOptionValue = ProductOptionValue;
@@ -6198,13 +6202,14 @@ type shop_ProductOrder = ProductOrder;
6198
6202
  type shop_ProductOrderField = ProductOrderField;
6199
6203
  type shop_ProductPlatform = ProductPlatform;
6200
6204
  type shop_ProductVariant = ProductVariant;
6201
- type shop_ProductVariantMetafieldArgs = ProductVariantMetafieldArgs;
6202
6205
  type shop_ProductVariantConnection = ProductVariantConnection;
6203
6206
  type shop_ProductVariantEdge = ProductVariantEdge;
6207
+ type shop_ProductVariantMetafieldArgs = ProductVariantMetafieldArgs;
6204
6208
  type shop_ProductVariantOrder = ProductVariantOrder;
6205
6209
  type shop_ProductVariantOrderField = ProductVariantOrderField;
6206
6210
  type shop_ProductVariantPlatform = ProductVariantPlatform;
6207
6211
  type shop_ProductVariantWhereInput = ProductVariantWhereInput;
6212
+ type shop_ProductVariantsArgs = ProductVariantsArgs;
6208
6213
  type shop_ProductWhereInput = ProductWhereInput;
6209
6214
  type shop_PublishedCustomSection = PublishedCustomSection;
6210
6215
  type shop_PublishedCustomSectionType = PublishedCustomSectionType;
@@ -6229,7 +6234,6 @@ type shop_PublishedThemePageWhereInput = PublishedThemePageWhereInput;
6229
6234
  type shop_PublishedThemeStyle = PublishedThemeStyle;
6230
6235
  type shop_PublishedThemeStyleWhereInput = PublishedThemeStyleWhereInput;
6231
6236
  type shop_Query = Query;
6232
- type shop_Query_EntitiesArgs = Query_EntitiesArgs;
6233
6237
  type shop_QueryArticleArgs = QueryArticleArgs;
6234
6238
  type shop_QueryArticlesArgs = QueryArticlesArgs;
6235
6239
  type shop_QueryBlogArgs = QueryBlogArgs;
@@ -6245,6 +6249,8 @@ type shop_QueryPreviewPageArgs = QueryPreviewPageArgs;
6245
6249
  type shop_QueryProductArgs = QueryProductArgs;
6246
6250
  type shop_QueryProductsArgs = QueryProductsArgs;
6247
6251
  type shop_QueryPublishedThemePagesArgs = QueryPublishedThemePagesArgs;
6252
+ type shop_Query_EntitiesArgs = Query_EntitiesArgs;
6253
+ type shop_Scalars = Scalars;
6248
6254
  type shop_SelectedOption = SelectedOption;
6249
6255
  type shop_ShopTokenWhereInput = ShopTokenWhereInput;
6250
6256
  type shop_StoreProperty = StoreProperty;
@@ -6255,19 +6261,13 @@ type shop__Entity = _Entity;
6255
6261
  type shop__Service = _Service;
6256
6262
  declare namespace shop {
6257
6263
  export {
6258
- shop_Maybe as Maybe,
6259
- shop_InputMaybe as InputMaybe,
6260
- shop_Exact as Exact,
6261
- shop_MakeOptional as MakeOptional,
6262
- shop_MakeMaybe as MakeMaybe,
6263
- shop_Scalars as Scalars,
6264
6264
  shop_Analytic as Analytic,
6265
6265
  shop_Article as Article,
6266
- shop_ArticleBlogsArgs as ArticleBlogsArgs,
6267
- shop_ArticleMetafieldArgs as ArticleMetafieldArgs,
6268
6266
  shop_ArticleBlogWhereInput as ArticleBlogWhereInput,
6267
+ shop_ArticleBlogsArgs as ArticleBlogsArgs,
6269
6268
  shop_ArticleConnection as ArticleConnection,
6270
6269
  shop_ArticleEdge as ArticleEdge,
6270
+ shop_ArticleMetafieldArgs as ArticleMetafieldArgs,
6271
6271
  shop_ArticleOrder as ArticleOrder,
6272
6272
  shop_ArticleOrderField as ArticleOrderField,
6273
6273
  shop_ArticlePlatform as ArticlePlatform,
@@ -6275,9 +6275,9 @@ declare namespace shop {
6275
6275
  shop_AttributeInput as AttributeInput,
6276
6276
  shop_Blog as Blog,
6277
6277
  shop_BlogArticlesArgs as BlogArticlesArgs,
6278
- shop_BlogMetafieldArgs as BlogMetafieldArgs,
6279
6278
  shop_BlogConnection as BlogConnection,
6280
6279
  shop_BlogEdge as BlogEdge,
6280
+ shop_BlogMetafieldArgs as BlogMetafieldArgs,
6281
6281
  shop_BlogOrder as BlogOrder,
6282
6282
  shop_BlogOrderField as BlogOrderField,
6283
6283
  shop_BlogPlatform as BlogPlatform,
@@ -6294,17 +6294,18 @@ declare namespace shop {
6294
6294
  shop_CartPlatform as CartPlatform,
6295
6295
  shop_CartUserError as CartUserError,
6296
6296
  Collection$1 as Collection,
6297
- shop_CollectionMetafieldArgs as CollectionMetafieldArgs,
6298
- shop_CollectionProductsArgs as CollectionProductsArgs,
6299
6297
  shop_CollectionConnection as CollectionConnection,
6300
6298
  shop_CollectionEdge as CollectionEdge,
6301
6299
  shop_CollectionMedia as CollectionMedia,
6302
6300
  shop_CollectionMediaWhereInput as CollectionMediaWhereInput,
6301
+ shop_CollectionMetafieldArgs as CollectionMetafieldArgs,
6303
6302
  shop_CollectionOrder as CollectionOrder,
6304
6303
  shop_CollectionOrderField as CollectionOrderField,
6305
6304
  shop_CollectionPlatform as CollectionPlatform,
6306
6305
  shop_CollectionProductWhereInput as CollectionProductWhereInput,
6306
+ shop_CollectionProductsArgs as CollectionProductsArgs,
6307
6307
  shop_CollectionWhereInput as CollectionWhereInput,
6308
+ shop_CustomCode as CustomCode,
6308
6309
  shop_Customer as Customer,
6309
6310
  shop_CustomerAddress as CustomerAddress,
6310
6311
  shop_CustomerAddressPlatform as CustomerAddressPlatform,
@@ -6329,6 +6330,11 @@ declare namespace shop {
6329
6330
  shop_EntityFindPublishedThemePageMetaByIdArgs as EntityFindPublishedThemePageMetaByIdArgs,
6330
6331
  shop_EntityFindPublishedThemePageOnlineStoreDataByIdArgs as EntityFindPublishedThemePageOnlineStoreDataByIdArgs,
6331
6332
  shop_EntityFindPublishedThemeStyleByIdArgs as EntityFindPublishedThemeStyleByIdArgs,
6333
+ shop_Exact as Exact,
6334
+ shop_InputMaybe as InputMaybe,
6335
+ shop_MakeMaybe as MakeMaybe,
6336
+ shop_MakeOptional as MakeOptional,
6337
+ shop_Maybe as Maybe,
6332
6338
  shop_Media as Media,
6333
6339
  shop_MediaConnection as MediaConnection,
6334
6340
  shop_MediaEdge as MediaEdge,
@@ -6347,10 +6353,10 @@ declare namespace shop {
6347
6353
  shop_ObjectType as ObjectType,
6348
6354
  shop_OrderDirection as OrderDirection,
6349
6355
  shop_Page as Page,
6350
- shop_PageMetafieldArgs as PageMetafieldArgs,
6351
6356
  shop_PageConnection as PageConnection,
6352
6357
  shop_PageEdge as PageEdge,
6353
6358
  shop_PageInfo as PageInfo,
6359
+ shop_PageMetafieldArgs as PageMetafieldArgs,
6354
6360
  shop_PageOrder as PageOrder,
6355
6361
  shop_PageOrderField as PageOrderField,
6356
6362
  shop_PagePlatform as PagePlatform,
@@ -6364,11 +6370,10 @@ declare namespace shop {
6364
6370
  shop_PriceRuleWhereInput as PriceRuleWhereInput,
6365
6371
  shop_Product as Product,
6366
6372
  shop_ProductCollectionsArgs as ProductCollectionsArgs,
6367
- shop_ProductMediasArgs as ProductMediasArgs,
6368
- shop_ProductMetafieldArgs as ProductMetafieldArgs,
6369
- shop_ProductVariantsArgs as ProductVariantsArgs,
6370
6373
  shop_ProductConnection as ProductConnection,
6371
6374
  shop_ProductEdge as ProductEdge,
6375
+ shop_ProductMediasArgs as ProductMediasArgs,
6376
+ shop_ProductMetafieldArgs as ProductMetafieldArgs,
6372
6377
  shop_ProductOption as ProductOption,
6373
6378
  shop_ProductOptionPlatform as ProductOptionPlatform,
6374
6379
  shop_ProductOptionValue as ProductOptionValue,
@@ -6379,13 +6384,14 @@ declare namespace shop {
6379
6384
  shop_ProductOrderField as ProductOrderField,
6380
6385
  shop_ProductPlatform as ProductPlatform,
6381
6386
  shop_ProductVariant as ProductVariant,
6382
- shop_ProductVariantMetafieldArgs as ProductVariantMetafieldArgs,
6383
6387
  shop_ProductVariantConnection as ProductVariantConnection,
6384
6388
  shop_ProductVariantEdge as ProductVariantEdge,
6389
+ shop_ProductVariantMetafieldArgs as ProductVariantMetafieldArgs,
6385
6390
  shop_ProductVariantOrder as ProductVariantOrder,
6386
6391
  shop_ProductVariantOrderField as ProductVariantOrderField,
6387
6392
  shop_ProductVariantPlatform as ProductVariantPlatform,
6388
6393
  shop_ProductVariantWhereInput as ProductVariantWhereInput,
6394
+ shop_ProductVariantsArgs as ProductVariantsArgs,
6389
6395
  shop_ProductWhereInput as ProductWhereInput,
6390
6396
  shop_PublishedCustomSection as PublishedCustomSection,
6391
6397
  shop_PublishedCustomSectionType as PublishedCustomSectionType,
@@ -6410,7 +6416,6 @@ declare namespace shop {
6410
6416
  shop_PublishedThemeStyle as PublishedThemeStyle,
6411
6417
  shop_PublishedThemeStyleWhereInput as PublishedThemeStyleWhereInput,
6412
6418
  shop_Query as Query,
6413
- shop_Query_EntitiesArgs as Query_EntitiesArgs,
6414
6419
  shop_QueryArticleArgs as QueryArticleArgs,
6415
6420
  shop_QueryArticlesArgs as QueryArticlesArgs,
6416
6421
  shop_QueryBlogArgs as QueryBlogArgs,
@@ -6426,6 +6431,8 @@ declare namespace shop {
6426
6431
  shop_QueryProductArgs as QueryProductArgs,
6427
6432
  shop_QueryProductsArgs as QueryProductsArgs,
6428
6433
  shop_QueryPublishedThemePagesArgs as QueryPublishedThemePagesArgs,
6434
+ shop_Query_EntitiesArgs as Query_EntitiesArgs,
6435
+ shop_Scalars as Scalars,
6429
6436
  shop_SelectedOption as SelectedOption,
6430
6437
  shop_ShopTokenWhereInput as ShopTokenWhereInput,
6431
6438
  shop_StoreProperty as StoreProperty,
@@ -6976,6 +6983,7 @@ type PublishedThemePagesQueryResponse = {
6976
6983
  themePageDataSEO?: Maybe<Array<Maybe<Pick<DataSeo, 'id' | 'key' | 'value'>>>>;
6977
6984
  pageStyle?: Maybe<Pick<PublishedThemeStyle, 'id' | 'data' | 'name'>>;
6978
6985
  themePageAnalytic?: Maybe<Pick<Analytic, 'fbPixelID' | 'gaTrackingID' | 'tiktokPixelID'>>;
6986
+ themePageCustomCode?: Maybe<Pick<CustomCode, 'body' | 'header'>>;
6979
6987
  }>>>;
6980
6988
  };
6981
6989
  declare const PublishedThemePagesDocument: string;
@@ -7039,6 +7047,7 @@ type PreviewPageQueryResponse = {
7039
7047
  themePageDataSEO?: Maybe<Array<Maybe<Pick<DataSeo, 'id' | 'key' | 'value'>>>>;
7040
7048
  pageStyle?: Maybe<Pick<PublishedThemeStyle, 'id' | 'data' | 'name'>>;
7041
7049
  themePageAnalytic?: Maybe<Pick<Analytic, 'fbPixelID' | 'gaTrackingID' | 'tiktokPixelID'>>;
7050
+ themePageCustomCode?: Maybe<Pick<CustomCode, 'body' | 'header'>>;
7042
7051
  }>;
7043
7052
  };
7044
7053
  declare const PreviewPageDocument: string;
@@ -7163,9 +7172,9 @@ declare const addToCart$2: (product: ProductInputAnalytic) => void;
7163
7172
  declare const fpixel_event: typeof event;
7164
7173
  declare namespace fpixel {
7165
7174
  export {
7166
- pageview$1 as pageview,
7167
- fpixel_event as event,
7168
7175
  addToCart$2 as addToCart,
7176
+ fpixel_event as event,
7177
+ pageview$1 as pageview,
7169
7178
  };
7170
7179
  }
7171
7180
 
@@ -7193,8 +7202,8 @@ declare const gtag_productDetail: typeof productDetail;
7193
7202
  declare const gtag_removeFromCart: typeof removeFromCart;
7194
7203
  declare namespace gtag {
7195
7204
  export {
7196
- gtag_pageview as pageview,
7197
7205
  addToCart$1 as addToCart,
7206
+ gtag_pageview as pageview,
7198
7207
  gtag_productClick as productClick,
7199
7208
  gtag_productDetail as productDetail,
7200
7209
  gtag_removeFromCart as removeFromCart,
@@ -7391,6 +7400,7 @@ type PublishedThemePageSelectFragment = Pick<PublishedThemePage, 'id' | 'name' |
7391
7400
  themePageDataSEO?: Maybe<Array<Maybe<Pick<DataSeo, 'id' | 'key' | 'value'>>>>;
7392
7401
  pageStyle?: Maybe<Pick<PublishedThemeStyle, 'id' | 'data' | 'name'>>;
7393
7402
  themePageAnalytic?: Maybe<Pick<Analytic, 'fbPixelID' | 'gaTrackingID' | 'tiktokPixelID'>>;
7403
+ themePageCustomCode?: Maybe<Pick<CustomCode, 'body' | 'header'>>;
7394
7404
  };
7395
7405
 
7396
7406
  type OrderByType = 'TITLE_ASC' | 'TITLE_DESC' | 'CREATED_AT_ASC' | undefined | 'none' | 'CREATED_AT_DESC';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.0.8",
3
+ "version": "1.1.0",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -31,7 +31,7 @@
31
31
  "react-error-boundary": "^3.1.4",
32
32
  "swr": "^2.0.0",
33
33
  "vanilla-lazyload": "17.8.3",
34
- "zustand": "^4.1.5"
34
+ "zustand": "^4.2.0"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "react": "^17 || ^18",