yet-another-react-lightbox 1.13.3 → 1.13.4

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.
@@ -49,7 +49,10 @@ export const ImageSlide = ({ slide: image, offset, render, rect, imageFit, onCli
49
49
  maxWidth: `min(${maxWidth}px, 100%)`,
50
50
  maxHeight: `min(${maxHeight}px, 100%)`,
51
51
  }
52
- : undefined;
52
+ : {
53
+ maxWidth: "100%",
54
+ maxHeight: "100%",
55
+ };
53
56
  const srcSet = (_g = image.srcSet) === null || _g === void 0 ? void 0 : _g.sort((a, b) => a.width - b.width).map((item) => `${item.src} ${item.width}w`).join(", ");
54
57
  const estimateActualWidth = () => {
55
58
  if (rect && !cover) {
@@ -62,9 +65,7 @@ export const ImageSlide = ({ slide: image, offset, render, rect, imageFit, onCli
62
65
  }
63
66
  return Number.MAX_VALUE;
64
67
  };
65
- const sizes = srcSet && rect && hasWindow()
66
- ? `${Math.ceil((Math.min(estimateActualWidth(), rect.width) / window.innerWidth) * 100)}vw`
67
- : undefined;
68
+ const sizes = srcSet && rect && hasWindow() ? `${Math.round(Math.min(estimateActualWidth(), rect.width))}px` : undefined;
68
69
  return (React.createElement(React.Fragment, null,
69
70
  React.createElement("img", { ref: setImageRef, onLoad: onLoad, onError: onError, onClick: onClick, className: clsx(cssClass("slide_image"), cover && cssClass("slide_image_cover"), status !== SLIDE_STATUS_COMPLETE && cssClass("slide_image_loading")), draggable: false, alt: image.alt, style: style, sizes: sizes, srcSet: srcSet, src: image.src }),
70
71
  status !== SLIDE_STATUS_COMPLETE && (React.createElement("div", { className: cssClass("slide_placeholder") },
package/dist/styles.css CHANGED
@@ -56,8 +56,6 @@
56
56
  transition: unset;
57
57
  }
58
58
  .yarl__slide_image {
59
- display: block;
60
- flex: 1;
61
59
  -o-object-fit: contain;
62
60
  object-fit: contain;
63
61
  -moz-user-select: none;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yet-another-react-lightbox",
3
- "version": "1.13.3",
3
+ "version": "1.13.4",
4
4
  "description": "Modern React lightbox component",
5
5
  "author": "Igor Danchenko",
6
6
  "license": "MIT",