@snowcone-app/ui 0.9.0 → 0.9.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/CHANGELOG.md +18 -0
- package/README.md +1 -1
- package/dist/index.cjs +8 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +10 -7
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/composed/ArtworkCustomizer.tsx +2 -2
- package/src/composed/ColorPicker.tsx +1 -1
- package/src/composed/CurrentSelectionDisplay.tsx +1 -1
- package/src/composed/HeroProductImage.tsx +9 -3
- package/src/composed/ProductGallery.tsx +1 -1
- package/src/hooks/useProductGallery.ts +1 -1
- package/src/patterns/RealtimeProvider.tsx +3 -4
- package/src/patterns/__tests__/RealtimeProvider.cropDelivery.test.tsx +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.9.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#4283](https://github.com/snowcone-app/snowcone-monorepo/pull/4283) [`4fbaaf1`](https://github.com/snowcone-app/snowcone-monorepo/commit/4fbaaf161d0c580a1c56790a9a4c54f676a92abc) Thanks [@kevinsproles](https://github.com/kevinsproles)! - Examples and tool descriptions use live demo products: the iPhone 17 Pro Max Case (`BC43BE`), the Canvas Tote (`CAXHQC`) and the All-Over Print Zip Hoodie (`XTNA6J`), in place of the Framed Canvas (`BEEB77`) and Women's Tee (`KMYKUK`), which are no longer for sale. No API change.
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`4fbaaf1`](https://github.com/snowcone-app/snowcone-monorepo/commit/4fbaaf161d0c580a1c56790a9a4c54f676a92abc)]:
|
|
10
|
+
- @snowcone-app/sdk@0.24.4
|
|
11
|
+
|
|
12
|
+
## 0.9.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#4074](https://github.com/snowcone-app/snowcone-monorepo/pull/4074) [`8682d87`](https://github.com/snowcone-app/snowcone-monorepo/commit/8682d876466cee5ee80ff05b1401a5679a410007) Thanks [@kevinsproles](https://github.com/kevinsproles)! - A selected size with no scene previews a listed variant that differs only by size. The cart, SKU and price keep the selected size.
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [[`8682d87`](https://github.com/snowcone-app/snowcone-monorepo/commit/8682d876466cee5ee80ff05b1401a5679a410007)]:
|
|
19
|
+
- @snowcone-app/sdk@0.24.3
|
|
20
|
+
|
|
3
21
|
## 0.9.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ import { Shop, Product, ArtSelector, ProductImage, AddToCart } from '@snowcone-a
|
|
|
38
38
|
function MyStore() {
|
|
39
39
|
return (
|
|
40
40
|
<Shop mode="mock">
|
|
41
|
-
<Product productId="
|
|
41
|
+
<Product productId="BC43BE">
|
|
42
42
|
{/* ArtSelector sets the artwork; ProductImage reads it from context. */}
|
|
43
43
|
<ArtSelector artworks={['https://example.com/art.png']} />
|
|
44
44
|
<ProductImage />
|
package/dist/index.cjs
CHANGED
|
@@ -6509,10 +6509,9 @@ function RealtimeProvider({
|
|
|
6509
6509
|
const product = productContext.product;
|
|
6510
6510
|
const productId = product.id;
|
|
6511
6511
|
const placements = product.placements || [];
|
|
6512
|
-
const variantId = (0, import_sdk8.
|
|
6512
|
+
const variantId = (0, import_sdk8.resolvePreviewVariantId)(
|
|
6513
6513
|
productContext,
|
|
6514
|
-
void 0,
|
|
6515
|
-
void 0
|
|
6514
|
+
(0, import_sdk8.resolveVariantId)(productContext, void 0, void 0)
|
|
6516
6515
|
);
|
|
6517
6516
|
const isFirstSend = !configSentRef.current;
|
|
6518
6517
|
const variantChanged = lastSentVariantIdRef.current !== null && lastSentVariantIdRef.current !== variantId;
|
|
@@ -10493,12 +10492,15 @@ var HeroProductImage = (0, import_react46.memo)(function HeroProductImage2({
|
|
|
10493
10492
|
const contextRef = (0, import_react46.useRef)(context);
|
|
10494
10493
|
contextRef.current = context;
|
|
10495
10494
|
const actualProductId = product?.id || productId || context?.product?.id;
|
|
10496
|
-
const
|
|
10495
|
+
const selectedGvid = (0, import_react46.useMemo)(() => {
|
|
10497
10496
|
return (0, import_sdk10.resolveVariantId)(context, gvid, variantId);
|
|
10498
10497
|
}, [gvid, variantId, context?.selection, context?.combinations]);
|
|
10499
10498
|
const actualMockupId = (0, import_react46.useMemo)(() => {
|
|
10500
|
-
return (0, import_sdk10.resolveMockupId)(context,
|
|
10501
|
-
}, [mockupId,
|
|
10499
|
+
return (0, import_sdk10.resolveMockupId)(context, selectedGvid, mockupId);
|
|
10500
|
+
}, [mockupId, selectedGvid, context]);
|
|
10501
|
+
const actualGvid = (0, import_react46.useMemo)(() => {
|
|
10502
|
+
return gvid || variantId ? selectedGvid : (0, import_sdk10.resolvePreviewVariantId)(context, selectedGvid, actualMockupId);
|
|
10503
|
+
}, [gvid, variantId, selectedGvid, actualMockupId, context]);
|
|
10502
10504
|
const unavailable = actualMockupId ? realtimeContext?.unavailableMockups?.get(actualMockupId) ?? null : null;
|
|
10503
10505
|
const artworkSrc = artwork?.src;
|
|
10504
10506
|
const selectedArtworkSrc = designContext?.selectedArtwork?.src;
|