yet-another-react-lightbox 1.9.0 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/plugins/Zoom.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -136,7 +136,7 @@ The following plugins come bundled in the package:
|
|
|
136
136
|
- [Slideshow](https://yet-another-react-lightbox.vercel.app/plugins/slideshow) - adds slideshow autoplay feature
|
|
137
137
|
- [Thumbnails](https://yet-another-react-lightbox.vercel.app/plugins/thumbnails) - adds thumbnails track
|
|
138
138
|
- [Video](https://yet-another-react-lightbox.vercel.app/plugins/video) - adds support for video slides
|
|
139
|
-
- [Zoom](https://yet-another-react-lightbox.vercel.app/plugins/zoom) - adds zoom feature
|
|
139
|
+
- [Zoom](https://yet-another-react-lightbox.vercel.app/plugins/zoom) - adds image zoom feature
|
|
140
140
|
|
|
141
141
|
## License
|
|
142
142
|
|
package/dist/plugins/Zoom.js
CHANGED
|
@@ -92,12 +92,12 @@ const ZoomButtonsGroup = ({ labels, render }) => {
|
|
|
92
92
|
React.createElement(ZoomButton, { ref: zoomOutRef, key: "zoomOut", labels: labels, render: render, onLoseFocus: focusZoomIn })));
|
|
93
93
|
};
|
|
94
94
|
const getSlideRects = (slide, cover, maxZoomPixelRatio, rect) => {
|
|
95
|
-
var _a, _b;
|
|
95
|
+
var _a, _b, _c;
|
|
96
96
|
let slideRect = { width: 0, height: 0 };
|
|
97
97
|
let maxSlideRect = { width: 0, height: 0 };
|
|
98
98
|
if (rect && !("type" in slide) && "src" in slide) {
|
|
99
|
-
const width = Math.max(...(((_a = slide.srcSet) === null || _a === void 0 ? void 0 : _a.map((x) => x.width)) || [])
|
|
100
|
-
const height = Math.max(...(((_b = slide.srcSet) === null || _b === void 0 ? void 0 : _b.map((x) => x.
|
|
99
|
+
const width = Math.max(...(((_a = slide.srcSet) === null || _a === void 0 ? void 0 : _a.map((x) => x.width)) || []).concat(slide.width ? [slide.width] : []));
|
|
100
|
+
const height = Math.max(...((_c = (_b = slide.srcSet) === null || _b === void 0 ? void 0 : _b.map((x) => x.height).filter((x) => Boolean(x))) !== null && _c !== void 0 ? _c : (slide.aspectRatio ? [width / slide.aspectRatio] : [])).concat(slide.height ? [slide.height] : []));
|
|
101
101
|
if (width > 0 && height > 0 && rect.width > 0 && rect.height > 0) {
|
|
102
102
|
maxSlideRect = cover
|
|
103
103
|
? {
|