@layers-app/shared 0.4.6 → 0.4.7
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/components/AnimatedFigurePage/AnimatedFigurePage.module.css.js +13 -13
- package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/AppContainer.js +79 -72
- 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/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/SlideAnimation.js +4 -4
- package/dist/components/AppContainer/components/ToolSidebar.js +9 -9
- 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/AppShell/AppShell.module.css.js +5 -5
- package/dist/components/AttachmentsGalleryModal/AttachmentsGalleryContext.d.ts +2 -0
- package/dist/components/AttachmentsGalleryModal/AttachmentsGalleryContext.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/AttachmentsGalleryContext.js +22 -17
- package/dist/components/AttachmentsGalleryModal/components/AttachmentVideoPlayer.d.ts +15 -0
- package/dist/components/AttachmentsGalleryModal/components/AttachmentVideoPlayer.d.ts.map +1 -0
- package/dist/components/AttachmentsGalleryModal/components/AttachmentVideoPlayer.js +36 -0
- package/dist/components/AttachmentsGalleryModal/components/GallerySlide.js +22 -22
- package/dist/components/AttachmentsGalleryModal/components/LegacyAttachmentVideoPlayer.d.ts +14 -0
- package/dist/components/AttachmentsGalleryModal/components/LegacyAttachmentVideoPlayer.d.ts.map +1 -0
- package/dist/components/AttachmentsGalleryModal/components/LegacyAttachmentVideoPlayer.js +31 -0
- package/dist/components/AttachmentsGalleryModal/components/ModalHeader.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ModalHeader.js +172 -120
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.module.css.js +4 -4
- package/dist/components/AttachmentsGalleryModal/components/StatusVideoPlayer.d.ts +18 -0
- package/dist/components/AttachmentsGalleryModal/components/StatusVideoPlayer.d.ts.map +1 -0
- package/dist/components/AttachmentsGalleryModal/components/StatusVideoPlayer.js +35 -0
- package/dist/components/AttachmentsGalleryModal/components/useAttachmentVideoStatus.d.ts +33 -0
- package/dist/components/AttachmentsGalleryModal/components/useAttachmentVideoStatus.d.ts.map +1 -0
- package/dist/components/AttachmentsGalleryModal/components/useAttachmentVideoStatus.js +70 -0
- package/dist/components/AttachmentsGalleryModal/styles.module.css.js +32 -28
- package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +12 -12
- package/dist/components/BouncingLogo/BouncingLogo.module.css.js +4 -4
- package/dist/components/Chat/CallMessage/CallMessage.module.css.js +8 -8
- package/dist/components/Chat/ChatBubble/ChatBubble.module.css.js +1 -1
- package/dist/components/Chat/ChatHeader/ChatHeader.module.css.js +1 -1
- package/dist/components/Chat/ChatInput/ChatInput.module.css.js +44 -44
- package/dist/components/Chat/ChatLayout/ChatLayout.module.css.js +4 -4
- package/dist/components/Chat/ChatMessage/ChatMessage.module.css.js +10 -10
- package/dist/components/Chat/ChatPill/ChatPill.module.css.js +1 -1
- package/dist/components/Chat/DialogItem/DialogItem.module.css.js +4 -4
- package/dist/components/Chat/DialogList/DialogList.module.css.js +1 -1
- package/dist/components/Chat/MediaDocument/MediaDocument.module.css.js +4 -4
- package/dist/components/Chat/MessageActions/MessageActions.module.css.js +1 -1
- package/dist/components/Chat/MessageActions/index.d.ts.map +1 -1
- package/dist/components/Chat/MessageActions/index.js +38 -37
- package/dist/components/Chat/MessageForward/MessageForward.module.css.js +1 -1
- package/dist/components/Chat/MessageList/MessageList.module.css.js +5 -5
- package/dist/components/Chat/MessageMeta/MessageMeta.module.css.js +3 -3
- package/dist/components/Chat/MessageMeta/index.d.ts.map +1 -1
- package/dist/components/Chat/MessageMeta/index.js +21 -19
- package/dist/components/Chat/MessageReactions/MessageReactions.module.css.js +12 -12
- package/dist/components/Chat/MessageReply/MessageReply.module.css.js +7 -7
- package/dist/components/Chat/MessageStatus/MessageStatus.module.css.js +8 -8
- package/dist/components/Chat/ServiceMessage/ServiceMessage.module.css.js +1 -1
- package/dist/components/CollapsibleContainer/CollapsibleContainer.module.css.js +1 -1
- 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/ColorPicker.module.css.js +26 -32
- package/dist/components/ColorPicker/ColorPickerList.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerList.js +72 -83
- package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerToolbar.js +64 -67
- package/dist/components/ColorPicker/icons.js +5 -5
- package/dist/components/ColorPicker/types.d.ts +0 -6
- package/dist/components/ColorPicker/types.d.ts.map +1 -1
- package/dist/components/ColorPicker/types.js +11 -53
- package/dist/components/ColorPicker/useRecentColors.d.ts +1 -3
- package/dist/components/ColorPicker/useRecentColors.d.ts.map +1 -1
- package/dist/components/ColorPicker/useRecentColors.js +20 -43
- package/dist/components/CommentComposer/CommentComposer.module.css.js +4 -4
- package/dist/components/CommunitiesDialog/styles.module.css.js +1 -1
- package/dist/components/Copyright/Copyright.module.css.js +1 -1
- package/dist/components/CustomKBD/CustomKBD.module.css.js +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.module.css.js +8 -8
- package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
- package/dist/components/ErrorPage/components/Error404.d.ts.map +1 -1
- package/dist/components/FeatureProgress/FeatureProgress.module.css.js +49 -49
- package/dist/components/FilePicker/FilePicker.module.css.js +7 -7
- package/dist/components/FormViewer/FormViewer.module.css.js +20 -20
- package/dist/components/FormViewer/components/fields/DragOptions/DragOptions.module.css.js +1 -1
- package/dist/components/FormViewer/components/fields/DropdownField/DropdownField.module.css.js +1 -1
- package/dist/components/FormViewer/components/fields/EditableContent/EditableContent.module.css.js +1 -1
- package/dist/components/FormViewer/components/fields/SelectableCard/SelectableCard.module.css.js +8 -8
- package/dist/components/FormViewer/components/fields/UploadField/UploadFile/UploadFile.module.css.js +4 -4
- package/dist/components/FormViewer/store/formStore.d.ts.map +1 -1
- package/dist/components/ImageCropper/ImageCropper.module.css.js +38 -38
- 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/IntegrationFlowAnimation/IntegrationFlowAnimation.module.css.js +11 -11
- package/dist/components/LanguagePicker/LanguagePicker.module.css.js +1 -1
- package/dist/components/Loaders/styles.module.css.js +6 -6
- package/dist/components/MediaLibrary/MediaLibrary.module.css.js +2 -2
- package/dist/components/MusicPlayerBar/MusicPlayerBar.module.css.js +23 -23
- package/dist/components/NavMenu/NavMenu.module.css.js +12 -12
- package/dist/components/NavbarResizer/NavbarResizer.module.css.js +2 -2
- package/dist/components/NewToolbar/utils.d.ts +12 -0
- package/dist/components/NewToolbar/utils.d.ts.map +1 -0
- package/dist/components/NotPublicPanel/NotPublicPanel.module.css.js +11 -11
- package/dist/components/Notification/Notification.module.css.js +1 -1
- 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/PillTabs/PillTabs.module.css.js +1 -1
- package/dist/components/SearchFilters/SearchFilters.module.css.js +1 -1
- package/dist/components/SettingsSection/styles.module.css.js +1 -1
- package/dist/components/StorageUsageProgress/StorageUsageProgress.module.css.js +1 -1
- package/dist/components/TreeIndent/TreeIndent.module.css.js +4 -4
- package/dist/components/VideoPlayer/VideoPlayer.d.ts +24 -0
- package/dist/components/VideoPlayer/VideoPlayer.d.ts.map +1 -0
- package/dist/components/VideoPlayer/VideoPlayer.js +727 -0
- package/dist/components/VideoPlayer/components/MobileDrawer/index.d.ts +8 -0
- package/dist/components/VideoPlayer/components/MobileDrawer/index.d.ts.map +1 -0
- package/dist/components/VideoPlayer/components/MobileDrawer/index.js +67 -0
- package/dist/components/VideoPlayer/components/SelectListOptionButton.d.ts +7 -0
- package/dist/components/VideoPlayer/components/SelectListOptionButton.d.ts.map +1 -0
- package/dist/components/VideoPlayer/components/SelectListOptionButton.js +44 -0
- package/dist/components/VideoPlayer/components/StoryboardPreview.d.ts +9 -0
- package/dist/components/VideoPlayer/components/StoryboardPreview.d.ts.map +1 -0
- package/dist/components/VideoPlayer/components/StoryboardPreview.js +38 -0
- package/dist/components/VideoPlayer/components/VideoCustomControls.d.ts +33 -0
- package/dist/components/VideoPlayer/components/VideoCustomControls.d.ts.map +1 -0
- package/dist/components/VideoPlayer/components/VideoCustomControls.js +601 -0
- package/dist/components/VideoPlayer/components/VideoIcons.d.ts +25 -0
- package/dist/components/VideoPlayer/components/VideoIcons.d.ts.map +1 -0
- package/dist/components/VideoPlayer/components/VideoIcons.js +145 -0
- package/dist/components/VideoPlayer/components/VideoMenu.d.ts +27 -0
- package/dist/components/VideoPlayer/components/VideoMenu.d.ts.map +1 -0
- package/dist/components/VideoPlayer/components/VideoMenu.js +77 -0
- package/dist/components/VideoPlayer/components/VideoMobileSettingsDrawer.d.ts +17 -0
- package/dist/components/VideoPlayer/components/VideoMobileSettingsDrawer.d.ts.map +1 -0
- package/dist/components/VideoPlayer/components/VideoMobileSettingsDrawer.js +289 -0
- package/dist/components/VideoPlayer/components/VideoQualityMenu/index.d.ts +10 -0
- package/dist/components/VideoPlayer/components/VideoQualityMenu/index.d.ts.map +1 -0
- package/dist/components/VideoPlayer/components/VideoQualityMenu/index.js +55 -0
- package/dist/components/VideoPlayer/components/VideoSelect.d.ts +10 -0
- package/dist/components/VideoPlayer/components/VideoSelect.d.ts.map +1 -0
- package/dist/components/VideoPlayer/components/VideoSelect.js +168 -0
- package/dist/components/VideoPlayer/components/VideoSettingsMenu/index.d.ts +12 -0
- package/dist/components/VideoPlayer/components/VideoSettingsMenu/index.d.ts.map +1 -0
- package/dist/components/VideoPlayer/components/VideoSettingsMenu/index.js +48 -0
- package/dist/components/VideoPlayer/components/VideoSettingsModal/ChaptersSection.d.ts +25 -0
- package/dist/components/VideoPlayer/components/VideoSettingsModal/ChaptersSection.d.ts.map +1 -0
- package/dist/components/VideoPlayer/components/VideoSettingsModal/ChaptersSection.js +384 -0
- package/dist/components/VideoPlayer/components/VideoSettingsModal/CoverSection.d.ts +21 -0
- package/dist/components/VideoPlayer/components/VideoSettingsModal/CoverSection.d.ts.map +1 -0
- package/dist/components/VideoPlayer/components/VideoSettingsModal/CoverSection.js +264 -0
- package/dist/components/VideoPlayer/components/VideoSettingsModal/FooterActions.d.ts +10 -0
- package/dist/components/VideoPlayer/components/VideoSettingsModal/FooterActions.d.ts.map +1 -0
- package/dist/components/VideoPlayer/components/VideoSettingsModal/FooterActions.js +39 -0
- package/dist/components/VideoPlayer/components/VideoSettingsModal/ManualSubtitlesPanel.d.ts +14 -0
- package/dist/components/VideoPlayer/components/VideoSettingsModal/ManualSubtitlesPanel.d.ts.map +1 -0
- package/dist/components/VideoPlayer/components/VideoSettingsModal/ManualSubtitlesPanel.js +360 -0
- package/dist/components/VideoPlayer/components/VideoSettingsModal/SubtitleTrackRow.d.ts +16 -0
- package/dist/components/VideoPlayer/components/VideoSettingsModal/SubtitleTrackRow.d.ts.map +1 -0
- package/dist/components/VideoPlayer/components/VideoSettingsModal/SubtitlesSection.d.ts +14 -0
- package/dist/components/VideoPlayer/components/VideoSettingsModal/SubtitlesSection.d.ts.map +1 -0
- package/dist/components/VideoPlayer/components/VideoSettingsModal/context.d.ts +4 -0
- package/dist/components/VideoPlayer/components/VideoSettingsModal/context.d.ts.map +1 -0
- package/dist/components/VideoPlayer/components/VideoSettingsModal/context.js +14 -0
- package/dist/components/VideoPlayer/components/VideoSettingsModal/index.d.ts +22 -0
- package/dist/components/VideoPlayer/components/VideoSettingsModal/index.d.ts.map +1 -0
- package/dist/components/VideoPlayer/components/VideoSettingsModal/index.js +211 -0
- package/dist/components/VideoPlayer/components/VideoSpeedMenu/index.d.ts +11 -0
- package/dist/components/VideoPlayer/components/VideoSpeedMenu/index.d.ts.map +1 -0
- package/dist/components/VideoPlayer/components/VideoSpeedMenu/index.js +41 -0
- package/dist/components/VideoPlayer/components/VideoSubtitlesMenu/index.d.ts +10 -0
- package/dist/components/VideoPlayer/components/VideoSubtitlesMenu/index.d.ts.map +1 -0
- package/dist/components/VideoPlayer/components/VideoSubtitlesMenu/index.js +69 -0
- package/dist/components/VideoPlayer/hooks/useStoryboard.d.ts +21 -0
- package/dist/components/VideoPlayer/hooks/useStoryboard.d.ts.map +1 -0
- package/dist/components/VideoPlayer/hooks/useStoryboard.js +91 -0
- package/dist/components/VideoPlayer/index.d.ts +11 -0
- package/dist/components/VideoPlayer/index.d.ts.map +1 -0
- package/dist/components/VideoPlayer/types.d.ts +101 -0
- package/dist/components/VideoPlayer/types.d.ts.map +1 -0
- package/dist/components/VideoPlayer/utils/chapters.d.ts +8 -0
- package/dist/components/VideoPlayer/utils/chapters.d.ts.map +1 -0
- package/dist/components/VideoPlayer/utils/chapters.js +38 -0
- package/dist/components/VideoPlayer/utils/storyboard.d.ts +5 -0
- package/dist/components/VideoPlayer/utils/storyboard.d.ts.map +1 -0
- package/dist/components/VideoPlayer/utils/storyboard.js +47 -0
- package/dist/components/VideoPlayer/utils/subtitles.d.ts +18 -0
- package/dist/components/VideoPlayer/utils/subtitles.d.ts.map +1 -0
- package/dist/components/VideoPlayer/utils/subtitles.js +23 -0
- package/dist/components/VideoPlayer/utils/touch.d.ts +3 -0
- package/dist/components/VideoPlayer/utils/touch.d.ts.map +1 -0
- package/dist/components/VideoPlayer/utils/touch.js +5 -0
- package/dist/components/VideoPlayer/utils/videoPlayerUtils.d.ts +10 -0
- package/dist/components/VideoPlayer/utils/videoPlayerUtils.d.ts.map +1 -0
- package/dist/components/VideoPlayer/utils/videoPlayerUtils.js +22 -0
- package/dist/components/VideoPlayer/utils/videoSettings.d.ts +69 -0
- package/dist/components/VideoPlayer/utils/videoSettings.d.ts.map +1 -0
- package/dist/components/VideoPlayer/utils/videoSettings.js +90 -0
- package/dist/components/table/FrontTable.d.ts.map +1 -1
- package/dist/components/table/hooks/useColumnsResizing.d.ts.map +1 -1
- package/dist/config/brand.d.ts.map +1 -1
- package/dist/config/brand.js +29 -29
- package/dist/config/envConfig.d.ts +2 -0
- package/dist/config/envConfig.d.ts.map +1 -1
- package/dist/helpers/showFeatureFeedback.module.css.js +4 -4
- 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.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +589 -575
- package/dist/lang/locales/ui_en.json.js +1 -1
- package/dist/lang/locales/ui_es.json.js +1 -1
- package/dist/lang/locales/ui_ru.json.js +1 -1
- package/dist/videoSettings/createVideoSettingsDataSource.d.ts +19 -0
- package/dist/videoSettings/createVideoSettingsDataSource.d.ts.map +1 -0
- package/dist/videoSettings/createVideoSettingsDataSource.js +127 -0
- package/docs/README.md +499 -499
- package/package.json +79 -78
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { jsxs as p, Fragment as H, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as V, useMemo as W } from "react";
|
|
3
|
+
import { useTranslation as M } from "react-i18next";
|
|
4
|
+
import { ArrowDown01Icon as y, Tick02Icon as F } from "@hugeicons/core-free-icons";
|
|
5
|
+
import { HugeiconsIcon as u } from "@hugeicons/react";
|
|
6
|
+
import { useCombobox as G, InputBase as I, Stack as L, Combobox as s, Group as U } from "@mantine/core";
|
|
7
|
+
import { useDisclosure as Y } from "@mantine/hooks";
|
|
8
|
+
import { IS_TOUCH_DEVICE as q } from "../utils/touch.js";
|
|
9
|
+
import { MobileDrawer as J } from "./MobileDrawer/index.js";
|
|
10
|
+
import { SelectListOptionButton as K } from "./SelectListOptionButton.js";
|
|
11
|
+
/* empty css */
|
|
12
|
+
function ho({
|
|
13
|
+
size: d = "sm",
|
|
14
|
+
w: m = 150,
|
|
15
|
+
comboboxProps: _,
|
|
16
|
+
rightSection: h,
|
|
17
|
+
renderOption: f,
|
|
18
|
+
data: i,
|
|
19
|
+
value: x,
|
|
20
|
+
defaultValue: N,
|
|
21
|
+
onChange: b,
|
|
22
|
+
inputClassName: O,
|
|
23
|
+
...k
|
|
24
|
+
}) {
|
|
25
|
+
const {
|
|
26
|
+
onClick: w,
|
|
27
|
+
type: Q,
|
|
28
|
+
onCopy: R,
|
|
29
|
+
onCut: X,
|
|
30
|
+
onPaste: Z,
|
|
31
|
+
classNames: t,
|
|
32
|
+
allowDeselect: $,
|
|
33
|
+
...v
|
|
34
|
+
} = k, C = [typeof t == "object" && t && "input" in t ? t.input : void 0, O].filter(Boolean).join(" ") || void 0, g = C ? {
|
|
35
|
+
...typeof t == "object" && t ? t : {},
|
|
36
|
+
input: C
|
|
37
|
+
} : t, [, P] = V(""), n = G({
|
|
38
|
+
onDropdownClose: () => {
|
|
39
|
+
n.resetSelectedOption(), n.focusTarget(), P("");
|
|
40
|
+
},
|
|
41
|
+
onDropdownOpen: () => {
|
|
42
|
+
n.focusSearchInput();
|
|
43
|
+
}
|
|
44
|
+
}), l = W(
|
|
45
|
+
() => (Array.isArray(i) ? i : []).map(
|
|
46
|
+
(o) => typeof o == "string" ? { value: o, label: o } : o
|
|
47
|
+
),
|
|
48
|
+
[i]
|
|
49
|
+
), a = x ?? N ?? null, D = l.find((o) => o.value === a)?.label ?? "", { t: T } = M(), [j, { open: E, close: S }] = Y(!1);
|
|
50
|
+
if (q)
|
|
51
|
+
return /* @__PURE__ */ p(H, { children: [
|
|
52
|
+
/* @__PURE__ */ e(
|
|
53
|
+
I,
|
|
54
|
+
{
|
|
55
|
+
component: "button",
|
|
56
|
+
size: d,
|
|
57
|
+
w: m,
|
|
58
|
+
classNames: g,
|
|
59
|
+
pointer: !0,
|
|
60
|
+
rightSection: h ?? /* @__PURE__ */ e(
|
|
61
|
+
u,
|
|
62
|
+
{
|
|
63
|
+
icon: y,
|
|
64
|
+
size: 16,
|
|
65
|
+
className: "editor-select__chevron"
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
rightSectionPointerEvents: "none",
|
|
69
|
+
onClick: (o) => {
|
|
70
|
+
w?.(o), E();
|
|
71
|
+
},
|
|
72
|
+
...v,
|
|
73
|
+
children: D
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ e(
|
|
77
|
+
J,
|
|
78
|
+
{
|
|
79
|
+
opened: j,
|
|
80
|
+
onClose: S,
|
|
81
|
+
title: T("editor.video.source.drawerTitle", "Source"),
|
|
82
|
+
children: /* @__PURE__ */ e(L, { gap: 4, p: 0, children: l.map((o) => /* @__PURE__ */ e(
|
|
83
|
+
K,
|
|
84
|
+
{
|
|
85
|
+
label: o.label,
|
|
86
|
+
checked: o.value === a,
|
|
87
|
+
onSelect: () => {
|
|
88
|
+
b?.(o.value, o), S();
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
o.value
|
|
92
|
+
)) })
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
] });
|
|
96
|
+
const z = (o, r, c) => f ? f({
|
|
97
|
+
option: { value: o, label: r },
|
|
98
|
+
checked: c
|
|
99
|
+
}) : /* @__PURE__ */ p(U, { justify: "space-between", wrap: "nowrap", w: "100%", children: [
|
|
100
|
+
r,
|
|
101
|
+
c && /* @__PURE__ */ e(
|
|
102
|
+
u,
|
|
103
|
+
{
|
|
104
|
+
icon: F,
|
|
105
|
+
size: 16,
|
|
106
|
+
color: "var(--mantine-primary-color-text)"
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
] }), { width: A, ...B } = _ || {};
|
|
110
|
+
return /* @__PURE__ */ p(
|
|
111
|
+
s,
|
|
112
|
+
{
|
|
113
|
+
store: n,
|
|
114
|
+
withinPortal: !0,
|
|
115
|
+
onOptionSubmit: (o) => {
|
|
116
|
+
const r = l.find((c) => c.value === o) ?? {
|
|
117
|
+
value: o,
|
|
118
|
+
label: o
|
|
119
|
+
};
|
|
120
|
+
b?.(o, r), n.closeDropdown();
|
|
121
|
+
},
|
|
122
|
+
width: A ?? "target",
|
|
123
|
+
...B,
|
|
124
|
+
children: [
|
|
125
|
+
/* @__PURE__ */ e(s.Target, { children: /* @__PURE__ */ e(
|
|
126
|
+
I,
|
|
127
|
+
{
|
|
128
|
+
component: "button",
|
|
129
|
+
size: d,
|
|
130
|
+
w: m,
|
|
131
|
+
classNames: g,
|
|
132
|
+
pointer: !0,
|
|
133
|
+
rightSection: h ?? /* @__PURE__ */ e(
|
|
134
|
+
u,
|
|
135
|
+
{
|
|
136
|
+
icon: y,
|
|
137
|
+
size: 16,
|
|
138
|
+
className: "editor-select__chevron"
|
|
139
|
+
}
|
|
140
|
+
),
|
|
141
|
+
rightSectionPointerEvents: "none",
|
|
142
|
+
onClick: (o) => {
|
|
143
|
+
w?.(o), n.toggleDropdown();
|
|
144
|
+
},
|
|
145
|
+
...v,
|
|
146
|
+
children: D
|
|
147
|
+
}
|
|
148
|
+
) }),
|
|
149
|
+
/* @__PURE__ */ e(s.Dropdown, { children: /* @__PURE__ */ e(
|
|
150
|
+
s.Options,
|
|
151
|
+
{
|
|
152
|
+
style: {
|
|
153
|
+
maxHeight: 396,
|
|
154
|
+
overflowY: "auto"
|
|
155
|
+
},
|
|
156
|
+
children: l.length > 0 ? l.map((o) => {
|
|
157
|
+
const r = o.value === a;
|
|
158
|
+
return /* @__PURE__ */ e(s.Option, { value: o.value, children: z(o.value, o.label, r) }, o.value);
|
|
159
|
+
}) : /* @__PURE__ */ e(s.Empty, { children: "Nothing found" })
|
|
160
|
+
}
|
|
161
|
+
) })
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
export {
|
|
167
|
+
ho as default
|
|
168
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PlayerSettingsSnapshot } from '../../utils/videoSettings';
|
|
2
|
+
type VideoSettingsMenuProps = {
|
|
3
|
+
isOpen?: boolean;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
settings: PlayerSettingsSnapshot;
|
|
6
|
+
onSpeedClick: () => void;
|
|
7
|
+
onQualityClick: () => void;
|
|
8
|
+
onSubtitlesClick: () => void;
|
|
9
|
+
};
|
|
10
|
+
export declare function VideoSettingsMenu({ disabled, settings, onSpeedClick, onQualityClick, onSubtitlesClick, }: VideoSettingsMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/VideoPlayer/components/VideoSettingsMenu/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AASxE,KAAK,sBAAsB,GAAG;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,sBAAsB,CAAC;IACjC,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,gBAAgB,GACjB,EAAE,sBAAsB,2CA+CxB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as f } from "react-i18next";
|
|
3
|
+
import { ChevronRightIcon as n, SubtitleIcon as m, SpeedIcon as p, QualityIcon as S } from "../VideoIcons.js";
|
|
4
|
+
import { VideoMenu as I } from "../VideoMenu.js";
|
|
5
|
+
function g({
|
|
6
|
+
disabled: o,
|
|
7
|
+
settings: e,
|
|
8
|
+
onSpeedClick: r,
|
|
9
|
+
onQualityClick: s,
|
|
10
|
+
onSubtitlesClick: d
|
|
11
|
+
}) {
|
|
12
|
+
const { t: i } = f(), u = e.currentSpeed === 1 ? i("editor.video.settings.normal") : `${e.currentSpeed}x`, a = e.qualities.find((l) => l.id === e.currentQualityId)?.label || i("editor.video.settings.auto"), c = e.subtitles.find((l) => l.id === e.currentSubtitleId)?.label || i("editor.video.settings.off"), b = [
|
|
13
|
+
{
|
|
14
|
+
key: "subtitles",
|
|
15
|
+
testId: "video-settings-menu-subtitles",
|
|
16
|
+
onClick: d,
|
|
17
|
+
disabled: o || !e.hasRealSubtitles,
|
|
18
|
+
leftIcon: /* @__PURE__ */ t(m, { size: 16 }),
|
|
19
|
+
leftLabel: i("editor.video.settings.subtitlesCc"),
|
|
20
|
+
centerLabel: c,
|
|
21
|
+
rightSection: /* @__PURE__ */ t(n, { size: 16 })
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
key: "speed",
|
|
25
|
+
testId: "video-settings-menu-speed",
|
|
26
|
+
onClick: r,
|
|
27
|
+
disabled: o || !e.hasRealSpeeds,
|
|
28
|
+
leftIcon: /* @__PURE__ */ t(p, { size: 16 }),
|
|
29
|
+
leftLabel: i("editor.video.settings.speed"),
|
|
30
|
+
centerLabel: u,
|
|
31
|
+
rightSection: /* @__PURE__ */ t(n, { size: 16 })
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
key: "quality",
|
|
35
|
+
testId: "video-settings-menu-quality",
|
|
36
|
+
onClick: s,
|
|
37
|
+
disabled: o || !e.hasRealQualities,
|
|
38
|
+
leftIcon: /* @__PURE__ */ t(S, { size: 16 }),
|
|
39
|
+
leftLabel: i("editor.video.settings.quality"),
|
|
40
|
+
centerLabel: a,
|
|
41
|
+
rightSection: /* @__PURE__ */ t(n, { size: 16 })
|
|
42
|
+
}
|
|
43
|
+
];
|
|
44
|
+
return /* @__PURE__ */ t(I, { width: 300, items: b });
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
g as VideoSettingsMenu
|
|
48
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Chapter } from '../../types';
|
|
2
|
+
import { type ChapterInput } from '../../utils/chapters';
|
|
3
|
+
type ChaptersSectionProps = {
|
|
4
|
+
videoId?: string | null;
|
|
5
|
+
initialChapters?: Chapter[];
|
|
6
|
+
nativeVideo?: HTMLVideoElement | null;
|
|
7
|
+
shakaPlayer?: any | null;
|
|
8
|
+
videoDuration?: number | null;
|
|
9
|
+
title: string;
|
|
10
|
+
toggleLabel: string;
|
|
11
|
+
chaptersDisabled: boolean;
|
|
12
|
+
onChaptersDisabledChange: (value: boolean) => void;
|
|
13
|
+
onSave?: (saveHandler: () => Promise<ChapterInput[] | null>) => void;
|
|
14
|
+
timePlaceholder: string;
|
|
15
|
+
endTimePlaceholder: string;
|
|
16
|
+
titlePlaceholder: string;
|
|
17
|
+
addChapterLabel: string;
|
|
18
|
+
deleteChapterLabel: string;
|
|
19
|
+
emptyLabel: string;
|
|
20
|
+
errorLabel: string;
|
|
21
|
+
invalidRangeLabel: string;
|
|
22
|
+
};
|
|
23
|
+
export declare function ChaptersSection({ videoId, initialChapters, nativeVideo, shakaPlayer, videoDuration: videoDurationProp, title, toggleLabel, chaptersDisabled, onChaptersDisabledChange, onSave, timePlaceholder, endTimePlaceholder, titlePlaceholder, addChapterLabel, deleteChapterLabel, emptyLabel, errorLabel, }: ChaptersSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=ChaptersSection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChaptersSection.d.ts","sourceRoot":"","sources":["../../../../../src/components/VideoPlayer/components/VideoSettingsModal/ChaptersSection.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EACL,KAAK,YAAY,EAGlB,MAAM,sBAAsB,CAAC;AAM9B,KAAK,oBAAoB,GAAG;IAC1B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,EAAE,CAAC;IAC5B,WAAW,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACtC,WAAW,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,wBAAwB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnD,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,OAAO,CAAC,YAAY,EAAE,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC;IACrE,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AA0PF,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,eAAe,EACf,WAAW,EACX,WAAW,EACX,aAAa,EAAE,iBAAiB,EAChC,KAAK,EACL,WAAW,EACX,gBAAgB,EAChB,wBAAwB,EACxB,MAAM,EACN,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,UAAU,EACV,UAAU,GACX,EAAE,oBAAoB,2CA4StB"}
|
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
import { jsxs as B, jsx as r, Fragment as St } from "react/jsx-runtime";
|
|
2
|
+
import { useState as g, useRef as it, useCallback as T, useEffect as j } from "react";
|
|
3
|
+
import { Stack as st, Text as R, Flex as at, Switch as xt, Divider as Tt, Group as yt, TextInput as ut, Textarea as Mt, Menu as Q, ActionIcon as Ct } from "@mantine/core";
|
|
4
|
+
import { secondsToTimestamp as D, parseTimestampToSec as dt } from "../../utils/chapters.js";
|
|
5
|
+
import { MoreVerticalIcon as wt } from "../VideoIcons.js";
|
|
6
|
+
import { useVideoSettingsDataSource as Et } from "./context.js";
|
|
7
|
+
function ht() {
|
|
8
|
+
try {
|
|
9
|
+
return crypto.randomUUID();
|
|
10
|
+
} catch {
|
|
11
|
+
return `${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function vt(x) {
|
|
15
|
+
return x.map((i) => ({
|
|
16
|
+
id: ht(),
|
|
17
|
+
startSec: i.startSec ?? 0,
|
|
18
|
+
title: (i.title ?? "").trim()
|
|
19
|
+
})).sort((i, m) => i.startSec - m.startSec);
|
|
20
|
+
}
|
|
21
|
+
function Nt({
|
|
22
|
+
chapter: x,
|
|
23
|
+
index: i,
|
|
24
|
+
startSec: m,
|
|
25
|
+
endSec: p,
|
|
26
|
+
isLast: y,
|
|
27
|
+
disabled: N,
|
|
28
|
+
startTimePlaceholder: X,
|
|
29
|
+
endTimePlaceholder: U,
|
|
30
|
+
titlePlaceholder: Y,
|
|
31
|
+
deleteChapterLabel: $,
|
|
32
|
+
startMin: G,
|
|
33
|
+
startMax: b,
|
|
34
|
+
endMin: Z,
|
|
35
|
+
endMax: V,
|
|
36
|
+
onStartSecChange: W,
|
|
37
|
+
onEndSecChange: P,
|
|
38
|
+
onTitleChange: _,
|
|
39
|
+
onRemove: z
|
|
40
|
+
}) {
|
|
41
|
+
const [S, L] = g(
|
|
42
|
+
() => D(m)
|
|
43
|
+
), [H, k] = g(
|
|
44
|
+
() => p == null ? "" : D(p)
|
|
45
|
+
), [M, C] = g(!1), [q, a] = g(!1), [I, h] = g(!1), [w, A] = g(!1);
|
|
46
|
+
j(() => {
|
|
47
|
+
I || L(D(m));
|
|
48
|
+
}, [m, I]), j(() => {
|
|
49
|
+
w || k(p == null ? "" : D(p));
|
|
50
|
+
}, [p, w]);
|
|
51
|
+
const J = (c) => {
|
|
52
|
+
L(c);
|
|
53
|
+
const E = dt(c);
|
|
54
|
+
if (E !== null) {
|
|
55
|
+
const f = Math.floor(Number(E) || 0), F = f < G, v = b != null && f > b;
|
|
56
|
+
if (F || v) {
|
|
57
|
+
C(!0);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
C(!1), W(i, f);
|
|
61
|
+
} else if (c.trim() === "") {
|
|
62
|
+
const F = 0 < G, v = b != null && 0 > b;
|
|
63
|
+
if (F || v) {
|
|
64
|
+
C(!0);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
C(!1), W(i, 0);
|
|
68
|
+
} else
|
|
69
|
+
C(!0);
|
|
70
|
+
}, tt = (c) => {
|
|
71
|
+
if (k(c), y) return;
|
|
72
|
+
const E = dt(c);
|
|
73
|
+
if (E !== null) {
|
|
74
|
+
const f = Math.floor(Number(E) || 0), v = f < (Z ?? -1 / 0), et = V != null && f > V;
|
|
75
|
+
if (v || et) {
|
|
76
|
+
a(!0);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
a(!1), P(i, f);
|
|
80
|
+
} else c.trim() === "" ? a(!1) : a(!0);
|
|
81
|
+
};
|
|
82
|
+
return /* @__PURE__ */ B(
|
|
83
|
+
yt,
|
|
84
|
+
{
|
|
85
|
+
gap: 10,
|
|
86
|
+
align: "flex-start",
|
|
87
|
+
wrap: "nowrap",
|
|
88
|
+
className: "video-settings-modal-chapter-row",
|
|
89
|
+
style: { maxWidth: "100%" },
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ B(st, { className: "video-settings-modal-chapter-times", children: [
|
|
92
|
+
/* @__PURE__ */ r(
|
|
93
|
+
ut,
|
|
94
|
+
{
|
|
95
|
+
size: "sm",
|
|
96
|
+
radius: 8,
|
|
97
|
+
variant: "default",
|
|
98
|
+
placeholder: X,
|
|
99
|
+
value: S,
|
|
100
|
+
onChange: (c) => J(c.currentTarget.value),
|
|
101
|
+
style: { width: "100%" },
|
|
102
|
+
styles: {
|
|
103
|
+
input: {
|
|
104
|
+
height: 36,
|
|
105
|
+
paddingTop: 6,
|
|
106
|
+
paddingBottom: 6,
|
|
107
|
+
paddingLeft: 12,
|
|
108
|
+
paddingRight: 12,
|
|
109
|
+
lineHeight: 1.45
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
error: M,
|
|
113
|
+
disabled: N,
|
|
114
|
+
onFocus: () => h(!0),
|
|
115
|
+
onBlur: () => h(!1)
|
|
116
|
+
}
|
|
117
|
+
),
|
|
118
|
+
/* @__PURE__ */ r(
|
|
119
|
+
ut,
|
|
120
|
+
{
|
|
121
|
+
size: "sm",
|
|
122
|
+
radius: 8,
|
|
123
|
+
variant: "default",
|
|
124
|
+
placeholder: U,
|
|
125
|
+
value: H,
|
|
126
|
+
onChange: (c) => tt(c.currentTarget.value),
|
|
127
|
+
style: { width: "100%" },
|
|
128
|
+
styles: {
|
|
129
|
+
input: {
|
|
130
|
+
height: 36,
|
|
131
|
+
paddingTop: 6,
|
|
132
|
+
paddingBottom: 6,
|
|
133
|
+
paddingLeft: 12,
|
|
134
|
+
paddingRight: 12,
|
|
135
|
+
lineHeight: 1.45
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
error: q,
|
|
139
|
+
disabled: N || y || p == null,
|
|
140
|
+
onFocus: () => A(!0),
|
|
141
|
+
onBlur: () => A(!1)
|
|
142
|
+
}
|
|
143
|
+
)
|
|
144
|
+
] }),
|
|
145
|
+
/* @__PURE__ */ r(at, { className: "video-settings-modal-chapter-title", children: /* @__PURE__ */ r(
|
|
146
|
+
Mt,
|
|
147
|
+
{
|
|
148
|
+
size: "sm",
|
|
149
|
+
radius: 8,
|
|
150
|
+
variant: "default",
|
|
151
|
+
placeholder: Y,
|
|
152
|
+
value: x.title,
|
|
153
|
+
onChange: (c) => _(i, c.currentTarget.value),
|
|
154
|
+
styles: {
|
|
155
|
+
root: {
|
|
156
|
+
width: "100%",
|
|
157
|
+
height: "100%"
|
|
158
|
+
},
|
|
159
|
+
wrapper: {
|
|
160
|
+
height: "100%"
|
|
161
|
+
},
|
|
162
|
+
input: {
|
|
163
|
+
height: "100%",
|
|
164
|
+
paddingTop: 8,
|
|
165
|
+
paddingBottom: 8,
|
|
166
|
+
paddingLeft: 12,
|
|
167
|
+
paddingRight: 12,
|
|
168
|
+
lineHeight: 1.45,
|
|
169
|
+
resize: "none"
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
style: { width: "100%", height: "100%" },
|
|
173
|
+
disabled: N
|
|
174
|
+
}
|
|
175
|
+
) }),
|
|
176
|
+
/* @__PURE__ */ r(at, { className: "video-settings-modal-chapter-actions", children: /* @__PURE__ */ B(Q, { position: "bottom-end", children: [
|
|
177
|
+
/* @__PURE__ */ r(Q.Target, { children: /* @__PURE__ */ r(
|
|
178
|
+
Ct,
|
|
179
|
+
{
|
|
180
|
+
size: 36,
|
|
181
|
+
variant: "subtle",
|
|
182
|
+
color: "gray",
|
|
183
|
+
"aria-label": "Chapter actions",
|
|
184
|
+
disabled: N,
|
|
185
|
+
radius: 8,
|
|
186
|
+
"data-test-id": "video-settings-chapters-row-menu",
|
|
187
|
+
children: /* @__PURE__ */ r(wt, { size: 20 })
|
|
188
|
+
}
|
|
189
|
+
) }),
|
|
190
|
+
/* @__PURE__ */ r(Q.Dropdown, { children: /* @__PURE__ */ r(
|
|
191
|
+
Q.Item,
|
|
192
|
+
{
|
|
193
|
+
color: "red",
|
|
194
|
+
onClick: () => z(i),
|
|
195
|
+
"data-test-id": "video-settings-chapters-delete",
|
|
196
|
+
children: $
|
|
197
|
+
}
|
|
198
|
+
) })
|
|
199
|
+
] }) })
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
function Lt({
|
|
205
|
+
videoId: x,
|
|
206
|
+
initialChapters: i,
|
|
207
|
+
nativeVideo: m,
|
|
208
|
+
shakaPlayer: p,
|
|
209
|
+
videoDuration: y,
|
|
210
|
+
title: N,
|
|
211
|
+
toggleLabel: X,
|
|
212
|
+
chaptersDisabled: U,
|
|
213
|
+
onChaptersDisabledChange: Y,
|
|
214
|
+
onSave: $,
|
|
215
|
+
timePlaceholder: G,
|
|
216
|
+
endTimePlaceholder: b,
|
|
217
|
+
titlePlaceholder: Z,
|
|
218
|
+
addChapterLabel: V,
|
|
219
|
+
deleteChapterLabel: W,
|
|
220
|
+
emptyLabel: P,
|
|
221
|
+
errorLabel: _
|
|
222
|
+
}) {
|
|
223
|
+
const [z, S] = g(
|
|
224
|
+
[]
|
|
225
|
+
), [L, H] = g(null), [k, M] = g(null), [C] = g(!1), [, q] = g(!1), [a, I] = g(null), h = it(!1), w = it(!1), A = Et(), J = T((t) => {
|
|
226
|
+
w.current || h.current || S(vt(t));
|
|
227
|
+
}, []);
|
|
228
|
+
j(() => {
|
|
229
|
+
if (y != null && y > 0) {
|
|
230
|
+
I(y);
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
try {
|
|
234
|
+
const t = p?.seekRange?.();
|
|
235
|
+
if (t && Number.isFinite(t.end) && t.end > 0) {
|
|
236
|
+
I(t.end);
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
} catch {
|
|
240
|
+
}
|
|
241
|
+
if (m) {
|
|
242
|
+
const t = m.duration;
|
|
243
|
+
if (Number.isFinite(t) && t > 0) {
|
|
244
|
+
I(t);
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}, [y, p, m]);
|
|
249
|
+
const tt = T(() => a == null ? null : Math.floor(a), [a]), c = T(async () => {
|
|
250
|
+
if (!x) return null;
|
|
251
|
+
M(null), q(!0), w.current = !0, H(null);
|
|
252
|
+
try {
|
|
253
|
+
const t = z.filter((e) => e.title.trim()).filter((e) => a == null || e.startSec < a).sort((e, n) => e.startSec - n.startSec).map(({ startSec: e, title: n }) => ({ startSec: e, title: n }));
|
|
254
|
+
return await A.saveChapters(t), h.current = !1, t;
|
|
255
|
+
} catch (t) {
|
|
256
|
+
const e = t instanceof Error ? t.message : _;
|
|
257
|
+
return /exceeds/i.test(e) || H(e), null;
|
|
258
|
+
} finally {
|
|
259
|
+
q(!1), w.current = !1;
|
|
260
|
+
}
|
|
261
|
+
}, [x, A, z, _, tt]);
|
|
262
|
+
j(() => {
|
|
263
|
+
$?.(c);
|
|
264
|
+
}, [c, $]);
|
|
265
|
+
const E = T(() => {
|
|
266
|
+
h.current = !0, M(null), S((t) => {
|
|
267
|
+
const e = a != null ? Math.floor(a) : null, n = [...t].sort((d, u) => d.startSec - u.startSec), l = n.length > 0 ? Math.floor(n[n.length - 1].startSec) : -1, s = Math.max(0, l + 1), o = e != null ? Math.min(s, Math.max(0, e - 1)) : s;
|
|
268
|
+
return [
|
|
269
|
+
...n,
|
|
270
|
+
{
|
|
271
|
+
id: ht(),
|
|
272
|
+
startSec: o,
|
|
273
|
+
title: ""
|
|
274
|
+
}
|
|
275
|
+
];
|
|
276
|
+
});
|
|
277
|
+
}, [a]), f = T((t, e) => {
|
|
278
|
+
h.current = !0, S((n) => {
|
|
279
|
+
const s = [...[...n].sort((d, u) => d.startSec - u.startSec)], o = s[t];
|
|
280
|
+
return o ? (s[t] = { ...o, title: e }, s) : n;
|
|
281
|
+
});
|
|
282
|
+
}, []), F = T((t, e) => {
|
|
283
|
+
h.current = !0, M(null), S((n) => {
|
|
284
|
+
const l = [...n].sort((d, u) => d.startSec - u.startSec), s = l[t];
|
|
285
|
+
if (!s) return n;
|
|
286
|
+
const o = [...l];
|
|
287
|
+
return o[t] = { ...s, startSec: e }, o.sort((d, u) => d.startSec - u.startSec);
|
|
288
|
+
});
|
|
289
|
+
}, []), v = T((t, e) => {
|
|
290
|
+
h.current = !0, M(null), S((n) => {
|
|
291
|
+
const l = [...n].sort((d, u) => d.startSec - u.startSec);
|
|
292
|
+
if (t >= l.length - 1) return n;
|
|
293
|
+
const s = l[t + 1];
|
|
294
|
+
if (!s) return n;
|
|
295
|
+
const o = [...l];
|
|
296
|
+
return o[t + 1] = { ...s, startSec: e }, o.sort((d, u) => d.startSec - u.startSec);
|
|
297
|
+
});
|
|
298
|
+
}, []), et = T((t) => {
|
|
299
|
+
h.current = !0, M(null), S((e) => [...e].sort((l, s) => l.startSec - s.startSec).filter((l, s) => s !== t));
|
|
300
|
+
}, []);
|
|
301
|
+
return j(() => {
|
|
302
|
+
if (!x) {
|
|
303
|
+
S([]), H(null), h.current = !1;
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
w.current || h.current || Array.isArray(i) && J(i);
|
|
307
|
+
}, [x, i, J]), /* @__PURE__ */ B(st, { gap: "xs", "data-test-id": "video-settings-chapters-section", children: [
|
|
308
|
+
/* @__PURE__ */ r(
|
|
309
|
+
R,
|
|
310
|
+
{
|
|
311
|
+
className: "video-settings-modal-section-title",
|
|
312
|
+
"data-test-id": "video-settings-chapters-title",
|
|
313
|
+
children: N
|
|
314
|
+
}
|
|
315
|
+
),
|
|
316
|
+
/* @__PURE__ */ B(
|
|
317
|
+
at,
|
|
318
|
+
{
|
|
319
|
+
align: "center",
|
|
320
|
+
gap: "md",
|
|
321
|
+
className: "video-settings-modal-subtitles-auto-toggle",
|
|
322
|
+
children: [
|
|
323
|
+
/* @__PURE__ */ r(R, { size: "sm", fw: 500, c: "var(--mantine-color-bright)", flex: 1, children: X }),
|
|
324
|
+
/* @__PURE__ */ r(
|
|
325
|
+
xt,
|
|
326
|
+
{
|
|
327
|
+
size: "sm",
|
|
328
|
+
checked: !U,
|
|
329
|
+
onChange: (t) => Y(!t.currentTarget.checked),
|
|
330
|
+
"data-test-id": "video-settings-chapters-toggle"
|
|
331
|
+
}
|
|
332
|
+
)
|
|
333
|
+
]
|
|
334
|
+
}
|
|
335
|
+
),
|
|
336
|
+
!U && /* @__PURE__ */ B(St, { children: [
|
|
337
|
+
/* @__PURE__ */ r(Tt, { my: 4 }),
|
|
338
|
+
L && /* @__PURE__ */ r(R, { size: "sm", c: "red", mb: "xs", children: L }),
|
|
339
|
+
k && /* @__PURE__ */ r(R, { size: "sm", c: "red", mb: "xs", children: k }),
|
|
340
|
+
/* @__PURE__ */ r(st, { gap: 12, children: [...z].sort((t, e) => t.startSec - e.startSec).map((t, e, n) => {
|
|
341
|
+
const l = n[e + 1] || null, s = n[e + 2] || null, o = a != null ? Math.floor(a) : null, d = l != null ? Math.floor(l.startSec) : o ?? null, u = Math.floor(t.startSec), lt = e > 0 ? Math.floor(n[e - 1].startSec) : null, ot = l != null ? Math.floor(l.startSec) : null, gt = lt != null ? lt + 1 : 0, K = ot != null ? ot - 1 : null, nt = o != null ? o - 1 : null, ft = K != null && nt != null ? Math.min(K, nt) : K ?? nt, mt = e < n.length - 1 ? u + 1 : null, ct = s != null ? Math.floor(s.startSec) : null, O = ct != null ? ct - 1 : null, rt = o ?? null, pt = O != null && rt != null ? Math.min(O, rt) : O ?? rt;
|
|
342
|
+
return /* @__PURE__ */ r(
|
|
343
|
+
Nt,
|
|
344
|
+
{
|
|
345
|
+
chapter: t,
|
|
346
|
+
index: e,
|
|
347
|
+
startSec: u,
|
|
348
|
+
endSec: d,
|
|
349
|
+
isLast: e === n.length - 1,
|
|
350
|
+
startMin: gt,
|
|
351
|
+
startMax: ft,
|
|
352
|
+
endMin: mt,
|
|
353
|
+
endMax: pt,
|
|
354
|
+
disabled: !1,
|
|
355
|
+
startTimePlaceholder: G,
|
|
356
|
+
endTimePlaceholder: a != null ? D(Math.floor(a)) : b,
|
|
357
|
+
titlePlaceholder: Z,
|
|
358
|
+
deleteChapterLabel: W,
|
|
359
|
+
onStartSecChange: F,
|
|
360
|
+
onEndSecChange: v,
|
|
361
|
+
onTitleChange: f,
|
|
362
|
+
onRemove: et
|
|
363
|
+
},
|
|
364
|
+
t.id
|
|
365
|
+
);
|
|
366
|
+
}) }),
|
|
367
|
+
/* @__PURE__ */ r(
|
|
368
|
+
R,
|
|
369
|
+
{
|
|
370
|
+
component: "button",
|
|
371
|
+
type: "button",
|
|
372
|
+
className: "video-settings-modal-link",
|
|
373
|
+
onClick: E,
|
|
374
|
+
"data-test-id": "video-settings-chapters-add",
|
|
375
|
+
children: V
|
|
376
|
+
}
|
|
377
|
+
),
|
|
378
|
+
z.length === 0 && !C && /* @__PURE__ */ r(R, { size: "xs", c: "dimmed", children: P })
|
|
379
|
+
] })
|
|
380
|
+
] });
|
|
381
|
+
}
|
|
382
|
+
export {
|
|
383
|
+
Lt as ChaptersSection
|
|
384
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FileWithPath } from '@mantine/dropzone';
|
|
2
|
+
import type { VideoSettingsData } from '../../types';
|
|
3
|
+
type CoverSectionProps = {
|
|
4
|
+
opened: boolean;
|
|
5
|
+
videoId?: string | null;
|
|
6
|
+
initialData?: VideoSettingsData | null;
|
|
7
|
+
title: string;
|
|
8
|
+
uploadLabel: string;
|
|
9
|
+
cropLabel: string;
|
|
10
|
+
emptyCoverLabel: string;
|
|
11
|
+
loadErrorLabel?: string;
|
|
12
|
+
retryLabel?: string;
|
|
13
|
+
onCoverUpload?: (file: FileWithPath) => void | Promise<VideoSettingsData | undefined>;
|
|
14
|
+
onCropCover?: () => void;
|
|
15
|
+
onPosterChange?: (posterUrl: string | null) => void;
|
|
16
|
+
onSelectedPosterChange?: (url: string | null) => void;
|
|
17
|
+
selectedPosterUrl?: string | null;
|
|
18
|
+
};
|
|
19
|
+
export declare function CoverSection({ opened, videoId, initialData, title, uploadLabel, loadErrorLabel, retryLabel, onCoverUpload, onPosterChange: _onPosterChange, onSelectedPosterChange, selectedPosterUrl, }: CoverSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=CoverSection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CoverSection.d.ts","sourceRoot":"","sources":["../../../../../src/components/VideoPlayer/components/VideoSettingsModal/CoverSection.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAY,YAAY,EAAmB,MAAM,mBAAmB,CAAC;AAE5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAIrD,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,WAAW,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,CACd,IAAI,EAAE,YAAY,KACf,IAAI,GAAG,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAAC;IACnD,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACpD,sBAAsB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACtD,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC,CAAC;AAEF,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,OAAO,EACP,WAAW,EACX,KAAK,EACL,WAAW,EACX,cAAc,EACd,UAAU,EACV,aAAa,EACb,cAAc,EAAE,eAAe,EAC/B,sBAAsB,EACtB,iBAAiB,GAClB,EAAE,iBAAiB,2CA6VnB"}
|