yet-another-react-lightbox 1.3.3 → 1.3.6
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 +16 -2
- package/dist/plugins/Fullscreen.d.ts +1 -1
- package/dist/plugins/Inline.d.ts +1 -1
- package/dist/plugins/Video.d.ts +3 -3
- package/dist/types.d.ts +10 -1
- package/dist/types.js +9 -13
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Yet Another React Lightbox
|
|
2
2
|
|
|
3
|
-
Modern React lightbox component.
|
|
3
|
+
Modern React lightbox component. Performant, easy to use, customizable and extendable.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
@@ -8,9 +8,23 @@ Modern React lightbox component.
|
|
|
8
8
|
[](https://bundlephobia.com/package/yet-another-react-lightbox)
|
|
9
9
|
[](LICENSE)
|
|
10
10
|
|
|
11
|
+
- **Built for React:** works with React 18, 17 and 16.8.0+
|
|
12
|
+
- **UX:** supports keyboard, mouse, touchpad and touchscreen navigation
|
|
13
|
+
- **Preloading:** never displays partially downloaded images
|
|
14
|
+
- **Performance:** preloads limited number of images without compromising performance or UX
|
|
15
|
+
- **Responsive:** responsive images with automatic resolution switching are supported out of the box
|
|
16
|
+
- **Video:** video slides are supported via an optional plugin
|
|
17
|
+
- **Customization:** customize any UI element or add your own custom slides
|
|
18
|
+
- **No bloat:** never bundle rarely used features; add optional features via plugins
|
|
19
|
+
- **TypeScript:** type definitions come built-in in the package
|
|
20
|
+
|
|
11
21
|
## Documentation
|
|
12
22
|
|
|
13
|
-
[https://yet-another-react-lightbox.vercel.app/](https://yet-another-react-lightbox.vercel.app/)
|
|
23
|
+
[https://yet-another-react-lightbox.vercel.app/documentation](https://yet-another-react-lightbox.vercel.app/documentation)
|
|
24
|
+
|
|
25
|
+
## Examples
|
|
26
|
+
|
|
27
|
+
[https://yet-another-react-lightbox.vercel.app/examples](https://yet-another-react-lightbox.vercel.app/examples)
|
|
14
28
|
|
|
15
29
|
## Installation
|
|
16
30
|
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { LightboxProps, Plugin, Render } from "../types.js";
|
|
3
3
|
declare module "../types.js" {
|
|
4
4
|
interface LightboxProps {
|
|
5
|
-
/** enter fullscreen mode automatically when the lightbox opens */
|
|
5
|
+
/** if `true`, enter fullscreen mode automatically when the lightbox opens */
|
|
6
6
|
fullscreen?: boolean;
|
|
7
7
|
}
|
|
8
8
|
interface Render {
|
package/dist/plugins/Inline.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { Component, Plugin } from "../types.js";
|
|
3
3
|
declare module "../types.js" {
|
|
4
4
|
interface LightboxProps {
|
|
5
|
-
/** HTML div element attributes to be passed to inline plugin container */
|
|
5
|
+
/** HTML div element attributes to be passed to the inline plugin container */
|
|
6
6
|
inline?: React.HTMLAttributes<HTMLDivElement>;
|
|
7
7
|
}
|
|
8
8
|
}
|
package/dist/plugins/Video.d.ts
CHANGED
|
@@ -6,11 +6,11 @@ export interface SlideVideo {
|
|
|
6
6
|
type: "video";
|
|
7
7
|
/** video placeholder image */
|
|
8
8
|
poster?: string;
|
|
9
|
-
/** video width */
|
|
9
|
+
/** video width in pixels */
|
|
10
10
|
width?: number;
|
|
11
|
-
/** video height */
|
|
11
|
+
/** video height in pixels */
|
|
12
12
|
height?: number;
|
|
13
|
-
/**
|
|
13
|
+
/** an array of video files */
|
|
14
14
|
sources?: {
|
|
15
15
|
/** video source URL */
|
|
16
16
|
src: string;
|
package/dist/types.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export interface SlideImage {
|
|
|
8
8
|
alt?: string;
|
|
9
9
|
/** image aspect ratio */
|
|
10
10
|
aspectRatio?: number;
|
|
11
|
-
/** alternative images to be passed to 'srcSet' */
|
|
11
|
+
/** alternative images to be passed to the 'srcSet' */
|
|
12
12
|
srcSet?: {
|
|
13
13
|
/** image URL */
|
|
14
14
|
src: string;
|
|
@@ -110,6 +110,15 @@ export interface LightboxProps {
|
|
|
110
110
|
/** lifecycle callbacks */
|
|
111
111
|
on: Callbacks;
|
|
112
112
|
}
|
|
113
|
+
export declare const ImageSlidePropTypes: PropTypes.Requireable<PropTypes.InferProps<{
|
|
114
|
+
src: PropTypes.Requireable<string>;
|
|
115
|
+
alt: PropTypes.Requireable<string>;
|
|
116
|
+
aspectRatio: PropTypes.Requireable<number>;
|
|
117
|
+
srcSet: PropTypes.Requireable<PropTypes.InferProps<{
|
|
118
|
+
src: PropTypes.Validator<string>;
|
|
119
|
+
width: PropTypes.Validator<number>;
|
|
120
|
+
}>[]>;
|
|
121
|
+
}>>;
|
|
113
122
|
export declare const SlideTypesPropTypes: PropTypes.Validator<any>[];
|
|
114
123
|
export declare const LightboxPropTypes: {
|
|
115
124
|
open: PropTypes.Validator<boolean>;
|
package/dist/types.js
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import PropTypes from "prop-types";
|
|
2
|
-
export const
|
|
3
|
-
PropTypes.
|
|
2
|
+
export const ImageSlidePropTypes = PropTypes.shape({
|
|
3
|
+
src: PropTypes.string,
|
|
4
|
+
alt: PropTypes.string,
|
|
5
|
+
aspectRatio: PropTypes.number,
|
|
6
|
+
srcSet: PropTypes.arrayOf(PropTypes.shape({
|
|
4
7
|
src: PropTypes.string.isRequired,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
PropTypes.arrayOf(PropTypes.shape({
|
|
10
|
-
src: PropTypes.string.isRequired,
|
|
11
|
-
width: PropTypes.number.isRequired,
|
|
12
|
-
}).isRequired).isRequired,
|
|
13
|
-
]),
|
|
14
|
-
}),
|
|
15
|
-
];
|
|
8
|
+
width: PropTypes.number.isRequired,
|
|
9
|
+
}).isRequired),
|
|
10
|
+
});
|
|
11
|
+
export const SlideTypesPropTypes = [ImageSlidePropTypes];
|
|
16
12
|
export const LightboxPropTypes = {
|
|
17
13
|
open: PropTypes.bool.isRequired,
|
|
18
14
|
close: PropTypes.func.isRequired,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yet-another-react-lightbox",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.6",
|
|
4
4
|
"description": "Modern React lightbox component",
|
|
5
5
|
"author": "Igor Danchenko",
|
|
6
6
|
"license": "MIT",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"@testing-library/jest-dom": "^5.16.4",
|
|
81
81
|
"@testing-library/react": "^13.3.0",
|
|
82
82
|
"@testing-library/user-event": "^14.2.0",
|
|
83
|
-
"@types/jest": "^27.5.
|
|
83
|
+
"@types/jest": "^27.5.2",
|
|
84
84
|
"@types/react": "^18.0.10",
|
|
85
85
|
"@types/react-dom": "^18.0.5",
|
|
86
86
|
"@typescript-eslint/eslint-plugin": "^5.27.0",
|