react-spring-lightbox
Advanced tools
Comparing version 1.4.2 to 1.4.3
@@ -5,2 +5,9 @@ # Changelog | ||
## [1.4.3] - 2020-03-23 | ||
### Fixed | ||
- Drop lodash.merge | ||
- Fix image heights not adjusting on window resize | ||
## [1.4.2] - 2020-03-15 | ||
@@ -7,0 +14,0 @@ |
@@ -15,8 +15,7 @@ 'use strict'; | ||
var _defineProperty = _interopDefault(require('@babel/runtime/helpers/defineProperty')); | ||
var merge = _interopDefault(require('lodash.merge')); | ||
var _classCallCheck = _interopDefault(require('@babel/runtime/helpers/classCallCheck')); | ||
var _createClass = _interopDefault(require('@babel/runtime/helpers/createClass')); | ||
var _assertThisInitialized = _interopDefault(require('@babel/runtime/helpers/assertThisInitialized')); | ||
var _possibleConstructorReturn = _interopDefault(require('@babel/runtime/helpers/possibleConstructorReturn')); | ||
var _getPrototypeOf = _interopDefault(require('@babel/runtime/helpers/getPrototypeOf')); | ||
var _assertThisInitialized = _interopDefault(require('@babel/runtime/helpers/assertThisInitialized')); | ||
var _inherits = _interopDefault(require('@babel/runtime/helpers/inherits')); | ||
@@ -386,3 +385,3 @@ var ReactDOM = _interopDefault(require('react-dom')); | ||
}); | ||
return React__default.createElement(AnimatedImage, { | ||
return /*#__PURE__*/React__default.createElement(AnimatedImage, { | ||
ref: imageRef, | ||
@@ -480,2 +479,3 @@ className: "lightbox-image", | ||
var _useWindowSize = useWindowSize(), | ||
windowHeight = _useWindowSize.height, | ||
pageWidth = _useWindowSize.width; | ||
@@ -523,3 +523,3 @@ | ||
if (pagerHeight !== currPagerHeight) setPagerHeight(currPagerHeight); | ||
}, [currentIndex, pagerHeight]); // Animate page change if currentIndex changes | ||
}, [currentIndex, pagerHeight, windowHeight]); // Animate page change if currentIndex changes | ||
@@ -622,3 +622,3 @@ React.useEffect(function () { | ||
display = _ref4.display; | ||
return React__default.createElement(AnimatedImagePager, { | ||
return /*#__PURE__*/React__default.createElement(AnimatedImagePager, { | ||
role: "presentation", | ||
@@ -637,3 +637,3 @@ ref: imageStageRef.current[i], | ||
} | ||
}, React__default.createElement(PagerContentWrapper, null, React__default.createElement(PagerInnerContentWrapper, null, React__default.createElement(ImageContainer, { | ||
}, /*#__PURE__*/React__default.createElement(PagerContentWrapper, null, /*#__PURE__*/React__default.createElement(PagerInnerContentWrapper, null, /*#__PURE__*/React__default.createElement(ImageContainer, { | ||
onClick: function onClick(e) { | ||
@@ -643,3 +643,3 @@ e.stopPropagation(); | ||
} | ||
}, React__default.createElement(Image, { | ||
}, /*#__PURE__*/React__default.createElement(Image, { | ||
setDisableDrag: setDisableDrag, | ||
@@ -700,7 +700,7 @@ src: images[i].src, | ||
return React__default.createElement(ImageStageContainer, { | ||
return /*#__PURE__*/React__default.createElement(ImageStageContainer, { | ||
className: "lightbox-image-stage" | ||
}, renderPrevButton({ | ||
canPrev: canPrev | ||
}), React__default.createElement(ImagePager, { | ||
}), /*#__PURE__*/React__default.createElement(ImagePager, { | ||
images: images, | ||
@@ -768,3 +768,3 @@ currentIndex: currentIndex, | ||
}; | ||
var transitions = web.useTransition(isOpen, null, merge(defaultTransition, pageTransitionConfig)); | ||
var transitions = web.useTransition(isOpen, null, _objectSpread$1({}, defaultTransition, {}, pageTransitionConfig)); | ||
return transitions.map(function (_ref2) { | ||
@@ -774,3 +774,3 @@ var item = _ref2.item, | ||
props = _ref2.props; | ||
return item && React__default.createElement(AnimatedPageContainer, { | ||
return item && /*#__PURE__*/React__default.createElement(AnimatedPageContainer, { | ||
key: key, | ||
@@ -784,2 +784,6 @@ className: "lightbox-container".concat(className ? " ".concat(className) : ''), | ||
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } | ||
/** | ||
@@ -796,5 +800,5 @@ * Creates a SSR + next.js friendly React Portal inside <body /> | ||
var _super = _createSuper(CreatePortal); | ||
function CreatePortal() { | ||
var _getPrototypeOf2; | ||
var _this; | ||
@@ -808,3 +812,3 @@ | ||
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(CreatePortal)).call.apply(_getPrototypeOf2, [this].concat(args))); | ||
_this = _super.call.apply(_super, [this].concat(args)); | ||
@@ -938,3 +942,3 @@ _defineProperty(_assertThisInitialized(_this), "preventWheel", function (e) { | ||
}); | ||
return React__default.createElement(CreatePortal, null, React__default.createElement(PageContainer, { | ||
return /*#__PURE__*/React__default.createElement(CreatePortal, null, /*#__PURE__*/React__default.createElement(PageContainer, { | ||
isOpen: isOpen, | ||
@@ -944,3 +948,3 @@ className: className, | ||
pageTransitionConfig: pageTransitionConfig | ||
}, renderHeader(), React__default.createElement(ImageStage, { | ||
}, renderHeader(), /*#__PURE__*/React__default.createElement(ImageStage, { | ||
images: images, | ||
@@ -947,0 +951,0 @@ onClose: onClose, |
@@ -10,8 +10,7 @@ import React, { useEffect, useState, useRef } from 'react'; | ||
import _defineProperty from '@babel/runtime/helpers/defineProperty'; | ||
import merge from 'lodash.merge'; | ||
import _classCallCheck from '@babel/runtime/helpers/classCallCheck'; | ||
import _createClass from '@babel/runtime/helpers/createClass'; | ||
import _assertThisInitialized from '@babel/runtime/helpers/assertThisInitialized'; | ||
import _possibleConstructorReturn from '@babel/runtime/helpers/possibleConstructorReturn'; | ||
import _getPrototypeOf from '@babel/runtime/helpers/getPrototypeOf'; | ||
import _assertThisInitialized from '@babel/runtime/helpers/assertThisInitialized'; | ||
import _inherits from '@babel/runtime/helpers/inherits'; | ||
@@ -381,3 +380,3 @@ import ReactDOM from 'react-dom'; | ||
}); | ||
return React.createElement(AnimatedImage, { | ||
return /*#__PURE__*/React.createElement(AnimatedImage, { | ||
ref: imageRef, | ||
@@ -475,2 +474,3 @@ className: "lightbox-image", | ||
var _useWindowSize = useWindowSize(), | ||
windowHeight = _useWindowSize.height, | ||
pageWidth = _useWindowSize.width; | ||
@@ -518,3 +518,3 @@ | ||
if (pagerHeight !== currPagerHeight) setPagerHeight(currPagerHeight); | ||
}, [currentIndex, pagerHeight]); // Animate page change if currentIndex changes | ||
}, [currentIndex, pagerHeight, windowHeight]); // Animate page change if currentIndex changes | ||
@@ -617,3 +617,3 @@ useEffect(function () { | ||
display = _ref4.display; | ||
return React.createElement(AnimatedImagePager, { | ||
return /*#__PURE__*/React.createElement(AnimatedImagePager, { | ||
role: "presentation", | ||
@@ -632,3 +632,3 @@ ref: imageStageRef.current[i], | ||
} | ||
}, React.createElement(PagerContentWrapper, null, React.createElement(PagerInnerContentWrapper, null, React.createElement(ImageContainer, { | ||
}, /*#__PURE__*/React.createElement(PagerContentWrapper, null, /*#__PURE__*/React.createElement(PagerInnerContentWrapper, null, /*#__PURE__*/React.createElement(ImageContainer, { | ||
onClick: function onClick(e) { | ||
@@ -638,3 +638,3 @@ e.stopPropagation(); | ||
} | ||
}, React.createElement(Image, { | ||
}, /*#__PURE__*/React.createElement(Image, { | ||
setDisableDrag: setDisableDrag, | ||
@@ -695,7 +695,7 @@ src: images[i].src, | ||
return React.createElement(ImageStageContainer, { | ||
return /*#__PURE__*/React.createElement(ImageStageContainer, { | ||
className: "lightbox-image-stage" | ||
}, renderPrevButton({ | ||
canPrev: canPrev | ||
}), React.createElement(ImagePager, { | ||
}), /*#__PURE__*/React.createElement(ImagePager, { | ||
images: images, | ||
@@ -763,3 +763,3 @@ currentIndex: currentIndex, | ||
}; | ||
var transitions = useTransition(isOpen, null, merge(defaultTransition, pageTransitionConfig)); | ||
var transitions = useTransition(isOpen, null, _objectSpread$1({}, defaultTransition, {}, pageTransitionConfig)); | ||
return transitions.map(function (_ref2) { | ||
@@ -769,3 +769,3 @@ var item = _ref2.item, | ||
props = _ref2.props; | ||
return item && React.createElement(AnimatedPageContainer, { | ||
return item && /*#__PURE__*/React.createElement(AnimatedPageContainer, { | ||
key: key, | ||
@@ -779,2 +779,6 @@ className: "lightbox-container".concat(className ? " ".concat(className) : ''), | ||
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } | ||
/** | ||
@@ -791,5 +795,5 @@ * Creates a SSR + next.js friendly React Portal inside <body /> | ||
var _super = _createSuper(CreatePortal); | ||
function CreatePortal() { | ||
var _getPrototypeOf2; | ||
var _this; | ||
@@ -803,3 +807,3 @@ | ||
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(CreatePortal)).call.apply(_getPrototypeOf2, [this].concat(args))); | ||
_this = _super.call.apply(_super, [this].concat(args)); | ||
@@ -933,3 +937,3 @@ _defineProperty(_assertThisInitialized(_this), "preventWheel", function (e) { | ||
}); | ||
return React.createElement(CreatePortal, null, React.createElement(PageContainer, { | ||
return /*#__PURE__*/React.createElement(CreatePortal, null, /*#__PURE__*/React.createElement(PageContainer, { | ||
isOpen: isOpen, | ||
@@ -939,3 +943,3 @@ className: className, | ||
pageTransitionConfig: pageTransitionConfig | ||
}, renderHeader(), React.createElement(ImageStage, { | ||
}, renderHeader(), /*#__PURE__*/React.createElement(ImageStage, { | ||
images: images, | ||
@@ -942,0 +946,0 @@ onClose: onClose, |
{ | ||
"name": "react-spring-lightbox", | ||
"version": "1.4.2", | ||
"version": "1.4.3", | ||
"description": "A flexible image gallery lightbox with native-feeling touch gestures and buttery smooth animations, built with react-spring.", | ||
@@ -65,8 +65,8 @@ "author": "Tim Ellenberger <timellenberger@gmail.com>", | ||
"devDependencies": { | ||
"@babel/core": "^7.8.7", | ||
"@babel/core": "^7.9.0", | ||
"@babel/plugin-proposal-class-properties": "^7.8.3", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.8.3", | ||
"@babel/plugin-transform-runtime": "^7.8.3", | ||
"@babel/preset-env": "^7.8.7", | ||
"@babel/preset-react": "^7.8.3", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.9.0", | ||
"@babel/plugin-transform-runtime": "^7.9.0", | ||
"@babel/preset-env": "^7.9.0", | ||
"@babel/preset-react": "^7.9.1", | ||
"@rollup/plugin-commonjs": "^11.0.2", | ||
@@ -82,3 +82,3 @@ "@rollup/plugin-node-resolve": "^7.1.1", | ||
"eslint-config-airbnb": "^18.1.0", | ||
"eslint-config-prettier": "^6.10.0", | ||
"eslint-config-prettier": "^6.10.1", | ||
"eslint-plugin-import": "^2.20.1", | ||
@@ -93,6 +93,6 @@ "eslint-plugin-jsx-a11y": "^6.2.3", | ||
"prettier": "^1.19.1", | ||
"react": "^16.13.0", | ||
"react-dom": "^16.13.0", | ||
"react-is": "^16.13.0", | ||
"rollup": "^2.0.6", | ||
"react": "^16.13.1", | ||
"react-dom": "^16.13.1", | ||
"react-is": "^16.13.1", | ||
"rollup": "^2.1.0", | ||
"rollup-plugin-babel": "^4.4.0", | ||
@@ -108,5 +108,4 @@ "rollup-plugin-filesize": "^6.2.1", | ||
"lodash.clamp": "^4.0.3", | ||
"lodash.merge": "^4.6.2", | ||
"react-use-gesture": "^7.0.5" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
200075
7
1693
- Removedlodash.merge@^4.6.2
- Removedlodash.merge@4.6.2(transitive)