@swift-food-services/catering-widget 0.2.0-beta.0 → 0.2.0-beta.1

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.cjs CHANGED
@@ -4472,6 +4472,9 @@ styleInject(`/*! tailwindcss v4.2.4 | MIT License | https://tailwindcss.com */
4472
4472
  .swift-catering-widget .overflow-y-auto {
4473
4473
  overflow-y: auto;
4474
4474
  }
4475
+ .swift-catering-widget .overscroll-contain {
4476
+ overscroll-behavior: contain;
4477
+ }
4475
4478
  .swift-catering-widget .overscroll-none {
4476
4479
  overscroll-behavior: none;
4477
4480
  }
@@ -16819,7 +16822,7 @@ function AIChatBody() {
16819
16822
  await applyEditField(field, value, idx);
16820
16823
  }
16821
16824
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "swift-chat-design bg-white rounded-xl shadow-sm border border-base-200 flex h-full min-h-0 flex-col overflow-hidden", children: [
16822
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 py-2.5 flex items-center gap-3 border-b border-base-200", children: [
16825
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-shrink-0 px-3 py-2.5 flex items-center gap-3 border-b border-base-200", children: [
16823
16826
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-9 h-9 rounded-full bg-primary flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sparkles, { className: "w-4 h-4 text-white" }) }),
16824
16827
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
16825
16828
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-semibold text-gray-800", children: "AI Assistant" }),
@@ -16857,7 +16860,7 @@ function AIChatBody() {
16857
16860
  {
16858
16861
  ref: messagesScrollRef,
16859
16862
  onScroll: handleMessagesScroll,
16860
- className: "absolute inset-0 overflow-y-auto p-3",
16863
+ className: "absolute inset-0 overflow-y-auto overscroll-contain p-3",
16861
16864
  children: /* @__PURE__ */ jsxRuntime.jsx(ChatMessagesView, {})
16862
16865
  }
16863
16866
  ),
@@ -16877,8 +16880,8 @@ function AIChatBody() {
16877
16880
  }
16878
16881
  ) })
16879
16882
  ] }),
16880
- actionChips.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-base-200 px-3 py-2", children: /* @__PURE__ */ jsxRuntime.jsx(ChipGroup, { chips: actionChips, onAction: handleChipClick }) }),
16881
- missingFields && missingFields.fields.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
16883
+ actionChips.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0 border-t border-base-200 px-3 py-2", children: /* @__PURE__ */ jsxRuntime.jsx(ChipGroup, { chips: actionChips, onAction: handleChipClick }) }),
16884
+ missingFields && missingFields.fields.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(
16882
16885
  MissingFieldsClarifier,
16883
16886
  {
16884
16887
  missing: missingFields,
@@ -16891,8 +16894,8 @@ function AIChatBody() {
16891
16894
  setEditValue(void 0);
16892
16895
  }
16893
16896
  }
16894
- ),
16895
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-base-200 p-2.5", children: /* @__PURE__ */ jsxRuntime.jsx(react$1.AnimatePresence, { mode: "wait", initial: false, children: editField !== null ? /* @__PURE__ */ jsxRuntime.jsx(
16897
+ ) }),
16898
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0 border-t border-base-200 p-2.5", children: /* @__PURE__ */ jsxRuntime.jsx(react$1.AnimatePresence, { mode: "wait", initial: false, children: editField !== null ? /* @__PURE__ */ jsxRuntime.jsx(
16896
16899
  react$1.motion.div,
16897
16900
  {
16898
16901
  initial: { opacity: 0, y: 8 },
@@ -19836,10 +19839,27 @@ function resolveDraftItems(mealSessionParts, aiMealSessions, activeMealSessionIn
19836
19839
  function SuggestionsOverlay({ onClose }) {
19837
19840
  const { stickyTopOffset = 0 } = useCateringConfig();
19838
19841
  react.useEffect(() => {
19839
- const prev = document.body.style.overflow;
19840
- document.body.style.overflow = "hidden";
19842
+ const body = document.body;
19843
+ const scrollY = window.scrollY;
19844
+ const prev = {
19845
+ position: body.style.position,
19846
+ top: body.style.top,
19847
+ left: body.style.left,
19848
+ right: body.style.right,
19849
+ width: body.style.width
19850
+ };
19851
+ body.style.position = "fixed";
19852
+ body.style.top = `-${scrollY}px`;
19853
+ body.style.left = "0";
19854
+ body.style.right = "0";
19855
+ body.style.width = "100%";
19841
19856
  return () => {
19842
- document.body.style.overflow = prev;
19857
+ body.style.position = prev.position;
19858
+ body.style.top = prev.top;
19859
+ body.style.left = prev.left;
19860
+ body.style.right = prev.right;
19861
+ body.style.width = prev.width;
19862
+ window.scrollTo(0, scrollY);
19843
19863
  };
19844
19864
  }, []);
19845
19865
  if (typeof document === "undefined") return null;