elseware-ui 2.2.31 → 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.
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface YoutubeVideoPlayerProps {
|
|
2
|
+
videoUrl: string;
|
|
3
|
+
width?: number;
|
|
4
|
+
height?: number;
|
|
5
|
+
}
|
|
6
|
+
declare function YoutubeVideoPlayer({ videoUrl, width, height, }: YoutubeVideoPlayerProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default YoutubeVideoPlayer;
|
package/build/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ import Slider from "./components/data-display/slider/Slider";
|
|
|
17
17
|
import Table from "./components/data-display/table/Table";
|
|
18
18
|
import Tag from "./components/data-display/tag/Tag";
|
|
19
19
|
import { Typography, Chapter, Section, Paragraph, Quote } from "./components/data-display/typography";
|
|
20
|
+
import YoutubeVideoPlayer from "./components/data-display/video/youtube-video-player/YoutubeVideoPlayer";
|
|
20
21
|
import { Button } from "./components/data-entry/button/Button";
|
|
21
22
|
import Checkbox from "./components/data-entry/checkbox/Checkbox";
|
|
22
23
|
import DateSelector from "./components/data-entry/date-selector/DateSelector";
|
|
@@ -58,4 +59,4 @@ import useModal from "./utils/hooks/components/useModal";
|
|
|
58
59
|
import useDrawer from "./utils/hooks/components/useDrawer";
|
|
59
60
|
import useClickOutside from "./utils/hooks/useClickOutside";
|
|
60
61
|
import useIsMobile from "./utils/hooks/useIsMobile";
|
|
61
|
-
export { Avatar, Badge, TitleBanner, Brand, BarChart, LineChart, PieChart, Chip, Image, CloudinaryImage, Info, List, ListItem, PriceTag, StarRating, StarRatingDistribution, Slider, Table, Tag, Typography, Chapter, Section, Paragraph, Quote, Button, Checkbox, DateSelector, Form, FormResponse, ImageInput, Input, MultiImageInput, InputResponse, Radio, StarRatingInput, Select, Switch, TextArea, Backdrop, Skeleton, Toast, sendToast, Transition, ContentArea, FooterNavbar, Sidebar, Flex, FlexCol, FlexRow, Grid, Layout, Header, Content, Footer, Breadcrumb, BreadcrumbItem, Drawer, DrawerToggler, HeaderNav, HeaderNavGroup, HeaderNavItem, HeaderNavItemTitle, Link, Menu, MenuGroup, MenuItem, MenuItemTitle, RouteTab, RouteTabs, Modal, Accordion, Card, CardHeader, CardContent, CardFooter, ThemeContext, ThemeProvider, ThemeSwitch, AsyncComponentWrapper, ShowMore, useModal, useDrawer, useClickOutside, useIsMobile, };
|
|
62
|
+
export { Avatar, Badge, TitleBanner, Brand, BarChart, LineChart, PieChart, Chip, Image, CloudinaryImage, Info, List, ListItem, PriceTag, StarRating, StarRatingDistribution, Slider, Table, Tag, Typography, Chapter, Section, Paragraph, Quote, YoutubeVideoPlayer, Button, Checkbox, DateSelector, Form, FormResponse, ImageInput, Input, MultiImageInput, InputResponse, Radio, StarRatingInput, Select, Switch, TextArea, Backdrop, Skeleton, Toast, sendToast, Transition, ContentArea, FooterNavbar, Sidebar, Flex, FlexCol, FlexRow, Grid, Layout, Header, Content, Footer, Breadcrumb, BreadcrumbItem, Drawer, DrawerToggler, HeaderNav, HeaderNavGroup, HeaderNavItem, HeaderNavItemTitle, Link, Menu, MenuGroup, MenuItem, MenuItemTitle, RouteTab, RouteTabs, Modal, Accordion, Card, CardHeader, CardContent, CardFooter, ThemeContext, ThemeProvider, ThemeSwitch, AsyncComponentWrapper, ShowMore, useModal, useDrawer, useClickOutside, useIsMobile, };
|
package/build/index.es.js
CHANGED
|
@@ -33600,6 +33600,22 @@ function Tag(_a) {
|
|
|
33600
33600
|
_b)) }, { children: text })));
|
|
33601
33601
|
}
|
|
33602
33602
|
|
|
33603
|
+
var getYoutubeEmbedUrl = function (url) {
|
|
33604
|
+
var videoIdMatch = url.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/);
|
|
33605
|
+
return videoIdMatch ? "https://www.youtube.com/embed/".concat(videoIdMatch[1]) : "";
|
|
33606
|
+
};
|
|
33607
|
+
function YoutubeVideoPlayer(_a) {
|
|
33608
|
+
var videoUrl = _a.videoUrl, _b = _a.width, width = _b === void 0 ? 750 : _b, _c = _a.height, height = _c === void 0 ? 422 : _c;
|
|
33609
|
+
var embedUrl = getYoutubeEmbedUrl(videoUrl);
|
|
33610
|
+
if (!embedUrl) {
|
|
33611
|
+
return jsxRuntime.jsx(FormResponse, { text: "Invalid YouTube URL", variant: "danger" });
|
|
33612
|
+
}
|
|
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
|
+
}
|
|
33618
|
+
|
|
33603
33619
|
function InputResponse(_a) {
|
|
33604
33620
|
var _b;
|
|
33605
33621
|
var name = _a.name, visibility = _a.visibility, _c = _a.variant, variant = _c === void 0 ? "default" : _c, styles = _a.styles;
|
|
@@ -34558,4 +34574,4 @@ var useDrawer = function (defaultVisibility) {
|
|
|
34558
34574
|
};
|
|
34559
34575
|
};
|
|
34560
34576
|
|
|
34561
|
-
export { Accordion, AsyncComponentWrapper, Avatar, Backdrop, Badge, BarChart, Brand, Breadcrumb, BreadcrumbItem, Button, Card, CardContent, CardFooter, CardHeader, Chapter, Checkbox, Chip, CloudinaryImage, Content, ContentArea, DateSelector, Drawer, DrawerToggler, Flex, FlexCol, FlexRow, Footer, FooterNavbar, Form, FormResponse, Grid, Header, HeaderNav, HeaderNavGroup, HeaderNavItem, HeaderNavItemTitle, Image$1 as Image, ImageInput, Info, Input, InputResponse, Layout, LineChart, Link, List, ListItem, Menu, MenuGroup, MenuItem, MenuItemTitle, Modal, MultiImageInput, Paragraph, PieChart, PriceTag, Quote, Radio, RouteTab, RouteTabs, Section, Select, ShowMore, Sidebar, Skeleton, Slider, StarRating, StarRatingDistribution, StarRatingInput, Switch, Table, Tag, TextArea, ThemeContext, ThemeProvider, ThemeSwitch, TitleBanner, Toast, Transition, Typography, sendToast, useClickOutside, useDrawer, useIsMobile, useModal };
|
|
34577
|
+
export { Accordion, AsyncComponentWrapper, Avatar, Backdrop, Badge, BarChart, Brand, Breadcrumb, BreadcrumbItem, Button, Card, CardContent, CardFooter, CardHeader, Chapter, Checkbox, Chip, CloudinaryImage, Content, ContentArea, DateSelector, Drawer, DrawerToggler, Flex, FlexCol, FlexRow, Footer, FooterNavbar, Form, FormResponse, Grid, Header, HeaderNav, HeaderNavGroup, HeaderNavItem, HeaderNavItemTitle, Image$1 as Image, ImageInput, Info, Input, InputResponse, Layout, LineChart, Link, List, ListItem, Menu, MenuGroup, MenuItem, MenuItemTitle, Modal, MultiImageInput, Paragraph, PieChart, PriceTag, Quote, Radio, RouteTab, RouteTabs, Section, Select, ShowMore, Sidebar, Skeleton, Slider, StarRating, StarRatingDistribution, StarRatingInput, Switch, Table, Tag, TextArea, ThemeContext, ThemeProvider, ThemeSwitch, TitleBanner, Toast, Transition, Typography, YoutubeVideoPlayer, sendToast, useClickOutside, useDrawer, useIsMobile, useModal };
|
package/build/index.js
CHANGED
|
@@ -33626,6 +33626,22 @@ function Tag(_a) {
|
|
|
33626
33626
|
_b)) }, { children: text })));
|
|
33627
33627
|
}
|
|
33628
33628
|
|
|
33629
|
+
var getYoutubeEmbedUrl = function (url) {
|
|
33630
|
+
var videoIdMatch = url.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/);
|
|
33631
|
+
return videoIdMatch ? "https://www.youtube.com/embed/".concat(videoIdMatch[1]) : "";
|
|
33632
|
+
};
|
|
33633
|
+
function YoutubeVideoPlayer(_a) {
|
|
33634
|
+
var videoUrl = _a.videoUrl, _b = _a.width, width = _b === void 0 ? 750 : _b, _c = _a.height, height = _c === void 0 ? 422 : _c;
|
|
33635
|
+
var embedUrl = getYoutubeEmbedUrl(videoUrl);
|
|
33636
|
+
if (!embedUrl) {
|
|
33637
|
+
return jsxRuntime.jsx(FormResponse, { text: "Invalid YouTube URL", variant: "danger" });
|
|
33638
|
+
}
|
|
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
|
+
}
|
|
33644
|
+
|
|
33629
33645
|
function InputResponse(_a) {
|
|
33630
33646
|
var _b;
|
|
33631
33647
|
var name = _a.name, visibility = _a.visibility, _c = _a.variant, variant = _c === void 0 ? "default" : _c, styles = _a.styles;
|
|
@@ -34663,6 +34679,7 @@ exports.TitleBanner = TitleBanner;
|
|
|
34663
34679
|
exports.Toast = Toast;
|
|
34664
34680
|
exports.Transition = Transition;
|
|
34665
34681
|
exports.Typography = Typography;
|
|
34682
|
+
exports.YoutubeVideoPlayer = YoutubeVideoPlayer;
|
|
34666
34683
|
exports.sendToast = sendToast;
|
|
34667
34684
|
exports.useClickOutside = useClickOutside;
|
|
34668
34685
|
exports.useDrawer = useDrawer;
|