Socket
Socket
Sign inDemoInstall

embla-carousel-auto-height

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

embla-carousel-auto-height - npm Package Compare versions

Comparing version 8.0.0-rc03 to 8.0.0-rc04

16

embla-carousel-auto-height.cjs.js

@@ -11,3 +11,3 @@ 'use strict';

let options;
let carousel;
let emblaApi;
let slideBounds = [];

@@ -17,4 +17,4 @@ let slideHeights = [];

const inViewThreshold = 0.5;
function init(embla, optionsHandler) {
carousel = embla;
function init(emblaApiInstance, optionsHandler) {
emblaApi = emblaApiInstance;
const {

@@ -33,11 +33,11 @@ mergeOptions,

slideRects
} = carousel.internalEngine();
} = emblaApi.internalEngine();
if (axis === 'y') return;
slideBounds = slidesInView.findSlideBounds(undefined, inViewThreshold);
slideHeights = slideRects.map(rect => rect.height);
heightEvents.forEach(evt => carousel.on(evt, setContainerHeight));
heightEvents.forEach(evt => emblaApi.on(evt, setContainerHeight));
setContainerHeight();
}
function destroy() {
heightEvents.forEach(evt => carousel.off(evt, setContainerHeight));
heightEvents.forEach(evt => emblaApi.off(evt, setContainerHeight));
setContainerHeight(undefined, 'destroy');

@@ -49,3 +49,3 @@ }

target
} = carousel.internalEngine();
} = emblaApi.internalEngine();
const inViewIndexes = slidesInView.check(target.get(), slideBounds);

@@ -57,3 +57,3 @@ const heights = inViewIndexes.map(index => slideHeights[index]);

const height = evt === 'destroy' ? options.destroyHeight : `${highestInView()}px`;
carousel.containerNode().style.height = height;
emblaApi.containerNode().style.height = height;
}

@@ -60,0 +60,0 @@ const self = {

@@ -9,3 +9,3 @@ const defaultOptions = {

let options;
let carousel;
let emblaApi;
let slideBounds = [];

@@ -15,4 +15,4 @@ let slideHeights = [];

const inViewThreshold = 0.5;
function init(embla, optionsHandler) {
carousel = embla;
function init(emblaApiInstance, optionsHandler) {
emblaApi = emblaApiInstance;
const {

@@ -31,11 +31,11 @@ mergeOptions,

slideRects
} = carousel.internalEngine();
} = emblaApi.internalEngine();
if (axis === 'y') return;
slideBounds = slidesInView.findSlideBounds(undefined, inViewThreshold);
slideHeights = slideRects.map(rect => rect.height);
heightEvents.forEach(evt => carousel.on(evt, setContainerHeight));
heightEvents.forEach(evt => emblaApi.on(evt, setContainerHeight));
setContainerHeight();
}
function destroy() {
heightEvents.forEach(evt => carousel.off(evt, setContainerHeight));
heightEvents.forEach(evt => emblaApi.off(evt, setContainerHeight));
setContainerHeight(undefined, 'destroy');

@@ -47,3 +47,3 @@ }

target
} = carousel.internalEngine();
} = emblaApi.internalEngine();
const inViewIndexes = slidesInView.check(target.get(), slideBounds);

@@ -55,3 +55,3 @@ const heights = inViewIndexes.map(index => slideHeights[index]);

const height = evt === 'destroy' ? options.destroyHeight : `${highestInView()}px`;
carousel.containerNode().style.height = height;
emblaApi.containerNode().style.height = height;
}

@@ -58,0 +58,0 @@ const self = {

{
"name": "embla-carousel-auto-height",
"version": "8.0.0-rc03",
"version": "8.0.0-rc04",
"author": "David Jerleke",

@@ -58,4 +58,4 @@ "description": "An auto height plugin for Embla Carousel",

"peerDependencies": {
"embla-carousel": "8.0.0-rc03"
"embla-carousel": "8.0.0-rc04"
}
}
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