shikijs / shiki-magic-move

Smoothly animated code blocks with Shiki
https://shiki-magic-move.netlify.app/
MIT License
1.11k stars 32 forks source link

fix: fake transition blocking events #18

Open paoloricciuti opened 1 month ago

paoloricciuti commented 1 month ago

Closes #11

I tested it locally and everything seems to work fine but please double check, i might be missing some use case. I changed registerTransitionEnd to return a function and invoked it after the reflow so that element.getAnimations could have the latest and correct value for every element. After that instead of registering the event i just wait for every css animation finished.

This ensure that if an elements doesn't change because already has the same style the getAnimations will not return an animation for that avoiding the the Promise.all at the end to be blocked.

antfu commented 1 month ago

Haven't checked the implementation, but it seems to make the theme and language switch not reactive

paoloricciuti commented 1 month ago

Haven't checked the implementation, but it seems to make the theme and language switch not reactive

For me it works for everything except Vue 🤷🏻‍♂️

I will check what's going on

paoloricciuti commented 1 month ago

Oh wait...i just switched to main and it's not working there either so it must be something else...does it work with other languages @antfu ?

paoloricciuti commented 1 month ago

@antfu there was a missing dependency on the watch in the playground that was making the change fail for vue. I think i fixed it on the latest commit (not that versed in vue so i might have messed something)

paoloricciuti commented 3 weeks ago

@antfu any update on this?

paoloricciuti commented 1 day ago

@antfu sorry for pinging you again but i'll soon need to use this library and i would love for this to be fixed before. Can you take a look?