@layers-app/shared 0.4.8 → 0.4.9
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/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 +179 -120
- 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 +34 -0
- package/dist/components/AttachmentsGalleryModal/components/useAttachmentVideoStatus.d.ts.map +1 -0
- package/dist/components/AttachmentsGalleryModal/components/useAttachmentVideoStatus.js +71 -0
- package/dist/components/AttachmentsGalleryModal/styles.module.css.js +31 -27
- package/dist/components/CommentComposer/CommentComposer.module.css.js +13 -9
- package/dist/components/CommentComposer/index.d.ts +2 -1
- package/dist/components/CommentComposer/index.d.ts.map +1 -1
- package/dist/components/CommentComposer/index.js +343 -325
- package/dist/components/CommentComposer/types.d.ts +4 -0
- package/dist/components/CommentComposer/types.d.ts.map +1 -1
- 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/helpers/getFileType.d.ts +1 -1
- package/dist/helpers/getFileType.d.ts.map +1 -1
- package/dist/helpers/getFileType.js +3 -2
- package/dist/hooks/useDateUtils.d.ts +3 -1
- package/dist/hooks/useDateUtils.d.ts.map +1 -1
- package/dist/hooks/useDateUtils.js +23 -18
- 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 +585 -567
- package/dist/lang/locales/ui_en.json.js +9 -7
- package/dist/lang/locales/ui_es.json.js +6 -4
- package/dist/lang/locales/ui_ru.json.js +8 -6
- 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/package.json +2 -1
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { ChapterInput } from './utils/chapters';
|
|
2
|
+
import type { SubtitleTrack } from './utils/subtitles';
|
|
3
|
+
export type { SubtitleTrack } from './utils/subtitles';
|
|
4
|
+
export type Subtitle = SubtitleTrack;
|
|
5
|
+
export interface VideoSource {
|
|
6
|
+
/** Adaptive manifest (HLS/DASH) — preferred playback path via Shaka Player. */
|
|
7
|
+
streamUrl: string | null;
|
|
8
|
+
/** Direct progressive file (e.g. mp4) — native <video> fallback. */
|
|
9
|
+
nativeUrl: string | null;
|
|
10
|
+
/** Extra raw/original direct URL, tried as a secondary fallback. */
|
|
11
|
+
rawUrl?: string | null;
|
|
12
|
+
/** Local object URL for instant preview before the upload is processed. */
|
|
13
|
+
localBlobUrl?: string | null;
|
|
14
|
+
/** Poster/cover image URL. */
|
|
15
|
+
posterUrl?: string | null;
|
|
16
|
+
/** Whether the adaptive stream is ready (Shaka). When false, plays native. */
|
|
17
|
+
optimizedReady?: boolean;
|
|
18
|
+
/** Server is still processing the video (affects controls/affordances). */
|
|
19
|
+
isProcessing?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface Storyboard {
|
|
22
|
+
ready?: boolean;
|
|
23
|
+
vttUrl?: string;
|
|
24
|
+
metaUrl?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ChapterThumb {
|
|
27
|
+
sheetUrl?: string;
|
|
28
|
+
x?: number;
|
|
29
|
+
y?: number;
|
|
30
|
+
w?: number;
|
|
31
|
+
h?: number;
|
|
32
|
+
}
|
|
33
|
+
export interface Chapter {
|
|
34
|
+
startSec: number;
|
|
35
|
+
title: string;
|
|
36
|
+
auto?: boolean;
|
|
37
|
+
thumb?: ChapterThumb;
|
|
38
|
+
}
|
|
39
|
+
export interface StoryboardMeta {
|
|
40
|
+
durationSec?: number;
|
|
41
|
+
}
|
|
42
|
+
export interface StoryboardCue {
|
|
43
|
+
start: number;
|
|
44
|
+
end: number;
|
|
45
|
+
sheetUrl: string;
|
|
46
|
+
x: number;
|
|
47
|
+
y: number;
|
|
48
|
+
w: number;
|
|
49
|
+
h: number;
|
|
50
|
+
}
|
|
51
|
+
export interface StoryboardFrame extends StoryboardCue {
|
|
52
|
+
sheetWidth?: number;
|
|
53
|
+
sheetHeight?: number;
|
|
54
|
+
}
|
|
55
|
+
export interface PlayerInfo {
|
|
56
|
+
shakaPlayer: any | null;
|
|
57
|
+
nativeVideo: HTMLVideoElement | null;
|
|
58
|
+
mode: 'shaka' | 'native';
|
|
59
|
+
containerEl: HTMLDivElement | null;
|
|
60
|
+
videoDuration?: number | null;
|
|
61
|
+
}
|
|
62
|
+
export interface VideoPreview {
|
|
63
|
+
id: string;
|
|
64
|
+
url: string;
|
|
65
|
+
order?: number;
|
|
66
|
+
}
|
|
67
|
+
export interface Cover {
|
|
68
|
+
previewId?: string;
|
|
69
|
+
url?: string;
|
|
70
|
+
}
|
|
71
|
+
export interface VideoSettingsData {
|
|
72
|
+
previews?: VideoPreview[];
|
|
73
|
+
cover?: Cover;
|
|
74
|
+
chapters?: Chapter[];
|
|
75
|
+
subtitles?: Subtitle[];
|
|
76
|
+
}
|
|
77
|
+
export interface SubtitleUploadOptions {
|
|
78
|
+
lang: string;
|
|
79
|
+
label?: string;
|
|
80
|
+
kind?: string;
|
|
81
|
+
default?: boolean;
|
|
82
|
+
signal?: AbortSignal;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Adapter the consumer implements to feed the settings UI. Every method works
|
|
86
|
+
* in terms of the player's normalized domain model — the consumer maps its own
|
|
87
|
+
* backend (endpoints/response shapes) inside these callbacks. The player never
|
|
88
|
+
* fetches or assumes any backend shape.
|
|
89
|
+
*/
|
|
90
|
+
export interface VideoSettingsDataSource {
|
|
91
|
+
getSettings: () => Promise<VideoSettingsData>;
|
|
92
|
+
uploadCover: (file: File) => Promise<VideoSettingsData>;
|
|
93
|
+
saveChapters: (chapters: ChapterInput[]) => Promise<void>;
|
|
94
|
+
listSubtitles: () => Promise<Subtitle[]>;
|
|
95
|
+
uploadSubtitle: (file: File, options: SubtitleUploadOptions) => Promise<Subtitle | null>;
|
|
96
|
+
deleteSubtitle: (id: string) => Promise<void>;
|
|
97
|
+
setSubtitleDisabled: (id: string, disabled: boolean) => Promise<void>;
|
|
98
|
+
uploadSubtitleSimple?: (file: File, lang: string) => Promise<Subtitle | null>;
|
|
99
|
+
onError?: (error: unknown, source?: string) => void;
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.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;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,MAAM,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC9C,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACxD,YAAY,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,aAAa,EAAE,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACzC,cAAc,EAAE,CACd,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,qBAAqB,KAC3B,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;IAC9B,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;IAC9E,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACrD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type ChapterInput = {
|
|
2
|
+
startSec: number;
|
|
3
|
+
title: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function secondsToTimestamp(sec: number): string;
|
|
6
|
+
export declare function parseTimestampToSec(ts: string): number | null;
|
|
7
|
+
export declare function parseChaptersText(text: string): ChapterInput[];
|
|
8
|
+
//# sourceMappingURL=chapters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chapters.d.ts","sourceRoot":"","sources":["../../../../src/components/VideoPlayer/utils/chapters.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAStD;AAED,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAkB7D;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,EAAE,CAkB9D"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
function a(i) {
|
|
2
|
+
const t = Math.max(0, Number(i) || 0), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), e = Math.floor(t % 60);
|
|
3
|
+
return n > 0 ? `${String(n).padStart(2, "0")}:${String(r).padStart(2, "0")}:${String(e).padStart(2, "0")}` : `${String(r).padStart(2, "0")}:${String(e).padStart(2, "0")}`;
|
|
4
|
+
}
|
|
5
|
+
function u(i) {
|
|
6
|
+
const t = i.split(":").map((n) => n.trim());
|
|
7
|
+
if (t.length === 2) {
|
|
8
|
+
const n = Number(t[0]), r = Number(t[1]);
|
|
9
|
+
return !Number.isFinite(n) || !Number.isFinite(r) ? null : n * 60 + r;
|
|
10
|
+
}
|
|
11
|
+
if (t.length === 3) {
|
|
12
|
+
const n = Number(t[0]), r = Number(t[1]), e = Number(t[2]);
|
|
13
|
+
return !Number.isFinite(n) || !Number.isFinite(r) || !Number.isFinite(e) ? null : n * 3600 + r * 60 + e;
|
|
14
|
+
}
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
function m(i) {
|
|
18
|
+
const t = (i || "").replace(/\r\n/g, `
|
|
19
|
+
`).replace(/\r/g, `
|
|
20
|
+
`).split(`
|
|
21
|
+
`), n = [];
|
|
22
|
+
for (const r of t) {
|
|
23
|
+
const e = r.trim();
|
|
24
|
+
if (!e) continue;
|
|
25
|
+
const s = e.match(/^([0-9]{1,2}:[0-9]{2}(?::[0-9]{2})?)\s+(.+)$/);
|
|
26
|
+
if (!s) continue;
|
|
27
|
+
const o = u(s[1]);
|
|
28
|
+
if (o == null) continue;
|
|
29
|
+
const c = s[2].trim();
|
|
30
|
+
c && n.push({ startSec: o, title: c });
|
|
31
|
+
}
|
|
32
|
+
return n;
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
m as parseChaptersText,
|
|
36
|
+
u as parseTimestampToSec,
|
|
37
|
+
a as secondsToTimestamp
|
|
38
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { StoryboardCue } from '../types';
|
|
2
|
+
export declare function parseStoryboardVtt(vttText: string, vttUrl: string, baseUrl?: string): StoryboardCue[];
|
|
3
|
+
export declare function resolveStoryboardUrl(url: string, baseUrl?: string): string;
|
|
4
|
+
export declare function clampRatio(value: number): number;
|
|
5
|
+
//# sourceMappingURL=storyboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storyboard.d.ts","sourceRoot":"","sources":["../../../../src/components/VideoPlayer/utils/storyboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AA6B9C,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,MAAM,GACf,aAAa,EAAE,CAgCjB;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAE1E;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEhD"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
function u(t) {
|
|
2
|
+
const n = t.match(/(\d+):(\d+):(\d+)\.(\d+)/);
|
|
3
|
+
if (!n) return 0;
|
|
4
|
+
const s = Number(n[1]), o = Number(n[2]), i = Number(n[3]), c = Number(n[4]);
|
|
5
|
+
return s * 3600 + o * 60 + i + c / 1e3;
|
|
6
|
+
}
|
|
7
|
+
function m(t, n) {
|
|
8
|
+
if (t.startsWith("http://") || t.startsWith("https://"))
|
|
9
|
+
return t;
|
|
10
|
+
const s = n || (typeof window < "u" ? window.location.origin : ""), o = t.startsWith("/") ? t : `/${t}`;
|
|
11
|
+
return `${s}${o}`;
|
|
12
|
+
}
|
|
13
|
+
function x(t, n) {
|
|
14
|
+
const o = m(t, n).split("/");
|
|
15
|
+
return o.pop(), o.join("/");
|
|
16
|
+
}
|
|
17
|
+
function $(t, n, s) {
|
|
18
|
+
const o = t.split(/\r?\n/), i = [], c = x(n, s);
|
|
19
|
+
let r = 0;
|
|
20
|
+
for (; r < o.length; ) {
|
|
21
|
+
const d = o[r].trim();
|
|
22
|
+
if (d.includes("-->")) {
|
|
23
|
+
const [h, l] = d.split("-->").map((a) => a.trim()), p = u(h), f = u(l), e = (o[r + 1] || "").trim().match(
|
|
24
|
+
/^(sheet_\d+\.jpg)#xywh=(\d+),(\d+),(\d+),(\d+)/
|
|
25
|
+
);
|
|
26
|
+
if (e) {
|
|
27
|
+
const a = e[1], b = Number(e[2]), w = Number(e[3]), y = Number(e[4]), N = Number(e[5]), g = `${c}/${a}`;
|
|
28
|
+
i.push({ start: p, end: f, sheetUrl: g, x: b, y: w, w: y, h: N });
|
|
29
|
+
}
|
|
30
|
+
r += 2;
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
r += 1;
|
|
34
|
+
}
|
|
35
|
+
return i;
|
|
36
|
+
}
|
|
37
|
+
function S(t, n) {
|
|
38
|
+
return m(t, n);
|
|
39
|
+
}
|
|
40
|
+
function R(t) {
|
|
41
|
+
return Math.min(1, Math.max(0, t));
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
R as clampRatio,
|
|
45
|
+
$ as parseStoryboardVtt,
|
|
46
|
+
S as resolveStoryboardUrl
|
|
47
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type SubtitleTrack = {
|
|
2
|
+
id: string;
|
|
3
|
+
lang: string;
|
|
4
|
+
label: string;
|
|
5
|
+
kind: string;
|
|
6
|
+
isDefault: boolean;
|
|
7
|
+
isDisabled: boolean;
|
|
8
|
+
url?: string;
|
|
9
|
+
createdAt?: string;
|
|
10
|
+
fileName?: string;
|
|
11
|
+
status?: 'uploading' | 'ready' | 'error' | 'draft';
|
|
12
|
+
auto?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare function normalizeSubtitleTrack(raw: any): SubtitleTrack;
|
|
15
|
+
export declare function isAutoGeneratedTrack(track: {
|
|
16
|
+
label: string;
|
|
17
|
+
}): boolean;
|
|
18
|
+
//# sourceMappingURL=subtitles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subtitles.d.ts","sourceRoot":"","sources":["../../../../src/components/VideoPlayer/utils/subtitles.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;IACnD,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,GAAG,GAAG,aAAa,CAkC9D;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAEtE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
function b(t) {
|
|
2
|
+
const i = t?.id ?? t?.trackId ?? t?.subtitleId ?? "", n = t?.lang ?? t?.language ?? t?.srclang ?? "", e = n ? String(n) : "und", l = t?.label ?? t?.name ?? t?.title ?? e, o = l ? String(l) : e, s = t?.kind ?? "subtitles", c = !!(t?.isDefault ?? t?.default ?? !1), u = !!(t?.isDisabled ?? !1), d = typeof t?.url == "string" ? t.url : typeof t?.vttUrl == "string" ? t.vttUrl : typeof t?.src == "string" ? t.src : void 0, g = typeof t?.createdAt == "string" ? t.createdAt : void 0, f = typeof t?.fileName == "string" ? t.fileName : void 0, a = !!(t?.auto ?? t?.isAuto ?? t?.source === "auto");
|
|
3
|
+
return {
|
|
4
|
+
id: String(i),
|
|
5
|
+
lang: e,
|
|
6
|
+
label: o,
|
|
7
|
+
kind: String(s),
|
|
8
|
+
isDefault: c,
|
|
9
|
+
isDisabled: u,
|
|
10
|
+
url: d,
|
|
11
|
+
createdAt: g,
|
|
12
|
+
fileName: f,
|
|
13
|
+
status: "ready",
|
|
14
|
+
auto: a
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function r(t) {
|
|
18
|
+
return t.label.length <= 3;
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
r as isAutoGeneratedTrack,
|
|
22
|
+
b as normalizeSubtitleTrack
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"touch.d.ts","sourceRoot":"","sources":["../../../../src/components/VideoPlayer/utils/touch.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,eAAe,EAAE,OAG8B,CAAC;AAK7D,eAAO,MAAM,eAAe,EAAE,OACwB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
const n = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", e = 768, o = n && navigator.maxTouchPoints > 0 && window.innerWidth <= e, t = n && window.matchMedia("(hover: hover)").matches, d = n && !t && !o;
|
|
2
|
+
export {
|
|
3
|
+
o as IS_TOUCH_DEVICE,
|
|
4
|
+
d as IS_TOUCH_TABLET
|
|
5
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare function formatTime(time: number): string;
|
|
2
|
+
type BufferedRange = {
|
|
3
|
+
start: number;
|
|
4
|
+
end: number;
|
|
5
|
+
};
|
|
6
|
+
declare const clamp: (value: number, min: number, max: number) => number;
|
|
7
|
+
declare const getBufferedRanges: (video: HTMLVideoElement | null) => BufferedRange[];
|
|
8
|
+
export { clamp, formatTime, getBufferedRanges };
|
|
9
|
+
export type { BufferedRange };
|
|
10
|
+
//# sourceMappingURL=videoPlayerUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"videoPlayerUtils.d.ts","sourceRoot":"","sources":["../../../../src/components/VideoPlayer/utils/videoPlayerUtils.ts"],"names":[],"mappings":"AAAA,iBAAS,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAYxC;AAED,KAAK,aAAa,GAAG;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,QAAA,MAAM,KAAK,GAAI,OAAO,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,WACjB,CAAC;AAEtC,QAAA,MAAM,iBAAiB,GAAI,OAAO,gBAAgB,GAAG,IAAI,KAAG,aAAa,EAYxE,CAAC;AAEF,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAC;AAChD,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
function u(t) {
|
|
2
|
+
if (!Number.isFinite(t)) return "0:00";
|
|
3
|
+
const n = Math.max(0, Math.floor(t)), r = Math.floor(n / 3600), a = Math.floor(n % 3600 / 60), o = n % 60;
|
|
4
|
+
return r > 0 ? `${r}:${String(a).padStart(2, "0")}:${String(
|
|
5
|
+
o
|
|
6
|
+
).padStart(2, "0")}` : `${a}:${String(o).padStart(2, "0")}`;
|
|
7
|
+
}
|
|
8
|
+
const s = (t, n, r) => Math.min(r, Math.max(n, t)), f = (t) => {
|
|
9
|
+
if (!t || !Number.isFinite(t.duration) || t.duration <= 0)
|
|
10
|
+
return [];
|
|
11
|
+
const n = [], r = t.buffered;
|
|
12
|
+
for (let a = 0; a < r.length; a += 1) {
|
|
13
|
+
const o = s(r.start(a) / t.duration, 0, 1), e = s(r.end(a) / t.duration, 0, 1);
|
|
14
|
+
n.push({ start: o, end: e });
|
|
15
|
+
}
|
|
16
|
+
return n;
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
s as clamp,
|
|
20
|
+
u as formatTime,
|
|
21
|
+
f as getBufferedRanges
|
|
22
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
type ShakaPlayerInstance = {
|
|
2
|
+
getVariantTracks?: () => Array<{
|
|
3
|
+
id: number;
|
|
4
|
+
height?: number;
|
|
5
|
+
width?: number;
|
|
6
|
+
language?: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
active?: boolean;
|
|
9
|
+
bandwidth?: number;
|
|
10
|
+
}>;
|
|
11
|
+
selectVariantTrack?: (track: {
|
|
12
|
+
id: number;
|
|
13
|
+
}, clearBuffer?: boolean) => void;
|
|
14
|
+
getTextTracks?: () => Array<{
|
|
15
|
+
id: number;
|
|
16
|
+
language?: string;
|
|
17
|
+
label?: string;
|
|
18
|
+
kind?: string;
|
|
19
|
+
active?: boolean;
|
|
20
|
+
}>;
|
|
21
|
+
selectTextTrack?: (track: {
|
|
22
|
+
id: number;
|
|
23
|
+
}) => void;
|
|
24
|
+
setTextTrackVisibility?: (visible: boolean) => void;
|
|
25
|
+
addTextTrack?: (uri: string, language: string, kind: string, mime?: string, codec?: string, label?: string) => any;
|
|
26
|
+
addTextTrackAsync?: (uri: string, language: string, kind: string, mime?: string, codec?: string, label?: string) => Promise<any>;
|
|
27
|
+
removeTextTrack?: (track: {
|
|
28
|
+
id: number;
|
|
29
|
+
}) => void;
|
|
30
|
+
getNetworkingEngine?: () => {
|
|
31
|
+
registerRequestFilter?: (filter: (type: any, request: any) => void) => void;
|
|
32
|
+
} | null;
|
|
33
|
+
getPlaybackRate?: () => number;
|
|
34
|
+
setPlaybackRate?: (rate: number) => void;
|
|
35
|
+
configure?: (config: Record<string, any>) => void;
|
|
36
|
+
addEventListener?: (event: string, callback: (...args: any[]) => void) => void;
|
|
37
|
+
removeEventListener?: (event: string, callback: (...args: any[]) => void) => void;
|
|
38
|
+
};
|
|
39
|
+
type PlayerSettingsSnapshot = {
|
|
40
|
+
speeds: number[];
|
|
41
|
+
currentSpeed: number;
|
|
42
|
+
hasRealSpeeds: boolean;
|
|
43
|
+
qualities: Array<{
|
|
44
|
+
id: number;
|
|
45
|
+
label: string;
|
|
46
|
+
}>;
|
|
47
|
+
currentQualityId: number | null;
|
|
48
|
+
hasRealQualities: boolean;
|
|
49
|
+
subtitles: Array<{
|
|
50
|
+
id: number | null;
|
|
51
|
+
label: string;
|
|
52
|
+
lang?: string;
|
|
53
|
+
isDefault?: boolean;
|
|
54
|
+
}>;
|
|
55
|
+
currentSubtitleId: number | null;
|
|
56
|
+
hasRealSubtitles: boolean;
|
|
57
|
+
};
|
|
58
|
+
declare const DEFAULT_SPEEDS: number[];
|
|
59
|
+
declare const buildQualityLabel: (track: {
|
|
60
|
+
height?: number;
|
|
61
|
+
bandwidth?: number;
|
|
62
|
+
}) => string;
|
|
63
|
+
declare const getSettingsSnapshot: (player: ShakaPlayerInstance | null, videoElement?: HTMLVideoElement | null) => PlayerSettingsSnapshot;
|
|
64
|
+
declare const setPlaybackRate: (player: ShakaPlayerInstance | null, rate: number) => void;
|
|
65
|
+
declare const setQuality: (player: ShakaPlayerInstance | null, id: number) => void;
|
|
66
|
+
declare const setSubtitle: (player: ShakaPlayerInstance | null, id: number | null, videoElement?: HTMLVideoElement | null) => void;
|
|
67
|
+
export { DEFAULT_SPEEDS, buildQualityLabel, getSettingsSnapshot, setPlaybackRate, setQuality, setSubtitle, };
|
|
68
|
+
export type { PlayerSettingsSnapshot, ShakaPlayerInstance };
|
|
69
|
+
//# sourceMappingURL=videoSettings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"videoSettings.d.ts","sourceRoot":"","sources":["../../../../src/components/VideoPlayer/utils/videoSettings.ts"],"names":[],"mappings":"AAAA,KAAK,mBAAmB,GAAG;IACzB,gBAAgB,CAAC,EAAE,MAAM,KAAK,CAAC;QAC7B,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC,CAAC;IACH,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,WAAW,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5E,aAAa,CAAC,EAAE,MAAM,KAAK,CAAC;QAC1B,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,OAAO,CAAC;KAClB,CAAC,CAAC;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAClD,sBAAsB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACpD,YAAY,CAAC,EAAE,CACb,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,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5, 0.75, 1, 1.25, 1.5, 2], g = [
|
|
2
|
+
{ id: 1, label: "English (Automatic)" },
|
|
3
|
+
{ id: 2, label: "Русский (Автоматические)" },
|
|
4
|
+
{ id: 3, label: "Spanish (automatic)" }
|
|
5
|
+
], v = (t) => t.height ? `${t.height}p` : t.bandwidth ? `${(t.bandwidth / 1e6).toFixed(1)} Mbps` : "Auto", h = (t) => t?.textTracks ? Array.from(t.textTracks).filter(
|
|
6
|
+
(a) => a.kind === "subtitles" || a.kind === "captions"
|
|
7
|
+
) : [], m = (t, a) => {
|
|
8
|
+
if (!t) {
|
|
9
|
+
const e = h(a), d = e.length > 0, b = e.findIndex(
|
|
10
|
+
(u) => u.mode === "showing"
|
|
11
|
+
), R = d ? [
|
|
12
|
+
{ id: null, label: "Off" },
|
|
13
|
+
...e.map((u, p) => ({
|
|
14
|
+
id: p,
|
|
15
|
+
label: u.label || u.language || "Unknown",
|
|
16
|
+
lang: u.language || void 0,
|
|
17
|
+
isDefault: u.default ?? !1
|
|
18
|
+
}))
|
|
19
|
+
] : [{ id: null, label: "Off" }, ...g];
|
|
20
|
+
return {
|
|
21
|
+
speeds: f,
|
|
22
|
+
currentSpeed: a?.playbackRate ?? 1,
|
|
23
|
+
hasRealSpeeds: !0,
|
|
24
|
+
qualities: [],
|
|
25
|
+
currentQualityId: null,
|
|
26
|
+
hasRealQualities: !1,
|
|
27
|
+
subtitles: R,
|
|
28
|
+
currentSubtitleId: b >= 0 ? b : null,
|
|
29
|
+
hasRealSubtitles: d
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const l = f, n = t.getPlaybackRate?.() ?? a?.playbackRate ?? 1, s = l.length > 0, i = t.getVariantTracks?.() ?? [], c = i.map((e) => ({
|
|
33
|
+
id: e.id,
|
|
34
|
+
label: v(e)
|
|
35
|
+
})), T = i.find((e) => e.active), S = c.length > 0, r = t.getTextTracks?.() ?? [], o = r.length > 0, x = o ? [
|
|
36
|
+
{ id: null, label: "Off" },
|
|
37
|
+
...r.map((e) => ({
|
|
38
|
+
id: e.id,
|
|
39
|
+
label: e.label || e.language || "Unknown",
|
|
40
|
+
lang: e.language || void 0,
|
|
41
|
+
isDefault: !!(e.default ?? e.isDefault ?? !1)
|
|
42
|
+
}))
|
|
43
|
+
] : [{ id: null, label: "Off" }, ...g], k = r.find((e) => e.active);
|
|
44
|
+
return {
|
|
45
|
+
speeds: l,
|
|
46
|
+
currentSpeed: n,
|
|
47
|
+
hasRealSpeeds: s,
|
|
48
|
+
qualities: c,
|
|
49
|
+
currentQualityId: T?.id ?? null,
|
|
50
|
+
hasRealQualities: S,
|
|
51
|
+
subtitles: x,
|
|
52
|
+
currentSubtitleId: k?.id ?? null,
|
|
53
|
+
hasRealSubtitles: o
|
|
54
|
+
};
|
|
55
|
+
}, I = (t, a) => {
|
|
56
|
+
t?.setPlaybackRate?.(a);
|
|
57
|
+
}, w = (t, a) => {
|
|
58
|
+
if (!t) return;
|
|
59
|
+
const n = (t.getVariantTracks?.() ?? []).find((s) => s.id === a);
|
|
60
|
+
n && t.selectVariantTrack?.(n, !0);
|
|
61
|
+
}, Q = (t, a, l) => {
|
|
62
|
+
if (t) {
|
|
63
|
+
if (a === null) {
|
|
64
|
+
t.setTextTrackVisibility?.(!1);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const i = (t.getTextTracks?.() ?? []).find((c) => c.id === a);
|
|
68
|
+
i && (t.selectTextTrack?.(i), t.setTextTrackVisibility?.(!0));
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (!l) return;
|
|
72
|
+
const n = h(l);
|
|
73
|
+
if (a === null) {
|
|
74
|
+
n.forEach((s) => {
|
|
75
|
+
s.mode = "disabled";
|
|
76
|
+
});
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
n.forEach((s, i) => {
|
|
80
|
+
s.mode = i === a ? "showing" : "disabled";
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
export {
|
|
84
|
+
f as DEFAULT_SPEEDS,
|
|
85
|
+
v as buildQualityLabel,
|
|
86
|
+
m as getSettingsSnapshot,
|
|
87
|
+
I as setPlaybackRate,
|
|
88
|
+
w as setQuality,
|
|
89
|
+
Q as setSubtitle
|
|
90
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const getFileType: (mimeType
|
|
1
|
+
export declare const getFileType: (mimeType?: string | null, groupByCategory?: boolean, fileName?: string | null) => "other" | "presentation" | "image" | "video" | "documents" | "folder" | "docx" | "xlsx" | "pptx" | "pdf" | "doc" | "xls" | "media" | "diagram" | "archieve";
|
|
2
2
|
//# sourceMappingURL=getFileType.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFileType.d.ts","sourceRoot":"","sources":["../../src/helpers/getFileType.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,GACtB,
|
|
1
|
+
{"version":3,"file":"getFileType.d.ts","sourceRoot":"","sources":["../../src/helpers/getFileType.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,GACtB,WAAW,MAAM,GAAG,IAAI,EACxB,kBAAiB,OAAc,EAC/B,WAAW,MAAM,GAAG,IAAI,gKA8EzB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
const
|
|
1
|
+
const n = (s, e = !0, c) => {
|
|
2
|
+
const t = s ?? "";
|
|
2
3
|
if (c)
|
|
3
4
|
switch (c.split(".").pop()?.toLowerCase() ?? "") {
|
|
4
5
|
case "docx":
|
|
@@ -65,5 +66,5 @@ const a = (t, e = !0, c) => {
|
|
|
65
66
|
}
|
|
66
67
|
};
|
|
67
68
|
export {
|
|
68
|
-
|
|
69
|
+
n as getFileType
|
|
69
70
|
};
|
|
@@ -4,7 +4,9 @@ export declare const useDateUtils: () => {
|
|
|
4
4
|
formatDate: (date: Date | string, formatStr?: string, options?: {
|
|
5
5
|
locale?: boolean;
|
|
6
6
|
}) => string;
|
|
7
|
-
formatDateInTimezone: (date: Date | string, formatStr?: string
|
|
7
|
+
formatDateInTimezone: (date: Date | string, formatStr?: string, options?: {
|
|
8
|
+
locale?: boolean;
|
|
9
|
+
}) => string;
|
|
8
10
|
formatRelativeTime: (date: Date | string, options?: FormatDistanceToNowOptions) => string;
|
|
9
11
|
isSameDayWithTimezone: (date1: Date | string, date2: Date | string) => boolean;
|
|
10
12
|
formatDistanceWithTimezone: (date1: Date | string, date2: Date | string, options?: FormatDistanceOptions) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDateUtils.d.ts","sourceRoot":"","sources":["../../src/hooks/useDateUtils.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAS3B,MAAM,UAAU,CAAC;AAMlB,eAAO,MAAM,YAAY;;uBAOf,IAAI,GAAG,MAAM,gCAET;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,KAC7B,MAAM;iCAoDD,IAAI,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"useDateUtils.d.ts","sourceRoot":"","sources":["../../src/hooks/useDateUtils.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAS3B,MAAM,UAAU,CAAC;AAMlB,eAAO,MAAM,YAAY;;uBAOf,IAAI,GAAG,MAAM,gCAET;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,KAC7B,MAAM;iCAoDD,IAAI,GAAG,MAAM,gCAET;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,KAC7B,MAAM;+BAUD,IAAI,GAAG,MAAM,YACT,0BAA0B,KACnC,MAAM;mCAQA,IAAI,GAAG,MAAM,SACb,IAAI,GAAG,MAAM,KACnB,OAAO;wCAQD,IAAI,GAAG,MAAM,SACb,IAAI,GAAG,MAAM,YACV,qBAAqB,KAC9B,MAAM;oCA3ED,IAAI,GAAG,MAAM,YACT;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,KAC5B,MAAM;CAyFV,CAAC"}
|
|
@@ -1,39 +1,44 @@
|
|
|
1
|
-
import { useTranslation as
|
|
2
|
-
import { differenceInDays as
|
|
1
|
+
import { useTranslation as v } from "react-i18next";
|
|
2
|
+
import { differenceInDays as h, differenceInHours as p, differenceInMinutes as U, differenceInSeconds as w, formatDistance as C, isSameDay as S, formatDistanceToNow as H, format as d } from "date-fns";
|
|
3
3
|
import { toZonedTime as s, formatInTimeZone as I } from "date-fns-tz";
|
|
4
4
|
import { useLocalTimezone as M } from "../store/timezoneStore.js";
|
|
5
5
|
import { dateFnsLocales as y } from "./useDateFnsLocale.js";
|
|
6
6
|
const k = () => {
|
|
7
|
-
const { timezone:
|
|
7
|
+
const { timezone: n } = M(), { t: a, i18n: z } = v("ui"), f = y[z.language] || y.en;
|
|
8
8
|
return {
|
|
9
|
-
timezone:
|
|
10
|
-
formatDate: (e, t = "yyyy-MM-dd HH:mm:ss",
|
|
11
|
-
const r = typeof e == "string" ? new Date(e) : e, i = s(r,
|
|
12
|
-
return
|
|
9
|
+
timezone: n,
|
|
10
|
+
formatDate: (e, t = "yyyy-MM-dd HH:mm:ss", o) => {
|
|
11
|
+
const r = typeof e == "string" ? new Date(e) : e, i = s(r, n || "UTC");
|
|
12
|
+
return o?.locale ?? !1 ? d(i, t, { locale: f }) : d(i, t);
|
|
13
13
|
},
|
|
14
|
-
formatDateInTimezone: (e, t = "yyyy-MM-dd HH:mm:ss") => I(
|
|
14
|
+
formatDateInTimezone: (e, t = "yyyy-MM-dd HH:mm:ss", o) => I(
|
|
15
|
+
e,
|
|
16
|
+
n || "UTC",
|
|
17
|
+
t,
|
|
18
|
+
o?.locale ? { locale: f } : void 0
|
|
19
|
+
),
|
|
15
20
|
formatRelativeTime: (e, t) => {
|
|
16
|
-
const
|
|
21
|
+
const o = typeof e == "string" ? new Date(e) : e, r = s(o, n || "UTC");
|
|
17
22
|
return H(r, { ...t });
|
|
18
23
|
},
|
|
19
24
|
isSameDayWithTimezone: (e, t) => {
|
|
20
|
-
const
|
|
21
|
-
return S(
|
|
25
|
+
const o = s(e, n || "UTC"), r = s(t, n || "UTC");
|
|
26
|
+
return S(o, r);
|
|
22
27
|
},
|
|
23
|
-
formatDistanceWithTimezone: (e, t,
|
|
24
|
-
const r = s(e,
|
|
25
|
-
return C(r, i, { ...
|
|
28
|
+
formatDistanceWithTimezone: (e, t, o) => {
|
|
29
|
+
const r = s(e, n || "UTC"), i = s(t, n || "UTC");
|
|
30
|
+
return C(r, i, { ...o, locale: f });
|
|
26
31
|
},
|
|
27
32
|
formatRelativeShortTime: (e, t) => {
|
|
28
|
-
const
|
|
33
|
+
const o = typeof e == "string" ? new Date(e) : e, r = /* @__PURE__ */ new Date(), i = s(o, n || "UTC"), m = s(r, n || "UTC"), T = h(m, i), u = p(m, i), l = U(m, i), D = w(m, i), c = t?.short ?? !1;
|
|
29
34
|
return T >= 1 ? a(c ? "relativeTime.shortDay" : "relativeTime.day", {
|
|
30
35
|
count: T
|
|
31
36
|
}) : u >= 1 ? a(c ? "relativeTime.shortHour" : "relativeTime.hour", {
|
|
32
37
|
count: u
|
|
33
|
-
}) :
|
|
34
|
-
count: D
|
|
35
|
-
}) : l >= 1 ? a(c ? "relativeTime.shortSecond" : "relativeTime.second", {
|
|
38
|
+
}) : l >= 1 ? a(c ? "relativeTime.shortMinute" : "relativeTime.minute", {
|
|
36
39
|
count: l
|
|
40
|
+
}) : D >= 1 ? a(c ? "relativeTime.shortSecond" : "relativeTime.second", {
|
|
41
|
+
count: D
|
|
37
42
|
}) : a(c ? "relativeTime.shortJustNow" : "relativeTime.justNow");
|
|
38
43
|
}
|
|
39
44
|
};
|