@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoicePlayer.model.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/VoicePlayer.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"VoicePlayer.model.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/VoicePlayer.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAA;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM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I,sBAAsB,EAAE;IAI1C,kBAAkB;IAIlB,OAAO;IAWP,eAAe,iDAUpB;CACH"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare class
|
|
1
|
+
export declare class VoiceTranscriptionModel {
|
|
2
2
|
readonly toggleExpand: import("effector").EventCallable<void>;
|
|
3
3
|
readonly setExpanded: import("effector").EventCallable<boolean>;
|
|
4
4
|
readonly reset: import("effector").EventCallable<void>;
|
|
5
5
|
readonly $isExpanded: import("effector").StoreWritable<boolean>;
|
|
6
6
|
}
|
|
7
|
-
//# sourceMappingURL=
|
|
7
|
+
//# sourceMappingURL=VoiceTranscription.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoiceTranscription.model.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/VoiceTranscription.model.ts"],"names":[],"mappings":"AAEA,qBAAa,uBAAuB;IAClC,SAAgB,YAAY,yCAAgB;IAC5C,SAAgB,WAAW,4CAAyB;IACpD,SAAgB,KAAK,yCAAgB;IAErC,SAAgB,WAAW,4CAEP;CACrB"}
|
package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionTranslation.model.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare class VoiceTranscriptionTranslationModel {
|
|
2
|
+
readonly toggle: import("effector").EventCallable<void>;
|
|
3
|
+
readonly setActive: import("effector").EventCallable<boolean>;
|
|
4
|
+
readonly reset: import("effector").EventCallable<void>;
|
|
5
|
+
readonly $isActive: import("effector").StoreWritable<boolean>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=VoiceTranscriptionTranslation.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoiceTranscriptionTranslation.model.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/VoiceTranscriptionTranslation.model.ts"],"names":[],"mappings":"AAEA,qBAAa,kCAAkC;IAC7C,SAAgB,MAAM,yCAAgB;IACtC,SAAgB,SAAS,4CAAyB;IAClD,SAAgB,KAAK,yCAAgB;IAErC,SAAgB,SAAS,4CAEL;CACrB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VoiceTranscriptionItem } from '../../types';
|
|
2
|
-
export declare class
|
|
2
|
+
export declare class VoiceTranscriptionsCollection {
|
|
3
3
|
readonly collection: Map<number, VoiceTranscriptionItem>;
|
|
4
4
|
add(attemptNumber: number, item: VoiceTranscriptionItem): void;
|
|
5
5
|
update(attemptNumber: number, item: Partial<VoiceTranscriptionItem>): void;
|
|
@@ -10,4 +10,4 @@ export declare class TranscriptionsCollection {
|
|
|
10
10
|
hasTranscript(attemptNumber: number): boolean;
|
|
11
11
|
hasAudio(attemptNumber: number): boolean;
|
|
12
12
|
}
|
|
13
|
-
//# sourceMappingURL=
|
|
13
|
+
//# sourceMappingURL=VoiceTranscriptionsCollection.d.ts.map
|
package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoiceTranscriptionsCollection.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/VoiceTranscriptionsCollection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAEpD,qBAAa,6BAA6B;IACxC,SAAgB,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAY;IAEpE,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,sBAAsB;IAIvD,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,sBAAsB,CAAC;IAKnE,MAAM,CAAC,aAAa,EAAE,MAAM;IAI5B,GAAG,CAAC,aAAa,EAAE,MAAM;IAIzB,MAAM;IAIN,KAAK;IAIL,aAAa,CAAC,aAAa,EAAE,MAAM;IAKnC,QAAQ,CAAC,aAAa,EAAE,MAAM;CAItC"}
|
|
@@ -2,8 +2,6 @@ import { WithAbortSignal } from 'src/types/common.types';
|
|
|
2
2
|
import { getAvailableInputs } from './helpers';
|
|
3
3
|
import { VoiceRecordModel } from './recording/model/VoiceRecord.model';
|
|
4
4
|
import { AxiosResponse } from 'axios';
|
|
5
|
-
import type { GoogleTranslateProps as GoogleTranslatePayload, GoogleTranslateResponse } from '../translation/providers/google.types';
|
|
6
|
-
export type { GoogleTranslatePayload, GoogleTranslateResponse };
|
|
7
5
|
export type VoiceRecordNotificationTypes = {
|
|
8
6
|
success: (message: string) => void;
|
|
9
7
|
info: (message: string) => void;
|
|
@@ -56,14 +54,12 @@ export type VoicePlayerApi = {
|
|
|
56
54
|
downloadAudioFile: (audioFileId: string, options?: {
|
|
57
55
|
signal?: AbortSignal;
|
|
58
56
|
}) => Promise<AxiosResponse<Blob>>;
|
|
59
|
-
translateText: (payload: GoogleTranslatePayload) => Promise<GoogleTranslateResponse>;
|
|
60
57
|
};
|
|
61
58
|
export type VoiceTranscriptionItem = {
|
|
62
59
|
attemptNumber: number;
|
|
63
60
|
audioFileId: string;
|
|
64
61
|
_id: string;
|
|
65
62
|
transcript?: string;
|
|
66
|
-
transcriptLanguage?: string;
|
|
67
63
|
transcriptLoading?: boolean;
|
|
68
64
|
transcriptError?: string;
|
|
69
65
|
audioUri?: string;
|
|
@@ -81,4 +77,5 @@ export declare enum VoiceTranscriptionVariant {
|
|
|
81
77
|
SMALL = "small",
|
|
82
78
|
LARGE = "large"
|
|
83
79
|
}
|
|
80
|
+
export {};
|
|
84
81
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/voice/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,gBAAgB,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IACX,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,oBAAoB,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,CAAA;IACnC,UAAU,CAAC,EAAE,eAAe,CAAA;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,oBAAY,mBAAmB;IAC7B,OAAO,YAAY;IACnB,QAAQ,aAAa;CACtB;AAED,oBAAY,yBAAyB;IACnC,KAAK,UAAU;IACf,KAAK,UAAU;CAChB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,yBAAyB,CAAA;AACvC,cAAc,mBAAmB,CAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,yBAAyB,CAAA;AACvC,cAAc,mBAAmB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,39 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magmamath/students-features",
|
|
3
|
-
"version": "1.3.23-rc.
|
|
3
|
+
"version": "1.3.23-rc.3",
|
|
4
4
|
"description": "Magmamath features library",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"react-native": "src/index.ts",
|
|
8
8
|
"module": "dist/module/index.js",
|
|
9
9
|
"types": "dist/typescript/module/index.d.ts",
|
|
10
|
-
"exports": {
|
|
11
|
-
".": {
|
|
12
|
-
"react-native": "./src/index.ts",
|
|
13
|
-
"source": "./src/index.ts",
|
|
14
|
-
"import": {
|
|
15
|
-
"types": "./dist/typescript/module/index.d.ts",
|
|
16
|
-
"default": "./dist/module/index.js"
|
|
17
|
-
},
|
|
18
|
-
"require": {
|
|
19
|
-
"types": "./dist/typescript/commonjs/index.d.ts",
|
|
20
|
-
"default": "./dist/commonjs/index.js"
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
"./voice": {
|
|
24
|
-
"react-native": "./src/features/voice/index.ts",
|
|
25
|
-
"source": "./src/features/voice/index.ts",
|
|
26
|
-
"import": {
|
|
27
|
-
"types": "./dist/typescript/module/features/voice/index.d.ts",
|
|
28
|
-
"default": "./dist/module/features/voice/index.js"
|
|
29
|
-
},
|
|
30
|
-
"require": {
|
|
31
|
-
"types": "./dist/typescript/commonjs/features/voice/index.d.ts",
|
|
32
|
-
"default": "./dist/commonjs/features/voice/index.js"
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
"./package.json": "./package.json"
|
|
36
|
-
},
|
|
37
10
|
"files": [
|
|
38
11
|
"src",
|
|
39
12
|
"dist",
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { Typography, COLORS
|
|
2
|
-
import
|
|
1
|
+
import { Typography, COLORS } from '@magmamath/react-native-ui'
|
|
2
|
+
import { useUnit } from 'effector-react'
|
|
3
|
+
import React, { useCallback, useMemo } from 'react'
|
|
3
4
|
import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native'
|
|
4
5
|
import Animated from 'react-native-reanimated'
|
|
6
|
+
import { NO_AUDIO_BE_MESSAGE } from '../../constants'
|
|
7
|
+
import { getActiveAttempt } from '../../helpers'
|
|
5
8
|
import { AnswerAudio, VoiceTranscriptionVariant } from '../../types'
|
|
6
9
|
import { useText } from '../../../../i18n/i18n'
|
|
7
|
-
import {
|
|
10
|
+
import { useVoiceTranscriptionEffects } from '../hooks/useVoiceTranscriptionEffects'
|
|
8
11
|
import { VoicePlayerModel } from '../model'
|
|
9
12
|
import { VoiceTranscriptContent } from './VoiceTranscriptContent'
|
|
10
13
|
import { VoiceTranscriptionCollapsible } from './VoiceTranscriptionCollapsible'
|
|
@@ -30,44 +33,67 @@ export const VoiceTranscription = ({
|
|
|
30
33
|
variant = VoiceTranscriptionVariant.SMALL,
|
|
31
34
|
}: VoiceTranscriptionProps) => {
|
|
32
35
|
const t = useText()
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
|
|
37
|
+
const [playerState, isLoadingTranscripts, isTranslationActive] = useUnit([
|
|
38
|
+
model.$playerState,
|
|
39
|
+
model.loader.loadAllTranscripts.pending,
|
|
40
|
+
model.translation.$isActive,
|
|
41
|
+
])
|
|
42
|
+
|
|
43
|
+
const activeAttempt = getActiveAttempt(attemptOffset, attemptsCount)
|
|
40
44
|
const isLargeVariant = variant === VoiceTranscriptionVariant.LARGE
|
|
41
45
|
|
|
46
|
+
const answersKey = useMemo(
|
|
47
|
+
() => answers.map((a) => `${a._id}:${a.audioFileId ?? ''}`).join(','),
|
|
48
|
+
[answers],
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
useVoiceTranscriptionEffects({ model, answers, answersKey, problemId, activeAttempt })
|
|
52
|
+
|
|
53
|
+
const hasActiveTranscript =
|
|
54
|
+
activeAttempt !== null && answers?.[activeAttempt - 1]?.audioFileId !== undefined
|
|
55
|
+
|
|
56
|
+
const activeTranscript = activeAttempt !== null ? model.loader.getTranscript(activeAttempt) : null
|
|
57
|
+
const hasTranscriptText = !!activeTranscript && activeTranscript !== NO_AUDIO_BE_MESSAGE
|
|
58
|
+
const isActiveTranscriptLoading = isLoadingTranscripts && hasActiveTranscript && !activeTranscript
|
|
59
|
+
const activeTranscriptText = hasTranscriptText
|
|
60
|
+
? activeTranscript
|
|
61
|
+
: t('voice.transcriptNotAvailable')
|
|
62
|
+
|
|
63
|
+
const handlePlayPress = useCallback(() => {
|
|
64
|
+
if (activeAttempt) {
|
|
65
|
+
model.translation.setActive(false)
|
|
66
|
+
model.togglePlayPause(activeAttempt)
|
|
67
|
+
}
|
|
68
|
+
}, [model, activeAttempt])
|
|
69
|
+
|
|
70
|
+
const handleTranslationToggle = useCallback(() => {
|
|
71
|
+
model.translation.toggle()
|
|
72
|
+
}, [model])
|
|
73
|
+
|
|
42
74
|
return (
|
|
43
|
-
<Animated.View
|
|
44
|
-
style={[
|
|
45
|
-
styles.container,
|
|
46
|
-
isLargeVariant ? styles.largeContainer : styles.smallContainer,
|
|
47
|
-
style,
|
|
48
|
-
]}
|
|
49
|
-
>
|
|
75
|
+
<Animated.View style={[styles.container, isLargeVariant && styles.largeContainer, style]}>
|
|
50
76
|
<View style={styles.header}>
|
|
51
77
|
<Typography style={styles.title} variant="h7">
|
|
52
78
|
{t('voice.transcriptions')}
|
|
53
79
|
</Typography>
|
|
54
|
-
{
|
|
80
|
+
{hasActiveTranscript && (
|
|
55
81
|
<VoiceTranscriptionHeaderActions
|
|
56
|
-
playerState={
|
|
57
|
-
isTranslationActive={
|
|
58
|
-
canTranslate={
|
|
59
|
-
onPlayPress={
|
|
60
|
-
onTranslationPress={
|
|
82
|
+
playerState={playerState}
|
|
83
|
+
isTranslationActive={isTranslationActive}
|
|
84
|
+
canTranslate={hasTranscriptText}
|
|
85
|
+
onPlayPress={handlePlayPress}
|
|
86
|
+
onTranslationPress={handleTranslationToggle}
|
|
61
87
|
/>
|
|
62
88
|
)}
|
|
63
89
|
</View>
|
|
64
90
|
|
|
65
91
|
{isLargeVariant ? (
|
|
66
|
-
<VoiceTranscriptContent text={
|
|
92
|
+
<VoiceTranscriptContent text={activeTranscriptText} isLoading={isActiveTranscriptLoading} />
|
|
67
93
|
) : (
|
|
68
94
|
<VoiceTranscriptionCollapsible
|
|
69
|
-
text={
|
|
70
|
-
isLoading={
|
|
95
|
+
text={activeTranscriptText}
|
|
96
|
+
isLoading={isActiveTranscriptLoading}
|
|
71
97
|
dropdown={model.dropdown}
|
|
72
98
|
/>
|
|
73
99
|
)}
|
|
@@ -77,30 +103,21 @@ export const VoiceTranscription = ({
|
|
|
77
103
|
|
|
78
104
|
const styles = StyleSheet.create({
|
|
79
105
|
container: {
|
|
80
|
-
padding: 4,
|
|
81
|
-
boxShadow: '0px 1px 3px 0px rgba(51, 51, 51, 0.25)',
|
|
82
|
-
borderRadius: 12,
|
|
83
|
-
backgroundColor: COLORS.NEUTRAL_1,
|
|
84
|
-
overflow: 'hidden',
|
|
85
|
-
},
|
|
86
|
-
// SMALL: floats over the drawing area; consumer-positioned siblings sit
|
|
87
|
-
// beneath it. Absolute positioning is intentional here.
|
|
88
|
-
smallContainer: {
|
|
89
106
|
position: 'absolute',
|
|
90
107
|
top: 56,
|
|
91
|
-
left:
|
|
108
|
+
left: 8,
|
|
92
109
|
width: 222,
|
|
93
110
|
maxHeight: 405,
|
|
94
111
|
minHeight: 51,
|
|
112
|
+
padding: 4,
|
|
113
|
+
boxShadow: '0px 1px 3px 0px rgba(51, 51, 51, 0.25)',
|
|
114
|
+
borderRadius: 12,
|
|
115
|
+
backgroundColor: COLORS.NEUTRAL_1,
|
|
116
|
+
overflow: 'hidden',
|
|
95
117
|
},
|
|
96
|
-
// LARGE: rendered as a flex child of the SolutionCard's column flow,
|
|
97
|
-
// between the header and footer. Auto-sizes to whatever space the footer
|
|
98
|
-
// (with or without the playable timeline) leaves — no magic numbers.
|
|
99
118
|
largeContainer: {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
marginTop: SPACING[200],
|
|
103
|
-
marginBottom: SPACING[200],
|
|
119
|
+
width: '98%',
|
|
120
|
+
height: '100%',
|
|
104
121
|
},
|
|
105
122
|
header: {
|
|
106
123
|
flexDirection: 'row',
|
|
@@ -2,8 +2,8 @@ import { CaretDownIcon } from '@magmamath/react-native-ui'
|
|
|
2
2
|
import React, { useCallback } from 'react'
|
|
3
3
|
import { StyleSheet, TouchableOpacity, View } from 'react-native'
|
|
4
4
|
import Animated from 'react-native-reanimated'
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { useVoiceTranscriptionDropdown } from '../hooks/useVoiceTranscription'
|
|
6
|
+
import { VoiceTranscriptionModel } from '../model/VoiceTranscription.model'
|
|
7
7
|
import { VoiceTranscriptContent } from './VoiceTranscriptContent'
|
|
8
8
|
|
|
9
9
|
const AnimatedTouchableOpacity = Animated.createAnimatedComponent(TouchableOpacity)
|
|
@@ -11,7 +11,7 @@ const AnimatedTouchableOpacity = Animated.createAnimatedComponent(TouchableOpaci
|
|
|
11
11
|
type VoiceTranscriptionCollapsibleProps = {
|
|
12
12
|
text: string
|
|
13
13
|
isLoading: boolean
|
|
14
|
-
dropdown:
|
|
14
|
+
dropdown: VoiceTranscriptionModel
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export const VoiceTranscriptionCollapsible = ({
|
|
@@ -20,7 +20,7 @@ export const VoiceTranscriptionCollapsible = ({
|
|
|
20
20
|
dropdown,
|
|
21
21
|
}: VoiceTranscriptionCollapsibleProps) => {
|
|
22
22
|
const { listAnimatedStyle, iconAnimatedStyle, onListLayout } =
|
|
23
|
-
|
|
23
|
+
useVoiceTranscriptionDropdown(dropdown)
|
|
24
24
|
|
|
25
25
|
const handleToggle = useCallback(() => {
|
|
26
26
|
dropdown.toggleExpand()
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Button, COLORS, GlobeIcon, SPACING } from '@magmamath/react-native-ui'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import { StyleSheet
|
|
3
|
+
import { StyleSheet } from 'react-native'
|
|
4
|
+
import Animated, { FadeIn, FadeOut } from 'react-native-reanimated'
|
|
4
5
|
import { ColorScheme } from '../../../chatbot/types/style.types'
|
|
5
6
|
import { PlayButton } from '../../../../shared/components/PlayButton'
|
|
6
7
|
import { PlayerState } from '../model'
|
|
@@ -28,24 +29,27 @@ export const VoiceTranscriptionHeaderActions = ({
|
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
return (
|
|
31
|
-
<View
|
|
32
|
+
<Animated.View
|
|
33
|
+
entering={FadeIn.duration(120)}
|
|
34
|
+
exiting={FadeOut.duration(120)}
|
|
35
|
+
style={styles.container}
|
|
36
|
+
>
|
|
32
37
|
<PlayButton
|
|
33
38
|
state={playButtonState}
|
|
34
39
|
onPress={onPlayPress}
|
|
35
40
|
activityIndicatorColor={COLORS.NEUTRAL_1}
|
|
36
|
-
colorScheme={ColorScheme.Yellow}
|
|
37
41
|
/>
|
|
38
42
|
{canTranslate && (
|
|
39
43
|
<Button
|
|
40
44
|
variant="secondary"
|
|
41
45
|
size="small"
|
|
42
|
-
colorScheme={ColorScheme.
|
|
46
|
+
colorScheme={ColorScheme.Blue}
|
|
43
47
|
isActive={isTranslationActive}
|
|
44
48
|
onPress={onTranslationPress}
|
|
45
49
|
icon={<GlobeIcon color={isTranslationActive ? COLORS.NEUTRAL_1 : COLORS.NEUTRAL_9} />}
|
|
46
50
|
/>
|
|
47
51
|
)}
|
|
48
|
-
</View>
|
|
52
|
+
</Animated.View>
|
|
49
53
|
)
|
|
50
54
|
}
|
|
51
55
|
|
|
@@ -55,7 +59,4 @@ const styles = StyleSheet.create({
|
|
|
55
59
|
alignItems: 'center',
|
|
56
60
|
gap: SPACING[200],
|
|
57
61
|
},
|
|
58
|
-
hidden: {
|
|
59
|
-
opacity: 0,
|
|
60
|
-
},
|
|
61
62
|
})
|
package/src/features/voice/playing/hooks/{useDropdownAnimation.ts → useVoiceTranscription.ts}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useEffect } from 'react'
|
|
2
2
|
import { useUnit } from 'effector-react'
|
|
3
3
|
import { useAnimatedStyle, useSharedValue, withTiming, interpolate } from 'react-native-reanimated'
|
|
4
|
-
import {
|
|
4
|
+
import { VoiceTranscriptionModel } from '../model/VoiceTranscription.model'
|
|
5
5
|
import { DROPDOWN_MAX_CONTENT_HEIGHT } from '../../constants'
|
|
6
6
|
import { LayoutChangeEvent } from 'react-native'
|
|
7
7
|
|
|
8
|
-
export const
|
|
8
|
+
export const useVoiceTranscriptionDropdown = (model: VoiceTranscriptionModel) => {
|
|
9
9
|
const isExpanded = useUnit(model.$isExpanded)
|
|
10
10
|
|
|
11
11
|
const contentHeight = useSharedValue(0)
|
|
@@ -13,9 +13,9 @@ export const useDropdownAnimation = (model: DropdownModel) => {
|
|
|
13
13
|
|
|
14
14
|
const onListLayout = (event: LayoutChangeEvent) => {
|
|
15
15
|
const measuredHeight = event.nativeEvent.layout.height
|
|
16
|
-
if (measuredHeight
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
if (measuredHeight > 0) {
|
|
17
|
+
contentHeight.value = measuredHeight
|
|
18
|
+
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
const listAnimatedStyle = useAnimatedStyle(() => {
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react'
|
|
2
|
+
import { AnswerAudio } from '../../types'
|
|
3
|
+
import { VoicePlayerModel } from '../model'
|
|
4
|
+
|
|
5
|
+
type Params = {
|
|
6
|
+
model: VoicePlayerModel
|
|
7
|
+
answers: AnswerAudio[]
|
|
8
|
+
answersKey: string
|
|
9
|
+
problemId: string
|
|
10
|
+
activeAttempt: number | null
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const useVoiceTranscriptionEffects = ({
|
|
14
|
+
model,
|
|
15
|
+
answers,
|
|
16
|
+
answersKey,
|
|
17
|
+
problemId,
|
|
18
|
+
activeAttempt,
|
|
19
|
+
}: Params) => {
|
|
20
|
+
const answersRef = useRef(answers)
|
|
21
|
+
answersRef.current = answers
|
|
22
|
+
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
model.reinitializePlayer()
|
|
25
|
+
return () => model.cleanup()
|
|
26
|
+
}, [model])
|
|
27
|
+
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
const lastAnswerHasNoDrawing = !answers[answers.length - 1]?.drawing
|
|
30
|
+
model.dropdown.setExpanded(answers.length > 0 && lastAnswerHasNoDrawing)
|
|
31
|
+
model.resetPlayer()
|
|
32
|
+
}, [problemId])
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (answersRef.current.some((answer) => answer.audioFileId)) {
|
|
36
|
+
model.initializeWithAudios(answersRef.current)
|
|
37
|
+
model.loader.loadAllTranscripts()
|
|
38
|
+
}
|
|
39
|
+
}, [model, answersKey])
|
|
40
|
+
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
model.stopAudio()
|
|
43
|
+
}, [activeAttempt])
|
|
44
|
+
}
|
|
@@ -11,7 +11,6 @@ export const enum PlayerState {
|
|
|
11
11
|
export class PlayerModel {
|
|
12
12
|
public player: AudioPlayer | null = createAudioPlayer()
|
|
13
13
|
private stopped = false
|
|
14
|
-
private primedUri: string | null = null
|
|
15
14
|
|
|
16
15
|
public readonly reset = createEvent()
|
|
17
16
|
public readonly setPlayerState = createEvent<PlayerState>()
|
|
@@ -40,32 +39,12 @@ export class PlayerModel {
|
|
|
40
39
|
this.stopped = true
|
|
41
40
|
if (this.player) {
|
|
42
41
|
this.player.replace('')
|
|
43
|
-
this.primedUri = null
|
|
44
42
|
this.setPlayerState(PlayerState.IDLE)
|
|
45
43
|
} else {
|
|
46
44
|
console.warn('Cannot stop: audio player not initialized')
|
|
47
45
|
}
|
|
48
46
|
})
|
|
49
47
|
|
|
50
|
-
public readonly prime = createEffect((uri: string) => {
|
|
51
|
-
if (!this.player) return
|
|
52
|
-
if (this.primedUri === uri) return
|
|
53
|
-
this.primedUri = uri
|
|
54
|
-
this.player.replace(uri)
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
public readonly seek = createEffect(async (seconds: number) => {
|
|
58
|
-
if (!this.player) {
|
|
59
|
-
console.warn('Cannot seek: audio player not initialized')
|
|
60
|
-
return
|
|
61
|
-
}
|
|
62
|
-
if (!this.player.isLoaded) {
|
|
63
|
-
console.warn('Cannot seek: audio player not loaded')
|
|
64
|
-
return
|
|
65
|
-
}
|
|
66
|
-
await this.player.seekTo(seconds)
|
|
67
|
-
})
|
|
68
|
-
|
|
69
48
|
public readonly resume = createEffect(() => {
|
|
70
49
|
if (this.player) {
|
|
71
50
|
this.player.play()
|
|
@@ -82,10 +61,7 @@ export class PlayerModel {
|
|
|
82
61
|
}
|
|
83
62
|
|
|
84
63
|
this.stopped = false
|
|
85
|
-
|
|
86
|
-
this.player.replace(uri)
|
|
87
|
-
this.primedUri = uri
|
|
88
|
-
}
|
|
64
|
+
this.player.replace(uri)
|
|
89
65
|
|
|
90
66
|
const waitForLoad = () => {
|
|
91
67
|
if (this.stopped) return
|
|
@@ -123,7 +99,6 @@ export class PlayerModel {
|
|
|
123
99
|
this.player.release()
|
|
124
100
|
this.player = null
|
|
125
101
|
}
|
|
126
|
-
this.primedUri = null
|
|
127
102
|
this.reset()
|
|
128
103
|
}
|
|
129
104
|
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { createEffect, createEvent, restore } from 'effector'
|
|
2
|
+
import { VoiceTranscriptionsCollection } from './VoiceTranscriptionsCollection'
|
|
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
|
+
export class TranscriptionsDownloaderModel {
|
|
11
|
+
private readonly collection: VoiceTranscriptionsCollection
|
|
12
|
+
private readonly api: VoicePlayerApi
|
|
13
|
+
|
|
14
|
+
public readonly setTranscriptsLoaded = createEvent<boolean>()
|
|
15
|
+
public readonly reset = createEvent()
|
|
16
|
+
|
|
17
|
+
public readonly $transcriptsLoaded = restore(this.setTranscriptsLoaded, false).reset(this.reset)
|
|
18
|
+
|
|
19
|
+
constructor(collection: VoiceTranscriptionsCollection, api: VoicePlayerApi) {
|
|
20
|
+
this.collection = collection
|
|
21
|
+
this.api = api
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
private async fetchTranscriptWithRetry(audioFileId: string): Promise<string> {
|
|
25
|
+
for (let attempt = 0; attempt < TRANSCRIPT_MAX_RETRIES; attempt++) {
|
|
26
|
+
const response = await this.api.getAudioFileTranscript(audioFileId)
|
|
27
|
+
|
|
28
|
+
if (response.status === 'completed') {
|
|
29
|
+
return response.text
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (response.status === 'failed') {
|
|
33
|
+
return NO_AUDIO_BE_MESSAGE
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (attempt < TRANSCRIPT_MAX_RETRIES - 1) {
|
|
37
|
+
await new Promise((resolve) => setTimeout(resolve, TRANSCRIPT_RETRY_INTERVAL_MS))
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return NO_AUDIO_BE_MESSAGE
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public readonly loadAllTranscripts = createEffect(async () => {
|
|
44
|
+
const attempts = this.collection.getAll()
|
|
45
|
+
|
|
46
|
+
const transcriptPromises = attempts.map(async (item) => {
|
|
47
|
+
if (this.collection.hasTranscript(item.attemptNumber)) {
|
|
48
|
+
return
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
this.collection.update(item.attemptNumber, { transcriptLoading: true })
|
|
52
|
+
|
|
53
|
+
try {
|
|
54
|
+
const text = await this.fetchTranscriptWithRetry(item.audioFileId)
|
|
55
|
+
|
|
56
|
+
this.collection.update(item.attemptNumber, {
|
|
57
|
+
transcript: text,
|
|
58
|
+
transcriptLoading: false,
|
|
59
|
+
transcriptError: undefined,
|
|
60
|
+
})
|
|
61
|
+
} catch (error) {
|
|
62
|
+
this.collection.update(item.attemptNumber, {
|
|
63
|
+
transcriptLoading: false,
|
|
64
|
+
transcriptError: error instanceof Error ? error.message : 'Failed to load transcript',
|
|
65
|
+
})
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
await Promise.all(transcriptPromises)
|
|
70
|
+
this.setTranscriptsLoaded(true)
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
public getTranscript(attemptNumber: number): string | undefined {
|
|
74
|
+
return this.collection.get(attemptNumber)?.transcript
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
public isTranscriptLoading(attemptNumber: number): boolean {
|
|
78
|
+
return this.collection.get(attemptNumber)?.transcriptLoading || false
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -13,9 +13,9 @@ type DownloadResult = {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export class VoiceFileDownloaderModel {
|
|
16
|
-
private
|
|
16
|
+
private api!: VoicePlayerApi
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
public readonly setApi = (api: VoicePlayerApi) => {
|
|
19
19
|
this.api = api
|
|
20
20
|
}
|
|
21
21
|
|