@djangocfg/ui-tools 2.1.371 → 2.1.372

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.
@@ -0,0 +1,5 @@
1
+ export { ChatRoot } from './chunk-KSBMKHYY.mjs';
2
+ import './chunk-NWUT327A.mjs';
3
+ import './chunk-N2XQF2OL.mjs';
4
+ //# sourceMappingURL=ChatRoot-2WNYE2V5.mjs.map
5
+ //# sourceMappingURL=ChatRoot-2WNYE2V5.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"ChatRoot-DYMCNGOB.mjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"ChatRoot-2WNYE2V5.mjs"}
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ var chunkA6DDYQQV_cjs = require('./chunk-A6DDYQQV.cjs');
4
+ require('./chunk-XACCHZH2.cjs');
5
+ require('./chunk-OLISEQHS.cjs');
6
+
7
+
8
+
9
+ Object.defineProperty(exports, "ChatRoot", {
10
+ enumerable: true,
11
+ get: function () { return chunkA6DDYQQV_cjs.ChatRoot; }
12
+ });
13
+ //# sourceMappingURL=ChatRoot-AD2JIUIU.cjs.map
14
+ //# sourceMappingURL=ChatRoot-AD2JIUIU.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"ChatRoot-HOQ37WRE.cjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"ChatRoot-AD2JIUIU.cjs"}
@@ -2158,6 +2158,7 @@ var MessageList = react.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(func
2158
2158
  const isLoadingMore = isLoadingMoreProp ?? ctx?.isLoadingMore ?? false;
2159
2159
  const { copyToClipboard } = hooks.useCopy();
2160
2160
  const virtuosoRef = react.useRef(null);
2161
+ const didInitialScrollRef = react.useRef(false);
2161
2162
  react.useImperativeHandle(
2162
2163
  ref,
2163
2164
  () => ({
@@ -2190,6 +2191,19 @@ var MessageList = react.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(func
2190
2191
  [itemClassName, ctx, copyToClipboard]
2191
2192
  );
2192
2193
  const itemRenderer = renderItem ?? defaultRenderItem;
2194
+ react.useEffect(() => {
2195
+ if (didInitialScrollRef.current) return;
2196
+ if (messages.length === 0) return;
2197
+ didInitialScrollRef.current = true;
2198
+ const id = requestAnimationFrame(() => {
2199
+ virtuosoRef.current?.scrollToIndex({
2200
+ index: "LAST",
2201
+ align: "end",
2202
+ behavior: "auto"
2203
+ });
2204
+ });
2205
+ return () => cancelAnimationFrame(id);
2206
+ }, [messages.length]);
2193
2207
  const computeItemKey = react.useCallback(
2194
2208
  (index, m) => m?.id ?? index,
2195
2209
  []
@@ -2248,6 +2262,7 @@ var MessageList = react.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(func
2248
2262
  computeItemKey,
2249
2263
  itemContent: (index, m) => m ? itemRenderer(m, index) : null,
2250
2264
  defaultItemHeight,
2265
+ initialTopMostItemIndex: messages.length > 0 ? messages.length - 1 : 0,
2251
2266
  followOutput: (isAtBottom) => isAtBottom ? "auto" : false,
2252
2267
  atBottomStateChange: onAtBottomChange,
2253
2268
  alignToBottom: true,
@@ -2407,5 +2422,5 @@ exports.useChatComposer = useChatComposer;
2407
2422
  exports.useChatContext = useChatContext;
2408
2423
  exports.useChatContextOptional = useChatContextOptional;
2409
2424
  exports.useChatLayout = useChatLayout;
2410
- //# sourceMappingURL=chunk-2SKR4U5S.cjs.map
2411
- //# sourceMappingURL=chunk-2SKR4U5S.cjs.map
2425
+ //# sourceMappingURL=chunk-A6DDYQQV.cjs.map
2426
+ //# sourceMappingURL=chunk-A6DDYQQV.cjs.map