@springbrand/message-panel 0.1.3-alpha.21 → 0.1.3-alpha.22
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.
|
@@ -444,7 +444,11 @@ export function CloudOsChatMessages({
|
|
|
444
444
|
running={block.running}
|
|
445
445
|
/>
|
|
446
446
|
);
|
|
447
|
-
case "text":
|
|
447
|
+
case "text": {
|
|
448
|
+
const streaming =
|
|
449
|
+
isActive &&
|
|
450
|
+
entryIndex === entries.length - 1 &&
|
|
451
|
+
block === entry.blocks.at(-1);
|
|
448
452
|
return (
|
|
449
453
|
<div
|
|
450
454
|
key={block.key}
|
|
@@ -453,9 +457,11 @@ export function CloudOsChatMessages({
|
|
|
453
457
|
<MarkdownMessage
|
|
454
458
|
message={block.text}
|
|
455
459
|
resolveUrl={resolveUrl}
|
|
460
|
+
streaming={streaming}
|
|
456
461
|
/>
|
|
457
462
|
</div>
|
|
458
463
|
);
|
|
464
|
+
}
|
|
459
465
|
case "toolGroup":
|
|
460
466
|
return (
|
|
461
467
|
<ToolGroupRow
|
|
@@ -94,9 +94,11 @@ const DEFAULT_COMPONENTS: Components = {
|
|
|
94
94
|
export const MarkdownMessage = memo(function MarkdownMessage({
|
|
95
95
|
message,
|
|
96
96
|
resolveUrl,
|
|
97
|
+
streaming = false,
|
|
97
98
|
}: {
|
|
98
99
|
message: string;
|
|
99
100
|
resolveUrl?: CloudOsUrlResolver;
|
|
101
|
+
streaming?: boolean;
|
|
100
102
|
}): ReactNode {
|
|
101
103
|
const rehypePlugins = useMemo(
|
|
102
104
|
() =>
|
|
@@ -109,7 +111,8 @@ export const MarkdownMessage = memo(function MarkdownMessage({
|
|
|
109
111
|
<Streamdown
|
|
110
112
|
className="space-y-0"
|
|
111
113
|
controls={false}
|
|
112
|
-
mode="static"
|
|
114
|
+
mode={streaming ? "streaming" : "static"}
|
|
115
|
+
isAnimating={streaming}
|
|
113
116
|
rehypePlugins={rehypePlugins}
|
|
114
117
|
skipHtml
|
|
115
118
|
components={DEFAULT_COMPONENTS}
|