@propeller-commerce/propeller-v2-react-ui 0.11.2 → 0.11.3

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/dist/index.d.cts CHANGED
@@ -6688,6 +6688,11 @@ interface ProductSliderProps {
6688
6688
  * add-to-cart in a semi-closed portal. The host owns navigation.
6689
6689
  */
6690
6690
  onLoginClick?: () => void;
6691
+ /**
6692
+ * Show the add-to-cart control on each card. Defaults to true; a semi-closed
6693
+ * portal still withholds it from anonymous visitors regardless.
6694
+ */
6695
+ allowAddToCart?: boolean;
6691
6696
  /** Called when "Request a Quote" is clicked in the AddToCart modal. */ onRequestQuoteClick?: (cart: Cart) => void;
6692
6697
  /** * Label overrides forwarded to the embedded AddToCart component. * Keys: add, adding, addedToCart, outOfStock, noCartId, errorAdding, * modalTitle, quantity, continueShopping, proceedToCheckout */ addToCartLabels?: Record<string, string>;
6693
6698
  /** Translated labels forwarded to embedded `<ProductCard>` instances. */
package/dist/index.d.ts CHANGED
@@ -6688,6 +6688,11 @@ interface ProductSliderProps {
6688
6688
  * add-to-cart in a semi-closed portal. The host owns navigation.
6689
6689
  */
6690
6690
  onLoginClick?: () => void;
6691
+ /**
6692
+ * Show the add-to-cart control on each card. Defaults to true; a semi-closed
6693
+ * portal still withholds it from anonymous visitors regardless.
6694
+ */
6695
+ allowAddToCart?: boolean;
6691
6696
  /** Called when "Request a Quote" is clicked in the AddToCart modal. */ onRequestQuoteClick?: (cart: Cart) => void;
6692
6697
  /** * Label overrides forwarded to the embedded AddToCart component. * Keys: add, adding, addedToCart, outOfStock, noCartId, errorAdding, * modalTitle, quantity, continueShopping, proceedToCheckout */ addToCartLabels?: Record<string, string>;
6693
6698
  /** Translated labels forwarded to embedded `<ProductCard>` instances. */
package/dist/index.js CHANGED
@@ -16061,8 +16061,9 @@ function ProductSlider(rawProps) {
16061
16061
  function desktopCount() {
16062
16062
  return props.itemsPerView?.desktop || 4;
16063
16063
  }
16064
- function portalMode() {
16065
- return props.portalMode || "open";
16064
+ function showAddToCart() {
16065
+ const allow = props.allowAddToCart !== false;
16066
+ return !isContentHidden(props.portalMode, props.user) && allow;
16066
16067
  }
16067
16068
  function isCluster(item) {
16068
16069
  return "clusterId" in item && !("productId" in item);
@@ -16211,7 +16212,7 @@ function ProductSlider(rawProps) {
16211
16212
  ProductCardImpl,
16212
16213
  {
16213
16214
  product: item,
16214
- allowAddToCart: portalMode() === "open",
16215
+ allowAddToCart: showAddToCart(),
16215
16216
  labels: props.productCardLabels,
16216
16217
  stockLabels: props.stockLabels,
16217
16218
  priceLabels: props.priceLabels,