Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

embla-carousel-vue

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

embla-carousel-vue - npm Package Compare versions

Comparing version 8.0.0-rc01 to 8.0.0-rc02

52

embla-carousel-vue.umd.js

@@ -146,3 +146,3 @@ (function (global, factory) {

}
function Animation(callback) {
function Animation(update, draw) {
const documentVisibleHandler = EventStore();

@@ -153,3 +153,5 @@ const timeStep = 1000 / 60;

let animationFrame = 0;
function init() {
let engine;
function init(engineInstance) {
engine = engineInstance;
documentVisibleHandler.add(document, 'visibilitychange', () => {

@@ -176,5 +178,6 @@ if (document.hidden) lastTimeStamp = null;

while (delta >= timeStep) {
callback();
update(engine);
delta -= timeStep;
}
draw(engine);
if (animationFrame) start();

@@ -582,2 +585,3 @@ }

attractionDirection = mathSign(attraction.get() || diff);
return self;
}

@@ -1142,10 +1146,18 @@ function settle(target) {

const slideIndexes = arrayKeys(slides);
// Draw
const animationCallback = () => {
const pointerDown = engine.dragHandler.pointerDown();
if (!loop) engine.scrollBounds.constrain(pointerDown);
engine.scrollBody.seek(target);
const settled = engine.scrollBody.settle(target);
// Animation
function update({
target,
dragHandler,
scrollBody,
scrollBounds,
scrollLooper,
slideLooper,
eventHandler,
animation
}) {
const pointerDown = dragHandler.pointerDown();
if (!loop) scrollBounds.constrain(pointerDown);
const settled = scrollBody.seek(target).settle(target);
if (settled && !pointerDown) {
engine.animation.stop();
animation.stop();
eventHandler.emit('settle');

@@ -1157,10 +1169,15 @@ }

if (loop) {
engine.scrollLooper.loop(engine.scrollBody.direction());
engine.slideLooper.loop();
scrollLooper.loop(scrollBody.direction());
slideLooper.loop();
}
engine.translate.to(location);
};
}
function draw({
translate,
location
}) {
translate.to(location);
}
// Shared
const friction = 0.68;
const animation = Animation(animationCallback);
const animation = Animation(update, draw);
const startLocation = scrollSnaps[index.get()];

@@ -1175,2 +1192,3 @@ const location = Vector1D(startLocation);

const engine = {
eventHandler,
containerRect,

@@ -1342,4 +1360,4 @@ slideRects,

}) => options)]).forEach(query => mediaHandlers.add(query, 'change', reActivate));
engine.animation.init();
eventHandler.init(self);
engine.animation.init(engine);
engine.eventHandler.init(self);
engine.resizeHandler.init(self, options.watchResize);

@@ -1346,0 +1364,0 @@ engine.slidesHandler.init(self, options.watchSlides);

{
"name": "embla-carousel-vue",
"version": "8.0.0-rc01",
"version": "8.0.0-rc02",
"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-rc01",
"embla-carousel-reactive-utils": "8.0.0-rc01"
"embla-carousel": "8.0.0-rc02",
"embla-carousel-reactive-utils": "8.0.0-rc02"
},

@@ -63,0 +63,0 @@ "peerDependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc