yet-another-react-lightbox 3.17.5 → 3.18.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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PluginProps
|
|
1
|
+
import { PluginProps } from '../../types.js';
|
|
2
2
|
|
|
3
3
|
/** Video plugin */
|
|
4
4
|
declare function Video({ augment }: PluginProps): void;
|
|
@@ -44,6 +44,8 @@ declare module "yet-another-react-lightbox" {
|
|
|
44
44
|
src: string;
|
|
45
45
|
/** video source type (e.g., `video/mp4`) */
|
|
46
46
|
type: string;
|
|
47
|
+
/** media query for the resource's intended media (e.g., `(min-width: 800px)`) */
|
|
48
|
+
media?: string;
|
|
47
49
|
}[];
|
|
48
50
|
}
|
|
49
51
|
interface LightboxProps {
|
|
@@ -82,7 +82,7 @@ function VideoSlide({ slide, offset }) {
|
|
|
82
82
|
publish(ACTIVE_SLIDE_PLAYING);
|
|
83
83
|
}, onEnded: () => {
|
|
84
84
|
publish(ACTIVE_SLIDE_COMPLETE);
|
|
85
|
-
} }, sources.map(({ src, type }) => (React.createElement("source", { key: [src, type].join("|"), src: src, type: type })))))))));
|
|
85
|
+
} }, sources.map(({ src, type, media }) => (React.createElement("source", { key: [src, type, media].filter(Boolean).join("|"), src: src, type: type, media: media })))))))));
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
function isVideoSlide(slide) {
|