uikit 3.19.5-dev.57ec46163 → 3.19.5-dev.8210c3e08

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 (47) hide show
  1. package/CHANGELOG.md +4 -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 +1 -1
  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 +58 -44
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +58 -44
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +59 -45
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +58 -44
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +58 -44
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +1 -1
  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 +87 -52
  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 +87 -52
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/api/observer.js +17 -5
  44. package/src/js/core/inverse.js +11 -1
  45. package/src/js/util/selector.js +61 -37
  46. package/src/js/util/svg.js +1 -12
  47. package/tests/modal.html +2 -2
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.19.5-dev.57ec46163 | https://www.getuikit.com | (c) 2014 - 2024 YOOtheme | MIT License */
1
+ /*! UIkit 3.19.5-dev.8210c3e08 | https://www.getuikit.com | (c) 2014 - 2024 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -367,55 +367,77 @@
367
367
  function findAll(selector, context) {
368
368
  return toNodes(_query(selector, toNode(context), "querySelectorAll"));
369
369
  }
370
- const contextSelectorRe = /(^|[^\\],)\s*[!>+~-]/;
371
- const isContextSelector = memoize((selector) => selector.match(contextSelectorRe));
372
370
  function getContext(selector, context = document) {
373
- return isString(selector) && isContextSelector(selector) || isDocument(context) ? context : context.ownerDocument;
374
- }
375
- const contextSanitizeRe = /([!>+~-])(?=\s+[!>+~-]|\s*$)/g;
376
- const sanatize = memoize((selector) => selector.replace(contextSanitizeRe, "$1 *"));
371
+ return isString(selector) && parseSelector(selector).isContextSelector || isDocument(context) ? context : context.ownerDocument;
372
+ }
373
+ const addStarRe = /([!>+~-])(?=\s+[!>+~-]|\s*$)/g;
374
+ const splitSelectorRe = /.*?[^\\](?![^(]*\))(?:,|$)/g;
375
+ const trailingCommaRe = /\s*,$/;
376
+ const parseSelector = memoize((selector) => {
377
+ selector = selector.replace(addStarRe, "$1 *");
378
+ let isContextSelector = false;
379
+ const selectors = [];
380
+ for (let sel of selector.match(splitSelectorRe)) {
381
+ sel = sel.replace(trailingCommaRe, "").trim();
382
+ if (sel[0] === ">") {
383
+ sel = `:scope ${sel}`;
384
+ }
385
+ isContextSelector || (isContextSelector = ["!", "+", "~", "-"].includes(sel[0]));
386
+ selectors.push(sel);
387
+ }
388
+ return {
389
+ selector: selectors.join(","),
390
+ selectors,
391
+ isContextSelector
392
+ };
393
+ });
377
394
  function _query(selector, context = document, queryFn) {
378
395
  if (!selector || !isString(selector)) {
379
396
  return selector;
380
397
  }
381
- selector = sanatize(selector);
382
- if (isContextSelector(selector)) {
383
- const split = splitSelector(selector);
384
- selector = "";
385
- for (let sel of split) {
386
- let ctx = context;
387
- if (sel[0] === "!") {
388
- const selectors = sel.substr(1).trim().split(" ");
389
- ctx = parent(context).closest(selectors[0]);
390
- sel = selectors.slice(1).join(" ").trim();
391
- if (!sel.length && split.length === 1) {
392
- return ctx;
393
- }
394
- }
395
- if (sel[0] === "-") {
396
- const selectors = sel.substr(1).trim().split(" ");
397
- const prev = (ctx || context).previousElementSibling;
398
- ctx = matches(prev, sel.substr(1)) ? prev : null;
399
- sel = selectors.slice(1).join(" ");
398
+ const parsed = parseSelector(selector);
399
+ if (!parsed.isContextSelector) {
400
+ return _doQuery(context, queryFn, parsed.selector);
401
+ }
402
+ selector = "";
403
+ const isSingle = parsed.selectors.length === 1;
404
+ for (let sel of parsed.selectors) {
405
+ let ctx = context;
406
+ if (sel[0] === "!") {
407
+ const selectors = sel.substr(1).trim().split(" ");
408
+ ctx = parent(context).closest(selectors[0]);
409
+ sel = selectors.slice(1).join(" ").trim();
410
+ if (!sel.length && isSingle) {
411
+ return ctx;
400
412
  }
401
- if (ctx) {
402
- selector += `${selector ? "," : ""}${domPath(ctx)} ${sel}`;
413
+ }
414
+ if (sel[0] === "-") {
415
+ const selectors = sel.substr(1).trim().split(" ");
416
+ const prev = (ctx || context).previousElementSibling;
417
+ ctx = matches(prev, sel.substr(1)) ? prev : null;
418
+ sel = selectors.slice(1).join(" ");
419
+ if (!sel.length && isSingle) {
420
+ return ctx;
403
421
  }
422
+ } else if (sel[0] === "~" || sel[0] === "+" && isSingle) {
423
+ return _doQuery(parent(ctx), queryFn, `:scope :nth-child(${index(ctx) + 1}) ${sel}`);
404
424
  }
405
- if (!isDocument(context)) {
406
- context = context.ownerDocument;
425
+ if (ctx) {
426
+ selector += `${selector ? "," : ""}${domPath(ctx)} ${sel}`;
407
427
  }
408
428
  }
429
+ if (!isDocument(context)) {
430
+ context = context.ownerDocument;
431
+ }
432
+ return _doQuery(context, queryFn, selector);
433
+ }
434
+ function _doQuery(context, queryFn, selector) {
409
435
  try {
410
436
  return context[queryFn](selector);
411
437
  } catch (e) {
412
438
  return null;
413
439
  }
414
440
  }
415
- const selectorRe = /.*?[^\\](?![^(]*\))(?:,|$)/g;
416
- const splitSelector = memoize(
417
- (selector) => selector.match(selectorRe).map((selector2) => selector2.replace(/,$/, "").trim())
418
- );
419
441
  function domPath(element) {
420
442
  const names = [];
421
443
  while (element.parentNode) {
@@ -1875,18 +1897,30 @@
1875
1897
  }
1876
1898
  const targets = hasOwn(instance, key) ? instance[key] : target;
1877
1899
  const observer = observe(targets, handler, options, args);
1878
- if (isFunction(target) && isArray(instance[key]) && observer.unobserve) {
1879
- registerWatch(instance, { handler: updateTargets(observer), immediate: false }, key);
1900
+ if (isFunction(target) && isArray(instance[key])) {
1901
+ registerWatch(
1902
+ instance,
1903
+ { handler: updateTargets(observer, options), immediate: false },
1904
+ key
1905
+ );
1880
1906
  }
1881
1907
  registerObserver(instance, observer);
1882
1908
  }
1883
- function updateTargets(observer) {
1909
+ function updateTargets(observer, options) {
1884
1910
  return (targets, prev) => {
1885
1911
  for (const target of prev) {
1886
- !includes(targets, target) && observer.unobserve(target);
1912
+ if (!includes(targets, target)) {
1913
+ if (observer.unobserve) {
1914
+ observer.unobserve(target);
1915
+ } else {
1916
+ observer.disconnect();
1917
+ }
1918
+ }
1887
1919
  }
1888
1920
  for (const target of targets) {
1889
- !includes(prev, target) && observer.observe(target);
1921
+ if (!includes(prev, target) || !observer.unobserve) {
1922
+ observer.observe(target, options);
1923
+ }
1890
1924
  }
1891
1925
  };
1892
1926
  }
@@ -2153,7 +2187,7 @@
2153
2187
  };
2154
2188
  App.util = util;
2155
2189
  App.options = {};
2156
- App.version = "3.19.5-dev.57ec46163";
2190
+ App.version = "3.19.5-dev.8210c3e08";
2157
2191
 
2158
2192
  const PREFIX = "uk-";
2159
2193
  const DATA = "__uikit__";
@@ -4762,6 +4796,12 @@
4762
4796
  target: ({ target }, $el) => target ? $$(target, $el) : [$el]
4763
4797
  },
4764
4798
  observe: [
4799
+ intersection({
4800
+ handler([{ isIntersecting }]) {
4801
+ this.isIntersecting = isIntersecting;
4802
+ },
4803
+ args: { intersecting: false }
4804
+ }),
4765
4805
  mutation({
4766
4806
  target: ({ target }) => target,
4767
4807
  options: { attributes: true, attributeFilter: ["class"], attributeOldValue: true }
@@ -4798,6 +4838,9 @@
4798
4838
  ],
4799
4839
  update: {
4800
4840
  read() {
4841
+ if (!this.isIntersecting) {
4842
+ return false;
4843
+ }
4801
4844
  for (const target of this.target) {
4802
4845
  replaceClass(
4803
4846
  target,
@@ -6080,18 +6123,10 @@
6080
6123
  }
6081
6124
 
6082
6125
  function getMaxPathLength(el) {
6083
- return Math.ceil(
6084
- Math.max(
6085
- 0,
6086
- ...$$("[stroke]", el).map((stroke) => {
6087
- try {
6088
- return stroke.getTotalLength();
6089
- } catch (e) {
6090
- return 0;
6091
- }
6092
- })
6093
- )
6094
- );
6126
+ return Math.ceil(Math.max(0, ...$$("[stroke]", el).map((stroke) => {
6127
+ var _a;
6128
+ return (_a = stroke.getTotalLength) == null ? void 0 : _a.call(stroke);
6129
+ })));
6095
6130
  }
6096
6131
 
6097
6132
  var svg = {