@gem-sdk/core 22.0.0-dev.63 → 22.0.0-dev.71
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/toolbar/ErrorBannerParts.js +2 -0
- package/dist/cjs/components/toolbar/PasteErrorBanner.js +2 -0
- package/dist/cjs/components/toolbar/PasteErrorPageBanner.js +2 -0
- package/dist/cjs/components/toolbar/SectionErrorBanner.js +1 -1
- package/dist/cjs/components/toolbar/pasteErrorBannerLayout.js +1 -0
- package/dist/cjs/components/upgrade-element/UpgradeButton.js +1 -1
- package/dist/cjs/components/upgrade-element/UpgradeElement.js +1 -1
- package/dist/cjs/contexts/BuilderPreviewContext.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/pasteError.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/toolbar/ErrorBannerParts.js +2 -0
- package/dist/esm/components/toolbar/PasteErrorBanner.js +2 -0
- package/dist/esm/components/toolbar/PasteErrorPageBanner.js +2 -0
- package/dist/esm/components/toolbar/SectionErrorBanner.js +1 -1
- package/dist/esm/components/toolbar/pasteErrorBannerLayout.js +1 -0
- package/dist/esm/components/upgrade-element/UpgradeButton.js +1 -1
- package/dist/esm/components/upgrade-element/UpgradeElement.js +1 -1
- package/dist/esm/contexts/BuilderPreviewContext.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/pasteError.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 +59610 -30794
- package/package.json +2 -2
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
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}}let 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
|
+
`);export{r as ShopifyCollectionsDocument,t as TypedDocumentString};
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
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}}let 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
|
+
`);export{i as ShopifyProductsDocument,t as TypedDocumentString};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createBuilderApiFetcher as e}from"./createBuilderApiFetcher.js";let r=e();export{r as fetchBuilderApi};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{RenderModeEnv as e}from"../../types/builder.js";import"../../types/custom.js";import"../../types/animations.js";let t=({mode:t,pageType:s})=>{let r=new Set(["GP_PRE_SALE_PAGE","GP_FUNNEL_PAGE","POST_PURCHASE","STATIC"]);return s&&!r.has(s)&&t===e.EDIT};export{t as shouldUseBridgeFetcher};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{useRef as e,useMemo as t,useCallback as r}from"react";import"react/jsx-runtime";import"zustand";import{usePageStore as i}from"../../contexts/PageContext.js";import"react-transition-group";import"../../components/constant.js";import"swr";import"@gem-sdk/core";import"../../graphql/queries/collection-detail-filter.generated.js";import"../../graphql/queries/collection.generated.js";import"../../graphql/queries/collections.generated.js";import"../../graphql/queries/published-theme-pages.generated.js";import"../../graphql/queries/store-property.generated.js";import"../../graphql/queries/preview-page.generated.js";import"../../graphql/queries/published-shop-metas.generated.js";import"../../graphql/queries/shop-shopify.generated.js";import"../../graphql/queries/articles.generated.js";import"../../graphql/queries/blogs.generated.js";import"../../graphql/queries/products-with-selling-plans.generated.js";import"../../graphql/queries/product-variant-with-selling-plans.generated.js";import"../../graphql/queries/product-variants.generated.js";import"../../graphql/queries/product-little-detail.generated.js";import"../../graphql/queries/product-medias.generated.js";import"../../graphql/queries/productsV2.generated.js";import"../../graphql-shopify/product-detail.generated.js";import"../../graphql-shopify/product-medias.generated.js";import"../../graphql-shopify/product-variants.generated.js";import"
|
|
2
|
+
import{useRef as e,useMemo as t,useCallback as r}from"react";import"react/jsx-runtime";import"zustand";import{usePageStore as i}from"../../contexts/PageContext.js";import"react-transition-group";import"../../components/constant.js";import"swr";import"@gem-sdk/core";import"../../graphql/queries/collection-detail-filter.generated.js";import"../../graphql/queries/collection.generated.js";import"../../graphql/queries/collections.generated.js";import"../../graphql/queries/published-theme-pages.generated.js";import"../../graphql/queries/store-property.generated.js";import"../../graphql/queries/preview-page.generated.js";import"../../graphql/queries/published-shop-metas.generated.js";import"../../graphql/queries/shop-shopify.generated.js";import"../../graphql/queries/articles.generated.js";import"../../graphql/queries/blogs.generated.js";import"../../graphql/queries/products-with-selling-plans.generated.js";import"../../graphql/queries/product-variant-with-selling-plans.generated.js";import"../../graphql/queries/product-variants.generated.js";import"../../graphql/queries/product-little-detail.generated.js";import"../../graphql/queries/product-medias.generated.js";import"../../graphql/queries/productsV2.generated.js";import"../../graphql-shopify/product-detail.generated.js";import"../../graphql-shopify/product-medias.generated.js";import"../../graphql-shopify/product-variants.generated.js";import"../../graphql-shopify/products.generated.js";import"../../graphql-shopify/collections.generated.js";import"../../graphql-shopify/articles.generated.js";import"../../graphql-shopify/blogs.generated.js";import"crc-32";import"../convert.js";import"../../types/builder.js";import"../../types/custom.js";import"../../types/animations.js";import"@gem-sdk/adapter-shopify";import"swr/mutation";import"vanilla-lazyload";import"../../hooks/useCartUI.js";import"../../graphql/queries/product-value-label.generated.js";import"../../hooks/useStickyStore.js";let a=()=>{let a=e(),o=i(e=>e.setInteractionIsSelectOnPage),s=i(e=>e.sidebarMode),n=i(e=>e.interactionData?.selectType),p=i(e=>e.interactionData);function l(e,t){return!(e instanceof Document)&&e?.matches(t)?e:e?.querySelector(t)}let d=(e,t,r)=>{let i=e=>{let t=e.detail;r&&r(t)};return e.addEventListener(t,i),()=>e.removeEventListener(t,i)},c=t(()=>"interaction"===s&&(!p?.isSelectOnPage||"PAGE"===n),[s,p?.isSelectOnPage,n]),g=t(()=>p?.isSelectOnPage,[p?.isSelectOnPage]),m=r(e=>{if(window.interactionLoaded){e();return}window.addEventListener("gp:flow-actions-loaded",()=>{e()})},[]);return{onListener:({event:e,selector:t,elementRef:r},i)=>{let o=l(r?.current||a.current||document,t);if(o)return d(o,e,i)},trigger:({event:e,data:t,selector:r,element:i})=>{let a=i||document.body?.querySelector(r);if(!a)return;let o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:{data:t}});a.dispatchEvent(o)},saveToElementInteractionData:(e,t,r)=>{if(!e)return;let i=e.getAttribute("gp-data-interaction"),a=JSON.parse(i||"{}");e.setAttribute("gp-data-interaction",JSON.stringify({...a,[t]:r}))},closeSelectOnPage:()=>{o(!1);let e=new CustomEvent("editor:interaction:change-select-on-page",{bubbles:!0,detail:!1});window.dispatchEvent(e)},ref:a,findElementIncludingSelf:l,getInteractionPreviousData:(e,t)=>{let r=e.getAttribute("gp-data-interaction"),i=JSON.parse(r||"{}");return{previousData:i[t],interactionDataJson:i}},changeSelectMode:e=>{let t=new CustomEvent("editor:interaction:change-select-mode",{bubbles:!0,detail:e});window.dispatchEvent(t)},selectInteractionElement:({componentUid:e,settingType:t,$target:r})=>{let i=new CustomEvent("editor:interaction:select-element",{bubbles:!0,detail:{componentUid:e,settingType:t,$target:r}});window.dispatchEvent(i)},isInteractionMode:c,isSelectOnPage:g,interactionListenerLoaded:m}};export{a as useInteraction};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{joinShopifyQueryTerms as e,buildArticleIdListQuery as r,buildTitleSearchQuery as t,toArticleGid as o}from"./shopify-query-terms.js";let i={ID:"PLATFORM_CREATED_AT",PUBLISHED_AT:"PUBLISHED_AT",TITLE:"TITLE",UPDATED_AT:"PLATFORM_UPDATED_AT"},s=e=>(e?i[e]:void 0)??"PLATFORM_CREATED_AT",l=e=>e.map(e=>o(e)).filter(e=>!!e),n=e=>{let r=e.titleContains?.trim(),t={...e.baseIDIn?.length?{baseIDIn:l(e.baseIDIn)}:{},...r?{titleContainsFold:r}:{}};return Object.keys(t).length?t:void 0},a=({query:o})=>({first:o.first,last:o.last,after:o.after,before:o.before,...o.orderBy?{sortKey:o.orderBy.field,reverse:"DESC"===o.orderBy.direction}:{},query:e([o.baseIDIn?.length?r(o.baseIDIn):void 0,t(o.titleContains)])}),f=({query:e})=>({first:e.first,last:e.last,after:e.after,before:e.before,...e.orderBy?{orderBy:{field:s(e.orderBy.field),direction:e.orderBy.direction}}:{},where:n(e)});export{a as normalizeToShopifyArticlesQuery,f as normalizeToStorefrontArticlesQuery,s as toLegacyArticleSortField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{toLegacyArticleSortField as e}from"./normalize-articles-query.js";import{joinShopifyQueryTerms as r,buildBlogIdQuery as t,buildTitleSearchQuery as i,toBlogGid as o}from"./shopify-query-terms.js";let s=e=>"TITLE"===e?"TITLE":"PLATFORM_UPDATED_AT",l=e=>{let r=e.titleContains?.trim(),t={...e.baseID?{baseID:o(e.baseID)}:{},...r?{titleContainsFold:r}:{}};return Object.keys(t).length?t:void 0},d=({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([t(e.baseID),i(e.titleContains)]),...e.articlesOrderBy?{reverseArticle:"DESC"===e.articlesOrderBy.direction}:{}}),a=({query:r})=>({first:r.first,last:r.last,after:r.after,before:r.before,...r.orderBy?{orderBy:{field:s(r.orderBy.field),direction:r.orderBy.direction}}:{},where:l(r),...r.articlesOrderBy?{articlesOrderBy:{field:e(r.articlesOrderBy.field),direction:r.articlesOrderBy.direction}}:{}});export{d as normalizeToShopifyBlogsQuery,a as normalizeToStorefrontBlogsQuery};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{joinShopifyQueryTerms as e,buildIdListQuery as t,buildIdExclusionQuery as r,buildCollectionKeywordSearchQuery as o,buildTitleSearchQuery as i,buildFieldSearchQuery as s,buildTemplateSuffixQuery as a,toCollectionGid as d}from"./shopify-query-terms.js";let n=({query:e})=>({id:e.baseID,numberOfProducts:e.firstProduct,orderBy:e.productOrderBy,isSample:e.isSample,isStorefront:e.isStorefront}),l={UPDATED_AT:"PLATFORM_UPDATED_AT",TITLE:"TITLE"},f=e=>e.map(e=>d(e)).filter(e=>!!e),u=e=>{let t=e.keywords?.trim(),r=e.titleContains?.trim(),o=e.handleContains?.trim(),i={...e.baseID?{baseID:d(e.baseID)}:{},...e.baseIDIn?.length?{baseIDIn:f(e.baseIDIn)}:{},...e.baseIDNotIn?.length?{baseIDNotIn:f(e.baseIDNotIn)}:{},...t?{or:[{titleContainsFold:t},{handleContainsFold:t}]}:{},...r?{titleContainsFold:r}:{},...o?{handleContainsFold:o}:{},...e.publishedStatus&&"any"!==e.publishedStatus?{isStorefront:"published"===e.publishedStatus}:{},...void 0!==e.templateSuffix?{templateSuffix:e.templateSuffix}:{},...void 0!==e.isSample?{isSample:e.isSample}:{}};return Object.keys(i).length?i:void 0},I=({query:e})=>({first:e.first,last:e.last,after:e.after,before:e.before,...e.orderBy?{orderBy:{field:l[e.orderBy.field]??"PLATFORM_UPDATED_AT",direction:e.orderBy.direction}}:{},where:u(e)}),b=({query:d})=>({first:d.first,last:d.last,after:d.after,before:d.before,...d.orderBy?{sortKey:d.orderBy.field,reverse:"DESC"===d.orderBy.direction}:{},...void 0!==d.firstProduct?{firstProduct:d.firstProduct}:{},...d.productOrderBy&&"none"!==d.productOrderBy?{sortKeyProduct:d.productOrderBy.startsWith("CREATED_AT")?"CREATED":"TITLE",reverseProduct:d.productOrderBy.endsWith("_DESC")}:{},query:e([d.baseID?t([d.baseID]):void 0,d.baseIDIn?.length?t(d.baseIDIn):void 0,d.baseIDNotIn?.length?r(d.baseIDNotIn):void 0,o(d.keywords),i(d.titleContains),s({field:"handle",value:d.handleContains}),a(d.templateSuffix)])});export{b as normalizeToShopifyCollectionsQuery,n as normalizeToStorefrontCollectionQuery,I as normalizeToStorefrontCollectionsQuery};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{joinShopifyQueryTerms as t,buildProductIdListQuery as e,buildProductIdExclusionQuery as n,buildKeywordSearchQuery as o,buildTitleSearchQuery as i,buildFieldSearchQuery as s,buildTemplateSuffixQuery as l,buildExactFieldQuery as a,buildExactFieldListQuery as r,buildExactFieldExclusionQuery as I,buildCollectionIdListQuery as d,toProductGid as u}from"./shopify-query-terms.js";let f=t=>t.map(t=>u(t)).filter(t=>!!t),h=t=>{if(!t.tagsIn?.length)return;let e=[{nameIn:t.tagsIn}];return t.tagsNotIn?.length&&e.push({nameNotIn:t.tagsNotIn}),[{hasTagsWith:e}]},g=t=>{if(!t.collectionIDIn?.length)return;let e=[{idIn:t.collectionIDIn}];return t.collectionTitleNotIn?.length&&e.push({titleNotIn:t.collectionTitleNotIn}),[{hasCollectionWith:e}]},c=t=>{let e=t.keywords?.trim();if(e)return[{titleContainsFold:e},{skuContainsFold:e}]},m=({query:t})=>{let e=t.titleContains?.trim(),n=t.handleContains?.trim(),o=c(t),i=h(t),s=g(t);return{first:t.first,...t.baseIDIn?.length?{baseIDIn:f(t.baseIDIn)}:{},...t.baseIDNotIn?.length?{baseIDNotIn:f(t.baseIDNotIn)}:{},...o?{or:o}:{},...e?{titleContainsFold:e}:{},...n?{handleContainsFold:n}:{},...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}:{},...i?{hasProductTagsWith:i}:{},...s?{hasCollectionProductsWith:s}:{}}},v=({query:u})=>({first:u.first,query:t([`status:${(u.status??"ACTIVE").toLowerCase()}`,u.baseIDIn?.length?e(u.baseIDIn):void 0,u.baseIDNotIn?.length?n(u.baseIDNotIn):void 0,o(u.keywords),i(u.titleContains),s({field:"handle",value:u.handleContains}),l(u.templateSuffix),a({field:"vendor",value:u.vendor}),r({field:"tag",values:u.tagsIn}),I({field:"tag",values:u.tagsNotIn}),u.collectionIDIn?.length?d(u.collectionIDIn):void 0])});export{v as normalizeToShopifyProductsQuery,m as normalizeToStorefrontProductsQuery};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e={SECTION_SIZE_EXCEED_256KB:1,LIQUID_SYNTAX_ERROR:2,MISSING_SECTION_IN_THEME:3},i=e=>{if("undefined"==typeof document)return!1;let i=document.querySelectorAll(`[data-uid="${e}"]`);return Array.from(i).some(e=>e.getClientRects().length>0)},t=({entity:e,isRendered:i})=>"ROOT"!==e.uid&&"section"!==e.type&&i(e.uid),r=({entity:e,isRendered:i})=>!("section"!==e.type&&e.editorConfigs?.toolbar?.hide)&&t({entity:e,isRendered:i}),d=({detail:e,target:i,parents:d,isRendered:n})=>{let o=i?[i,...d]:d;return{uid:e.uid,message:e.message,anchorUid:o.find(e=>r({entity:e,isRendered:n}))?.uid,positionUid:o.find(e=>t({entity:e,isRendered:n}))?.uid,sectionUid:o.find(e=>"Section"===e.tag)?.uid}},n=({list:i,uid:t})=>{if(i)return i.filter(e=>e.uid===t&&!e.isDismissed).sort((i,t)=>e[t.type]-e[i.type])[0]};export{n as getVisiblePublishError,i as isRenderedOnPage,d as resolvePasteErrorInfo};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CollectionDetailFilterDocument as e}from"../../graphql/queries/collection-detail-filter.generated.js";import"../../graphql/queries/collection.generated.js";import"../../graphql/queries/collections.generated.js";import"../../graphql/queries/published-theme-pages.generated.js";import"../../graphql/queries/store-property.generated.js";import"../../graphql/queries/preview-page.generated.js";import"../../graphql/queries/published-shop-metas.generated.js";import"../../graphql/queries/shop-shopify.generated.js";import"../../graphql/queries/articles.generated.js";import"../../graphql/queries/blogs.generated.js";import"../../graphql/queries/products-with-selling-plans.generated.js";import"../../graphql/queries/product-variant-with-selling-plans.generated.js";import{ProductVariantsDocument as r}from"../../graphql/queries/product-variants.generated.js";import{isDefined as t}from"../is-defined.js";let
|
|
1
|
+
import{CollectionDetailFilterDocument as e}from"../../graphql/queries/collection-detail-filter.generated.js";import"../../graphql/queries/collection.generated.js";import"../../graphql/queries/collections.generated.js";import"../../graphql/queries/published-theme-pages.generated.js";import"../../graphql/queries/store-property.generated.js";import"../../graphql/queries/preview-page.generated.js";import"../../graphql/queries/published-shop-metas.generated.js";import"../../graphql/queries/shop-shopify.generated.js";import"../../graphql/queries/articles.generated.js";import"../../graphql/queries/blogs.generated.js";import"../../graphql/queries/products-with-selling-plans.generated.js";import"../../graphql/queries/product-variant-with-selling-plans.generated.js";import{ProductVariantsDocument as r}from"../../graphql/queries/product-variants.generated.js";import{isDefined as t}from"../is-defined.js";function o(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"}}}let s=async(e,r)=>{let t=await a(e,r);if(!t)throw Error("collections not found");let o=await l(e,t,r.isSample);return o},i=async(r,t)=>r([e.toString(),t]),d=(e,r,t)=>{let o=e-t*r;return e<t?e:o>0?t:t+o},n=(e,r)=>{let t=[],o=0;for(;o<e.length;)t.push(e.slice(o,r+o)),o+=r;return t},a=async(e,r)=>{let t,s,n,a,l;let c=1;if(r.numberOfProducts){let p=Math.ceil(r.numberOfProducts/8);for(;c<=p&&!1!==a;){t={firstVariant:1,firstMedia:30,orderBy:{field:"PLATFORM_CREATED_AT",direction:"DESC"},orderByMedia:{field:"POSITION",direction:"ASC"},firstProduct:d(r.numberOfProducts,c,8),...r.id&&"latest"!==r.id.toLowerCase()?{where:{baseID:r.id}}:{where:{hasCollectionProducts:!0,isSample:r.isSample}},orderByProduct:o(r.orderBy),whereProduct:{status:"ACTIVE",...r.isStorefront&&{isStorefront:r.isStorefront},isSample:r.isSample},...s?{productsAfter:s}:void 0};let p=await i(e,t);if(s=p?.collections?.edges?.[0]?.node?.products?.pageInfo?.endCursor,1===c?(n=p,l=n?.collections?.edges?.[0]):l?.node?.products&&p?.collections?.edges?.[0]?.node?.products?.edges&&(l.node.products={pageInfo:p?.collections?.edges?.[0]?.node?.products?.pageInfo,edges:l.node?.products?.edges.concat(p?.collections?.edges?.[0]?.node?.products?.edges)}),c++,!l?.node?.products?.pageInfo?.hasNextPage){a=!1;break}}return n}},l=async(e,r,o)=>{let s=r?.collections?.edges?.[0]?.node;if(!s)return r;let i=s?.products?.edges,d=i?.map(e=>e?.node?.baseID).filter(t),n=await c(e,{ids:d,isSample:o}),a=i?.map(e=>{let r=n?.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:{...s,products:{edges:a}},cursor:void 0}]}};return l},c=async(e,{ids:t,isSample:o,isStorefront:s})=>{let i=n(t??[],8),d=async t=>{try{return await e([r.toString(),{...t,orderByVariant:{field:"POSITION",direction:"ASC"}}])}catch{return{}}},a=i.map(e=>{let r={firstVariant:100,first:e.length,orderBy:{field:"TITLE",direction:"ASC"},where:{status:"ACTIVE",isSample:o,...s&&{isStorefront:s},...e.length&&{baseIDIn:e.sort()}}};return d(r)}),l=await Promise.all(a),c=l?.reduce((e,r)=>e.concat(r?.variants?.edges??[]),[]);return{variants:{edges:c}}};export{d as calculateFirstProduct,s as getCollection,o as productSortedByOrder};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ShopifyArticlesDocument as e}from"../../graphql-shopify/articles.generated.js";import{ShopifyBlogsDocument as t}from"../../graphql-shopify/blogs.generated.js";let 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.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.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}}};export{d as getShopifyArticles,l as getShopifyBlogs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ShopifyCollectionsDocument as e}from"../../graphql-shopify/collections.generated.js";import{ShopifyProductVariantsDocument as t}from"../../graphql-shopify/product-variants.generated.js";import{buildIdListQuery as i,toNumericId as r}from"../shopify-query-terms.js";import{productSortedByOrder as o}from"./get-collection.js";export{calculateFirstProduct}from"./get-collection.js";import{normalizeShopifyProduct as s}from"./get-shopify-product.js";let a=()=>({collections:{edges:[]}}),d=(t,i)=>t([e.toString(),i]),l=async(e,{id:t,numberOfProducts:i,orderBy:r})=>{if(!i||!Number.isFinite(i)||i<0)throw Error("collections not found");let{collection:o,products:s}=await n(e,{collectionId:t,limit:i,orderBy:r});if(!o)return a();let d=await Promise.all(s.map(t=>p(e,t)));return{collections:{edges:[f({collection:o,edges:d})]}}},n=async(e,{collectionId:t,limit:s,orderBy:a})=>{let l,n;let c=!t||"latest"===t.toLowerCase(),p=o(a),f=p?.field==="TITLE"?"TITLE":"CREATED",m=p?.direction==="DESC",u=c?"":t,g=new Set,y=[];for(;y.length<s;){let t={first:1,firstProduct:Math.min(8,s-y.length),sortKeyProduct:f,reverseProduct:m,firstMedia:30,sortKeyMedia:"POSITION",reverseMedia:!1,firstVariant:1,sortKeyVariant:"POSITION",reverseVariant:!1,sortKey:"UPDATED_AT",reverse:!0};u&&(t.query=i([u])),n&&(t.afterProduct=n);let o=await d(e,t),a=o?.collections?.edges?.[0]?.node;if(!a)break;u||(u=r(a.id)??""),l??(l=a),y.push(...a.products.edges.filter(({node:e})=>"ACTIVE"===e.status));let{hasNextPage:c,endCursor:p}=a.products.pageInfo;if(!c||!p||g.has(p))break;g.add(p),n=p}return{collection:l,products:y.slice(0,s)}},c=async(e,i)=>{try{let o=await e([t.toString(),{first:100,query:`product_id:${r(i)}`,sortKey:"POSITION",reverse:!1}]);return o?.variants?.edges??[]}catch{return[]}},p=async(e,{cursor:t,node:i})=>{let r=await c(e,i.id),o=s({product:i,variants:r,medias:i.media.edges});return{cursor:t,node:{...o,variants:{...i.variants,edges:o.variants?.edges??[]},medias:{...i.media,edges:o.medias?.edges??[]}}}},f=({collection:e,edges:t})=>({cursor:void 0,node:{id:r(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}}});export{l as getShopifyCollection};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ShopifyCollectionsDocument as e}from"../../graphql-shopify/collections.generated.js";let t=e=>e.slice(e.lastIndexOf("/")+1),i=async(i,o={})=>{let d=await i([e.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}};export{i as getShopifyCollections};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ShopifyProductDetailDocument as e}from"../../graphql-shopify/product-detail.generated.js";import{ShopifyProductMediasDocument as t}from"../../graphql-shopify/product-medias.generated.js";import{ShopifyProductVariantsDocument as i}from"../../graphql-shopify/product-variants.generated.js";let r=e=>e.slice(e.lastIndexOf("/")+1),
|
|
1
|
+
import{ShopifyProductDetailDocument as e}from"../../graphql-shopify/product-detail.generated.js";import{ShopifyProductMediasDocument as t}from"../../graphql-shopify/product-medias.generated.js";import{ShopifyProductVariantsDocument as i}from"../../graphql-shopify/product-variants.generated.js";let 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.toString(),o]),s=n.product?.edges?.[0]?.node;if(!s)throw Error("Product not found");let{variants:l,medias:p}=await d(t,s);return c({product:s,variants:l,medias:p})},d=async(e,a,d)=>{let[n,s]=await Promise.all([o(async t=>{let d=await e([i.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.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}},c=({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}}))}});export{d as fetchShopifyProductConnections,a as getShopifyProduct,c as normalizeShopifyProduct};
|