@webless/agent 0.6.9 → 0.6.10

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/embed.cjs CHANGED
@@ -3778,7 +3778,14 @@ function BookingCard({
3778
3778
  const [startTime, setStartTime] = (0, import_react7.useState)("");
3779
3779
  const [name, setName] = (0, import_react7.useState)("");
3780
3780
  const [email, setEmail] = (0, import_react7.useState)("");
3781
+ const activeStepRef = (0, import_react7.useRef)(null);
3782
+ const previousStepRef = (0, import_react7.useRef)(step);
3781
3783
  const stepIndex = BOOKING_STEPS.findIndex((item) => item.id === step);
3784
+ (0, import_react7.useEffect)(() => {
3785
+ if (previousStepRef.current === step) return;
3786
+ previousStepRef.current = step;
3787
+ activeStepRef.current?.scrollIntoView({ block: "nearest" });
3788
+ }, [step]);
3782
3789
  const slots = (0, import_react7.useMemo)(
3783
3790
  () => bookingSlotsForEventType(offer.slots, eventTypeUri),
3784
3791
  [eventTypeUri, offer.slots]
@@ -3872,7 +3879,7 @@ function BookingCard({
3872
3879
  },
3873
3880
  item.id
3874
3881
  )) }),
3875
- step === "date" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "booking-card__step", children: [
3882
+ step === "date" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "booking-card__step", ref: activeStepRef, children: [
3876
3883
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "booking-card__title", children: selectedType?.name || "Pick a date" }),
3877
3884
  timeZone ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { className: "booking-card__tz", children: [
3878
3885
  "Times in ",
@@ -3962,7 +3969,7 @@ function BookingCard({
3962
3969
  }
3963
3970
  )
3964
3971
  ] }, "date") : null,
3965
- step === "time" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "booking-card__step", children: [
3972
+ step === "time" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "booking-card__step", ref: activeStepRef, children: [
3966
3973
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "booking-card__step-bar", children: [
3967
3974
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
3968
3975
  "button",
@@ -3993,7 +4000,7 @@ function BookingCard({
3993
4000
  slot.startTime
3994
4001
  )) })
3995
4002
  ] }, "time") : null,
3996
- step === "details" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "booking-card__step", children: [
4003
+ step === "details" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "booking-card__step", ref: activeStepRef, children: [
3997
4004
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "booking-card__step-bar", children: [
3998
4005
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
3999
4006
  "button",