sanity-plugin-shopify-assets 1.2.0 → 1.2.2
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/README.md +0 -2
- package/dist/index.esm.js +150 -81
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +149 -80
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/ShopifyAssetPicker.tsx +6 -3
- package/src/datastores/shopify.ts +24 -7
package/dist/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
4
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
5
3
|
Object.defineProperty(exports, '__esModule', {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
@@ -31,29 +29,81 @@ var videojs__default = /*#__PURE__*/_interopDefaultCompat(videojs);
|
|
|
31
29
|
var PhotoAlbum__default = /*#__PURE__*/_interopDefaultCompat(PhotoAlbum);
|
|
32
30
|
var InfiniteScroll__default = /*#__PURE__*/_interopDefaultCompat(InfiniteScroll);
|
|
33
31
|
var axios__default = /*#__PURE__*/_interopDefaultCompat(axios);
|
|
34
|
-
const Root = styledComponents.styled.div
|
|
32
|
+
const Root = styledComponents.styled.div`
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
background-origin: content-box;
|
|
35
|
+
background-repeat: no-repeat;
|
|
36
|
+
background-clip: border-box;
|
|
37
|
+
background-size: cover;
|
|
38
|
+
background-color: ${_ref => {
|
|
35
39
|
let {
|
|
36
40
|
theme
|
|
37
41
|
} = _ref;
|
|
38
42
|
return theme.sanity.color.card.enabled.bg2;
|
|
39
|
-
}
|
|
43
|
+
}};
|
|
44
|
+
position: relative;
|
|
45
|
+
outline: none !important;
|
|
46
|
+
border: ${_ref2 => {
|
|
40
47
|
let {
|
|
41
48
|
theme
|
|
42
49
|
} = _ref2;
|
|
43
|
-
return
|
|
44
|
-
}
|
|
45
|
-
|
|
50
|
+
return `1px solid ${theme.sanity.color.card.enabled.border}`;
|
|
51
|
+
}};
|
|
52
|
+
box-sizing: content-box;
|
|
53
|
+
user-drag: none;
|
|
54
|
+
|
|
55
|
+
&:hover {
|
|
56
|
+
opacity: 0.85;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&:focus,
|
|
60
|
+
&:active {
|
|
61
|
+
border: 1px solid var(--input-border-color-focus);
|
|
62
|
+
box-shadow: inset 0 0 0 3px var(--input-border-color-focus);
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
65
|
+
const InfoLine = styledComponents.styled(ui.Card)`
|
|
66
|
+
${_ref3 => {
|
|
46
67
|
let {
|
|
47
68
|
theme
|
|
48
69
|
} = _ref3;
|
|
49
|
-
return
|
|
50
|
-
}
|
|
51
|
-
|
|
70
|
+
return `
|
|
71
|
+
--infoline-fg: ${theme.sanity.color.card.enabled.fg};
|
|
72
|
+
--infoline-bg: ${theme.sanity.color.card.enabled.bg};
|
|
73
|
+
`;
|
|
74
|
+
}};
|
|
75
|
+
user-drag: none;
|
|
76
|
+
position: absolute;
|
|
77
|
+
background-color: var(--infoline-bg);
|
|
78
|
+
top: 0;
|
|
79
|
+
left: 0;
|
|
80
|
+
max-width: 65%;
|
|
81
|
+
overflow-wrap: break-word;
|
|
82
|
+
|
|
83
|
+
[data-ui='Text'] {
|
|
84
|
+
color: var(--infoline-fg);
|
|
85
|
+
}
|
|
86
|
+
`;
|
|
87
|
+
const DurationLine = styledComponents.styled(ui.Card)`
|
|
88
|
+
${_ref4 => {
|
|
52
89
|
let {
|
|
53
90
|
theme
|
|
54
91
|
} = _ref4;
|
|
55
|
-
return
|
|
56
|
-
}
|
|
92
|
+
return `
|
|
93
|
+
--durationline-fg: ${theme.sanity.color.card.enabled.bg};
|
|
94
|
+
--durationline-bg: ${theme.sanity.color.card.enabled.fg};
|
|
95
|
+
`;
|
|
96
|
+
}};
|
|
97
|
+
user-drag: none;
|
|
98
|
+
position: absolute;
|
|
99
|
+
background-color: var(--durationline-bg);
|
|
100
|
+
top: 0;
|
|
101
|
+
right: 0;
|
|
102
|
+
|
|
103
|
+
[data-ui='Text'] {
|
|
104
|
+
color: var(--durationline-fg);
|
|
105
|
+
}
|
|
106
|
+
`;
|
|
57
107
|
const VideoPlayer = _ref5 => {
|
|
58
108
|
let {
|
|
59
109
|
src,
|
|
@@ -62,8 +112,7 @@ const VideoPlayer = _ref5 => {
|
|
|
62
112
|
const videoNode = React__default.default.useRef(null);
|
|
63
113
|
const player = React__default.default.useRef();
|
|
64
114
|
React.useEffect(() => {
|
|
65
|
-
|
|
66
|
-
player.current = videojs__default.default((_a = videoNode.current) != null ? _a : "", {
|
|
115
|
+
player.current = videojs__default.default(videoNode.current ?? "", {
|
|
67
116
|
sources: [{
|
|
68
117
|
src
|
|
69
118
|
}],
|
|
@@ -98,30 +147,34 @@ const VideoPlayer = _ref5 => {
|
|
|
98
147
|
})]
|
|
99
148
|
});
|
|
100
149
|
};
|
|
101
|
-
const StyledBox = styledComponents.styled(ui.Box)
|
|
150
|
+
const StyledBox = styledComponents.styled(ui.Box)`
|
|
151
|
+
background-color: ${_ref6 => {
|
|
102
152
|
let {
|
|
103
153
|
theme
|
|
104
154
|
} = _ref6;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
155
|
+
return theme.sanity.color?.card?.enabled?.bg2;
|
|
156
|
+
}};
|
|
157
|
+
border: ${_ref7 => {
|
|
108
158
|
let {
|
|
109
159
|
theme
|
|
110
160
|
} = _ref7;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
161
|
+
return `1px solid ${theme.sanity?.color?.card?.enabled?.border}`;
|
|
162
|
+
}};
|
|
163
|
+
display: flex;
|
|
164
|
+
justify-content: center;
|
|
165
|
+
margin-bottom: ${_ref8 => {
|
|
114
166
|
let {
|
|
115
167
|
theme
|
|
116
168
|
} = _ref8;
|
|
117
169
|
return theme.sanity.space[4];
|
|
118
|
-
}
|
|
170
|
+
}};
|
|
171
|
+
position: relative;
|
|
172
|
+
`;
|
|
119
173
|
const RenderAsset = _ref9 => {
|
|
120
174
|
let {
|
|
121
175
|
value,
|
|
122
176
|
url
|
|
123
177
|
} = _ref9;
|
|
124
|
-
var _a;
|
|
125
178
|
switch (value.type) {
|
|
126
179
|
case "video":
|
|
127
180
|
return /* @__PURE__ */jsxRuntime.jsx(VideoPlayer, {
|
|
@@ -133,7 +186,7 @@ const RenderAsset = _ref9 => {
|
|
|
133
186
|
justify: "center",
|
|
134
187
|
children: /* @__PURE__ */jsxRuntime.jsx("img", {
|
|
135
188
|
alt: "preview",
|
|
136
|
-
src:
|
|
189
|
+
src: value?.preview?.url,
|
|
137
190
|
style: {
|
|
138
191
|
maxWidth: "100%",
|
|
139
192
|
height: "auto",
|
|
@@ -144,10 +197,10 @@ const RenderAsset = _ref9 => {
|
|
|
144
197
|
});
|
|
145
198
|
}
|
|
146
199
|
};
|
|
147
|
-
const AssetPreview =
|
|
200
|
+
const AssetPreview = _ref0 => {
|
|
148
201
|
let {
|
|
149
202
|
value
|
|
150
|
-
} =
|
|
203
|
+
} = _ref0;
|
|
151
204
|
const url = value && value.url;
|
|
152
205
|
if (!value || !url) {
|
|
153
206
|
return null;
|
|
@@ -171,8 +224,8 @@ const AssetPreview = _ref10 => {
|
|
|
171
224
|
margin: 2,
|
|
172
225
|
children: /* @__PURE__ */jsxRuntime.jsxs(ui.Text, {
|
|
173
226
|
size: 1,
|
|
174
|
-
title:
|
|
175
|
-
children: [filename, " ", fileSize &&
|
|
227
|
+
title: `Select ${filename}`,
|
|
228
|
+
children: [filename, " ", fileSize && `(${prettyBytes__default.default(fileSize)})`]
|
|
176
229
|
})
|
|
177
230
|
}), duration && /* @__PURE__ */jsxRuntime.jsx(DurationLine, {
|
|
178
231
|
padding: 2,
|
|
@@ -180,7 +233,7 @@ const AssetPreview = _ref10 => {
|
|
|
180
233
|
margin: 2,
|
|
181
234
|
children: /* @__PURE__ */jsxRuntime.jsx(ui.Text, {
|
|
182
235
|
size: 1,
|
|
183
|
-
title:
|
|
236
|
+
title: `Video duration: ${filename}`,
|
|
184
237
|
children: prettyMilliseconds__default.default(duration, {
|
|
185
238
|
colonNotation: true,
|
|
186
239
|
secondsDecimalDigits: 0
|
|
@@ -196,12 +249,16 @@ const fetchSearch = props => {
|
|
|
196
249
|
shop,
|
|
197
250
|
query,
|
|
198
251
|
cursor,
|
|
199
|
-
resultsPerPage
|
|
252
|
+
resultsPerPage,
|
|
253
|
+
token
|
|
200
254
|
} = props;
|
|
201
255
|
return rxjs.defer(() => {
|
|
202
|
-
return axios__default.default.get(
|
|
256
|
+
return axios__default.default.get(`https://${projectId}.api.sanity.io/v1/shopify/assets/${dataset}?shop=${shop}&query=${encodeURIComponent(query)}${cursor && `&cursor=${cursor}`}&limit=${resultsPerPage}`, {
|
|
203
257
|
withCredentials: true,
|
|
204
|
-
method: "GET"
|
|
258
|
+
method: "GET",
|
|
259
|
+
headers: token ? {
|
|
260
|
+
Authorization: `Bearer ${token}`
|
|
261
|
+
} : {}
|
|
205
262
|
});
|
|
206
263
|
}).pipe(operators.map(result => result.data));
|
|
207
264
|
};
|
|
@@ -211,11 +268,15 @@ const fetchList = props => {
|
|
|
211
268
|
dataset,
|
|
212
269
|
shop,
|
|
213
270
|
cursor,
|
|
214
|
-
resultsPerPage
|
|
271
|
+
resultsPerPage,
|
|
272
|
+
token
|
|
215
273
|
} = props;
|
|
216
|
-
return rxjs.defer(() => axios__default.default.get(
|
|
274
|
+
return rxjs.defer(() => axios__default.default.get(`https://${projectId}.api.sanity.io/v1/shopify/assets/${dataset}?shop=${shop}${cursor && `&cursor=${cursor}`}&limit=${resultsPerPage}`, {
|
|
217
275
|
withCredentials: true,
|
|
218
|
-
method: "GET"
|
|
276
|
+
method: "GET",
|
|
277
|
+
headers: token ? {
|
|
278
|
+
Authorization: `Bearer ${token}`
|
|
279
|
+
} : {}
|
|
219
280
|
})).pipe(operators.map(result => result.data));
|
|
220
281
|
};
|
|
221
282
|
const search = props => {
|
|
@@ -225,10 +286,11 @@ const search = props => {
|
|
|
225
286
|
shop,
|
|
226
287
|
query,
|
|
227
288
|
cursor,
|
|
228
|
-
resultsPerPage
|
|
289
|
+
resultsPerPage,
|
|
290
|
+
token
|
|
229
291
|
} = props;
|
|
230
|
-
return rxjs.concat(query.pipe(operators.withLatestFrom(cursor), operators.debounceTime(500), operators.distinctUntilChanged(), operators.switchMap(
|
|
231
|
-
let [q, c] =
|
|
292
|
+
return rxjs.concat(query.pipe(operators.withLatestFrom(cursor), operators.debounceTime(500), operators.distinctUntilChanged(), operators.switchMap(_ref1 => {
|
|
293
|
+
let [q, c] = _ref1;
|
|
232
294
|
if (q) {
|
|
233
295
|
return fetchSearch({
|
|
234
296
|
projectId,
|
|
@@ -236,7 +298,8 @@ const search = props => {
|
|
|
236
298
|
shop,
|
|
237
299
|
query: q,
|
|
238
300
|
cursor: c,
|
|
239
|
-
resultsPerPage
|
|
301
|
+
resultsPerPage,
|
|
302
|
+
token
|
|
240
303
|
}).pipe(operators.distinctUntilChanged());
|
|
241
304
|
}
|
|
242
305
|
return fetchList({
|
|
@@ -244,7 +307,8 @@ const search = props => {
|
|
|
244
307
|
dataset,
|
|
245
308
|
shop,
|
|
246
309
|
cursor: c,
|
|
247
|
-
resultsPerPage
|
|
310
|
+
resultsPerPage,
|
|
311
|
+
token
|
|
248
312
|
});
|
|
249
313
|
})));
|
|
250
314
|
};
|
|
@@ -254,7 +318,7 @@ const DialogHeader = props => {
|
|
|
254
318
|
shopifyDomain
|
|
255
319
|
} = props;
|
|
256
320
|
const handleOpenInNewTab = React.useCallback(() => {
|
|
257
|
-
window.open(
|
|
321
|
+
window.open(`https://${shopifyDomain}/admin/settings/files`, "_blank");
|
|
258
322
|
}, [shopifyDomain]);
|
|
259
323
|
return /* @__PURE__ */jsxRuntime.jsxs(ui.Flex, {
|
|
260
324
|
align: "center",
|
|
@@ -282,10 +346,7 @@ const DialogHeader = props => {
|
|
|
282
346
|
})]
|
|
283
347
|
});
|
|
284
348
|
};
|
|
285
|
-
const extractName = name =>
|
|
286
|
-
var _a, _b, _c;
|
|
287
|
-
return (_c = (_b = (_a = name == null ? void 0 : name.split("/")) == null ? void 0 : _a.pop()) == null ? void 0 : _b.split("?")[0]) != null ? _c : "";
|
|
288
|
-
};
|
|
349
|
+
const extractName = name => name?.split("/")?.pop()?.split("?")[0] ?? "";
|
|
289
350
|
function File(props) {
|
|
290
351
|
const {
|
|
291
352
|
onClick,
|
|
@@ -307,12 +368,12 @@ function File(props) {
|
|
|
307
368
|
}, [onClick, data, filename]);
|
|
308
369
|
return /* @__PURE__ */jsxRuntime.jsxs(Root, {
|
|
309
370
|
ref: rootElm,
|
|
310
|
-
title:
|
|
371
|
+
title: `${filename}`,
|
|
311
372
|
tabIndex: 0,
|
|
312
373
|
style: {
|
|
313
|
-
width:
|
|
314
|
-
height:
|
|
315
|
-
backgroundImage:
|
|
374
|
+
width: `${width}px`,
|
|
375
|
+
height: `${height}px`,
|
|
376
|
+
backgroundImage: `url("${preview?.url}")`
|
|
316
377
|
},
|
|
317
378
|
onClick: handleClick,
|
|
318
379
|
children: [/* @__PURE__ */jsxRuntime.jsx(InfoLine, {
|
|
@@ -321,8 +382,8 @@ function File(props) {
|
|
|
321
382
|
margin: 2,
|
|
322
383
|
children: /* @__PURE__ */jsxRuntime.jsxs(ui.Text, {
|
|
323
384
|
size: 1,
|
|
324
|
-
title:
|
|
325
|
-
children: [filename, " ", meta.fileSize &&
|
|
385
|
+
title: `Select ${filename}`,
|
|
386
|
+
children: [filename, " ", meta.fileSize && `(${prettyBytes__default.default(meta.fileSize)})`]
|
|
326
387
|
})
|
|
327
388
|
}), meta.duration && /* @__PURE__ */jsxRuntime.jsx(DurationLine, {
|
|
328
389
|
padding: 2,
|
|
@@ -330,7 +391,7 @@ function File(props) {
|
|
|
330
391
|
margin: 2,
|
|
331
392
|
children: /* @__PURE__ */jsxRuntime.jsx(ui.Text, {
|
|
332
393
|
size: 1,
|
|
333
|
-
title:
|
|
394
|
+
title: `Video duration: ${filename}`,
|
|
334
395
|
children: prettyMilliseconds__default.default(meta.duration, {
|
|
335
396
|
colonNotation: true,
|
|
336
397
|
secondsDecimalDigits: 0
|
|
@@ -339,8 +400,15 @@ function File(props) {
|
|
|
339
400
|
})]
|
|
340
401
|
});
|
|
341
402
|
}
|
|
342
|
-
const Search = styledComponents.styled(ui.Stack)
|
|
343
|
-
|
|
403
|
+
const Search = styledComponents.styled(ui.Stack)`
|
|
404
|
+
position: sticky;
|
|
405
|
+
top: 0;
|
|
406
|
+
z-index: 1;
|
|
407
|
+
`;
|
|
408
|
+
styledComponents.styled.div`
|
|
409
|
+
overflow-y: auto;
|
|
410
|
+
max-height: 80vh;
|
|
411
|
+
`;
|
|
344
412
|
const RESULTS_PER_PAGE = 42;
|
|
345
413
|
const PHOTO_SPACING = 2;
|
|
346
414
|
const PHOTO_PADDING = 1;
|
|
@@ -355,6 +423,10 @@ function ShopifyAssetPicker(props) {
|
|
|
355
423
|
} = props;
|
|
356
424
|
const projectId = sanity.useProjectId();
|
|
357
425
|
const dataset = sanity.useDataset();
|
|
426
|
+
const client = sanity.useClient({
|
|
427
|
+
apiVersion: "2021-06-07"
|
|
428
|
+
});
|
|
429
|
+
const token = client.config().token;
|
|
358
430
|
const [error, setError] = React.useState("");
|
|
359
431
|
const [query, setQuery] = React.useState("");
|
|
360
432
|
const [searchResults, setSearchResults] = React.useState([]);
|
|
@@ -372,7 +444,8 @@ function ShopifyAssetPicker(props) {
|
|
|
372
444
|
shop: shopifyDomain,
|
|
373
445
|
query: searchSubject$,
|
|
374
446
|
cursor: cursorSubject$,
|
|
375
|
-
resultsPerPage: RESULTS_PER_PAGE
|
|
447
|
+
resultsPerPage: RESULTS_PER_PAGE,
|
|
448
|
+
token
|
|
376
449
|
}).subscribe({
|
|
377
450
|
next: results => {
|
|
378
451
|
setSearchResults(prevResults => [...prevResults, ...results.assets]);
|
|
@@ -380,11 +453,11 @@ function ShopifyAssetPicker(props) {
|
|
|
380
453
|
setIsLoading(false);
|
|
381
454
|
},
|
|
382
455
|
error: err => {
|
|
383
|
-
setError(
|
|
456
|
+
setError(`${err.response?.data?.message || err.message || "An error occurred"} - check plugin configuration`);
|
|
384
457
|
}
|
|
385
458
|
});
|
|
386
459
|
return () => searchSubscription.unsubscribe();
|
|
387
|
-
}, [searchSubject$, cursorSubject$, shopifyDomain, projectId, dataset]);
|
|
460
|
+
}, [searchSubject$, cursorSubject$, shopifyDomain, projectId, dataset, token]);
|
|
388
461
|
const handleSearchTermChanged = React.useCallback(event => {
|
|
389
462
|
const newQuery = event.currentTarget.value;
|
|
390
463
|
setQuery(newQuery);
|
|
@@ -400,11 +473,11 @@ function ShopifyAssetPicker(props) {
|
|
|
400
473
|
searchSubject$.next(query);
|
|
401
474
|
}, [cursorSubject$, pageInfo, searchSubject$, query]);
|
|
402
475
|
const handleSelect = React.useCallback(file => {
|
|
403
|
-
file._key = value
|
|
476
|
+
file._key = value?._key;
|
|
404
477
|
file._type = schemaType.name;
|
|
405
478
|
onChange(sanity.PatchEvent.from([sanity.set(file)]));
|
|
406
479
|
onClose();
|
|
407
|
-
}, [onChange, onClose, schemaType.name, value
|
|
480
|
+
}, [onChange, onClose, schemaType.name, value?._key]);
|
|
408
481
|
const renderFile = React.useCallback(fileProps => {
|
|
409
482
|
const {
|
|
410
483
|
photo,
|
|
@@ -475,7 +548,7 @@ function ShopifyAssetPicker(props) {
|
|
|
475
548
|
}), /* @__PURE__ */jsxRuntime.jsx(InfiniteScroll__default.default, {
|
|
476
549
|
dataLength: searchResults.length,
|
|
477
550
|
next: handleScollerLoadMore,
|
|
478
|
-
hasMore: pageInfo ? pageInfo
|
|
551
|
+
hasMore: pageInfo ? pageInfo?.hasNextPage : true,
|
|
479
552
|
scrollThreshold: 0.99,
|
|
480
553
|
height: "60vh",
|
|
481
554
|
loader: /* @__PURE__ */jsxRuntime.jsx(ui.Flex, {
|
|
@@ -501,21 +574,18 @@ function ShopifyAssetPicker(props) {
|
|
|
501
574
|
spacing: PHOTO_SPACING,
|
|
502
575
|
padding: PHOTO_PADDING,
|
|
503
576
|
targetRowHeight: handleWidth,
|
|
504
|
-
photos: searchResults.map(file => {
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
data: file
|
|
512
|
-
};
|
|
513
|
-
}),
|
|
577
|
+
photos: searchResults.map(file => ({
|
|
578
|
+
src: file?.preview?.url,
|
|
579
|
+
width: file?.preview?.width || 2048,
|
|
580
|
+
height: file?.preview?.height || 2048,
|
|
581
|
+
key: file.id,
|
|
582
|
+
data: file
|
|
583
|
+
})),
|
|
514
584
|
renderPhoto: renderFile,
|
|
515
585
|
componentsProps: {
|
|
516
586
|
containerProps: {
|
|
517
587
|
style: {
|
|
518
|
-
marginBottom:
|
|
588
|
+
marginBottom: `${PHOTO_SPACING}px`
|
|
519
589
|
}
|
|
520
590
|
}
|
|
521
591
|
}
|
|
@@ -624,15 +694,14 @@ function ShopifyAssetInput(props) {
|
|
|
624
694
|
})]
|
|
625
695
|
});
|
|
626
696
|
}
|
|
627
|
-
const CloudinaryDiffPreview =
|
|
697
|
+
const CloudinaryDiffPreview = _ref10 => {
|
|
628
698
|
let {
|
|
629
699
|
value
|
|
630
|
-
} =
|
|
631
|
-
var _a, _b;
|
|
700
|
+
} = _ref10;
|
|
632
701
|
if (!value) {
|
|
633
702
|
return null;
|
|
634
703
|
}
|
|
635
|
-
if (
|
|
704
|
+
if (value?.preview?.url) {
|
|
636
705
|
return /* @__PURE__ */jsxRuntime.jsx(ui.Flex, {
|
|
637
706
|
justify: "center",
|
|
638
707
|
align: "center",
|
|
@@ -642,7 +711,7 @@ const CloudinaryDiffPreview = _ref12 => {
|
|
|
642
711
|
space: 2,
|
|
643
712
|
children: [/* @__PURE__ */jsxRuntime.jsx("img", {
|
|
644
713
|
alt: "preview",
|
|
645
|
-
src:
|
|
714
|
+
src: value?.preview?.url,
|
|
646
715
|
style: {
|
|
647
716
|
objectFit: "contain",
|
|
648
717
|
margin: "auto",
|
|
@@ -666,11 +735,11 @@ const CloudinaryDiffPreview = _ref12 => {
|
|
|
666
735
|
})
|
|
667
736
|
});
|
|
668
737
|
};
|
|
669
|
-
const AssetDiff =
|
|
738
|
+
const AssetDiff = _ref11 => {
|
|
670
739
|
let {
|
|
671
740
|
diff,
|
|
672
741
|
schemaType
|
|
673
|
-
} =
|
|
742
|
+
} = _ref11;
|
|
674
743
|
return /* @__PURE__ */jsxRuntime.jsx(sanity.DiffFromTo, {
|
|
675
744
|
diff,
|
|
676
745
|
schemaType,
|
|
@@ -729,14 +798,14 @@ const shopifyAssetSchema = config => {
|
|
|
729
798
|
filename: "filename",
|
|
730
799
|
type: "type"
|
|
731
800
|
},
|
|
732
|
-
prepare(
|
|
801
|
+
prepare(_ref12) {
|
|
733
802
|
let {
|
|
734
803
|
url,
|
|
735
804
|
meta,
|
|
736
805
|
preview,
|
|
737
806
|
filename,
|
|
738
807
|
type
|
|
739
|
-
} =
|
|
808
|
+
} = _ref12;
|
|
740
809
|
return {
|
|
741
810
|
title: filename,
|
|
742
811
|
subtitle: type,
|