@2uinc/frontend-component-xpert-chatbot 1.35.8-beta.3 → 1.35.8-beta.4

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.
@@ -20228,21 +20228,21 @@ nu.propTypes = {
20228
20228
  };
20229
20229
  nu.displayName = "PromptList";
20230
20230
  const rd = ({ chatContentRef: e, messages: t }) => {
20231
- const { loading: n } = se(Ze), [r, a] = de(!1), i = pt(() => {
20231
+ const { loading: n, streaming: r } = se(Ze), [a, i] = de(!1), u = pt(() => {
20232
20232
  if (!e.current) return;
20233
- const { scrollTop: s, scrollHeight: l, clientHeight: c } = e.current, d = s + c >= l - 10;
20234
- a(!d);
20235
- }, [e]), u = () => {
20233
+ const { scrollTop: l, scrollHeight: c, clientHeight: d } = e.current, h = l + d >= c - 10;
20234
+ i(!h);
20235
+ }, [e]), s = () => {
20236
20236
  e.current && e.current.scrollTo({
20237
20237
  top: e.current.scrollHeight,
20238
20238
  behavior: "smooth"
20239
20239
  });
20240
20240
  };
20241
20241
  return ke(() => {
20242
- const s = e.current;
20243
- if (s)
20244
- return s.addEventListener("scroll", i), () => s.removeEventListener("scroll", i);
20245
- }, [e, i]), ke(() => {
20242
+ const l = e.current;
20243
+ if (l)
20244
+ return l.addEventListener("scroll", u), () => l.removeEventListener("scroll", u);
20245
+ }, [e, u]), ke(() => {
20246
20246
  e.current && e.current.scrollTo({
20247
20247
  top: e.current.scrollHeight,
20248
20248
  behavior: "smooth"
@@ -20252,10 +20252,10 @@ const rd = ({ chatContentRef: e, messages: t }) => {
20252
20252
  top: e.current.scrollHeight,
20253
20253
  behavior: "smooth"
20254
20254
  });
20255
- }, [n, e]), n ? null : /* @__PURE__ */ v.jsx(v.Fragment, { children: r && t.filter((s) => s.role === "assistant").length > 0 && /* @__PURE__ */ v.jsx(
20255
+ }, [n, e]), n ? null : /* @__PURE__ */ v.jsx(v.Fragment, { children: (a || r) && t.filter((l) => l.role === "assistant").length > 0 && /* @__PURE__ */ v.jsx(
20256
20256
  "button",
20257
20257
  {
20258
- onClick: u,
20258
+ onClick: s,
20259
20259
  className: "xpert_chatbot__scroll-to-last-message-button",
20260
20260
  "aria-label": "Scroll to bottom",
20261
20261
  children: "↓"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@2uinc/frontend-component-xpert-chatbot",
3
- "version": "1.35.8-beta.3",
3
+ "version": "1.35.8-beta.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/2uinc/frontend-component-xpert-chatbot.git"