PluginProbe
Extendify / 3.2.1
Extendify v3.2.1
3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 All 127 releases
extendify / src / Agent / components / messages / AnimateChunks.jsx

AnimateChunks.jsx in Extendify 3.2.1, at src/Agent/components/messages/AnimateChunks.jsx

28 lines 713 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { customComponents } from '@agent/lib/markdown';
2 import { AnimatePresence, motion } from 'framer-motion';
3 import ReactMarkdown from 'react-markdown';
4
5 export const AnimateChunks = ({ words, delay = 0.4, duration = 0.25 }) => {
6 const isChars = words.every((word) => word.length === 1);
7
8 return (
9 <AnimatePresence>
10 {words.map((word, i) => (
11 <motion.span
12 key={i}
13 initial={{ opacity: 0, y: 8 }}
14 animate={{ opacity: 1, y: 0 }}
15 exit={{ opacity: 0 }}
16 transition={{ duration, delay: i * delay }}
17 >
18 {isChars ? (
19 word
20 ) : (
21 <ReactMarkdown components={customComponents}>{word}</ReactMarkdown>
22 )}
23 </motion.span>
24 ))}
25 </AnimatePresence>
26 );
27 };
28