@springbrand/message-panel 0.1.3-alpha.22 → 0.1.3-alpha.23
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.
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
export type CloudOsUrlResolver = (url: string) => string | null | undefined;
|
|
15
15
|
|
|
16
16
|
const ALLOWED_PROTOCOLS = new Set(["http:", "https:", "mailto:"]);
|
|
17
|
+
const CJK_TEXT = /[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u;
|
|
17
18
|
|
|
18
19
|
export function safeExternalUrl(href: string | undefined): string | undefined {
|
|
19
20
|
if (!href) return undefined;
|
|
@@ -109,6 +110,13 @@ export const MarkdownMessage = memo(function MarkdownMessage({
|
|
|
109
110
|
);
|
|
110
111
|
return (
|
|
111
112
|
<Streamdown
|
|
113
|
+
animated={
|
|
114
|
+
streaming
|
|
115
|
+
? CJK_TEXT.test(message)
|
|
116
|
+
? { sep: "char", duration: 100, stagger: 5 }
|
|
117
|
+
: true
|
|
118
|
+
: false
|
|
119
|
+
}
|
|
112
120
|
className="space-y-0"
|
|
113
121
|
controls={false}
|
|
114
122
|
mode={streaming ? "streaming" : "static"}
|