uikit 3.15.9-dev.d605a4e5a → 3.15.9-dev.ffad54c1a

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 (44) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/dist/css/uikit-core-rtl.css +1 -1
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +1 -1
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +1 -1
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +1 -1
  9. package/dist/css/uikit.min.css +1 -1
  10. package/dist/js/components/countdown.js +1 -1
  11. package/dist/js/components/countdown.min.js +1 -1
  12. package/dist/js/components/filter.js +25 -2
  13. package/dist/js/components/filter.min.js +1 -1
  14. package/dist/js/components/lightbox-panel.js +1 -1
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +1 -1
  17. package/dist/js/components/lightbox.min.js +1 -1
  18. package/dist/js/components/notification.js +1 -1
  19. package/dist/js/components/notification.min.js +1 -1
  20. package/dist/js/components/parallax.js +1 -1
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +1 -1
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +1 -1
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +1 -1
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +1 -1
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +36 -5
  31. package/dist/js/components/sortable.min.js +1 -1
  32. package/dist/js/components/tooltip.js +1 -1
  33. package/dist/js/components/tooltip.min.js +1 -1
  34. package/dist/js/components/upload.js +1 -1
  35. package/dist/js/components/upload.min.js +1 -1
  36. package/dist/js/uikit-core.js +2 -2
  37. package/dist/js/uikit-core.min.js +1 -1
  38. package/dist/js/uikit-icons.js +1 -1
  39. package/dist/js/uikit-icons.min.js +1 -1
  40. package/dist/js/uikit.js +37 -6
  41. package/dist/js/uikit.min.js +2 -2
  42. package/package.json +1 -1
  43. package/src/js/components/sortable.js +15 -4
  44. package/src/js/mixin/internal/animate-slide.js +26 -1
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "uikit",
3
3
  "title": "UIkit",
4
4
  "description": "UIkit is a lightweight and modular front-end framework for developing fast and powerful web interfaces.",
5
- "version": "3.15.9-dev.d605a4e5a",
5
+ "version": "3.15.9-dev.ffad54c1a",
6
6
  "main": "dist/js/uikit.js",
7
7
  "style": "dist/css/uikit.css",
8
8
  "sideEffects": [
@@ -1,10 +1,12 @@
1
1
  import Animate from '../mixin/animate';
2
2
  import Class from '../mixin/class';
3
3
  import {
4
+ $,
4
5
  $$,
5
6
  addClass,
6
7
  append,
7
8
  assign,
9
+ attr,
8
10
  before,
9
11
  children,
10
12
  css,
@@ -15,6 +17,7 @@ import {
15
17
  index,
16
18
  isEmpty,
17
19
  isInput,
20
+ isTag,
18
21
  off,
19
22
  offsetViewport,
20
23
  on,
@@ -345,10 +348,18 @@ function untrackScroll() {
345
348
  }
346
349
 
347
350
  function appendDrag(container, element) {
348
- const clone = append(
349
- container,
350
- element.outerHTML.replace(/(^<)(?:li|tr)|(?:li|tr)(\/>$)/g, '$1div$2')
351
- );
351
+ let clone;
352
+ if (['li', 'tr'].some((tag) => isTag(element, tag))) {
353
+ clone = $('<div>');
354
+ append(clone, element.cloneNode(true).children);
355
+ for (const { nodeName, nodeValue } of element.attributes) {
356
+ attr(clone, nodeName, nodeValue);
357
+ }
358
+ } else {
359
+ clone = element.cloneNode(true);
360
+ }
361
+
362
+ append(container, clone);
352
363
 
353
364
  css(clone, 'margin', '0', 'important');
354
365
  css(clone, {
@@ -4,8 +4,10 @@ import {
4
4
  fastdom,
5
5
  includes,
6
6
  index,
7
+ isEqual,
7
8
  isVisible,
8
9
  noop,
10
+ observeMutation,
9
11
  offset,
10
12
  parent,
11
13
  position,
@@ -26,6 +28,8 @@ export default async function (action, target, duration) {
26
28
  nodes.forEach(Transition.cancel);
27
29
  reset(target);
28
30
 
31
+ const { promise, observer } = awaitMutation(target);
32
+
29
33
  // Adding, sorting, removing nodes
30
34
  action();
31
35
 
@@ -33,7 +37,12 @@ export default async function (action, target, duration) {
33
37
  nodes = nodes.concat(children(target).filter((el) => !includes(nodes, el)));
34
38
 
35
39
  // Wait for update to propagate
36
- await Promise.resolve();
40
+ if (isEqual(children(target), nodes)) {
41
+ observer.disconnect();
42
+ await Promise.resolve();
43
+ } else {
44
+ await promise;
45
+ }
37
46
 
38
47
  // Force update
39
48
  fastdom.flush();
@@ -141,3 +150,19 @@ function getPositionWithMargin(el) {
141
150
  function awaitFrame() {
142
151
  return new Promise((resolve) => requestAnimationFrame(resolve));
143
152
  }
153
+
154
+ function awaitMutation(target) {
155
+ let observer;
156
+ const promise = new Promise(
157
+ (resolve) =>
158
+ (observer = observeMutation(
159
+ target,
160
+ (records, observer) => {
161
+ resolve();
162
+ observer.disconnect();
163
+ },
164
+ { childList: true, attributes: true }
165
+ ))
166
+ );
167
+ return { promise, observer };
168
+ }