@gem-sdk/core 1.5.7 → 1.5.15-fix.1
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/Render.liquid.js +1 -0
- package/dist/cjs/graphql/fragments/product.generated.js +1 -1
- package/dist/cjs/graphql/queries/collection-detail-filter.generated.js +1 -1
- package/dist/cjs/graphql/queries/collection.generated.js +1 -1
- package/dist/cjs/graphql/queries/product-medias.generated.js +2 -2
- package/dist/cjs/graphql/queries/products.generated.js +1 -1
- package/dist/cjs/helpers/colors.js +25 -8
- package/dist/cjs/helpers/convert.js +5 -0
- package/dist/cjs/helpers/queries/get-collection.js +4 -0
- package/dist/cjs/helpers/queries/get-product-by-slug.js +4 -0
- package/dist/cjs/helpers/queries/get-product.js +4 -0
- package/dist/cjs/helpers/queries/get-products.js +4 -0
- package/dist/cjs/hooks/shop.js +7 -0
- package/dist/cjs/hooks/useMoney.js +167 -5
- package/dist/cjs/hooks/useProduct.js +1 -0
- package/dist/cjs/index.js +4 -0
- package/dist/esm/components/Render.liquid.js +1 -0
- package/dist/esm/graphql/fragments/product.generated.js +1 -1
- package/dist/esm/graphql/queries/collection-detail-filter.generated.js +1 -1
- package/dist/esm/graphql/queries/collection.generated.js +1 -1
- package/dist/esm/graphql/queries/product-medias.generated.js +2 -2
- package/dist/esm/graphql/queries/products.generated.js +1 -1
- package/dist/esm/helpers/colors.js +25 -8
- package/dist/esm/helpers/convert.js +3 -0
- package/dist/esm/helpers/queries/get-collection.js +4 -0
- package/dist/esm/helpers/queries/get-product-by-slug.js +4 -0
- package/dist/esm/helpers/queries/get-product.js +4 -0
- package/dist/esm/helpers/queries/get-products.js +4 -0
- package/dist/esm/hooks/shop.js +7 -1
- package/dist/esm/hooks/useMoney.js +167 -5
- package/dist/esm/hooks/useProduct.js +1 -0
- package/dist/esm/index.js +2 -1
- package/dist/types/index.d.ts +24 -5
- package/package.json +4 -4
|
@@ -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
|
|
|
@@ -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
|
|
28
|
+
return clName;
|
|
26
29
|
}
|
|
27
30
|
else {
|
|
28
|
-
return `${device}:${
|
|
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
|
|
46
|
+
return clName;
|
|
40
47
|
}
|
|
41
48
|
else {
|
|
42
|
-
return `${state}:${
|
|
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
|
|
67
|
+
return clName;
|
|
57
68
|
}
|
|
58
69
|
else {
|
|
59
|
-
return `${state}:${
|
|
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}:${
|
|
83
|
+
return `${device}:${clName}`;
|
|
69
84
|
}
|
|
70
85
|
else {
|
|
71
|
-
return `${device}:${state}:${
|
|
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) => {
|
|
@@ -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 } }
|
|
@@ -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 {
|
package/dist/cjs/hooks/shop.js
CHANGED
|
@@ -65,8 +65,15 @@ function useConnectedShopify() {
|
|
|
65
65
|
function useIsSampleProduct() {
|
|
66
66
|
const { storefrontToken } = useStoreFront();
|
|
67
67
|
return !storefrontToken;
|
|
68
|
+
}
|
|
69
|
+
function useCheckoutUrl(url) {
|
|
70
|
+
const { storefrontToken } = useStoreFront();
|
|
71
|
+
if (!url)
|
|
72
|
+
return undefined;
|
|
73
|
+
return storefrontToken ? `${url}?access_token=${storefrontToken}` : url;
|
|
68
74
|
}
|
|
69
75
|
|
|
76
|
+
exports.useCheckoutUrl = useCheckoutUrl;
|
|
70
77
|
exports.useConnectedShopify = useConnectedShopify;
|
|
71
78
|
exports.useCurrency = useCurrency;
|
|
72
79
|
exports.useEditorMode = useEditorMode;
|
|
@@ -6,17 +6,179 @@ var react = require('react');
|
|
|
6
6
|
var shop = require('./shop.js');
|
|
7
7
|
|
|
8
8
|
const NARROW_SYMBOL_MAP = {
|
|
9
|
-
|
|
9
|
+
AED: 'د.إ',
|
|
10
|
+
AFN: '؋',
|
|
11
|
+
ALL: 'L',
|
|
12
|
+
AMD: 'դր.',
|
|
13
|
+
ANG: 'ƒ',
|
|
14
|
+
AOA: 'Kz',
|
|
15
|
+
ARS: '$',
|
|
10
16
|
AUD: '$',
|
|
17
|
+
AWG: 'ƒ',
|
|
18
|
+
AZN: '₼',
|
|
19
|
+
BAM: 'КМ',
|
|
20
|
+
BBD: '$',
|
|
21
|
+
BDT: '৳',
|
|
22
|
+
BGN: 'лв.',
|
|
23
|
+
BHD: 'ب.د',
|
|
24
|
+
BIF: 'Fr',
|
|
25
|
+
BMD: '$',
|
|
26
|
+
BND: '$',
|
|
27
|
+
BOB: 'Bs.',
|
|
28
|
+
BRL: 'R$',
|
|
29
|
+
BSD: '$',
|
|
30
|
+
BTN: 'Nu.',
|
|
31
|
+
BWP: 'P',
|
|
32
|
+
BYN: 'Br',
|
|
33
|
+
BYR: 'Br',
|
|
34
|
+
BZD: '$',
|
|
11
35
|
CAD: '$',
|
|
12
|
-
|
|
36
|
+
CDF: 'Fr',
|
|
37
|
+
CHF: 'CHF',
|
|
38
|
+
CLF: 'UF',
|
|
39
|
+
CLP: '$',
|
|
40
|
+
CNY: '¥',
|
|
41
|
+
COP: '$',
|
|
42
|
+
CRC: '₡',
|
|
43
|
+
CUC: '$',
|
|
44
|
+
CUP: '$',
|
|
45
|
+
CVE: '$',
|
|
46
|
+
CZK: 'Kč',
|
|
47
|
+
DJF: 'Fdj',
|
|
48
|
+
DKK: 'kr.',
|
|
49
|
+
DOP: '$',
|
|
50
|
+
DZD: 'د.ج',
|
|
51
|
+
EGP: 'ج.م',
|
|
52
|
+
ERN: 'Nfk',
|
|
53
|
+
ETB: 'Br',
|
|
13
54
|
EUR: '€',
|
|
55
|
+
FJD: '$',
|
|
56
|
+
FKP: '£',
|
|
14
57
|
GBP: '£',
|
|
58
|
+
GEL: 'ლ',
|
|
59
|
+
GHS: '₵',
|
|
60
|
+
GIP: '£',
|
|
61
|
+
GMD: 'D',
|
|
62
|
+
GNF: 'Fr',
|
|
63
|
+
GTQ: 'Q',
|
|
64
|
+
GYD: '$',
|
|
65
|
+
HKD: '$',
|
|
66
|
+
HNL: 'L',
|
|
67
|
+
HRK: 'kn',
|
|
68
|
+
HTG: 'G',
|
|
69
|
+
HUF: 'Ft',
|
|
70
|
+
IDR: 'Rp',
|
|
71
|
+
ILS: '₪',
|
|
15
72
|
INR: '₹',
|
|
16
|
-
|
|
17
|
-
|
|
73
|
+
IQD: 'ع.د',
|
|
74
|
+
IRR: '﷼',
|
|
75
|
+
ISK: 'kr',
|
|
76
|
+
JMD: '$',
|
|
77
|
+
JOD: 'د.ا',
|
|
18
78
|
JPY: '¥',
|
|
19
|
-
|
|
79
|
+
KES: 'KSh',
|
|
80
|
+
KGS: 'som',
|
|
81
|
+
KHR: '៛',
|
|
82
|
+
KMF: 'Fr',
|
|
83
|
+
KPW: '₩',
|
|
84
|
+
KRW: '₩',
|
|
85
|
+
KWD: 'د.ك',
|
|
86
|
+
KYD: '$',
|
|
87
|
+
KZT: '〒',
|
|
88
|
+
LAK: '₭',
|
|
89
|
+
LBP: 'ل.ل',
|
|
90
|
+
LKR: '₨',
|
|
91
|
+
LRD: '$',
|
|
92
|
+
LSL: 'L',
|
|
93
|
+
LTL: 'Lt',
|
|
94
|
+
LVL: 'Ls',
|
|
95
|
+
LYD: 'ل.د',
|
|
96
|
+
MAD: 'د.م.',
|
|
97
|
+
MDL: 'L',
|
|
98
|
+
MGA: 'Ar',
|
|
99
|
+
MKD: 'ден',
|
|
100
|
+
MMK: 'K',
|
|
101
|
+
MNT: '₮',
|
|
102
|
+
MOP: 'P',
|
|
103
|
+
MRU: 'UM',
|
|
104
|
+
MUR: '₨',
|
|
105
|
+
MVR: 'MVR',
|
|
106
|
+
MWK: 'MK',
|
|
107
|
+
MXN: '$',
|
|
108
|
+
MYR: 'RM',
|
|
109
|
+
MZN: 'MTn',
|
|
110
|
+
NAD: '$',
|
|
111
|
+
NGN: '₦',
|
|
112
|
+
NIO: 'C$',
|
|
113
|
+
NOK: 'kr',
|
|
114
|
+
NPR: '₨',
|
|
115
|
+
NZD: '$',
|
|
116
|
+
OMR: 'ر.ع.',
|
|
117
|
+
PAB: 'B/.',
|
|
118
|
+
PEN: 'S/.',
|
|
119
|
+
PGK: 'K',
|
|
120
|
+
PHP: '₱',
|
|
121
|
+
PKR: '₨',
|
|
122
|
+
PLN: 'zł',
|
|
123
|
+
PYG: '₲',
|
|
124
|
+
QAR: 'ر.ق',
|
|
125
|
+
RON: 'Lei',
|
|
126
|
+
RSD: 'РСД',
|
|
127
|
+
RUB: '₽',
|
|
128
|
+
RWF: 'FRw',
|
|
129
|
+
SAR: 'ر.س',
|
|
130
|
+
SBD: '$',
|
|
131
|
+
SCR: '₨',
|
|
132
|
+
SDG: '£',
|
|
133
|
+
SEK: 'kr',
|
|
134
|
+
SGD: '$',
|
|
135
|
+
SHP: '£',
|
|
136
|
+
SKK: 'Sk',
|
|
137
|
+
SLL: 'Le',
|
|
138
|
+
SOS: 'Sh',
|
|
139
|
+
SRD: '$',
|
|
140
|
+
SSP: '£',
|
|
141
|
+
STN: 'Db',
|
|
142
|
+
SVC: '₡',
|
|
143
|
+
SYP: '£S',
|
|
144
|
+
SZL: 'E',
|
|
145
|
+
THB: '฿',
|
|
146
|
+
TJS: 'ЅМ',
|
|
147
|
+
TMT: 'T',
|
|
148
|
+
TND: 'د.ت',
|
|
149
|
+
TOP: 'T$',
|
|
150
|
+
TRY: '₺',
|
|
151
|
+
TTD: '$',
|
|
152
|
+
TWD: '$',
|
|
153
|
+
TZS: 'Sh',
|
|
154
|
+
UAH: '₴',
|
|
155
|
+
UGX: 'USh',
|
|
156
|
+
USD: '$',
|
|
157
|
+
UYU: '$',
|
|
158
|
+
UZS: '',
|
|
159
|
+
VED: 'Bs.D.',
|
|
160
|
+
VES: 'Bs.S.',
|
|
161
|
+
VND: '₫',
|
|
162
|
+
VUV: 'Vt',
|
|
163
|
+
WST: 'T',
|
|
164
|
+
XAF: 'Fr',
|
|
165
|
+
XAG: 'oz t',
|
|
166
|
+
XAU: 'oz t',
|
|
167
|
+
XBA: '',
|
|
168
|
+
XBB: '',
|
|
169
|
+
XBC: '',
|
|
170
|
+
XBD: '',
|
|
171
|
+
XCD: '$',
|
|
172
|
+
XDR: 'SDR',
|
|
173
|
+
XOF: 'Fr',
|
|
174
|
+
XPD: 'oz t',
|
|
175
|
+
XPF: 'Fr',
|
|
176
|
+
XPT: 'oz t',
|
|
177
|
+
xts: '',
|
|
178
|
+
YER: '﷼',
|
|
179
|
+
ZAR: 'R',
|
|
180
|
+
ZMK: 'ZK',
|
|
181
|
+
ZMW: 'ZK',
|
|
20
182
|
};
|
|
21
183
|
const useMoney = (money) => {
|
|
22
184
|
const { locale } = shop.useLocale();
|
|
@@ -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;
|
|
@@ -182,6 +184,7 @@ exports.useCartNoteUpdate = useCartNoteUpdate.useCartNoteUpdate;
|
|
|
182
184
|
exports.useCreateCart = useCreateCart.useCreateCart;
|
|
183
185
|
exports.useRemoveCartItem = useRemoveCartItem.useRemoveCartItem;
|
|
184
186
|
exports.useUpdateCartItem = useUpdateCartItem.useUpdateCartItem;
|
|
187
|
+
exports.useCheckoutUrl = shop.useCheckoutUrl;
|
|
185
188
|
exports.useConnectedShopify = shop.useConnectedShopify;
|
|
186
189
|
exports.useCurrency = shop.useCurrency;
|
|
187
190
|
exports.useEditorMode = shop.useEditorMode;
|
|
@@ -192,6 +195,7 @@ exports.useMobileOnly = shop.useMobileOnly;
|
|
|
192
195
|
exports.usePageType = shop.usePageType;
|
|
193
196
|
exports.usePluginEnable = shop.usePluginEnable;
|
|
194
197
|
exports.useStoreFront = shop.useStoreFront;
|
|
198
|
+
exports.useSwatches = shop.useSwatches;
|
|
195
199
|
exports.useCollectionQuery = useCollectionQuery.useCollectionQuery;
|
|
196
200
|
exports.useProductQuery = useProductQuery.useProductQuery;
|
|
197
201
|
exports.useProductsQuery = useProductsQuery.useProductsQuery;
|
|
@@ -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
|
|
26
|
+
return clName;
|
|
24
27
|
}
|
|
25
28
|
else {
|
|
26
|
-
return `${device}:${
|
|
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
|
|
44
|
+
return clName;
|
|
38
45
|
}
|
|
39
46
|
else {
|
|
40
|
-
return `${state}:${
|
|
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
|
|
65
|
+
return clName;
|
|
55
66
|
}
|
|
56
67
|
else {
|
|
57
|
-
return `${state}:${
|
|
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}:${
|
|
81
|
+
return `${device}:${clName}`;
|
|
67
82
|
}
|
|
68
83
|
else {
|
|
69
|
-
return `${device}:${state}:${
|
|
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) => {
|
|
@@ -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 } }
|
|
@@ -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 {
|
package/dist/esm/hooks/shop.js
CHANGED
|
@@ -63,6 +63,12 @@ function useConnectedShopify() {
|
|
|
63
63
|
function useIsSampleProduct() {
|
|
64
64
|
const { storefrontToken } = useStoreFront();
|
|
65
65
|
return !storefrontToken;
|
|
66
|
+
}
|
|
67
|
+
function useCheckoutUrl(url) {
|
|
68
|
+
const { storefrontToken } = useStoreFront();
|
|
69
|
+
if (!url)
|
|
70
|
+
return undefined;
|
|
71
|
+
return storefrontToken ? `${url}?access_token=${storefrontToken}` : url;
|
|
66
72
|
}
|
|
67
73
|
|
|
68
|
-
export { useConnectedShopify, useCurrency, useEditorMode, useIsSampleProduct, useLocale, useMatchMutate, useMobileOnly, usePageType, usePluginEnable, useStoreFront, useSwatches };
|
|
74
|
+
export { useCheckoutUrl, useConnectedShopify, useCurrency, useEditorMode, useIsSampleProduct, useLocale, useMatchMutate, useMobileOnly, usePageType, usePluginEnable, useStoreFront, useSwatches };
|
|
@@ -2,17 +2,179 @@ import { useMemo } from 'react';
|
|
|
2
2
|
import { useLocale, useCurrency } from './shop.js';
|
|
3
3
|
|
|
4
4
|
const NARROW_SYMBOL_MAP = {
|
|
5
|
-
|
|
5
|
+
AED: 'د.إ',
|
|
6
|
+
AFN: '؋',
|
|
7
|
+
ALL: 'L',
|
|
8
|
+
AMD: 'դր.',
|
|
9
|
+
ANG: 'ƒ',
|
|
10
|
+
AOA: 'Kz',
|
|
11
|
+
ARS: '$',
|
|
6
12
|
AUD: '$',
|
|
13
|
+
AWG: 'ƒ',
|
|
14
|
+
AZN: '₼',
|
|
15
|
+
BAM: 'КМ',
|
|
16
|
+
BBD: '$',
|
|
17
|
+
BDT: '৳',
|
|
18
|
+
BGN: 'лв.',
|
|
19
|
+
BHD: 'ب.د',
|
|
20
|
+
BIF: 'Fr',
|
|
21
|
+
BMD: '$',
|
|
22
|
+
BND: '$',
|
|
23
|
+
BOB: 'Bs.',
|
|
24
|
+
BRL: 'R$',
|
|
25
|
+
BSD: '$',
|
|
26
|
+
BTN: 'Nu.',
|
|
27
|
+
BWP: 'P',
|
|
28
|
+
BYN: 'Br',
|
|
29
|
+
BYR: 'Br',
|
|
30
|
+
BZD: '$',
|
|
7
31
|
CAD: '$',
|
|
8
|
-
|
|
32
|
+
CDF: 'Fr',
|
|
33
|
+
CHF: 'CHF',
|
|
34
|
+
CLF: 'UF',
|
|
35
|
+
CLP: '$',
|
|
36
|
+
CNY: '¥',
|
|
37
|
+
COP: '$',
|
|
38
|
+
CRC: '₡',
|
|
39
|
+
CUC: '$',
|
|
40
|
+
CUP: '$',
|
|
41
|
+
CVE: '$',
|
|
42
|
+
CZK: 'Kč',
|
|
43
|
+
DJF: 'Fdj',
|
|
44
|
+
DKK: 'kr.',
|
|
45
|
+
DOP: '$',
|
|
46
|
+
DZD: 'د.ج',
|
|
47
|
+
EGP: 'ج.م',
|
|
48
|
+
ERN: 'Nfk',
|
|
49
|
+
ETB: 'Br',
|
|
9
50
|
EUR: '€',
|
|
51
|
+
FJD: '$',
|
|
52
|
+
FKP: '£',
|
|
10
53
|
GBP: '£',
|
|
54
|
+
GEL: 'ლ',
|
|
55
|
+
GHS: '₵',
|
|
56
|
+
GIP: '£',
|
|
57
|
+
GMD: 'D',
|
|
58
|
+
GNF: 'Fr',
|
|
59
|
+
GTQ: 'Q',
|
|
60
|
+
GYD: '$',
|
|
61
|
+
HKD: '$',
|
|
62
|
+
HNL: 'L',
|
|
63
|
+
HRK: 'kn',
|
|
64
|
+
HTG: 'G',
|
|
65
|
+
HUF: 'Ft',
|
|
66
|
+
IDR: 'Rp',
|
|
67
|
+
ILS: '₪',
|
|
11
68
|
INR: '₹',
|
|
12
|
-
|
|
13
|
-
|
|
69
|
+
IQD: 'ع.د',
|
|
70
|
+
IRR: '﷼',
|
|
71
|
+
ISK: 'kr',
|
|
72
|
+
JMD: '$',
|
|
73
|
+
JOD: 'د.ا',
|
|
14
74
|
JPY: '¥',
|
|
15
|
-
|
|
75
|
+
KES: 'KSh',
|
|
76
|
+
KGS: 'som',
|
|
77
|
+
KHR: '៛',
|
|
78
|
+
KMF: 'Fr',
|
|
79
|
+
KPW: '₩',
|
|
80
|
+
KRW: '₩',
|
|
81
|
+
KWD: 'د.ك',
|
|
82
|
+
KYD: '$',
|
|
83
|
+
KZT: '〒',
|
|
84
|
+
LAK: '₭',
|
|
85
|
+
LBP: 'ل.ل',
|
|
86
|
+
LKR: '₨',
|
|
87
|
+
LRD: '$',
|
|
88
|
+
LSL: 'L',
|
|
89
|
+
LTL: 'Lt',
|
|
90
|
+
LVL: 'Ls',
|
|
91
|
+
LYD: 'ل.د',
|
|
92
|
+
MAD: 'د.م.',
|
|
93
|
+
MDL: 'L',
|
|
94
|
+
MGA: 'Ar',
|
|
95
|
+
MKD: 'ден',
|
|
96
|
+
MMK: 'K',
|
|
97
|
+
MNT: '₮',
|
|
98
|
+
MOP: 'P',
|
|
99
|
+
MRU: 'UM',
|
|
100
|
+
MUR: '₨',
|
|
101
|
+
MVR: 'MVR',
|
|
102
|
+
MWK: 'MK',
|
|
103
|
+
MXN: '$',
|
|
104
|
+
MYR: 'RM',
|
|
105
|
+
MZN: 'MTn',
|
|
106
|
+
NAD: '$',
|
|
107
|
+
NGN: '₦',
|
|
108
|
+
NIO: 'C$',
|
|
109
|
+
NOK: 'kr',
|
|
110
|
+
NPR: '₨',
|
|
111
|
+
NZD: '$',
|
|
112
|
+
OMR: 'ر.ع.',
|
|
113
|
+
PAB: 'B/.',
|
|
114
|
+
PEN: 'S/.',
|
|
115
|
+
PGK: 'K',
|
|
116
|
+
PHP: '₱',
|
|
117
|
+
PKR: '₨',
|
|
118
|
+
PLN: 'zł',
|
|
119
|
+
PYG: '₲',
|
|
120
|
+
QAR: 'ر.ق',
|
|
121
|
+
RON: 'Lei',
|
|
122
|
+
RSD: 'РСД',
|
|
123
|
+
RUB: '₽',
|
|
124
|
+
RWF: 'FRw',
|
|
125
|
+
SAR: 'ر.س',
|
|
126
|
+
SBD: '$',
|
|
127
|
+
SCR: '₨',
|
|
128
|
+
SDG: '£',
|
|
129
|
+
SEK: 'kr',
|
|
130
|
+
SGD: '$',
|
|
131
|
+
SHP: '£',
|
|
132
|
+
SKK: 'Sk',
|
|
133
|
+
SLL: 'Le',
|
|
134
|
+
SOS: 'Sh',
|
|
135
|
+
SRD: '$',
|
|
136
|
+
SSP: '£',
|
|
137
|
+
STN: 'Db',
|
|
138
|
+
SVC: '₡',
|
|
139
|
+
SYP: '£S',
|
|
140
|
+
SZL: 'E',
|
|
141
|
+
THB: '฿',
|
|
142
|
+
TJS: 'ЅМ',
|
|
143
|
+
TMT: 'T',
|
|
144
|
+
TND: 'د.ت',
|
|
145
|
+
TOP: 'T$',
|
|
146
|
+
TRY: '₺',
|
|
147
|
+
TTD: '$',
|
|
148
|
+
TWD: '$',
|
|
149
|
+
TZS: 'Sh',
|
|
150
|
+
UAH: '₴',
|
|
151
|
+
UGX: 'USh',
|
|
152
|
+
USD: '$',
|
|
153
|
+
UYU: '$',
|
|
154
|
+
UZS: '',
|
|
155
|
+
VED: 'Bs.D.',
|
|
156
|
+
VES: 'Bs.S.',
|
|
157
|
+
VND: '₫',
|
|
158
|
+
VUV: 'Vt',
|
|
159
|
+
WST: 'T',
|
|
160
|
+
XAF: 'Fr',
|
|
161
|
+
XAG: 'oz t',
|
|
162
|
+
XAU: 'oz t',
|
|
163
|
+
XBA: '',
|
|
164
|
+
XBB: '',
|
|
165
|
+
XBC: '',
|
|
166
|
+
XBD: '',
|
|
167
|
+
XCD: '$',
|
|
168
|
+
XDR: 'SDR',
|
|
169
|
+
XOF: 'Fr',
|
|
170
|
+
XPD: 'oz t',
|
|
171
|
+
XPF: 'Fr',
|
|
172
|
+
XPT: 'oz t',
|
|
173
|
+
xts: '',
|
|
174
|
+
YER: '﷼',
|
|
175
|
+
ZAR: 'R',
|
|
176
|
+
ZMK: 'ZK',
|
|
177
|
+
ZMW: 'ZK',
|
|
16
178
|
};
|
|
17
179
|
const useMoney = (money) => {
|
|
18
180
|
const { locale } = useLocale();
|
|
@@ -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';
|
|
@@ -57,7 +58,7 @@ export { useCartNoteUpdate } from './hooks/cart/use-cart-note-update.js';
|
|
|
57
58
|
export { useCreateCart } from './hooks/cart/use-create-cart.js';
|
|
58
59
|
export { useRemoveCartItem } from './hooks/cart/use-remove-cart-item.js';
|
|
59
60
|
export { useUpdateCartItem } from './hooks/cart/use-update-cart-item.js';
|
|
60
|
-
export { useConnectedShopify, useCurrency, useEditorMode, useIsSampleProduct, useLocale, useMatchMutate, useMobileOnly, usePageType, usePluginEnable, useStoreFront } from './hooks/shop.js';
|
|
61
|
+
export { useCheckoutUrl, useConnectedShopify, useCurrency, useEditorMode, useIsSampleProduct, useLocale, useMatchMutate, useMobileOnly, usePageType, usePluginEnable, useStoreFront, useSwatches } from './hooks/shop.js';
|
|
61
62
|
export { useCollectionQuery } from './hooks/shop/use-collection-query.js';
|
|
62
63
|
export { useProductQuery } from './hooks/shop/use-product-query.js';
|
|
63
64
|
export { useProductsQuery } from './hooks/shop/use-products-query.js';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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>>;
|
|
@@ -7324,6 +7332,10 @@ declare const useCurrency: () => {
|
|
|
7324
7332
|
currency: string | undefined;
|
|
7325
7333
|
changeCurrency: (currency: string) => void;
|
|
7326
7334
|
};
|
|
7335
|
+
declare const useSwatches: () => {
|
|
7336
|
+
swatches: GlobalSwatchesData[] | undefined;
|
|
7337
|
+
changeSwatches: (swatches: GlobalSwatchesData[]) => void;
|
|
7338
|
+
};
|
|
7327
7339
|
declare const usePageType: () => PublishedThemePageType;
|
|
7328
7340
|
declare const useStoreFront: () => {
|
|
7329
7341
|
provider: "SHOPIFY" | "BIGCOMMERCE" | undefined;
|
|
@@ -7336,6 +7348,7 @@ declare const useMobileOnly: () => boolean | undefined;
|
|
|
7336
7348
|
declare const useMatchMutate: () => (matcher: RegExp, ...args: any[]) => Promise<any[][]>;
|
|
7337
7349
|
declare function useConnectedShopify(): boolean;
|
|
7338
7350
|
declare function useIsSampleProduct(): boolean;
|
|
7351
|
+
declare function useCheckoutUrl(url?: string): string | undefined;
|
|
7339
7352
|
|
|
7340
7353
|
type Args$1 = {
|
|
7341
7354
|
id?: string;
|
|
@@ -7343,11 +7356,17 @@ type Args$1 = {
|
|
|
7343
7356
|
orderBy?: 'TITLE_ASC' | 'TITLE_DESC' | 'CREATED_AT_ASC' | undefined | 'none' | 'CREATED_AT_DESC';
|
|
7344
7357
|
isSample?: boolean;
|
|
7345
7358
|
};
|
|
7346
|
-
declare const useCollectionQuery: (args: Args$1, options?: SWRConfiguration<CollectionDetailFilterQueryResponse>) => swr__internal.SWRResponse<CollectionDetailFilterQueryResponse, any>;
|
|
7359
|
+
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
7360
|
|
|
7348
|
-
declare const useProductQuery: (productId?: string, options?: SWRConfiguration<ProductSelectFragment>) => swr__internal.SWRResponse<ProductSelectFragment, any
|
|
7361
|
+
declare const useProductQuery: (productId?: string, options?: SWRConfiguration<ProductSelectFragment>) => swr__internal.SWRResponse<ProductSelectFragment, any, Partial<swr__internal.PublicConfiguration<ProductSelectFragment, any, (arg: ["query/product", {
|
|
7362
|
+
id?: string | undefined;
|
|
7363
|
+
isSample?: boolean | undefined;
|
|
7364
|
+
}]) => swr__internal.FetcherResponse<ProductSelectFragment>>> | undefined>;
|
|
7349
7365
|
|
|
7350
|
-
declare const useProductsQuery: (ids?: string[], options?: SWRConfiguration<ProductsQueryResponse>) => swr__internal.SWRResponse<ProductsQueryResponse, any
|
|
7366
|
+
declare const useProductsQuery: (ids?: string[], options?: SWRConfiguration<ProductsQueryResponse>) => swr__internal.SWRResponse<ProductsQueryResponse, any, Partial<swr__internal.PublicConfiguration<ProductsQueryResponse, any, (arg: ["query/products", {
|
|
7367
|
+
ids?: string[] | undefined;
|
|
7368
|
+
isSample?: boolean | undefined;
|
|
7369
|
+
}]) => swr__internal.FetcherResponse<ProductsQueryResponse>>> | undefined>;
|
|
7351
7370
|
|
|
7352
7371
|
declare const useCurrentDevice: () => NameDevices;
|
|
7353
7372
|
|
|
@@ -7492,4 +7511,4 @@ declare const fetchMedias: (fetcher: FetchFunc, { id, isSample }: FetchParams) =
|
|
|
7492
7511
|
|
|
7493
7512
|
declare const getProductBySlug: (fetcher: FetchFunc, slug?: string) => Promise<ProductSelectFragment>;
|
|
7494
7513
|
|
|
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 };
|
|
7514
|
+
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, useCheckoutUrl, 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, 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.5.
|
|
3
|
+
"version": "1.5.15-fix.1",
|
|
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.
|
|
32
|
+
"swr": "^2.0.3",
|
|
33
33
|
"vanilla-lazyload": "17.8.3",
|
|
34
|
-
"zustand": "^4.3.
|
|
34
|
+
"zustand": "^4.3.2"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"react": "^17 || ^18",
|
|
@@ -47,4 +47,4 @@
|
|
|
47
47
|
"types": "./dist/types/index.d.ts"
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
}
|
|
50
|
+
}
|