@constructor-io/constructorio-ui-plp 1.8.2 → 1.8.4

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.
@@ -23,7 +23,7 @@ const useProductInfo = ({ item }) => {
23
23
  const itemWithVariationUrl = (productSwatch === null || productSwatch === void 0 ? void 0 : productSwatch.selectedVariation)
24
24
  ? Object.assign(Object.assign({}, item), { url: productSwatch.selectedVariation.url }) : item;
25
25
  const itemUrl = getItemUrl(itemWithVariationUrl) || ((_h = productSwatch === null || productSwatch === void 0 ? void 0 : productSwatch.selectedVariation) === null || _h === void 0 ? void 0 : _h.url);
26
- const variationId = (_j = productSwatch === null || productSwatch === void 0 ? void 0 : productSwatch.selectedVariation) === null || _j === void 0 ? void 0 : _j.variationId;
26
+ const variationId = ((_j = productSwatch === null || productSwatch === void 0 ? void 0 : productSwatch.selectedVariation) === null || _j === void 0 ? void 0 : _j.variationId) || item.variationId;
27
27
  let rolloverImage = (_k = productSwatch === null || productSwatch === void 0 ? void 0 : productSwatch.selectedVariation) === null || _k === void 0 ? void 0 : _k.rolloverImage;
28
28
  // Fallback to item's rollover image if all variations don't have a rollover image
29
29
  if (!rolloverImage && ((_l = productSwatch === null || productSwatch === void 0 ? void 0 : productSwatch.swatchList) === null || _l === void 0 ? void 0 : _l.every((swatch) => !swatch.rolloverImage))) {
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = '1.8.2';
3
+ exports.default = '1.8.4';
@@ -20,7 +20,7 @@ const useProductInfo = ({ item }) => {
20
20
  ? { ...item, url: productSwatch.selectedVariation.url }
21
21
  : item;
22
22
  const itemUrl = getItemUrl(itemWithVariationUrl) || productSwatch?.selectedVariation?.url;
23
- const variationId = productSwatch?.selectedVariation?.variationId;
23
+ const variationId = productSwatch?.selectedVariation?.variationId || item.variationId;
24
24
  let rolloverImage = productSwatch?.selectedVariation?.rolloverImage;
25
25
  // Fallback to item's rollover image if all variations don't have a rollover image
26
26
  if (!rolloverImage && productSwatch?.swatchList?.every((swatch) => !swatch.rolloverImage)) {
@@ -1 +1 @@
1
- export default '1.8.2';
1
+ export default '1.8.4';
@@ -1,2 +1,2 @@
1
- declare const _default: "1.8.2";
1
+ declare const _default: "1.8.4";
2
2
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructor-io/constructorio-ui-plp",
3
- "version": "1.8.2",
3
+ "version": "1.8.4",
4
4
  "description": "Constructor PLP UI library for web applications",
5
5
  "author": "Constructor.io Corporation",
6
6
  "license": "MIT",