@wix/bookings 1.0.1782 → 1.0.1784

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.
Files changed (53) hide show
  1. package/build/cjs/context-booking-checkout.d.ts +32 -0
  2. package/build/cjs/context-booking-checkout.js +2002 -1762
  3. package/build/cjs/context-booking-checkout.js.map +1 -1
  4. package/build/cjs/context-my-booking.d.ts +2832 -0
  5. package/build/cjs/context-my-booking.js +592 -0
  6. package/build/cjs/context-my-booking.js.map +1 -0
  7. package/build/cjs/context-my-bookings.d.ts +2862 -0
  8. package/build/cjs/context-my-bookings.js +12885 -0
  9. package/build/cjs/context-my-bookings.js.map +1 -0
  10. package/build/cjs/context-service.d.ts +18 -24
  11. package/build/cjs/context-service.js +403 -396
  12. package/build/cjs/context-service.js.map +1 -1
  13. package/build/cjs/context-time-slots.d.ts +24 -7
  14. package/build/cjs/context-time-slots.js +82 -81
  15. package/build/cjs/context-time-slots.js.map +1 -1
  16. package/build/es/context-booking-checkout.d.mts +32 -0
  17. package/build/es/context-booking-checkout.mjs +2002 -1762
  18. package/build/es/context-booking-checkout.mjs.map +1 -1
  19. package/build/es/context-my-booking.d.mts +2832 -0
  20. package/build/es/context-my-booking.mjs +562 -0
  21. package/build/es/context-my-booking.mjs.map +1 -0
  22. package/build/es/context-my-bookings.d.mts +2862 -0
  23. package/build/es/context-my-bookings.mjs +12844 -0
  24. package/build/es/context-my-bookings.mjs.map +1 -0
  25. package/build/es/context-service.d.mts +18 -24
  26. package/build/es/context-service.mjs +403 -396
  27. package/build/es/context-service.mjs.map +1 -1
  28. package/build/es/context-time-slots.d.mts +24 -7
  29. package/build/es/context-time-slots.mjs +82 -81
  30. package/build/es/context-time-slots.mjs.map +1 -1
  31. package/build/internal/cjs/context-booking-checkout.d.ts +32 -0
  32. package/build/internal/cjs/context-my-booking.d.ts +2832 -0
  33. package/build/internal/cjs/context-my-bookings.d.ts +2862 -0
  34. package/build/internal/cjs/context-service.d.ts +18 -24
  35. package/build/internal/cjs/context-time-slots.d.ts +24 -7
  36. package/build/internal/es/context-booking-checkout.d.mts +32 -0
  37. package/build/internal/es/context-my-booking.d.mts +2832 -0
  38. package/build/internal/es/context-my-bookings.d.mts +2862 -0
  39. package/build/internal/es/context-service.d.mts +18 -24
  40. package/build/internal/es/context-time-slots.d.mts +24 -7
  41. package/context/my-booking/package.json +3 -0
  42. package/context/my-bookings/package.json +3 -0
  43. package/context-runtime/context-booking-checkout/runtime.d.ts +32 -0
  44. package/context-runtime/context-booking-checkout/runtime.js +3 -3
  45. package/context-runtime/context-my-booking/runtime.d.ts +2832 -0
  46. package/context-runtime/context-my-booking/runtime.js +2 -0
  47. package/context-runtime/context-my-bookings/runtime.d.ts +2862 -0
  48. package/context-runtime/context-my-bookings/runtime.js +11 -0
  49. package/context-runtime/context-service/runtime.d.ts +18 -24
  50. package/context-runtime/context-service/runtime.js +3 -3
  51. package/context-runtime/context-time-slots/runtime.d.ts +24 -7
  52. package/context-runtime/context-time-slots/runtime.js +2 -2
  53. package/package.json +22 -6
@@ -3531,6 +3531,38 @@ interface BookingCheckoutState {
3531
3531
  * ```
3532
3532
  */
3533
3533
  setParticipants: (count: number) => void;
3534
+ /**
3535
+ * Sets whether the visitor has a promo code to enter at checkout, in `selection.wantsPromoCode`,
3536
+ * and writes it to the page's URL, replacing the current history entry.
3537
+ *
3538
+ * When it's `true` and a priced service is paid in person, `createBooking()` sends the visitor to
3539
+ * the checkout page to enter the code. It doesn't change what's booked, so it keeps
3540
+ * `selectedPaymentOptions`, `createError`, and `addToCartError`.
3541
+ *
3542
+ * The function does nothing when `selection` is `null`.
3543
+ *
3544
+ * @param wanted Whether the visitor has a promo code to enter at checkout.
3545
+ * @example Let the visitor say they have a promo code
3546
+ * ```tsx
3547
+ * import { useBookingCheckoutContext } from '@wix/bookings/context/booking-checkout';
3548
+ *
3549
+ * function PromoCodeCheckbox() {
3550
+ * const { selection, setWantsPromoCode } = useBookingCheckoutContext();
3551
+ *
3552
+ * return (
3553
+ * <label>
3554
+ * <input
3555
+ * type="checkbox"
3556
+ * checked={selection?.wantsPromoCode === true}
3557
+ * onChange={(event) => setWantsPromoCode(event.target.checked)}
3558
+ * />
3559
+ * I have a promo code
3560
+ * </label>
3561
+ * );
3562
+ * }
3563
+ * ```
3564
+ */
3565
+ setWantsPromoCode: (wanted: boolean) => void;
3534
3566
  }
3535
3567
  //#endregion
3536
3568
  //#region src/extensions/contexts/booking-checkout-context/booking-checkout-context.d.ts