uikit 3.25.24-dev.66bb413 → 3.25.24-dev.683b9f8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/css/uikit-core-rtl.css +1 -1
  2. package/dist/css/uikit-core-rtl.min.css +1 -1
  3. package/dist/css/uikit-core.css +1 -1
  4. package/dist/css/uikit-core.min.css +1 -1
  5. package/dist/css/uikit-rtl.css +1 -1
  6. package/dist/css/uikit-rtl.min.css +1 -1
  7. package/dist/css/uikit.css +1 -1
  8. package/dist/css/uikit.min.css +1 -1
  9. package/dist/js/components/countdown.js +1 -1
  10. package/dist/js/components/countdown.min.js +1 -1
  11. package/dist/js/components/filter.js +1 -1
  12. package/dist/js/components/filter.min.js +1 -1
  13. package/dist/js/components/lightbox-panel.js +10 -29
  14. package/dist/js/components/lightbox-panel.min.js +1 -1
  15. package/dist/js/components/lightbox.js +10 -29
  16. package/dist/js/components/lightbox.min.js +1 -1
  17. package/dist/js/components/notification.js +1 -1
  18. package/dist/js/components/notification.min.js +1 -1
  19. package/dist/js/components/parallax.js +1 -1
  20. package/dist/js/components/parallax.min.js +1 -1
  21. package/dist/js/components/slider-parallax.js +1 -1
  22. package/dist/js/components/slider-parallax.min.js +1 -1
  23. package/dist/js/components/slider.js +1 -1
  24. package/dist/js/components/slider.min.js +1 -1
  25. package/dist/js/components/slideshow-parallax.js +1 -1
  26. package/dist/js/components/slideshow-parallax.min.js +1 -1
  27. package/dist/js/components/slideshow.js +1 -1
  28. package/dist/js/components/slideshow.min.js +1 -1
  29. package/dist/js/components/sortable.js +1 -1
  30. package/dist/js/components/sortable.min.js +1 -1
  31. package/dist/js/components/tooltip.js +6 -7
  32. package/dist/js/components/tooltip.min.js +1 -1
  33. package/dist/js/components/upload.js +1 -1
  34. package/dist/js/components/upload.min.js +1 -1
  35. package/dist/js/uikit-core.js +66 -77
  36. package/dist/js/uikit-core.min.js +1 -1
  37. package/dist/js/uikit-icons.js +1 -1
  38. package/dist/js/uikit-icons.min.js +1 -1
  39. package/dist/js/uikit.js +66 -77
  40. package/dist/js/uikit.min.js +1 -1
  41. package/package.json +1 -1
  42. package/src/js/core/scrollspy.js +10 -20
  43. package/src/js/mixin/modal.js +3 -24
  44. package/src/js/mixin/togglable.js +5 -6
  45. package/src/js/util/animation.js +58 -41
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.25.24-dev.66bb413 | https://www.getuikit.com | (c) 2014 - 2026 YOOtheme | MIT License */
1
+ /*! UIkit 3.25.24-dev.683b9f8 | https://www.getuikit.com | (c) 2014 - 2026 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -685,39 +685,52 @@
685
685
  }
686
686
  };
687
687
  const clsAnimation = "uk-animation";
688
- const animationEnd = "animationend";
689
- const animationCanceled = "animationcanceled";
688
+ const activeAnimations = /* @__PURE__ */ new WeakMap();
690
689
  function animate$2(element, animation, duration = 200, origin, out) {
691
- return Promise.all(
692
- toNodes(element).map(
693
- (element2) => new Promise((resolve, reject) => {
694
- if (hasClass(element2, clsAnimation)) {
695
- trigger(element2, animationCanceled);
696
- }
697
- const classes = [
698
- animation,
699
- clsAnimation,
700
- `${clsAnimation}-${out ? "leave" : "enter"}`,
701
- origin && `uk-transform-origin-${origin}`,
702
- out && `${clsAnimation}-reverse`
703
- ];
704
- const timer = setTimeout(() => trigger(element2, animationEnd), duration);
705
- once(
706
- element2,
707
- [animationEnd, animationCanceled],
708
- ({ type }) => {
709
- clearTimeout(timer);
710
- type === animationCanceled ? reject() : resolve(element2);
711
- css(element2, "animationDuration", "");
712
- removeClass(element2, classes);
713
- },
714
- { self: true }
715
- );
716
- css(element2, "animationDuration", `${duration}ms`);
717
- addClass(element2, classes);
718
- })
719
- )
720
- );
690
+ const animateFn = async (element2) => {
691
+ if (!Element.prototype.getAnimations) {
692
+ return element2;
693
+ }
694
+ cancel(element2);
695
+ const existingAnimations = element2.getAnimations();
696
+ const classes = [
697
+ animation,
698
+ clsAnimation,
699
+ `${clsAnimation}-${out ? "leave" : "enter"}`,
700
+ origin && `uk-transform-origin-${origin}`,
701
+ out && `${clsAnimation}-reverse`
702
+ ];
703
+ css(element2, "animationDuration", `${duration}ms`);
704
+ addClass(element2, classes);
705
+ const animations = element2.getAnimations().filter((animation2) => !existingAnimations.includes(animation2));
706
+ const data = { animations, classes };
707
+ activeAnimations.set(element2, data);
708
+ try {
709
+ await Promise.all(animations.map(({ finished }) => finished));
710
+ return element2;
711
+ } finally {
712
+ cleanup(element2, data);
713
+ }
714
+ };
715
+ return Promise.all(toNodes(element).map(animateFn));
716
+ }
717
+ function cleanup(element, data) {
718
+ if (activeAnimations.get(element) === data) {
719
+ activeAnimations.delete(element);
720
+ css(element, "animationDuration", "");
721
+ removeClass(element, data.classes);
722
+ }
723
+ }
724
+ function cancel(elements) {
725
+ for (const element of toNodes(elements)) {
726
+ const data = activeAnimations.get(element);
727
+ if (data) {
728
+ for (const animation of data.animations) {
729
+ animation.cancel();
730
+ }
731
+ cleanup(element, data);
732
+ }
733
+ }
721
734
  }
722
735
  const Animation = {
723
736
  in: animate$2,
@@ -725,11 +738,9 @@
725
738
  return animate$2(element, animation, duration, origin, true);
726
739
  },
727
740
  inProgress(element) {
728
- return hasClass(element, clsAnimation);
741
+ return activeAnimations.has(element);
729
742
  },
730
- cancel(element) {
731
- trigger(element, animationCanceled);
732
- }
743
+ cancel
733
744
  };
734
745
 
735
746
  function ready(fn) {
@@ -2870,15 +2881,14 @@
2870
2881
  }
2871
2882
  }
2872
2883
  }
2873
- function toggleAnimation(el, show, cmp) {
2874
- const { animation, duration, _toggle } = cmp;
2884
+ async function toggleAnimation(el, show, cmp) {
2885
+ const { animation, duration, origin, _toggle } = cmp;
2875
2886
  if (show) {
2876
2887
  _toggle(el, true);
2877
- return Animation.in(el, animation[0], duration, cmp.origin);
2888
+ return Animation.in(el, animation[0], duration, origin);
2878
2889
  }
2879
- return Animation.out(el, animation[1] || animation[0], duration, cmp.origin).then(
2880
- () => _toggle(el, false)
2881
- );
2890
+ await Animation.out(el, animation[1] || animation[0], duration, origin);
2891
+ _toggle(el, false);
2882
2892
  }
2883
2893
 
2884
2894
  const active$1 = [];
@@ -3040,29 +3050,14 @@
3040
3050
  let rejectAnimation;
3041
3051
  return new Promise(
3042
3052
  (resolve, reject) => once(el, "show hide", () => {
3043
- var _a;
3053
+ var _a, _b, _c;
3044
3054
  (_a = pendingReject.get(el)) == null ? void 0 : _a();
3045
3055
  rejectAnimation = reject;
3046
3056
  pendingReject.set(el, reject);
3047
3057
  _toggle(el, show);
3048
- const off = once(
3049
- transitionElement,
3050
- "transitionstart",
3051
- () => {
3052
- once(transitionElement, "transitionend transitioncancel", resolve, {
3053
- self: true
3054
- });
3055
- clearTimeout(timer);
3056
- },
3057
- { self: true }
3058
- );
3059
- const timer = setTimeout(
3060
- () => {
3061
- off();
3062
- resolve();
3063
- },
3064
- toMs(css(transitionElement, "transitionDuration"))
3065
- );
3058
+ Promise.all(
3059
+ ((_c = (_b = transitionElement.getAnimations) == null ? void 0 : _b.call(transitionElement)) != null ? _c : []).map(({ finished }) => finished)
3060
+ ).then(resolve, reject);
3066
3061
  })
3067
3062
  ).then(() => {
3068
3063
  if (pendingReject.get(el) === rejectAnimation) {
@@ -3070,9 +3065,6 @@
3070
3065
  }
3071
3066
  });
3072
3067
  }
3073
- function toMs(time) {
3074
- return toFloat(time) * (endsWith(time, "ms") ? 1 : 1e3);
3075
- }
3076
3068
  function preventBackgroundFocus(modal) {
3077
3069
  return on(document, "focusin", (e) => {
3078
3070
  if (last(active$1) !== modal || modal.$el.contains(e.target)) {
@@ -3411,7 +3403,7 @@
3411
3403
  return Math.atan2(Math.abs(pos2.y - pos1.y), Math.abs(pos2.x - pos1.x)) * 180 / Math.PI;
3412
3404
  }
3413
3405
 
3414
- var VERSION = '3.25.24-dev.66bb413';
3406
+ var VERSION = '3.25.24-dev.683b9f8';
3415
3407
 
3416
3408
  function initWatches(instance) {
3417
3409
  instance._watches = [];
@@ -9233,7 +9225,7 @@
9233
9225
  ],
9234
9226
  methods: {
9235
9227
  toggle(el, inview) {
9236
- var _a, _b;
9228
+ var _a, _b, _c;
9237
9229
  const state = (_a = this.elementData) == null ? void 0 : _a.get(el);
9238
9230
  if (!state) {
9239
9231
  return;
@@ -9242,16 +9234,13 @@
9242
9234
  css(el, "opacity", !inview && this.hidden ? 0 : "");
9243
9235
  toggleClass(el, clsInView, inview);
9244
9236
  toggleClass(el, state.cls);
9245
- let match;
9246
- if (match = state.cls.match(/\buk-animation-[\w-]+/g)) {
9247
- const removeAnimationClasses = () => removeClass(el, match);
9248
- if (inview) {
9249
- state.off = once(el, "animationcancel animationend", removeAnimationClasses, {
9250
- self: true
9251
- });
9252
- } else {
9253
- removeAnimationClasses();
9254
- }
9237
+ const match = state.cls.match(/\buk-animation-[\w-]+/g);
9238
+ if (match) {
9239
+ const animations = inview && ((_c = el.getAnimations) == null ? void 0 : _c.call(el)) || [];
9240
+ let active = true;
9241
+ state.off = () => active = false;
9242
+ const cleanup = () => active && removeClass(el, match);
9243
+ Promise.all(animations.map(({ finished }) => finished)).then(cleanup, cleanup);
9255
9244
  }
9256
9245
  trigger(el, inview ? "inview" : "outview");
9257
9246
  state.inview = inview;