yet-another-react-lightbox 3.4.0 → 3.5.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.
package/README.md CHANGED
@@ -130,6 +130,7 @@ The following plugins come bundled in the package:
130
130
  - [Captions](https://yet-another-react-lightbox.com/plugins/captions) - adds support for slide title and
131
131
  description
132
132
  - [Counter](https://yet-another-react-lightbox.com/plugins/counter) - adds slides counter
133
+ - [Download](https://yet-another-react-lightbox.com/plugins/download) - adds download button
133
134
  - [Fullscreen](https://yet-another-react-lightbox.com/plugins/fullscreen) - adds support for fullscreen mode
134
135
  - [Inline](https://yet-another-react-lightbox.com/plugins/inline) - adds support for inline rendering mode
135
136
  - [Slideshow](https://yet-another-react-lightbox.com/plugins/slideshow) - adds slideshow autoplay feature
@@ -1,4 +1,4 @@
1
1
  import * as React from "react";
2
2
  import { ComponentProps } from "../../types.js";
3
- export declare function Portal({ children, animation, styles, className, on, close }: ComponentProps): React.ReactPortal | null;
3
+ export declare function Portal({ children, animation, styles, className, on, portal, close }: ComponentProps): React.ReactPortal | null;
4
4
  export declare const PortalModule: import("../../types.js").Module;
@@ -21,7 +21,7 @@ function setAttribute(element, attribute, value) {
21
21
  }
22
22
  };
23
23
  }
24
- export function Portal({ children, animation, styles, className, on, close }) {
24
+ export function Portal({ children, animation, styles, className, on, portal, close }) {
25
25
  const [mounted, setMounted] = React.useState(false);
26
26
  const [visible, setVisible] = React.useState(false);
27
27
  const cleanup = React.useRef([]);
@@ -86,7 +86,7 @@ export function Portal({ children, animation, styles, className, on, close }) {
86
86
  ? { [cssVar("fade_animation_timing_function")]: animation.easing.fade }
87
87
  : null),
88
88
  ...styles.root,
89
- } }, children), document.body)
89
+ } }, children), portal.root || document.body)
90
90
  : null;
91
91
  }
92
92
  export const PortalModule = createModule(MODULE_PORTAL, Portal);
package/dist/props.js CHANGED
@@ -31,6 +31,7 @@ export const LightboxDefaultProps = {
31
31
  touchAction: "none",
32
32
  closeOnBackdropClick: false,
33
33
  },
34
+ portal: {},
34
35
  on: {},
35
36
  styles: {},
36
37
  className: "",
package/dist/types.d.ts CHANGED
@@ -25,6 +25,8 @@ export interface LightboxProps {
25
25
  animation: AnimationSettings;
26
26
  /** controller settings */
27
27
  controller: ControllerSettings;
28
+ /** portal settings */
29
+ portal: PortalSettings;
28
30
  /** lifecycle callbacks */
29
31
  on: Callbacks;
30
32
  /** customization styles */
@@ -177,6 +179,11 @@ export interface ControllerRef {
177
179
  /** get lightbox state */
178
180
  getLightboxState: () => LightboxState;
179
181
  }
182
+ /** Portal settings */
183
+ export interface PortalSettings {
184
+ /** portal mount point */
185
+ root?: DocumentFragment | Element | null;
186
+ }
180
187
  /** Lightbox navigation action */
181
188
  export interface NavigationAction {
182
189
  /** navigate through the specified number of slides */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yet-another-react-lightbox",
3
- "version": "3.4.0",
3
+ "version": "3.5.0",
4
4
  "description": "Modern React lightbox component",
5
5
  "author": "Igor Danchenko",
6
6
  "license": "MIT",
@@ -118,6 +118,10 @@
118
118
  "engines": {
119
119
  "node": ">=14"
120
120
  },
121
+ "publishConfig": {
122
+ "access": "public",
123
+ "provenance": true
124
+ },
121
125
  "peerDependencies": {
122
126
  "react": ">=16.8.0",
123
127
  "react-dom": ">=16.8.0"