@galaxycore/ai-chat 0.5.0 → 0.7.0
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/CHANGELOG.md +15 -0
- package/README.md +1 -1
- package/dist/headless.d.ts +2 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +69 -20
- package/dist/index.js.map +1 -1
- package/dist/{labels-D8smv23O.d.ts → labels-a_-_yLBi.d.ts} +9 -3
- package/dist/styles.css +1 -0
- package/dist/targeting.css +205 -0
- package/dist/targeting.d.ts +101 -0
- package/dist/targeting.js +585 -0
- package/dist/targeting.js.map +1 -0
- package/docs/api-reference.md +2 -1
- package/docs/publishing.md +9 -9
- package/docs/streaming.md +27 -1
- package/docs/validation.md +23 -0
- package/package.json +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
- Keep following streamed replies through consecutive layout changes. Deliberate upward scrolling still pauses following.
|
|
6
|
+
- Add an optional `scrollRef` to reveal an element or text range inside the message viewport.
|
|
7
|
+
|
|
8
|
+
## 0.6.0
|
|
9
|
+
|
|
10
|
+
- 新增可选的页面指向:划选文字、双击段落、在图片上拖出区域,都可以变成聊天上下文引用。公开入口是 `useChatTargeting`、`ChatTargetingOverlay`、`toChatContextItem`,以及中英文文案;主入口和 `/targeting` 都会导出。
|
|
11
|
+
- 指向样式随主样式表引入,并单独输出 `dist/targeting.css`。
|
|
12
|
+
- 输入框按 Escape 会失焦,方便宿主关掉指向层。不挂载这套能力时,原有发送、附件和界面保持不变。
|
|
13
|
+
|
|
14
|
+
## @galaxycore/ai-chat-gateway 0.2.0
|
|
15
|
+
|
|
16
|
+
- Upgraded `@earendil-works/pi-agent-core` and `@earendil-works/pi-ai` from 1.1.0 to 1.4.0. The gateway uses none of the APIs those releases changed; see the Pi changelogs for added providers, client identity and retry fixes.
|
|
17
|
+
|
|
3
18
|
## 0.5.0
|
|
4
19
|
|
|
5
20
|
- Assistant text now renders Markdown by default, including headings, lists, tables and fenced code, using the existing streaming renderer. User input remains literal text.
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
GalaxyCore 通用 React AI 聊天组件。默认界面借鉴 Chrome AI 侧栏和 Codex 的消息阅读、工具状态与输入区布局,使用 Lucide 图标;支持完整面板、组合组件和 headless Hook。不同业务系统可分别适配文档、表格、图表或编辑器上下文,也可以使用自己的主题与组件库。
|
|
4
4
|
|
|
5
|
-
**当前版本:UI 包 0.
|
|
5
|
+
**当前版本:UI 包 0.7.0,网关包 0.2.0。** UI 提供平滑流式展示、历史会话菜单、页面指向、语音输入、可部署示例和交互文档站。独立 Node 网关通过 pi core 实现流式文本、服务端工具调用、停止和持久化会话恢复。Codex 已预留运行时扩展接口,尚未实现其桥接。发布验收与真实模型联调状态见 [验证记录](docs/validation.md)。
|
|
6
6
|
|
|
7
7
|
## 本地运行
|
|
8
8
|
|
package/dist/headless.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
2
|
import { ChatContextAdapter, ChatContextController, ChatContextItem, ChatContextOptions, ChatContextValue, ChatRequestContext, SelectedChatContextItem, TextSelectionAdapterOptions, createTextSelectionAdapter, useChatContext } from "./context.js";
|
|
3
3
|
import { SpeechInputAdapter, SpeechInputController, SpeechInputError, SpeechInputOptions, SpeechInputResult, SpeechInputSession, SpeechInputStartOptions, createBrowserSpeechAdapter, defaultSpeechInputLabels, useSpeechInput } from "./voice.js";
|
|
4
|
-
import { C as
|
|
5
|
-
export { type AiChatController, type AiChatOptions, type AiChatProps, type AttachmentOptions, type ChatComposerProps, type ChatContextAdapter, type ChatContextController, type ChatContextItem, type ChatContextOptions, type ChatContextValue, type ChatLabels, type ChatMessageActionContext, type ChatMessagesProps, type ChatPanelProps, type ChatRequestContext, type ChatSuggestedAction, type PartRendererProps, type PartRenderers, type SelectedChatContextItem, type SpeechInputAdapter, type SpeechInputController, SpeechInputError, type SpeechInputOptions, type SpeechInputResult, type SpeechInputSession, type SpeechInputStartOptions, type TextRenderer, type TextSelectionAdapterOptions, type ToolPart, type ToolPresentation, type ToolPresentationResolver, type ToolRenderers, acceptsFile, createBrowserSpeechAdapter, createTextSelectionAdapter, defaultSpeechInputLabels, enUS, getMessageText, safeUrl, useAiChat, useChatContext, useSpeechInput, zhCN };
|
|
4
|
+
import { C as ToolPresentationResolver, S as ToolPresentation, _ as ChatSuggestedAction, a as safeUrl, b as TextRenderer, c as AiChatOptions, d as ChatComposerProps, f as ChatLabels, g as ChatScrollHandle, h as ChatPanelProps, i as getMessageText, l as AiChatProps, m as ChatMessagesProps, n as zhCN, o as useAiChat, p as ChatMessageActionContext, r as acceptsFile, s as AiChatController, t as enUS, u as AttachmentOptions, v as PartRendererProps, w as ToolRenderers, x as ToolPart, y as PartRenderers } from "./labels-a_-_yLBi.js";
|
|
5
|
+
export { type AiChatController, type AiChatOptions, type AiChatProps, type AttachmentOptions, type ChatComposerProps, type ChatContextAdapter, type ChatContextController, type ChatContextItem, type ChatContextOptions, type ChatContextValue, type ChatLabels, type ChatMessageActionContext, type ChatMessagesProps, type ChatPanelProps, type ChatRequestContext, type ChatScrollHandle, type ChatSuggestedAction, type PartRendererProps, type PartRenderers, type SelectedChatContextItem, type SpeechInputAdapter, type SpeechInputController, SpeechInputError, type SpeechInputOptions, type SpeechInputResult, type SpeechInputSession, type SpeechInputStartOptions, type TextRenderer, type TextSelectionAdapterOptions, type ToolPart, type ToolPresentation, type ToolPresentationResolver, type ToolRenderers, acceptsFile, createBrowserSpeechAdapter, createTextSelectionAdapter, defaultSpeechInputLabels, enUS, getMessageText, safeUrl, useAiChat, useChatContext, useSpeechInput, zhCN };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { a as ChatIconName, c as Icon, i as ChatAppearanceProviderProps, n as ChatIconButtonProps, o as ChatIconOverrides, r as ChatAppearanceProvider, s as ChatIconProps, t as ChatIconButton } from "./appearance-BUtKwRL5.js";
|
|
3
3
|
import { ChatContextAdapter, ChatContextController, ChatContextItem, ChatContextOptions, ChatContextValue, ChatRequestContext, ContextTray, ContextTrayLabels, ContextTrayProps, SelectedChatContextItem, TextSelectionAdapterOptions, createTextSelectionAdapter, useChatContext } from "./context.js";
|
|
4
4
|
import { SpeechInputAdapter, SpeechInputController, SpeechInputError, SpeechInputErrorCode, SpeechInputLabels, SpeechInputOptions, SpeechInputResult, SpeechInputSession, SpeechInputStartOptions, SpeechInputState, SpeechInputSupport, UseSpeechInputOptions, createBrowserSpeechAdapter, defaultSpeechInputLabels, useSpeechInput } from "./voice.js";
|
|
5
|
-
import { C as
|
|
5
|
+
import { C as ToolPresentationResolver, S as ToolPresentation, _ as ChatSuggestedAction, b as TextRenderer, c as AiChatOptions, d as ChatComposerProps, f as ChatLabels, g as ChatScrollHandle, h as ChatPanelProps, i as getMessageText, l as AiChatProps, m as ChatMessagesProps, n as zhCN, o as useAiChat, p as ChatMessageActionContext, s as AiChatController, t as enUS, u as AttachmentOptions, v as PartRendererProps, w as ToolRenderers, x as ToolPart, y as PartRenderers } from "./labels-a_-_yLBi.js";
|
|
6
|
+
import { ActiveMarquee, ChatTargetHit, ChatTargetKind, ChatTargetRect, ChatTargetingController, ChatTargetingLabels, ChatTargetingOverlay, ChatTargetingOverlayProps, PendingChatTarget, UseChatTargetingOptions, enUSTargetingLabels, toChatContextItem, useChatTargeting, zhCNTargetingLabels } from "./targeting.js";
|
|
6
7
|
import { HTMLAttributes, ReactNode } from "react";
|
|
7
8
|
import { UIMessage } from "ai";
|
|
8
9
|
//#region src/ai-chat.d.ts
|
|
@@ -59,5 +60,5 @@ export declare function ChatHistoryMenu({ conversations, currentId, onSelect, on
|
|
|
59
60
|
/** Drafts and upload requests are isolated by conversation id. */
|
|
60
61
|
export declare function ChatComposer<M extends UIMessage = UIMessage>(props: ChatComposerProps<M>): import("react").JSX.Element;
|
|
61
62
|
//#endregion
|
|
62
|
-
export { type AiChatController, type AiChatOptions, type AiChatProps, type AttachmentOptions, ChatAppearanceProvider, type ChatAppearanceProviderProps, type ChatComposerProps, type ChatContextAdapter, type ChatContextController, type ChatContextItem, type ChatContextOptions, type ChatContextValue, type ChatHistoryItem, type ChatHistoryLabels, type ChatHistoryMenuProps, Icon as ChatIcon, ChatIconButton, type ChatIconButtonProps, type ChatIconName, type ChatIconOverrides, type ChatIconProps, type ChatLabels, type ChatMessageActionContext, type ChatMessagesProps, type ChatPanelProps, type ChatRequestContext, type ChatSuggestedAction, ContextTray, type ContextTrayLabels, type ContextTrayProps, type PartRendererProps, type PartRenderers, type SelectedChatContextItem, type SpeechInputAdapter, type SpeechInputController, SpeechInputError, type SpeechInputErrorCode, type SpeechInputLabels, type SpeechInputOptions, type SpeechInputResult, type SpeechInputSession, type SpeechInputStartOptions, type SpeechInputState, type SpeechInputSupport, type TextRenderer, type TextSelectionAdapterOptions, type ToolPart, type ToolPresentation, type ToolPresentationResolver, type ToolRenderers, type UseSpeechInputOptions, createBrowserSpeechAdapter, createTextSelectionAdapter, defaultSpeechInputLabels, enUS, getMessageText, useAiChat, useChatContext, useSpeechInput, zhCN };
|
|
63
|
+
export { type ActiveMarquee, type AiChatController, type AiChatOptions, type AiChatProps, type AttachmentOptions, ChatAppearanceProvider, type ChatAppearanceProviderProps, type ChatComposerProps, type ChatContextAdapter, type ChatContextController, type ChatContextItem, type ChatContextOptions, type ChatContextValue, type ChatHistoryItem, type ChatHistoryLabels, type ChatHistoryMenuProps, Icon as ChatIcon, ChatIconButton, type ChatIconButtonProps, type ChatIconName, type ChatIconOverrides, type ChatIconProps, type ChatLabels, type ChatMessageActionContext, type ChatMessagesProps, type ChatPanelProps, type ChatRequestContext, type ChatScrollHandle, type ChatSuggestedAction, type ChatTargetHit, type ChatTargetKind, type ChatTargetRect, type ChatTargetingController, type ChatTargetingLabels, ChatTargetingOverlay, type ChatTargetingOverlayProps, ContextTray, type ContextTrayLabels, type ContextTrayProps, type PartRendererProps, type PartRenderers, type PendingChatTarget, type SelectedChatContextItem, type SpeechInputAdapter, type SpeechInputController, SpeechInputError, type SpeechInputErrorCode, type SpeechInputLabels, type SpeechInputOptions, type SpeechInputResult, type SpeechInputSession, type SpeechInputStartOptions, type SpeechInputState, type SpeechInputSupport, type TextRenderer, type TextSelectionAdapterOptions, type ToolPart, type ToolPresentation, type ToolPresentationResolver, type ToolRenderers, type UseChatTargetingOptions, type UseSpeechInputOptions, createBrowserSpeechAdapter, createTextSelectionAdapter, defaultSpeechInputLabels, enUS, enUSTargetingLabels, getMessageText, toChatContextItem, useAiChat, useChatContext, useChatTargeting, useSpeechInput, zhCN, zhCNTargetingLabels };
|
|
63
64
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,8 @@ import { SpeechInputError, createBrowserSpeechAdapter, defaultSpeechInputLabels,
|
|
|
7
7
|
import { MarkdownResponse } from "./markdown.js";
|
|
8
8
|
import { ContextTray, createTextSelectionAdapter, useChatContext } from "./context.js";
|
|
9
9
|
import "./appearance.js";
|
|
10
|
-
import {
|
|
10
|
+
import { ChatTargetingOverlay, enUSTargetingLabels, toChatContextItem, useChatTargeting, zhCNTargetingLabels } from "./targeting.js";
|
|
11
|
+
import { useCallback, useEffect, useId, useImperativeHandle, useLayoutEffect, useRef, useState } from "react";
|
|
11
12
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
13
|
import { isToolUIPart } from "ai";
|
|
13
14
|
//#region src/chat-composer.tsx
|
|
@@ -291,6 +292,10 @@ function Composer({ chat, labels: overrides, attachments, speech, toolbar, conte
|
|
|
291
292
|
}
|
|
292
293
|
},
|
|
293
294
|
onKeyDown: (event) => {
|
|
295
|
+
if (event.key === "Escape" && !event.nativeEvent.isComposing && event.keyCode !== 229) {
|
|
296
|
+
event.currentTarget.blur();
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
294
299
|
if (event.key === "Enter" && !event.shiftKey && !event.nativeEvent.isComposing && event.keyCode !== 229) {
|
|
295
300
|
event.preventDefault();
|
|
296
301
|
send();
|
|
@@ -551,8 +556,8 @@ function useMessageScroll(messages) {
|
|
|
551
556
|
const frame = useRef(void 0);
|
|
552
557
|
const previousTime = useRef(void 0);
|
|
553
558
|
const lastTop = useRef(0);
|
|
554
|
-
const lastMaximum = useRef(0);
|
|
555
559
|
const writtenTop = useRef(void 0);
|
|
560
|
+
const endScrollbarGesture = useRef(void 0);
|
|
556
561
|
const touchY = useRef(void 0);
|
|
557
562
|
const previousMessages = useRef(messages.map(({ id }) => id));
|
|
558
563
|
const [awayFromBottom, setAwayFromBottom] = useState(false);
|
|
@@ -566,7 +571,6 @@ function useMessageScroll(messages) {
|
|
|
566
571
|
if (!element) return;
|
|
567
572
|
if (Math.abs(element.scrollTop - top) > .5) element.scrollTop = top;
|
|
568
573
|
writtenTop.current = lastTop.current = element.scrollTop;
|
|
569
|
-
lastMaximum.current = Math.max(0, element.scrollHeight - element.clientHeight);
|
|
570
574
|
}, []);
|
|
571
575
|
const schedule = useCallback(() => {
|
|
572
576
|
if (!following.current || frame.current !== void 0) return;
|
|
@@ -602,15 +606,39 @@ function useMessageScroll(messages) {
|
|
|
602
606
|
cancel();
|
|
603
607
|
setAwayFromBottom(true);
|
|
604
608
|
}, [cancel]);
|
|
609
|
+
const reveal = useCallback((target) => {
|
|
610
|
+
const element = scroller.current;
|
|
611
|
+
const node = "commonAncestorContainer" in target ? target.commonAncestorContainer : target;
|
|
612
|
+
if (!element || !content.current?.contains(node) || !element.offsetHeight) return false;
|
|
613
|
+
const viewport = element.getBoundingClientRect();
|
|
614
|
+
const bounds = target.getBoundingClientRect();
|
|
615
|
+
const scale = viewport.height / element.offsetHeight;
|
|
616
|
+
if (!scale || bounds.height <= 0) return false;
|
|
617
|
+
const viewportTop = viewport.top + element.clientTop * scale;
|
|
618
|
+
const viewportHeight = element.clientHeight * scale;
|
|
619
|
+
if (bounds.top >= viewportTop && bounds.bottom <= viewportTop + viewportHeight) return false;
|
|
620
|
+
const centerOffset = Math.max(0, (viewportHeight - bounds.height) / 2);
|
|
621
|
+
const previousTop = element.scrollTop;
|
|
622
|
+
const desiredTop = previousTop + (bounds.top - viewportTop - centerOffset) / scale;
|
|
623
|
+
const top = Math.max(0, Math.min(desiredTop, element.scrollHeight - element.clientHeight));
|
|
624
|
+
if (Math.abs(top - previousTop) <= .5) return false;
|
|
625
|
+
write(top);
|
|
626
|
+
if (element.scrollTop === previousTop) return false;
|
|
627
|
+
pause();
|
|
628
|
+
return true;
|
|
629
|
+
}, [pause, write]);
|
|
605
630
|
useClientLayoutEffect(() => {
|
|
606
631
|
scrollToLatest();
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
632
|
+
let observer;
|
|
633
|
+
if (scroller.current && content.current && typeof ResizeObserver !== "undefined") {
|
|
634
|
+
observer = new ResizeObserver(schedule);
|
|
635
|
+
observer.observe(content.current);
|
|
636
|
+
observer.observe(scroller.current);
|
|
637
|
+
}
|
|
611
638
|
return () => {
|
|
612
|
-
observer
|
|
639
|
+
observer?.disconnect();
|
|
613
640
|
cancel();
|
|
641
|
+
endScrollbarGesture.current?.();
|
|
614
642
|
};
|
|
615
643
|
}, [
|
|
616
644
|
scrollToLatest,
|
|
@@ -639,15 +667,9 @@ function useMessageScroll(messages) {
|
|
|
639
667
|
lastTop.current = top;
|
|
640
668
|
if (writtenTop.current !== void 0 && Math.abs(top - writtenTop.current) < 1) return;
|
|
641
669
|
writtenTop.current = void 0;
|
|
642
|
-
const maximum = Math.max(0, element.scrollHeight - element.clientHeight);
|
|
643
|
-
if (following.current && maximum < lastMaximum.current && top >= maximum - 1) {
|
|
644
|
-
lastMaximum.current = maximum;
|
|
645
|
-
schedule();
|
|
646
|
-
return;
|
|
647
|
-
}
|
|
648
|
-
lastMaximum.current = maximum;
|
|
649
670
|
if (top < previous - 1) {
|
|
650
|
-
pause();
|
|
671
|
+
if (endScrollbarGesture.current) pause();
|
|
672
|
+
else schedule();
|
|
651
673
|
return;
|
|
652
674
|
}
|
|
653
675
|
if (top > previous && element.scrollHeight - top - element.clientHeight <= 4) {
|
|
@@ -656,6 +678,29 @@ function useMessageScroll(messages) {
|
|
|
656
678
|
schedule();
|
|
657
679
|
}
|
|
658
680
|
}
|
|
681
|
+
function onPointerDown(event) {
|
|
682
|
+
if (event.target !== event.currentTarget || event.button !== 0 || event.pointerType === "touch") return;
|
|
683
|
+
endScrollbarGesture.current?.();
|
|
684
|
+
const document = event.currentTarget.ownerDocument;
|
|
685
|
+
const view = document.defaultView;
|
|
686
|
+
const pointerId = event.pointerId;
|
|
687
|
+
let releaseFrame;
|
|
688
|
+
const cleanup = () => {
|
|
689
|
+
document.removeEventListener("pointerup", release, true);
|
|
690
|
+
document.removeEventListener("pointercancel", release, true);
|
|
691
|
+
view?.removeEventListener("blur", cleanup);
|
|
692
|
+
if (releaseFrame !== void 0) cancelAnimationFrame(releaseFrame);
|
|
693
|
+
endScrollbarGesture.current = void 0;
|
|
694
|
+
};
|
|
695
|
+
const release = (event) => {
|
|
696
|
+
if (event.pointerId !== pointerId || releaseFrame !== void 0) return;
|
|
697
|
+
releaseFrame = requestAnimationFrame(cleanup);
|
|
698
|
+
};
|
|
699
|
+
endScrollbarGesture.current = cleanup;
|
|
700
|
+
document.addEventListener("pointerup", release, true);
|
|
701
|
+
document.addEventListener("pointercancel", release, true);
|
|
702
|
+
view?.addEventListener("blur", cleanup);
|
|
703
|
+
}
|
|
659
704
|
function consumedByNestedScroll(event) {
|
|
660
705
|
let target = event.target instanceof Element ? event.target : null;
|
|
661
706
|
while (target && target !== event.currentTarget) {
|
|
@@ -689,8 +734,10 @@ function useMessageScroll(messages) {
|
|
|
689
734
|
content,
|
|
690
735
|
awayFromBottom,
|
|
691
736
|
scrollToLatest,
|
|
737
|
+
reveal,
|
|
692
738
|
scrollEvents: {
|
|
693
739
|
onScroll,
|
|
740
|
+
onPointerDown,
|
|
694
741
|
onWheel,
|
|
695
742
|
onTouchStart,
|
|
696
743
|
onTouchMove,
|
|
@@ -792,9 +839,10 @@ function StreamingText({ text, isStreaming, enabled = true, renderText }) {
|
|
|
792
839
|
function ChatMessages(props) {
|
|
793
840
|
return /* @__PURE__ */ jsx(Messages, { ...props }, props.chat.id);
|
|
794
841
|
}
|
|
795
|
-
function Messages({ chat, labels: labelOverrides, renderText, smoothStreaming = true, renderers, tools, toolPresentation, suggestedActions, suggestionsTitle, suggestionsDescription, renderMessageActions, renderMessageHeader, empty, className, requestOptions, onActionError, capabilities }) {
|
|
842
|
+
function Messages({ chat, labels: labelOverrides, renderText, smoothStreaming = true, scrollRef, renderers, tools, toolPresentation, suggestedActions, suggestionsTitle, suggestionsDescription, renderMessageActions, renderMessageHeader, empty, className, requestOptions, onActionError, capabilities }) {
|
|
796
843
|
const labels = resolveLabels(labelOverrides);
|
|
797
|
-
const { scroller, content, awayFromBottom, scrollToLatest, scrollEvents } = useMessageScroll(chat.messages);
|
|
844
|
+
const { scroller, content, awayFromBottom, scrollToLatest, reveal, scrollEvents } = useMessageScroll(chat.messages);
|
|
845
|
+
useImperativeHandle(scrollRef, () => ({ reveal }), [reveal]);
|
|
798
846
|
const copyTimeout = useRef(void 0);
|
|
799
847
|
const actionInFlight = useRef(false);
|
|
800
848
|
const [copiedId, setCopiedId] = useState();
|
|
@@ -1130,7 +1178,7 @@ function Messages({ chat, labels: labelOverrides, renderText, smoothStreaming =
|
|
|
1130
1178
|
function ChatPanel(props) {
|
|
1131
1179
|
return /* @__PURE__ */ jsx(Panel, { ...props }, props.chat.id);
|
|
1132
1180
|
}
|
|
1133
|
-
function Panel({ chat, labels: labelOverrides, title, subtitle, headerIcon, header, headerActions, footer, composer, composerProps, theme = "auto", variant = "panel", density = "comfortable", capabilities, className, renderText, smoothStreaming, renderers, tools, toolPresentation, suggestedActions, suggestionsTitle, suggestionsDescription, renderMessageActions, renderMessageHeader, empty, requestOptions, onActionError, ...elementProps }) {
|
|
1181
|
+
function Panel({ chat, labels: labelOverrides, title, subtitle, headerIcon, header, headerActions, footer, composer, composerProps, theme = "auto", variant = "panel", density = "comfortable", capabilities, className, renderText, smoothStreaming, scrollRef, renderers, tools, toolPresentation, suggestedActions, suggestionsTitle, suggestionsDescription, renderMessageActions, renderMessageHeader, empty, requestOptions, onActionError, ...elementProps }) {
|
|
1134
1182
|
const labels = resolveLabels(labelOverrides);
|
|
1135
1183
|
const [retrying, setRetrying] = useState(false);
|
|
1136
1184
|
const [retryError, setRetryError] = useState();
|
|
@@ -1193,6 +1241,7 @@ function Panel({ chat, labels: labelOverrides, title, subtitle, headerIcon, head
|
|
|
1193
1241
|
labels: labelOverrides,
|
|
1194
1242
|
renderText,
|
|
1195
1243
|
smoothStreaming,
|
|
1244
|
+
scrollRef,
|
|
1196
1245
|
renderers,
|
|
1197
1246
|
tools,
|
|
1198
1247
|
toolPresentation,
|
|
@@ -1428,6 +1477,6 @@ function ChatHistoryMenu({ conversations, currentId, onSelect, onNewChat, disabl
|
|
|
1428
1477
|
});
|
|
1429
1478
|
}
|
|
1430
1479
|
//#endregion
|
|
1431
|
-
export { AiChat, ChatAppearanceProvider, ChatComposer, ChatHistoryMenu, Icon as ChatIcon, ChatIconButton, ChatMessages, ChatPanel, ContextTray, SpeechInputError, createBrowserSpeechAdapter, createTextSelectionAdapter, defaultSpeechInputLabels, enUS, getMessageText, useAiChat, useChatContext, useSpeechInput, zhCN };
|
|
1480
|
+
export { AiChat, ChatAppearanceProvider, ChatComposer, ChatHistoryMenu, Icon as ChatIcon, ChatIconButton, ChatMessages, ChatPanel, ChatTargetingOverlay, ContextTray, SpeechInputError, createBrowserSpeechAdapter, createTextSelectionAdapter, defaultSpeechInputLabels, enUS, enUSTargetingLabels, getMessageText, toChatContextItem, useAiChat, useChatContext, useChatTargeting, useSpeechInput, zhCN, zhCNTargetingLabels };
|
|
1432
1481
|
|
|
1433
1482
|
//# sourceMappingURL=index.js.map
|