@gendive/chatllm 0.17.2 → 0.17.3
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/react/index.js +45 -0
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +45 -0
- package/dist/react/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -2588,6 +2588,7 @@ ${currentContextSummary}` },
|
|
|
2588
2588
|
chatMessages = messagesToSend.map((m) => ({ role: m.role, content: m.content }));
|
|
2589
2589
|
}
|
|
2590
2590
|
if (attachmentResults.length > 0 && shouldContinueAfterAttachment) {
|
|
2591
|
+
skipNextSkillParsingRef.current = true;
|
|
2591
2592
|
const attachmentContext = attachmentResults.filter((part) => part.type === "tool_result").map((part) => `[${part.label || part.toolName} \uACB0\uACFC]
|
|
2592
2593
|
${part.result.content}`).join("\n\n");
|
|
2593
2594
|
if (attachmentContext) {
|
|
@@ -8649,9 +8650,26 @@ var MessageList = ({
|
|
|
8649
8650
|
const containerRef = (0, import_react17.useRef)(null);
|
|
8650
8651
|
const [selectedText, setSelectedText] = (0, import_react17.useState)("");
|
|
8651
8652
|
const [selectionPosition, setSelectionPosition] = (0, import_react17.useState)(null);
|
|
8653
|
+
const [showScrollButton, setShowScrollButton] = (0, import_react17.useState)(false);
|
|
8654
|
+
const isUserScrolledUpRef = (0, import_react17.useRef)(false);
|
|
8655
|
+
const SCROLL_THRESHOLD = 100;
|
|
8656
|
+
const handleScroll = (0, import_react17.useCallback)(() => {
|
|
8657
|
+
if (!containerRef.current) return;
|
|
8658
|
+
const { scrollTop, scrollHeight, clientHeight } = containerRef.current;
|
|
8659
|
+
const distanceFromBottom = scrollHeight - scrollTop - clientHeight;
|
|
8660
|
+
const isNearBottom = distanceFromBottom < SCROLL_THRESHOLD;
|
|
8661
|
+
isUserScrolledUpRef.current = !isNearBottom;
|
|
8662
|
+
setShowScrollButton(!isNearBottom);
|
|
8663
|
+
}, []);
|
|
8652
8664
|
(0, import_react17.useEffect)(() => {
|
|
8665
|
+
if (isUserScrolledUpRef.current) return;
|
|
8653
8666
|
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
8654
8667
|
}, [messages]);
|
|
8668
|
+
const scrollToBottom = (0, import_react17.useCallback)(() => {
|
|
8669
|
+
isUserScrolledUpRef.current = false;
|
|
8670
|
+
setShowScrollButton(false);
|
|
8671
|
+
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
8672
|
+
}, []);
|
|
8655
8673
|
const handleMouseUp = (0, import_react17.useCallback)(() => {
|
|
8656
8674
|
const selection = typeof window !== "undefined" ? window.getSelection() : null;
|
|
8657
8675
|
const text = selection?.toString().trim();
|
|
@@ -8696,6 +8714,7 @@ var MessageList = ({
|
|
|
8696
8714
|
overflow: "auto",
|
|
8697
8715
|
position: "relative"
|
|
8698
8716
|
},
|
|
8717
|
+
onScroll: handleScroll,
|
|
8699
8718
|
onMouseUp: handleMouseUp,
|
|
8700
8719
|
children: [
|
|
8701
8720
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
@@ -8748,6 +8767,32 @@ var MessageList = ({
|
|
|
8748
8767
|
]
|
|
8749
8768
|
}
|
|
8750
8769
|
),
|
|
8770
|
+
showScrollButton && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
8771
|
+
"button",
|
|
8772
|
+
{
|
|
8773
|
+
onClick: scrollToBottom,
|
|
8774
|
+
"aria-label": "\uB9E8 \uC544\uB798\uB85C \uC2A4\uD06C\uB864",
|
|
8775
|
+
style: {
|
|
8776
|
+
position: "sticky",
|
|
8777
|
+
bottom: "260px",
|
|
8778
|
+
left: "50%",
|
|
8779
|
+
transform: "translateX(-50%)",
|
|
8780
|
+
width: "40px",
|
|
8781
|
+
height: "40px",
|
|
8782
|
+
borderRadius: "50%",
|
|
8783
|
+
backgroundColor: "var(--chatllm-content-bg)",
|
|
8784
|
+
border: "1px solid var(--chatllm-border)",
|
|
8785
|
+
boxShadow: "0 2px 8px rgba(0,0,0,0.15)",
|
|
8786
|
+
cursor: "pointer",
|
|
8787
|
+
display: "flex",
|
|
8788
|
+
alignItems: "center",
|
|
8789
|
+
justifyContent: "center",
|
|
8790
|
+
zIndex: 10,
|
|
8791
|
+
transition: "opacity 0.2s"
|
|
8792
|
+
},
|
|
8793
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(IconSvg, { name: "arrow-down-s-line", size: 24, color: "var(--chatllm-text-secondary)" })
|
|
8794
|
+
}
|
|
8795
|
+
),
|
|
8751
8796
|
selectionPosition && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
8752
8797
|
"div",
|
|
8753
8798
|
{
|