@gem-sdk/core 22.0.0-dev.63 → 22.0.0-dev.64
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/ComponentToolbarPreview.js +1 -1
- package/dist/cjs/components/ComponentWrapperPreview.js +1 -1
- package/dist/cjs/components/InteractionSuffix.js +1 -1
- package/dist/cjs/components/Render.liquid.js +8 -8
- package/dist/cjs/components/RenderCustomCode.js +3 -3
- package/dist/cjs/components/resize/Spacing.js +1 -1
- package/dist/cjs/components/theme-section/CreateThemeSection.js +1 -1
- package/dist/cjs/components/theme-section/ThemeSectionTooltip.js +1 -1
- package/dist/cjs/components/upgrade-element/UpgradeButton.js +1 -1
- package/dist/cjs/components/upgrade-element/UpgradeElement.js +1 -1
- package/dist/cjs/contexts/ProductContext.js +1 -1
- package/dist/cjs/graphql-shopify/articles.generated.js +51 -0
- package/dist/cjs/graphql-shopify/blogs.generated.js +62 -0
- package/dist/cjs/graphql-shopify/collections.generated.js +269 -0
- package/dist/cjs/graphql-shopify/products.generated.js +280 -0
- package/dist/cjs/helpers/builder-api-bridge/fetchBuilderApi.js +1 -0
- package/dist/cjs/helpers/builder-api-bridge/shouldUseBridgeFetcher.js +1 -0
- package/dist/cjs/helpers/interaction/index.js +1 -1
- package/dist/cjs/helpers/normalize-articles-query.js +1 -0
- package/dist/cjs/helpers/normalize-blogs-query.js +1 -0
- package/dist/cjs/helpers/normalize-collections-query.js +1 -0
- package/dist/cjs/helpers/normalize-products-query.js +1 -0
- package/dist/cjs/helpers/queries/get-collection.js +1 -1
- package/dist/cjs/helpers/queries/get-shopify-articles.js +1 -0
- package/dist/cjs/helpers/queries/get-shopify-collection.js +1 -0
- package/dist/cjs/helpers/queries/get-shopify-collections.js +1 -0
- package/dist/cjs/helpers/queries/get-shopify-product.js +1 -1
- package/dist/cjs/helpers/queries/get-shopify-products.js +1 -0
- package/dist/cjs/helpers/shopify-query-terms.js +1 -0
- package/dist/cjs/hooks/articles/useArticlesQuery.js +1 -1
- package/dist/cjs/hooks/shop/use-collection-query.js +1 -1
- package/dist/cjs/hooks/shop/use-collections-query.js +1 -1
- package/dist/cjs/hooks/shop/use-product-query.js +1 -1
- package/dist/cjs/hooks/shop/use-products-query.js +1 -1
- package/dist/cjs/hooks/useAnimations.js +1 -1
- package/dist/cjs/hooks/useInitialSwatchesOptions.js +1 -1
- package/dist/cjs/hooks/useProduct.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/ComponentToolbarPreview.js +1 -1
- package/dist/esm/components/ComponentWrapperPreview.js +1 -1
- package/dist/esm/components/InteractionSuffix.js +1 -1
- package/dist/esm/components/Render.liquid.js +4 -4
- package/dist/esm/components/RenderCustomCode.js +3 -3
- package/dist/esm/components/resize/Spacing.js +1 -1
- package/dist/esm/components/theme-section/CreateThemeSection.js +1 -1
- package/dist/esm/components/theme-section/ThemeSectionTooltip.js +1 -1
- package/dist/esm/components/upgrade-element/UpgradeButton.js +1 -1
- package/dist/esm/components/upgrade-element/UpgradeElement.js +1 -1
- package/dist/esm/contexts/ProductContext.js +1 -1
- package/dist/esm/graphql-shopify/articles.generated.js +51 -0
- package/dist/esm/graphql-shopify/blogs.generated.js +62 -0
- package/dist/esm/graphql-shopify/collections.generated.js +269 -0
- package/dist/esm/graphql-shopify/products.generated.js +280 -0
- package/dist/esm/helpers/builder-api-bridge/fetchBuilderApi.js +1 -0
- package/dist/esm/helpers/builder-api-bridge/shouldUseBridgeFetcher.js +1 -0
- package/dist/esm/helpers/interaction/index.js +1 -1
- package/dist/esm/helpers/normalize-articles-query.js +1 -0
- package/dist/esm/helpers/normalize-blogs-query.js +1 -0
- package/dist/esm/helpers/normalize-collections-query.js +1 -0
- package/dist/esm/helpers/normalize-products-query.js +1 -0
- package/dist/esm/helpers/queries/get-collection.js +1 -1
- package/dist/esm/helpers/queries/get-shopify-articles.js +1 -0
- package/dist/esm/helpers/queries/get-shopify-collection.js +1 -0
- package/dist/esm/helpers/queries/get-shopify-collections.js +1 -0
- package/dist/esm/helpers/queries/get-shopify-product.js +1 -1
- package/dist/esm/helpers/queries/get-shopify-products.js +1 -0
- package/dist/esm/helpers/shopify-query-terms.js +1 -0
- package/dist/esm/hooks/articles/useArticlesQuery.js +1 -1
- package/dist/esm/hooks/shop/use-collection-query.js +1 -1
- package/dist/esm/hooks/shop/use-collections-query.js +1 -1
- package/dist/esm/hooks/shop/use-product-query.js +1 -1
- package/dist/esm/hooks/shop/use-products-query.js +1 -1
- package/dist/esm/hooks/useAnimations.js +1 -1
- package/dist/esm/hooks/useInitialSwatchesOptions.js +1 -1
- package/dist/esm/hooks/useProduct.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/types/index.d.ts +59590 -30793
- package/package.json +1 -1
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
"use strict";function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class t extends String{toString(){return this.value}constructor(t,r){super(t),e(this,"__apiType",void 0),e(this,"value",void 0),e(this,"__meta__",void 0),this.value=t,this.__meta__=r}}const r=new t(`
|
|
2
|
+
query ShopifyCollections($first: Int = 10, $after: String, $last: Int, $before: String, $query: String, $sortKey: CollectionSortKeys = ID, $reverse: Boolean = false, $firstProduct: Int = 20, $afterProduct: String, $sortKeyProduct: ProductCollectionSortKeys = COLLECTION_DEFAULT, $reverseProduct: Boolean = false, $firstOption: Int = 3, $firstCollection: Int = 20, $firstMedia: Int = 20, $afterMedia: String, $sortKeyMedia: ProductMediaSortKeys = POSITION, $reverseMedia: Boolean = false, $firstVariant: Int = 20, $afterVariant: String, $sortKeyVariant: ProductVariantSortKeys = POSITION, $reverseVariant: Boolean = false) {
|
|
3
|
+
collections(
|
|
4
|
+
first: $first
|
|
5
|
+
after: $after
|
|
6
|
+
last: $last
|
|
7
|
+
before: $before
|
|
8
|
+
query: $query
|
|
9
|
+
sortKey: $sortKey
|
|
10
|
+
reverse: $reverse
|
|
11
|
+
) {
|
|
12
|
+
edges {
|
|
13
|
+
cursor
|
|
14
|
+
node {
|
|
15
|
+
id
|
|
16
|
+
handle
|
|
17
|
+
title
|
|
18
|
+
description
|
|
19
|
+
descriptionHtml
|
|
20
|
+
templateSuffix
|
|
21
|
+
sortOrder
|
|
22
|
+
updatedAt
|
|
23
|
+
seo {
|
|
24
|
+
title
|
|
25
|
+
description
|
|
26
|
+
}
|
|
27
|
+
image {
|
|
28
|
+
id
|
|
29
|
+
url
|
|
30
|
+
width
|
|
31
|
+
height
|
|
32
|
+
altText
|
|
33
|
+
}
|
|
34
|
+
productsCount {
|
|
35
|
+
count
|
|
36
|
+
precision
|
|
37
|
+
}
|
|
38
|
+
products(
|
|
39
|
+
first: $firstProduct
|
|
40
|
+
after: $afterProduct
|
|
41
|
+
sortKey: $sortKeyProduct
|
|
42
|
+
reverse: $reverseProduct
|
|
43
|
+
) {
|
|
44
|
+
edges {
|
|
45
|
+
cursor
|
|
46
|
+
node {
|
|
47
|
+
id
|
|
48
|
+
handle
|
|
49
|
+
title
|
|
50
|
+
description
|
|
51
|
+
descriptionHtml
|
|
52
|
+
vendor
|
|
53
|
+
tags
|
|
54
|
+
status
|
|
55
|
+
createdAt
|
|
56
|
+
featuredMedia {
|
|
57
|
+
id
|
|
58
|
+
alt
|
|
59
|
+
mediaContentType
|
|
60
|
+
status
|
|
61
|
+
preview {
|
|
62
|
+
image {
|
|
63
|
+
id
|
|
64
|
+
url
|
|
65
|
+
width
|
|
66
|
+
height
|
|
67
|
+
altText
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
... on MediaImage {
|
|
71
|
+
mimeType
|
|
72
|
+
image {
|
|
73
|
+
id
|
|
74
|
+
url
|
|
75
|
+
width
|
|
76
|
+
height
|
|
77
|
+
altText
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
... on Video {
|
|
81
|
+
duration
|
|
82
|
+
sources {
|
|
83
|
+
url
|
|
84
|
+
format
|
|
85
|
+
mimeType
|
|
86
|
+
width
|
|
87
|
+
height
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
... on ExternalVideo {
|
|
91
|
+
host
|
|
92
|
+
embedUrl
|
|
93
|
+
originUrl
|
|
94
|
+
}
|
|
95
|
+
... on Model3d {
|
|
96
|
+
sources {
|
|
97
|
+
url
|
|
98
|
+
format
|
|
99
|
+
mimeType
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
options(first: $firstOption) {
|
|
104
|
+
id
|
|
105
|
+
name
|
|
106
|
+
position
|
|
107
|
+
optionValues {
|
|
108
|
+
id
|
|
109
|
+
name
|
|
110
|
+
hasVariants
|
|
111
|
+
swatch {
|
|
112
|
+
color
|
|
113
|
+
image {
|
|
114
|
+
id
|
|
115
|
+
image {
|
|
116
|
+
url
|
|
117
|
+
width
|
|
118
|
+
height
|
|
119
|
+
altText
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
collections(first: $firstCollection) {
|
|
126
|
+
edges {
|
|
127
|
+
node {
|
|
128
|
+
id
|
|
129
|
+
handle
|
|
130
|
+
title
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
media(
|
|
135
|
+
first: $firstMedia
|
|
136
|
+
after: $afterMedia
|
|
137
|
+
sortKey: $sortKeyMedia
|
|
138
|
+
reverse: $reverseMedia
|
|
139
|
+
) {
|
|
140
|
+
edges {
|
|
141
|
+
cursor
|
|
142
|
+
node {
|
|
143
|
+
id
|
|
144
|
+
alt
|
|
145
|
+
mediaContentType
|
|
146
|
+
status
|
|
147
|
+
preview {
|
|
148
|
+
image {
|
|
149
|
+
id
|
|
150
|
+
url
|
|
151
|
+
width
|
|
152
|
+
height
|
|
153
|
+
altText
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
... on MediaImage {
|
|
157
|
+
mimeType
|
|
158
|
+
image {
|
|
159
|
+
id
|
|
160
|
+
url
|
|
161
|
+
width
|
|
162
|
+
height
|
|
163
|
+
altText
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
... on Video {
|
|
167
|
+
duration
|
|
168
|
+
sources {
|
|
169
|
+
url
|
|
170
|
+
format
|
|
171
|
+
mimeType
|
|
172
|
+
width
|
|
173
|
+
height
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
... on ExternalVideo {
|
|
177
|
+
host
|
|
178
|
+
embedUrl
|
|
179
|
+
originUrl
|
|
180
|
+
}
|
|
181
|
+
... on Model3d {
|
|
182
|
+
sources {
|
|
183
|
+
url
|
|
184
|
+
format
|
|
185
|
+
mimeType
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
pageInfo {
|
|
191
|
+
hasNextPage
|
|
192
|
+
endCursor
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
variants(
|
|
196
|
+
first: $firstVariant
|
|
197
|
+
after: $afterVariant
|
|
198
|
+
sortKey: $sortKeyVariant
|
|
199
|
+
reverse: $reverseVariant
|
|
200
|
+
) {
|
|
201
|
+
edges {
|
|
202
|
+
cursor
|
|
203
|
+
node {
|
|
204
|
+
id
|
|
205
|
+
title
|
|
206
|
+
sku
|
|
207
|
+
barcode
|
|
208
|
+
position
|
|
209
|
+
price
|
|
210
|
+
compareAtPrice
|
|
211
|
+
availableForSale
|
|
212
|
+
inventoryPolicy
|
|
213
|
+
inventoryQuantity
|
|
214
|
+
selectedOptions {
|
|
215
|
+
name
|
|
216
|
+
value
|
|
217
|
+
}
|
|
218
|
+
inventoryItem {
|
|
219
|
+
id
|
|
220
|
+
sku
|
|
221
|
+
tracked
|
|
222
|
+
requiresShipping
|
|
223
|
+
unitCost {
|
|
224
|
+
amount
|
|
225
|
+
currencyCode
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
image {
|
|
229
|
+
id
|
|
230
|
+
url
|
|
231
|
+
width
|
|
232
|
+
height
|
|
233
|
+
altText
|
|
234
|
+
}
|
|
235
|
+
media(first: 1) {
|
|
236
|
+
nodes {
|
|
237
|
+
id
|
|
238
|
+
alt
|
|
239
|
+
mediaContentType
|
|
240
|
+
status
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
pageInfo {
|
|
246
|
+
hasNextPage
|
|
247
|
+
endCursor
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
pageInfo {
|
|
253
|
+
hasNextPage
|
|
254
|
+
hasPreviousPage
|
|
255
|
+
startCursor
|
|
256
|
+
endCursor
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
pageInfo {
|
|
262
|
+
hasNextPage
|
|
263
|
+
hasPreviousPage
|
|
264
|
+
startCursor
|
|
265
|
+
endCursor
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
`);exports.ShopifyCollectionsDocument=r,exports.TypedDocumentString=t;
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
"use strict";function e(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}class t extends String{toString(){return this.value}constructor(t,i){super(t),e(this,"__apiType",void 0),e(this,"value",void 0),e(this,"__meta__",void 0),this.value=t,this.__meta__=i}}const i=new t(`
|
|
2
|
+
query ShopifyProducts($first: Int = 10, $after: String, $query: String, $sortKey: ProductSortKeys = ID, $reverse: Boolean = false, $firstOption: Int = 3, $firstCollection: Int = 20, $afterCollection: String, $firstMedia: Int = 20, $afterMedia: String, $sortKeyMedia: ProductMediaSortKeys = POSITION, $reverseMedia: Boolean = false, $firstVariant: Int = 50, $afterVariant: String, $sortKeyVariant: ProductVariantSortKeys = POSITION, $reverseVariant: Boolean = false) {
|
|
3
|
+
products(
|
|
4
|
+
first: $first
|
|
5
|
+
after: $after
|
|
6
|
+
query: $query
|
|
7
|
+
sortKey: $sortKey
|
|
8
|
+
reverse: $reverse
|
|
9
|
+
) {
|
|
10
|
+
edges {
|
|
11
|
+
cursor
|
|
12
|
+
node {
|
|
13
|
+
id
|
|
14
|
+
handle
|
|
15
|
+
title
|
|
16
|
+
description
|
|
17
|
+
descriptionHtml
|
|
18
|
+
vendor
|
|
19
|
+
tags
|
|
20
|
+
createdAt
|
|
21
|
+
featuredMedia {
|
|
22
|
+
id
|
|
23
|
+
alt
|
|
24
|
+
mediaContentType
|
|
25
|
+
status
|
|
26
|
+
preview {
|
|
27
|
+
image {
|
|
28
|
+
id
|
|
29
|
+
url
|
|
30
|
+
width
|
|
31
|
+
height
|
|
32
|
+
altText
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
... on MediaImage {
|
|
36
|
+
mimeType
|
|
37
|
+
image {
|
|
38
|
+
id
|
|
39
|
+
url
|
|
40
|
+
width
|
|
41
|
+
height
|
|
42
|
+
altText
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
... on Video {
|
|
46
|
+
duration
|
|
47
|
+
filename
|
|
48
|
+
sources {
|
|
49
|
+
url
|
|
50
|
+
format
|
|
51
|
+
mimeType
|
|
52
|
+
width
|
|
53
|
+
height
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
... on ExternalVideo {
|
|
57
|
+
host
|
|
58
|
+
embedUrl
|
|
59
|
+
originUrl
|
|
60
|
+
}
|
|
61
|
+
... on Model3d {
|
|
62
|
+
filename
|
|
63
|
+
sources {
|
|
64
|
+
url
|
|
65
|
+
format
|
|
66
|
+
mimeType
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
options(first: $firstOption) {
|
|
71
|
+
id
|
|
72
|
+
name
|
|
73
|
+
position
|
|
74
|
+
optionValues {
|
|
75
|
+
id
|
|
76
|
+
name
|
|
77
|
+
hasVariants
|
|
78
|
+
swatch {
|
|
79
|
+
color
|
|
80
|
+
image {
|
|
81
|
+
id
|
|
82
|
+
image {
|
|
83
|
+
url
|
|
84
|
+
width
|
|
85
|
+
height
|
|
86
|
+
altText
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
collections(first: $firstCollection, after: $afterCollection) {
|
|
93
|
+
edges {
|
|
94
|
+
cursor
|
|
95
|
+
node {
|
|
96
|
+
id
|
|
97
|
+
handle
|
|
98
|
+
title
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
pageInfo {
|
|
102
|
+
hasNextPage
|
|
103
|
+
endCursor
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
media(
|
|
107
|
+
first: $firstMedia
|
|
108
|
+
after: $afterMedia
|
|
109
|
+
sortKey: $sortKeyMedia
|
|
110
|
+
reverse: $reverseMedia
|
|
111
|
+
) {
|
|
112
|
+
edges {
|
|
113
|
+
cursor
|
|
114
|
+
node {
|
|
115
|
+
id
|
|
116
|
+
alt
|
|
117
|
+
mediaContentType
|
|
118
|
+
status
|
|
119
|
+
preview {
|
|
120
|
+
image {
|
|
121
|
+
id
|
|
122
|
+
url
|
|
123
|
+
width
|
|
124
|
+
height
|
|
125
|
+
altText
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
... on MediaImage {
|
|
129
|
+
mimeType
|
|
130
|
+
image {
|
|
131
|
+
id
|
|
132
|
+
url
|
|
133
|
+
width
|
|
134
|
+
height
|
|
135
|
+
altText
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
... on Video {
|
|
139
|
+
duration
|
|
140
|
+
filename
|
|
141
|
+
sources {
|
|
142
|
+
url
|
|
143
|
+
format
|
|
144
|
+
mimeType
|
|
145
|
+
width
|
|
146
|
+
height
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
... on ExternalVideo {
|
|
150
|
+
host
|
|
151
|
+
embedUrl
|
|
152
|
+
originUrl
|
|
153
|
+
}
|
|
154
|
+
... on Model3d {
|
|
155
|
+
filename
|
|
156
|
+
sources {
|
|
157
|
+
url
|
|
158
|
+
format
|
|
159
|
+
mimeType
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
pageInfo {
|
|
165
|
+
hasNextPage
|
|
166
|
+
endCursor
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
variants(
|
|
170
|
+
first: $firstVariant
|
|
171
|
+
after: $afterVariant
|
|
172
|
+
sortKey: $sortKeyVariant
|
|
173
|
+
reverse: $reverseVariant
|
|
174
|
+
) {
|
|
175
|
+
edges {
|
|
176
|
+
cursor
|
|
177
|
+
node {
|
|
178
|
+
id
|
|
179
|
+
title
|
|
180
|
+
sku
|
|
181
|
+
barcode
|
|
182
|
+
position
|
|
183
|
+
price
|
|
184
|
+
compareAtPrice
|
|
185
|
+
availableForSale
|
|
186
|
+
inventoryPolicy
|
|
187
|
+
inventoryQuantity
|
|
188
|
+
selectedOptions {
|
|
189
|
+
name
|
|
190
|
+
value
|
|
191
|
+
}
|
|
192
|
+
inventoryItem {
|
|
193
|
+
id
|
|
194
|
+
sku
|
|
195
|
+
tracked
|
|
196
|
+
requiresShipping
|
|
197
|
+
unitCost {
|
|
198
|
+
amount
|
|
199
|
+
currencyCode
|
|
200
|
+
}
|
|
201
|
+
measurement {
|
|
202
|
+
id
|
|
203
|
+
weight {
|
|
204
|
+
unit
|
|
205
|
+
value
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
image {
|
|
210
|
+
id
|
|
211
|
+
url
|
|
212
|
+
width
|
|
213
|
+
height
|
|
214
|
+
altText
|
|
215
|
+
}
|
|
216
|
+
media(first: 1) {
|
|
217
|
+
nodes {
|
|
218
|
+
id
|
|
219
|
+
alt
|
|
220
|
+
mediaContentType
|
|
221
|
+
status
|
|
222
|
+
preview {
|
|
223
|
+
image {
|
|
224
|
+
id
|
|
225
|
+
url
|
|
226
|
+
width
|
|
227
|
+
height
|
|
228
|
+
altText
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
... on MediaImage {
|
|
232
|
+
mimeType
|
|
233
|
+
image {
|
|
234
|
+
id
|
|
235
|
+
url
|
|
236
|
+
width
|
|
237
|
+
height
|
|
238
|
+
altText
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
... on Video {
|
|
242
|
+
duration
|
|
243
|
+
sources {
|
|
244
|
+
url
|
|
245
|
+
format
|
|
246
|
+
mimeType
|
|
247
|
+
width
|
|
248
|
+
height
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
... on ExternalVideo {
|
|
252
|
+
host
|
|
253
|
+
embedUrl
|
|
254
|
+
originUrl
|
|
255
|
+
}
|
|
256
|
+
... on Model3d {
|
|
257
|
+
sources {
|
|
258
|
+
url
|
|
259
|
+
format
|
|
260
|
+
mimeType
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
pageInfo {
|
|
268
|
+
hasNextPage
|
|
269
|
+
endCursor
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
pageInfo {
|
|
275
|
+
hasNextPage
|
|
276
|
+
endCursor
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
`);exports.ShopifyProductsDocument=i,exports.TypedDocumentString=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./createBuilderApiFetcher.js");const r=e.createBuilderApiFetcher();exports.fetchBuilderApi=r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("../../types/builder.js");require("../../types/custom.js"),require("../../types/animations.js"),exports.shouldUseBridgeFetcher=({mode:r,pageType:s})=>{let t=new Set(["GP_PRE_SALE_PAGE","GP_FUNNEL_PAGE","POST_PURCHASE","STATIC"]);return s&&!t.has(s)&&r===e.RenderModeEnv.EDIT};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";var e=require("react");require("react/jsx-runtime"),require("zustand");var r=require("../../contexts/PageContext.js");require("react-transition-group"),require("../../components/constant.js"),require("swr"),require("@gem-sdk/core"),require("../../graphql/queries/collection-detail-filter.generated.js"),require("../../graphql/queries/collection.generated.js"),require("../../graphql/queries/collections.generated.js"),require("../../graphql/queries/published-theme-pages.generated.js"),require("../../graphql/queries/store-property.generated.js"),require("../../graphql/queries/preview-page.generated.js"),require("../../graphql/queries/published-shop-metas.generated.js"),require("../../graphql/queries/shop-shopify.generated.js"),require("../../graphql/queries/articles.generated.js"),require("../../graphql/queries/blogs.generated.js"),require("../../graphql/queries/products-with-selling-plans.generated.js"),require("../../graphql/queries/product-variant-with-selling-plans.generated.js"),require("../../graphql/queries/product-variants.generated.js"),require("../../graphql/queries/product-little-detail.generated.js"),require("../../graphql/queries/product-medias.generated.js"),require("../../graphql/queries/productsV2.generated.js"),require("../../graphql-shopify/product-detail.generated.js"),require("../../graphql-shopify/product-medias.generated.js"),require("../../graphql-shopify/product-variants.generated.js"),require("
|
|
2
|
+
"use strict";var e=require("react");require("react/jsx-runtime"),require("zustand");var r=require("../../contexts/PageContext.js");require("react-transition-group"),require("../../components/constant.js"),require("swr"),require("@gem-sdk/core"),require("../../graphql/queries/collection-detail-filter.generated.js"),require("../../graphql/queries/collection.generated.js"),require("../../graphql/queries/collections.generated.js"),require("../../graphql/queries/published-theme-pages.generated.js"),require("../../graphql/queries/store-property.generated.js"),require("../../graphql/queries/preview-page.generated.js"),require("../../graphql/queries/published-shop-metas.generated.js"),require("../../graphql/queries/shop-shopify.generated.js"),require("../../graphql/queries/articles.generated.js"),require("../../graphql/queries/blogs.generated.js"),require("../../graphql/queries/products-with-selling-plans.generated.js"),require("../../graphql/queries/product-variant-with-selling-plans.generated.js"),require("../../graphql/queries/product-variants.generated.js"),require("../../graphql/queries/product-little-detail.generated.js"),require("../../graphql/queries/product-medias.generated.js"),require("../../graphql/queries/productsV2.generated.js"),require("../../graphql-shopify/product-detail.generated.js"),require("../../graphql-shopify/product-medias.generated.js"),require("../../graphql-shopify/product-variants.generated.js"),require("../../graphql-shopify/products.generated.js"),require("../../graphql-shopify/collections.generated.js"),require("../../graphql-shopify/articles.generated.js"),require("../../graphql-shopify/blogs.generated.js"),require("crc-32"),require("../convert.js"),require("../../types/builder.js"),require("../../types/custom.js"),require("../../types/animations.js"),require("@gem-sdk/adapter-shopify"),require("swr/mutation"),require("vanilla-lazyload"),require("../../hooks/useCartUI.js"),require("../../graphql/queries/product-value-label.generated.js"),require("../../hooks/useStickyStore.js"),exports.useInteraction=()=>{let t=e.useRef(),i=r.usePageStore(e=>e.setInteractionIsSelectOnPage),a=r.usePageStore(e=>e.sidebarMode),s=r.usePageStore(e=>e.interactionData?.selectType),n=r.usePageStore(e=>e.interactionData);function u(e,r){return!(e instanceof Document)&&e?.matches(r)?e:e?.querySelector(r)}let o=(e,r,t)=>{let i=e=>{let r=e.detail;t&&t(r)};return e.addEventListener(r,i),()=>e.removeEventListener(r,i)},l=e.useMemo(()=>"interaction"===a&&(!n?.isSelectOnPage||"PAGE"===s),[a,n?.isSelectOnPage,s]),q=e.useMemo(()=>n?.isSelectOnPage,[n?.isSelectOnPage]),c=e.useCallback(e=>{if(window.interactionLoaded){e();return}window.addEventListener("gp:flow-actions-loaded",()=>{e()})},[]);return{onListener:({event:e,selector:r,elementRef:i},a)=>{let s=u(i?.current||t.current||document,r);if(s)return o(s,e,a)},trigger:({event:e,data:r,selector:t,element:i})=>{let a=i||document.body?.querySelector(t);if(!a)return;let s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:{data:r}});a.dispatchEvent(s)},saveToElementInteractionData:(e,r,t)=>{if(!e)return;let i=e.getAttribute("gp-data-interaction"),a=JSON.parse(i||"{}");e.setAttribute("gp-data-interaction",JSON.stringify({...a,[r]:t}))},closeSelectOnPage:()=>{i(!1);let e=new CustomEvent("editor:interaction:change-select-on-page",{bubbles:!0,detail:!1});window.dispatchEvent(e)},ref:t,findElementIncludingSelf:u,getInteractionPreviousData:(e,r)=>{let t=e.getAttribute("gp-data-interaction"),i=JSON.parse(t||"{}");return{previousData:i[r],interactionDataJson:i}},changeSelectMode:e=>{let r=new CustomEvent("editor:interaction:change-select-mode",{bubbles:!0,detail:e});window.dispatchEvent(r)},selectInteractionElement:({componentUid:e,settingType:r,$target:t})=>{let i=new CustomEvent("editor:interaction:select-element",{bubbles:!0,detail:{componentUid:e,settingType:r,$target:t}});window.dispatchEvent(i)},isInteractionMode:l,isSelectOnPage:q,interactionListenerLoaded:c}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./shopify-query-terms.js");const r={ID:"PLATFORM_CREATED_AT",PUBLISHED_AT:"PUBLISHED_AT",TITLE:"TITLE",UPDATED_AT:"PLATFORM_UPDATED_AT"},t=e=>(e?r[e]:void 0)??"PLATFORM_CREATED_AT",i=r=>r.map(r=>e.toArticleGid(r)).filter(e=>!!e),o=e=>{let r=e.titleContains?.trim(),t={...e.baseIDIn?.length?{baseIDIn:i(e.baseIDIn)}:{},...r?{titleContainsFold:r}:{}};return Object.keys(t).length?t:void 0};exports.normalizeToShopifyArticlesQuery=({query:r})=>({first:r.first,last:r.last,after:r.after,before:r.before,...r.orderBy?{sortKey:r.orderBy.field,reverse:"DESC"===r.orderBy.direction}:{},query:e.joinShopifyQueryTerms([r.baseIDIn?.length?e.buildArticleIdListQuery(r.baseIDIn):void 0,e.buildTitleSearchQuery(r.titleContains)])}),exports.normalizeToStorefrontArticlesQuery=({query:e})=>({first:e.first,last:e.last,after:e.after,before:e.before,...e.orderBy?{orderBy:{field:t(e.orderBy.field),direction:e.orderBy.direction}}:{},where:o(e)}),exports.toLegacyArticleSortField=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./normalize-articles-query.js"),r=require("./shopify-query-terms.js");const t=e=>"TITLE"===e?"TITLE":"PLATFORM_UPDATED_AT",i=e=>{let t=e.titleContains?.trim(),i={...e.baseID?{baseID:r.toBlogGid(e.baseID)}:{},...t?{titleContainsFold:t}:{}};return Object.keys(i).length?i:void 0};exports.normalizeToShopifyBlogsQuery=({query:e})=>({first:e.first,last:e.last,after:e.after,before:e.before,...e.orderBy?{sortKey:e.orderBy.field,reverse:"DESC"===e.orderBy.direction}:{},query:r.joinShopifyQueryTerms([r.buildBlogIdQuery(e.baseID),r.buildTitleSearchQuery(e.titleContains)]),...e.articlesOrderBy?{reverseArticle:"DESC"===e.articlesOrderBy.direction}:{}}),exports.normalizeToStorefrontBlogsQuery=({query:r})=>({first:r.first,last:r.last,after:r.after,before:r.before,...r.orderBy?{orderBy:{field:t(r.orderBy.field),direction:r.orderBy.direction}}:{},where:i(r),...r.articlesOrderBy?{articlesOrderBy:{field:e.toLegacyArticleSortField(r.articlesOrderBy.field),direction:r.articlesOrderBy.direction}}:{}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./shopify-query-terms.js");const r={UPDATED_AT:"PLATFORM_UPDATED_AT",TITLE:"TITLE"},t=r=>r.map(r=>e.toCollectionGid(r)).filter(e=>!!e),o=r=>{let o=r.keywords?.trim(),i=r.titleContains?.trim(),s=r.handleContains?.trim(),d={...r.baseID?{baseID:e.toCollectionGid(r.baseID)}:{},...r.baseIDIn?.length?{baseIDIn:t(r.baseIDIn)}:{},...r.baseIDNotIn?.length?{baseIDNotIn:t(r.baseIDNotIn)}:{},...o?{or:[{titleContainsFold:o},{handleContainsFold:o}]}:{},...i?{titleContainsFold:i}:{},...s?{handleContainsFold:s}:{},...r.publishedStatus&&"any"!==r.publishedStatus?{isStorefront:"published"===r.publishedStatus}:{},...void 0!==r.templateSuffix?{templateSuffix:r.templateSuffix}:{},...void 0!==r.isSample?{isSample:r.isSample}:{}};return Object.keys(d).length?d:void 0};exports.normalizeToShopifyCollectionsQuery=({query:r})=>({first:r.first,last:r.last,after:r.after,before:r.before,...r.orderBy?{sortKey:r.orderBy.field,reverse:"DESC"===r.orderBy.direction}:{},...void 0!==r.firstProduct?{firstProduct:r.firstProduct}:{},...r.productOrderBy&&"none"!==r.productOrderBy?{sortKeyProduct:r.productOrderBy.startsWith("CREATED_AT")?"CREATED":"TITLE",reverseProduct:r.productOrderBy.endsWith("_DESC")}:{},query:e.joinShopifyQueryTerms([r.baseID?e.buildIdListQuery([r.baseID]):void 0,r.baseIDIn?.length?e.buildIdListQuery(r.baseIDIn):void 0,r.baseIDNotIn?.length?e.buildIdExclusionQuery(r.baseIDNotIn):void 0,e.buildCollectionKeywordSearchQuery(r.keywords),e.buildTitleSearchQuery(r.titleContains),e.buildFieldSearchQuery({field:"handle",value:r.handleContains}),e.buildTemplateSuffixQuery(r.templateSuffix)])}),exports.normalizeToStorefrontCollectionQuery=({query:e})=>({id:e.baseID,numberOfProducts:e.firstProduct,orderBy:e.productOrderBy,isSample:e.isSample,isStorefront:e.isStorefront}),exports.normalizeToStorefrontCollectionsQuery=({query:e})=>({first:e.first,last:e.last,after:e.after,before:e.before,...e.orderBy?{orderBy:{field:r[e.orderBy.field]??"PLATFORM_UPDATED_AT",direction:e.orderBy.direction}}:{},where:o(e)});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var t=require("./shopify-query-terms.js");const e=e=>e.map(e=>t.toProductGid(e)).filter(t=>!!t),i=t=>{if(!t.tagsIn?.length)return;let e=[{nameIn:t.tagsIn}];return t.tagsNotIn?.length&&e.push({nameNotIn:t.tagsNotIn}),[{hasTagsWith:e}]},o=t=>{if(!t.collectionIDIn?.length)return;let e=[{idIn:t.collectionIDIn}];return t.collectionTitleNotIn?.length&&e.push({titleNotIn:t.collectionTitleNotIn}),[{hasCollectionWith:e}]},n=t=>{let e=t.keywords?.trim();if(e)return[{titleContainsFold:e},{skuContainsFold:e}]};exports.normalizeToShopifyProductsQuery=({query:e})=>({first:e.first,query:t.joinShopifyQueryTerms([`status:${(e.status??"ACTIVE").toLowerCase()}`,e.baseIDIn?.length?t.buildProductIdListQuery(e.baseIDIn):void 0,e.baseIDNotIn?.length?t.buildProductIdExclusionQuery(e.baseIDNotIn):void 0,t.buildKeywordSearchQuery(e.keywords),t.buildTitleSearchQuery(e.titleContains),t.buildFieldSearchQuery({field:"handle",value:e.handleContains}),t.buildTemplateSuffixQuery(e.templateSuffix),t.buildExactFieldQuery({field:"vendor",value:e.vendor}),t.buildExactFieldListQuery({field:"tag",values:e.tagsIn}),t.buildExactFieldExclusionQuery({field:"tag",values:e.tagsNotIn}),e.collectionIDIn?.length?t.buildCollectionIdListQuery(e.collectionIDIn):void 0])}),exports.normalizeToStorefrontProductsQuery=({query:t})=>{let l=t.titleContains?.trim(),s=t.handleContains?.trim(),r=n(t),a=i(t),u=o(t);return{first:t.first,...t.baseIDIn?.length?{baseIDIn:e(t.baseIDIn)}:{},...t.baseIDNotIn?.length?{baseIDNotIn:e(t.baseIDNotIn)}:{},...r?{or:r}:{},...l?{titleContainsFold:l}:{},...s?{handleContainsFold:s}:{},...t.status?{status:t.status}:{},...void 0!==t.templateSuffix?{templateSuffix:t.templateSuffix}:{},...void 0!==t.isSample?{isSample:t.isSample}:{},...void 0!==t.isStorefront?{isStorefront:t.isStorefront}:{},...t.vendor?{vendor:t.vendor}:{},...a?{hasProductTagsWith:a}:{},...u?{hasCollectionProductsWith:u}:{}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../graphql/queries/collection-detail-filter.generated.js");require("../../graphql/queries/collection.generated.js"),require("../../graphql/queries/collections.generated.js"),require("../../graphql/queries/published-theme-pages.generated.js"),require("../../graphql/queries/store-property.generated.js"),require("../../graphql/queries/preview-page.generated.js"),require("../../graphql/queries/published-shop-metas.generated.js"),require("../../graphql/queries/shop-shopify.generated.js"),require("../../graphql/queries/articles.generated.js"),require("../../graphql/queries/blogs.generated.js"),require("../../graphql/queries/products-with-selling-plans.generated.js"),require("../../graphql/queries/product-variant-with-selling-plans.generated.js");var r=require("../../graphql/queries/product-variants.generated.js"),t=require("../is-defined.js");const
|
|
1
|
+
"use strict";var e=require("../../graphql/queries/collection-detail-filter.generated.js");require("../../graphql/queries/collection.generated.js"),require("../../graphql/queries/collections.generated.js"),require("../../graphql/queries/published-theme-pages.generated.js"),require("../../graphql/queries/store-property.generated.js"),require("../../graphql/queries/preview-page.generated.js"),require("../../graphql/queries/published-shop-metas.generated.js"),require("../../graphql/queries/shop-shopify.generated.js"),require("../../graphql/queries/articles.generated.js"),require("../../graphql/queries/blogs.generated.js"),require("../../graphql/queries/products-with-selling-plans.generated.js"),require("../../graphql/queries/product-variant-with-selling-plans.generated.js");var r=require("../../graphql/queries/product-variants.generated.js"),t=require("../is-defined.js");function s(e){switch(e){case"TITLE_ASC":case"none":default:return{direction:"ASC",field:"TITLE"};case"TITLE_DESC":return{direction:"DESC",field:"TITLE"};case"CREATED_AT_ASC":return{direction:"ASC",field:"CREATED_AT"};case"CREATED_AT_DESC":return{direction:"DESC",field:"CREATED_AT"}}}const i=async(e,r)=>{let t=await a(e,r);if(!t)throw Error("collections not found");let s=await l(e,t,r.isSample);return s},o=async(r,t)=>r([e.CollectionDetailFilterDocument.toString(),t]),n=(e,r,t)=>{let s=e-t*r;return e<t?e:s>0?t:t+s},d=(e,r)=>{let t=[],s=0;for(;s<e.length;)t.push(e.slice(s,r+s)),s+=r;return t},a=async(e,r)=>{let t,i,d,a,l;let c=1;if(r.numberOfProducts){let u=Math.ceil(r.numberOfProducts/8);for(;c<=u&&!1!==a;){t={firstVariant:1,firstMedia:30,orderBy:{field:"PLATFORM_CREATED_AT",direction:"DESC"},orderByMedia:{field:"POSITION",direction:"ASC"},firstProduct:n(r.numberOfProducts,c,8),...r.id&&"latest"!==r.id.toLowerCase()?{where:{baseID:r.id}}:{where:{hasCollectionProducts:!0,isSample:r.isSample}},orderByProduct:s(r.orderBy),whereProduct:{status:"ACTIVE",...r.isStorefront&&{isStorefront:r.isStorefront},isSample:r.isSample},...i?{productsAfter:i}:void 0};let u=await o(e,t);if(i=u?.collections?.edges?.[0]?.node?.products?.pageInfo?.endCursor,1===c?(d=u,l=d?.collections?.edges?.[0]):l?.node?.products&&u?.collections?.edges?.[0]?.node?.products?.edges&&(l.node.products={pageInfo:u?.collections?.edges?.[0]?.node?.products?.pageInfo,edges:l.node?.products?.edges.concat(u?.collections?.edges?.[0]?.node?.products?.edges)}),c++,!l?.node?.products?.pageInfo?.hasNextPage){a=!1;break}}return d}},l=async(e,r,s)=>{let i=r?.collections?.edges?.[0]?.node;if(!i)return r;let o=i?.products?.edges,n=o?.map(e=>e?.node?.baseID).filter(t.isDefined),d=await c(e,{ids:n,isSample:s}),a=o?.map(e=>{let r=d?.variants?.edges?.filter(r=>r?.node?.id===e?.node?.id);return{...e,node:e.node?{...e.node,variants:e.node?.variants?{...e.node?.variants,edges:r?.[0]?.node?.variants?.edges??e.node?.variants.edges??[]}:void 0}:void 0}})??[],l={...r,collections:{edges:[{node:{...i,products:{edges:a}},cursor:void 0}]}};return l},c=async(e,{ids:t,isSample:s,isStorefront:i})=>{let o=d(t??[],8),n=async t=>{try{return await e([r.ProductVariantsDocument.toString(),{...t,orderByVariant:{field:"POSITION",direction:"ASC"}}])}catch{return{}}},a=o.map(e=>{let r={firstVariant:100,first:e.length,orderBy:{field:"TITLE",direction:"ASC"},where:{status:"ACTIVE",isSample:s,...i&&{isStorefront:i},...e.length&&{baseIDIn:e.sort()}}};return n(r)}),l=await Promise.all(a),c=l?.reduce((e,r)=>e.concat(r?.variants?.edges??[]),[]);return{variants:{edges:c}}};exports.calculateFirstProduct=n,exports.getCollection=i,exports.productSortedByOrder=s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("../../graphql-shopify/articles.generated.js"),t=require("../../graphql-shopify/blogs.generated.js");const i=e=>e.slice(e.lastIndexOf("/")+1),o=e=>({...e,...null!=e.last&&void 0===e.first?{first:null}:{}}),a=e=>({id:i(e.id),baseID:e.id,title:e.title,handle:e.handle,description:e.summary??void 0,templateSuffix:e.templateSuffix??void 0,titleMeta:void 0,descriptionMeta:void 0,platform:"SHOPIFY",isSample:!1,platformCreatedAt:e.createdAt,platformUpdatedAt:e.updatedAt,publishedAt:e.publishedAt??void 0,author:e.author?.name??void 0,tags:e.tags.map(e=>({name:e})),content:{excerptHtml:e.summary??void 0,html:e.body??void 0},media:e.image?{src:e.image.url,alt:e.image.altText??void 0,width:e.image.width??void 0,height:e.image.height??void 0}:void 0,blogs:e.blog?{edges:[{node:{title:e.blog.title,handle:e.blog.handle}}]}:void 0}),d=async(t,i={})=>{let d=await t([e.ShopifyArticlesDocument.toString(),o(i)]);if(!d?.articles)throw Error("Article not found");return{articles:{edges:d.articles.edges.map(({cursor:e,node:t})=>({cursor:e,node:a(t)})),pageInfo:d.articles.pageInfo}}},l=async(e,d={})=>{let l=await e([t.ShopifyBlogsDocument.toString(),o(d)]);if(!l?.blogs)throw Error("Blog not found");return{blogs:{edges:l.blogs.edges.map(({cursor:e,node:t})=>({cursor:e,node:{id:i(t.id),baseID:t.id,title:t.title,handle:t.handle,description:void 0,descriptionMeta:void 0,titleMeta:void 0,templateSuffix:t.templateSuffix??void 0,platform:"SHOPIFY",tags:t.tags,articles:{edges:t.articles.edges.map(({cursor:e,node:t})=>({cursor:e,node:a(t)}))}}})),pageInfo:l.blogs.pageInfo}}};exports.getShopifyArticles=d,exports.getShopifyBlogs=l;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("../../graphql-shopify/collections.generated.js"),t=require("../../graphql-shopify/product-variants.generated.js"),i=require("../shopify-query-terms.js"),r=require("./get-collection.js"),o=require("./get-shopify-product.js");const s=()=>({collections:{edges:[]}}),a=(t,i)=>t([e.ShopifyCollectionsDocument.toString(),i]),d=async(e,{id:t,numberOfProducts:i,orderBy:r})=>{if(!i||!Number.isFinite(i)||i<0)throw Error("collections not found");let{collection:o,products:a}=await c(e,{collectionId:t,limit:i,orderBy:r});if(!o)return s();let d=await Promise.all(a.map(t=>n(e,t)));return{collections:{edges:[u({collection:o,edges:d})]}}},c=async(e,{collectionId:t,limit:o,orderBy:s})=>{let d,c;let l=!t||"latest"===t.toLowerCase(),n=r.productSortedByOrder(s),u=n?.field==="TITLE"?"TITLE":"CREATED",p=n?.direction==="DESC",f=l?"":t,g=new Set,m=[];for(;m.length<o;){let t={first:1,firstProduct:Math.min(8,o-m.length),sortKeyProduct:u,reverseProduct:p,firstMedia:30,sortKeyMedia:"POSITION",reverseMedia:!1,firstVariant:1,sortKeyVariant:"POSITION",reverseVariant:!1,sortKey:"UPDATED_AT",reverse:!0};f&&(t.query=i.buildIdListQuery([f])),c&&(t.afterProduct=c);let r=await a(e,t),s=r?.collections?.edges?.[0]?.node;if(!s)break;f||(f=i.toNumericId(s.id)??""),d??(d=s),m.push(...s.products.edges.filter(({node:e})=>"ACTIVE"===e.status));let{hasNextPage:l,endCursor:n}=s.products.pageInfo;if(!l||!n||g.has(n))break;g.add(n),c=n}return{collection:d,products:m.slice(0,o)}},l=async(e,r)=>{try{let o=await e([t.ShopifyProductVariantsDocument.toString(),{first:100,query:`product_id:${i.toNumericId(r)}`,sortKey:"POSITION",reverse:!1}]);return o?.variants?.edges??[]}catch{return[]}},n=async(e,{cursor:t,node:i})=>{let r=await l(e,i.id),s=o.normalizeShopifyProduct({product:i,variants:r,medias:i.media.edges});return{cursor:t,node:{...s,variants:{...i.variants,edges:s.variants?.edges??[]},medias:{...i.media,edges:s.medias?.edges??[]}}}},u=({collection:e,edges:t})=>({cursor:void 0,node:{id:i.toNumericId(e.id)??e.id,baseID:e.id,title:e.title,handle:e.handle,description:e.description,descriptionHtml:e.descriptionHtml,templateSuffix:e.templateSuffix??void 0,updatedAt:e.updatedAt,titleMeta:e.seo.title??void 0,descriptionMeta:e.seo.description??void 0,collectionMedia:e.image?{src:e.image.url}:void 0,platform:"SHOPIFY",tags:[],isSample:!1,products:{edges:t}}});exports.calculateFirstProduct=r.calculateFirstProduct,exports.getShopifyCollection=d;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("../../graphql-shopify/collections.generated.js");const t=e=>e.slice(e.lastIndexOf("/")+1),i=async(i,o={})=>{let d=await i([e.ShopifyCollectionsDocument.toString(),{...o,...null!=o.last&&void 0===o.first?{first:null}:{}}]);if(!d)throw Error("Collection not found");return{collections:d.collections?{edges:d.collections.edges.map(({node:e})=>({node:{id:t(e.id),baseID:e.id,title:e.title,handle:e.handle,description:e.description,descriptionHtml:e.descriptionHtml,templateSuffix:e.templateSuffix??void 0,updatedAt:e.updatedAt,titleMeta:e.seo.title??void 0,descriptionMeta:e.seo.description??void 0,collectionMedia:e.image?{src:e.image.url}:void 0,platform:"SHOPIFY",tags:[],isSample:!1,products:{totalCount:e.productsCount?.count,edges:e.products.edges.map(({node:e})=>({node:{id:t(e.id),title:e.title,handle:e.handle,description:e.description,status:e.status,featuredImage:e.featuredMedia?.preview?.image?{src:e.featuredMedia.preview.image.url}:void 0}}))}}}))}:void 0}};exports.getShopifyCollections=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../graphql-shopify/product-detail.generated.js"),t=require("../../graphql-shopify/product-medias.generated.js"),i=require("../../graphql-shopify/product-variants.generated.js");const r=e=>e.slice(e.lastIndexOf("/")+1),
|
|
1
|
+
"use strict";var e=require("../../graphql-shopify/product-detail.generated.js"),t=require("../../graphql-shopify/product-medias.generated.js"),i=require("../../graphql-shopify/product-variants.generated.js");const r=e=>e.slice(e.lastIndexOf("/")+1),a=async(t,{id:i}={})=>{let a=!i||"latest"===i.toLowerCase();if(!a&&!/^(?:gid:\/\/shopify\/Product\/)?\d+$/.test(i))throw Error("Invalid Shopify product ID");let o={first:1,query:a?"status:active":`id:${r(i)}`,sortKey:"CREATED_AT",reverse:!0},n=await t([e.ShopifyProductDetailDocument.toString(),o]),s=n.product?.edges?.[0]?.node;if(!s)throw Error("Product not found");let{variants:l,medias:c}=await d(t,s);return u({product:s,variants:l,medias:c})},d=async(e,a,d)=>{let[n,s]=await Promise.all([o(async t=>{let d=await e([i.ShopifyProductVariantsDocument.toString(),{first:50,query:`product_id:${r(a.id)}`,after:t,sortKey:"POSITION",reverse:!1}]);return d.variants},d?.variants),o(async i=>{let d=await e([t.ShopifyProductMediasDocument.toString(),{first:1,query:`id:${r(a.id)}`,afterMedia:i,sortKeyMedia:"POSITION",reverseMedia:!1}]);return d.medias?.edges?.[0]?.node?.media},d?.media)]);return{variants:n,medias:s}},o=async(e,t)=>{let i=[],r=new Set,a=async t=>{if(!t)return i;i.push(...t.edges);let{hasNextPage:d,endCursor:o}=t.pageInfo;return!d||!o||r.has(o)?i:(r.add(o),a(await e(o)))};try{return await a(t??await e())}catch(e){if(0===i.length)throw e;return i}},n=(e,t)=>({id:r(e.id??t),baseID:e.id??t,contentType:"IMAGE",src:e.url,previewImage:e.url,width:e.width??void 0,height:e.height??void 0,alt:e.altText??void 0}),s=e=>{let t=e.preview?.image,i="image"in e?e.image:void 0,a="sources"in e?e.sources.find(e=>"mp4"===e.format.toLowerCase())??e.sources[0]:void 0;return{id:r(e.id),baseID:e.id,contentType:e.mediaContentType,src:i?.url??("embedUrl"in e?e.embedUrl:a?.url),previewImage:t?.url??i?.url,width:i?.width??(a&&"width"in a&&"number"==typeof a.width?a.width:t?.width)??void 0,height:i?.height??(a&&"height"in a&&"number"==typeof a.height?a.height:t?.height)??void 0,alt:e.alt??i?.altText??t?.altText??void 0}},l=e=>{let t=e.media.nodes[0],i=t?s(t):e.image?n(e.image,e.id):void 0;return{id:r(e.id),baseID:e.id,title:e.title,barcode:e.barcode??void 0,sku:e.sku??void 0,price:String(e.price),salePrice:null==e.compareAtPrice?void 0:String(e.compareAtPrice),costPrice:e.inventoryItem.unitCost?.amount,inventoryPolicy:e.inventoryPolicy,inventoryQuantity:e.inventoryQuantity??void 0,manageInventory:e.inventoryItem.tracked,isDigital:!e.inventoryItem.requiresShipping,weight:e.inventoryItem.measurement.weight?.value,platform:"SHOPIFY",selectedOptions:e.selectedOptions.map(({name:e,value:t})=>({name:e,value:t})),mediaId:i?.id??"",media:i}},u=({product:e,variants:t,medias:i})=>({id:r(e.id),baseID:e.id,title:e.title,handle:e.handle,description:e.description,descriptionHtml:e.descriptionHtml,createdAt:e.createdAt,vendor:e.vendor,tags:e.tags,isSample:!1,sku:t[0]?.node.sku??void 0,featuredImage:e.featuredMedia?s(e.featuredMedia):void 0,options:e.options.map(e=>({id:e.id,name:e.name,values:e.optionValues.map(e=>({id:r(e.id),baseID:e.id,label:e.name}))})),variants:{edges:t.map(({cursor:e,node:t})=>({cursor:e,node:l(t)}))},medias:{edges:i.map(({cursor:e,node:t})=>({cursor:e,node:s(t)}))},collections:{edges:e.collections.edges.map(({node:e})=>({node:{id:e.id,handle:e.handle,title:e.title}}))}});exports.fetchShopifyProductConnections=d,exports.getShopifyProduct=a,exports.normalizeShopifyProduct=u;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("../../graphql-shopify/products.generated.js"),t=require("./get-shopify-product.js");const r=async(e,{ids:r,defaultSelectedProductCount:a,allStatus:s,selectedStatus:i})=>{let n=[];if(!s){let e=i?.length?i:["ACTIVE"];n.push(`(status:${e.map(e=>e.toLowerCase()).join(",")})`)}if(r?.length){let e=r.map(e=>{if(!/^(?:gid:\/\/shopify\/Product\/)?\d+$/.test(e))throw Error("Invalid Shopify product ID");return`id:${e.slice(e.lastIndexOf("/")+1)}`});n.push(`(${e.join(" OR ")})`)}let d=await o(e,{first:r?.length||a||4,query:n.join(" AND ")}),u=await Promise.all(d.products.edges.map(async({cursor:r,node:a})=>{let{variants:s,medias:o}=await t.fetchShopifyProductConnections(e,a,a);return{cursor:r,node:t.normalizeShopifyProduct({product:a,variants:s,medias:o})}}));return{products:{edges:u,pageInfo:d.products.pageInfo}}},a=async(e,t)=>{let r=await o(e,{first:t.first||4,query:t.query??"status:active"});return i(r)},s=async(e,t)=>{let r=await o(e,{first:t.first||8,query:t.query??"status:active",after:t.after});return i(r)},o=async(t,r)=>{let a=await t([e.ShopifyProductsDocument.toString(),{firstMedia:1,firstVariant:1,sortKey:"CREATED_AT",reverse:!0,sortKeyMedia:"POSITION",reverseMedia:!1,sortKeyVariant:"POSITION",reverseVariant:!1,...r}]);if(!a?.products)throw Error("Product not found");return a},i=e=>({products:{edges:e.products.edges.map(({cursor:e,node:r})=>{let a=t.normalizeShopifyProduct({product:r,variants:r.variants.edges,medias:r.media.edges});return{cursor:e,node:{...a,variants:{...a.variants,edges:a.variants?.edges??[],pageInfo:r.variants.pageInfo},medias:{...a.medias,edges:a.medias?.edges??[],pageInfo:r.media.pageInfo}}}}),pageInfo:e.products.pageInfo}});exports.getListShopifyProductByVariables=s,exports.getShopifyProductQueryAll=a,exports.getShopifyProducts=r;
|