@snowcone-app/ui 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.9.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#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.
8
+
9
+ - Updated dependencies [[`8682d87`](https://github.com/snowcone-app/snowcone-monorepo/commit/8682d876466cee5ee80ff05b1401a5679a410007)]:
10
+ - @snowcone-app/sdk@0.24.3
11
+
3
12
  ## 0.9.0
4
13
 
5
14
  ### Minor Changes
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.resolveVariantId)(
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 actualGvid = (0, import_react46.useMemo)(() => {
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, actualGvid, mockupId);
10501
- }, [mockupId, actualGvid, context]);
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;