@wix/bookings 1.0.1785 → 1.0.1787

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 (51) hide show
  1. package/build/cjs/context-booking-checkout.d.ts +22 -6
  2. package/build/cjs/context-booking-checkout.js +2296 -2253
  3. package/build/cjs/context-booking-checkout.js.map +1 -1
  4. package/build/cjs/context-categories.js +285 -275
  5. package/build/cjs/context-categories.js.map +1 -1
  6. package/build/cjs/context-locations.js +465 -455
  7. package/build/cjs/context-locations.js.map +1 -1
  8. package/build/cjs/context-service-addons.js +964 -917
  9. package/build/cjs/context-service-addons.js.map +1 -1
  10. package/build/cjs/context-service.d.ts +14 -5
  11. package/build/cjs/context-service.js +3514 -3337
  12. package/build/cjs/context-service.js.map +1 -1
  13. package/build/cjs/context-services.js +878 -832
  14. package/build/cjs/context-services.js.map +1 -1
  15. package/build/cjs/context-time-slots.d.ts +10 -0
  16. package/build/cjs/context-time-slots.js +1202 -1159
  17. package/build/cjs/context-time-slots.js.map +1 -1
  18. package/build/es/context-booking-checkout.d.mts +22 -6
  19. package/build/es/context-booking-checkout.mjs +2304 -2261
  20. package/build/es/context-booking-checkout.mjs.map +1 -1
  21. package/build/es/context-categories.mjs +285 -275
  22. package/build/es/context-categories.mjs.map +1 -1
  23. package/build/es/context-locations.mjs +465 -455
  24. package/build/es/context-locations.mjs.map +1 -1
  25. package/build/es/context-service-addons.mjs +971 -924
  26. package/build/es/context-service-addons.mjs.map +1 -1
  27. package/build/es/context-service.d.mts +14 -5
  28. package/build/es/context-service.mjs +3383 -3206
  29. package/build/es/context-service.mjs.map +1 -1
  30. package/build/es/context-services.mjs +878 -832
  31. package/build/es/context-services.mjs.map +1 -1
  32. package/build/es/context-time-slots.d.mts +10 -0
  33. package/build/es/context-time-slots.mjs +1222 -1179
  34. package/build/es/context-time-slots.mjs.map +1 -1
  35. package/build/internal/cjs/context-booking-checkout.d.ts +22 -6
  36. package/build/internal/cjs/context-service.d.ts +14 -5
  37. package/build/internal/cjs/context-time-slots.d.ts +10 -0
  38. package/build/internal/es/context-booking-checkout.d.mts +22 -6
  39. package/build/internal/es/context-service.d.mts +14 -5
  40. package/build/internal/es/context-time-slots.d.mts +10 -0
  41. package/context-runtime/context-booking-checkout/runtime.d.ts +22 -6
  42. package/context-runtime/context-booking-checkout/runtime.js +3 -3
  43. package/context-runtime/context-categories/runtime.js +2 -2
  44. package/context-runtime/context-locations/runtime.js +2 -2
  45. package/context-runtime/context-service/runtime.d.ts +14 -5
  46. package/context-runtime/context-service/runtime.js +3 -3
  47. package/context-runtime/context-service-addons/runtime.js +2 -2
  48. package/context-runtime/context-services/runtime.js +3 -3
  49. package/context-runtime/context-time-slots/runtime.d.ts +10 -0
  50. package/context-runtime/context-time-slots/runtime.js +3 -3
  51. package/package.json +3 -3
@@ -3788,8 +3788,8 @@ interface SlotPickDetails {
3788
3788
  }
3789
3789
  type SetSlot = (slot: SlotSelection, details?: SlotPickDetails) => void;
3790
3790
  /**
3791
- * Appends this service's selection as `b=`. `handoff` (booking form) keeps only this service's
3792
- * entry and the live timezone. `staffId` (null = "any") leaves the selection.
3791
+ * Appends this service's selection as `bookingSelection=`. `handoff` (booking form) keeps only this
3792
+ * service's entry and the live timezone. `staffId` (null = "any") leaves the selection.
3793
3793
  */
3794
3794
  type WithSelectionParam = (path: string, opts?: {
3795
3795
  /**
@@ -4415,7 +4415,7 @@ interface ServiceContextValue {
4415
4415
  * Visitor's selection for the service, such as the time slot, location, staff member, variant
4416
4416
  * choices, and add-ons. It starts from the booking preferences in the page's URL.
4417
4417
  *
4418
- * The booking preferences are the booking choices that the page's URL keeps in its `b` query
4418
+ * The booking preferences are the booking choices that the page's URL keeps in its `bookingSelection` query
4419
4419
  * parameter, so they carry from page to page: the services the visitor selected, with their time
4420
4420
  * slots and choices.
4421
4421
  *
@@ -4423,6 +4423,12 @@ interface ServiceContextValue {
4423
4423
  * `navigateToNextPage()` carries it to the next page.
4424
4424
  */
4425
4425
  selection: ServicePreference;
4426
+ /**
4427
+ * Whether `selection` is still waiting for the booking preferences in the page's URL. The page's
4428
+ * first render ignores them, so its server HTML is the same for every visitor; they apply right
4429
+ * after. While `true`, `selection` is empty: show a loading state rather than "nothing selected".
4430
+ */
4431
+ isSelectionPending: boolean;
4426
4432
  /**
4427
4433
  * Whether the time slot in `selection` is a full class session whose waitlist is open. Such a
4428
4434
  * slot can't be booked on the site yet: `navigateToNextPage()` doesn't take it to the booking
@@ -4763,17 +4769,20 @@ interface ServiceContextValue {
4763
4769
  */
4764
4770
  setWantsPromoCode: (wanted: boolean) => void;
4765
4771
  /**
4766
- * Adds the visitor's selection to a page path, as the booking preferences in the path's `b` query
4772
+ * Adds the visitor's selection to a page path, as the booking preferences in the path's `bookingSelection` query
4767
4773
  * parameter.
4768
4774
  *
4769
4775
  * Use it to build your own link that carries the selection. It doesn't change the selection, and
4770
4776
  * doesn't navigate. When `setSlot()` set a time zone, the booking preferences use it.
4771
4777
  *
4778
+ * While `isSelectionPending` is `true`, the link doesn't carry what the page's URL selected, so a
4779
+ * link rendered on the server is the same for every visitor. It updates once the selection is read.
4780
+ *
4772
4781
  * @param path - Path of the page, which can have its own query and hash.
4773
4782
  *
4774
4783
  * @param opts - How to add the selection.
4775
4784
  *
4776
- * @returns Path, query, and hash of `path`, with the `b` query parameter added. The origin of a
4785
+ * @returns Path, query, and hash of `path`, with the `bookingSelection` query parameter added. The origin of a
4777
4786
  * full URL is dropped.
4778
4787
  *
4779
4788
  * @example Link to a page with the visitor's selection