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

supercharged-slider

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

supercharged-slider - npm Package Compare versions

Comparing version 0.3.2 to 0.3.3

src/middlewares/navigation.ts

4

dist/index.js

@@ -182,3 +182,2 @@ var index = "";

return;
console.log({ middlewares, currentBreakpoint });
runMiddlewares(Object.values(middlewares), slider);

@@ -213,3 +212,3 @@ }

const isVertical = () => slider.direction === "vertical";
const isTargetValid = (e) => e.composedPath().includes(slider.element);
const isTargetValid = (e) => e.composedPath().includes(slider.wrapper);
let isDragging = false;

@@ -260,3 +259,2 @@ let wrapperPositionBeforeDrag = 0;

const onCleanUp = () => {
console.log("cleanUp");
isDragging = false;

@@ -263,0 +261,0 @@ wrapperPositionBeforeDrag = 0;

@@ -1,2 +0,2 @@

export declare type Hook<T extends unknown> = (props?: T) => void;
export declare type Hook<T extends unknown> = (props: T) => void;
export interface Slider {

@@ -3,0 +3,0 @@ element: HTMLElement;

{
"name": "supercharged-slider",
"version": "0.3.2",
"version": "0.3.3",
"description": "A super modular tiny slider library.",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -11,3 +11,3 @@ import './demo.scss';

import vertical from './middlewares/vertical';
import autoplay from './middlewares/autoplay';
import navigation from './middlewares/navigation';

@@ -28,3 +28,6 @@ const instance1 = createSlider({

slidesPerView(6),
autoplay({ interval: 1000 }),
navigation({
prev: '.s-slider-2 .s-navigation-button-prev',
next: '.s-slider-2 .s-navigation-button-next',
}),
breakpoints({

@@ -31,0 +34,0 @@ 768: [slidesPerView(1)],

@@ -26,4 +26,10 @@ import { Middleware } from '~/types';

const onCleanUp = () => {
clearTimeout(timeout);
slider.removeSlideChangeHook(start);
slider.removeCleanUpHook(onCleanUp);
};
slider.onCleanUp(onCleanUp);
slider.onSlideChange(start);
slider.onCleanUp(() => clearTimeout(timeout));
},

@@ -30,0 +36,0 @@ });

@@ -40,4 +40,2 @@ import runMiddlewares from '~/utils/runMiddlewares';

console.log({ middlewares, currentBreakpoint });
runMiddlewares(Object.values(middlewares), slider);

@@ -44,0 +42,0 @@ },

@@ -8,3 +8,3 @@ import { Middleware } from '~/types';

const isVertical = () => slider.direction === 'vertical';
const isTargetValid = (e: MouseEvent) => e.composedPath().includes(slider.element);
const isTargetValid = (e: MouseEvent) => e.composedPath().includes(slider.wrapper);

@@ -67,3 +67,2 @@ let isDragging = false;

const onCleanUp = () => {
console.log('cleanUp');
isDragging = false;

@@ -70,0 +69,0 @@ wrapperPositionBeforeDrag = 0;

@@ -1,2 +0,2 @@

export type Hook<T extends unknown> = (props?: T) => void;
export type Hook<T extends unknown> = (props: T) => void;
export interface Slider {

@@ -3,0 +3,0 @@ element: HTMLElement

Sorry, the diff of this file is not supported yet

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