@rebuy/rebuy 2.30.0 → 2.31.0

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.
@@ -2466,6 +2466,8 @@ var buildImage = (settings) => ({
2466
2466
  ...settings.displaySettings?.image?.imageFit && {
2467
2467
  objectFit: settings.displaySettings.image.imageFit
2468
2468
  },
2469
+ /** Accessible name for the product image (legacy `OfferImage` used `accessibilityDescription={variantTitle}`); the renderer interpolates it, so an empty default would announce the image as decorative. */
2470
+ altText: "{{variantTitle}}",
2469
2471
  sectionType: "image",
2470
2472
  source: settings.images?.source === "product" ? "{{productImage}}" : "{{variantImage}}",
2471
2473
  width: 100
@@ -2545,6 +2547,8 @@ var buildSubscriptionButton = (settings) => {
2545
2547
  {
2546
2548
  action: "switchToSubscription",
2547
2549
  buttonStyle: "plain",
2550
+ /** A `subscription` widget offers no one-time purchase (legacy's offers checkbox renders only when `isProductTypeBoth`); suppress the downgrade so the buyer can't switch to one-time on a subscription-only offer. */
2551
+ ...settings.productType === "subscription" && { disableDowngrade: true },
2548
2552
  sections: [
2549
2553
  slot("subscriptionOption", void 0),
2550
2554
  slot("switchToOneTimePurchase", language?.cartSwitchToOnetime),
@@ -3603,7 +3607,15 @@ var TAXONOMY = {
3603
3607
  usesWidgetId: true,
3604
3608
  verb: "tracking"
3605
3609
  },
3606
- "widget-viewed": { buildTags: experimentTags, noun: "widget", subject: "user", usesWidgetId: true, verb: "viewed" }
3610
+ "widget-viewed": {
3611
+ buildTags: experimentTags,
3612
+ /** Under an experiment the view belongs to the VARIANT element, not the placeholder (React parity, same as added-to-cart) — else views credit the placeholder while adds credit the variant and per-widget conversion is meaningless. */
3613
+ buildWidgetId: ({ elementId }, input) => elementId != null ? String(elementId) : input.widgetId,
3614
+ noun: "widget",
3615
+ subject: "user",
3616
+ usesWidgetId: true,
3617
+ verb: "viewed"
3618
+ }
3607
3619
  };
3608
3620
  var isKnownEvent = (name) => name in TAXONOMY;
3609
3621
  var translateAnalyticsEvent = (event, input) => {