embla-carousel-svelte
Advanced tools
Comparing version 8.0.0-rc10 to 8.0.0-rc11
@@ -328,8 +328,6 @@ (function (global, factory) { | ||
const diff = dragTracker.pointerMove(evt); | ||
const directionDiff = direction.apply(diff); | ||
if (diffScroll > dragThreshold) preventClick = true; | ||
scrollBody.useFriction(0.3).useDuration(1); | ||
if (directionDiff) scrollBody.useDirection(directionDiff); | ||
animation.start(); | ||
target.add(directionDiff); | ||
target.add(direction.apply(diff)); | ||
evt.preventDefault(); | ||
@@ -471,13 +469,21 @@ } | ||
let scrollFriction = baseFriction; | ||
let rawLocation = location.get(); | ||
let rawLocationPrevious = 0; | ||
function seek() { | ||
const diff = target.get() - location.get(); | ||
const isInstant = !scrollDuration; | ||
let directionDiff = 0; | ||
if (isInstant) { | ||
bodyVelocity = 0; | ||
location.set(target); | ||
directionDiff = diff; | ||
} else { | ||
bodyVelocity += diff / scrollDuration; | ||
bodyVelocity *= scrollFriction; | ||
rawLocation += bodyVelocity; | ||
location.add(bodyVelocity); | ||
directionDiff = rawLocation - rawLocationPrevious; | ||
} | ||
scrollDirection = mathSign(directionDiff); | ||
rawLocationPrevious = rawLocation; | ||
hasSettled = mathAbs(diff) < 0.001; | ||
@@ -512,6 +518,2 @@ return self; | ||
} | ||
function useDirection(n) { | ||
scrollDirection = mathSign(n); | ||
return self; | ||
} | ||
const self = { | ||
@@ -525,3 +527,2 @@ direction, | ||
useBaseDuration, | ||
useDirection, | ||
useFriction, | ||
@@ -739,3 +740,2 @@ useDuration | ||
const indexDiff = target.index !== indexCurrent.get(); | ||
scrollBody.useDirection(distanceDiff); | ||
targetVector.add(distanceDiff); | ||
@@ -742,0 +742,0 @@ if (distanceDiff) { |
{ | ||
"name": "embla-carousel-svelte", | ||
"version": "8.0.0-rc10", | ||
"version": "8.0.0-rc11", | ||
"author": "David Jerleke", | ||
@@ -59,4 +59,4 @@ "description": "A lightweight carousel library with fluid motion and great swipe precision", | ||
"dependencies": { | ||
"embla-carousel": "8.0.0-rc10", | ||
"embla-carousel-reactive-utils": "8.0.0-rc10" | ||
"embla-carousel": "8.0.0-rc11", | ||
"embla-carousel-reactive-utils": "8.0.0-rc11" | ||
}, | ||
@@ -63,0 +63,0 @@ "peerDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57260
+ Addedembla-carousel@8.0.0-rc11(transitive)
+ Addedembla-carousel-reactive-utils@8.0.0-rc11(transitive)
- Removedembla-carousel@8.0.0-rc10(transitive)
- Removedembla-carousel-reactive-utils@8.0.0-rc10(transitive)
Updatedembla-carousel@8.0.0-rc11