Socket
Socket
Sign inDemoInstall

rc-motion

Package Overview
Dependencies
Maintainers
3
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-motion - npm Package Compare versions

Comparing version 2.7.2 to 2.7.3

13

es/hooks/useStatus.js

@@ -92,5 +92,5 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";

// ============================= Step =============================
var eventHandlers = React.useMemo(function () {
var getEventHandlers = function getEventHandlers(targetStatus) {
var _ref2, _ref3, _ref4;
switch (status) {
switch (targetStatus) {
case STATUS_APPEAR:

@@ -105,2 +105,5 @@ return _ref2 = {}, _defineProperty(_ref2, STEP_PREPARE, onAppearPrepare), _defineProperty(_ref2, STEP_START, onAppearStart), _defineProperty(_ref2, STEP_ACTIVE, onAppearActive), _ref2;

}
};
var eventHandlers = React.useMemo(function () {
return getEventHandlers(status);
}, [status]);

@@ -172,7 +175,11 @@ var _useStepQueue = useStepQueue(status, !supportMotion, function (newStep) {

}
var nextEventHandlers = getEventHandlers(nextStatus);
// Update to next status
if (nextStatus) {
if (nextStatus && (supportMotion || nextEventHandlers[STEP_PREPARE])) {
setStatus(nextStatus);
startStep();
} else {
// Set back in case no motion but prev status has prepare step
setStatus(STATUS_NONE);
}

@@ -179,0 +186,0 @@ }, [visible]);

@@ -101,5 +101,5 @@ "use strict";

// ============================= Step =============================
var eventHandlers = React.useMemo(function () {
var getEventHandlers = function getEventHandlers(targetStatus) {
var _ref2, _ref3, _ref4;
switch (status) {
switch (targetStatus) {
case _interface.STATUS_APPEAR:

@@ -114,2 +114,5 @@ return _ref2 = {}, (0, _defineProperty2.default)(_ref2, _interface.STEP_PREPARE, onAppearPrepare), (0, _defineProperty2.default)(_ref2, _interface.STEP_START, onAppearStart), (0, _defineProperty2.default)(_ref2, _interface.STEP_ACTIVE, onAppearActive), _ref2;

}
};
var eventHandlers = React.useMemo(function () {
return getEventHandlers(status);
}, [status]);

@@ -181,7 +184,11 @@ var _useStepQueue = (0, _useStepQueue3.default)(status, !supportMotion, function (newStep) {

}
var nextEventHandlers = getEventHandlers(nextStatus);
// Update to next status
if (nextStatus) {
if (nextStatus && (supportMotion || nextEventHandlers[_interface.STEP_PREPARE])) {
setStatus(nextStatus);
startStep();
} else {
// Set back in case no motion but prev status has prepare step
setStatus(_interface.STATUS_NONE);
}

@@ -188,0 +195,0 @@ }, [visible]);

{
"name": "rc-motion",
"version": "2.7.2",
"version": "2.7.3",
"description": "React lifecycle controlled motion library",

@@ -5,0 +5,0 @@ "keywords": [

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