@ohhwells/bridge 0.1.33-next.37 → 0.1.33-next.39

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.js CHANGED
@@ -221,12 +221,20 @@ function formatClassTime(cls) {
221
221
  const em = endTotal % 60;
222
222
  return `${h}:${cls.startTime.minutes}-${eh}:${String(em).padStart(2, "0")}`;
223
223
  }
224
+ function formatBookingLabel(cls) {
225
+ const price = cls.price;
226
+ const isFree = price === null || price === void 0 || `${price}` === "" || `${price}` === "0";
227
+ return isFree ? "Book for free" : `Book for ${cls.currency ?? ""} ${price}`.trim();
228
+ }
224
229
  function getBookingsOnDate(cls, date) {
225
230
  if (!cls.bookings?.length) return 0;
226
- const ds = date.toISOString().split("T")[0];
231
+ const target = new Date(date);
232
+ target.setHours(0, 0, 0, 0);
227
233
  return cls.bookings.filter((b) => {
228
234
  try {
229
- return new Date(b.classDate).toISOString().split("T")[0] === ds;
235
+ const bookingDate = new Date(b.classDate);
236
+ bookingDate.setHours(0, 0, 0, 0);
237
+ return bookingDate.getTime() === target.getTime();
230
238
  } catch {
231
239
  return false;
232
240
  }
@@ -530,7 +538,7 @@ function ScheduleView({ schedule, dates, selectedIdx, onSelectDate, onOpenModal
530
538
  if (!cls.id) return;
531
539
  onOpenModal?.(isFull ? "waitlist" : "book", cls.id, selectedDate);
532
540
  },
533
- children: isFull ? "Join Waitlist" : "Book Now"
541
+ children: isFull ? "Join Waitlist" : formatBookingLabel(cls)
534
542
  }
535
543
  )
536
544
  ] })
@@ -712,15 +720,10 @@ function SchedulingWidget({ notifyOnConnect = false, initialScheduleId, insertAf
712
720
  };
713
721
  const handleReplaceSchedule = () => {
714
722
  setIsHovered(false);
715
- if (schedule) {
716
- window.parent.postMessage({
717
- type: "ow:schedule-connected",
718
- schedule: { id: schedule.id, name: schedule.name },
719
- insertAfter
720
- }, "*");
721
- } else {
722
- window.parent.postMessage({ type: "ow:scheduling-not-connected", insertAfter }, "*");
723
- }
723
+ window.parent.postMessage(
724
+ { type: "ow:scheduling-not-connected", insertAfter, currentScheduleId: schedule?.id },
725
+ "*"
726
+ );
724
727
  };
725
728
  if (!inEditor && !loading && !schedule) return null;
726
729
  const sectionId = `scheduling-${insertAfter}`;
@@ -763,7 +766,19 @@ function SchedulingWidget({ notifyOnConnect = false, initialScheduleId, insertAf
763
766
  ),
764
767
  /* @__PURE__ */ jsxs2("div", { className: "max-w-[1280px] mx-auto flex flex-col items-center gap-16", children: [
765
768
  /* @__PURE__ */ jsxs2("div", { className: "flex flex-col items-center gap-4", children: [
766
- /* @__PURE__ */ jsx2("h2", { className: "font-display text-4xl sm:text-5xl font-bold text-center m-0 text-(--color-dark,#200C02)", children: schedule?.name ?? "Book an appointment" }),
769
+ /* @__PURE__ */ jsx2(
770
+ "h2",
771
+ {
772
+ className: "font-display text-center m-0 text-(--color-dark,#200C02)",
773
+ style: {
774
+ fontSize: "var(--fs-section-h2, clamp(40px, 4.4vw, 64px))",
775
+ fontWeight: "var(--font-weight-heading, 400)",
776
+ lineHeight: 1.05,
777
+ letterSpacing: "-0.02em"
778
+ },
779
+ children: schedule?.name ?? "Book an appointment"
780
+ }
781
+ ),
767
782
  schedule?.description && /* @__PURE__ */ jsx2("p", { className: "font-body text-body text-center m-0 text-(--color-accent,#A89B83)", children: schedule.description })
768
783
  ] }),
769
784
  /* @__PURE__ */ jsxs2("div", { className: "w-full flex flex-col items-end gap-3", children: [