flemo 1.1.0 → 1.1.2

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 (2) hide show
  1. package/dist/index.mjs +23 -20
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -464,25 +464,28 @@ const It = K({
464
464
  },
465
465
  onSwipeEnd: async (n, e, { currentScreen: t, prevScreen: a, onStart: r }) => {
466
466
  const { offset: s, velocity: o } = e, c = s.x > 50 || o.x > 20;
467
- return r?.(c), M(
468
- t,
469
- {
470
- x: c ? "100%" : 0
471
- },
472
- {
473
- duration: 0.3,
474
- ease: [0.32, 0.72, 0, 1]
475
- }
476
- ), M(
477
- a,
478
- {
479
- x: c ? 0 : -100
480
- },
481
- {
482
- duration: 0.3,
483
- ease: [0.32, 0.72, 0, 1]
484
- }
485
- ), c;
467
+ return r?.(c), await Promise.all([
468
+ M(
469
+ t,
470
+ {
471
+ x: c ? "100%" : 0
472
+ },
473
+ {
474
+ duration: 0.3,
475
+ ease: [0.32, 0.72, 0, 1]
476
+ }
477
+ ),
478
+ M(
479
+ a,
480
+ {
481
+ x: c ? 0 : -100
482
+ },
483
+ {
484
+ duration: 0.3,
485
+ ease: [0.32, 0.72, 0, 1]
486
+ }
487
+ )
488
+ ]), c;
486
489
  }
487
490
  }
488
491
  }), Mt = K({
@@ -1044,7 +1047,7 @@ function Ht({
1044
1047
  T.current = !1, G.current = !0, p.start(f);
1045
1048
  else if (T.current && !y) {
1046
1049
  const g = f.clientX - V.current, k = f.clientY - W.current, ht = N.current.element && N.current.element.scrollTop <= 0 && N.current.hasMarker, mt = D.current.element && D.current.element.scrollLeft <= 0 && D.current.hasMarker;
1047
- (S === "y" && (ht || D.current.element) && k > 0 && g < 2 || S === "x" && (mt || N.current.element) && g > 0 && k < 2) && (T.current = !1, G.current = !0, p.start(f));
1050
+ (S === "y" && (ht || D.current.element) && k > 0 && Math.abs(g) < 4 || S === "x" && (mt || N.current.element) && g > 0 && Math.abs(k) < 4) && (T.current = !1, G.current = !0, p.start(f));
1048
1051
  }
1049
1052
  }, ft = () => {
1050
1053
  T.current = !1, G.current = !1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flemo",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "A modern React router library with built-in motion animations and smooth transitions",
5
5
  "main": "./dist/index.mjs",
6
6
  "module": "./dist/index.mjs",