@exode-team/react-recorder 1.0.3 → 1.1.0

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.
Files changed (74) hide show
  1. package/dist/{AudioRecorder.d.ts → components/AudioRecorder.d.ts} +1 -1
  2. package/dist/components/AudioRecorder.d.ts.map +1 -0
  3. package/dist/components/IdleControl/IdleControl.d.ts +13 -0
  4. package/dist/components/IdleControl/IdleControl.d.ts.map +1 -0
  5. package/dist/{atoms/IdleControlAtom.styled.d.ts → components/IdleControl/IdleControl.styled.d.ts} +2 -2
  6. package/dist/components/IdleControl/IdleControl.styled.d.ts.map +1 -0
  7. package/dist/{atoms/RecordingShellAtom.d.ts → components/RecordingShell/RecordingShell.d.ts} +4 -4
  8. package/dist/components/RecordingShell/RecordingShell.d.ts.map +1 -0
  9. package/dist/{atoms/RecordingShellAtom.styled.d.ts → components/RecordingShell/RecordingShell.styled.d.ts} +2 -2
  10. package/dist/components/RecordingShell/RecordingShell.styled.d.ts.map +1 -0
  11. package/dist/components/VoiceMessagePlayer/VoiceMessagePlayer.d.ts +16 -0
  12. package/dist/components/VoiceMessagePlayer/VoiceMessagePlayer.d.ts.map +1 -0
  13. package/dist/components/VoiceMessagePlayer/VoiceMessagePlayer.styled.d.ts +13 -0
  14. package/dist/components/VoiceMessagePlayer/VoiceMessagePlayer.styled.d.ts.map +1 -0
  15. package/dist/components/VoiceRecorderInput/VoiceRecorderInput.d.ts +22 -0
  16. package/dist/components/VoiceRecorderInput/VoiceRecorderInput.d.ts.map +1 -0
  17. package/dist/components/VoiceRecorderInput/VoiceRecorderInput.styled.d.ts +18 -0
  18. package/dist/components/VoiceRecorderInput/VoiceRecorderInput.styled.d.ts.map +1 -0
  19. package/dist/{atoms/WaveformBarsAtom.d.ts → components/WaveformBars/WaveformBars.d.ts} +4 -4
  20. package/dist/components/WaveformBars/WaveformBars.d.ts.map +1 -0
  21. package/dist/hooks/index.d.ts +9 -0
  22. package/dist/hooks/index.d.ts.map +1 -0
  23. package/dist/hooks/useAudioPlayback.d.ts +19 -0
  24. package/dist/hooks/useAudioPlayback.d.ts.map +1 -0
  25. package/dist/hooks/useMediaRecorder.d.ts +27 -0
  26. package/dist/hooks/useMediaRecorder.d.ts.map +1 -0
  27. package/dist/hooks/useRecorderVisualization.d.ts +2 -0
  28. package/dist/hooks/useRecorderVisualization.d.ts.map +1 -1
  29. package/dist/hooks/useRecordingTiming.d.ts.map +1 -1
  30. package/dist/hooks/useVoiceMessagePlayer.d.ts +26 -0
  31. package/dist/hooks/useVoiceMessagePlayer.d.ts.map +1 -0
  32. package/dist/hooks/useVoiceRecorder.d.ts +0 -1
  33. package/dist/hooks/useVoiceRecorder.d.ts.map +1 -1
  34. package/dist/index.cjs +1328 -17616
  35. package/dist/index.cjs.map +1 -1
  36. package/dist/index.d.ts +17 -3
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +1324 -17620
  39. package/dist/index.js.map +1 -1
  40. package/dist/platform/animation-frame-adapter.d.ts +8 -0
  41. package/dist/platform/animation-frame-adapter.d.ts.map +1 -0
  42. package/dist/platform/audio-analyzer-adapter.d.ts +13 -0
  43. package/dist/platform/audio-analyzer-adapter.d.ts.map +1 -0
  44. package/dist/platform/audio-playback-adapter.d.ts +19 -0
  45. package/dist/platform/audio-playback-adapter.d.ts.map +1 -0
  46. package/dist/platform/audio-playback-manager.d.ts +14 -0
  47. package/dist/platform/audio-playback-manager.d.ts.map +1 -0
  48. package/dist/platform/index.d.ts +15 -0
  49. package/dist/platform/index.d.ts.map +1 -0
  50. package/dist/platform/media-recorder-adapter.d.ts +20 -0
  51. package/dist/platform/media-recorder-adapter.d.ts.map +1 -0
  52. package/dist/platform/microphone.d.ts +9 -0
  53. package/dist/platform/microphone.d.ts.map +1 -0
  54. package/dist/types/index.d.ts +9 -0
  55. package/dist/types/index.d.ts.map +1 -0
  56. package/dist/{types.d.ts → types/recorder.d.ts} +3 -20
  57. package/dist/types/recorder.d.ts.map +1 -0
  58. package/dist/types/upload.d.ts +24 -0
  59. package/dist/types/upload.d.ts.map +1 -0
  60. package/dist/utils/format.d.ts +7 -0
  61. package/dist/utils/format.d.ts.map +1 -0
  62. package/dist/utils/index.d.ts +8 -0
  63. package/dist/utils/index.d.ts.map +1 -0
  64. package/dist/utils/math.d.ts +8 -0
  65. package/dist/utils/math.d.ts.map +1 -0
  66. package/package.json +5 -5
  67. package/dist/AudioRecorder.d.ts.map +0 -1
  68. package/dist/atoms/IdleControlAtom.d.ts +0 -13
  69. package/dist/atoms/IdleControlAtom.d.ts.map +0 -1
  70. package/dist/atoms/IdleControlAtom.styled.d.ts.map +0 -1
  71. package/dist/atoms/RecordingShellAtom.d.ts.map +0 -1
  72. package/dist/atoms/RecordingShellAtom.styled.d.ts.map +0 -1
  73. package/dist/atoms/WaveformBarsAtom.d.ts.map +0 -1
  74. package/dist/types.d.ts.map +0 -1
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Animation frame platform adapter
3
+ *
4
+ * @author: exode <hello@exode.ru>
5
+ */
6
+ export declare const scheduleFrame: (callback: FrameRequestCallback) => number;
7
+ export declare const cancelFrame: (id: number) => void;
8
+ //# sourceMappingURL=animation-frame-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animation-frame-adapter.d.ts","sourceRoot":"","sources":["../../src/platform/animation-frame-adapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,eAAO,MAAM,aAAa,GAAI,UAAU,oBAAoB,KAAG,MAE9D,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,IAAI,MAAM,KAAG,IAExC,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Audio analyzer platform adapter
3
+ *
4
+ * @author: exode <hello@exode.ru>
5
+ */
6
+ export interface StreamAnalyzer {
7
+ context: AudioContext;
8
+ analyser: AnalyserNode;
9
+ }
10
+ export declare const createStreamAnalyzer: (stream: MediaStream) => StreamAnalyzer;
11
+ export declare const readFrequencyLevels: (analyser: AnalyserNode, barCount?: number) => number[];
12
+ export declare const decodeAudioLevels: (blob: Blob, barCount?: number) => Promise<number[]>;
13
+ //# sourceMappingURL=audio-analyzer-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audio-analyzer-adapter.d.ts","sourceRoot":"","sources":["../../src/platform/audio-analyzer-adapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,WAAW,cAAc;IAC3B,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,YAAY,CAAC;CAC1B;AAED,eAAO,MAAM,oBAAoB,GAAI,QAAQ,WAAW,KAAG,cAS1D,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,UAAU,YAAY,EAAE,WAAU,MAAyB,KAAG,MAAM,EAevG,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC1B,MAAM,IAAI,EACV,WAAU,MAAyB,KACpC,OAAO,CAAC,MAAM,EAAE,CAkClB,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Audio playback platform adapter
3
+ *
4
+ * @author: exode <hello@exode.ru>
5
+ */
6
+ export interface AudioPlayback {
7
+ audio: HTMLAudioElement;
8
+ url: string;
9
+ }
10
+ export interface PlaybackCallbacks {
11
+ onLoadedMetadata: (duration: number) => void;
12
+ onTimeUpdate: (currentTime: number) => void;
13
+ onEnded: () => void;
14
+ }
15
+ export declare const createAudioPlayback: (url: string, callbacks: PlaybackCallbacks) => AudioPlayback;
16
+ export declare const cleanupAudio: (audio: HTMLAudioElement) => void;
17
+ export declare const createObjectURL: (blob: Blob) => string;
18
+ export declare const revokeObjectURL: (url: string) => void;
19
+ //# sourceMappingURL=audio-playback-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audio-playback-adapter.d.ts","sourceRoot":"","sources":["../../src/platform/audio-playback-adapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE,gBAAgB,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAC9B,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,YAAY,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,eAAO,MAAM,mBAAmB,GAAI,KAAK,MAAM,EAAE,WAAW,iBAAiB,KAAG,aAgB/E,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,OAAO,gBAAgB,KAAG,IAMtD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,MAAM,IAAI,KAAG,MAE5C,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,KAAK,MAAM,KAAG,IAE7C,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Global audio playback manager — ensures only one audio plays at a time
3
+ *
4
+ * @author: exode <hello@exode.ru>
5
+ */
6
+ type StopCallback = () => void;
7
+ export declare const audioPlaybackManager: {
8
+ /** Register a stop callback for a player instance */
9
+ subscribe: (callback: StopCallback) => () => void;
10
+ /** Stop all other players except the caller */
11
+ stopOthers: (except: StopCallback) => void;
12
+ };
13
+ export {};
14
+ //# sourceMappingURL=audio-playback-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audio-playback-manager.d.ts","sourceRoot":"","sources":["../../src/platform/audio-playback-manager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,KAAK,YAAY,GAAG,MAAM,IAAI,CAAC;AAI/B,eAAO,MAAM,oBAAoB;IAC7B,qDAAqD;0BAC/B,YAAY;IAQlC,+CAA+C;yBAC1B,YAAY;CAOpC,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Platform adapters barrel (internal — not exported publicly)
3
+ *
4
+ * @author: exode <hello@exode.ru>
5
+ */
6
+ export { requestMicrophoneAccess, classifyMicError } from './microphone';
7
+ export type { MicErrorKind } from './microphone';
8
+ export { createRecorderSession, stopStream } from './media-recorder-adapter';
9
+ export type { RecorderSession, RecorderSessionCallbacks } from './media-recorder-adapter';
10
+ export { createAudioPlayback, cleanupAudio, createObjectURL, revokeObjectURL } from './audio-playback-adapter';
11
+ export type { AudioPlayback, PlaybackCallbacks } from './audio-playback-adapter';
12
+ export { createStreamAnalyzer, readFrequencyLevels, decodeAudioLevels } from './audio-analyzer-adapter';
13
+ export type { StreamAnalyzer } from './audio-analyzer-adapter';
14
+ export { scheduleFrame, cancelFrame } from './animation-frame-adapter';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/platform/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACzE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC7E,YAAY,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAE1F,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC/G,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAEjF,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACxG,YAAY,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * MediaRecorder platform adapter
3
+ *
4
+ * @author: exode <hello@exode.ru>
5
+ */
6
+ export interface RecorderSession {
7
+ recorder: MediaRecorder;
8
+ stream: MediaStream;
9
+ }
10
+ export interface RecorderSessionCallbacks {
11
+ onDataAvailable: (event: BlobEvent) => void;
12
+ onStop: () => void;
13
+ onPause: () => void;
14
+ onResume: () => void;
15
+ }
16
+ export declare const createRecorderSession: (stream: MediaStream, callbacks: RecorderSessionCallbacks, options?: {
17
+ mimeType?: string;
18
+ }) => RecorderSession;
19
+ export declare const stopStream: (stream: MediaStream) => void;
20
+ //# sourceMappingURL=media-recorder-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-recorder-adapter.d.ts","sourceRoot":"","sources":["../../src/platform/media-recorder-adapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,MAAM,WAAW,eAAe;IAC5B,QAAQ,EAAE,aAAa,CAAC;IACxB,MAAM,EAAE,WAAW,CAAC;CACvB;AAED,MAAM,WAAW,wBAAwB;IACrC,eAAe,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IAC5C,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,eAAO,MAAM,qBAAqB,GAC9B,QAAQ,WAAW,EACnB,WAAW,wBAAwB,EACnC,UAAU;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,KAChC,eAeF,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,QAAQ,WAAW,KAAG,IAEhD,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Microphone platform adapter
3
+ *
4
+ * @author: exode <hello@exode.ru>
5
+ */
6
+ export type MicErrorKind = 'permission' | 'not-supported' | 'unknown';
7
+ export declare const classifyMicError: (error: unknown) => MicErrorKind;
8
+ export declare const requestMicrophoneAccess: () => Promise<MediaStream>;
9
+ //# sourceMappingURL=microphone.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"microphone.d.ts","sourceRoot":"","sources":["../../src/platform/microphone.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,eAAe,GAAG,SAAS,CAAC;AAEtE,eAAO,MAAM,gBAAgB,GAAI,OAAO,OAAO,KAAG,YAYjD,CAAC;AAEF,eAAO,MAAM,uBAAuB,QAAa,OAAO,CAAC,WAAW,CAMnE,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Types barrel
3
+ *
4
+ * @author: exode <hello@exode.ru>
5
+ */
6
+ export type { StorageFileEntity, StorageSpace, UploadStrategy } from './upload';
7
+ export { StorageSpaceEnum } from './upload';
8
+ export type { UseVoiceRecorderOptions, UseVoiceRecorderResult } from './recorder';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,YAAY,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC"}
@@ -1,26 +1,9 @@
1
1
  /**
2
- * AudioRecorder shared types
2
+ * Recorder types
3
3
  *
4
4
  * @author: exode <hello@exode.ru>
5
5
  */
6
- export interface StorageFileEntity {
7
- id?: number;
8
- url?: string;
9
- name?: string;
10
- size?: number;
11
- mimeType?: string;
12
- [key: string]: unknown;
13
- }
14
- export declare const StorageSpaceEnum: {
15
- readonly User: "user";
16
- readonly Shared: "shared";
17
- readonly System: "system";
18
- };
19
- export type StorageSpace = typeof StorageSpaceEnum[keyof typeof StorageSpaceEnum] | (string & {});
20
- export type UploadStrategy<TFile> = (file: File, ctx: {
21
- space: StorageSpace;
22
- uploadId: string;
23
- }) => Promise<TFile>;
6
+ import type { StorageSpace, UploadStrategy } from './upload';
24
7
  export interface UseVoiceRecorderOptions<TFile = unknown> {
25
8
  space: StorageSpace;
26
9
  uploadId: string;
@@ -56,4 +39,4 @@ export interface UseVoiceRecorderResult {
56
39
  sendRecording: () => Promise<void>;
57
40
  formatTime: (seconds: number) => string;
58
41
  }
59
- //# sourceMappingURL=types.d.ts.map
42
+ //# sourceMappingURL=recorder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recorder.d.ts","sourceRoot":"","sources":["../../src/types/recorder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG7D,MAAM,WAAW,uBAAuB,CAAC,KAAK,GAAG,OAAO;IACpD,KAAK,EAAE,YAAY,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACvC,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,QAAQ,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,sBAAsB;IACnC,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,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,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,aAAa,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;CAC3C"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Upload types
3
+ *
4
+ * @author: exode <hello@exode.ru>
5
+ */
6
+ export interface StorageFileEntity {
7
+ id?: number;
8
+ url?: string;
9
+ name?: string;
10
+ size?: number;
11
+ mimeType?: string;
12
+ [key: string]: unknown;
13
+ }
14
+ export declare const StorageSpaceEnum: {
15
+ readonly User: "user";
16
+ readonly Shared: "shared";
17
+ readonly System: "system";
18
+ };
19
+ export type StorageSpace = typeof StorageSpaceEnum[keyof typeof StorageSpaceEnum] | (string & {});
20
+ export type UploadStrategy<TFile> = (file: File, ctx: {
21
+ space: StorageSpace;
22
+ uploadId: string;
23
+ }) => Promise<TFile>;
24
+ //# sourceMappingURL=upload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../src/types/upload.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,MAAM,WAAW,iBAAiB;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED,eAAO,MAAM,gBAAgB;;;;CAInB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,OAAO,gBAAgB,CAAC,MAAM,OAAO,gBAAgB,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElG,MAAM,MAAM,cAAc,CAAC,KAAK,IAAI,CAChC,IAAI,EAAE,IAAI,EACV,GAAG,EAAE;IAAE,KAAK,EAAE,YAAY,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,KAC7C,OAAO,CAAC,KAAK,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Format utilities
3
+ *
4
+ * @author: exode <hello@exode.ru>
5
+ */
6
+ export declare const formatTime: (seconds: number) => string;
7
+ //# sourceMappingURL=format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/utils/format.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,eAAO,MAAM,UAAU,GAAI,SAAS,MAAM,KAAG,MAK5C,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Utils barrel
3
+ *
4
+ * @author: exode <hello@exode.ru>
5
+ */
6
+ export { clampValue, roundTo } from './math';
7
+ export { formatTime } from './format';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Math utilities
3
+ *
4
+ * @author: exode <hello@exode.ru>
5
+ */
6
+ export declare const clampValue: (value: number, lowerBound?: number, upperBound?: number) => number;
7
+ export declare const roundTo: (value: number, precision?: number) => number;
8
+ //# sourceMappingURL=math.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../src/utils/math.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,EAAE,mBAAc,EAAE,mBAAgB,KAAG,MAI5E,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,OAAO,MAAM,EAAE,kBAAa,KAAG,MAItD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exode-team/react-recorder",
3
- "version": "1.0.3",
3
+ "version": "1.1.0",
4
4
  "description": "Accessible audio recorder UI kit for React applications",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -8,6 +8,8 @@
8
8
  "scripts": {
9
9
  "clean": "rimraf dist",
10
10
  "build": "rollup -c",
11
+ "sandbox": "cd sandbox && npx vite",
12
+ "sandbox:build": "cd sandbox && npx vite build",
11
13
  "prepare": "yarn build",
12
14
  "npm:publish": "npm run build && npm publish"
13
15
  },
@@ -26,10 +28,8 @@
26
28
  "peerDependencies": {
27
29
  "react": ">=17.0.0",
28
30
  "react-dom": ">=17.0.0",
29
- "styled-components": ">=5.3.0"
30
- },
31
- "dependencies": {
32
- "lodash": "^4.17.21"
31
+ "styled-components": ">=5.3.0",
32
+ "@vkontakte/icons": ">=2.0.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@rollup/plugin-commonjs": "^25.0.7",
@@ -1 +0,0 @@
1
- {"version":3,"file":"AudioRecorder.d.ts","sourceRoot":"","sources":["../src/AudioRecorder.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAEjB,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAC/B,MAAM,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AAU,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,iBAAiB,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3E;AAoDD,QAAA,MAAM,aAAa,GAAI,OAAO,KAAK,QA6NlC,CAAC;AAGF,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -1,13 +0,0 @@
1
- /**
2
- * IdleControlAtom
3
- *
4
- * @author: exode <hello@exode.ru>
5
- */
6
- interface Props {
7
- onClick: () => void;
8
- instruction: string;
9
- startAriaLabel: string;
10
- }
11
- declare const IdleControlAtom: (props: Props) => any;
12
- export { IdleControlAtom };
13
- //# sourceMappingURL=IdleControlAtom.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IdleControlAtom.d.ts","sourceRoot":"","sources":["../../src/atoms/IdleControlAtom.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,eAAe,GAAI,OAAO,KAAK,QAsBpC,CAAC;AAGF,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"IdleControlAtom.styled.d.ts","sourceRoot":"","sources":["../../src/atoms/IdleControlAtom.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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"RecordingShellAtom.d.ts","sourceRoot":"","sources":["../../src/atoms/RecordingShellAtom.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AA4BH,UAAU,KAAK;I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AAC;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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"WaveformBarsAtom.d.ts","sourceRoot":"","sources":["../../src/atoms/WaveformBarsAtom.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,gBAAgB,GAAI,OAAO,KAAK,QA0BrC,CAAC;AAGF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,MAAM,WAAW,iBAAiB;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED,eAAO,MAAM,gBAAgB;;;;CAInB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,OAAO,gB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