Compare commits

..

81 Commits

Author SHA1 Message Date
Arctictlzicu
f7f1d9672d Merge branch 'ChatGPTNextWeb:main' into main 2025-04-15 22:45:38 +08:00
Arctictlzicu
7a364b08bb Merge branch 'ChatGPTNextWeb:main' into main 2025-02-23 10:22:59 +08:00
GH Action - Upstream Sync
e1afdf43c1 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-10-11 00:59:01 +00:00
GH Action - Upstream Sync
aeb219a273 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-10-10 00:58:58 +00:00
GH Action - Upstream Sync
16328ad35b Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-10-09 00:59:03 +00:00
GH Action - Upstream Sync
df3e34bd42 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-10-07 01:01:40 +00:00
GH Action - Upstream Sync
d455ba1717 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-10-04 00:59:26 +00:00
GH Action - Upstream Sync
98f471ebac Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-10-01 01:05:19 +00:00
Arctictlzicu
e84af6405e Merge branch 'ChatGPTNextWeb:main' into main 2024-09-30 10:21:36 +08:00
GH Action - Upstream Sync
12b809d1cd Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-09-16 01:00:27 +00:00
GH Action - Upstream Sync
10f9dcf013 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-09-15 01:03:19 +00:00
GH Action - Upstream Sync
913ad65ca0 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-09-14 00:56:10 +00:00
GH Action - Upstream Sync
5fbe45c3cd Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-09-13 00:56:50 +00:00
GH Action - Upstream Sync
2e34f63f8d Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-09-10 00:57:09 +00:00
GH Action - Upstream Sync
d324ad9614 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-09-09 00:58:19 +00:00
GH Action - Upstream Sync
735955d107 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-09-08 01:01:04 +00:00
GH Action - Upstream Sync
c30bfc8a45 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-09-07 00:55:30 +00:00
GH Action - Upstream Sync
a8fcf030db Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-09-05 00:56:22 +00:00
GH Action - Upstream Sync
cc6213cbd9 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-30 00:56:09 +00:00
GH Action - Upstream Sync
556ca2d13c Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-28 00:55:30 +00:00
GH Action - Upstream Sync
34e93d2080 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-25 00:58:22 +00:00
GH Action - Upstream Sync
bb816ec96d Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-22 00:54:53 +00:00
GH Action - Upstream Sync
003c643dd1 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-21 00:53:43 +00:00
GH Action - Upstream Sync
5939caaf1d Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-20 00:53:38 +00:00
GH Action - Upstream Sync
0bbdd75779 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-17 00:52:02 +00:00
GH Action - Upstream Sync
3b251be2dd Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-16 00:54:24 +00:00
GH Action - Upstream Sync
4f4c8f5245 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-14 00:54:10 +00:00
GH Action - Upstream Sync
ab7d42b70e Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-09 00:54:27 +00:00
GH Action - Upstream Sync
dbe8ca93cc Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-08 00:53:48 +00:00
GH Action - Upstream Sync
a5b8036a3e Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-07 00:54:03 +00:00
GH Action - Upstream Sync
eabbeb1ec2 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-06 00:53:20 +00:00
GH Action - Upstream Sync
73c94e79f4 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-04 00:57:13 +00:00
GH Action - Upstream Sync
515207b935 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-03 00:52:25 +00:00
GH Action - Upstream Sync
a5c1fdedb8 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-08-02 00:53:07 +00:00
GH Action - Upstream Sync
b623cb59f2 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-31 00:42:41 +00:00
GH Action - Upstream Sync
7815176abd Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-30 00:53:10 +00:00
GH Action - Upstream Sync
7441f423d5 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-27 00:52:04 +00:00
GH Action - Upstream Sync
466e99471c Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-26 00:52:25 +00:00
GH Action - Upstream Sync
0e1be4f7e6 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-23 00:53:40 +00:00
GH Action - Upstream Sync
aba77de5fb Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-21 00:56:32 +00:00
GH Action - Upstream Sync
9a73aff57a Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-20 00:51:36 +00:00
GH Action - Upstream Sync
1777189b1e Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-19 15:07:25 +00:00
GH Action - Upstream Sync
c5bb130b03 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-18 00:51:54 +00:00
GH Action - Upstream Sync
42c1e55ac3 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-17 00:53:00 +00:00
GH Action - Upstream Sync
0b10c2083d Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-16 00:53:01 +00:00
GH Action - Upstream Sync
9e0485d4b5 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-14 00:56:42 +00:00
GH Action - Upstream Sync
b44e75e5ed Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-13 00:52:29 +00:00
GH Action - Upstream Sync
abb1b6ff76 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-12 00:51:53 +00:00
GH Action - Upstream Sync
7632e890c2 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-11 00:52:39 +00:00
GH Action - Upstream Sync
8c4fa3daa5 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-10 00:52:51 +00:00
GH Action - Upstream Sync
68f25e6254 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-07 00:56:07 +00:00
GH Action - Upstream Sync
307448adf9 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-06 00:50:06 +00:00
GH Action - Upstream Sync
789df693be Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-05 00:51:10 +00:00
GH Action - Upstream Sync
f1b04cf555 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-04 00:51:33 +00:00
GH Action - Upstream Sync
f2cd26da3c Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-07-02 00:51:28 +00:00
GH Action - Upstream Sync
eef4b3bf7c Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-06-27 00:51:17 +00:00
GH Action - Upstream Sync
e0faa26e91 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-06-25 00:51:07 +00:00
GH Action - Upstream Sync
3ad30ed5ba Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-06-08 00:50:16 +00:00
GH Action - Upstream Sync
099fea0910 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-05-28 00:49:00 +00:00
GH Action - Upstream Sync
426f1bcffb Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-05-23 00:48:11 +00:00
GH Action - Upstream Sync
d1c0c9ed37 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-05-21 00:48:31 +00:00
GH Action - Upstream Sync
e734cb731a Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-05-17 00:48:10 +00:00
GH Action - Upstream Sync
ad20cc2396 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-05-16 00:48:17 +00:00
GH Action - Upstream Sync
458f2f5c21 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-05-15 00:48:01 +00:00
GH Action - Upstream Sync
aa465de9e9 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-05-14 00:48:16 +00:00
GH Action - Upstream Sync
271376511d Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-05-08 00:38:27 +00:00
GH Action - Upstream Sync
779bb8e9fc Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-05-07 00:46:48 +00:00
GH Action - Upstream Sync
461cf6f23f Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-05-01 00:50:55 +00:00
GH Action - Upstream Sync
786b2efbd6 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-04-26 00:46:05 +00:00
GH Action - Upstream Sync
798d31bdfc Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-04-17 00:45:51 +00:00
GH Action - Upstream Sync
bd626cb03b Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-04-16 00:44:39 +00:00
GH Action - Upstream Sync
98a611d68f Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-04-15 03:11:08 +00:00
GH Action - Upstream Sync
da2d765876 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-04-13 00:37:39 +00:00
GH Action - Upstream Sync
209fef16e2 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-04-12 00:45:11 +00:00
GH Action - Upstream Sync
56f84e1076 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-04-11 00:45:26 +00:00
GH Action - Upstream Sync
d64a05d836 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-04-10 00:44:09 +00:00
GH Action - Upstream Sync
ed8cdb0ca7 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-04-09 00:44:48 +00:00
GH Action - Upstream Sync
8d6e4dddbf Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-04-04 00:46:16 +00:00
GH Action - Upstream Sync
bbaf52e8ab Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-03-29 00:44:00 +00:00
GH Action - Upstream Sync
eab4412998 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-03-28 00:44:34 +00:00
GH Action - Upstream Sync
e2a9c54d20 Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web 2024-03-27 00:43:46 +00:00
3 changed files with 12 additions and 281 deletions

View File

@@ -18,6 +18,7 @@ import ReturnIcon from "../icons/return.svg";
import CopyIcon from "../icons/copy.svg";
import SpeakIcon from "../icons/speak.svg";
import SpeakStopIcon from "../icons/speak-stop.svg";
import LoadingIcon from "../icons/three-dots.svg";
import LoadingButtonIcon from "../icons/loading.svg";
import PromptIcon from "../icons/prompt.svg";
import MaskIcon from "../icons/mask.svg";
@@ -78,6 +79,8 @@ import {
import { uploadImage as uploadImageRemote } from "@/app/utils/chat";
import dynamic from "next/dynamic";
import { ChatControllerPool } from "../client/controller";
import { DalleQuality, DalleStyle, ModelSize } from "../typing";
import { Prompt, usePromptStore } from "../store/prompt";
@@ -122,15 +125,14 @@ import { getModelProvider } from "../utils/model";
import { RealtimeChat } from "@/app/components/realtime-chat";
import clsx from "clsx";
import { getAvailableClientsCount, isMcpEnabled } from "../mcp/actions";
import { Markdown } from "./markdown";
const localStorage = safeLocalStorage();
const ttsPlayer = createTTSPlayer();
// const Markdown = dynamic(async () => (await import("./markdown")).Markdown, {
// loading: () => <LoadingIcon />,
// });
const Markdown = dynamic(async () => (await import("./markdown")).Markdown, {
loading: () => <LoadingIcon />,
});
const MCPAction = () => {
const navigate = useNavigate();
@@ -1982,8 +1984,6 @@ function _Chat() {
fontFamily={fontFamily}
parentRef={scrollRef}
defaultShow={i >= messages.length - 6}
immediatelyRender={i >= messages.length - 3}
streaming={message.streaming}
/>
{getMessageImages(message).length == 1 && (
<img

View File

@@ -267,136 +267,6 @@ function tryWrapHtmlCode(text: string) {
);
}
// Split content into paragraphs while preserving code blocks
function splitContentIntoParagraphs(content: string) {
// Check for unclosed code blocks
const codeBlockStartCount = (content.match(/```/g) || []).length;
let processedContent = content;
// Add closing tag if there's an odd number of code block markers
if (codeBlockStartCount % 2 !== 0) {
processedContent = content + "\n```";
}
// Extract code blocks
const codeBlockRegex = /```[\s\S]*?```/g;
const codeBlocks: string[] = [];
let codeBlockCounter = 0;
// Replace code blocks with placeholders
const contentWithPlaceholders = processedContent.replace(
codeBlockRegex,
(match) => {
codeBlocks.push(match);
const placeholder = `__CODE_BLOCK_${codeBlockCounter++}__`;
return placeholder;
},
);
// Split by double newlines
const paragraphs = contentWithPlaceholders
.split(/\n\n+/)
.filter((p) => p.trim());
// Restore code blocks
return paragraphs.map((p) => {
if (p.match(/__CODE_BLOCK_\d+__/)) {
return p.replace(/__CODE_BLOCK_\d+__/g, (match) => {
const index = parseInt(match.match(/\d+/)?.[0] || "0");
return codeBlocks[index] || match;
});
}
return p;
});
}
// Lazy-loaded paragraph component
function MarkdownParagraph({
content,
onLoad,
}: {
content: string;
onLoad?: () => void;
}) {
const [isLoaded, setIsLoaded] = useState(false);
const placeholderRef = useRef<HTMLDivElement>(null);
const [isVisible, setIsVisible] = useState(false);
useEffect(() => {
let observer: IntersectionObserver;
if (placeholderRef.current) {
observer = new IntersectionObserver(
(entries) => {
if (entries[0].isIntersecting) {
setIsVisible(true);
}
},
{ threshold: 0.1, rootMargin: "200px 0px" },
);
observer.observe(placeholderRef.current);
}
return () => observer?.disconnect();
}, []);
useEffect(() => {
if (isVisible && !isLoaded) {
setIsLoaded(true);
onLoad?.();
}
}, [isVisible, isLoaded, onLoad]);
// Generate preview content
const previewContent = useMemo(() => {
if (content.startsWith("```")) {
return "```" + (content.split("\n")[0] || "").slice(3) + "...```";
}
return content.length > 60 ? content.slice(0, 60) + "..." : content;
}, [content]);
return (
<div className="markdown-paragraph" ref={placeholderRef}>
{!isLoaded ? (
<div className="markdown-paragraph-placeholder">{previewContent}</div>
) : (
<_MarkDownContent content={content} />
)}
</div>
);
}
// Memoized paragraph component to prevent unnecessary re-renders
const MemoizedMarkdownParagraph = React.memo(
({ content }: { content: string }) => {
return <_MarkDownContent content={content} />;
},
(prevProps, nextProps) => prevProps.content === nextProps.content,
);
MemoizedMarkdownParagraph.displayName = "MemoizedMarkdownParagraph";
// Specialized component for streaming content
function StreamingMarkdownContent({ content }: { content: string }) {
const paragraphs = useMemo(
() => splitContentIntoParagraphs(content),
[content],
);
const lastParagraphRef = useRef<HTMLDivElement>(null);
return (
<div className="markdown-streaming-content">
{paragraphs.map((paragraph, index) => (
<div
key={`p-${index}-${paragraph.substring(0, 20)}`}
className="markdown-paragraph markdown-streaming-paragraph"
ref={index === paragraphs.length - 1 ? lastParagraphRef : null}
>
<MemoizedMarkdownParagraph content={paragraph} />
</div>
))}
</div>
);
}
function _MarkDownContent(props: { content: string }) {
const escapedContent = useMemo(() => {
return tryWrapHtmlCode(escapeBrackets(props.content));
@@ -456,27 +326,9 @@ export function Markdown(
fontFamily?: string;
parentRef?: RefObject<HTMLDivElement>;
defaultShow?: boolean;
immediatelyRender?: boolean;
streaming?: boolean; // Whether this is a streaming response
} & React.DOMAttributes<HTMLDivElement>,
) {
const mdRef = useRef<HTMLDivElement>(null);
const paragraphs = useMemo(
() => splitContentIntoParagraphs(props.content),
[props.content],
);
const [loadedCount, setLoadedCount] = useState(0);
// Determine rendering strategy based on props
const shouldAsyncRender =
!props.immediatelyRender && !props.streaming && paragraphs.length > 1;
useEffect(() => {
// Immediately render all paragraphs if specified
if (props.immediatelyRender) {
setLoadedCount(paragraphs.length);
}
}, [props.immediatelyRender, paragraphs.length]);
return (
<div
@@ -492,24 +344,6 @@ export function Markdown(
>
{props.loading ? (
<LoadingIcon />
) : props.streaming ? (
// Use specialized component for streaming content
<StreamingMarkdownContent content={props.content} />
) : shouldAsyncRender ? (
<div className="markdown-content">
{paragraphs.map((paragraph, index) => (
<MarkdownParagraph
key={index}
content={paragraph}
onLoad={() => setLoadedCount((prev) => prev + 1)}
/>
))}
{loadedCount < paragraphs.length && loadedCount > 0 && (
<div className="markdown-paragraph-loading">
<LoadingIcon />
</div>
)}
</div>
) : (
<MarkdownContent content={props.content} />
)}

View File

@@ -99,7 +99,6 @@
font-size: 14px;
line-height: 1.5;
word-wrap: break-word;
margin-bottom: 0;
}
.light {
@@ -359,14 +358,8 @@
.markdown-body kbd {
display: inline-block;
padding: 3px 5px;
font:
11px ui-monospace,
SFMono-Regular,
SF Mono,
Menlo,
Consolas,
Liberation Mono,
monospace;
font: 11px ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas,
Liberation Mono, monospace;
line-height: 10px;
color: var(--color-fg-default);
vertical-align: middle;
@@ -455,28 +448,16 @@
.markdown-body tt,
.markdown-body code,
.markdown-body samp {
font-family:
ui-monospace,
SFMono-Regular,
SF Mono,
Menlo,
Consolas,
Liberation Mono,
monospace;
font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas,
Liberation Mono, monospace;
font-size: 12px;
}
.markdown-body pre {
margin-top: 0;
margin-bottom: 0;
font-family:
ui-monospace,
SFMono-Regular,
SF Mono,
Menlo,
Consolas,
Liberation Mono,
monospace;
font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas,
Liberation Mono, monospace;
font-size: 12px;
word-wrap: normal;
}
@@ -1149,87 +1130,3 @@
#dmermaid {
display: none;
}
.markdown-content {
width: 100%;
}
.markdown-paragraph {
transition: opacity 0.3s ease;
margin-bottom: 0.5em;
&.markdown-paragraph-visible {
opacity: 1;
}
&.markdown-paragraph-hidden {
opacity: 0.7;
}
}
.markdown-paragraph-placeholder {
padding: 8px;
color: var(--color-fg-subtle);
background-color: var(--color-canvas-subtle);
border-radius: 6px;
border-left: 3px solid var(--color-border-muted);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-family: var(--font-family-sans);
font-size: 14px;
min-height: 1.2em;
}
.markdown-paragraph-loading {
height: 20px;
background-color: var(--color-canvas-subtle);
border-radius: 6px;
margin-bottom: 8px;
position: relative;
overflow: hidden;
&::after {
content: "";
position: absolute;
top: 0;
left: 0;
width: 30%;
height: 100%;
background: linear-gradient(
90deg,
transparent,
rgba(255, 255, 255, 0.1),
transparent
);
animation: shimmer 1.5s infinite;
}
}
@keyframes shimmer {
0% {
transform: translateX(-100%);
}
100% {
transform: translateX(200%);
}
}
.markdown-streaming-content {
width: 100%;
}
.markdown-streaming-paragraph {
opacity: 1;
animation: fadeIn 0.3s ease-in-out;
margin-bottom: 0.5em;
}
@keyframes fadeIn {
from {
opacity: 0.5;
}
to {
opacity: 1;
}
}