@gem-sdk/core 1.58.0-dev.38 → 1.58.0-dev.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/graphql/fragments/preview-theme-page.generated.js +3 -0
- package/dist/cjs/graphql/queries/preview-page.generated.js +3 -1
- package/dist/cjs/helpers/prefetch-queries.js +5 -3
- package/dist/esm/graphql/fragments/preview-theme-page.generated.js +3 -0
- package/dist/esm/graphql/queries/preview-page.generated.js +3 -1
- package/dist/esm/helpers/prefetch-queries.js +5 -3
- package/dist/types/index.d.ts +7 -6
- package/package.json +2 -2
|
@@ -4,6 +4,7 @@ var previewThemePage_generated = require('../fragments/preview-theme-page.genera
|
|
|
4
4
|
var dataSeo_generated = require('../fragments/data-seo.generated.js');
|
|
5
5
|
var analytic_generated = require('../fragments/analytic.generated.js');
|
|
6
6
|
var customCode_generated = require('../fragments/custom-code.generated.js');
|
|
7
|
+
var customFont_generated = require('../fragments/custom-font.generated.js');
|
|
7
8
|
|
|
8
9
|
const PreviewThemePageDocument = `
|
|
9
10
|
query PreviewThemePage($pageType: PreviewThemePageType!, $handleURL: String) {
|
|
@@ -14,6 +15,7 @@ const PreviewThemePageDocument = `
|
|
|
14
15
|
${previewThemePage_generated.PreviewThemePageSelect}
|
|
15
16
|
${dataSeo_generated.DataSeoSelect}
|
|
16
17
|
${analytic_generated.AnalyticSelect}
|
|
17
|
-
${customCode_generated.CustomCodeSelect}
|
|
18
|
+
${customCode_generated.CustomCodeSelect}
|
|
19
|
+
${customFont_generated.CustomFontSelect}`;
|
|
18
20
|
|
|
19
21
|
exports.PreviewThemePageDocument = PreviewThemePageDocument;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var useSWR = require('swr');
|
|
3
4
|
var getCollection = require('./queries/get-collection.js');
|
|
4
5
|
var getProduct = require('./queries/get-product.js');
|
|
5
6
|
var getProducts = require('./queries/get-products.js');
|
|
7
|
+
var query = require('./query.js');
|
|
6
8
|
|
|
7
9
|
const prefetchQueries = (input, options)=>{
|
|
8
10
|
const queries = [];
|
|
@@ -19,7 +21,7 @@ const prefetchQueries = (input, options)=>{
|
|
|
19
21
|
isStorefront: options?.isStorefront
|
|
20
22
|
};
|
|
21
23
|
data = {
|
|
22
|
-
key:
|
|
24
|
+
key: useSWR.unstable_serialize(query.generateProductQueryKey(variables)),
|
|
23
25
|
func: getProduct.getProduct,
|
|
24
26
|
variables
|
|
25
27
|
};
|
|
@@ -37,7 +39,7 @@ const prefetchQueries = (input, options)=>{
|
|
|
37
39
|
isStorefront: options?.isStorefront
|
|
38
40
|
};
|
|
39
41
|
data = {
|
|
40
|
-
key:
|
|
42
|
+
key: useSWR.unstable_serialize(query.generateCollectionQueryKey(variables)),
|
|
41
43
|
func: getCollection.getCollection,
|
|
42
44
|
variables
|
|
43
45
|
};
|
|
@@ -50,7 +52,7 @@ const prefetchQueries = (input, options)=>{
|
|
|
50
52
|
isStorefront: options?.isStorefront
|
|
51
53
|
};
|
|
52
54
|
data = {
|
|
53
|
-
key:
|
|
55
|
+
key: useSWR.unstable_serialize(query.generateProductsQueryKey(variables)),
|
|
54
56
|
func: getProducts.getProducts,
|
|
55
57
|
variables
|
|
56
58
|
};
|
|
@@ -2,6 +2,7 @@ import { PreviewThemePageSelect } from '../fragments/preview-theme-page.generate
|
|
|
2
2
|
import { DataSeoSelect } from '../fragments/data-seo.generated.js';
|
|
3
3
|
import { AnalyticSelect } from '../fragments/analytic.generated.js';
|
|
4
4
|
import { CustomCodeSelect } from '../fragments/custom-code.generated.js';
|
|
5
|
+
import { CustomFontSelect } from '../fragments/custom-font.generated.js';
|
|
5
6
|
|
|
6
7
|
const PreviewThemePageDocument = `
|
|
7
8
|
query PreviewThemePage($pageType: PreviewThemePageType!, $handleURL: String) {
|
|
@@ -12,6 +13,7 @@ const PreviewThemePageDocument = `
|
|
|
12
13
|
${PreviewThemePageSelect}
|
|
13
14
|
${DataSeoSelect}
|
|
14
15
|
${AnalyticSelect}
|
|
15
|
-
${CustomCodeSelect}
|
|
16
|
+
${CustomCodeSelect}
|
|
17
|
+
${CustomFontSelect}`;
|
|
16
18
|
|
|
17
19
|
export { PreviewThemePageDocument };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { unstable_serialize } from 'swr';
|
|
1
2
|
import { getCollection } from './queries/get-collection.js';
|
|
2
3
|
import { getProduct } from './queries/get-product.js';
|
|
3
4
|
import { getProducts } from './queries/get-products.js';
|
|
5
|
+
import { generateCollectionQueryKey, generateProductsQueryKey, generateProductQueryKey } from './query.js';
|
|
4
6
|
|
|
5
7
|
const prefetchQueries = (input, options)=>{
|
|
6
8
|
const queries = [];
|
|
@@ -17,7 +19,7 @@ const prefetchQueries = (input, options)=>{
|
|
|
17
19
|
isStorefront: options?.isStorefront
|
|
18
20
|
};
|
|
19
21
|
data = {
|
|
20
|
-
key:
|
|
22
|
+
key: unstable_serialize(generateProductQueryKey(variables)),
|
|
21
23
|
func: getProduct,
|
|
22
24
|
variables
|
|
23
25
|
};
|
|
@@ -35,7 +37,7 @@ const prefetchQueries = (input, options)=>{
|
|
|
35
37
|
isStorefront: options?.isStorefront
|
|
36
38
|
};
|
|
37
39
|
data = {
|
|
38
|
-
key:
|
|
40
|
+
key: unstable_serialize(generateCollectionQueryKey(variables)),
|
|
39
41
|
func: getCollection,
|
|
40
42
|
variables
|
|
41
43
|
};
|
|
@@ -48,7 +50,7 @@ const prefetchQueries = (input, options)=>{
|
|
|
48
50
|
isStorefront: options?.isStorefront
|
|
49
51
|
};
|
|
50
52
|
data = {
|
|
51
|
-
key:
|
|
53
|
+
key: unstable_serialize(generateProductsQueryKey(variables)),
|
|
52
54
|
func: getProducts,
|
|
53
55
|
variables
|
|
54
56
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -32211,6 +32211,7 @@ type PreviewThemePageQueryResponse = {
|
|
|
32211
32211
|
themeStyle?: Maybe$1<Pick<PreviewThemeStyle, 'id' | 'data' | 'name'>>;
|
|
32212
32212
|
analytic?: Maybe$1<Pick<Analytic$1, 'fbPixelID' | 'gaTrackingID' | 'tiktokPixelID'>>;
|
|
32213
32213
|
customCode?: Maybe$1<Pick<CustomCode$1, 'body' | 'header'>>;
|
|
32214
|
+
customFonts?: Maybe$1<Array<Maybe$1<Pick<CustomFont$1, 'backupFilePath' | 'fontFamily' | 'fontStyle' | 'fontWeight' | 'mimeType' | 'filePath'>>>>;
|
|
32214
32215
|
}>;
|
|
32215
32216
|
};
|
|
32216
32217
|
declare const PreviewThemePageDocument: string;
|
|
@@ -41881,7 +41882,7 @@ declare const useBlogsQuery: (variables: BlogsQueryVariables | null, options?: S
|
|
|
41881
41882
|
type Func$6 = ReturnType<typeof addToCartOperation>;
|
|
41882
41883
|
type Response$6 = Awaited<ReturnType<Func$6>>;
|
|
41883
41884
|
type Args$5 = Parameters<Func$6>[0];
|
|
41884
|
-
declare const useAddToCart: (options?: SWRMutationConfiguration<Response$6, any,
|
|
41885
|
+
declare const useAddToCart: (options?: SWRMutationConfiguration<Response$6, any, 'add-to-cart', Args$5>) => swr_mutation.SWRMutationResponse<_gem_sdk_adapter_common_dist_types_types_cart.Cart, any, "add-to-cart", _gem_sdk_adapter_common_dist_types_types_cart.AddCartLineInput>;
|
|
41885
41886
|
|
|
41886
41887
|
type Func$5 = ReturnType<typeof getCartOperation>;
|
|
41887
41888
|
type Response$5 = Awaited<ReturnType<Func$5>>;
|
|
@@ -41890,27 +41891,27 @@ declare const useCartData: (options?: SWRConfiguration<Response$5 | undefined, a
|
|
|
41890
41891
|
type Func$4 = ReturnType<typeof cartDiscountCodesUpdateOperation>;
|
|
41891
41892
|
type Response$4 = Awaited<ReturnType<Func$4>>;
|
|
41892
41893
|
type Args$4 = Parameters<Func$4>[0];
|
|
41893
|
-
declare const useCartDiscountCodesUpdate: (options?: SWRMutationConfiguration<Response$4, any,
|
|
41894
|
+
declare const useCartDiscountCodesUpdate: (options?: SWRMutationConfiguration<Response$4, any, 'cart-discount-codes-update', Args$4>) => swr_mutation.SWRMutationResponse<_gem_sdk_adapter_common_dist_types_types_cart.Cart, any, "cart-discount-codes-update", _gem_sdk_adapter_common_dist_types_types_cart.CartDiscountCodesUpdateInput>;
|
|
41894
41895
|
|
|
41895
41896
|
type Func$3 = ReturnType<typeof cartNoteUpdateOperation>;
|
|
41896
41897
|
type Response$3 = Awaited<ReturnType<Func$3>>;
|
|
41897
41898
|
type Args$3 = Parameters<Func$3>[0];
|
|
41898
|
-
declare const useCartNoteUpdate: (options?: SWRMutationConfiguration<Response$3, any,
|
|
41899
|
+
declare const useCartNoteUpdate: (options?: SWRMutationConfiguration<Response$3, any, 'cart-note-update', Args$3>) => swr_mutation.SWRMutationResponse<_gem_sdk_adapter_common_dist_types_types_cart.Cart, any, "cart-note-update", _gem_sdk_adapter_common_dist_types_types_cart.CartNoteUpdateInput>;
|
|
41899
41900
|
|
|
41900
41901
|
type Func$2 = ReturnType<typeof createCartOperation>;
|
|
41901
41902
|
type Response$2 = Awaited<ReturnType<Func$2>>;
|
|
41902
41903
|
type Args$2 = Parameters<Func$2>[0];
|
|
41903
|
-
declare const useCreateCart: (options?: SWRMutationConfiguration<Response$2, any,
|
|
41904
|
+
declare const useCreateCart: (options?: SWRMutationConfiguration<Response$2, any, 'create-cart', Args$2>) => swr_mutation.SWRMutationResponse<_gem_sdk_adapter_common_dist_types_types_cart.Cart, any, "create-cart", _gem_sdk_adapter_common_dist_types_types_cart.CreateCartInput>;
|
|
41904
41905
|
|
|
41905
41906
|
type Func$1 = ReturnType<typeof removeCartItemOperation>;
|
|
41906
41907
|
type Response$1 = Awaited<ReturnType<Func$1>>;
|
|
41907
41908
|
type Args$1 = Parameters<Func$1>[0];
|
|
41908
|
-
declare const useRemoveCartItem: (options?: SWRMutationConfiguration<Response$1, any,
|
|
41909
|
+
declare const useRemoveCartItem: (options?: SWRMutationConfiguration<Response$1, any, 'remove-cart-item', Args$1>) => swr_mutation.SWRMutationResponse<_gem_sdk_adapter_common_dist_types_types_cart.Cart, any, "remove-cart-item", _gem_sdk_adapter_common_dist_types_types_cart.RemoveCartLineInput>;
|
|
41909
41910
|
|
|
41910
41911
|
type Func = ReturnType<typeof updateCartLineOperation>;
|
|
41911
41912
|
type Response = Awaited<ReturnType<Func>>;
|
|
41912
41913
|
type Args = Parameters<Func>[0];
|
|
41913
|
-
declare const useUpdateCartItem: (options?: SWRMutationConfiguration<Response, any,
|
|
41914
|
+
declare const useUpdateCartItem: (options?: SWRMutationConfiguration<Response, any, 'update-cart-item', Args>) => swr_mutation.SWRMutationResponse<_gem_sdk_adapter_common_dist_types_types_cart.Cart, any, "update-cart-item", _gem_sdk_adapter_common_dist_types_types_cart.UpdateCartLineInput>;
|
|
41914
41915
|
|
|
41915
41916
|
declare const useLocale: () => {
|
|
41916
41917
|
locale: string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/core",
|
|
3
|
-
"version": "1.58.0-dev.
|
|
3
|
+
"version": "1.58.0-dev.40",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"cssjson": "2.1.3",
|
|
37
37
|
"dayjs": "^1.11.11",
|
|
38
38
|
"react-error-boundary": "4.0.10",
|
|
39
|
-
"swr": "2.
|
|
39
|
+
"swr": "2.2.0",
|
|
40
40
|
"vanilla-lazyload": "17.8.3",
|
|
41
41
|
"zustand": "4.3.9"
|
|
42
42
|
},
|