File tree Expand file tree Collapse file tree
lib/components/chat/Messages/Markdown/MarkdownInlineTokens Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -243,6 +243,19 @@ select {
243243 animation : smoothFadeIn 0.2s forwards;
244244}
245245
246+ @keyframes fade-in-token {
247+ from {
248+ opacity : 0 ;
249+ }
250+ to {
251+ opacity : 1 ;
252+ }
253+ }
254+
255+ .fade-in-token {
256+ animation : fade-in-token 100ms ease-out;
257+ }
258+
246259.katex-mathml {
247260 display : none;
248261}
Original file line number Diff line number Diff line change 11<script lang =" ts" >
22 import { copyToClipboard , unescapeHtml } from ' $lib/utils' ;
33 import { toast } from ' svelte-sonner' ;
4- import { fade } from ' svelte/transition' ;
54
65 import { getContext } from ' svelte' ;
76
1312
1413<!-- svelte-ignore a11y-click-events-have-key-events -->
1514<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
16- {#if done }
17- <code
18- class =" codespan cursor-pointer"
19- on:click ={() => {
20- copyToClipboard (unescapeHtml (token .text ));
21- toast .success ($i18n .t (' Copied to clipboard' ));
22- }}>{unescapeHtml (token .text )}</code
23- >
24- {:else }
25- <code
26- transition:fade ={{ duration : 100 }}
27- class =" codespan cursor-pointer"
28- on:click ={() => {
29- copyToClipboard (unescapeHtml (token .text ));
30- toast .success ($i18n .t (' Copied to clipboard' ));
31- }}>{unescapeHtml (token .text )}</code
32- >
33- {/if }
15+ <code
16+ class ="codespan cursor-pointer {! done ? ' fade-in-token' : ' ' }"
17+ on:click ={() => {
18+ copyToClipboard (unescapeHtml (token .text ));
19+ toast .success ($i18n .t (' Copied to clipboard' ));
20+ }}>{unescapeHtml (token .text )}</code
21+ >
Original file line number Diff line number Diff line change 11<script lang =" ts" >
2- import { fade } from ' svelte/transition' ;
3-
42 export let token;
53 export let done = true ;
6-
7- let texts = [];
8- $ : texts = (token ?.raw ?? ' ' ).split (' ' );
94 </script >
105
116{#if done }
127 {token ?.raw }
138{:else }
14- {#each texts as text }
15- <span class ="" transition: fade={{ duration : 100 }} >
9+ {#each ( token ?. raw ?? ' ' ). split ( ' ' ) as text }
10+ <span class =" fade-in-token " >
1611 {text }{' ' }
1712 </span >
1813 {/each }
You can’t perform that action at this time.
0 commit comments