@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/README.md CHANGED
@@ -318,6 +318,18 @@ npm run build
318
318
  npm publish --access public
319
319
  ```
320
320
 
321
+ ### Staging → rebound-template auto-bump
322
+
323
+ When `staging` publishes successfully, the bridge workflow dispatches a `bridge-published` event to `TheFlowOps-Eng/rebound-template`. That repo’s `bump-bridge.yml` workflow checks out `staging`, runs `npm install @ohhwells/bridge@<version> --save-exact`, and pushes the lockfile bump.
324
+
325
+ **One-time setup** (in `ohhwells-bridge` GitHub repo → Settings → Secrets):
326
+
327
+ | Secret | Value |
328
+ |--------|--------|
329
+ | `REBOUND_TEMPLATE_DISPATCH_TOKEN` | Fine-grained or classic PAT with `repo` access to `rebound-template` (needs permission to trigger `repository_dispatch`) |
330
+
331
+ The published staging version looks like `0.1.31-next.42` and is tagged `next` on npm.
332
+
321
333
  ---
322
334
 
323
335
  ## Link dialog (Canvas Editor)
package/dist/index.cjs CHANGED
@@ -271,12 +271,20 @@ function formatClassTime(cls) {
271
271
  const em = endTotal % 60;
272
272
  return `${h}:${cls.startTime.minutes}-${eh}:${String(em).padStart(2, "0")}`;
273
273
  }
274
+ function formatBookingLabel(cls) {
275
+ const price = cls.price;
276
+ const isFree = price === null || price === void 0 || `${price}` === "" || `${price}` === "0";
277
+ return isFree ? "Book for free" : `Book for ${cls.currency ?? ""} ${price}`.trim();
278
+ }
274
279
  function getBookingsOnDate(cls, date) {
275
280
  if (!cls.bookings?.length) return 0;
276
- const ds = date.toISOString().split("T")[0];
281
+ const target = new Date(date);
282
+ target.setHours(0, 0, 0, 0);
277
283
  return cls.bookings.filter((b) => {
278
284
  try {
279
- return new Date(b.classDate).toISOString().split("T")[0] === ds;
285
+ const bookingDate = new Date(b.classDate);
286
+ bookingDate.setHours(0, 0, 0, 0);
287
+ return bookingDate.getTime() === target.getTime();
280
288
  } catch {
281
289
  return false;
282
290
  }
@@ -580,7 +588,7 @@ function ScheduleView({ schedule, dates, selectedIdx, onSelectDate, onOpenModal
580
588
  if (!cls.id) return;
581
589
  onOpenModal?.(isFull ? "waitlist" : "book", cls.id, selectedDate);
582
590
  },
583
- children: isFull ? "Join Waitlist" : "Book Now"
591
+ children: isFull ? "Join Waitlist" : formatBookingLabel(cls)
584
592
  }
585
593
  )
586
594
  ] })
@@ -762,15 +770,10 @@ function SchedulingWidget({ notifyOnConnect = false, initialScheduleId, insertAf
762
770
  };
763
771
  const handleReplaceSchedule = () => {
764
772
  setIsHovered(false);
765
- if (schedule) {
766
- window.parent.postMessage({
767
- type: "ow:schedule-connected",
768
- schedule: { id: schedule.id, name: schedule.name },
769
- insertAfter
770
- }, "*");
771
- } else {
772
- window.parent.postMessage({ type: "ow:scheduling-not-connected", insertAfter }, "*");
773
- }
773
+ window.parent.postMessage(
774
+ { type: "ow:scheduling-not-connected", insertAfter, currentScheduleId: schedule?.id },
775
+ "*"
776
+ );
774
777
  };
775
778
  if (!inEditor && !loading && !schedule) return null;
776
779
  const sectionId = `scheduling-${insertAfter}`;
@@ -813,7 +816,19 @@ function SchedulingWidget({ notifyOnConnect = false, initialScheduleId, insertAf
813
816
  ),
814
817
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "max-w-[1280px] mx-auto flex flex-col items-center gap-16", children: [
815
818
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex flex-col items-center gap-4", children: [
816
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("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" }),
819
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
820
+ "h2",
821
+ {
822
+ className: "font-display text-center m-0 text-(--color-dark,#200C02)",
823
+ style: {
824
+ fontSize: "var(--fs-section-h2, clamp(40px, 4.4vw, 64px))",
825
+ fontWeight: "var(--font-weight-heading, 400)",
826
+ lineHeight: 1.05,
827
+ letterSpacing: "-0.02em"
828
+ },
829
+ children: schedule?.name ?? "Book an appointment"
830
+ }
831
+ ),
817
832
  schedule?.description && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "font-body text-body text-center m-0 text-(--color-accent,#A89B83)", children: schedule.description })
818
833
  ] }),
819
834
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "w-full flex flex-col items-end gap-3", children: [