chunk.NC36RJW4.js 896 B

12345678910111213141516171819202122232425262728293031
  1. // src/utilities/animation-registry.ts
  2. var defaultAnimationRegistry = new Map();
  3. var customAnimationRegistry = new WeakMap();
  4. function setDefaultAnimation(animationName, animation) {
  5. defaultAnimationRegistry.set(animationName, animation);
  6. }
  7. function setAnimation(el, animationName, animation) {
  8. customAnimationRegistry.set(el, Object.assign({}, customAnimationRegistry.get(el), {
  9. [animationName]: animation
  10. }));
  11. }
  12. function getAnimation(el, animationName) {
  13. const customAnimation = customAnimationRegistry.get(el);
  14. if (customAnimation && customAnimation[animationName]) {
  15. return customAnimation[animationName];
  16. }
  17. const defaultAnimation = defaultAnimationRegistry.get(animationName);
  18. if (defaultAnimation) {
  19. return defaultAnimation;
  20. }
  21. return {
  22. keyframes: [],
  23. options: { duration: 0 }
  24. };
  25. }
  26. export {
  27. setDefaultAnimation,
  28. setAnimation,
  29. getAnimation
  30. };