@plasmicpkgs/commerce 0.0.41 → 0.0.44

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.
@@ -1633,6 +1633,8 @@ var categoryCollectionMeta = {
1633
1633
  importName: "CategoryCollection"
1634
1634
  };
1635
1635
  function CategoryCollection(props) {
1636
+ var _categories$findIndex;
1637
+
1636
1638
  var children = props.children,
1637
1639
  noLayout = props.noLayout,
1638
1640
  className = props.className,
@@ -1662,11 +1664,14 @@ function CategoryCollection(props) {
1662
1664
  var firstCategoryNotEmpty = categories == null ? void 0 : categories.find(function (category) {
1663
1665
  return !category.isEmpty;
1664
1666
  });
1667
+ var firstCategoryNotEmptyIndex = (_categories$findIndex = categories == null ? void 0 : categories.findIndex(function (category) {
1668
+ return !category.isEmpty;
1669
+ })) != null ? _categories$findIndex : -1;
1665
1670
  var renderedData = categories == null ? void 0 : categories.map(function (category, i) {
1666
1671
  return React.createElement(CategoryProvider, {
1667
1672
  category: category,
1668
1673
  key: category.id
1669
- }, repeatedElement(firstCategoryNotEmpty ? category === firstCategoryNotEmpty : i === 0, children));
1674
+ }, repeatedElement(i < firstCategoryNotEmptyIndex ? i + 1 : i === firstCategoryNotEmptyIndex ? 0 : i, children));
1670
1675
  });
1671
1676
 
1672
1677
  if ([isAllCategoriesLoading, isLoading].includes(true)) {
@@ -2122,7 +2127,7 @@ function ProductCollection(props) {
2122
2127
  return React.createElement(ProductProvider, {
2123
2128
  product: product,
2124
2129
  key: product.id
2125
- }, repeatedElement(i === 0, children));
2130
+ }, repeatedElement(i, children));
2126
2131
  });
2127
2132
 
2128
2133
  if ([isSearchLoading, isBrandsLoading, isCategoriesLoading].includes(true)) {
@@ -2284,7 +2289,7 @@ function ProductMediaCollection(props) {
2284
2289
  return React.createElement("div", {
2285
2290
  className: className
2286
2291
  }, product == null ? void 0 : product.images.map(function (image, i) {
2287
- return repeatedElement(i === 0, React.createElement(ProductMediaProvider, {
2292
+ return repeatedElement(i, React.createElement(ProductMediaProvider, {
2288
2293
  mediaIndex: i,
2289
2294
  children: media
2290
2295
  }));
@@ -2449,7 +2454,7 @@ function ProductSlider(props) {
2449
2454
  gridTemplateColumns: "repeat(" + thumbsVisible + ", 1fr)"
2450
2455
  }
2451
2456
  }, product.images.slice(leftIndex, leftIndex + thumbsVisible).map(function (image, i) {
2452
- return repeatedElement(i === 0, React.createElement(ProductMediaProvider, {
2457
+ return repeatedElement(i, React.createElement(ProductMediaProvider, {
2453
2458
  mediaIndex: leftIndex + i,
2454
2459
  children: thumbsContainer,
2455
2460
  onClick: function onClick() {