File tree Expand file tree Collapse file tree
src/lib/components/chat/Messages/Markdown/MarkdownInlineTokens Expand file tree Collapse file tree 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+ >
22+
23+ <style >
24+ @keyframes fade-in-token {
25+ from {
26+ opacity : 0 ;
27+ }
28+ to {
29+ opacity : 1 ;
30+ }
31+ }
32+ .fade-in-token {
33+ animation : fade-in-token 100ms ease-out ;
34+ }
35+ </style >
You can’t perform that action at this time.
0 commit comments