@gem-sdk/core 1.9.23 → 1.9.35
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/components/constant.js +2 -1
- package/dist/cjs/helpers/queries/get-collection.js +49 -25
- package/dist/cjs/hooks/shop/use-collection-query.js +2 -2
- package/dist/cjs/hooks/shop/use-collections-query.js +2 -2
- package/dist/cjs/hooks/shop/use-products-query.js +4 -4
- package/dist/cjs/hooks/shop.js +5 -2
- package/dist/esm/components/constant.js +2 -1
- package/dist/esm/helpers/queries/get-collection.js +49 -25
- package/dist/esm/hooks/shop/use-collection-query.js +2 -2
- package/dist/esm/hooks/shop/use-collections-query.js +2 -2
- package/dist/esm/hooks/shop/use-products-query.js +4 -4
- package/dist/esm/hooks/shop.js +5 -2
- package/dist/types/index.d.ts +18 -4
- package/package.json +3 -3
|
@@ -4,6 +4,7 @@ var collectionDetailFilter_generated = require('../../graphql/queries/collection
|
|
|
4
4
|
var productVariants_generated = require('../../graphql/queries/product-variants.generated.js');
|
|
5
5
|
var isDefined = require('../is-defined.js');
|
|
6
6
|
|
|
7
|
+
const PRODUCT_PER_PAGE = 8; // number of products per page
|
|
7
8
|
function productSortedByOrder(key) {
|
|
8
9
|
switch(key){
|
|
9
10
|
case 'TITLE_ASC':
|
|
@@ -54,8 +55,16 @@ const calculateFirstProduct = (numberOfProducts, currentPage, productsPerPage)=>
|
|
|
54
55
|
if (numberOfProducts < productsPerPage) return numberOfProducts;
|
|
55
56
|
return remainingProducts > 0 ? productsPerPage : productsPerPage + remainingProducts;
|
|
56
57
|
};
|
|
58
|
+
const chunkArray = (array, size)=>{
|
|
59
|
+
const chunked_arr = [];
|
|
60
|
+
let index = 0;
|
|
61
|
+
while(index < array.length){
|
|
62
|
+
chunked_arr.push(array.slice(index, size + index));
|
|
63
|
+
index += size;
|
|
64
|
+
}
|
|
65
|
+
return chunked_arr;
|
|
66
|
+
};
|
|
57
67
|
const loopFetchCollection = async (fetcher, arg)=>{
|
|
58
|
-
const productsPerPage = 8; // number of products per page
|
|
59
68
|
let variables; // variables of collection query
|
|
60
69
|
let productAfterFetcher; // product after of collection query
|
|
61
70
|
let dataCollection; // data of collection query
|
|
@@ -63,7 +72,7 @@ const loopFetchCollection = async (fetcher, arg)=>{
|
|
|
63
72
|
let firstCollection;
|
|
64
73
|
let currentPage = 1;
|
|
65
74
|
if (arg.numberOfProducts) {
|
|
66
|
-
const pages = Math.ceil(arg.numberOfProducts /
|
|
75
|
+
const pages = Math.ceil(arg.numberOfProducts / PRODUCT_PER_PAGE);
|
|
67
76
|
while(currentPage <= pages && hasNextPage !== false){
|
|
68
77
|
variables = {
|
|
69
78
|
firstVariant: 1,
|
|
@@ -76,7 +85,7 @@ const loopFetchCollection = async (fetcher, arg)=>{
|
|
|
76
85
|
field: 'POSITION',
|
|
77
86
|
direction: 'ASC'
|
|
78
87
|
},
|
|
79
|
-
firstProduct: calculateFirstProduct(arg.numberOfProducts, currentPage,
|
|
88
|
+
firstProduct: calculateFirstProduct(arg.numberOfProducts, currentPage, PRODUCT_PER_PAGE),
|
|
80
89
|
...!arg.id || arg.id.toLowerCase() === 'latest' ? {
|
|
81
90
|
where: {
|
|
82
91
|
hasCollectionProducts: true,
|
|
@@ -95,8 +104,11 @@ const loopFetchCollection = async (fetcher, arg)=>{
|
|
|
95
104
|
},
|
|
96
105
|
isSample: arg.isSample
|
|
97
106
|
},
|
|
98
|
-
|
|
107
|
+
...productAfterFetcher ? {
|
|
108
|
+
productsAfter: productAfterFetcher
|
|
109
|
+
} : undefined
|
|
99
110
|
};
|
|
111
|
+
console.log(111, variables);
|
|
100
112
|
const pageData = await fetchCollection(fetcher, variables);
|
|
101
113
|
productAfterFetcher = pageData?.collections?.edges?.[0]?.node?.products?.pageInfo?.endCursor;
|
|
102
114
|
if (currentPage === 1) {
|
|
@@ -161,36 +173,48 @@ const mergeProductCollectionVariant = async (fetcher, collection, isSample)=>{
|
|
|
161
173
|
return newCollection;
|
|
162
174
|
};
|
|
163
175
|
const fetchVariantsByBaseIds = async (fetcher, { ids , isSample , isStorefront })=>{
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
first: ids?.length || 1,
|
|
167
|
-
orderBy: {
|
|
168
|
-
field: 'TITLE',
|
|
169
|
-
direction: 'ASC'
|
|
170
|
-
},
|
|
171
|
-
where: {
|
|
172
|
-
status: 'ACTIVE',
|
|
173
|
-
isSample,
|
|
174
|
-
...isStorefront && {
|
|
175
|
-
isStorefront
|
|
176
|
-
},
|
|
177
|
-
...ids?.length && {
|
|
178
|
-
baseIDIn: ids.sort()
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
};
|
|
176
|
+
const chunkedIds = chunkArray(ids ?? [], 8);
|
|
177
|
+
const defaultEdges = [];
|
|
182
178
|
const query = async (variables)=>{
|
|
183
179
|
try {
|
|
184
|
-
|
|
180
|
+
return await fetcher([
|
|
185
181
|
productVariants_generated.ProductVariantsDocument,
|
|
186
182
|
variables
|
|
187
183
|
]);
|
|
188
|
-
return response;
|
|
189
184
|
} catch {
|
|
190
185
|
return {};
|
|
191
186
|
}
|
|
192
187
|
};
|
|
193
|
-
|
|
188
|
+
const promises = chunkedIds.map((chunkedId)=>{
|
|
189
|
+
const variables = {
|
|
190
|
+
firstVariant: 100,
|
|
191
|
+
first: chunkedId.length,
|
|
192
|
+
orderBy: {
|
|
193
|
+
field: 'TITLE',
|
|
194
|
+
direction: 'ASC'
|
|
195
|
+
},
|
|
196
|
+
where: {
|
|
197
|
+
status: 'ACTIVE',
|
|
198
|
+
isSample,
|
|
199
|
+
...isStorefront && {
|
|
200
|
+
isStorefront
|
|
201
|
+
},
|
|
202
|
+
...chunkedId.length && {
|
|
203
|
+
baseIDIn: chunkedId.sort()
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
return query(variables);
|
|
208
|
+
});
|
|
209
|
+
const responses = await Promise.all(promises);
|
|
210
|
+
const edges = responses?.reduce((acc, response)=>{
|
|
211
|
+
return acc.concat(response?.variants?.edges ?? []);
|
|
212
|
+
}, defaultEdges);
|
|
213
|
+
return {
|
|
214
|
+
variants: {
|
|
215
|
+
edges
|
|
216
|
+
}
|
|
217
|
+
};
|
|
194
218
|
};
|
|
195
219
|
|
|
196
220
|
exports.calculateFirstProduct = calculateFirstProduct;
|
|
@@ -8,13 +8,13 @@ var useFetchHandle = require('../useFetchHandle.js');
|
|
|
8
8
|
const useCollectionQuery = (args, options)=>{
|
|
9
9
|
const fetcher = useFetchHandle.useFetchHandle();
|
|
10
10
|
const isSample = shop.useIsSampleProduct();
|
|
11
|
-
return useSWR([
|
|
11
|
+
return useSWR(args ? [
|
|
12
12
|
'query/collection',
|
|
13
13
|
{
|
|
14
14
|
...args,
|
|
15
15
|
isSample
|
|
16
16
|
}
|
|
17
|
-
], ([, arg])=>{
|
|
17
|
+
] : null, ([, arg])=>{
|
|
18
18
|
return getCollection.getCollection(fetcher, arg);
|
|
19
19
|
}, options);
|
|
20
20
|
};
|
|
@@ -6,10 +6,10 @@ var useFetchHandle = require('../useFetchHandle.js');
|
|
|
6
6
|
|
|
7
7
|
const useCollectionsQuery = (variable, options)=>{
|
|
8
8
|
const fetcher = useFetchHandle.useFetchHandle();
|
|
9
|
-
return useSWR([
|
|
9
|
+
return useSWR(variable ? [
|
|
10
10
|
'query/collections',
|
|
11
11
|
variable
|
|
12
|
-
], async ([, arg])=>{
|
|
12
|
+
] : null, async ([, arg])=>{
|
|
13
13
|
return getCollections.getCollections(fetcher, arg);
|
|
14
14
|
}, options);
|
|
15
15
|
};
|
|
@@ -9,16 +9,16 @@ const useProductsQuery = (ids, options)=>{
|
|
|
9
9
|
const fetcher = useFetchHandle.useFetchHandle();
|
|
10
10
|
const isSample = shop.useIsSampleProduct();
|
|
11
11
|
const isStorefront = shop.useIsStorefrontProduct();
|
|
12
|
-
return useSWR([
|
|
12
|
+
return useSWR(ids ? [
|
|
13
13
|
'query/products',
|
|
14
14
|
{
|
|
15
15
|
ids: [
|
|
16
|
-
...ids
|
|
17
|
-
]
|
|
16
|
+
...ids
|
|
17
|
+
].sort(),
|
|
18
18
|
isSample,
|
|
19
19
|
isStorefront
|
|
20
20
|
}
|
|
21
|
-
], async ([, arg])=>{
|
|
21
|
+
] : null, async ([, arg])=>{
|
|
22
22
|
return getProducts.getProducts(fetcher, arg);
|
|
23
23
|
}, options);
|
|
24
24
|
};
|
package/dist/cjs/hooks/shop.js
CHANGED
|
@@ -64,7 +64,7 @@ const useMobileOnly = ()=>{
|
|
|
64
64
|
};
|
|
65
65
|
const useMatchMutate = ()=>{
|
|
66
66
|
const { cache , mutate } = useSWR.useSWRConfig();
|
|
67
|
-
return (matcher,
|
|
67
|
+
return (matcher, opts)=>{
|
|
68
68
|
if (!(cache instanceof Map)) {
|
|
69
69
|
throw new Error('matchMutate requires the cache provider to be a Map instance');
|
|
70
70
|
}
|
|
@@ -74,7 +74,10 @@ const useMatchMutate = ()=>{
|
|
|
74
74
|
keys.push(key);
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
|
-
const mutations = keys.map((key)=>
|
|
77
|
+
const mutations = keys.map((key)=>{
|
|
78
|
+
const cacheData = cache.get(key);
|
|
79
|
+
return mutate(key, cacheData?.data, opts);
|
|
80
|
+
});
|
|
78
81
|
return Promise.all(mutations);
|
|
79
82
|
};
|
|
80
83
|
};
|
|
@@ -2,6 +2,7 @@ import { CollectionDetailFilterDocument } from '../../graphql/queries/collection
|
|
|
2
2
|
import { ProductVariantsDocument } from '../../graphql/queries/product-variants.generated.js';
|
|
3
3
|
import { isDefined } from '../is-defined.js';
|
|
4
4
|
|
|
5
|
+
const PRODUCT_PER_PAGE = 8; // number of products per page
|
|
5
6
|
function productSortedByOrder(key) {
|
|
6
7
|
switch(key){
|
|
7
8
|
case 'TITLE_ASC':
|
|
@@ -52,8 +53,16 @@ const calculateFirstProduct = (numberOfProducts, currentPage, productsPerPage)=>
|
|
|
52
53
|
if (numberOfProducts < productsPerPage) return numberOfProducts;
|
|
53
54
|
return remainingProducts > 0 ? productsPerPage : productsPerPage + remainingProducts;
|
|
54
55
|
};
|
|
56
|
+
const chunkArray = (array, size)=>{
|
|
57
|
+
const chunked_arr = [];
|
|
58
|
+
let index = 0;
|
|
59
|
+
while(index < array.length){
|
|
60
|
+
chunked_arr.push(array.slice(index, size + index));
|
|
61
|
+
index += size;
|
|
62
|
+
}
|
|
63
|
+
return chunked_arr;
|
|
64
|
+
};
|
|
55
65
|
const loopFetchCollection = async (fetcher, arg)=>{
|
|
56
|
-
const productsPerPage = 8; // number of products per page
|
|
57
66
|
let variables; // variables of collection query
|
|
58
67
|
let productAfterFetcher; // product after of collection query
|
|
59
68
|
let dataCollection; // data of collection query
|
|
@@ -61,7 +70,7 @@ const loopFetchCollection = async (fetcher, arg)=>{
|
|
|
61
70
|
let firstCollection;
|
|
62
71
|
let currentPage = 1;
|
|
63
72
|
if (arg.numberOfProducts) {
|
|
64
|
-
const pages = Math.ceil(arg.numberOfProducts /
|
|
73
|
+
const pages = Math.ceil(arg.numberOfProducts / PRODUCT_PER_PAGE);
|
|
65
74
|
while(currentPage <= pages && hasNextPage !== false){
|
|
66
75
|
variables = {
|
|
67
76
|
firstVariant: 1,
|
|
@@ -74,7 +83,7 @@ const loopFetchCollection = async (fetcher, arg)=>{
|
|
|
74
83
|
field: 'POSITION',
|
|
75
84
|
direction: 'ASC'
|
|
76
85
|
},
|
|
77
|
-
firstProduct: calculateFirstProduct(arg.numberOfProducts, currentPage,
|
|
86
|
+
firstProduct: calculateFirstProduct(arg.numberOfProducts, currentPage, PRODUCT_PER_PAGE),
|
|
78
87
|
...!arg.id || arg.id.toLowerCase() === 'latest' ? {
|
|
79
88
|
where: {
|
|
80
89
|
hasCollectionProducts: true,
|
|
@@ -93,8 +102,11 @@ const loopFetchCollection = async (fetcher, arg)=>{
|
|
|
93
102
|
},
|
|
94
103
|
isSample: arg.isSample
|
|
95
104
|
},
|
|
96
|
-
|
|
105
|
+
...productAfterFetcher ? {
|
|
106
|
+
productsAfter: productAfterFetcher
|
|
107
|
+
} : undefined
|
|
97
108
|
};
|
|
109
|
+
console.log(111, variables);
|
|
98
110
|
const pageData = await fetchCollection(fetcher, variables);
|
|
99
111
|
productAfterFetcher = pageData?.collections?.edges?.[0]?.node?.products?.pageInfo?.endCursor;
|
|
100
112
|
if (currentPage === 1) {
|
|
@@ -159,36 +171,48 @@ const mergeProductCollectionVariant = async (fetcher, collection, isSample)=>{
|
|
|
159
171
|
return newCollection;
|
|
160
172
|
};
|
|
161
173
|
const fetchVariantsByBaseIds = async (fetcher, { ids , isSample , isStorefront })=>{
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
first: ids?.length || 1,
|
|
165
|
-
orderBy: {
|
|
166
|
-
field: 'TITLE',
|
|
167
|
-
direction: 'ASC'
|
|
168
|
-
},
|
|
169
|
-
where: {
|
|
170
|
-
status: 'ACTIVE',
|
|
171
|
-
isSample,
|
|
172
|
-
...isStorefront && {
|
|
173
|
-
isStorefront
|
|
174
|
-
},
|
|
175
|
-
...ids?.length && {
|
|
176
|
-
baseIDIn: ids.sort()
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
};
|
|
174
|
+
const chunkedIds = chunkArray(ids ?? [], 8);
|
|
175
|
+
const defaultEdges = [];
|
|
180
176
|
const query = async (variables)=>{
|
|
181
177
|
try {
|
|
182
|
-
|
|
178
|
+
return await fetcher([
|
|
183
179
|
ProductVariantsDocument,
|
|
184
180
|
variables
|
|
185
181
|
]);
|
|
186
|
-
return response;
|
|
187
182
|
} catch {
|
|
188
183
|
return {};
|
|
189
184
|
}
|
|
190
185
|
};
|
|
191
|
-
|
|
186
|
+
const promises = chunkedIds.map((chunkedId)=>{
|
|
187
|
+
const variables = {
|
|
188
|
+
firstVariant: 100,
|
|
189
|
+
first: chunkedId.length,
|
|
190
|
+
orderBy: {
|
|
191
|
+
field: 'TITLE',
|
|
192
|
+
direction: 'ASC'
|
|
193
|
+
},
|
|
194
|
+
where: {
|
|
195
|
+
status: 'ACTIVE',
|
|
196
|
+
isSample,
|
|
197
|
+
...isStorefront && {
|
|
198
|
+
isStorefront
|
|
199
|
+
},
|
|
200
|
+
...chunkedId.length && {
|
|
201
|
+
baseIDIn: chunkedId.sort()
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
return query(variables);
|
|
206
|
+
});
|
|
207
|
+
const responses = await Promise.all(promises);
|
|
208
|
+
const edges = responses?.reduce((acc, response)=>{
|
|
209
|
+
return acc.concat(response?.variants?.edges ?? []);
|
|
210
|
+
}, defaultEdges);
|
|
211
|
+
return {
|
|
212
|
+
variants: {
|
|
213
|
+
edges
|
|
214
|
+
}
|
|
215
|
+
};
|
|
192
216
|
};
|
|
193
217
|
|
|
194
218
|
export { calculateFirstProduct, getCollection };
|
|
@@ -6,13 +6,13 @@ import { useFetchHandle } from '../useFetchHandle.js';
|
|
|
6
6
|
const useCollectionQuery = (args, options)=>{
|
|
7
7
|
const fetcher = useFetchHandle();
|
|
8
8
|
const isSample = useIsSampleProduct();
|
|
9
|
-
return useSWR([
|
|
9
|
+
return useSWR(args ? [
|
|
10
10
|
'query/collection',
|
|
11
11
|
{
|
|
12
12
|
...args,
|
|
13
13
|
isSample
|
|
14
14
|
}
|
|
15
|
-
], ([, arg])=>{
|
|
15
|
+
] : null, ([, arg])=>{
|
|
16
16
|
return getCollection(fetcher, arg);
|
|
17
17
|
}, options);
|
|
18
18
|
};
|
|
@@ -4,10 +4,10 @@ import { useFetchHandle } from '../useFetchHandle.js';
|
|
|
4
4
|
|
|
5
5
|
const useCollectionsQuery = (variable, options)=>{
|
|
6
6
|
const fetcher = useFetchHandle();
|
|
7
|
-
return useSWR([
|
|
7
|
+
return useSWR(variable ? [
|
|
8
8
|
'query/collections',
|
|
9
9
|
variable
|
|
10
|
-
], async ([, arg])=>{
|
|
10
|
+
] : null, async ([, arg])=>{
|
|
11
11
|
return getCollections(fetcher, arg);
|
|
12
12
|
}, options);
|
|
13
13
|
};
|
|
@@ -7,16 +7,16 @@ const useProductsQuery = (ids, options)=>{
|
|
|
7
7
|
const fetcher = useFetchHandle();
|
|
8
8
|
const isSample = useIsSampleProduct();
|
|
9
9
|
const isStorefront = useIsStorefrontProduct();
|
|
10
|
-
return useSWR([
|
|
10
|
+
return useSWR(ids ? [
|
|
11
11
|
'query/products',
|
|
12
12
|
{
|
|
13
13
|
ids: [
|
|
14
|
-
...ids
|
|
15
|
-
]
|
|
14
|
+
...ids
|
|
15
|
+
].sort(),
|
|
16
16
|
isSample,
|
|
17
17
|
isStorefront
|
|
18
18
|
}
|
|
19
|
-
], async ([, arg])=>{
|
|
19
|
+
] : null, async ([, arg])=>{
|
|
20
20
|
return getProducts(fetcher, arg);
|
|
21
21
|
}, options);
|
|
22
22
|
};
|
package/dist/esm/hooks/shop.js
CHANGED
|
@@ -62,7 +62,7 @@ const useMobileOnly = ()=>{
|
|
|
62
62
|
};
|
|
63
63
|
const useMatchMutate = ()=>{
|
|
64
64
|
const { cache , mutate } = useSWRConfig();
|
|
65
|
-
return (matcher,
|
|
65
|
+
return (matcher, opts)=>{
|
|
66
66
|
if (!(cache instanceof Map)) {
|
|
67
67
|
throw new Error('matchMutate requires the cache provider to be a Map instance');
|
|
68
68
|
}
|
|
@@ -72,7 +72,10 @@ const useMatchMutate = ()=>{
|
|
|
72
72
|
keys.push(key);
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
|
-
const mutations = keys.map((key)=>
|
|
75
|
+
const mutations = keys.map((key)=>{
|
|
76
|
+
const cacheData = cache.get(key);
|
|
77
|
+
return mutate(key, cacheData?.data, opts);
|
|
78
|
+
});
|
|
76
79
|
return Promise.all(mutations);
|
|
77
80
|
};
|
|
78
81
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StoreApi } from 'zustand';
|
|
2
2
|
import { Cart as Cart$1, addToCartOperation, getCartOperation, cartDiscountCodesUpdateOperation, cartNoteUpdateOperation, createCartOperation, removeCartItemOperation, updateCartLineOperation } from '@gem-sdk/adapter-shopify';
|
|
3
|
-
import { SWRConfig, SWRConfiguration } from 'swr';
|
|
3
|
+
import { SWRConfig, SWRConfiguration, MutatorOptions } from 'swr';
|
|
4
4
|
import { ShortHandProperty } from '@gem-sdk/styles';
|
|
5
5
|
import * as swr_mutation from 'swr/mutation';
|
|
6
6
|
import { SWRMutationConfiguration } from 'swr/mutation';
|
|
@@ -86,6 +86,7 @@ type RenderMode = 'edit' | 'preview';
|
|
|
86
86
|
|
|
87
87
|
type InitComponentType<T = any> = {
|
|
88
88
|
[K in keyof T]-?: {
|
|
89
|
+
main?: boolean;
|
|
89
90
|
tag: K;
|
|
90
91
|
label?: string;
|
|
91
92
|
settings?: T[K] extends BaseProps ? T[K]['setting'] : unknown;
|
|
@@ -865,6 +866,7 @@ type ComponentSetting<P extends BaseProps> = {
|
|
|
865
866
|
};
|
|
866
867
|
};
|
|
867
868
|
ui?: ControlUI[];
|
|
869
|
+
presets?: ComponentPreset[];
|
|
868
870
|
};
|
|
869
871
|
type ControlUI = {
|
|
870
872
|
type: 'group' | 'tab' | 'advanced' | 'control';
|
|
@@ -886,6 +888,18 @@ type ControlUI = {
|
|
|
886
888
|
};
|
|
887
889
|
};
|
|
888
890
|
};
|
|
891
|
+
type ComponentPreset = {
|
|
892
|
+
id: string;
|
|
893
|
+
name: {
|
|
894
|
+
en: string;
|
|
895
|
+
};
|
|
896
|
+
icon: {
|
|
897
|
+
desktop: string;
|
|
898
|
+
tablet?: string;
|
|
899
|
+
mobile?: string;
|
|
900
|
+
};
|
|
901
|
+
components: InitComponentType[];
|
|
902
|
+
};
|
|
889
903
|
|
|
890
904
|
type Maybe<T> = T | undefined;
|
|
891
905
|
type InputMaybe<T> = T | undefined;
|
|
@@ -7543,7 +7557,7 @@ declare const useStoreFront: () => {
|
|
|
7543
7557
|
declare const usePluginEnable: () => string[] | undefined;
|
|
7544
7558
|
declare const useEditorMode: () => RenderMode | undefined;
|
|
7545
7559
|
declare const useMobileOnly: () => boolean | undefined;
|
|
7546
|
-
declare const useMatchMutate: () => (matcher: RegExp,
|
|
7560
|
+
declare const useMatchMutate: () => <T = any>(matcher: RegExp, opts?: boolean | MutatorOptions<T> | undefined) => Promise<(T | undefined)[][]>;
|
|
7547
7561
|
declare function useConnectedShopify(): boolean;
|
|
7548
7562
|
declare function useIsSampleProduct(): boolean | undefined;
|
|
7549
7563
|
declare function useIsStorefrontProduct(): boolean | undefined;
|
|
@@ -7555,7 +7569,7 @@ type Args$1 = {
|
|
|
7555
7569
|
orderBy?: 'TITLE_ASC' | 'TITLE_DESC' | 'CREATED_AT_ASC' | undefined | 'none' | 'CREATED_AT_DESC';
|
|
7556
7570
|
isSample?: boolean;
|
|
7557
7571
|
};
|
|
7558
|
-
declare const useCollectionQuery: (args
|
|
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>;
|
|
7559
7573
|
|
|
7560
7574
|
declare const useCollectionsQuery: (variable: CollectionsQueryVariables, options?: SWRConfiguration<CollectionsQueryResponse>) => swr__internal.SWRResponse<CollectionsQueryResponse, any, Partial<swr__internal.PublicConfiguration<CollectionsQueryResponse, any, (arg: ["query/collections", Exact<{
|
|
7561
7575
|
after?: InputMaybe<string>;
|
|
@@ -7723,4 +7737,4 @@ declare const fetchMedias: (fetcher: FetchFunc, { id, isSample, isStorefront }:
|
|
|
7723
7737
|
|
|
7724
7738
|
declare const getProductBySlug: (fetcher: FetchFunc, slug?: string) => Promise<ProductSelectFragment>;
|
|
7725
7739
|
|
|
7726
|
-
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, 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 };
|
|
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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/core",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.35",
|
|
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": "4.0.3",
|
|
32
|
-
"swr": "2.1.
|
|
32
|
+
"swr": "2.1.2",
|
|
33
33
|
"vanilla-lazyload": "17.8.3",
|
|
34
|
-
"zustand": "4.3.
|
|
34
|
+
"zustand": "4.3.7"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"react": "^17 || ^18",
|