yet-another-react-lightbox 1.13.1 → 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
|
-
:
|
|
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") },
|
|
@@ -80,9 +80,6 @@
|
|
|
80
80
|
height: var(--yarl__thumbnails_thumbnail_height, 80px);
|
|
81
81
|
box-sizing: content-box;
|
|
82
82
|
}
|
|
83
|
-
.yarl__thumbnails_thumbnail > *:only-child {
|
|
84
|
-
flex: 1;
|
|
85
|
-
}
|
|
86
83
|
.yarl__thumbnails_thumbnail_active {
|
|
87
84
|
border-color: var(--yarl__thumbnails_thumbnail_active_border_color, var(--yarl__color_button_active, #fff));
|
|
88
85
|
}
|
package/dist/styles.css
CHANGED