elseware-ui 2.3.0 → 2.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.
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
/// <reference types="@types/react" />
|
|
2
|
-
import React from "react";
|
|
3
1
|
interface YoutubeVideoPlayerProps {
|
|
4
2
|
videoUrl: string;
|
|
5
3
|
width?: number;
|
|
6
4
|
height?: number;
|
|
7
5
|
}
|
|
8
|
-
declare
|
|
6
|
+
declare function YoutubeVideoPlayer({ videoUrl, width, height, }: YoutubeVideoPlayerProps): import("react/jsx-runtime").JSX.Element;
|
|
9
7
|
export default YoutubeVideoPlayer;
|
package/build/index.es.js
CHANGED
|
@@ -33604,14 +33604,17 @@ var getYoutubeEmbedUrl = function (url) {
|
|
|
33604
33604
|
var videoIdMatch = url.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/);
|
|
33605
33605
|
return videoIdMatch ? "https://www.youtube.com/embed/".concat(videoIdMatch[1]) : "";
|
|
33606
33606
|
};
|
|
33607
|
-
|
|
33607
|
+
function YoutubeVideoPlayer(_a) {
|
|
33608
33608
|
var videoUrl = _a.videoUrl, _b = _a.width, width = _b === void 0 ? 750 : _b, _c = _a.height, height = _c === void 0 ? 422 : _c;
|
|
33609
33609
|
var embedUrl = getYoutubeEmbedUrl(videoUrl);
|
|
33610
33610
|
if (!embedUrl) {
|
|
33611
33611
|
return jsxRuntime.jsx(FormResponse, { text: "Invalid YouTube URL", variant: "danger" });
|
|
33612
33612
|
}
|
|
33613
|
-
return (jsxRuntime.jsx("div", __assign$1({ className: "flex justify-center" }, { children: jsxRuntime.jsx("
|
|
33614
|
-
|
|
33613
|
+
return (jsxRuntime.jsx("div", __assign$1({ className: "flex justify-center" }, { children: jsxRuntime.jsx("div", __assign$1({ className: "relative w-full", style: {
|
|
33614
|
+
maxWidth: "".concat(width, "px"),
|
|
33615
|
+
paddingTop: "".concat((height / width) * 100, "%"),
|
|
33616
|
+
} }, { children: jsxRuntime.jsx("iframe", { src: embedUrl, title: "YouTube video player", allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture", allowFullScreen: true, className: "absolute top-0 left-0 w-full h-full rounded-lg shadow-lg" }) })) })));
|
|
33617
|
+
}
|
|
33615
33618
|
|
|
33616
33619
|
function InputResponse(_a) {
|
|
33617
33620
|
var _b;
|
package/build/index.js
CHANGED
|
@@ -33630,14 +33630,17 @@ var getYoutubeEmbedUrl = function (url) {
|
|
|
33630
33630
|
var videoIdMatch = url.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/);
|
|
33631
33631
|
return videoIdMatch ? "https://www.youtube.com/embed/".concat(videoIdMatch[1]) : "";
|
|
33632
33632
|
};
|
|
33633
|
-
|
|
33633
|
+
function YoutubeVideoPlayer(_a) {
|
|
33634
33634
|
var videoUrl = _a.videoUrl, _b = _a.width, width = _b === void 0 ? 750 : _b, _c = _a.height, height = _c === void 0 ? 422 : _c;
|
|
33635
33635
|
var embedUrl = getYoutubeEmbedUrl(videoUrl);
|
|
33636
33636
|
if (!embedUrl) {
|
|
33637
33637
|
return jsxRuntime.jsx(FormResponse, { text: "Invalid YouTube URL", variant: "danger" });
|
|
33638
33638
|
}
|
|
33639
|
-
return (jsxRuntime.jsx("div", __assign$1({ className: "flex justify-center" }, { children: jsxRuntime.jsx("
|
|
33640
|
-
|
|
33639
|
+
return (jsxRuntime.jsx("div", __assign$1({ className: "flex justify-center" }, { children: jsxRuntime.jsx("div", __assign$1({ className: "relative w-full", style: {
|
|
33640
|
+
maxWidth: "".concat(width, "px"),
|
|
33641
|
+
paddingTop: "".concat((height / width) * 100, "%"),
|
|
33642
|
+
} }, { children: jsxRuntime.jsx("iframe", { src: embedUrl, title: "YouTube video player", allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture", allowFullScreen: true, className: "absolute top-0 left-0 w-full h-full rounded-lg shadow-lg" }) })) })));
|
|
33643
|
+
}
|
|
33641
33644
|
|
|
33642
33645
|
function InputResponse(_a) {
|
|
33643
33646
|
var _b;
|