yet-another-react-lightbox 1.3.0 → 1.3.1
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
|
@@ -31,9 +31,12 @@ declare global {
|
|
|
31
31
|
msRequestFullscreen?: () => void;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
declare type FullscreenButtonProps = Pick<LightboxProps, "labels"> & {
|
|
35
35
|
auto: boolean;
|
|
36
36
|
render: Render;
|
|
37
37
|
};
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
declare const FullscreenButton: ({ auto, labels, render }: FullscreenButtonProps) => JSX.Element | null;
|
|
39
|
+
declare const Fullscreen: Plugin;
|
|
40
|
+
export type { FullscreenButtonProps };
|
|
41
|
+
export { Fullscreen, FullscreenButton };
|
|
42
|
+
export default Fullscreen;
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { createIcon, IconButton, label, useController, useLatest } from "../core/index.js";
|
|
3
3
|
const EnterFullscreenIcon = createIcon("EnterFullscreen", React.createElement("path", { d: "M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z" }));
|
|
4
4
|
const ExitFullscreenIcon = createIcon("ExitFullscreen", React.createElement("path", { d: "M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z" }));
|
|
5
|
-
|
|
5
|
+
const FullscreenButton = ({ auto, labels, render }) => {
|
|
6
6
|
const [fullscreen, setFullscreen] = React.useState(false);
|
|
7
7
|
const latestAuto = useLatest(auto);
|
|
8
8
|
const { containerRef } = useController();
|
|
@@ -92,7 +92,7 @@ export const FullscreenButton = ({ auto, labels, render }) => {
|
|
|
92
92
|
return null;
|
|
93
93
|
return render.buttonFullscreen ? (React.createElement(React.Fragment, null, render.buttonFullscreen({ fullscreen, toggleFullscreen }))) : (React.createElement(IconButton, { label: fullscreen ? label(labels, "Exit Fullscreen") : label(labels, "Enter Fullscreen"), icon: fullscreen ? ExitFullscreenIcon : EnterFullscreenIcon, renderIcon: fullscreen ? render.iconExitFullscreen : render.iconEnterFullscreen, onClick: toggleFullscreen }));
|
|
94
94
|
};
|
|
95
|
-
|
|
95
|
+
const Fullscreen = ({ augment }) => {
|
|
96
96
|
augment(({ toolbar: { buttons, ...restToolbar }, ...restProps }) => ({
|
|
97
97
|
toolbar: {
|
|
98
98
|
buttons: [
|
|
@@ -104,3 +104,5 @@ export const Fullscreen = ({ augment }) => {
|
|
|
104
104
|
...restProps,
|
|
105
105
|
}));
|
|
106
106
|
};
|
|
107
|
+
export { Fullscreen, FullscreenButton };
|
|
108
|
+
export default Fullscreen;
|
package/dist/plugins/Inline.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ declare module "../types.js" {
|
|
|
5
5
|
inline?: React.HTMLAttributes<HTMLDivElement>;
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
declare const InlineContainer: Component;
|
|
9
|
+
declare const InlineModule: import("../types.js").Module;
|
|
10
|
+
declare const Inline: Plugin;
|
|
11
|
+
export { Inline, InlineModule, InlineContainer };
|
|
12
|
+
export default Inline;
|
package/dist/plugins/Inline.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { createModule } from "../core/index.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
const InlineContainer = ({ inline, children }) => React.createElement("div", { ...inline }, children);
|
|
4
|
+
const InlineModule = createModule("inline", InlineContainer);
|
|
5
|
+
const Inline = ({ augment, replace, remove }) => {
|
|
6
6
|
augment(({ toolbar: { buttons, ...restToolbar }, open, close, ...restProps }) => ({
|
|
7
7
|
open: true,
|
|
8
8
|
close: () => { },
|
|
@@ -16,3 +16,5 @@ export const Inline = ({ augment, replace, remove }) => {
|
|
|
16
16
|
remove("no-scroll");
|
|
17
17
|
replace("portal", InlineModule);
|
|
18
18
|
};
|
|
19
|
+
export { Inline, InlineModule, InlineContainer };
|
|
20
|
+
export default Inline;
|
package/dist/plugins/Video.d.ts
CHANGED
|
@@ -15,7 +15,9 @@ declare module "../types.js" {
|
|
|
15
15
|
SlideVideo: SlideVideo;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
declare const VideoSlide: ({ slide: { sources, poster, width, height } }: {
|
|
19
19
|
slide: SlideVideo;
|
|
20
20
|
}) => JSX.Element;
|
|
21
|
-
|
|
21
|
+
declare const Video: Plugin;
|
|
22
|
+
export { Video, VideoSlide };
|
|
23
|
+
export default Video;
|
package/dist/plugins/Video.js
CHANGED
|
@@ -12,7 +12,7 @@ SlideTypesPropTypes.push(PropTypes.shape({
|
|
|
12
12
|
type: PropTypes.string.isRequired,
|
|
13
13
|
}).isRequired),
|
|
14
14
|
}));
|
|
15
|
-
|
|
15
|
+
const VideoSlide = ({ slide: { sources, poster, width, height } }) => {
|
|
16
16
|
const { setContainerRef, containerRect } = useContainerRect();
|
|
17
17
|
const scaleWidthAndHeight = () => {
|
|
18
18
|
if (!width || !height || !containerRect)
|
|
@@ -28,7 +28,7 @@ export const VideoSlide = ({ slide: { sources, poster, width, height } }) => {
|
|
|
28
28
|
height: "100%",
|
|
29
29
|
}, className: clsx(cssClass("video_container"), cssClass("flex_center")) }, containerRect && (React.createElement("video", { controls: true, playsInline: true, poster: poster, ...scaleWidthAndHeight() }, sources.map(({ src, type }, index) => (React.createElement("source", { key: index, src: src, type: type })))))))));
|
|
30
30
|
};
|
|
31
|
-
|
|
31
|
+
const Video = ({ augment }) => {
|
|
32
32
|
augment(({ render: { slide: renderSlide, ...restRender }, ...restProps }) => ({
|
|
33
33
|
render: {
|
|
34
34
|
slide: (slide) => {
|
|
@@ -42,3 +42,5 @@ export const Video = ({ augment }) => {
|
|
|
42
42
|
...restProps,
|
|
43
43
|
}));
|
|
44
44
|
};
|
|
45
|
+
export { Video, VideoSlide };
|
|
46
|
+
export default Video;
|