@wix/bookings 1.0.1781 → 1.0.1783

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 (63) 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-addons.d.ts +54 -3
  11. package/build/cjs/context-service-addons.js +1065 -578
  12. package/build/cjs/context-service-addons.js.map +1 -1
  13. package/build/cjs/context-service.d.ts +35 -24
  14. package/build/cjs/context-service.js +985 -966
  15. package/build/cjs/context-service.js.map +1 -1
  16. package/build/cjs/context-time-slots.d.ts +44 -98
  17. package/build/cjs/context-time-slots.js +456 -474
  18. package/build/cjs/context-time-slots.js.map +1 -1
  19. package/build/es/context-booking-checkout.d.mts +32 -0
  20. package/build/es/context-booking-checkout.mjs +2002 -1762
  21. package/build/es/context-booking-checkout.mjs.map +1 -1
  22. package/build/es/context-my-booking.d.mts +2832 -0
  23. package/build/es/context-my-booking.mjs +562 -0
  24. package/build/es/context-my-booking.mjs.map +1 -0
  25. package/build/es/context-my-bookings.d.mts +2862 -0
  26. package/build/es/context-my-bookings.mjs +12844 -0
  27. package/build/es/context-my-bookings.mjs.map +1 -0
  28. package/build/es/context-service-addons.d.mts +54 -3
  29. package/build/es/context-service-addons.mjs +1061 -574
  30. package/build/es/context-service-addons.mjs.map +1 -1
  31. package/build/es/context-service.d.mts +35 -24
  32. package/build/es/context-service.mjs +985 -966
  33. package/build/es/context-service.mjs.map +1 -1
  34. package/build/es/context-time-slots.d.mts +44 -98
  35. package/build/es/context-time-slots.mjs +456 -474
  36. package/build/es/context-time-slots.mjs.map +1 -1
  37. package/build/internal/cjs/context-booking-checkout.d.ts +32 -0
  38. package/build/internal/cjs/context-my-booking.d.ts +2832 -0
  39. package/build/internal/cjs/context-my-bookings.d.ts +2862 -0
  40. package/build/internal/cjs/context-service-addons.d.ts +54 -3
  41. package/build/internal/cjs/context-service.d.ts +35 -24
  42. package/build/internal/cjs/context-time-slots.d.ts +44 -98
  43. package/build/internal/es/context-booking-checkout.d.mts +32 -0
  44. package/build/internal/es/context-my-booking.d.mts +2832 -0
  45. package/build/internal/es/context-my-bookings.d.mts +2862 -0
  46. package/build/internal/es/context-service-addons.d.mts +54 -3
  47. package/build/internal/es/context-service.d.mts +35 -24
  48. package/build/internal/es/context-time-slots.d.mts +44 -98
  49. package/context/my-booking/package.json +3 -0
  50. package/context/my-bookings/package.json +3 -0
  51. package/context-runtime/context-booking-checkout/runtime.d.ts +32 -0
  52. package/context-runtime/context-booking-checkout/runtime.js +3 -3
  53. package/context-runtime/context-my-booking/runtime.d.ts +2832 -0
  54. package/context-runtime/context-my-booking/runtime.js +2 -0
  55. package/context-runtime/context-my-bookings/runtime.d.ts +2862 -0
  56. package/context-runtime/context-my-bookings/runtime.js +11 -0
  57. package/context-runtime/context-service/runtime.d.ts +35 -24
  58. package/context-runtime/context-service/runtime.js +3 -3
  59. package/context-runtime/context-service-addons/runtime.d.ts +54 -3
  60. package/context-runtime/context-service-addons/runtime.js +2 -2
  61. package/context-runtime/context-time-slots/runtime.d.ts +44 -98
  62. package/context-runtime/context-time-slots/runtime.js +3 -3
  63. package/package.json +20 -4
@@ -4186,6 +4186,9 @@ interface ServiceContextValue {
4186
4186
  * - A class: it has a session that hasn't ended.
4187
4187
  * - A course: it has spots left, its sessions haven't ended, and booking is open.
4188
4188
  *
4189
+ * In the editor, bind a booking button's visibility condition to it to hide the button when
4190
+ * the service can't be booked.
4191
+ *
4189
4192
  * @returns `true` when the service can be booked online now. Same as
4190
4193
  * `serviceBookability.isAvailableForBooking`.
4191
4194
  *
@@ -4210,6 +4213,9 @@ interface ServiceContextValue {
4210
4213
  /**
4211
4214
  * Checks whether the service has a booking policy description to show.
4212
4215
  *
4216
+ * In the editor, bind the policy text's visibility condition to it to hide the text when
4217
+ * there's no policy.
4218
+ *
4213
4219
  * @returns `true` when `policyDescription` isn't empty.
4214
4220
  *
4215
4221
  * @example Show the booking policy only when there's one
@@ -4234,6 +4240,9 @@ interface ServiceContextValue {
4234
4240
  /**
4235
4241
  * Checks whether the service has a cover image.
4236
4242
  *
4243
+ * In the editor, bind a header's visibility condition to it to hide the header when there's
4244
+ * no cover image.
4245
+ *
4237
4246
  * @returns `true` when `coverImage` is set.
4238
4247
  *
4239
4248
  * @example Show a header only when the service has a cover image
@@ -4255,6 +4264,9 @@ interface ServiceContextValue {
4255
4264
  /**
4256
4265
  * Checks whether the service has gallery images.
4257
4266
  *
4267
+ * In the editor, bind a gallery's visibility condition to it to hide the gallery when there are
4268
+ * no images.
4269
+ *
4258
4270
  * @returns `true` when `gallery` has at least 1 image.
4259
4271
  *
4260
4272
  * @example Show a gallery only when the service has images
@@ -4411,6 +4423,21 @@ interface ServiceContextValue {
4411
4423
  * `navigateToNextPage()` carries it to the next page.
4412
4424
  */
4413
4425
  selection: ServicePreference;
4426
+ /**
4427
+ * Whether the time slot in `selection` is a full class session whose waitlist is open. Such a
4428
+ * slot can't be booked on the site yet: `navigateToNextPage()` doesn't take it to the booking
4429
+ * form, and a button that books it should offer the waitlist instead.
4430
+ *
4431
+ * `false` when no time slot is selected, or the selected one can be booked.
4432
+ */
4433
+ isWaitlistSlotSelected: boolean;
4434
+ /**
4435
+ * ID of the site (its meta site ID), as the host reports it. Builders use it for links that
4436
+ * name the site, such as the waitlist dialog's link to the site in the Wix app.
4437
+ *
4438
+ * `''` while the host hasn't provided it, such as an unsaved site in the editor.
4439
+ */
4440
+ siteId: string;
4414
4441
  /**
4415
4442
  * [IANA time zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the time
4416
4443
  * slot in `selection`. It's the time zone sent with the time slot when it was selected.
@@ -4721,36 +4748,18 @@ interface ServiceContextValue {
4721
4748
  draftRevision: number;
4722
4749
  /**
4723
4750
  * Whether the visitor has a promo code to enter at checkout, from the booking preferences in the
4724
- * page's URL. To change it, call `setWantsPromoCode()`.
4751
+ * page's URL.
4752
+ *
4753
+ * @deprecated Use the Booking Checkout context's `selection.wantsPromoCode`.
4725
4754
  */
4726
4755
  wantsPromoCode: boolean;
4727
4756
  /**
4728
4757
  * Sets whether the visitor has a promo code to enter at checkout, and writes it to the page's
4729
- * URL, replacing the current history entry.
4730
- *
4731
- * The function does nothing when the page's URL has no booking preferences.
4758
+ * URL, replacing the current history entry. The function does nothing when the page's URL has no
4759
+ * booking preferences.
4732
4760
  *
4761
+ * @deprecated Use the Booking Checkout context's `setWantsPromoCode()`.
4733
4762
  * @param wanted - Whether the visitor has a promo code to enter at checkout.
4734
- *
4735
- * @example Let the visitor say they have a promo code
4736
- * ```tsx
4737
- * import { useServiceContext } from '@wix/bookings/context/service';
4738
- *
4739
- * function PromoCodeCheckbox() {
4740
- * const { wantsPromoCode, setWantsPromoCode } = useServiceContext();
4741
- *
4742
- * return (
4743
- * <label>
4744
- * <input
4745
- * type="checkbox"
4746
- * checked={wantsPromoCode}
4747
- * onChange={(event) => setWantsPromoCode(event.target.checked)}
4748
- * />
4749
- * I have a promo code
4750
- * </label>
4751
- * );
4752
- * }
4753
- * ```
4754
4763
  */
4755
4764
  setWantsPromoCode: (wanted: boolean) => void;
4756
4765
  /**
@@ -4800,6 +4809,8 @@ interface ServiceContextValue {
4800
4809
  * - The context is in reschedule mode. To move the booking, call `rescheduleBooking()`.
4801
4810
  * - The next page is the booking form, and no time slot is selected for a class or an
4802
4811
  * appointment.
4812
+ * - The next page is the booking form, and the selected time slot is a full class session with
4813
+ * an open waitlist. See `isWaitlistSlotSelected`.
4803
4814
  * - The site has no page for the next step.
4804
4815
  *
4805
4816
  * The booking form gets only this service's selection. Other pages get the selection merged into