@lumx/react 3.7.6-alpha.14 → 3.7.6-alpha.16
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/index.js +9 -4
- package/index.js.map +1 -1
- package/package.json +3 -4
- package/src/components/image-lightbox/internal/ImageSlide.tsx +3 -3
- package/src/components/image-lightbox/useImageLightbox.tsx +2 -2
- package/src/components/thumbnail/Thumbnail.stories.tsx +10 -9
- package/src/components/thumbnail/Thumbnail.tsx +6 -3
- package/src/utils/{startViewTransition.ts → DOM/startViewTransition.ts} +4 -2
- package/src/utils/object/{isEqual.test.js → isEqual.test.ts} +1 -1
- package/src/utils/react/unref.ts +7 -0
- package/src/utils/unref.ts +0 -6
- /package/src/utils/{findImage.tsx → DOM/findImage.tsx} +0 -0
- /package/src/utils/{getPrefersReducedMotion.ts → browser/getPrefersReducedMotion.ts} +0 -0
package/index.js
CHANGED
|
@@ -8137,7 +8137,7 @@ const ImageSlide = /*#__PURE__*/React.memo(props => {
|
|
|
8137
8137
|
tabIndex: isScrollable ? 0 : undefined,
|
|
8138
8138
|
className: `${CLASSNAME$v}__image-slide`
|
|
8139
8139
|
}, /*#__PURE__*/React.createElement(Thumbnail, {
|
|
8140
|
-
imgRef:
|
|
8140
|
+
imgRef: useMergeRefs(imgRef, propImgRef),
|
|
8141
8141
|
image: image,
|
|
8142
8142
|
alt: alt,
|
|
8143
8143
|
className: `${CLASSNAME$v}__thumbnail`,
|
|
@@ -8296,6 +8296,7 @@ const ImageSlideshow = _ref => {
|
|
|
8296
8296
|
}, slideShowControls, zoomControls)));
|
|
8297
8297
|
};
|
|
8298
8298
|
|
|
8299
|
+
/** Unref a react ref or element */
|
|
8299
8300
|
function unref(maybeElement) {
|
|
8300
8301
|
if (maybeElement instanceof HTMLElement) return maybeElement;
|
|
8301
8302
|
return maybeElement === null || maybeElement === void 0 ? void 0 : maybeElement.current;
|
|
@@ -13735,15 +13736,19 @@ const Thumbnail = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
13735
13736
|
}), /*#__PURE__*/React.createElement("span", {
|
|
13736
13737
|
className: `${CLASSNAME$1f}__background`
|
|
13737
13738
|
}, /*#__PURE__*/React.createElement("img", _extends({
|
|
13739
|
+
// Use placeholder image size
|
|
13738
13740
|
width: loadingPlaceholderImage === null || loadingPlaceholderImage === void 0 ? void 0 : loadingPlaceholderImage.naturalWidth,
|
|
13739
13741
|
height: loadingPlaceholderImage === null || loadingPlaceholderImage === void 0 ? void 0 : loadingPlaceholderImage.naturalHeight
|
|
13740
13742
|
}, imgProps, {
|
|
13741
|
-
style: _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
13742
|
-
|
|
13743
|
+
style: _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
13744
|
+
// Reserve space while loading (when possible)
|
|
13745
|
+
width: isLoading ? (imgProps === null || imgProps === void 0 ? void 0 : imgProps.width) || (loadingPlaceholderImage === null || loadingPlaceholderImage === void 0 ? void 0 : loadingPlaceholderImage.naturalWidth) : undefined
|
|
13746
|
+
}, imgProps === null || imgProps === void 0 ? void 0 : imgProps.style), imageErrorStyle), focusPointStyle), loadingStyle),
|
|
13747
|
+
ref: useMergeRefs(setImgElement, propImgRef),
|
|
13743
13748
|
className: classnames(handleBasicClasses({
|
|
13744
13749
|
prefix: `${CLASSNAME$1f}__image`,
|
|
13745
13750
|
isLoading,
|
|
13746
|
-
hasDefinedSize:
|
|
13751
|
+
hasDefinedSize: Boolean((imgProps === null || imgProps === void 0 ? void 0 : imgProps.height) && imgProps.width)
|
|
13747
13752
|
}), imgProps === null || imgProps === void 0 ? void 0 : imgProps.className),
|
|
13748
13753
|
crossOrigin: crossOrigin,
|
|
13749
13754
|
src: image,
|