@magmamath/students-features 1.3.23-rc.21 → 1.3.23-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/features/voice/playing/components/VoiceTranscription.js +48 -39
- package/dist/commonjs/features/voice/playing/components/VoiceTranscription.js.map +1 -1
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.js +2 -2
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.js.map +1 -1
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.js +8 -7
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.js.map +1 -1
- package/dist/commonjs/features/voice/playing/hooks/{useDropdownAnimation.js → useVoiceTranscription.js} +7 -8
- package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscription.js.map +1 -0
- package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionEffects.js +37 -0
- package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionEffects.js.map +1 -0
- package/dist/commonjs/features/voice/playing/model/Player.model.js +1 -24
- package/dist/commonjs/features/voice/playing/model/Player.model.js.map +1 -1
- package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.js +66 -0
- package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.js.map +1 -0
- package/dist/commonjs/features/voice/playing/model/VoiceFileDownloader.model.js +2 -2
- package/dist/commonjs/features/voice/playing/model/VoiceFileDownloader.model.js.map +1 -1
- package/dist/commonjs/features/voice/playing/model/VoicePlayer.model.js +175 -46
- package/dist/commonjs/features/voice/playing/model/VoicePlayer.model.js.map +1 -1
- package/dist/commonjs/features/voice/playing/model/{Dropdown.model.js → VoiceTranscription.model.js} +4 -4
- package/dist/commonjs/features/voice/playing/model/VoiceTranscription.model.js.map +1 -0
- package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionTranslation.model.js +15 -0
- package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionTranslation.model.js.map +1 -0
- package/dist/commonjs/features/voice/playing/model/{TranscriptionsCollection.js → VoiceTranscriptionsCollection.js} +4 -4
- package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.js.map +1 -0
- package/dist/commonjs/features/voice/types.js.map +1 -1
- package/dist/commonjs/index.js +0 -12
- package/dist/commonjs/index.js.map +1 -1
- package/dist/module/features/voice/playing/components/VoiceTranscription.js +47 -40
- package/dist/module/features/voice/playing/components/VoiceTranscription.js.map +1 -1
- package/dist/module/features/voice/playing/components/VoiceTranscriptionCollapsible.js +2 -2
- package/dist/module/features/voice/playing/components/VoiceTranscriptionCollapsible.js.map +1 -1
- package/dist/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.js +7 -8
- package/dist/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.js.map +1 -1
- package/dist/module/features/voice/playing/hooks/{useDropdownAnimation.js → useVoiceTranscription.js} +5 -6
- package/dist/module/features/voice/playing/hooks/useVoiceTranscription.js.map +1 -0
- package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionEffects.js +32 -0
- package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionEffects.js.map +1 -0
- package/dist/module/features/voice/playing/model/Player.model.js +1 -24
- package/dist/module/features/voice/playing/model/Player.model.js.map +1 -1
- package/dist/module/features/voice/playing/model/TranscriptionsDownloaderModel.js +61 -0
- package/dist/module/features/voice/playing/model/TranscriptionsDownloaderModel.js.map +1 -0
- package/dist/module/features/voice/playing/model/VoiceFileDownloader.model.js +2 -2
- package/dist/module/features/voice/playing/model/VoiceFileDownloader.model.js.map +1 -1
- package/dist/module/features/voice/playing/model/VoicePlayer.model.js +177 -48
- package/dist/module/features/voice/playing/model/VoicePlayer.model.js.map +1 -1
- package/dist/module/features/voice/playing/model/{Dropdown.model.js → VoiceTranscription.model.js} +2 -2
- package/dist/module/features/voice/playing/model/VoiceTranscription.model.js.map +1 -0
- package/dist/module/features/voice/playing/model/VoiceTranscriptionTranslation.model.js +10 -0
- package/dist/module/features/voice/playing/model/VoiceTranscriptionTranslation.model.js.map +1 -0
- package/dist/module/features/voice/playing/model/{TranscriptionsCollection.js → VoiceTranscriptionsCollection.js} +2 -2
- package/dist/module/features/voice/playing/model/VoiceTranscriptionsCollection.js.map +1 -0
- package/dist/module/features/voice/types.js.map +1 -1
- package/dist/module/index.js +0 -1
- package/dist/module/index.js.map +1 -1
- package/dist/typescript/commonjs/features/voice/index.d.ts +0 -1
- package/dist/typescript/commonjs/features/voice/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscription.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts +2 -2
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/playing/hooks/{useDropdownAnimation.d.ts → useVoiceTranscription.d.ts} +3 -3
- package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscription.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionEffects.d.ts +12 -0
- package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionEffects.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/model/Player.model.d.ts +0 -3
- package/dist/typescript/commonjs/features/voice/playing/model/Player.model.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts +15 -0
- package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/model/VoiceFileDownloader.model.d.ts +2 -2
- package/dist/typescript/commonjs/features/voice/playing/model/VoiceFileDownloader.model.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/playing/model/VoicePlayer.model.d.ts +20 -18
- package/dist/typescript/commonjs/features/voice/playing/model/VoicePlayer.model.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/playing/model/{Dropdown.model.d.ts → VoiceTranscription.model.d.ts} +2 -2
- package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscription.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionTranslation.model.d.ts +7 -0
- package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionTranslation.model.d.ts.map +1 -0
- package/dist/typescript/{module/features/voice/playing/model/TranscriptionsCollection.d.ts → commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts} +2 -2
- package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/types.d.ts +1 -4
- package/dist/typescript/commonjs/features/voice/types.d.ts.map +1 -1
- package/dist/typescript/commonjs/index.d.ts +0 -1
- package/dist/typescript/commonjs/index.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/index.d.ts +0 -1
- package/dist/typescript/module/features/voice/index.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscription.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts +2 -2
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/playing/hooks/{useDropdownAnimation.d.ts → useVoiceTranscription.d.ts} +3 -3
- package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscription.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionEffects.d.ts +12 -0
- package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionEffects.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/model/Player.model.d.ts +0 -3
- package/dist/typescript/module/features/voice/playing/model/Player.model.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts +15 -0
- package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/model/VoiceFileDownloader.model.d.ts +2 -2
- package/dist/typescript/module/features/voice/playing/model/VoiceFileDownloader.model.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/playing/model/VoicePlayer.model.d.ts +20 -18
- package/dist/typescript/module/features/voice/playing/model/VoicePlayer.model.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/playing/model/{Dropdown.model.d.ts → VoiceTranscription.model.d.ts} +2 -2
- package/dist/typescript/module/features/voice/playing/model/VoiceTranscription.model.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionTranslation.model.d.ts +7 -0
- package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionTranslation.model.d.ts.map +1 -0
- package/dist/typescript/{commonjs/features/voice/playing/model/TranscriptionsCollection.d.ts → module/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts} +2 -2
- package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/types.d.ts +1 -4
- package/dist/typescript/module/features/voice/types.d.ts.map +1 -1
- package/dist/typescript/module/index.d.ts +0 -1
- package/dist/typescript/module/index.d.ts.map +1 -1
- package/package.json +1 -28
- package/src/features/voice/index.ts +0 -1
- package/src/features/voice/playing/components/VoiceTranscription.tsx +60 -43
- package/src/features/voice/playing/components/VoiceTranscriptionCollapsible.tsx +4 -4
- package/src/features/voice/playing/components/VoiceTranscriptionHeaderActions.tsx +9 -8
- package/src/features/voice/playing/hooks/{useDropdownAnimation.ts → useVoiceTranscription.ts} +5 -5
- package/src/features/voice/playing/hooks/useVoiceTranscriptionEffects.ts +44 -0
- package/src/features/voice/playing/model/Player.model.ts +1 -26
- package/src/features/voice/playing/model/TranscriptionsDownloaderModel.ts +80 -0
- package/src/features/voice/playing/model/VoiceFileDownloader.model.ts +2 -2
- package/src/features/voice/playing/model/VoicePlayer.model.ts +196 -56
- package/src/features/voice/playing/model/{Dropdown.model.ts → VoiceTranscription.model.ts} +1 -1
- package/src/features/voice/playing/model/VoiceTranscriptionTranslation.model.ts +11 -0
- package/src/features/voice/playing/model/{TranscriptionsCollection.ts → VoiceTranscriptionsCollection.ts} +1 -1
- package/src/features/voice/types.ts +0 -9
- package/src/index.ts +0 -1
- package/dist/commonjs/features/translation/constants.js +0 -11
- package/dist/commonjs/features/translation/constants.js.map +0 -1
- package/dist/commonjs/features/translation/helpers.js +0 -60
- package/dist/commonjs/features/translation/helpers.js.map +0 -1
- package/dist/commonjs/features/translation/index.js +0 -105
- package/dist/commonjs/features/translation/index.js.map +0 -1
- package/dist/commonjs/features/translation/model/TranslationModel.js +0 -122
- package/dist/commonjs/features/translation/model/TranslationModel.js.map +0 -1
- package/dist/commonjs/features/translation/model/TranslationPreprocessor.js +0 -142
- package/dist/commonjs/features/translation/model/TranslationPreprocessor.js.map +0 -1
- package/dist/commonjs/features/translation/model/TranslationService.js +0 -112
- package/dist/commonjs/features/translation/model/TranslationService.js.map +0 -1
- package/dist/commonjs/features/translation/preserve/wordsToPreserve.js +0 -314
- package/dist/commonjs/features/translation/preserve/wordsToPreserve.js.map +0 -1
- package/dist/commonjs/features/translation/providers/google/GoogleTranslationProvider.js +0 -50
- package/dist/commonjs/features/translation/providers/google/GoogleTranslationProvider.js.map +0 -1
- package/dist/commonjs/features/translation/providers/google/supportedLanguages.js +0 -230
- package/dist/commonjs/features/translation/providers/google/supportedLanguages.js.map +0 -1
- package/dist/commonjs/features/translation/providers/google.types.js +0 -2
- package/dist/commonjs/features/translation/providers/google.types.js.map +0 -1
- package/dist/commonjs/features/translation/providers/translation.interface.js +0 -49
- package/dist/commonjs/features/translation/providers/translation.interface.js.map +0 -1
- package/dist/commonjs/features/translation/types.js +0 -2
- package/dist/commonjs/features/translation/types.js.map +0 -1
- package/dist/commonjs/features/voice/playing/hooks/useDropdownAnimation.js.map +0 -1
- package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.js +0 -128
- package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.js.map +0 -1
- package/dist/commonjs/features/voice/playing/model/Dropdown.model.js.map +0 -1
- package/dist/commonjs/features/voice/playing/model/PlaybackController.js +0 -183
- package/dist/commonjs/features/voice/playing/model/PlaybackController.js.map +0 -1
- package/dist/commonjs/features/voice/playing/model/TranscriptionsCollection.js.map +0 -1
- package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.js +0 -82
- package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.js.map +0 -1
- package/dist/commonjs/features/voice/playing/model/Translation.model.js +0 -62
- package/dist/commonjs/features/voice/playing/model/Translation.model.js.map +0 -1
- package/dist/module/features/translation/constants.js +0 -7
- package/dist/module/features/translation/constants.js.map +0 -1
- package/dist/module/features/translation/helpers.js +0 -53
- package/dist/module/features/translation/helpers.js.map +0 -1
- package/dist/module/features/translation/index.js +0 -12
- package/dist/module/features/translation/index.js.map +0 -1
- package/dist/module/features/translation/model/TranslationModel.js +0 -117
- package/dist/module/features/translation/model/TranslationModel.js.map +0 -1
- package/dist/module/features/translation/model/TranslationPreprocessor.js +0 -137
- package/dist/module/features/translation/model/TranslationPreprocessor.js.map +0 -1
- package/dist/module/features/translation/model/TranslationService.js +0 -107
- package/dist/module/features/translation/model/TranslationService.js.map +0 -1
- package/dist/module/features/translation/preserve/wordsToPreserve.js +0 -310
- package/dist/module/features/translation/preserve/wordsToPreserve.js.map +0 -1
- package/dist/module/features/translation/providers/google/GoogleTranslationProvider.js +0 -45
- package/dist/module/features/translation/providers/google/GoogleTranslationProvider.js.map +0 -1
- package/dist/module/features/translation/providers/google/supportedLanguages.js +0 -225
- package/dist/module/features/translation/providers/google/supportedLanguages.js.map +0 -1
- package/dist/module/features/translation/providers/google.types.js +0 -2
- package/dist/module/features/translation/providers/google.types.js.map +0 -1
- package/dist/module/features/translation/providers/translation.interface.js +0 -44
- package/dist/module/features/translation/providers/translation.interface.js.map +0 -1
- package/dist/module/features/translation/types.js +0 -2
- package/dist/module/features/translation/types.js.map +0 -1
- package/dist/module/features/voice/playing/hooks/useDropdownAnimation.js.map +0 -1
- package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionController.js +0 -123
- package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionController.js.map +0 -1
- package/dist/module/features/voice/playing/model/Dropdown.model.js.map +0 -1
- package/dist/module/features/voice/playing/model/PlaybackController.js +0 -178
- package/dist/module/features/voice/playing/model/PlaybackController.js.map +0 -1
- package/dist/module/features/voice/playing/model/TranscriptionsCollection.js.map +0 -1
- package/dist/module/features/voice/playing/model/TranscriptionsDownloader.model.js +0 -77
- package/dist/module/features/voice/playing/model/TranscriptionsDownloader.model.js.map +0 -1
- package/dist/module/features/voice/playing/model/Translation.model.js +0 -57
- package/dist/module/features/voice/playing/model/Translation.model.js.map +0 -1
- package/dist/typescript/commonjs/features/translation/constants.d.ts +0 -5
- package/dist/typescript/commonjs/features/translation/constants.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/translation/helpers.d.ts +0 -9
- package/dist/typescript/commonjs/features/translation/helpers.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/translation/index.d.ts +0 -12
- package/dist/typescript/commonjs/features/translation/index.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/translation/model/TranslationModel.d.ts +0 -33
- package/dist/typescript/commonjs/features/translation/model/TranslationModel.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/translation/model/TranslationPreprocessor.d.ts +0 -34
- package/dist/typescript/commonjs/features/translation/model/TranslationPreprocessor.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/translation/model/TranslationService.d.ts +0 -40
- package/dist/typescript/commonjs/features/translation/model/TranslationService.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/translation/preserve/wordsToPreserve.d.ts +0 -3
- package/dist/typescript/commonjs/features/translation/preserve/wordsToPreserve.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/translation/providers/google/GoogleTranslationProvider.d.ts +0 -17
- package/dist/typescript/commonjs/features/translation/providers/google/GoogleTranslationProvider.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/translation/providers/google/supportedLanguages.d.ts +0 -209
- package/dist/typescript/commonjs/features/translation/providers/google/supportedLanguages.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/translation/providers/google.types.d.ts +0 -15
- package/dist/typescript/commonjs/features/translation/providers/google.types.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/translation/providers/translation.interface.d.ts +0 -30
- package/dist/typescript/commonjs/features/translation/providers/translation.interface.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/translation/types.d.ts +0 -27
- package/dist/typescript/commonjs/features/translation/types.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/hooks/useDropdownAnimation.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts +0 -30
- package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/model/Dropdown.model.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/model/PlaybackController.d.ts +0 -28
- package/dist/typescript/commonjs/features/voice/playing/model/PlaybackController.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsCollection.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.d.ts +0 -19
- package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/model/Translation.model.d.ts +0 -25
- package/dist/typescript/commonjs/features/voice/playing/model/Translation.model.d.ts.map +0 -1
- package/dist/typescript/module/features/translation/constants.d.ts +0 -5
- package/dist/typescript/module/features/translation/constants.d.ts.map +0 -1
- package/dist/typescript/module/features/translation/helpers.d.ts +0 -9
- package/dist/typescript/module/features/translation/helpers.d.ts.map +0 -1
- package/dist/typescript/module/features/translation/index.d.ts +0 -12
- package/dist/typescript/module/features/translation/index.d.ts.map +0 -1
- package/dist/typescript/module/features/translation/model/TranslationModel.d.ts +0 -33
- package/dist/typescript/module/features/translation/model/TranslationModel.d.ts.map +0 -1
- package/dist/typescript/module/features/translation/model/TranslationPreprocessor.d.ts +0 -34
- package/dist/typescript/module/features/translation/model/TranslationPreprocessor.d.ts.map +0 -1
- package/dist/typescript/module/features/translation/model/TranslationService.d.ts +0 -40
- package/dist/typescript/module/features/translation/model/TranslationService.d.ts.map +0 -1
- package/dist/typescript/module/features/translation/preserve/wordsToPreserve.d.ts +0 -3
- package/dist/typescript/module/features/translation/preserve/wordsToPreserve.d.ts.map +0 -1
- package/dist/typescript/module/features/translation/providers/google/GoogleTranslationProvider.d.ts +0 -17
- package/dist/typescript/module/features/translation/providers/google/GoogleTranslationProvider.d.ts.map +0 -1
- package/dist/typescript/module/features/translation/providers/google/supportedLanguages.d.ts +0 -209
- package/dist/typescript/module/features/translation/providers/google/supportedLanguages.d.ts.map +0 -1
- package/dist/typescript/module/features/translation/providers/google.types.d.ts +0 -15
- package/dist/typescript/module/features/translation/providers/google.types.d.ts.map +0 -1
- package/dist/typescript/module/features/translation/providers/translation.interface.d.ts +0 -30
- package/dist/typescript/module/features/translation/providers/translation.interface.d.ts.map +0 -1
- package/dist/typescript/module/features/translation/types.d.ts +0 -27
- package/dist/typescript/module/features/translation/types.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/hooks/useDropdownAnimation.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts +0 -30
- package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/model/Dropdown.model.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/model/PlaybackController.d.ts +0 -28
- package/dist/typescript/module/features/voice/playing/model/PlaybackController.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/model/TranscriptionsCollection.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloader.model.d.ts +0 -19
- package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloader.model.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/model/Translation.model.d.ts +0 -25
- package/dist/typescript/module/features/voice/playing/model/Translation.model.d.ts.map +0 -1
- package/src/features/translation/constants.ts +0 -4
- package/src/features/translation/helpers.ts +0 -63
- package/src/features/translation/index.ts +0 -30
- package/src/features/translation/model/TranslationModel.ts +0 -174
- package/src/features/translation/model/TranslationPreprocessor.ts +0 -171
- package/src/features/translation/model/TranslationService.ts +0 -148
- package/src/features/translation/preserve/wordsToPreserve.ts +0 -87
- package/src/features/translation/providers/google/GoogleTranslationProvider.ts +0 -50
- package/src/features/translation/providers/google/supportedLanguages.ts +0 -229
- package/src/features/translation/providers/google.types.ts +0 -16
- package/src/features/translation/providers/translation.interface.ts +0 -63
- package/src/features/translation/types.ts +0 -30
- package/src/features/voice/playing/hooks/useVoiceTranscriptionController.ts +0 -171
- package/src/features/voice/playing/model/PlaybackController.ts +0 -213
- package/src/features/voice/playing/model/TranscriptionsDownloader.model.ts +0 -88
- package/src/features/voice/playing/model/Translation.model.ts +0 -75
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
import { createEffect } from 'effector'
|
|
2
|
-
import { PlayerModel, PlayerState } from './Player.model'
|
|
3
|
-
import { TranscriptionsCollection } from './TranscriptionsCollection'
|
|
4
|
-
import { VoiceFileDownloaderModel } from './VoiceFileDownloader.model'
|
|
5
|
-
|
|
6
|
-
type PlaybackControllerDeps = {
|
|
7
|
-
collection: TranscriptionsCollection
|
|
8
|
-
player: PlayerModel
|
|
9
|
-
downloader: VoiceFileDownloaderModel
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export class PlaybackController {
|
|
13
|
-
private readonly collection: TranscriptionsCollection
|
|
14
|
-
private readonly player: PlayerModel
|
|
15
|
-
private readonly downloader: VoiceFileDownloaderModel
|
|
16
|
-
private currentPlayingAttempt: number | null = null
|
|
17
|
-
private shouldPreventPlayback = false
|
|
18
|
-
|
|
19
|
-
constructor(deps: PlaybackControllerDeps) {
|
|
20
|
-
this.collection = deps.collection
|
|
21
|
-
this.player = deps.player
|
|
22
|
-
this.downloader = deps.downloader
|
|
23
|
-
this.player.playbackFinished.watch(() => this.clearCurrentAttempt())
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
public readonly togglePlayPause = (attemptNumber: number) => {
|
|
27
|
-
const playerState = this.player.$playerState.getState()
|
|
28
|
-
if (this.currentPlayingAttempt === attemptNumber && playerState === PlayerState.PLAYING) {
|
|
29
|
-
this.player.pause()
|
|
30
|
-
} else {
|
|
31
|
-
this.handlePlayAttempt(attemptNumber)
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
public readonly preloadAudio = createEffect(async (attemptNumber: number) => {
|
|
36
|
-
const item = this.collection.get(attemptNumber)
|
|
37
|
-
if (!item) return
|
|
38
|
-
if (this.collection.hasAudio(attemptNumber)) {
|
|
39
|
-
this.primePlayerIfIdle(attemptNumber)
|
|
40
|
-
return
|
|
41
|
-
}
|
|
42
|
-
if (item.audioDownloadPromise) {
|
|
43
|
-
try {
|
|
44
|
-
await item.audioDownloadPromise
|
|
45
|
-
} catch {}
|
|
46
|
-
this.primePlayerIfIdle(attemptNumber)
|
|
47
|
-
return
|
|
48
|
-
}
|
|
49
|
-
try {
|
|
50
|
-
await this.downloadAudio(attemptNumber)
|
|
51
|
-
this.primePlayerIfIdle(attemptNumber)
|
|
52
|
-
} catch (error) {
|
|
53
|
-
if (error instanceof Error && error.name === 'AbortError') return
|
|
54
|
-
console.error('Audio preload error:', error)
|
|
55
|
-
}
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
private primePlayerIfIdle(attemptNumber: number) {
|
|
59
|
-
if (this.player.$playerState.getState() !== PlayerState.IDLE) return
|
|
60
|
-
if (this.currentPlayingAttempt !== null) return
|
|
61
|
-
const audioUri = this.collection.get(attemptNumber)?.audioUri
|
|
62
|
-
if (!audioUri) return
|
|
63
|
-
this.player.prime(audioUri)
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
public halt() {
|
|
67
|
-
this.shouldPreventPlayback = true
|
|
68
|
-
this.abortAllDownloads()
|
|
69
|
-
this.player.stop()
|
|
70
|
-
this.clearCurrentAttempt()
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
public releaseResources() {
|
|
74
|
-
this.collection.getAll().forEach((item) => {
|
|
75
|
-
if (item.controller) {
|
|
76
|
-
this.downloader.abortDownload(item.controller)
|
|
77
|
-
}
|
|
78
|
-
if (item.audioUri?.startsWith('blob:')) {
|
|
79
|
-
try {
|
|
80
|
-
URL.revokeObjectURL(item.audioUri)
|
|
81
|
-
} catch (e) {}
|
|
82
|
-
}
|
|
83
|
-
})
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
private clearCurrentAttempt() {
|
|
87
|
-
this.currentPlayingAttempt = null
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
private abortAllDownloads() {
|
|
91
|
-
this.collection.getAll().forEach((item) => {
|
|
92
|
-
if (item.controller && item.audioLoading) {
|
|
93
|
-
this.downloader.abortDownload(item.controller)
|
|
94
|
-
this.collection.update(item.attemptNumber, {
|
|
95
|
-
audioLoading: false,
|
|
96
|
-
controller: undefined,
|
|
97
|
-
audioDownloadPromise: undefined,
|
|
98
|
-
})
|
|
99
|
-
}
|
|
100
|
-
})
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
private async downloadAudio(attemptNumber: number): Promise<void> {
|
|
104
|
-
const item = this.collection.get(attemptNumber)
|
|
105
|
-
if (!item) return
|
|
106
|
-
|
|
107
|
-
const { collectionItem, downloadPromise } = await this.downloader.download({
|
|
108
|
-
audioFileId: item.audioFileId,
|
|
109
|
-
attemptNumber,
|
|
110
|
-
})
|
|
111
|
-
this.collection.update(attemptNumber, collectionItem)
|
|
112
|
-
|
|
113
|
-
try {
|
|
114
|
-
const result = await downloadPromise
|
|
115
|
-
this.collection.update(attemptNumber, {
|
|
116
|
-
audioUri: result.uri,
|
|
117
|
-
audioLoading: false,
|
|
118
|
-
audioError: undefined,
|
|
119
|
-
controller: undefined,
|
|
120
|
-
audioDownloadPromise: undefined,
|
|
121
|
-
})
|
|
122
|
-
} catch (error) {
|
|
123
|
-
const isAbort = error instanceof Error && error.name === 'AbortError'
|
|
124
|
-
this.collection.update(attemptNumber, {
|
|
125
|
-
audioLoading: false,
|
|
126
|
-
audioError: isAbort
|
|
127
|
-
? undefined
|
|
128
|
-
: error instanceof Error
|
|
129
|
-
? error.message
|
|
130
|
-
: 'Failed to download audio',
|
|
131
|
-
controller: undefined,
|
|
132
|
-
audioDownloadPromise: undefined,
|
|
133
|
-
})
|
|
134
|
-
throw error
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
private readonly handlePlayAttempt = createEffect(async (attemptNumber: number) => {
|
|
139
|
-
this.shouldPreventPlayback = false
|
|
140
|
-
const item = this.collection.get(attemptNumber)
|
|
141
|
-
if (!item) return
|
|
142
|
-
|
|
143
|
-
if (this.currentPlayingAttempt !== null && this.currentPlayingAttempt !== attemptNumber) {
|
|
144
|
-
this.abortAllDownloads()
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
if (this.collection.hasAudio(attemptNumber)) {
|
|
148
|
-
this.playAudioFx(attemptNumber)
|
|
149
|
-
return
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
try {
|
|
153
|
-
this.player.setPlayerState(PlayerState.LOADING)
|
|
154
|
-
|
|
155
|
-
if (item.audioDownloadPromise) {
|
|
156
|
-
await item.audioDownloadPromise
|
|
157
|
-
} else {
|
|
158
|
-
await this.downloadAudio(attemptNumber)
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
if (this.shouldPreventPlayback) {
|
|
162
|
-
this.player.setPlayerState(PlayerState.IDLE)
|
|
163
|
-
return
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
this.player.setPlayerState(PlayerState.IDLE)
|
|
167
|
-
this.playAudioFx(attemptNumber)
|
|
168
|
-
} catch (error) {
|
|
169
|
-
if (error instanceof Error && error.name === 'AbortError') {
|
|
170
|
-
this.player.setPlayerState(PlayerState.IDLE)
|
|
171
|
-
return
|
|
172
|
-
}
|
|
173
|
-
console.error('Audio download error:', error)
|
|
174
|
-
this.player.setPlayerState(PlayerState.IDLE)
|
|
175
|
-
}
|
|
176
|
-
})
|
|
177
|
-
|
|
178
|
-
private readonly playAudioFx = createEffect(async (attemptNumber: number) => {
|
|
179
|
-
if (this.shouldPreventPlayback) return
|
|
180
|
-
|
|
181
|
-
const item = this.collection.get(attemptNumber)
|
|
182
|
-
if (!item?.audioUri) {
|
|
183
|
-
console.warn('No audio URI available for attempt:', attemptNumber)
|
|
184
|
-
return
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
try {
|
|
188
|
-
if (this.currentPlayingAttempt !== null && this.currentPlayingAttempt !== attemptNumber) {
|
|
189
|
-
this.player.player?.remove()
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
if (this.currentPlayingAttempt === attemptNumber && this.player.player?.playing) {
|
|
193
|
-
this.player.pause()
|
|
194
|
-
return
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
if (this.currentPlayingAttempt === attemptNumber && !this.player.player?.playing) {
|
|
198
|
-
this.player.resume()
|
|
199
|
-
return
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
this.currentPlayingAttempt = attemptNumber
|
|
203
|
-
await this.player.play(item.audioUri)
|
|
204
|
-
} catch (error) {
|
|
205
|
-
console.error('Error playing audio:', error)
|
|
206
|
-
this.player.setPlayerState(PlayerState.IDLE)
|
|
207
|
-
|
|
208
|
-
this.collection.update(attemptNumber, {
|
|
209
|
-
audioError: error instanceof Error ? error.message : 'Failed to play audio',
|
|
210
|
-
})
|
|
211
|
-
}
|
|
212
|
-
})
|
|
213
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { createEffect } from 'effector'
|
|
2
|
-
import { TranscriptionsCollection } from './TranscriptionsCollection'
|
|
3
|
-
import { VoicePlayerApi } from '../../types'
|
|
4
|
-
import {
|
|
5
|
-
NO_AUDIO_BE_MESSAGE,
|
|
6
|
-
TRANSCRIPT_MAX_RETRIES,
|
|
7
|
-
TRANSCRIPT_RETRY_INTERVAL_MS,
|
|
8
|
-
} from '../../constants'
|
|
9
|
-
|
|
10
|
-
type TranscriptResult = { text: string; language?: string }
|
|
11
|
-
|
|
12
|
-
export class TranscriptionsDownloaderModel {
|
|
13
|
-
private readonly collection: TranscriptionsCollection
|
|
14
|
-
private readonly api: VoicePlayerApi
|
|
15
|
-
private readonly inflightFetches = new Map<string, Promise<TranscriptResult>>()
|
|
16
|
-
private readonly transcriptCache = new Map<string, TranscriptResult>()
|
|
17
|
-
|
|
18
|
-
constructor(collection: TranscriptionsCollection, api: VoicePlayerApi) {
|
|
19
|
-
this.collection = collection
|
|
20
|
-
this.api = api
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
private fetchTranscriptWithRetry(audioFileId: string): Promise<TranscriptResult> {
|
|
24
|
-
const cached = this.transcriptCache.get(audioFileId)
|
|
25
|
-
if (cached) return Promise.resolve(cached)
|
|
26
|
-
|
|
27
|
-
const existing = this.inflightFetches.get(audioFileId)
|
|
28
|
-
if (existing) return existing
|
|
29
|
-
|
|
30
|
-
const promise = this.runFetchWithRetry(audioFileId)
|
|
31
|
-
.then((result) => {
|
|
32
|
-
this.transcriptCache.set(audioFileId, result)
|
|
33
|
-
return result
|
|
34
|
-
})
|
|
35
|
-
.finally(() => {
|
|
36
|
-
this.inflightFetches.delete(audioFileId)
|
|
37
|
-
})
|
|
38
|
-
this.inflightFetches.set(audioFileId, promise)
|
|
39
|
-
return promise
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
private async runFetchWithRetry(audioFileId: string): Promise<TranscriptResult> {
|
|
43
|
-
for (let attempt = 0; attempt < TRANSCRIPT_MAX_RETRIES; attempt++) {
|
|
44
|
-
const response = await this.api.getAudioFileTranscript(audioFileId)
|
|
45
|
-
|
|
46
|
-
if (response.status === 'completed') {
|
|
47
|
-
return { text: response.text, language: response.language }
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (response.status === 'failed') {
|
|
51
|
-
return { text: NO_AUDIO_BE_MESSAGE }
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (attempt < TRANSCRIPT_MAX_RETRIES - 1) {
|
|
55
|
-
await new Promise((resolve) => setTimeout(resolve, TRANSCRIPT_RETRY_INTERVAL_MS))
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return { text: NO_AUDIO_BE_MESSAGE }
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
public readonly loadTranscriptForAttempt = createEffect(async (attemptNumber: number) => {
|
|
62
|
-
const item = this.collection.get(attemptNumber)
|
|
63
|
-
if (!item?.audioFileId) return
|
|
64
|
-
if (item.transcript || item.transcriptLoading) return
|
|
65
|
-
|
|
66
|
-
this.collection.update(attemptNumber, { transcriptLoading: true })
|
|
67
|
-
|
|
68
|
-
try {
|
|
69
|
-
const { text, language } = await this.fetchTranscriptWithRetry(item.audioFileId)
|
|
70
|
-
|
|
71
|
-
this.collection.update(attemptNumber, {
|
|
72
|
-
transcript: text,
|
|
73
|
-
transcriptLanguage: language,
|
|
74
|
-
transcriptLoading: false,
|
|
75
|
-
transcriptError: undefined,
|
|
76
|
-
})
|
|
77
|
-
} catch (error) {
|
|
78
|
-
this.collection.update(attemptNumber, {
|
|
79
|
-
transcriptLoading: false,
|
|
80
|
-
transcriptError: error instanceof Error ? error.message : 'Failed to load transcript',
|
|
81
|
-
})
|
|
82
|
-
}
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
public getCachedTranscript(audioFileId: string): TranscriptResult | undefined {
|
|
86
|
-
return this.transcriptCache.get(audioFileId)
|
|
87
|
-
}
|
|
88
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { createEffect, createEvent, createStore, restore } from 'effector'
|
|
2
|
-
import { TranscriptionsCollection } from './TranscriptionsCollection'
|
|
3
|
-
import { VoicePlayerApi } from '../../types'
|
|
4
|
-
import { TranslationService } from '../../../translation/model/TranslationService'
|
|
5
|
-
import { GoogleTranslationProvider } from '../../../translation/providers/google/GoogleTranslationProvider'
|
|
6
|
-
import {
|
|
7
|
-
preservedWordsReplacers,
|
|
8
|
-
wordsToPreserve,
|
|
9
|
-
} from '../../../translation/preserve/wordsToPreserve'
|
|
10
|
-
|
|
11
|
-
type TranslateParams = {
|
|
12
|
-
attemptNumber: number
|
|
13
|
-
targetLanguage: string
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
type TranslateResult = {
|
|
17
|
-
attemptNumber: number
|
|
18
|
-
text: string
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export class TranslationModel {
|
|
22
|
-
private readonly collection: TranscriptionsCollection
|
|
23
|
-
private readonly service: TranslationService
|
|
24
|
-
|
|
25
|
-
public readonly toggle = createEvent()
|
|
26
|
-
public readonly setActive = createEvent<boolean>()
|
|
27
|
-
public readonly clearCache = createEvent()
|
|
28
|
-
public readonly reset = createEvent()
|
|
29
|
-
|
|
30
|
-
public readonly $isActive = restore(this.setActive, false)
|
|
31
|
-
.on(this.toggle, (state) => !state)
|
|
32
|
-
.reset(this.reset)
|
|
33
|
-
|
|
34
|
-
public readonly translate = createEffect<TranslateParams, TranslateResult | null>(
|
|
35
|
-
async ({ attemptNumber, targetLanguage }) => {
|
|
36
|
-
const item = this.collection.get(attemptNumber)
|
|
37
|
-
if (!item?.transcript) return null
|
|
38
|
-
|
|
39
|
-
const text = await this.service.translate(item.transcript, {
|
|
40
|
-
targetLang: targetLanguage,
|
|
41
|
-
sourceLang: item.transcriptLanguage,
|
|
42
|
-
cacheKey: `voice::${attemptNumber}::${targetLanguage}`,
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
if (!text) return null
|
|
46
|
-
|
|
47
|
-
return { attemptNumber, text }
|
|
48
|
-
},
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
public readonly $translations = createStore<Record<number, string>>({})
|
|
52
|
-
.on(this.translate.doneData, (state, result) => {
|
|
53
|
-
if (!result) return state
|
|
54
|
-
return { ...state, [result.attemptNumber]: result.text }
|
|
55
|
-
})
|
|
56
|
-
.reset(this.reset, this.clearCache)
|
|
57
|
-
|
|
58
|
-
constructor(collection: TranscriptionsCollection, api: VoicePlayerApi) {
|
|
59
|
-
this.collection = collection
|
|
60
|
-
this.service = new TranslationService({
|
|
61
|
-
preserve: {
|
|
62
|
-
map: wordsToPreserve,
|
|
63
|
-
replacers: preservedWordsReplacers,
|
|
64
|
-
},
|
|
65
|
-
providers: [new GoogleTranslationProvider({ api: { translateRequest: api.translateText } })],
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
this.clearCache.watch(() => this.service.reset())
|
|
69
|
-
this.reset.watch(() => this.service.reset())
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
public getTranslation(attemptNumber: number): string | undefined {
|
|
73
|
-
return this.$translations.getState()[attemptNumber]
|
|
74
|
-
}
|
|
75
|
-
}
|