@exode-team/react-recorder 1.0.3 → 1.1.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/README.md +82 -2
- package/dist/components/AudioRecorder.d.ts +20 -0
- package/dist/components/AudioRecorder.d.ts.map +1 -0
- package/dist/components/AudioRecorder.messages.d.ts +32 -0
- package/dist/components/AudioRecorder.messages.d.ts.map +1 -0
- package/dist/components/AudioRecorder.styled.d.ts +7 -0
- package/dist/components/AudioRecorder.styled.d.ts.map +1 -0
- package/dist/components/IdleControl/IdleControl.d.ts +13 -0
- package/dist/components/IdleControl/IdleControl.d.ts.map +1 -0
- package/dist/{atoms/IdleControlAtom.styled.d.ts → components/IdleControl/IdleControl.styled.d.ts} +2 -2
- package/dist/components/IdleControl/IdleControl.styled.d.ts.map +1 -0
- package/dist/{atoms/RecordingShellAtom.d.ts → components/RecordingShell/RecordingShell.d.ts} +4 -4
- package/dist/components/RecordingShell/RecordingShell.d.ts.map +1 -0
- package/dist/{atoms/RecordingShellAtom.styled.d.ts → components/RecordingShell/RecordingShell.styled.d.ts} +2 -2
- package/dist/components/RecordingShell/RecordingShell.styled.d.ts.map +1 -0
- package/dist/components/VoiceMessagePlayer/VoiceMessagePlayer.d.ts +11 -0
- package/dist/components/VoiceMessagePlayer/VoiceMessagePlayer.d.ts.map +1 -0
- package/dist/components/VoiceMessagePlayer/VoiceMessagePlayer.styled.d.ts +13 -0
- package/dist/components/VoiceMessagePlayer/VoiceMessagePlayer.styled.d.ts.map +1 -0
- package/dist/components/VoiceRecorderInput/PreviewBars.d.ts +17 -0
- package/dist/components/VoiceRecorderInput/PreviewBars.d.ts.map +1 -0
- package/dist/components/VoiceRecorderInput/TimelineBars.d.ts +12 -0
- package/dist/components/VoiceRecorderInput/TimelineBars.d.ts.map +1 -0
- package/dist/components/VoiceRecorderInput/VoiceRecorderInput.d.ts +22 -0
- package/dist/components/VoiceRecorderInput/VoiceRecorderInput.d.ts.map +1 -0
- package/dist/components/VoiceRecorderInput/VoiceRecorderInput.styled.d.ts +18 -0
- package/dist/components/VoiceRecorderInput/VoiceRecorderInput.styled.d.ts.map +1 -0
- package/dist/{atoms/WaveformBarsAtom.d.ts → components/WaveformBars/WaveformBars.d.ts} +4 -4
- package/dist/components/WaveformBars/WaveformBars.d.ts.map +1 -0
- package/dist/constants.d.ts +5 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +12 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/useAudioBlobLoader.d.ts +23 -0
- package/dist/hooks/useAudioBlobLoader.d.ts.map +1 -0
- package/dist/hooks/useAudioPlayback.d.ts +19 -0
- package/dist/hooks/useAudioPlayback.d.ts.map +1 -0
- package/dist/hooks/useAudioRecorderHandlers.d.ts +22 -0
- package/dist/hooks/useAudioRecorderHandlers.d.ts.map +1 -0
- package/dist/hooks/useMediaRecorder.d.ts +18 -0
- package/dist/hooks/useMediaRecorder.d.ts.map +1 -0
- package/dist/hooks/useRecorderVisualization.d.ts +2 -0
- package/dist/hooks/useRecorderVisualization.d.ts.map +1 -1
- package/dist/hooks/useRecordingSender.d.ts +23 -0
- package/dist/hooks/useRecordingSender.d.ts.map +1 -0
- package/dist/hooks/useRecordingTiming.d.ts.map +1 -1
- package/dist/hooks/useVoiceMessagePlayer.d.ts +9 -0
- package/dist/hooks/useVoiceMessagePlayer.d.ts.map +1 -0
- package/dist/hooks/useVoiceRecorder.d.ts +0 -1
- package/dist/hooks/useVoiceRecorder.d.ts.map +1 -1
- package/dist/hooks/useVoiceRecorderInput.d.ts +31 -0
- package/dist/hooks/useVoiceRecorderInput.d.ts.map +1 -0
- package/dist/index.cjs +2074 -18071
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +19 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2067 -18073
- package/dist/index.js.map +1 -1
- package/dist/platform/animation-frame-adapter.d.ts +8 -0
- package/dist/platform/animation-frame-adapter.d.ts.map +1 -0
- package/dist/platform/audio-analyzer-adapter.d.ts +13 -0
- package/dist/platform/audio-analyzer-adapter.d.ts.map +1 -0
- package/dist/platform/audio-blob-fetcher.d.ts +7 -0
- package/dist/platform/audio-blob-fetcher.d.ts.map +1 -0
- package/dist/platform/audio-playback-adapter.d.ts +19 -0
- package/dist/platform/audio-playback-adapter.d.ts.map +1 -0
- package/dist/platform/audio-playback-manager.d.ts +14 -0
- package/dist/platform/audio-playback-manager.d.ts.map +1 -0
- package/dist/platform/index.d.ts +16 -0
- package/dist/platform/index.d.ts.map +1 -0
- package/dist/platform/media-recorder-adapter.d.ts +20 -0
- package/dist/platform/media-recorder-adapter.d.ts.map +1 -0
- package/dist/platform/microphone.d.ts +9 -0
- package/dist/platform/microphone.d.ts.map +1 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/{types.d.ts → types/recorder.d.ts} +34 -20
- package/dist/types/recorder.d.ts.map +1 -0
- package/dist/types/upload.d.ts +24 -0
- package/dist/types/upload.d.ts.map +1 -0
- package/dist/utils/format.d.ts +7 -0
- package/dist/utils/format.d.ts.map +1 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/math.d.ts +8 -0
- package/dist/utils/math.d.ts.map +1 -0
- package/dist/utils/voice-blob-cache.d.ts +20 -0
- package/dist/utils/voice-blob-cache.d.ts.map +1 -0
- package/dist/utils/voice-playback-chain.d.ts +20 -0
- package/dist/utils/voice-playback-chain.d.ts.map +1 -0
- package/package.json +5 -5
- package/dist/AudioRecorder.d.ts +0 -43
- package/dist/AudioRecorder.d.ts.map +0 -1
- package/dist/atoms/IdleControlAtom.d.ts +0 -13
- package/dist/atoms/IdleControlAtom.d.ts.map +0 -1
- package/dist/atoms/IdleControlAtom.styled.d.ts.map +0 -1
- package/dist/atoms/RecordingShellAtom.d.ts.map +0 -1
- package/dist/atoms/RecordingShellAtom.styled.d.ts.map +0 -1
- package/dist/atoms/WaveformBarsAtom.d.ts.map +0 -1
- package/dist/types.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -10,8 +10,11 @@
|
|
|
10
10
|
- встроенная визуализация уровней сигнала и предпросмотр записанного фрагмента;
|
|
11
11
|
- управление воспроизведением, паузой и повторным набором;
|
|
12
12
|
- адаптация текстов/aria-лейблов через проп `messages`;
|
|
13
|
-
- строгая типизация и SDK-подобный API (`uploader`, callbacks жизненного цикла)
|
|
14
|
-
-
|
|
13
|
+
- строгая типизация и SDK-подобный API (`uploader`, callbacks жизненного цикла);
|
|
14
|
+
- хук `useVoiceRecorder` для создания кастомного UI;
|
|
15
|
+
- компонент `VoiceMessagePlayer` с waveform-визуализацией и поддержкой последовательного воспроизведения;
|
|
16
|
+
- `VoiceBlobCache` для мгновенного воспроизведения только что отправленных сообщений;
|
|
17
|
+
- `VoicePlaybackChain` — автоматическое воспроизведение следующего голосового (как в Telegram).
|
|
15
18
|
|
|
16
19
|
### Установка
|
|
17
20
|
|
|
@@ -113,6 +116,83 @@ const MyCustomRecorder = () => {
|
|
|
113
116
|
`togglePlayback`, `stopPlayback`, `sendRecording`
|
|
114
117
|
- Утилиты: `formatTime`
|
|
115
118
|
|
|
119
|
+
#### `<VoiceMessagePlayer />`
|
|
120
|
+
|
|
121
|
+
Компонент воспроизведения голосовых сообщений с визуализацией waveform, поддержкой программного запуска через `ref`
|
|
122
|
+
и последовательного воспроизведения (chained playback).
|
|
123
|
+
|
|
124
|
+
```tsx
|
|
125
|
+
import { useRef } from 'react';
|
|
126
|
+
import { VoiceMessagePlayer, VoiceMessagePlayerRef } from '@exode-team/react-recorder';
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
const Messages = () => {
|
|
130
|
+
const ref = useRef<VoiceMessagePlayerRef>(null);
|
|
131
|
+
|
|
132
|
+
return (
|
|
133
|
+
<VoiceMessagePlayer ref={ref}
|
|
134
|
+
src="/audio/message.webm"
|
|
135
|
+
chainId={42}
|
|
136
|
+
duration={12.5}
|
|
137
|
+
onEnded={() => console.log('Playback ended')}/>
|
|
138
|
+
);
|
|
139
|
+
};
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
| Проп | Тип | Обязателен | По умолчанию | Описание |
|
|
143
|
+
|-----------------|--------------------------------|------------|--------------|---------------------------------------------------------------------------------------------|
|
|
144
|
+
| `src` | `string` | ✅ | — | URL аудиофайла. |
|
|
145
|
+
| `chainId` | `number` | — | — | ID для последовательного воспроизведения. При окончании автоматически запускает следующий. |
|
|
146
|
+
| `duration` | `number` | — | — | Длительность в секундах (отображается до загрузки аудио). |
|
|
147
|
+
| `waveformData` | `number[]` | — | — | Предварительно вычисленные уровни waveform. |
|
|
148
|
+
| `preloadedBlob` | `Blob \| null` | — | — | Blob для мгновенного воспроизведения без сетевого запроса. |
|
|
149
|
+
| `onEnded` | `() => void` | — | — | Колбэк окончания воспроизведения. |
|
|
150
|
+
| `className` | `string` | — | — | CSS-класс контейнера. |
|
|
151
|
+
| `onClick` | `(e: React.MouseEvent) => void`| — | — | Обработчик клика по контейнеру. |
|
|
152
|
+
|
|
153
|
+
**Ref API (`VoiceMessagePlayerRef`):**
|
|
154
|
+
|
|
155
|
+
- `play()` — программный запуск воспроизведения.
|
|
156
|
+
|
|
157
|
+
#### `VoicePlaybackChain`
|
|
158
|
+
|
|
159
|
+
Singleton-реестр для последовательного воспроизведения голосовых сообщений (как в Telegram).
|
|
160
|
+
Автоматически используется внутри `VoiceMessagePlayer` при передаче `chainId`, но доступен и напрямую.
|
|
161
|
+
|
|
162
|
+
```ts
|
|
163
|
+
import { VoicePlaybackChain } from '@exode-team/react-recorder';
|
|
164
|
+
|
|
165
|
+
// Регистрация плеера (возвращает cleanup для useEffect)
|
|
166
|
+
const cleanup = VoicePlaybackChain.register(42, () => play());
|
|
167
|
+
|
|
168
|
+
// Запуск следующего после текущего
|
|
169
|
+
VoicePlaybackChain.playNext(42);
|
|
170
|
+
|
|
171
|
+
// Удаление из цепочки
|
|
172
|
+
VoicePlaybackChain.unregister(42);
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
#### `VoiceBlobCache`
|
|
176
|
+
|
|
177
|
+
Кеш Blob-объектов голосовых сообщений для мгновенного воспроизведения только что отправленных записей
|
|
178
|
+
(до получения URL с сервера).
|
|
179
|
+
|
|
180
|
+
```ts
|
|
181
|
+
import { VoiceBlobCache } from '@exode-team/react-recorder';
|
|
182
|
+
|
|
183
|
+
// Сохранить blob при отправке
|
|
184
|
+
VoiceBlobCache.set(messageId, blob);
|
|
185
|
+
|
|
186
|
+
// Получить для воспроизведения
|
|
187
|
+
const blob = VoiceBlobCache.get(messageId);
|
|
188
|
+
|
|
189
|
+
// Перенести при получении серверного ID
|
|
190
|
+
VoiceBlobCache.transfer(optimisticId, serverId);
|
|
191
|
+
|
|
192
|
+
// Удалить при ошибке
|
|
193
|
+
VoiceBlobCache.delete(messageId);
|
|
194
|
+
```
|
|
195
|
+
|
|
116
196
|
### Типы
|
|
117
197
|
|
|
118
198
|
#### `StorageSpaceEnum`
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AudioRecorder
|
|
3
|
+
*
|
|
4
|
+
* @author: exode <hello@exode.ru>
|
|
5
|
+
*/
|
|
6
|
+
import { type RecorderMessagesInput } from './AudioRecorder.messages';
|
|
7
|
+
import { type StorageFileEntity, type StorageSpace, type UploadStrategy, type UseVoiceRecorderOptions } from '../types';
|
|
8
|
+
type RecorderOptionOverrides = Omit<UseVoiceRecorderOptions<Partial<StorageFileEntity>>, 'space' | 'uploadId' | 'onUploaded' | 'uploader'>;
|
|
9
|
+
interface Props extends Partial<RecorderOptionOverrides> {
|
|
10
|
+
uploader: UploadStrategy<Partial<StorageFileEntity>>;
|
|
11
|
+
messages?: RecorderMessagesInput;
|
|
12
|
+
uploadId?: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
space?: StorageSpace;
|
|
15
|
+
onUploadError?: (error: unknown) => void;
|
|
16
|
+
onUploaded?: (file: Partial<StorageFileEntity>) => void | Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
declare const AudioRecorder: (props: Props) => any;
|
|
19
|
+
export { AudioRecorder };
|
|
20
|
+
//# sourceMappingURL=AudioRecorder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AudioRecorder.d.ts","sourceRoot":"","sources":["../../src/components/AudioRecorder.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,OAAO,EAAiB,KAAK,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAErF,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAEjB,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAC/B,MAAM,UAAU,CAAC;AAGlB,KAAK,uBAAuB,GAAG,IAAI,CAC/B,uBAAuB,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,EACnD,OAAO,GAAG,UAAU,GAAG,YAAY,GAAG,UAAU,CACnD,CAAC;AAEF,UAAU,KAAM,SAAQ,OAAO,CAAC,uBAAuB,CAAC;IACpD,QAAQ,EAAE,cAAc,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACrD,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,iBAAiB,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3E;AAGD,QAAA,MAAM,aAAa,GAAI,OAAO,KAAK,QAyHlC,CAAC;AAGF,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AudioRecorder messages — i18n-ready message definitions and merge utility
|
|
3
|
+
*
|
|
4
|
+
* @author: exode <hello@exode.ru>
|
|
5
|
+
*/
|
|
6
|
+
export interface RecorderMessages {
|
|
7
|
+
buttons: {
|
|
8
|
+
send: string;
|
|
9
|
+
cancel: string;
|
|
10
|
+
};
|
|
11
|
+
instruction: string;
|
|
12
|
+
aria: {
|
|
13
|
+
startRecording: string;
|
|
14
|
+
stopRecording: string;
|
|
15
|
+
pauseRecording: string;
|
|
16
|
+
resumeRecording: string;
|
|
17
|
+
playRecording: string;
|
|
18
|
+
pausePlayback: string;
|
|
19
|
+
};
|
|
20
|
+
errors: {
|
|
21
|
+
loadFileFailed: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export type RecorderMessagesInput = Partial<{
|
|
25
|
+
buttons: Partial<RecorderMessages['buttons']>;
|
|
26
|
+
instruction: RecorderMessages['instruction'];
|
|
27
|
+
aria: Partial<RecorderMessages['aria']>;
|
|
28
|
+
errors: Partial<RecorderMessages['errors']>;
|
|
29
|
+
}>;
|
|
30
|
+
export declare const DEFAULT_MESSAGES: RecorderMessages;
|
|
31
|
+
export declare const mergeMessages: (custom?: RecorderMessagesInput) => RecorderMessages;
|
|
32
|
+
//# sourceMappingURL=AudioRecorder.messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AudioRecorder.messages.d.ts","sourceRoot":"","sources":["../../src/components/AudioRecorder.messages.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,MAAM,WAAW,gBAAgB;IAC7B,OAAO,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE;QACF,cAAc,EAAE,MAAM,CAAC;QACvB,aAAa,EAAE,MAAM,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC;QACvB,eAAe,EAAE,MAAM,CAAC;QACxB,aAAa,EAAE,MAAM,CAAC;QACtB,aAAa,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,MAAM,EAAE;QACJ,cAAc,EAAE,MAAM,CAAC;KAC1B,CAAC;CACL;AAED,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC;IACxC,OAAO,EAAE,OAAO,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9C,WAAW,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC;IAC7C,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;IACxC,MAAM,EAAE,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;CAC/C,CAAC,CAAC;AAEH,eAAO,MAAM,gBAAgB,EAAE,gBAiB9B,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,SAAS,qBAAqB,KAAG,gBAoB9D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AudioRecorder.styled.d.ts","sourceRoot":"","sources":["../../src/components/AudioRecorder.styled.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,eAAO,MAAM,SAAS,KAMrB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IdleControl
|
|
3
|
+
*
|
|
4
|
+
* @author: exode <hello@exode.ru>
|
|
5
|
+
*/
|
|
6
|
+
interface Props {
|
|
7
|
+
onClick: () => void;
|
|
8
|
+
instruction: string;
|
|
9
|
+
startAriaLabel: string;
|
|
10
|
+
}
|
|
11
|
+
declare const IdleControl: (props: Props) => any;
|
|
12
|
+
export { IdleControl };
|
|
13
|
+
//# sourceMappingURL=IdleControl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdleControl.d.ts","sourceRoot":"","sources":["../../../src/components/IdleControl/IdleControl.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,UAAU,KAAK;IACX,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;CAC1B;AAGD,QAAA,MAAM,WAAW,GAAI,OAAO,KAAK,QAsBhC,CAAC;AAGF,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
package/dist/{atoms/IdleControlAtom.styled.d.ts → components/IdleControl/IdleControl.styled.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* IdleControl styles
|
|
3
3
|
*
|
|
4
4
|
* @author: exode <hello@exode.ru>
|
|
5
5
|
*/
|
|
@@ -8,4 +8,4 @@ export declare const IdleButton: any;
|
|
|
8
8
|
export declare const IdleButtonOutline: any;
|
|
9
9
|
export declare const IdleButtonGlow: any;
|
|
10
10
|
export declare const IdleInstruction: any;
|
|
11
|
-
//# sourceMappingURL=
|
|
11
|
+
//# sourceMappingURL=IdleControl.styled.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdleControl.styled.d.ts","sourceRoot":"","sources":["../../../src/components/IdleControl/IdleControl.styled.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,eAAO,MAAM,WAAW,KAKvB,CAAC;AAEF,eAAO,MAAM,UAAU,KA0BtB,CAAC;AAEF,eAAO,MAAM,iBAAiB,KAM7B,CAAC;AAEF,eAAO,MAAM,cAAc,KAY1B,CAAC;AAEF,eAAO,MAAM,eAAe,KAI3B,CAAC"}
|
package/dist/{atoms/RecordingShellAtom.d.ts → components/RecordingShell/RecordingShell.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* RecordingShell
|
|
3
3
|
*
|
|
4
4
|
* @author: exode <hello@exode.ru>
|
|
5
5
|
*/
|
|
@@ -28,6 +28,6 @@ interface Props {
|
|
|
28
28
|
onTogglePlayback: () => void;
|
|
29
29
|
formatTime: (seconds: number) => string;
|
|
30
30
|
}
|
|
31
|
-
declare const
|
|
32
|
-
export {
|
|
33
|
-
//# sourceMappingURL=
|
|
31
|
+
declare const RecordingShell: (props: Props) => any;
|
|
32
|
+
export { RecordingShell };
|
|
33
|
+
//# sourceMappingURL=RecordingShell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecordingShell.d.ts","sourceRoot":"","sources":["../../../src/components/RecordingShell/RecordingShell.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AA4BH,UAAU,KAAK;IACX,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,uBAAuB,EAAE,MAAM,CAAC;IAChC,wBAAwB,EAAE,MAAM,CAAC;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;CAC3C;AAGD,QAAA,MAAM,cAAc,GAAI,OAAO,KAAK,QAyHnC,CAAC;AAGF,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* RecordingShell styles
|
|
3
3
|
*
|
|
4
4
|
* @author: exode <hello@exode.ru>
|
|
5
5
|
*/
|
|
@@ -14,4 +14,4 @@ export declare const Timer: any;
|
|
|
14
14
|
export declare const SendButton: any;
|
|
15
15
|
export declare const SpinnerSlot: any;
|
|
16
16
|
export declare const Spinner: any;
|
|
17
|
-
//# sourceMappingURL=
|
|
17
|
+
//# sourceMappingURL=RecordingShell.styled.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecordingShell.styled.d.ts","sourceRoot":"","sources":["../../../src/components/RecordingShell/RecordingShell.styled.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,eAAO,MAAM,OAAO,KAQnB,CAAC;AAEF,eAAO,MAAM,YAAY,KAqBxB,CAAC;AAEF,eAAO,MAAM,KAAK,KAQjB,CAAC;AAEF,eAAO,MAAM,YAAY,KA2CxB,CAAC;AAEF,eAAO,MAAM,QAAQ,KAOpB,CAAC;AAEF,eAAO,MAAM,IAAI,KAMhB,CAAC;AAEF,eAAO,MAAM,GAAG,KAOf,CAAC;AAEF,eAAO,MAAM,KAAK,KAKjB,CAAC;AAEF,eAAO,MAAM,UAAU,KAyBtB,CAAC;AAEF,eAAO,MAAM,WAAW,KAMvB,CAAC;AAEF,eAAO,MAAM,OAAO,KAoBnB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VoiceMessagePlayer
|
|
3
|
+
*
|
|
4
|
+
* @author: exode <hello@exode.ru>
|
|
5
|
+
*/
|
|
6
|
+
export interface VoiceMessagePlayerRef {
|
|
7
|
+
play: () => void;
|
|
8
|
+
}
|
|
9
|
+
declare const VoiceMessagePlayer: any;
|
|
10
|
+
export { VoiceMessagePlayer };
|
|
11
|
+
//# sourceMappingURL=VoiceMessagePlayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoiceMessagePlayer.d.ts","sourceRoot":"","sources":["../../../src/components/VoiceMessagePlayer/VoiceMessagePlayer.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AA0BH,MAAM,WAAW,qBAAqB;IAClC,IAAI,EAAE,MAAM,IAAI,CAAC;CACpB;AAcD,QAAA,MAAM,kBAAkB,KAmJtB,CAAC;AAGH,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VoiceMessagePlayer styles
|
|
3
|
+
*
|
|
4
|
+
* @author: exode <hello@exode.ru>
|
|
5
|
+
*/
|
|
6
|
+
export declare const PlayerWrapper: any;
|
|
7
|
+
export declare const PlayButton: any;
|
|
8
|
+
export declare const ContentColumn: any;
|
|
9
|
+
export declare const WaveformTrack: any;
|
|
10
|
+
export declare const WaveformBar: any;
|
|
11
|
+
export declare const Duration: any;
|
|
12
|
+
export declare const LoadingSpinner: any;
|
|
13
|
+
//# sourceMappingURL=VoiceMessagePlayer.styled.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoiceMessagePlayer.styled.d.ts","sourceRoot":"","sources":["../../../src/components/VoiceMessagePlayer/VoiceMessagePlayer.styled.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,eAAO,MAAM,aAAa,KAOzB,CAAC;AAEF,eAAO,MAAM,UAAU,KA8BtB,CAAC;AAEF,eAAO,MAAM,aAAa,KAMzB,CAAC;AAEF,eAAO,MAAM,aAAa,KAQzB,CAAC;AAEF,eAAO,MAAM,WAAW,KAKvB,CAAC;AAEF,eAAO,MAAM,QAAQ,KAMpB,CAAC;AAEF,eAAO,MAAM,cAAc,KAa1B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PreviewBars — renders waveform bars in preview mode (paused/stopped)
|
|
3
|
+
*
|
|
4
|
+
* @author: exode <hello@exode.ru>
|
|
5
|
+
*/
|
|
6
|
+
interface PreviewBarsProps {
|
|
7
|
+
isPlaying: boolean;
|
|
8
|
+
playbackTime: number;
|
|
9
|
+
lastDuration: number;
|
|
10
|
+
recordingTime: number;
|
|
11
|
+
previewLevels: number[];
|
|
12
|
+
timelineLevels: number[];
|
|
13
|
+
getVisibleBarsCount: () => number;
|
|
14
|
+
}
|
|
15
|
+
declare const PreviewBars: (props: PreviewBarsProps) => any;
|
|
16
|
+
export { PreviewBars };
|
|
17
|
+
//# sourceMappingURL=PreviewBars.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreviewBars.d.ts","sourceRoot":"","sources":["../../../src/components/VoiceRecorderInput/PreviewBars.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,UAAU,gBAAgB;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,mBAAmB,EAAE,MAAM,MAAM,CAAC;CACrC;AAGD,QAAA,MAAM,WAAW,GAAI,OAAO,gBAAgB,QA0E3C,CAAC;AAGF,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TimelineBars — renders waveform bars during active recording
|
|
3
|
+
*
|
|
4
|
+
* @author: exode <hello@exode.ru>
|
|
5
|
+
*/
|
|
6
|
+
interface TimelineBarsProps {
|
|
7
|
+
timelineLevels: number[];
|
|
8
|
+
getVisibleBarsCount: () => number;
|
|
9
|
+
}
|
|
10
|
+
declare const TimelineBars: (props: TimelineBarsProps) => any;
|
|
11
|
+
export { TimelineBars };
|
|
12
|
+
//# sourceMappingURL=TimelineBars.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimelineBars.d.ts","sourceRoot":"","sources":["../../../src/components/VoiceRecorderInput/TimelineBars.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,UAAU,iBAAiB;IACvB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,mBAAmB,EAAE,MAAM,MAAM,CAAC;CACrC;AAGD,QAAA,MAAM,YAAY,GAAI,OAAO,iBAAiB,QAkC7C,CAAC;AAGF,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VoiceRecorderInput
|
|
3
|
+
*
|
|
4
|
+
* @author: exode <hello@exode.ru>
|
|
5
|
+
*/
|
|
6
|
+
import { type StorageSpace, type UploadStrategy } from '../../types';
|
|
7
|
+
interface Props {
|
|
8
|
+
uploader?: UploadStrategy<unknown>;
|
|
9
|
+
onUploaded?: (file: unknown) => void | Promise<void>;
|
|
10
|
+
onCancel?: () => void;
|
|
11
|
+
onSend?: (file: File, duration: number) => void | Promise<void>;
|
|
12
|
+
onError?: (error: unknown) => void;
|
|
13
|
+
onPermissionDenied?: (error: unknown) => void;
|
|
14
|
+
autoStart?: boolean;
|
|
15
|
+
mimeType?: string;
|
|
16
|
+
fileName?: string;
|
|
17
|
+
space?: StorageSpace;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
declare const VoiceRecorderInput: (props: Props) => any;
|
|
21
|
+
export { VoiceRecorderInput };
|
|
22
|
+
//# sourceMappingURL=VoiceRecorderInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoiceRecorderInput.d.ts","sourceRoot":"","sources":["../../../src/components/VoiceRecorderInput/VoiceRecorderInput.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAaH,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAuBrE,UAAU,KAAK;IACX,QAAQ,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IACnC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAGD,QAAA,MAAM,kBAAkB,GAAI,OAAO,KAAK,QAsGvC,CAAC;AAGF,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VoiceRecorderInput styles
|
|
3
|
+
*
|
|
4
|
+
* @author: exode <hello@exode.ru>
|
|
5
|
+
*/
|
|
6
|
+
export declare const Wrapper: any;
|
|
7
|
+
export declare const CancelButton: any;
|
|
8
|
+
export declare const RecordTrack: any;
|
|
9
|
+
/** Container for control buttons — auto-sized, no fixed width */
|
|
10
|
+
export declare const ButtonSlot: any;
|
|
11
|
+
export declare const StopButton: any;
|
|
12
|
+
export declare const WaveformArea: any;
|
|
13
|
+
export declare const Timer: any;
|
|
14
|
+
export declare const SendButton: any;
|
|
15
|
+
export declare const MicIndicator: any;
|
|
16
|
+
export declare const PlayPauseButton: any;
|
|
17
|
+
export declare const SpinnerIcon: any;
|
|
18
|
+
//# sourceMappingURL=VoiceRecorderInput.styled.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoiceRecorderInput.styled.d.ts","sourceRoot":"","sources":["../../../src/components/VoiceRecorderInput/VoiceRecorderInput.styled.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,eAAO,MAAM,OAAO,KAOnB,CAAC;AAEF,eAAO,MAAM,YAAY,KAkBxB,CAAC;AAEF,eAAO,MAAM,WAAW,KASvB,CAAC;AAEF,iEAAiE;AACjE,eAAO,MAAM,UAAU,KAKtB,CAAC;AAEF,eAAO,MAAM,UAAU,KA0BtB,CAAC;AAEF,eAAO,MAAM,YAAY,KAUxB,CAAC;AAEF,eAAO,MAAM,KAAK,KAMjB,CAAC;AAEF,eAAO,MAAM,UAAU,KAuBtB,CAAC;AAEF,eAAO,MAAM,YAAY,KAqBxB,CAAC;AAEF,eAAO,MAAM,eAAe,KAqB3B,CAAC;AAEF,eAAO,MAAM,WAAW,KAcvB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* WaveformBars
|
|
3
3
|
*
|
|
4
4
|
* @author: exode <hello@exode.ru>
|
|
5
5
|
*/
|
|
@@ -15,6 +15,6 @@ interface Props {
|
|
|
15
15
|
index: number;
|
|
16
16
|
}) => React.CSSProperties;
|
|
17
17
|
}
|
|
18
|
-
declare const
|
|
19
|
-
export {
|
|
20
|
-
//# sourceMappingURL=
|
|
18
|
+
declare const WaveformBars: (props: Props) => any;
|
|
19
|
+
export { WaveformBars };
|
|
20
|
+
//# sourceMappingURL=WaveformBars.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WaveformBars.d.ts","sourceRoot":"","sources":["../../../src/components/WaveformBars/WaveformBars.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,UAAU,KAAK;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE;QAC1B,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACjB,KAAK,KAAK,CAAC,aAAa,CAAC;CAC7B;AAGD,QAAA,MAAM,YAAY,GAAI,OAAO,KAAK,QA0BjC,CAAC;AAGF,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -5,4 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export declare const AUDIO_LEVEL_BARS = 40;
|
|
7
7
|
export declare const createInitialLevels: () => number[];
|
|
8
|
+
export declare const TIMELINE_SAMPLE_INTERVAL = 150;
|
|
9
|
+
export declare const TIMELINE_BAR_WIDTH = 3;
|
|
10
|
+
export declare const TIMELINE_BAR_GAP = 2;
|
|
11
|
+
export declare const TIMELINE_BAR_MIN_HEIGHT = 3;
|
|
12
|
+
export declare const TIMELINE_BAR_MAX_HEIGHT = 24;
|
|
8
13
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,eAAO,MAAM,mBAAmB,QAAO,MAAM,EAAuD,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,eAAO,MAAM,mBAAmB,QAAO,MAAM,EAAuD,CAAC;AAErG,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAC5C,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,uBAAuB,IAAI,CAAC;AACzC,eAAO,MAAM,uBAAuB,KAAK,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hooks barrel
|
|
3
|
+
*
|
|
4
|
+
* @author: exode <hello@exode.ru>
|
|
5
|
+
*/
|
|
6
|
+
export { useVoiceRecorder } from './useVoiceRecorder';
|
|
7
|
+
export { useRecorderVisualization } from './useRecorderVisualization';
|
|
8
|
+
export { useRecordingTiming } from './useRecordingTiming';
|
|
9
|
+
export { useAudioBlobLoader } from './useAudioBlobLoader';
|
|
10
|
+
export { useRecordingSender } from './useRecordingSender';
|
|
11
|
+
export { useVoiceMessagePlayer } from './useVoiceMessagePlayer';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useAudioBlobLoader — loads audio blob from URL or preloaded data,
|
|
3
|
+
* creates object URL and decodes waveform levels.
|
|
4
|
+
*
|
|
5
|
+
* @author: exode <hello@exode.ru>
|
|
6
|
+
*/
|
|
7
|
+
import type { PlaybackCallbacks } from '../platform';
|
|
8
|
+
interface UseAudioBlobLoaderOptions {
|
|
9
|
+
src: string;
|
|
10
|
+
waveformData?: number[];
|
|
11
|
+
preloadedBlob?: Blob | null;
|
|
12
|
+
playbackCallbacks: PlaybackCallbacks;
|
|
13
|
+
}
|
|
14
|
+
interface UseAudioBlobLoaderResult {
|
|
15
|
+
audioRef: React.MutableRefObject<HTMLAudioElement | null>;
|
|
16
|
+
isLoading: boolean;
|
|
17
|
+
isLoaded: boolean;
|
|
18
|
+
waveformLevels: number[];
|
|
19
|
+
ensureAudioLoaded: () => Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
declare const useAudioBlobLoader: (options: UseAudioBlobLoaderOptions) => UseAudioBlobLoaderResult;
|
|
22
|
+
export { useAudioBlobLoader };
|
|
23
|
+
//# sourceMappingURL=useAudioBlobLoader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAudioBlobLoader.d.ts","sourceRoot":"","sources":["../../src/hooks/useAudioBlobLoader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAYrD,UAAU,yBAAyB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC5B,iBAAiB,EAAE,iBAAiB,CAAC;CACxC;AAED,UAAU,wBAAwB;IAC9B,QAAQ,EAAE,KAAK,CAAC,gBAAgB,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAC1D,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,iBAAiB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1C;AAED,QAAA,MAAM,kBAAkB,GAAI,SAAS,yBAAyB,KAAG,wBAgIhE,CAAC;AAGF,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useAudioPlayback
|
|
3
|
+
*
|
|
4
|
+
* @author: exode <hello@exode.ru>
|
|
5
|
+
*/
|
|
6
|
+
interface UseAudioPlaybackResult {
|
|
7
|
+
audioURL: string | null;
|
|
8
|
+
isPlaying: boolean;
|
|
9
|
+
playbackTime: number;
|
|
10
|
+
playbackDuration: number;
|
|
11
|
+
mountBlob: (blob: Blob) => string;
|
|
12
|
+
togglePlayback: (onError?: (error: unknown) => void) => void;
|
|
13
|
+
stopPlayback: () => void;
|
|
14
|
+
resetPlayback: () => void;
|
|
15
|
+
cleanupAudioElement: () => void;
|
|
16
|
+
}
|
|
17
|
+
declare const useAudioPlayback: () => UseAudioPlaybackResult;
|
|
18
|
+
export { useAudioPlayback };
|
|
19
|
+
//# sourceMappingURL=useAudioPlayback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAudioPlayback.d.ts","sourceRoot":"","sources":["../../src/hooks/useAudioPlayback.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,UAAU,sBAAsB;IAC5B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC;IAClC,cAAc,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,KAAK,IAAI,CAAC;IAC7D,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,mBAAmB,EAAE,MAAM,IAAI,CAAC;CACnC;AAED,QAAA,MAAM,gBAAgB,QAAO,sBA2H5B,CAAC;AAGF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useAudioRecorderHandlers — recording/send/cancel handlers for AudioRecorder
|
|
3
|
+
*
|
|
4
|
+
* @author: exode <hello@exode.ru>
|
|
5
|
+
*/
|
|
6
|
+
import type { UseVoiceRecorderResult } from '../types';
|
|
7
|
+
import type { RecorderMessages } from '../components/AudioRecorder.messages';
|
|
8
|
+
interface UseAudioRecorderHandlersOptions {
|
|
9
|
+
vibrate: (pattern: number | number[]) => void;
|
|
10
|
+
messages: RecorderMessages;
|
|
11
|
+
recorder: UseVoiceRecorderResult;
|
|
12
|
+
onUploadError?: (error: unknown) => void;
|
|
13
|
+
}
|
|
14
|
+
declare const useAudioRecorderHandlers: (options: UseAudioRecorderHandlersOptions) => {
|
|
15
|
+
isSending: any;
|
|
16
|
+
handleCancel: any;
|
|
17
|
+
handleSendRequest: any;
|
|
18
|
+
handleRecordToggle: any;
|
|
19
|
+
handlePlaybackToggle: any;
|
|
20
|
+
};
|
|
21
|
+
export { useAudioRecorderHandlers };
|
|
22
|
+
//# sourceMappingURL=useAudioRecorderHandlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAudioRecorderHandlers.d.ts","sourceRoot":"","sources":["../../src/hooks/useAudioRecorderHandlers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAG7E,UAAU,+BAA+B;IACrC,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC;IAC9C,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,QAAQ,EAAE,sBAAsB,CAAC;IACjC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5C;AAGD,QAAA,MAAM,wBAAwB,GAAI,SAAS,+BAA+B;;;;;;CA2KzE,CAAC;AAGF,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useMediaRecorder
|
|
3
|
+
*
|
|
4
|
+
* @author: exode <hello@exode.ru>
|
|
5
|
+
*/
|
|
6
|
+
import type { MediaRecorderCallbacks } from '../types';
|
|
7
|
+
interface UseMediaRecorderResult {
|
|
8
|
+
isRecording: boolean;
|
|
9
|
+
isPaused: boolean;
|
|
10
|
+
startRecording: (mimeType: string) => Promise<void>;
|
|
11
|
+
stopRecording: () => void;
|
|
12
|
+
cancelRecording: () => void;
|
|
13
|
+
togglePause: () => void;
|
|
14
|
+
cleanupStream: () => void;
|
|
15
|
+
}
|
|
16
|
+
declare const useMediaRecorder: (callbacks: MediaRecorderCallbacks) => UseMediaRecorderResult;
|
|
17
|
+
export { useMediaRecorder };
|
|
18
|
+
//# sourceMappingURL=useMediaRecorder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMediaRecorder.d.ts","sourceRoot":"","sources":["../../src/hooks/useMediaRecorder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAGvD,UAAU,sBAAsB;IAC5B,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,aAAa,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED,QAAA,MAAM,gBAAgB,GAAI,WAAW,sBAAsB,KAAG,sBAkI7D,CAAC;AAGF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -8,11 +8,13 @@ interface UseRecorderVisualizationResult {
|
|
|
8
8
|
previewLevels: number[];
|
|
9
9
|
resetAudioLevels: () => void;
|
|
10
10
|
resetPreviewLevels: () => void;
|
|
11
|
+
resumeVisualization: () => void;
|
|
11
12
|
cleanupVisualization: () => void;
|
|
12
13
|
generatePreviewLevels: (blob: Blob) => Promise<void>;
|
|
13
14
|
initializeVisualization: (stream: MediaStream) => void;
|
|
14
15
|
stopVisualization: (options?: {
|
|
15
16
|
resetLevels?: boolean;
|
|
17
|
+
closeContext?: boolean;
|
|
16
18
|
}) => void;
|
|
17
19
|
}
|
|
18
20
|
declare const useRecorderVisualization: () => UseRecorderVisualizationResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRecorderVisualization.d.ts","sourceRoot":"","sources":["../../src/hooks/useRecorderVisualization.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"useRecorderVisualization.d.ts","sourceRoot":"","sources":["../../src/hooks/useRecorderVisualization.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,UAAU,8BAA8B;IACpC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC,qBAAqB,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD,uBAAuB,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IACvD,iBAAiB,EAAE,CAAC,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,OAAO,CAAC;QAAC,YAAY,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;CAC5F;AAGD,QAAA,MAAM,wBAAwB,QAAO,8BAyGpC,CAAC;AAGF,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useRecordingSender — handles sending a recorded voice message via an upload strategy.
|
|
3
|
+
*
|
|
4
|
+
* @author: exode <hello@exode.ru>
|
|
5
|
+
*/
|
|
6
|
+
import type { StorageSpace, UploadStrategy } from '../types';
|
|
7
|
+
interface UseRecordingSenderOptions<TFile> {
|
|
8
|
+
fileName: string;
|
|
9
|
+
mimeType: string;
|
|
10
|
+
audioBlob: Blob | null;
|
|
11
|
+
space: StorageSpace;
|
|
12
|
+
uploadId: string;
|
|
13
|
+
uploader?: UploadStrategy<TFile>;
|
|
14
|
+
onUploaded: (file: TFile) => void | Promise<void>;
|
|
15
|
+
deleteRecording: () => void;
|
|
16
|
+
autoResetAfterUpload: boolean;
|
|
17
|
+
onRecordingError?: (error: unknown) => void;
|
|
18
|
+
}
|
|
19
|
+
declare const useRecordingSender: <TFile = unknown>(options: UseRecordingSenderOptions<TFile>) => {
|
|
20
|
+
sendRecording: any;
|
|
21
|
+
};
|
|
22
|
+
export { useRecordingSender };
|
|
23
|
+
//# sourceMappingURL=useRecordingSender.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRecordingSender.d.ts","sourceRoot":"","sources":["../../src/hooks/useRecordingSender.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG7D,UAAU,yBAAyB,CAAC,KAAK;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,YAAY,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC;IACjC,UAAU,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/C;AAGD,QAAA,MAAM,kBAAkB,GAAI,KAAK,GAAG,OAAO,EAAE,SAAS,yBAAyB,CAAC,KAAK,CAAC;;CA4DrF,CAAC;AAGF,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRecordingTiming.d.ts","sourceRoot":"","sources":["../../src/hooks/useRecordingTiming.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,UAAU,wBAAwB;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,eAAe,EAAE,MAAM,IAAI,CAAC;CAC/B;
|
|
1
|
+
{"version":3,"file":"useRecordingTiming.d.ts","sourceRoot":"","sources":["../../src/hooks/useRecordingTiming.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,UAAU,wBAAwB;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,eAAe,EAAE,MAAM,IAAI,CAAC;CAC/B;AAED,QAAA,MAAM,kBAAkB,QAAO,wBAgF9B,CAAC;AAGF,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useVoiceMessagePlayer
|
|
3
|
+
*
|
|
4
|
+
* @author: exode <hello@exode.ru>
|
|
5
|
+
*/
|
|
6
|
+
import type { UseVoiceMessagePlayerOptions, UseVoiceMessagePlayerResult } from '../types';
|
|
7
|
+
declare const useVoiceMessagePlayer: (options: UseVoiceMessagePlayerOptions) => UseVoiceMessagePlayerResult;
|
|
8
|
+
export { useVoiceMessagePlayer };
|
|
9
|
+
//# sourceMappingURL=useVoiceMessagePlayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useVoiceMessagePlayer.d.ts","sourceRoot":"","sources":["../../src/hooks/useVoiceMessagePlayer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,KAAK,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAG1F,QAAA,MAAM,qBAAqB,GAAI,SAAS,4BAA4B,KAAG,2BAmJtE,CAAC;AAGF,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* @author: exode <hello@exode.ru>
|
|
5
5
|
*/
|
|
6
6
|
import type { UseVoiceRecorderOptions, UseVoiceRecorderResult } from '../types';
|
|
7
|
-
export declare const clampValue: (value: number, lowerBound?: number, upperBound?: number) => number;
|
|
8
7
|
declare function useVoiceRecorder<TFile = unknown>(props: UseVoiceRecorderOptions<TFile>): UseVoiceRecorderResult;
|
|
9
8
|
export { useVoiceRecorder };
|
|
10
9
|
//# sourceMappingURL=useVoiceRecorder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useVoiceRecorder.d.ts","sourceRoot":"","sources":["../../src/hooks/useVoiceRecorder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"useVoiceRecorder.d.ts","sourceRoot":"","sources":["../../src/hooks/useVoiceRecorder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,OAAO,KAAK,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAGhF,iBAAS,gBAAgB,CAAC,KAAK,GAAG,OAAO,EAAE,KAAK,EAAE,uBAAuB,CAAC,KAAK,CAAC,GAAG,sBAAsB,CAyMxG;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|