@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.
- package/dist/ChatRoot-2WNYE2V5.mjs +5 -0
- package/dist/{ChatRoot-DYMCNGOB.mjs.map → ChatRoot-2WNYE2V5.mjs.map} +1 -1
- package/dist/ChatRoot-AD2JIUIU.cjs +14 -0
- package/dist/{ChatRoot-HOQ37WRE.cjs.map → ChatRoot-AD2JIUIU.cjs.map} +1 -1
- package/dist/{chunk-2SKR4U5S.cjs → chunk-A6DDYQQV.cjs} +17 -2
- package/dist/chunk-A6DDYQQV.cjs.map +1 -0
- package/dist/{chunk-MVAT6OPZ.mjs → chunk-KSBMKHYY.mjs} +18 -3
- package/dist/chunk-KSBMKHYY.mjs.map +1 -0
- package/dist/index.cjs +47 -47
- package/dist/index.mjs +3 -3
- package/package.json +6 -6
- package/src/tools/Chat/components/MessageList.tsx +33 -0
- package/dist/ChatRoot-DYMCNGOB.mjs +0 -5
- package/dist/ChatRoot-HOQ37WRE.cjs +0 -14
- package/dist/chunk-2SKR4U5S.cjs.map +0 -1
- package/dist/chunk-MVAT6OPZ.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"ChatRoot-
|
|
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-
|
|
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-
|
|
2411
|
-
//# sourceMappingURL=chunk-
|
|
2425
|
+
//# sourceMappingURL=chunk-A6DDYQQV.cjs.map
|
|
2426
|
+
//# sourceMappingURL=chunk-A6DDYQQV.cjs.map
|