@layers-app/shared 0.4.6 → 0.4.8
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/dist/assets/default-workspace-avatar.jpg.js +1 -1
- package/dist/components/AliasTextInput/AliasTextInput.d.ts.map +1 -1
- package/dist/components/AliasTextInput/AliasTextInput.js +32 -32
- package/dist/components/AppContainer/AppContainer.d.ts +1 -1
- package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/AppContainer.js +82 -70
- package/dist/components/AppContainer/AppContainer.module.css.js +20 -10
- package/dist/components/AppContainer/components/AppsSidebar/DesktopUpdateButton.d.ts +6 -0
- package/dist/components/AppContainer/components/AppsSidebar/DesktopUpdateButton.d.ts.map +1 -0
- package/dist/components/AppContainer/components/AppsSidebar/DesktopUpdateButton.js +161 -0
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.js +77 -49
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +238 -105
- package/dist/components/AppContainer/components/Main.js +4 -4
- package/dist/components/AppContainer/components/NavbarContent.d.ts.map +1 -1
- package/dist/components/AppContainer/components/NavbarContent.js +16 -2
- package/dist/components/AppContainer/components/SlideAnimation.js +4 -4
- package/dist/components/AppContainer/components/ToolSidebar.d.ts +5 -0
- package/dist/components/AppContainer/components/ToolSidebar.d.ts.map +1 -1
- package/dist/components/AppContainer/components/ToolSidebar.js +51 -39
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts +62 -1
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts.map +1 -1
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +1107 -137
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.module.css.js +158 -6
- package/dist/components/AppContainer/types.d.ts +12 -0
- package/dist/components/AppContainer/types.d.ts.map +1 -1
- package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts +3 -1
- package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts.map +1 -1
- package/dist/components/AttachmentsPreview/AttachmentsPreview.js +237 -93
- package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +18 -16
- package/dist/components/Chat/ChatInput/index.d.ts +13 -1
- package/dist/components/Chat/ChatInput/index.d.ts.map +1 -1
- package/dist/components/Chat/ChatInput/index.js +264 -164
- package/dist/components/Chat/ChatInput/useVoiceRecorder.d.ts +16 -0
- package/dist/components/Chat/ChatInput/useVoiceRecorder.d.ts.map +1 -0
- package/dist/components/Chat/ChatInput/useVoiceRecorder.js +83 -0
- package/dist/components/Chat/ChatMessage/ChatMessage.module.css.js +20 -16
- package/dist/components/Chat/ChatMessage/index.d.ts +16 -0
- package/dist/components/Chat/ChatMessage/index.d.ts.map +1 -1
- package/dist/components/Chat/ChatMessage/index.js +153 -118
- package/dist/components/Chat/MessageActions/index.d.ts +2 -0
- package/dist/components/Chat/MessageActions/index.d.ts.map +1 -1
- package/dist/components/Chat/MessageActions/index.js +189 -50
- package/dist/components/Chat/MessageAuthor/index.d.ts +7 -1
- package/dist/components/Chat/MessageAuthor/index.d.ts.map +1 -1
- package/dist/components/Chat/MessageAuthor/index.js +39 -25
- package/dist/components/Chat/MessageList/MessageList.module.css.js +14 -12
- package/dist/components/Chat/MessageList/index.d.ts +17 -25
- package/dist/components/Chat/MessageList/index.d.ts.map +1 -1
- package/dist/components/Chat/MessageList/index.js +201 -149
- package/dist/components/Chat/MessageMeta/index.d.ts.map +1 -1
- package/dist/components/Chat/MessageMeta/index.js +21 -19
- package/dist/components/ColorPicker/ColorPicker.d.ts +3 -0
- package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPicker.js +81 -76
- package/dist/components/ColorPicker/ColorPickerToolbar.d.ts +1 -0
- package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerToolbar.js +97 -91
- package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts +2 -1
- package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts.map +1 -1
- package/dist/components/CommentComposer/CommentEditorHotkeys.js +29 -26
- package/dist/components/CommentComposer/index.d.ts +1 -1
- package/dist/components/CommentComposer/index.d.ts.map +1 -1
- package/dist/components/CommentComposer/index.js +70 -68
- package/dist/components/CommentComposer/types.d.ts +6 -0
- package/dist/components/CommentComposer/types.d.ts.map +1 -1
- package/dist/components/CustomKBD/index.js +21 -22
- package/dist/components/EmojiPicker/EmojiPicker.d.ts +1 -0
- package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.js +129 -121
- package/dist/components/EntityTitle/EntityTitle.d.ts +3 -4
- package/dist/components/EntityTitle/EntityTitle.d.ts.map +1 -1
- package/dist/components/EntityTitle/EntityTitle.js +81 -80
- package/dist/components/FormViewer/helpers/conditions.d.ts.map +1 -1
- package/dist/components/FormViewer/helpers/conditions.js +33 -17
- package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.d.ts +3 -1
- package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.d.ts.map +1 -1
- package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.js +26 -25
- package/dist/components/NewToolbar/utils.d.ts +12 -0
- package/dist/components/NewToolbar/utils.d.ts.map +1 -0
- package/dist/components/Notification/InfiniteScroll.d.ts +12 -0
- package/dist/components/Notification/InfiniteScroll.d.ts.map +1 -0
- package/dist/components/Notification/InfiniteScroll.js +42 -0
- package/dist/components/Notification/Notification.d.ts +4 -1
- package/dist/components/Notification/Notification.d.ts.map +1 -1
- package/dist/components/Notification/Notification.module.css.js +28 -4
- package/dist/components/Notification/atoms/ActionBadge.d.ts +11 -0
- package/dist/components/Notification/atoms/ActionBadge.d.ts.map +1 -0
- package/dist/components/Notification/atoms/ActionBadge.js +53 -0
- package/dist/components/Notification/atoms/ArchiveIcon.d.ts +7 -0
- package/dist/components/Notification/atoms/ArchiveIcon.d.ts.map +1 -0
- package/dist/components/Notification/atoms/ArchiveIcon.js +40 -0
- package/dist/components/Notification/atoms/InboxIcon.d.ts +7 -0
- package/dist/components/Notification/atoms/InboxIcon.d.ts.map +1 -0
- package/dist/components/Notification/atoms/InboxIcon.js +33 -0
- package/dist/components/Notification/atoms/MarkReadIcon.d.ts +7 -0
- package/dist/components/Notification/atoms/MarkReadIcon.d.ts.map +1 -0
- package/dist/components/Notification/atoms/MarkReadIcon.js +33 -0
- package/dist/components/Notification/atoms/ResourceIcon.d.ts +7 -0
- package/dist/components/Notification/atoms/ResourceIcon.d.ts.map +1 -0
- package/dist/components/Notification/atoms/TabBadge.d.ts +7 -0
- package/dist/components/Notification/atoms/TabBadge.d.ts.map +1 -0
- package/dist/components/Notification/atoms/TabBadge.js +32 -0
- package/dist/components/Notification/atoms/UnreadDot.d.ts +6 -0
- package/dist/components/Notification/atoms/UnreadDot.d.ts.map +1 -0
- package/dist/components/Notification/atoms/UnreadDot.js +23 -0
- package/dist/components/Notification/atoms/index.d.ts +5 -0
- package/dist/components/Notification/atoms/index.d.ts.map +1 -0
- package/dist/components/Notification/hooks/index.d.ts +8 -0
- package/dist/components/Notification/hooks/index.d.ts.map +1 -0
- package/dist/components/Notification/hooks/useInboxActions.d.ts +12 -0
- package/dist/components/Notification/hooks/useInboxActions.d.ts.map +1 -0
- package/dist/components/Notification/hooks/useInboxActions.js +58 -0
- package/dist/components/Notification/hooks/useInboxLoader.d.ts +8 -0
- package/dist/components/Notification/hooks/useInboxLoader.d.ts.map +1 -0
- package/dist/components/Notification/hooks/useInboxLoader.js +49 -0
- package/dist/components/Notification/hooks/useNotificationItem.d.ts +26 -0
- package/dist/components/Notification/hooks/useNotificationItem.d.ts.map +1 -0
- package/dist/components/Notification/hooks/useNotificationItem.js +51 -0
- package/dist/components/Notification/hooks/useNotificationStore.d.ts +49 -0
- package/dist/components/Notification/hooks/useNotificationStore.d.ts.map +1 -0
- package/dist/components/Notification/hooks/useNotificationStore.js +139 -0
- package/dist/components/Notification/hooks/useNotificationStream.d.ts +2 -0
- package/dist/components/Notification/hooks/useNotificationStream.d.ts.map +1 -0
- package/dist/components/Notification/hooks/useNotificationStream.js +86 -0
- package/dist/components/Notification/hooks/useNotificationTime.d.ts +2 -0
- package/dist/components/Notification/hooks/useNotificationTime.d.ts.map +1 -0
- package/dist/components/Notification/hooks/useNotificationTime.js +23 -0
- package/dist/components/Notification/hooks/useNotificationsApi.d.ts +25 -0
- package/dist/components/Notification/hooks/useNotificationsApi.d.ts.map +1 -0
- package/dist/components/Notification/hooks/useNotificationsApi.js +64 -0
- package/dist/components/Notification/lib/api.d.ts +4 -0
- package/dist/components/Notification/lib/api.d.ts.map +1 -0
- package/dist/components/Notification/lib/api.js +19 -0
- package/dist/components/Notification/lib/index.d.ts +5 -0
- package/dist/components/Notification/lib/index.d.ts.map +1 -0
- package/dist/components/Notification/lib/notificationText.d.ts +10 -0
- package/dist/components/Notification/lib/notificationText.d.ts.map +1 -0
- package/dist/components/Notification/lib/notificationText.js +131 -0
- package/dist/components/Notification/lib/stripHtml.d.ts +2 -0
- package/dist/components/Notification/lib/stripHtml.d.ts.map +1 -0
- package/dist/components/Notification/lib/stripHtml.js +6 -0
- package/dist/components/Notification/lib/types.d.ts +45 -0
- package/dist/components/Notification/lib/types.d.ts.map +1 -0
- package/dist/components/Notification/lib/types.js +9 -0
- package/dist/components/Notification/molecules/InboxEmpty.d.ts +8 -0
- package/dist/components/Notification/molecules/InboxEmpty.d.ts.map +1 -0
- package/dist/components/Notification/molecules/InboxEmpty.js +21 -0
- package/dist/components/Notification/molecules/InboxHeader.d.ts +17 -0
- package/dist/components/Notification/molecules/InboxHeader.d.ts.map +1 -0
- package/dist/components/Notification/molecules/InboxHeader.js +73 -0
- package/dist/components/Notification/molecules/InboxTabs.d.ts +15 -0
- package/dist/components/Notification/molecules/InboxTabs.d.ts.map +1 -0
- package/dist/components/Notification/molecules/InboxTabs.js +60 -0
- package/dist/components/Notification/molecules/NotificationActions.d.ts +9 -0
- package/dist/components/Notification/molecules/NotificationActions.d.ts.map +1 -0
- package/dist/components/Notification/molecules/NotificationActions.js +64 -0
- package/dist/components/Notification/molecules/NotificationAvatar.d.ts +17 -0
- package/dist/components/Notification/molecules/NotificationAvatar.d.ts.map +1 -0
- package/dist/components/Notification/molecules/NotificationAvatar.js +38 -0
- package/dist/components/Notification/molecules/NotificationContent.d.ts +22 -0
- package/dist/components/Notification/molecules/NotificationContent.d.ts.map +1 -0
- package/dist/components/Notification/molecules/NotificationContent.js +183 -0
- package/dist/components/Notification/molecules/index.d.ts +7 -0
- package/dist/components/Notification/molecules/index.d.ts.map +1 -0
- package/dist/components/Notification/organisms/InboxItem.d.ts +14 -0
- package/dist/components/Notification/organisms/InboxItem.d.ts.map +1 -0
- package/dist/components/Notification/organisms/InboxItem.js +100 -0
- package/dist/components/Notification/organisms/InboxPanel.d.ts +4 -0
- package/dist/components/Notification/organisms/InboxPanel.d.ts.map +1 -0
- package/dist/components/Notification/organisms/InboxPanel.js +99 -0
- package/dist/components/Notification/organisms/index.d.ts +3 -0
- package/dist/components/Notification/organisms/index.d.ts.map +1 -0
- package/dist/components/OnboardingTour/index.d.ts +1 -1
- package/dist/components/OnboardingTour/index.d.ts.map +1 -1
- package/dist/components/OnboardingTour/useOnboardingTour.d.ts +2 -0
- package/dist/components/OnboardingTour/useOnboardingTour.d.ts.map +1 -1
- package/dist/components/OnboardingTour/useOnboardingTour.js +63 -51
- package/dist/components/modals/RemoveConfirmModal.d.ts.map +1 -1
- package/dist/components/modals/RemoveConfirmModal.js +27 -26
- package/dist/config/brand.d.ts.map +1 -1
- package/dist/config/brand.js +29 -29
- package/dist/config/envConfig.d.ts +4 -0
- package/dist/config/envConfig.d.ts.map +1 -1
- package/dist/config/envConfig.js +29 -28
- package/dist/helpers/getFileIcons.js +5 -5
- package/dist/helpers/getFileType.d.ts.map +1 -1
- package/dist/helpers/getFileType.js +11 -2
- package/dist/helpers/platform.d.ts +1 -1
- package/dist/helpers/platform.d.ts.map +1 -1
- package/dist/helpers/platform.js +1 -0
- package/dist/helpers/showNotifications.d.ts +8 -14
- package/dist/helpers/showNotifications.d.ts.map +1 -1
- package/dist/helpers/showNotifications.js +107 -111
- package/dist/helpers/showNotifications.module.css.js +4 -16
- package/dist/hooks/useDateUtils.d.ts.map +1 -1
- package/dist/hooks/useDateUtils.js +19 -23
- package/dist/index.css +1 -1
- package/dist/index.js +576 -573
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/Audio.context.js +15 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/Audio.js +228 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/Audio.module.css.js +4 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioControls.js +19 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioMuteButton.js +30 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioPlayButton.js +40 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioSkipButton.js +28 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioSpectrum.js +137 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioSpeedControl.js +31 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioTimeDisplay.js +44 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioTimeline.js +71 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioVolumeSlider.js +43 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioWaveform.js +166 -0
- package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/use-audio.js +201 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/Video.context.js +15 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/Video.js +272 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/Video.module.css.js +4 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoCaptionsButton.js +55 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoControls.js +30 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoFullscreenButton.js +31 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoMuteButton.js +29 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoPiPButton.js +29 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoPlayButton.js +28 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoSkipButton.js +27 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoTimeDisplay.js +44 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoTimeline.js +70 -0
- package/dist/node_modules/@gfazioli/mantine-video/dist/esm/use-video.js +170 -0
- package/package.json +5 -3
- package/dist/components/Notification/Notification.js +0 -119
- package/dist/components/Notification/NotificationCard.d.ts +0 -10
- package/dist/components/Notification/NotificationCard.d.ts.map +0 -1
- package/dist/components/Notification/NotificationCard.js +0 -93
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var e = { root: "me_93a1ff14", video: "me_e0d35c89", backgroundMuteButton: "me_c06a98ab", controls: "me_cdf35be8", controlBar: "me_1e8b5628", playButton: "me_39f8f838", muteButton: "me_273e3f5d", fullscreenButton: "me_3d7259ff", pipButton: "me_1d5188b7", captionsButton: "me_c8163091", skipButton: "me_e5822e43", iconButton: "me_bdfae1bd", timeline: "me_73f6e973", timelineBuffered: "me_aaddbb72", timeDisplay: "me_a6bc92c3" };
|
|
2
|
+
export {
|
|
3
|
+
e as default
|
|
4
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Tooltip as g, ActionIcon as h } from "@mantine/core";
|
|
2
|
+
import { IconBadgeCcFilled as b, IconBadgeCc as y } from "@tabler/icons-react";
|
|
3
|
+
import s, { forwardRef as L, useState as d, useEffect as T } from "react";
|
|
4
|
+
import { useVideoContext as w } from "../Video.context.js";
|
|
5
|
+
const x = L(
|
|
6
|
+
({ enableLabel: l = "Enable captions", disableLabel: f = "Disable captions", ...m }, u) => {
|
|
7
|
+
const o = w(), [r, v] = d(!1), [p, k] = d(!1);
|
|
8
|
+
if (T(() => {
|
|
9
|
+
const n = o.videoRef.current;
|
|
10
|
+
if (!n) return;
|
|
11
|
+
const t = () => {
|
|
12
|
+
const c = Array.from(n.textTracks).filter(
|
|
13
|
+
(a) => a.kind === "captions" || a.kind === "subtitles"
|
|
14
|
+
);
|
|
15
|
+
k(c.length > 0), v(c.some((a) => a.mode === "showing"));
|
|
16
|
+
};
|
|
17
|
+
t();
|
|
18
|
+
const e = n.textTracks;
|
|
19
|
+
if (typeof e.addEventListener == "function")
|
|
20
|
+
return e.addEventListener("change", t), e.addEventListener("addtrack", t), e.addEventListener("removetrack", t), () => {
|
|
21
|
+
e.removeEventListener?.("change", t), e.removeEventListener?.("addtrack", t), e.removeEventListener?.("removetrack", t);
|
|
22
|
+
};
|
|
23
|
+
}, [o.videoRef]), !p) return null;
|
|
24
|
+
const E = () => {
|
|
25
|
+
const n = o.videoRef.current;
|
|
26
|
+
if (!n) return;
|
|
27
|
+
const t = Array.from(n.textTracks).filter(
|
|
28
|
+
(e) => e.kind === "captions" || e.kind === "subtitles"
|
|
29
|
+
);
|
|
30
|
+
t.length !== 0 && (r ? t.forEach((e) => {
|
|
31
|
+
e.mode = "disabled";
|
|
32
|
+
}) : t[0].mode = "showing");
|
|
33
|
+
}, i = r ? f : l;
|
|
34
|
+
return /* @__PURE__ */ s.createElement(g, { label: i, withArrow: !0, openDelay: 400 }, /* @__PURE__ */ s.createElement(
|
|
35
|
+
h,
|
|
36
|
+
{
|
|
37
|
+
ref: u,
|
|
38
|
+
variant: "transparent",
|
|
39
|
+
color: "white",
|
|
40
|
+
size: "lg",
|
|
41
|
+
"aria-label": i,
|
|
42
|
+
"aria-pressed": r,
|
|
43
|
+
onClick: E,
|
|
44
|
+
"data-state": r ? "on" : "off",
|
|
45
|
+
...o.getStyles("captionsButton"),
|
|
46
|
+
...m
|
|
47
|
+
},
|
|
48
|
+
r ? /* @__PURE__ */ s.createElement(b, { size: 20 }) : /* @__PURE__ */ s.createElement(y, { size: 20 })
|
|
49
|
+
));
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
x.displayName = "VideoCaptionsButton";
|
|
53
|
+
export {
|
|
54
|
+
x as VideoCaptionsButton
|
|
55
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Box as o } from "@mantine/core";
|
|
2
|
+
import e, { forwardRef as i } from "react";
|
|
3
|
+
import { useVideoContext as a } from "../Video.context.js";
|
|
4
|
+
import { VideoCaptionsButton as c } from "./VideoCaptionsButton.js";
|
|
5
|
+
import { VideoFullscreenButton as u } from "./VideoFullscreenButton.js";
|
|
6
|
+
import { VideoMuteButton as p } from "./VideoMuteButton.js";
|
|
7
|
+
import { VideoPiPButton as s } from "./VideoPiPButton.js";
|
|
8
|
+
import { VideoPlayButton as d } from "./VideoPlayButton.js";
|
|
9
|
+
import { VideoTimeDisplay as f } from "./VideoTimeDisplay.js";
|
|
10
|
+
import { VideoTimeline as V } from "./VideoTimeline.js";
|
|
11
|
+
const E = i(
|
|
12
|
+
({ children: r, ...l }, n) => {
|
|
13
|
+
const t = a();
|
|
14
|
+
return /* @__PURE__ */ e.createElement(
|
|
15
|
+
o,
|
|
16
|
+
{
|
|
17
|
+
ref: n,
|
|
18
|
+
...t.getStyles("controls"),
|
|
19
|
+
mod: { visible: t.controlsVisible },
|
|
20
|
+
onClick: (m) => m.stopPropagation(),
|
|
21
|
+
...l
|
|
22
|
+
},
|
|
23
|
+
/* @__PURE__ */ e.createElement(o, { ...t.getStyles("controlBar") }, r ?? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(d, null), /* @__PURE__ */ e.createElement(V, null), /* @__PURE__ */ e.createElement(f, null), /* @__PURE__ */ e.createElement(p, null), /* @__PURE__ */ e.createElement(c, null), /* @__PURE__ */ e.createElement(s, null), /* @__PURE__ */ e.createElement(u, null)))
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
E.displayName = "VideoControls";
|
|
28
|
+
export {
|
|
29
|
+
E as VideoControls
|
|
30
|
+
};
|
package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoFullscreenButton.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Tooltip as i, ActionIcon as a } from "@mantine/core";
|
|
2
|
+
import { IconMinimize as s, IconMaximize as u } from "@tabler/icons-react";
|
|
3
|
+
import t, { forwardRef as f } from "react";
|
|
4
|
+
import { useVideoContext as m } from "../Video.context.js";
|
|
5
|
+
const p = f(
|
|
6
|
+
({ enterLabel: r = "Enter fullscreen", exitLabel: n = "Exit fullscreen", ...o }, c) => {
|
|
7
|
+
const e = m();
|
|
8
|
+
if (!e.canFullscreen) return null;
|
|
9
|
+
const l = e.fullscreen ? n : r;
|
|
10
|
+
return /* @__PURE__ */ t.createElement(i, { label: l, withArrow: !0, openDelay: 400 }, /* @__PURE__ */ t.createElement(
|
|
11
|
+
a,
|
|
12
|
+
{
|
|
13
|
+
ref: c,
|
|
14
|
+
variant: "transparent",
|
|
15
|
+
color: "white",
|
|
16
|
+
size: "lg",
|
|
17
|
+
"aria-label": l,
|
|
18
|
+
"aria-pressed": e.fullscreen,
|
|
19
|
+
onClick: e.toggleFullscreen,
|
|
20
|
+
"data-state": e.fullscreen ? "on" : "off",
|
|
21
|
+
...e.getStyles("fullscreenButton"),
|
|
22
|
+
...o
|
|
23
|
+
},
|
|
24
|
+
e.fullscreen ? /* @__PURE__ */ t.createElement(s, { size: 20 }) : /* @__PURE__ */ t.createElement(u, { size: 20 })
|
|
25
|
+
));
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
p.displayName = "VideoFullscreenButton";
|
|
29
|
+
export {
|
|
30
|
+
p as VideoFullscreenButton
|
|
31
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Tooltip as i, ActionIcon as c } from "@mantine/core";
|
|
2
|
+
import { IconVolume3 as s, IconVolume2 as d, IconVolume as p } from "@tabler/icons-react";
|
|
3
|
+
import o, { forwardRef as f } from "react";
|
|
4
|
+
import { useVideoContext as V } from "../Video.context.js";
|
|
5
|
+
const I = f(
|
|
6
|
+
({ muteLabel: r = "Mute", unmuteLabel: u = "Unmute", ...a }, m) => {
|
|
7
|
+
const e = V(), t = e.muted || e.volume === 0, n = t ? u : r, l = t ? s : e.volume < 0.5 ? d : p;
|
|
8
|
+
return /* @__PURE__ */ o.createElement(i, { label: n, withArrow: !0, openDelay: 400 }, /* @__PURE__ */ o.createElement(
|
|
9
|
+
c,
|
|
10
|
+
{
|
|
11
|
+
ref: m,
|
|
12
|
+
variant: "transparent",
|
|
13
|
+
color: "white",
|
|
14
|
+
size: "lg",
|
|
15
|
+
"aria-label": n,
|
|
16
|
+
"aria-pressed": t,
|
|
17
|
+
onClick: e.toggleMute,
|
|
18
|
+
"data-state": t ? "muted" : "unmuted",
|
|
19
|
+
...e.getStyles("muteButton"),
|
|
20
|
+
...a
|
|
21
|
+
},
|
|
22
|
+
/* @__PURE__ */ o.createElement(l, { size: 20 })
|
|
23
|
+
));
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
I.displayName = "VideoMuteButton";
|
|
27
|
+
export {
|
|
28
|
+
I as VideoMuteButton
|
|
29
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Tooltip as n, ActionIcon as a } from "@mantine/core";
|
|
2
|
+
import { IconPictureInPicture as c } from "@tabler/icons-react";
|
|
3
|
+
import e, { forwardRef as p } from "react";
|
|
4
|
+
import { useVideoContext as l } from "../Video.context.js";
|
|
5
|
+
const u = p(
|
|
6
|
+
({ label: o = "Picture-in-Picture", ...r }, i) => {
|
|
7
|
+
const t = l();
|
|
8
|
+
return t.canPiP ? /* @__PURE__ */ e.createElement(n, { label: o, withArrow: !0, openDelay: 400 }, /* @__PURE__ */ e.createElement(
|
|
9
|
+
a,
|
|
10
|
+
{
|
|
11
|
+
ref: i,
|
|
12
|
+
variant: "transparent",
|
|
13
|
+
color: "white",
|
|
14
|
+
size: "lg",
|
|
15
|
+
"aria-label": o,
|
|
16
|
+
"aria-pressed": t.pip,
|
|
17
|
+
onClick: t.togglePiP,
|
|
18
|
+
"data-state": t.pip ? "on" : "off",
|
|
19
|
+
...t.getStyles("pipButton"),
|
|
20
|
+
...r
|
|
21
|
+
},
|
|
22
|
+
/* @__PURE__ */ e.createElement(c, { size: 20 })
|
|
23
|
+
)) : null;
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
u.displayName = "VideoPiPButton";
|
|
27
|
+
export {
|
|
28
|
+
u as VideoPiPButton
|
|
29
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Tooltip as i, ActionIcon as c } from "@mantine/core";
|
|
2
|
+
import { IconPlayerPauseFilled as p, IconPlayerPlayFilled as s } from "@tabler/icons-react";
|
|
3
|
+
import t, { forwardRef as y } from "react";
|
|
4
|
+
import { useVideoContext as m } from "../Video.context.js";
|
|
5
|
+
const d = y(
|
|
6
|
+
({ playLabel: l = "Play", pauseLabel: o = "Pause", ...r }, n) => {
|
|
7
|
+
const e = m(), a = e.playing ? o : l;
|
|
8
|
+
return /* @__PURE__ */ t.createElement(i, { label: a, withArrow: !0, openDelay: 400 }, /* @__PURE__ */ t.createElement(
|
|
9
|
+
c,
|
|
10
|
+
{
|
|
11
|
+
ref: n,
|
|
12
|
+
variant: "transparent",
|
|
13
|
+
color: "white",
|
|
14
|
+
size: "lg",
|
|
15
|
+
"aria-label": a,
|
|
16
|
+
onClick: e.toggle,
|
|
17
|
+
"data-state": e.playing ? "playing" : "paused",
|
|
18
|
+
...e.getStyles("playButton"),
|
|
19
|
+
...r
|
|
20
|
+
},
|
|
21
|
+
e.playing ? /* @__PURE__ */ t.createElement(p, { size: 20 }) : /* @__PURE__ */ t.createElement(s, { size: 20 })
|
|
22
|
+
));
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
d.displayName = "VideoPlayButton";
|
|
26
|
+
export {
|
|
27
|
+
d as VideoPlayButton
|
|
28
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Tooltip as p, ActionIcon as d } from "@mantine/core";
|
|
2
|
+
import { IconRewindForward10 as s, IconRewindBackward10 as w } from "@tabler/icons-react";
|
|
3
|
+
import e, { forwardRef as f } from "react";
|
|
4
|
+
import { useVideoContext as k } from "../Video.context.js";
|
|
5
|
+
const u = f(
|
|
6
|
+
({ seconds: t = 10, icon: n, label: i, ...c }, l) => {
|
|
7
|
+
const o = k(), r = t >= 0, a = i ?? `${r ? "Forward" : "Back"} ${Math.abs(t)}s`, m = n ?? (r ? /* @__PURE__ */ e.createElement(s, { size: 20 }) : /* @__PURE__ */ e.createElement(w, { size: 20 }));
|
|
8
|
+
return /* @__PURE__ */ e.createElement(p, { label: a, withArrow: !0, openDelay: 400 }, /* @__PURE__ */ e.createElement(
|
|
9
|
+
d,
|
|
10
|
+
{
|
|
11
|
+
ref: l,
|
|
12
|
+
variant: "transparent",
|
|
13
|
+
color: "white",
|
|
14
|
+
size: "lg",
|
|
15
|
+
"aria-label": a,
|
|
16
|
+
onClick: () => o.seekBy(t),
|
|
17
|
+
...o.getStyles("skipButton"),
|
|
18
|
+
...c
|
|
19
|
+
},
|
|
20
|
+
m
|
|
21
|
+
));
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
u.displayName = "VideoSkipButton";
|
|
25
|
+
export {
|
|
26
|
+
u as VideoSkipButton
|
|
27
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Text as s } from "@mantine/core";
|
|
2
|
+
import c, { forwardRef as f } from "react";
|
|
3
|
+
import { useVideoContext as u } from "../Video.context.js";
|
|
4
|
+
const l = f(
|
|
5
|
+
({ format: r = "current/duration", ...t }, e) => {
|
|
6
|
+
const o = u(), n = p(r, o.currentTime, o.duration);
|
|
7
|
+
return /* @__PURE__ */ c.createElement(
|
|
8
|
+
s,
|
|
9
|
+
{
|
|
10
|
+
ref: e,
|
|
11
|
+
size: "sm",
|
|
12
|
+
c: "white",
|
|
13
|
+
ff: "monospace",
|
|
14
|
+
ta: "center",
|
|
15
|
+
...o.getStyles("timeDisplay"),
|
|
16
|
+
...t
|
|
17
|
+
},
|
|
18
|
+
n
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
l.displayName = "VideoTimeDisplay";
|
|
23
|
+
function a(r) {
|
|
24
|
+
if (!Number.isFinite(r) || r < 0) return "0:00";
|
|
25
|
+
const t = Math.floor(r), e = Math.floor(t / 3600), o = Math.floor(t % 3600 / 60), n = t % 60, i = e > 0 ? String(o).padStart(2, "0") : String(o), m = String(n).padStart(2, "0");
|
|
26
|
+
return e > 0 ? `${e}:${i}:${m}` : `${i}:${m}`;
|
|
27
|
+
}
|
|
28
|
+
function p(r, t, e) {
|
|
29
|
+
switch (r) {
|
|
30
|
+
case "current":
|
|
31
|
+
return a(t);
|
|
32
|
+
case "duration":
|
|
33
|
+
return a(e);
|
|
34
|
+
case "remaining":
|
|
35
|
+
return a(Math.max(e - t, 0));
|
|
36
|
+
case "current/-remaining":
|
|
37
|
+
return `${a(t)} / -${a(Math.max(e - t, 0))}`;
|
|
38
|
+
default:
|
|
39
|
+
return `${a(t)} / ${a(e)}`;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
l as VideoTimeDisplay
|
|
44
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Box as h, Slider as y } from "@mantine/core";
|
|
2
|
+
import b, { forwardRef as v, useState as x, useRef as m, useEffect as R, useCallback as p } from "react";
|
|
3
|
+
import { useVideoContext as E } from "../Video.context.js";
|
|
4
|
+
const $ = v(
|
|
5
|
+
({ sliderProps: o, liveScrub: t = !0, ...l }, u) => {
|
|
6
|
+
const e = E(), [c, i] = x(null), f = m(!1), d = m(!1), r = m(null), a = m(null), s = Number.isFinite(e.duration) && e.duration > 0 ? e.duration : 0, g = c ?? e.currentTime, S = s > 0 ? e.buffered / s * 100 : 0;
|
|
7
|
+
R(
|
|
8
|
+
() => () => {
|
|
9
|
+
r.current !== null && cancelAnimationFrame(r.current);
|
|
10
|
+
},
|
|
11
|
+
[]
|
|
12
|
+
);
|
|
13
|
+
const C = p(
|
|
14
|
+
(n) => {
|
|
15
|
+
f.current || (f.current = !0, d.current = e.playing, t && e.playing && e.pause()), i(n), t && (a.current = n, r.current === null && (r.current = requestAnimationFrame(() => {
|
|
16
|
+
r.current = null, a.current !== null && (e.seek(a.current), a.current = null);
|
|
17
|
+
})));
|
|
18
|
+
},
|
|
19
|
+
[e, t]
|
|
20
|
+
), k = p(
|
|
21
|
+
(n) => {
|
|
22
|
+
r.current !== null && (cancelAnimationFrame(r.current), r.current = null), a.current = null, e.seek(n), i(null), f.current = !1, d.current && (d.current = !1, e.play());
|
|
23
|
+
},
|
|
24
|
+
[e]
|
|
25
|
+
);
|
|
26
|
+
return /* @__PURE__ */ b.createElement(h, { ref: u, ...e.getStyles("timeline"), ...l }, /* @__PURE__ */ b.createElement(
|
|
27
|
+
h,
|
|
28
|
+
{
|
|
29
|
+
...e.getStyles("timelineBuffered"),
|
|
30
|
+
style: { width: `${S}%` },
|
|
31
|
+
"aria-hidden": !0
|
|
32
|
+
}
|
|
33
|
+
), /* @__PURE__ */ b.createElement(
|
|
34
|
+
y,
|
|
35
|
+
{
|
|
36
|
+
value: Math.min(g, s || g),
|
|
37
|
+
onChange: C,
|
|
38
|
+
onChangeEnd: k,
|
|
39
|
+
min: 0,
|
|
40
|
+
max: s || 1e-4,
|
|
41
|
+
step: 0.01,
|
|
42
|
+
label: (n) => w(n),
|
|
43
|
+
showLabelOnHover: !0,
|
|
44
|
+
color: "var(--video-timeline-color)",
|
|
45
|
+
thumbSize: 12,
|
|
46
|
+
size: "xs",
|
|
47
|
+
"aria-label": "Seek",
|
|
48
|
+
styles: {
|
|
49
|
+
root: { flex: 1, width: "100%" },
|
|
50
|
+
track: { backgroundColor: "rgba(255, 255, 255, 0.25)" },
|
|
51
|
+
bar: { backgroundColor: "var(--video-timeline-color)" },
|
|
52
|
+
thumb: {
|
|
53
|
+
backgroundColor: "var(--video-timeline-thumb-color)",
|
|
54
|
+
borderColor: "var(--video-timeline-thumb-color)"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
...o
|
|
58
|
+
}
|
|
59
|
+
));
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
$.displayName = "VideoTimeline";
|
|
63
|
+
function w(o) {
|
|
64
|
+
if (!Number.isFinite(o) || o < 0) return "0:00";
|
|
65
|
+
const t = Math.floor(o), l = Math.floor(t / 3600), u = Math.floor(t % 3600 / 60), e = t % 60, c = l > 0 ? String(u).padStart(2, "0") : String(u), i = String(e).padStart(2, "0");
|
|
66
|
+
return l > 0 ? `${l}:${c}:${i}` : `${c}:${i}`;
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
$ as VideoTimeline
|
|
70
|
+
};
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { useRef as m, useState as a, useEffect as i, useCallback as u } from "react";
|
|
2
|
+
function Ee(r = {}) {
|
|
3
|
+
const n = m(null), o = m(null), [v, l] = a(!1), [N, y] = a(0), [B, P] = a(0), [U, E] = a(0), [W, g] = a(r.volume ?? 1), [j, p] = a(r.muted ?? !1), [z, h] = a(r.playbackRate ?? 1), [A, L] = a(!1), [G, d] = a(!1), [H, J] = a(null), [K, O] = a(!1), [Q, b] = a(!1), [X, R] = a(!1), [Y, Z] = a(!1), [_, $] = a(!1);
|
|
4
|
+
i(() => {
|
|
5
|
+
typeof document > "u" || (Z(!!document.fullscreenEnabled), $(
|
|
6
|
+
document.pictureInPictureEnabled === !0
|
|
7
|
+
));
|
|
8
|
+
}, []);
|
|
9
|
+
const c = m(r);
|
|
10
|
+
c.current = r, i(() => {
|
|
11
|
+
const e = n.current;
|
|
12
|
+
if (!e) return;
|
|
13
|
+
const t = () => {
|
|
14
|
+
l(!0), L(!1), c.current.onPlayChange?.(!0);
|
|
15
|
+
}, s = () => {
|
|
16
|
+
l(!1), c.current.onPlayChange?.(!1);
|
|
17
|
+
}, k = () => {
|
|
18
|
+
L(!0), l(!1), c.current.onEnded?.();
|
|
19
|
+
}, C = () => {
|
|
20
|
+
y(e.currentTime), c.current.onCurrentTimeChange?.(e.currentTime);
|
|
21
|
+
}, f = () => {
|
|
22
|
+
const D = e.duration || 0;
|
|
23
|
+
P(D), c.current.onDurationChange?.(D);
|
|
24
|
+
}, F = () => {
|
|
25
|
+
g(e.volume), p(e.muted), c.current.onVolumeChange?.(e.volume);
|
|
26
|
+
}, T = () => {
|
|
27
|
+
h(e.playbackRate), c.current.onPlaybackRateChange?.(e.playbackRate);
|
|
28
|
+
}, I = () => d(!0), x = () => d(!1), M = () => {
|
|
29
|
+
R(!0), d(!1);
|
|
30
|
+
}, w = () => {
|
|
31
|
+
e.buffered.length > 0 && E(e.buffered.end(e.buffered.length - 1));
|
|
32
|
+
}, q = () => {
|
|
33
|
+
J(e.error), d(!1), c.current.onError?.(e.error);
|
|
34
|
+
}, S = () => {
|
|
35
|
+
b(!0), c.current.onEnterPictureInPicture?.();
|
|
36
|
+
}, V = () => {
|
|
37
|
+
b(!1), c.current.onLeavePictureInPicture?.();
|
|
38
|
+
};
|
|
39
|
+
return e.addEventListener("play", t), e.addEventListener("pause", s), e.addEventListener("ended", k), e.addEventListener("timeupdate", C), e.addEventListener("durationchange", f), e.addEventListener("loadedmetadata", f), e.addEventListener("volumechange", F), e.addEventListener("ratechange", T), e.addEventListener("waiting", I), e.addEventListener("playing", x), e.addEventListener("canplay", M), e.addEventListener("progress", w), e.addEventListener("error", q), e.addEventListener("enterpictureinpicture", S), e.addEventListener("leavepictureinpicture", V), Number.isFinite(e.duration) && e.duration > 0 && P(e.duration), e.currentTime > 0 && y(e.currentTime), (e.volume !== 1 || e.muted) && (g(e.volume), p(e.muted)), e.playbackRate !== 1 && h(e.playbackRate), e.paused || l(!0), e.readyState >= 3 && R(!0), e.buffered.length > 0 && E(e.buffered.end(e.buffered.length - 1)), () => {
|
|
40
|
+
e.removeEventListener("play", t), e.removeEventListener("pause", s), e.removeEventListener("ended", k), e.removeEventListener("timeupdate", C), e.removeEventListener("durationchange", f), e.removeEventListener("loadedmetadata", f), e.removeEventListener("volumechange", F), e.removeEventListener("ratechange", T), e.removeEventListener("waiting", I), e.removeEventListener("playing", x), e.removeEventListener("canplay", M), e.removeEventListener("progress", w), e.removeEventListener("error", q), e.removeEventListener("enterpictureinpicture", S), e.removeEventListener("leavepictureinpicture", V);
|
|
41
|
+
};
|
|
42
|
+
}, []), i(() => {
|
|
43
|
+
if (typeof document > "u") return;
|
|
44
|
+
const e = () => {
|
|
45
|
+
const t = document.fullscreenElement === o.current || document.fullscreenElement === n.current;
|
|
46
|
+
O(t), c.current.onFullscreenChange?.(t);
|
|
47
|
+
};
|
|
48
|
+
return document.addEventListener("fullscreenchange", e), () => document.removeEventListener("fullscreenchange", e);
|
|
49
|
+
}, []), i(() => {
|
|
50
|
+
if (r.playing === void 0) return;
|
|
51
|
+
const e = n.current;
|
|
52
|
+
e && (r.playing && e.paused ? e.play().catch(() => {
|
|
53
|
+
}) : !r.playing && !e.paused && e.pause());
|
|
54
|
+
}, [r.playing]), i(() => {
|
|
55
|
+
if (r.currentTime === void 0) return;
|
|
56
|
+
const e = n.current;
|
|
57
|
+
e && Math.abs(e.currentTime - r.currentTime) > 0.5 && (e.currentTime = r.currentTime);
|
|
58
|
+
}, [r.currentTime]), i(() => {
|
|
59
|
+
if (r.volume === void 0) return;
|
|
60
|
+
const e = n.current;
|
|
61
|
+
e && Math.abs(e.volume - r.volume) > 0.01 && (e.volume = Math.max(0, Math.min(1, r.volume)));
|
|
62
|
+
}, [r.volume]), i(() => {
|
|
63
|
+
if (r.playbackRate === void 0) return;
|
|
64
|
+
const e = n.current;
|
|
65
|
+
e && e.playbackRate !== r.playbackRate && (e.playbackRate = r.playbackRate);
|
|
66
|
+
}, [r.playbackRate]);
|
|
67
|
+
const ee = u(async () => {
|
|
68
|
+
const e = n.current;
|
|
69
|
+
if (e)
|
|
70
|
+
try {
|
|
71
|
+
await e.play();
|
|
72
|
+
} catch {
|
|
73
|
+
}
|
|
74
|
+
}, []), te = u(() => {
|
|
75
|
+
n.current?.pause();
|
|
76
|
+
}, []), ne = u(() => {
|
|
77
|
+
const e = n.current;
|
|
78
|
+
e && (e.paused ? e.play().catch(() => {
|
|
79
|
+
}) : e.pause());
|
|
80
|
+
}, []), re = u((e) => {
|
|
81
|
+
const t = n.current;
|
|
82
|
+
if (!t) return;
|
|
83
|
+
const s = Number.isFinite(t.duration) ? t.duration : 1 / 0;
|
|
84
|
+
t.currentTime = Math.max(0, Math.min(e, s));
|
|
85
|
+
}, []), ue = u((e) => {
|
|
86
|
+
const t = n.current;
|
|
87
|
+
if (!t) return;
|
|
88
|
+
const s = Number.isFinite(t.duration) ? t.duration : 1 / 0;
|
|
89
|
+
t.currentTime = Math.max(0, Math.min(t.currentTime + e, s));
|
|
90
|
+
}, []), ae = u((e) => {
|
|
91
|
+
const t = n.current;
|
|
92
|
+
t && (t.volume = Math.max(0, Math.min(1, e)), e > 0 && t.muted && (t.muted = !1));
|
|
93
|
+
}, []), ce = u(() => {
|
|
94
|
+
n.current && (n.current.muted = !0);
|
|
95
|
+
}, []), ie = u(() => {
|
|
96
|
+
n.current && (n.current.muted = !1);
|
|
97
|
+
}, []), se = u(() => {
|
|
98
|
+
const e = n.current;
|
|
99
|
+
e && (e.muted = !e.muted);
|
|
100
|
+
}, []), oe = u((e) => {
|
|
101
|
+
n.current && (n.current.playbackRate = e);
|
|
102
|
+
}, []), le = u(async () => {
|
|
103
|
+
const e = o.current;
|
|
104
|
+
e && e.requestFullscreen && await e.requestFullscreen();
|
|
105
|
+
}, []), de = u(async () => {
|
|
106
|
+
typeof document < "u" && document.fullscreenElement && await document.exitFullscreen();
|
|
107
|
+
}, []), fe = u(async () => {
|
|
108
|
+
if (typeof document < "u" && document.fullscreenElement)
|
|
109
|
+
await document.exitFullscreen();
|
|
110
|
+
else {
|
|
111
|
+
const e = o.current;
|
|
112
|
+
e?.requestFullscreen && await e.requestFullscreen();
|
|
113
|
+
}
|
|
114
|
+
}, []), me = u(async () => {
|
|
115
|
+
const e = n.current;
|
|
116
|
+
e?.requestPictureInPicture && await e.requestPictureInPicture();
|
|
117
|
+
}, []), ve = u(async () => {
|
|
118
|
+
if (typeof document > "u") return;
|
|
119
|
+
const e = document;
|
|
120
|
+
e.pictureInPictureElement && e.exitPictureInPicture && await e.exitPictureInPicture();
|
|
121
|
+
}, []), ye = u(async () => {
|
|
122
|
+
if (typeof document > "u") return;
|
|
123
|
+
const e = document;
|
|
124
|
+
if (e.pictureInPictureElement && e.exitPictureInPicture)
|
|
125
|
+
await e.exitPictureInPicture();
|
|
126
|
+
else {
|
|
127
|
+
const t = n.current;
|
|
128
|
+
t?.requestPictureInPicture && await t.requestPictureInPicture();
|
|
129
|
+
}
|
|
130
|
+
}, []);
|
|
131
|
+
return {
|
|
132
|
+
videoRef: n,
|
|
133
|
+
containerRef: o,
|
|
134
|
+
playing: v,
|
|
135
|
+
paused: !v,
|
|
136
|
+
ended: A,
|
|
137
|
+
currentTime: N,
|
|
138
|
+
duration: B,
|
|
139
|
+
buffered: U,
|
|
140
|
+
volume: W,
|
|
141
|
+
muted: j,
|
|
142
|
+
playbackRate: z,
|
|
143
|
+
fullscreen: K,
|
|
144
|
+
pip: Q,
|
|
145
|
+
isLoading: G,
|
|
146
|
+
error: H,
|
|
147
|
+
canPlay: X,
|
|
148
|
+
canFullscreen: Y,
|
|
149
|
+
canPiP: _,
|
|
150
|
+
play: ee,
|
|
151
|
+
pause: te,
|
|
152
|
+
toggle: ne,
|
|
153
|
+
seek: re,
|
|
154
|
+
seekBy: ue,
|
|
155
|
+
setVolume: ae,
|
|
156
|
+
mute: ce,
|
|
157
|
+
unmute: ie,
|
|
158
|
+
toggleMute: se,
|
|
159
|
+
setPlaybackRate: oe,
|
|
160
|
+
requestFullscreen: le,
|
|
161
|
+
exitFullscreen: de,
|
|
162
|
+
toggleFullscreen: fe,
|
|
163
|
+
requestPiP: me,
|
|
164
|
+
exitPiP: ve,
|
|
165
|
+
togglePiP: ye
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
export {
|
|
169
|
+
Ee as useVideo
|
|
170
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@layers-app/shared",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"description": "Shared components, hooks, and utilities for Layers application",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"@dnd-kit/sortable": "^8.0.0",
|
|
38
38
|
"@dnd-kit/utilities": "^3.2.0",
|
|
39
39
|
"@emoji-mart/data": "^1.2.1",
|
|
40
|
+
"@layers-app/draggable-ui": "^0.0.1",
|
|
40
41
|
"@layers-app/onboarding-tour": "^4.0.0",
|
|
41
42
|
"@mantine/core": ">=9.0.0",
|
|
42
43
|
"@mantine/dates": ">=9.0.0",
|
|
@@ -52,7 +53,6 @@
|
|
|
52
53
|
"@tanstack/virtual-core": "^3.0.0",
|
|
53
54
|
"chroma-js": "^3.1.2",
|
|
54
55
|
"date-fns": "^4.1.0",
|
|
55
|
-
"@layers-app/draggable-ui": "^0.0.1",
|
|
56
56
|
"emoji-mart": "^5.6.0",
|
|
57
57
|
"exceljs": "^4.3.0",
|
|
58
58
|
"framer-motion": "^11.3.24",
|
|
@@ -73,6 +73,8 @@
|
|
|
73
73
|
"zustand": "^5.0.3"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@gfazioli/mantine-
|
|
76
|
+
"@gfazioli/mantine-audio": "^1.0.2",
|
|
77
|
+
"@gfazioli/mantine-onboarding-tour": "^4.0.0",
|
|
78
|
+
"@gfazioli/mantine-video": "^1.1.2"
|
|
77
79
|
}
|
|
78
80
|
}
|