reachat 2.1.0-alpha.10 → 2.1.0-alpha.12

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
@@ -10,7 +10,7 @@
10
10
  console.error("vite-plugin-css-injected-by-js", e);
11
11
  }
12
12
  })();
13
- import { A, b, c, C, d, e, F, M, j, k, m, n, o, p, q, N, i, w, x, s, t, u, v, y, z, T, g, f, B, h, D, l, r } from "./index-BIrmxgH5.js";
13
+ import { A, b, c, C, d, e, F, M, j, k, m, n, o, p, q, N, i, w, x, s, t, u, v, y, z, T, g, f, B, h, D, l, r } from "./index-l2ncOVPh.js";
14
14
  import "react/jsx-runtime";
15
15
  import "motion/react";
16
16
  import "reablocks";
@@ -2136,7 +2136,8 @@ ${response}`),
2136
2136
  limit = 10,
2137
2137
  className,
2138
2138
  showMoreText = "Show more",
2139
- autoScroll = true
2139
+ autoScroll = true,
2140
+ onScroll
2140
2141
  }) => {
2141
2142
  const { activeSession, theme } = React.useContext(ChatContext);
2142
2143
  const contentRef = React.useRef(null);
@@ -2165,38 +2166,46 @@ ${response}`),
2165
2166
  if (!activeSession) {
2166
2167
  return /* @__PURE__ */ jsxRuntime.jsx(SessionEmpty, { children: newSessionContent });
2167
2168
  }
2168
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: reablocks.cn(theme.messages.content, className), ref: contentRef, children: [
2169
- hasMore && /* @__PURE__ */ jsxRuntime.jsx(
2170
- reablocks.Button,
2171
- {
2172
- variant: "outline",
2173
- className: reablocks.cn(theme.messages.showMore),
2174
- fullWidth: true,
2175
- onClick: handleShowMore,
2176
- children: showMoreText
2177
- }
2178
- ),
2179
- /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { children: /* @__PURE__ */ jsxRuntime.jsx(
2180
- react.motion.div,
2181
- {
2182
- variants: containerVariants,
2183
- initial: "hidden",
2184
- animate: "visible",
2185
- onAnimationComplete: () => {
2186
- requestAnimationFrame(() => setIsAnimating(false));
2187
- },
2188
- children: children ? children(convosToRender) : convosToRender.map((conversation, index) => /* @__PURE__ */ jsxRuntime.jsx(
2189
- SessionMessage,
2169
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2170
+ "div",
2171
+ {
2172
+ className: reablocks.cn(theme.messages.content, className),
2173
+ ref: contentRef,
2174
+ onScrollCapture: onScroll,
2175
+ children: [
2176
+ hasMore && /* @__PURE__ */ jsxRuntime.jsx(
2177
+ reablocks.Button,
2190
2178
  {
2191
- conversation,
2192
- isLast: index === conversation.length - 1
2179
+ variant: "outline",
2180
+ className: reablocks.cn(theme.messages.showMore),
2181
+ fullWidth: true,
2182
+ onClick: handleShowMore,
2183
+ children: showMoreText
2184
+ }
2185
+ ),
2186
+ /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { children: /* @__PURE__ */ jsxRuntime.jsx(
2187
+ react.motion.div,
2188
+ {
2189
+ variants: containerVariants,
2190
+ initial: "hidden",
2191
+ animate: "visible",
2192
+ onAnimationComplete: () => {
2193
+ requestAnimationFrame(() => setIsAnimating(false));
2194
+ },
2195
+ children: children ? children(convosToRender) : convosToRender.map((conversation, index) => /* @__PURE__ */ jsxRuntime.jsx(
2196
+ SessionMessage,
2197
+ {
2198
+ conversation,
2199
+ isLast: index === conversation.length - 1
2200
+ },
2201
+ conversation.id
2202
+ ))
2193
2203
  },
2194
- conversation.id
2195
- ))
2196
- },
2197
- activeSession?.id
2198
- ) })
2199
- ] });
2204
+ activeSession?.id
2205
+ ) })
2206
+ ]
2207
+ }
2208
+ );
2200
2209
  };
2201
2210
  const SessionMessagesHeader = ({ children }) => {
2202
2211
  const { activeSession, theme } = React.useContext(ChatContext);