@vocalstack/player 0.1.0-alpha.1 → 0.1.0-alpha.11

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.
@@ -1,8 +1,33 @@
1
- import { type Started } from '../data/connect';
1
+ import { type PopupStatus, type Started } from '../data/connect';
2
+ import { type IdlePrefs } from './IdleSettings';
3
+ export interface IdleState {
4
+ prefs: IdlePrefs;
5
+ set: (p: Partial<IdlePrefs>) => void;
6
+ shareUrl?: string;
7
+ }
2
8
  export declare function hostOf(src: string): string;
3
- export declare function SourceGate({ src, appUrl, title, onReady }: {
9
+ export interface Connect {
10
+ busy: boolean;
11
+ status: PopupStatus | null;
12
+ err: string | null;
13
+ connected: boolean;
14
+ connect: () => void;
15
+ start: (url: string, ask: boolean) => void;
16
+ }
17
+ export declare function useConnect(appUrl: string | undefined, onReady: (s: Started) => void): Connect;
18
+ export declare function SourceGate({ idle, src, ask, connect, page, poster, onClear }: {
19
+ idle: IdleState;
4
20
  src: string;
5
- appUrl?: string;
6
- title?: string;
7
- onReady: (s: Started) => void;
21
+ ask: boolean;
22
+ connect: Connect;
23
+ page: boolean;
24
+ poster?: string | null;
25
+ onClear?: () => void;
26
+ }): import("react").JSX.Element;
27
+ export declare function StartCard({ idle, connect, page, poster, onPick }: {
28
+ idle: IdleState;
29
+ connect: Connect;
30
+ page: boolean;
31
+ poster?: string | null;
32
+ onPick: (url: string) => void;
8
33
  }): import("react").JSX.Element;
@@ -20,6 +20,20 @@ export interface PlayerControls {
20
20
  fullscreen?: boolean;
21
21
  settings?: boolean;
22
22
  }
23
+ export interface PlaybackState {
24
+ t: number;
25
+ dur: number;
26
+ playing: boolean;
27
+ idx: number;
28
+ seekN: number;
29
+ lang: string | null;
30
+ }
31
+ export interface PlayerHandle {
32
+ seek: (t: number) => void;
33
+ play: () => void;
34
+ pause: () => void;
35
+ toggle: () => void;
36
+ }
23
37
  export interface VocalStackPlayerProps {
24
38
  id?: string;
25
39
  src?: string;
@@ -38,11 +52,14 @@ export interface VocalStackPlayerProps {
38
52
  syncUrl?: boolean;
39
53
  endCard?: EndCardOptions | false;
40
54
  appUrl?: string;
55
+ poster?: string | null;
41
56
  settingsExtra?: ReactNode;
42
57
  shareUrl?: (t: number | null) => string;
43
58
  onSource?: (s: LoadedSource) => void;
44
59
  onProgress?: (pct: number | null) => void;
45
60
  onError?: (e: ErrorLike) => void;
61
+ onPlayback?: (s: PlaybackState) => void;
62
+ compact?: boolean;
46
63
  className?: string;
47
64
  }
48
- export declare function VocalStackPlayer(props: VocalStackPlayerProps): import("react").JSX.Element;
65
+ export declare const VocalStackPlayer: import("react").ForwardRefExoticComponent<VocalStackPlayerProps & import("react").RefAttributes<PlayerHandle>>;
package/dist/ui/core.d.ts CHANGED
@@ -91,18 +91,32 @@ export declare const PUB_SIDE: {
91
91
  title: string;
92
92
  note: string;
93
93
  };
94
+ export interface VoiceSheetCtx {
95
+ people: CastMember[];
96
+ gvList: AvailableVoice[];
97
+ autoOf: (key: number) => AvailableVoice | null;
98
+ savedFor: (sp: CastMember) => AvailableVoice | null;
99
+ }
100
+ export interface NoCloneNote {
101
+ busy?: boolean;
102
+ title: string;
103
+ sub: string;
104
+ tip?: string;
105
+ action?: () => void;
106
+ }
94
107
  export interface VoiceSheetHooks {
95
108
  cloneOn?: boolean;
109
+ pendingClones?: boolean;
96
110
  titleNode?: React.ReactNode;
111
+ badge?: (ctx: VoiceSheetCtx) => number;
97
112
  onAddVoice?: (v: AvailableVoice) => void;
98
113
  onPickVoice?: (v: AvailableVoice) => boolean | void;
99
- noCloneFor?: (sp: CastMember, auto: AvailableVoice | null) => {
100
- busy?: boolean;
101
- title: string;
102
- sub: string;
103
- tip?: string;
104
- action?: () => void;
105
- } | null;
114
+ onSelectSpeaker?: (key: number) => void;
115
+ noCloneFor?: (sp: CastMember, auto: AvailableVoice | null, ctx: VoiceSheetCtx) => NoCloneNote | null;
116
+ castNoClone?: (sp: CastMember, ctx: VoiceSheetCtx) => boolean;
117
+ castShort?: (sp: CastMember, ctx: VoiceSheetCtx) => boolean;
118
+ castBuilding?: (sp: CastMember, ctx: VoiceSheetCtx) => boolean;
119
+ castWarn?: (sp: CastMember, ctx: VoiceSheetCtx) => string | null;
106
120
  }
107
121
  export declare function useTxVoice({ recordingId, model, rows, lenS, ended, cred, langs, srcLang, canTranslate, pickedLang, setPickedLang, side, hearOriginal, timed, stockVoices, stickyPicker, pickerBusy, voiceSheet }: {
108
122
  voiceSheet?: VoiceSheetHooks;
@@ -156,12 +170,18 @@ export declare function useTxVoice({ recordingId, model, rows, lenS, ended, cred
156
170
  openPicker: () => void;
157
171
  original: boolean;
158
172
  reloadVoices: () => void;
173
+ voicesVer: number;
159
174
  people: CastMember[];
160
175
  gvList: AvailableVoice[];
161
176
  autoOf: (key: number) => AvailableVoice | null;
162
177
  savedFor: (sp: CastMember) => AvailableVoice | null;
163
178
  closeVoices: () => void;
164
179
  setSheet: import("react").Dispatch<import("react").SetStateAction<boolean>>;
180
+ selectedSpeaker: CastMember | null;
181
+ armVoice: (v: import("../data/voicePreview").PreviewableVoice) => void;
182
+ resetPreview: () => void;
183
+ armedId: string | null;
184
+ resetCast: () => void;
165
185
  readLang: string | null;
166
186
  readVoiceKey: string;
167
187
  readVoiceName: string;
package/dist/ui/full.d.ts CHANGED
@@ -29,6 +29,9 @@ export type PlayerTransport = {
29
29
  onPlay?: () => void;
30
30
  busy?: boolean;
31
31
  };
32
+ export declare function PanelSeek({ pos }: {
33
+ pos: PlayerPos;
34
+ }): import("react").JSX.Element;
32
35
  export declare function MiniPlayer({ pos, transport, chip, voices, onShare, onFull, copied }: {
33
36
  pos: PlayerPos;
34
37
  transport: PlayerTransport;
@@ -137,13 +137,14 @@ export declare function speakerRoster(rows: {
137
137
  export declare function castKey(map: Map<number, string>): string;
138
138
  export declare function parseCast(key: string | null | undefined): Map<number, string> | null;
139
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 }: {
140
+ export declare function SpeakerCast({ roster, selected, onSelect, noClone, building, short, warn, sexOf, t }: {
141
141
  roster: CastMember[];
142
142
  selected: number | null;
143
143
  onSelect: (key: number) => void;
144
144
  noClone: (p: CastMember) => boolean;
145
145
  building?: (p: CastMember) => boolean;
146
146
  short?: (p: CastMember) => boolean;
147
+ warn?: (p: CastMember) => string | null;
147
148
  sexOf: (p: CastMember) => 'male' | 'female' | null;
148
149
  t: Strings;
149
150
  }): import("react").JSX.Element | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vocalstack/player",
3
- "version": "0.1.0-alpha.1",
3
+ "version": "0.1.0-alpha.11",
4
4
  "description": "VocalStack video and transcript player for React: synced transcript, subtitles, spoken translations and background sound, over the public VocalStack API.",
5
5
  "license": "MIT",
6
6
  "type": "module",