Socket
Socket
Sign inDemoInstall

react-touch-carousel

Package Overview
Dependencies
11
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.8.3 to 0.9.0

38

lib/TouchCarousel.js

@@ -15,10 +15,4 @@ 'use strict';

var _Motion = require('react-motion/lib/Motion');
var _reactSpring = require('react-spring');
var _Motion2 = _interopRequireDefault(_Motion);
var _spring = require('react-motion/lib/spring');
var _spring2 = _interopRequireDefault(_spring);
var _utils = require('./utils');

@@ -58,5 +52,5 @@

precision: 0.001,
tension: 200,
friction: 25,
moveScale: 1,
stiffness: 200,
damping: 25,
onRest: function onRest() {},

@@ -109,3 +103,3 @@ onDragStart: function onDragStart() {},

var touchId = (0, _utils.getTouchId)(e);
if (touchId !== _this.tracingTouchId) {
if (touchId !== _this.tracingTouchId || !_this.touchMoves.length) {
_this.touchMoves = [touchMove];

@@ -116,3 +110,3 @@ }

var shouldIgnore = e.defaultPrevented;
if (!shouldIgnore && _this.state.active && _this.touchMoves.length) {
if (!shouldIgnore && _this.state.active) {
if (_this.isMovingCross == null) {

@@ -188,3 +182,3 @@ var _this$props2 = _this.props,

var damping = _this.props.damping / 1e6;
var friction = _this.props.friction / 1e6;
var touchMoves = _this.touchMoves;

@@ -200,3 +194,3 @@

var touchMoveVelocity = ((0, _utils.getTouchPosition)(e)[xy] - touchMoves[i][xy]) / duration;
var momentumDistance = touchMoveVelocity * Math.abs(touchMoveVelocity) / damping / 2;
var momentumDistance = touchMoveVelocity * Math.abs(touchMoveVelocity) / friction / 2;
var cursor = _this.state.cursor;

@@ -380,19 +374,19 @@

renderCard = _props2.renderCard,
stiffness = _props2.stiffness,
damping = _props2.damping,
tension = _props2.tension,
friction = _props2.friction,
precision = _props2.precision,
loop = _props2.loop,
rest = _objectWithoutProperties(_props2, ['component', 'cardSize', 'cardCount', 'cardPadCount', 'renderCard', 'stiffness', 'damping', 'precision', 'loop']);
rest = _objectWithoutProperties(_props2, ['component', 'cardSize', 'cardCount', 'cardPadCount', 'renderCard', 'tension', 'friction', 'precision', 'loop']);
var padCount = loop ? cardPadCount : 0;
var springConfig = { stiffness: stiffness, damping: damping, precision: precision };
var springConfig = { tension: tension, friction: friction, precision: precision };
var computedCursor = this.getComputedCursor();
return _react2.default.createElement(
_Motion2.default,
_reactSpring.Spring,
{
defaultStyle: { cursor: computedCursor },
style: {
cursor: this.shouldEnableSpring() ? (0, _spring2.default)(computedCursor, springConfig) : (0, _utils.precision)(computedCursor, precision)
},
config: springConfig,
from: { cursor: computedCursor },
immediate: !this.shouldEnableSpring(),
to: { cursor: computedCursor },
onRest: this.onSpringRest

@@ -399,0 +393,0 @@ },

@@ -8,3 +8,2 @@ "use strict";

exports.clamp = clamp;
exports.precision = precision;
exports.getTouchPosition = getTouchPosition;

@@ -32,6 +31,2 @@ exports.getTouchId = getTouchId;

function precision(n, p) {
return Math.round(n / p) * p;
}
function getTouchPosition(e) {

@@ -38,0 +33,0 @@ return {

{
"name": "react-touch-carousel",
"version": "0.8.3",
"version": "0.9.0",
"description": "Micro carousel framework for React.JS",

@@ -49,4 +49,4 @@ "main": "lib/index.js",

"raw-loader": "0.5.1",
"react": "16.4.0",
"react-dom": "16.4.0",
"react": "16.6.3",
"react-dom": "16.6.3",
"standard": "11.0.1",

@@ -61,3 +61,3 @@ "standard-loader": "^6.0.1",

"dependencies": {
"react-motion": "0.5.2"
"react-spring": "^6.1.10"
},

@@ -64,0 +64,0 @@ "standard": {

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc