@vocalstack/player 0.0.0-stage → 0.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +67 -2
- package/dist/core/audio.d.ts +39 -0
- package/dist/core/background.d.ts +54 -0
- package/dist/core/clipPrefetch.d.ts +38 -0
- package/dist/core/clipQueue.d.ts +130 -0
- package/dist/core/format.d.ts +17 -0
- package/dist/core/mediaKeys.d.ts +14 -0
- package/dist/core/noAudio.d.ts +18 -0
- package/dist/core/playPosition.d.ts +18 -0
- package/dist/core/qr.d.ts +2 -0
- package/dist/core/readalong.d.ts +17 -0
- package/dist/core/transcript.d.ts +126 -0
- package/dist/core/voiceFollow.d.ts +44 -0
- package/dist/core/voiceRetry.d.ts +2 -0
- package/dist/core/voiceplayer.d.ts +31 -0
- package/dist/core/youtube.d.ts +9 -0
- package/dist/data/connect.d.ts +15 -0
- package/dist/data/context.d.ts +66 -0
- package/dist/data/errors.d.ts +9 -0
- package/dist/data/i18n.d.ts +425 -0
- package/dist/data/lookup.d.ts +4 -0
- package/dist/data/prefs.d.ts +14 -0
- package/dist/data/transcript.d.ts +27 -0
- package/dist/data/tx.d.ts +37 -0
- package/dist/data/voicePreview.d.ts +15 -0
- package/dist/ds/Controls.d.ts +163 -0
- package/dist/ds/Icons.d.ts +141 -0
- package/dist/ds/LanguagePicker.d.ts +34 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +5470 -0
- package/dist/index.js.map +1 -0
- package/dist/style.css +1 -0
- package/dist/ui/EndCard.d.ts +11 -0
- package/dist/ui/SideColumn.d.ts +49 -0
- package/dist/ui/SourceGate.d.ts +8 -0
- package/dist/ui/VocalStackPlayer.d.ts +48 -0
- package/dist/ui/core.d.ts +227 -0
- package/dist/ui/full.d.ts +109 -0
- package/dist/ui/shared.d.ts +276 -0
- package/dist/ui/useDesk.d.ts +1 -0
- package/dist/ui/wait.d.ts +24 -0
- package/package.json +49 -4
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { Strings } from '../data/i18n';
|
|
2
|
+
export declare function setFullTarget(el: HTMLElement | null): void;
|
|
3
|
+
export declare function browserFull(on: boolean): void;
|
|
4
|
+
export declare function realFull(on: boolean): void;
|
|
5
|
+
export type PlayerPos = {
|
|
6
|
+
live: boolean;
|
|
7
|
+
atEdge: boolean;
|
|
8
|
+
edgeFrac: number | null;
|
|
9
|
+
readyFrac?: number | null;
|
|
10
|
+
pct: number;
|
|
11
|
+
atLabel: string;
|
|
12
|
+
labelAt: (frac: number) => string;
|
|
13
|
+
endLabel: string;
|
|
14
|
+
onSeek: (frac: number) => void;
|
|
15
|
+
};
|
|
16
|
+
export type VoicesBtn = {
|
|
17
|
+
on: boolean;
|
|
18
|
+
title: string;
|
|
19
|
+
onClick: () => void;
|
|
20
|
+
};
|
|
21
|
+
export type PlayerTransport = {
|
|
22
|
+
prevOn: boolean;
|
|
23
|
+
nextOn: boolean;
|
|
24
|
+
onPrev: () => void;
|
|
25
|
+
onNext: () => void;
|
|
26
|
+
playing: boolean;
|
|
27
|
+
playable: boolean;
|
|
28
|
+
playTitle: string;
|
|
29
|
+
onPlay?: () => void;
|
|
30
|
+
busy?: boolean;
|
|
31
|
+
};
|
|
32
|
+
export declare function MiniPlayer({ pos, transport, chip, voices, onShare, onFull, copied }: {
|
|
33
|
+
pos: PlayerPos;
|
|
34
|
+
transport: PlayerTransport;
|
|
35
|
+
chip: React.ReactNode;
|
|
36
|
+
voices: VoicesBtn;
|
|
37
|
+
onShare?: () => void;
|
|
38
|
+
onFull: () => void;
|
|
39
|
+
copied: React.ReactNode;
|
|
40
|
+
}): import("react").JSX.Element;
|
|
41
|
+
export declare function FullVideo({ noFull, page, picture, title, desk, pos, sub, wait, pct, mute, cc, ad, chip, transport, picker, sheet, voices, voicesBtn, sheetOpen, onShare, onSettings, paused, copied, onTouch, onClose }: {
|
|
42
|
+
noFull?: boolean;
|
|
43
|
+
page?: boolean;
|
|
44
|
+
onTouch: () => void;
|
|
45
|
+
onSettings?: () => void;
|
|
46
|
+
paused?: {
|
|
47
|
+
title: string;
|
|
48
|
+
summary: string | null;
|
|
49
|
+
share?: {
|
|
50
|
+
url: (t: number | null) => string;
|
|
51
|
+
at: number;
|
|
52
|
+
} | null;
|
|
53
|
+
} | null;
|
|
54
|
+
voices: React.ReactNode;
|
|
55
|
+
voicesBtn: VoicesBtn | null;
|
|
56
|
+
picture: React.ReactNode;
|
|
57
|
+
title: string;
|
|
58
|
+
desk: boolean;
|
|
59
|
+
pos: PlayerPos;
|
|
60
|
+
sub: {
|
|
61
|
+
who: string | null;
|
|
62
|
+
color: string;
|
|
63
|
+
words: {
|
|
64
|
+
t: string;
|
|
65
|
+
sp: string;
|
|
66
|
+
dim: boolean;
|
|
67
|
+
}[];
|
|
68
|
+
cursor?: number | null;
|
|
69
|
+
} | null;
|
|
70
|
+
wait?: React.ReactNode;
|
|
71
|
+
pct?: number | null;
|
|
72
|
+
mute?: {
|
|
73
|
+
muted: boolean;
|
|
74
|
+
onToggle: () => void;
|
|
75
|
+
};
|
|
76
|
+
cc?: {
|
|
77
|
+
on: boolean;
|
|
78
|
+
onToggle: () => void;
|
|
79
|
+
};
|
|
80
|
+
ad?: boolean;
|
|
81
|
+
chip: React.ReactNode;
|
|
82
|
+
transport: PlayerTransport;
|
|
83
|
+
picker: React.ReactNode;
|
|
84
|
+
sheet: React.ReactNode;
|
|
85
|
+
sheetOpen: boolean;
|
|
86
|
+
onShare?: () => void;
|
|
87
|
+
copied: React.ReactNode;
|
|
88
|
+
onClose?: () => void;
|
|
89
|
+
}): import("react").JSX.Element;
|
|
90
|
+
export declare function ListenerHeader({ dark, back: onBack, home, live, title, badge, subline, onOptions, optionsActive }: {
|
|
91
|
+
dark: boolean;
|
|
92
|
+
back?: () => void;
|
|
93
|
+
home?: boolean;
|
|
94
|
+
live?: boolean;
|
|
95
|
+
title?: string;
|
|
96
|
+
badge?: React.ReactNode;
|
|
97
|
+
subline?: string;
|
|
98
|
+
onOptions: () => void;
|
|
99
|
+
optionsActive?: boolean;
|
|
100
|
+
}): import("react").JSX.Element;
|
|
101
|
+
export declare const modeOptions: (t: Strings, video?: boolean) => ({
|
|
102
|
+
value: "read";
|
|
103
|
+
label: string;
|
|
104
|
+
icon: import("react").JSX.Element;
|
|
105
|
+
} | {
|
|
106
|
+
value: "listen";
|
|
107
|
+
label: import("react").JSX.Element;
|
|
108
|
+
icon: import("react").JSX.Element;
|
|
109
|
+
})[];
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { Correction, LanguageLists, ExportFormat } from '@vocalstack/js-sdk';
|
|
3
|
+
import { type Lane, type Model, type Row, type Word } from '../core/transcript';
|
|
4
|
+
import { type MediaCred } from '../core/audio';
|
|
5
|
+
import { type ReadPos, type VoiceTrackRow } from '../core/voiceplayer';
|
|
6
|
+
import { type ErrorLike } from '../data/transcript';
|
|
7
|
+
import type { Strings } from '../data/i18n';
|
|
8
|
+
export declare function feedInset(el: HTMLElement): {
|
|
9
|
+
top: number;
|
|
10
|
+
bottom: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const NO_VOICE_TIP = "This language has no synthetic voice yet, so you can read it but not listen.";
|
|
13
|
+
export declare function rowKey(onClick: () => void): (e: React.KeyboardEvent<HTMLElement>) => void;
|
|
14
|
+
export declare function useFeedBar(ref: React.RefObject<HTMLDivElement>, thumbRef: React.RefObject<HTMLDivElement>, extra?: number): void;
|
|
15
|
+
export declare function FeedBar({ thumbRef }: {
|
|
16
|
+
thumbRef: React.RefObject<HTMLDivElement>;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
export declare function Toast({ error, onClose }: {
|
|
19
|
+
error: ErrorLike | null;
|
|
20
|
+
onClose: () => void;
|
|
21
|
+
}): import("react").JSX.Element | null;
|
|
22
|
+
export declare function SpeakerTag({ model, speaker, showLabels, pending, diarized }: {
|
|
23
|
+
model: Model;
|
|
24
|
+
speaker: number;
|
|
25
|
+
showLabels: boolean;
|
|
26
|
+
pending?: boolean;
|
|
27
|
+
diarized?: boolean;
|
|
28
|
+
}): import("react").JSX.Element | null;
|
|
29
|
+
export declare function VoiceIdGlyph({ color }: {
|
|
30
|
+
color: string;
|
|
31
|
+
}): import("react").JSX.Element;
|
|
32
|
+
export declare function Transport({ chip, note, scrub, mute, voice, prev, play, next }: {
|
|
33
|
+
chip: ReactNode;
|
|
34
|
+
note?: ReactNode;
|
|
35
|
+
scrub: ReactNode;
|
|
36
|
+
mute: ReactNode;
|
|
37
|
+
voice: ReactNode;
|
|
38
|
+
prev: ReactNode;
|
|
39
|
+
play: ReactNode;
|
|
40
|
+
next: ReactNode;
|
|
41
|
+
}): import("react").JSX.Element;
|
|
42
|
+
export declare function ReplayScrub({ index, total, atLabel, durLabel, stepLabel, onSeek, onSeekFrac, onScrubStart, onScrubEnd, frac, glideMs }: {
|
|
43
|
+
index: number;
|
|
44
|
+
total: number;
|
|
45
|
+
atLabel: string;
|
|
46
|
+
durLabel: string;
|
|
47
|
+
stepLabel: string;
|
|
48
|
+
onSeek: (i: number) => void;
|
|
49
|
+
onSeekFrac?: (f: number) => void;
|
|
50
|
+
onScrubStart?: () => void;
|
|
51
|
+
onScrubEnd?: () => void;
|
|
52
|
+
frac?: number;
|
|
53
|
+
glideMs?: number;
|
|
54
|
+
}): import("react").JSX.Element;
|
|
55
|
+
export interface RowFixes {
|
|
56
|
+
script: number;
|
|
57
|
+
manual: boolean;
|
|
58
|
+
manualCount: number;
|
|
59
|
+
}
|
|
60
|
+
export declare function rowFixes(r: Row, corrections: Correction[] | undefined, slots?: Set<string>): RowFixes;
|
|
61
|
+
export declare const isFixedWord: (w: Word, slots?: Set<string>, listener?: boolean) => boolean;
|
|
62
|
+
export declare function FixBadges({ f, desk, onOpen }: {
|
|
63
|
+
f: RowFixes;
|
|
64
|
+
desk?: boolean;
|
|
65
|
+
onOpen?: () => void;
|
|
66
|
+
}): import("react").JSX.Element;
|
|
67
|
+
export declare function FixPen({ onOpen, alone }: {
|
|
68
|
+
onOpen: () => void;
|
|
69
|
+
alone: boolean;
|
|
70
|
+
}): import("react").JSX.Element;
|
|
71
|
+
export declare function CorrectedBadge({ desk }: {
|
|
72
|
+
desk?: boolean;
|
|
73
|
+
}): import("react").JSX.Element;
|
|
74
|
+
export declare function TrText({ text, query, pos, warm }: {
|
|
75
|
+
text: string;
|
|
76
|
+
query?: string;
|
|
77
|
+
pos?: ReadPos | null;
|
|
78
|
+
warm: boolean;
|
|
79
|
+
}): import("react").JSX.Element;
|
|
80
|
+
export declare function Words({ words, text, query, colour, tappable, tapAll, onWord, corrected, pos, warm, slots, listener, fixes }: {
|
|
81
|
+
fixes?: boolean;
|
|
82
|
+
slots?: Set<string>;
|
|
83
|
+
listener?: boolean;
|
|
84
|
+
words: Word[];
|
|
85
|
+
text: string;
|
|
86
|
+
query?: string;
|
|
87
|
+
colour: boolean;
|
|
88
|
+
tappable?: boolean;
|
|
89
|
+
tapAll?: boolean;
|
|
90
|
+
onWord?: (w: Word) => void;
|
|
91
|
+
corrected?: boolean;
|
|
92
|
+
pos?: ReadPos | null;
|
|
93
|
+
warm?: boolean;
|
|
94
|
+
}): import("react").JSX.Element;
|
|
95
|
+
export declare function worstConf(r: Row): '' | 'mid' | 'low';
|
|
96
|
+
export declare function useViewportTranslation(recordingId: string | null, lang: string | null, rows: Row[], merge: (lang: string, made: Record<string, string>) => void): (ids: number[]) => void;
|
|
97
|
+
export interface AvailableVoice {
|
|
98
|
+
id: string;
|
|
99
|
+
name: string;
|
|
100
|
+
cloned: boolean;
|
|
101
|
+
default: boolean;
|
|
102
|
+
previewUrl?: string;
|
|
103
|
+
quality?: 1 | 2 | 3 | null;
|
|
104
|
+
lagS?: number | null;
|
|
105
|
+
accent?: string | null;
|
|
106
|
+
gender?: 'male' | 'female' | null;
|
|
107
|
+
ready?: boolean;
|
|
108
|
+
consent?: 'pending' | 'granted' | null;
|
|
109
|
+
speaker?: number | null;
|
|
110
|
+
auto?: boolean;
|
|
111
|
+
library?: boolean;
|
|
112
|
+
live?: boolean;
|
|
113
|
+
}
|
|
114
|
+
export declare function voiceDetail(v: AvailableVoice): string;
|
|
115
|
+
interface VoiceGroupRow {
|
|
116
|
+
v: AvailableVoice;
|
|
117
|
+
headOn: boolean;
|
|
118
|
+
head: string;
|
|
119
|
+
headCount: number;
|
|
120
|
+
rule: string;
|
|
121
|
+
}
|
|
122
|
+
export declare function voiceGroups(list: AvailableVoice[], t: Strings): VoiceGroupRow[];
|
|
123
|
+
export interface CastMember {
|
|
124
|
+
key: number;
|
|
125
|
+
voiceId?: string | null;
|
|
126
|
+
name: string;
|
|
127
|
+
initial: string;
|
|
128
|
+
lane: Lane | null;
|
|
129
|
+
sex?: 'male' | 'female' | null;
|
|
130
|
+
fg?: string;
|
|
131
|
+
soft?: string;
|
|
132
|
+
hasVoice?: boolean;
|
|
133
|
+
}
|
|
134
|
+
export declare function speakerRoster(rows: {
|
|
135
|
+
speaker: number;
|
|
136
|
+
}[], model: Model, unknownLabel: string): CastMember[];
|
|
137
|
+
export declare function castKey(map: Map<number, string>): string;
|
|
138
|
+
export declare function parseCast(key: string | null | undefined): Map<number, string> | null;
|
|
139
|
+
export declare function autoCast(roster: CastMember[], voices: AvailableVoice[], clones?: boolean): Map<number, string>;
|
|
140
|
+
export declare function SpeakerCast({ roster, selected, onSelect, noClone, building, short, sexOf, t }: {
|
|
141
|
+
roster: CastMember[];
|
|
142
|
+
selected: number | null;
|
|
143
|
+
onSelect: (key: number) => void;
|
|
144
|
+
noClone: (p: CastMember) => boolean;
|
|
145
|
+
building?: (p: CastMember) => boolean;
|
|
146
|
+
short?: (p: CastMember) => boolean;
|
|
147
|
+
sexOf: (p: CastMember) => 'male' | 'female' | null;
|
|
148
|
+
t: Strings;
|
|
149
|
+
}): import("react").JSX.Element | null;
|
|
150
|
+
export declare function VoiceSheetBody({ cast, voices, currentId, armedId, sampleId, dlId, onPick, onAdd, onUse, usedBy, foldKey, foldFor, problem, noClone, t }: {
|
|
151
|
+
cast?: ReactNode;
|
|
152
|
+
voices: AvailableVoice[];
|
|
153
|
+
currentId: string | null;
|
|
154
|
+
armedId?: string | null;
|
|
155
|
+
sampleId?: string | null;
|
|
156
|
+
dlId?: string | null;
|
|
157
|
+
problem?: string | null;
|
|
158
|
+
noClone?: {
|
|
159
|
+
title: string;
|
|
160
|
+
sub: string;
|
|
161
|
+
tip?: string;
|
|
162
|
+
busy?: boolean;
|
|
163
|
+
action?: () => void;
|
|
164
|
+
} | null;
|
|
165
|
+
onPick: (v: AvailableVoice) => void;
|
|
166
|
+
onAdd?: (v: AvailableVoice) => void;
|
|
167
|
+
onUse: (id: string) => void;
|
|
168
|
+
usedBy?: (v: AvailableVoice) => string | null;
|
|
169
|
+
foldKey?: string | number | null;
|
|
170
|
+
foldFor?: 'male' | 'female' | null;
|
|
171
|
+
t: Strings;
|
|
172
|
+
}): import("react").JSX.Element;
|
|
173
|
+
export declare function Equaliser({ height, width }: {
|
|
174
|
+
height: number;
|
|
175
|
+
width?: number;
|
|
176
|
+
}): import("react").JSX.Element;
|
|
177
|
+
export declare function langMeta(langs: LanguageLists | null, code: string | null): {
|
|
178
|
+
flag: string | import("react").JSX.Element;
|
|
179
|
+
code: string;
|
|
180
|
+
label: string;
|
|
181
|
+
name: string;
|
|
182
|
+
};
|
|
183
|
+
export declare const PLAIN_CHIP: React.CSSProperties;
|
|
184
|
+
export declare const BAR_CHIP: React.CSSProperties;
|
|
185
|
+
export declare function useVoiceCatalogue(lang: string | null, active: boolean, version?: number, rec?: {
|
|
186
|
+
id: string | null;
|
|
187
|
+
token?: string | null;
|
|
188
|
+
shareCode?: string | null;
|
|
189
|
+
}): {
|
|
190
|
+
voices: AvailableVoice[];
|
|
191
|
+
} | null;
|
|
192
|
+
export declare function namedCount(model: Model): number;
|
|
193
|
+
export declare function useArchiveVoice({ recordingId, lang, ended, cred, pickedVoice, sentenceIds }: {
|
|
194
|
+
recordingId: string | null;
|
|
195
|
+
lang: string | null;
|
|
196
|
+
ended: boolean;
|
|
197
|
+
cred: MediaCred;
|
|
198
|
+
pickedVoice: string | null;
|
|
199
|
+
sentenceIds?: number[];
|
|
200
|
+
}): {
|
|
201
|
+
listed: {
|
|
202
|
+
recordingId: string;
|
|
203
|
+
lang: string;
|
|
204
|
+
rows: VoiceTrackRow[];
|
|
205
|
+
} | null;
|
|
206
|
+
rows: VoiceTrackRow[];
|
|
207
|
+
track: VoiceTrackRow | null;
|
|
208
|
+
renderVoiceId: string | null;
|
|
209
|
+
rendering: boolean;
|
|
210
|
+
failed: string | null;
|
|
211
|
+
clips: import("../core/clipQueue").VoiceClip[];
|
|
212
|
+
requestRender: (voiceId: string | null, cast?: Map<number, string> | null) => Promise<void>;
|
|
213
|
+
forget: () => void;
|
|
214
|
+
reload: () => void;
|
|
215
|
+
setNear: import("react").Dispatch<import("react").SetStateAction<number | null>>;
|
|
216
|
+
missing: number;
|
|
217
|
+
coming: Set<number>;
|
|
218
|
+
};
|
|
219
|
+
export interface TabSpec<K extends string> {
|
|
220
|
+
key: K;
|
|
221
|
+
label: string;
|
|
222
|
+
icon?: string;
|
|
223
|
+
sw?: number;
|
|
224
|
+
}
|
|
225
|
+
export declare function HeadTap({ onBack, children }: {
|
|
226
|
+
onBack: () => void;
|
|
227
|
+
children: React.ReactNode;
|
|
228
|
+
}): import("react").JSX.Element;
|
|
229
|
+
export declare function TabBar<K extends string>({ tabs, current, onPick, gap, fold, side }: {
|
|
230
|
+
tabs: TabSpec<K>[];
|
|
231
|
+
current: K | 'none';
|
|
232
|
+
onPick: (k: K | 'none') => void;
|
|
233
|
+
side?: boolean;
|
|
234
|
+
gap?: boolean;
|
|
235
|
+
fold?: boolean;
|
|
236
|
+
}): import("react").JSX.Element;
|
|
237
|
+
type Download = {
|
|
238
|
+
name: string;
|
|
239
|
+
meta: string;
|
|
240
|
+
onClick: () => void | Promise<unknown>;
|
|
241
|
+
};
|
|
242
|
+
export declare function ExportPanel({ audio, video, formats, onExport }: {
|
|
243
|
+
audio?: Download | null;
|
|
244
|
+
video?: Download | null;
|
|
245
|
+
formats?: boolean;
|
|
246
|
+
onExport: (k: ExportFormat) => void | Promise<unknown>;
|
|
247
|
+
}): import("react").JSX.Element;
|
|
248
|
+
export declare function shareLink(url: string, title: string, onCopied?: () => void): void;
|
|
249
|
+
export type SummaryState = {
|
|
250
|
+
state: 'idle' | 'pending' | 'ready' | 'unavailable' | 'not_requested';
|
|
251
|
+
request?: () => void;
|
|
252
|
+
title?: string;
|
|
253
|
+
summary?: string;
|
|
254
|
+
slow?: boolean;
|
|
255
|
+
retry: () => void;
|
|
256
|
+
};
|
|
257
|
+
export declare function useSummaryIn(base: SummaryState, recordingId: string | null, lang: string | null): SummaryState;
|
|
258
|
+
export declare function summaryOf(rec: {
|
|
259
|
+
title?: string | null;
|
|
260
|
+
summary?: string | null;
|
|
261
|
+
} | null | undefined): SummaryState;
|
|
262
|
+
export declare function SummaryPanel({ s }: {
|
|
263
|
+
s: SummaryState;
|
|
264
|
+
}): import("react").JSX.Element;
|
|
265
|
+
export declare function LiveVideo({ ytId, title, timeLabel, radius, style, large, children, picture }: {
|
|
266
|
+
ytId: string;
|
|
267
|
+
title: string;
|
|
268
|
+
timeLabel?: string | null;
|
|
269
|
+
radius?: number;
|
|
270
|
+
style?: React.CSSProperties;
|
|
271
|
+
large?: boolean;
|
|
272
|
+
children?: React.ReactNode;
|
|
273
|
+
picture?: React.ReactNode;
|
|
274
|
+
}): import("react").JSX.Element;
|
|
275
|
+
export declare function useDragScroll(enabled?: boolean, external?: React.RefObject<HTMLDivElement>): import("react").MutableRefObject<HTMLDivElement | null>;
|
|
276
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useDesk(forced?: boolean): boolean;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type PlayerWaitKind = 'translating' | 'voice' | 'starting' | 'translateFailed' | 'voiceFailed';
|
|
2
|
+
export interface PlayerWaitState {
|
|
3
|
+
kind: PlayerWaitKind;
|
|
4
|
+
lang: string;
|
|
5
|
+
since?: number | null;
|
|
6
|
+
}
|
|
7
|
+
export declare function playerWaitOf(o: {
|
|
8
|
+
lang: string | null;
|
|
9
|
+
langName: string;
|
|
10
|
+
translating: boolean;
|
|
11
|
+
translateFailed: string | null;
|
|
12
|
+
voiceFailed: boolean;
|
|
13
|
+
relang: boolean;
|
|
14
|
+
starting: number | null | undefined;
|
|
15
|
+
slowLine: boolean;
|
|
16
|
+
lineSince: number | null;
|
|
17
|
+
}): PlayerWaitState | null;
|
|
18
|
+
export declare function useHeld(on: boolean, ms: number): [boolean, number | null];
|
|
19
|
+
export declare function PlayerWait({ state, line, onRetry, onOriginal }: {
|
|
20
|
+
state: PlayerWaitState;
|
|
21
|
+
line?: string | null;
|
|
22
|
+
onRetry: () => void;
|
|
23
|
+
onOriginal: () => void;
|
|
24
|
+
}): import("react").JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vocalstack/player",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0-alpha.1",
|
|
4
|
+
"description": "VocalStack video and transcript player for React: synced transcript, subtitles, spoken translations and background sound, over the public VocalStack API.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/vocalstack/player.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://vocalstack.com",
|
|
12
|
+
"sideEffects": [
|
|
13
|
+
"*.css"
|
|
14
|
+
],
|
|
15
|
+
"main": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"default": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./style.css": "./dist/style.css"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "vite build && tsc -p tsconfig.build.json",
|
|
29
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
30
|
+
"test": "node --import ./test-resolve.mjs --test test/*.test.ts",
|
|
31
|
+
"dev": "vite --config example/vite.config.ts",
|
|
32
|
+
"prepublishOnly": "npm run typecheck && npm test && npm run build"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"react": ">=18",
|
|
36
|
+
"react-dom": ">=18"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@vocalstack/js-sdk": "^2.0.0-alpha.1"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@types/node": "^24.0.0",
|
|
43
|
+
"@types/react": "^18.3.12",
|
|
44
|
+
"@types/react-dom": "^18.3.1",
|
|
45
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
46
|
+
"react": "^18.3.1",
|
|
47
|
+
"react-dom": "^18.3.1",
|
|
48
|
+
"typescript": "^5.9.0",
|
|
49
|
+
"vite": "^5.4.11"
|
|
50
|
+
}
|
|
51
|
+
}
|