react-motion-gallery 2.0.46 → 2.0.48

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.
Files changed (2) hide show
  1. package/README.md +6 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1860,6 +1860,10 @@ The hook returns additional refs and setters for the internal fullscreen runtime
1860
1860
  | `enabled` | `boolean` | `false` | Master switch for fullscreen UI. |
1861
1861
  | `items` | `MediaItem[] \| string[]` | `—` | Declared in the type, but current fullscreen media resolution comes from `GalleryCore.fullscreenItems`. |
1862
1862
  | `renderImage` | `({ item, index, isZoomed, className, baseStyle }) => ReactNode` | `—` | Custom fullscreen image renderer. Must render a real descendant `<img>`. With `lazyLoad.images.enabled`, the renderer is mounted only when the slide is allowed and the runtime watches that descendant image for load/decode readiness. |
1863
+ | `closeScroll` | `boolean \| FullscreenCloseScrollOptions` | `false` | Scrolls the matching base item into the center of the viewport when fullscreen closes. `true` enables the default before-close scroll; object form defaults `enabled` to `true`. |
1864
+ | `closeScroll.enabled` | `boolean \| "desktop-only" \| "mobile-only" \| ((context) => boolean)` | `true` in object form | Enables close-scroll conditionally. Function form receives the current fullscreen index, layout, target element, viewport and pointer details, and the resolved `isMobile` flag. |
1865
+ | `closeScroll.timing` | `"before-close" \| "after-close"` | `"before-close"` | Chooses whether to scroll before the close animation starts or after the modal has closed. |
1866
+ | `closeScroll.mobileDetection` | `(context: FullscreenMobileDetectionContext) => boolean` | built-in heuristic | Overrides mobile detection used by `"desktop-only"`, `"mobile-only"`, and the resolver context. The built-in heuristic treats narrow touch/no-hover viewports as mobile. |
1863
1867
  | `video.source` | `(item: MediaItem, index: number) => Plyr.SourceInfo` | `—` | Builds fullscreen Plyr sources for video items. |
1864
1868
  | `video.options` | `Plyr.Options \| ((item: MediaItem, index: number) => Plyr.Options)` | `—` | Builds fullscreen Plyr options. |
1865
1869
  | `video.playOnOpen` | `boolean` | `false` | Attempts to play the fullscreen Plyr video when fullscreen opens directly onto a video slide. Browser autoplay rules still apply. |
@@ -1926,6 +1930,8 @@ The hook returns additional refs and setters for the internal fullscreen runtime
1926
1930
  | `lazyLoad.videos.spinnerClassName` | `string` | `—` | Spinner class for video slides. |
1927
1931
  | `lazyLoad.videos.spinnerStyle` | `React.CSSProperties` | `—` | Spinner style for video slides. |
1928
1932
 
1933
+ Use `fullscreen.closeScroll` when the base gallery item might be offscreen by the time the user closes fullscreen. This keeps the close animation anchored to the matching item instead of landing on a hidden or distant origin.
1934
+
1929
1935
  Fullscreen `effects.crossfade.wheel` uses the same `true`, `false`, or object form as slider wheel crossfade. Its `durationMs` default follows fullscreen `effects.crossfade.durationMs`, which defaults to `120`.
1930
1936
 
1931
1937
  Use path-specific intro timing when the scale handoff should feel slower or faster than the opacity fallback:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-motion-gallery",
3
- "version": "2.0.46",
3
+ "version": "2.0.48",
4
4
  "description": "Composable React media gallery primitives for sliders, grids, masonry, fullscreen, video, zoom/pan, and stable skeleton loading",
5
5
  "license": "PolyForm-Noncommercial-1.0.0",
6
6
  "author": "React Motion Gallery",