yet-another-react-lightbox 2.2.7 → 2.3.0

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.
@@ -140,6 +140,13 @@ export const ZoomContainer = ({ slide, offset, rect, render, carousel, animation
140
140
  }
141
141
  }
142
142
  }, [offset, zoom, maxZoom, isMinZoom, isMaxZoom, setIsMinZoom, setIsMaxZoom]);
143
+ const onZoomCallback = useEventCallback(() => {
144
+ var _a;
145
+ if (offset === 0) {
146
+ (_a = on.zoom) === null || _a === void 0 ? void 0 : _a.call(on, zoom);
147
+ }
148
+ });
149
+ useLayoutEffect(onZoomCallback, [zoom, onZoomCallback]);
143
150
  const translateCoordinates = React.useCallback((event) => {
144
151
  if (controllerRef.current) {
145
152
  const { pageX, pageY } = event;
@@ -49,5 +49,8 @@ declare module "../../types" {
49
49
  /** render custom Zoom out icon */
50
50
  iconZoomOut?: () => React.ReactNode;
51
51
  }
52
+ interface Callbacks {
53
+ zoom?: (level: number) => void;
54
+ }
52
55
  }
53
56
  export default Zoom;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yet-another-react-lightbox",
3
- "version": "2.2.7",
3
+ "version": "2.3.0",
4
4
  "description": "Modern React lightbox component",
5
5
  "author": "Igor Danchenko",
6
6
  "license": "MIT",