@magmamath/students-features 1.3.23-rc.2 → 1.3.23-rc.21
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/translation/constants.js +11 -0
- package/dist/commonjs/features/translation/constants.js.map +1 -0
- package/dist/commonjs/features/translation/helpers.js +60 -0
- package/dist/commonjs/features/translation/helpers.js.map +1 -0
- package/dist/commonjs/features/translation/index.js +105 -0
- package/dist/commonjs/features/translation/index.js.map +1 -0
- package/dist/commonjs/features/translation/model/TranslationModel.js +122 -0
- package/dist/commonjs/features/translation/model/TranslationModel.js.map +1 -0
- package/dist/commonjs/features/translation/model/TranslationPreprocessor.js +142 -0
- package/dist/commonjs/features/translation/model/TranslationPreprocessor.js.map +1 -0
- package/dist/commonjs/features/translation/model/TranslationService.js +112 -0
- package/dist/commonjs/features/translation/model/TranslationService.js.map +1 -0
- package/dist/commonjs/features/translation/preserve/wordsToPreserve.js +314 -0
- package/dist/commonjs/features/translation/preserve/wordsToPreserve.js.map +1 -0
- package/dist/commonjs/features/translation/providers/google/GoogleTranslationProvider.js +50 -0
- package/dist/commonjs/features/translation/providers/google/GoogleTranslationProvider.js.map +1 -0
- package/dist/commonjs/features/translation/providers/google/supportedLanguages.js +230 -0
- package/dist/commonjs/features/translation/providers/google/supportedLanguages.js.map +1 -0
- package/dist/commonjs/features/translation/providers/google.types.js +2 -0
- package/dist/commonjs/features/translation/providers/google.types.js.map +1 -0
- package/dist/commonjs/features/translation/providers/translation.interface.js +49 -0
- package/dist/commonjs/features/translation/providers/translation.interface.js.map +1 -0
- package/dist/commonjs/features/translation/types.js +2 -0
- package/dist/commonjs/features/translation/types.js.map +1 -0
- package/dist/commonjs/features/voice/index.js +4 -4
- package/dist/commonjs/features/voice/index.js.map +1 -1
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptContent.js +44 -0
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptContent.js.map +1 -0
- package/dist/commonjs/features/voice/playing/components/VoiceTranscription.js +107 -0
- package/dist/commonjs/features/voice/playing/components/VoiceTranscription.js.map +1 -0
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.js +66 -0
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.js.map +1 -0
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.js +58 -0
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.js.map +1 -0
- package/dist/commonjs/features/voice/playing/hooks/{useVoiceTranscriptionsDropdown.js → useDropdownAnimation.js} +8 -7
- package/dist/commonjs/features/voice/playing/hooks/useDropdownAnimation.js.map +1 -0
- package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.js +128 -0
- package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.js.map +1 -0
- package/dist/commonjs/features/voice/playing/model/{VoiceTranscriptionsDropdown.model.js → Dropdown.model.js} +4 -4
- package/dist/commonjs/features/voice/playing/model/Dropdown.model.js.map +1 -0
- package/dist/commonjs/features/voice/playing/model/PlaybackController.js +183 -0
- package/dist/commonjs/features/voice/playing/model/PlaybackController.js.map +1 -0
- package/dist/commonjs/features/voice/playing/model/Player.model.js +24 -1
- package/dist/commonjs/features/voice/playing/model/Player.model.js.map +1 -1
- package/dist/commonjs/features/voice/playing/model/{VoiceTranscriptionsCollection.js → TranscriptionsCollection.js} +4 -4
- package/dist/commonjs/features/voice/playing/model/TranscriptionsCollection.js.map +1 -0
- package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.js +82 -0
- package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.js.map +1 -0
- package/dist/commonjs/features/voice/playing/model/Translation.model.js +62 -0
- package/dist/commonjs/features/voice/playing/model/Translation.model.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 +46 -172
- package/dist/commonjs/features/voice/playing/model/VoicePlayer.model.js.map +1 -1
- package/dist/commonjs/features/voice/types.js.map +1 -1
- package/dist/commonjs/index.js +12 -0
- package/dist/commonjs/index.js.map +1 -1
- package/dist/module/features/translation/constants.js +7 -0
- package/dist/module/features/translation/constants.js.map +1 -0
- package/dist/module/features/translation/helpers.js +53 -0
- package/dist/module/features/translation/helpers.js.map +1 -0
- package/dist/module/features/translation/index.js +12 -0
- package/dist/module/features/translation/index.js.map +1 -0
- package/dist/module/features/translation/model/TranslationModel.js +117 -0
- package/dist/module/features/translation/model/TranslationModel.js.map +1 -0
- package/dist/module/features/translation/model/TranslationPreprocessor.js +137 -0
- package/dist/module/features/translation/model/TranslationPreprocessor.js.map +1 -0
- package/dist/module/features/translation/model/TranslationService.js +107 -0
- package/dist/module/features/translation/model/TranslationService.js.map +1 -0
- package/dist/module/features/translation/preserve/wordsToPreserve.js +310 -0
- package/dist/module/features/translation/preserve/wordsToPreserve.js.map +1 -0
- package/dist/module/features/translation/providers/google/GoogleTranslationProvider.js +45 -0
- package/dist/module/features/translation/providers/google/GoogleTranslationProvider.js.map +1 -0
- package/dist/module/features/translation/providers/google/supportedLanguages.js +225 -0
- package/dist/module/features/translation/providers/google/supportedLanguages.js.map +1 -0
- package/dist/module/features/translation/providers/google.types.js +2 -0
- package/dist/module/features/translation/providers/google.types.js.map +1 -0
- package/dist/module/features/translation/providers/translation.interface.js +44 -0
- package/dist/module/features/translation/providers/translation.interface.js.map +1 -0
- package/dist/module/features/translation/types.js +2 -0
- package/dist/module/features/translation/types.js.map +1 -0
- package/dist/module/features/voice/index.js +1 -1
- package/dist/module/features/voice/index.js.map +1 -1
- package/dist/module/features/voice/playing/components/VoiceTranscriptContent.js +38 -0
- package/dist/module/features/voice/playing/components/VoiceTranscriptContent.js.map +1 -0
- package/dist/module/features/voice/playing/components/VoiceTranscription.js +101 -0
- package/dist/module/features/voice/playing/components/VoiceTranscription.js.map +1 -0
- package/dist/module/features/voice/playing/components/VoiceTranscriptionCollapsible.js +58 -0
- package/dist/module/features/voice/playing/components/VoiceTranscriptionCollapsible.js.map +1 -0
- package/dist/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.js +52 -0
- package/dist/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.js.map +1 -0
- package/dist/module/features/voice/playing/hooks/{useVoiceTranscriptionsDropdown.js → useDropdownAnimation.js} +6 -5
- package/dist/module/features/voice/playing/hooks/useDropdownAnimation.js.map +1 -0
- package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionController.js +123 -0
- package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionController.js.map +1 -0
- package/dist/module/features/voice/playing/model/{VoiceTranscriptionsDropdown.model.js → Dropdown.model.js} +2 -2
- package/dist/module/features/voice/playing/model/Dropdown.model.js.map +1 -0
- package/dist/module/features/voice/playing/model/PlaybackController.js +178 -0
- package/dist/module/features/voice/playing/model/PlaybackController.js.map +1 -0
- package/dist/module/features/voice/playing/model/Player.model.js +24 -1
- package/dist/module/features/voice/playing/model/Player.model.js.map +1 -1
- package/dist/module/features/voice/playing/model/{VoiceTranscriptionsCollection.js → TranscriptionsCollection.js} +2 -2
- package/dist/module/features/voice/playing/model/TranscriptionsCollection.js.map +1 -0
- package/dist/module/features/voice/playing/model/TranscriptionsDownloader.model.js +77 -0
- package/dist/module/features/voice/playing/model/TranscriptionsDownloader.model.js.map +1 -0
- package/dist/module/features/voice/playing/model/Translation.model.js +57 -0
- package/dist/module/features/voice/playing/model/Translation.model.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 +48 -174
- package/dist/module/features/voice/playing/model/VoicePlayer.model.js.map +1 -1
- package/dist/module/features/voice/types.js.map +1 -1
- package/dist/module/index.js +1 -0
- package/dist/module/index.js.map +1 -1
- package/dist/typescript/commonjs/features/translation/constants.d.ts +5 -0
- package/dist/typescript/commonjs/features/translation/constants.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/translation/helpers.d.ts +9 -0
- package/dist/typescript/commonjs/features/translation/helpers.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/translation/index.d.ts +12 -0
- package/dist/typescript/commonjs/features/translation/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/translation/model/TranslationModel.d.ts +33 -0
- package/dist/typescript/commonjs/features/translation/model/TranslationModel.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/translation/model/TranslationPreprocessor.d.ts +34 -0
- package/dist/typescript/commonjs/features/translation/model/TranslationPreprocessor.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/translation/model/TranslationService.d.ts +40 -0
- package/dist/typescript/commonjs/features/translation/model/TranslationService.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/translation/preserve/wordsToPreserve.d.ts +3 -0
- package/dist/typescript/commonjs/features/translation/preserve/wordsToPreserve.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/translation/providers/google/GoogleTranslationProvider.d.ts +17 -0
- package/dist/typescript/commonjs/features/translation/providers/google/GoogleTranslationProvider.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/translation/providers/google/supportedLanguages.d.ts +209 -0
- package/dist/typescript/commonjs/features/translation/providers/google/supportedLanguages.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/translation/providers/google.types.d.ts +15 -0
- package/dist/typescript/commonjs/features/translation/providers/google.types.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/translation/providers/translation.interface.d.ts +30 -0
- package/dist/typescript/commonjs/features/translation/providers/translation.interface.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/translation/types.d.ts +27 -0
- package/dist/typescript/commonjs/features/translation/types.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/index.d.ts +2 -1
- package/dist/typescript/commonjs/features/voice/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptContent.d.ts +8 -0
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptContent.d.ts.map +1 -0
- package/dist/typescript/{module/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts → commonjs/features/voice/playing/components/VoiceTranscription.d.ts} +3 -4
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscription.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts +10 -0
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.d.ts +12 -0
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.d.ts.map +1 -0
- package/dist/typescript/{module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts → commonjs/features/voice/playing/hooks/useDropdownAnimation.d.ts} +3 -3
- package/dist/typescript/commonjs/features/voice/playing/hooks/useDropdownAnimation.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts +30 -0
- package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts.map +1 -0
- package/dist/typescript/{module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts → commonjs/features/voice/playing/model/Dropdown.model.d.ts} +2 -2
- package/dist/typescript/commonjs/features/voice/playing/model/Dropdown.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/model/PlaybackController.d.ts +28 -0
- package/dist/typescript/commonjs/features/voice/playing/model/PlaybackController.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/model/Player.model.d.ts +3 -0
- package/dist/typescript/commonjs/features/voice/playing/model/Player.model.d.ts.map +1 -1
- package/dist/typescript/{module/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts → commonjs/features/voice/playing/model/TranscriptionsCollection.d.ts} +2 -2
- package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsCollection.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.d.ts +19 -0
- package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/model/Translation.model.d.ts +25 -0
- package/dist/typescript/commonjs/features/voice/playing/model/Translation.model.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 +18 -18
- package/dist/typescript/commonjs/features/voice/playing/model/VoicePlayer.model.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/types.d.ts +5 -1
- package/dist/typescript/commonjs/features/voice/types.d.ts.map +1 -1
- package/dist/typescript/commonjs/index.d.ts +1 -0
- package/dist/typescript/commonjs/index.d.ts.map +1 -1
- package/dist/typescript/module/features/translation/constants.d.ts +5 -0
- package/dist/typescript/module/features/translation/constants.d.ts.map +1 -0
- package/dist/typescript/module/features/translation/helpers.d.ts +9 -0
- package/dist/typescript/module/features/translation/helpers.d.ts.map +1 -0
- package/dist/typescript/module/features/translation/index.d.ts +12 -0
- package/dist/typescript/module/features/translation/index.d.ts.map +1 -0
- package/dist/typescript/module/features/translation/model/TranslationModel.d.ts +33 -0
- package/dist/typescript/module/features/translation/model/TranslationModel.d.ts.map +1 -0
- package/dist/typescript/module/features/translation/model/TranslationPreprocessor.d.ts +34 -0
- package/dist/typescript/module/features/translation/model/TranslationPreprocessor.d.ts.map +1 -0
- package/dist/typescript/module/features/translation/model/TranslationService.d.ts +40 -0
- package/dist/typescript/module/features/translation/model/TranslationService.d.ts.map +1 -0
- package/dist/typescript/module/features/translation/preserve/wordsToPreserve.d.ts +3 -0
- package/dist/typescript/module/features/translation/preserve/wordsToPreserve.d.ts.map +1 -0
- package/dist/typescript/module/features/translation/providers/google/GoogleTranslationProvider.d.ts +17 -0
- package/dist/typescript/module/features/translation/providers/google/GoogleTranslationProvider.d.ts.map +1 -0
- package/dist/typescript/module/features/translation/providers/google/supportedLanguages.d.ts +209 -0
- package/dist/typescript/module/features/translation/providers/google/supportedLanguages.d.ts.map +1 -0
- package/dist/typescript/module/features/translation/providers/google.types.d.ts +15 -0
- package/dist/typescript/module/features/translation/providers/google.types.d.ts.map +1 -0
- package/dist/typescript/module/features/translation/providers/translation.interface.d.ts +30 -0
- package/dist/typescript/module/features/translation/providers/translation.interface.d.ts.map +1 -0
- package/dist/typescript/module/features/translation/types.d.ts +27 -0
- package/dist/typescript/module/features/translation/types.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/index.d.ts +2 -1
- package/dist/typescript/module/features/voice/index.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptContent.d.ts +8 -0
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptContent.d.ts.map +1 -0
- package/dist/typescript/{commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts → module/features/voice/playing/components/VoiceTranscription.d.ts} +3 -4
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscription.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts +10 -0
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.d.ts +12 -0
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.d.ts.map +1 -0
- package/dist/typescript/{commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts → module/features/voice/playing/hooks/useDropdownAnimation.d.ts} +3 -3
- package/dist/typescript/module/features/voice/playing/hooks/useDropdownAnimation.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts +30 -0
- package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts.map +1 -0
- package/dist/typescript/{commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts → module/features/voice/playing/model/Dropdown.model.d.ts} +2 -2
- package/dist/typescript/module/features/voice/playing/model/Dropdown.model.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/model/PlaybackController.d.ts +28 -0
- package/dist/typescript/module/features/voice/playing/model/PlaybackController.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/model/Player.model.d.ts +3 -0
- package/dist/typescript/module/features/voice/playing/model/Player.model.d.ts.map +1 -1
- package/dist/typescript/{commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts → module/features/voice/playing/model/TranscriptionsCollection.d.ts} +2 -2
- package/dist/typescript/module/features/voice/playing/model/TranscriptionsCollection.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloader.model.d.ts +19 -0
- package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloader.model.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/model/Translation.model.d.ts +25 -0
- package/dist/typescript/module/features/voice/playing/model/Translation.model.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 +18 -18
- package/dist/typescript/module/features/voice/playing/model/VoicePlayer.model.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/types.d.ts +5 -1
- package/dist/typescript/module/features/voice/types.d.ts.map +1 -1
- package/dist/typescript/module/index.d.ts +1 -0
- package/dist/typescript/module/index.d.ts.map +1 -1
- package/package.json +28 -1
- package/src/features/translation/constants.ts +4 -0
- package/src/features/translation/helpers.ts +63 -0
- package/src/features/translation/index.ts +30 -0
- package/src/features/translation/model/TranslationModel.ts +174 -0
- package/src/features/translation/model/TranslationPreprocessor.ts +171 -0
- package/src/features/translation/model/TranslationService.ts +148 -0
- package/src/features/translation/preserve/wordsToPreserve.ts +87 -0
- package/src/features/translation/providers/google/GoogleTranslationProvider.ts +50 -0
- package/src/features/translation/providers/google/supportedLanguages.ts +229 -0
- package/src/features/translation/providers/google.types.ts +16 -0
- package/src/features/translation/providers/translation.interface.ts +63 -0
- package/src/features/translation/types.ts +30 -0
- package/src/features/voice/index.ts +2 -1
- package/src/features/voice/playing/components/VoiceTranscriptContent.tsx +37 -0
- package/src/features/voice/playing/components/VoiceTranscription.tsx +117 -0
- package/src/features/voice/playing/components/VoiceTranscriptionCollapsible.tsx +59 -0
- package/src/features/voice/playing/components/VoiceTranscriptionHeaderActions.tsx +61 -0
- package/src/features/voice/playing/hooks/{useVoiceTranscriptionsDropdown.ts → useDropdownAnimation.ts} +5 -5
- package/src/features/voice/playing/hooks/useVoiceTranscriptionController.ts +171 -0
- package/src/features/voice/playing/model/{VoiceTranscriptionsDropdown.model.ts → Dropdown.model.ts} +2 -2
- package/src/features/voice/playing/model/PlaybackController.ts +213 -0
- package/src/features/voice/playing/model/Player.model.ts +26 -1
- package/src/features/voice/playing/model/{VoiceTranscriptionsCollection.ts → TranscriptionsCollection.ts} +1 -1
- package/src/features/voice/playing/model/TranscriptionsDownloader.model.ts +88 -0
- package/src/features/voice/playing/model/Translation.model.ts +75 -0
- package/src/features/voice/playing/model/VoiceFileDownloader.model.ts +2 -2
- package/src/features/voice/playing/model/VoicePlayer.model.ts +57 -194
- package/src/features/voice/types.ts +10 -0
- package/src/index.ts +1 -0
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.js +0 -251
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.js.map +0 -1
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js +0 -109
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js.map +0 -1
- package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js.map +0 -1
- package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js +0 -34
- package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js.map +0 -1
- package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.js +0 -66
- package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.js.map +0 -1
- package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.js.map +0 -1
- package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js.map +0 -1
- package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdown.js +0 -244
- package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdown.js.map +0 -1
- package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js +0 -103
- package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js.map +0 -1
- package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js.map +0 -1
- package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js +0 -29
- package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js.map +0 -1
- package/dist/module/features/voice/playing/model/TranscriptionsDownloaderModel.js +0 -61
- package/dist/module/features/voice/playing/model/TranscriptionsDownloaderModel.js.map +0 -1
- package/dist/module/features/voice/playing/model/VoiceTranscriptionsCollection.js.map +0 -1
- package/dist/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts +0 -12
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts +0 -11
- package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts +0 -15
- package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts +0 -12
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts +0 -11
- package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts +0 -15
- package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts.map +0 -1
- package/src/features/voice/playing/components/VoiceTranscriptionsDropdown.tsx +0 -302
- package/src/features/voice/playing/components/VoiceTranscriptionsDropdownItem.tsx +0 -128
- package/src/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.ts +0 -40
- package/src/features/voice/playing/model/TranscriptionsDownloaderModel.ts +0 -80
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { Pressable, StyleSheet, View } from 'react-native'
|
|
2
|
-
import React, { memo, useCallback, useRef } from 'react'
|
|
3
|
-
import {
|
|
4
|
-
Button,
|
|
5
|
-
ButtonSize,
|
|
6
|
-
ButtonVariant,
|
|
7
|
-
COLORS,
|
|
8
|
-
Loader,
|
|
9
|
-
LoaderColor,
|
|
10
|
-
LoaderSize,
|
|
11
|
-
Typography,
|
|
12
|
-
} from '@magmamath/react-native-ui'
|
|
13
|
-
import Animated, { runOnJS, useAnimatedReaction } from 'react-native-reanimated'
|
|
14
|
-
import { useVoiceTranscriptionsDropdownItemAnimation } from '../hooks/useVoiceTranscriptionsDropdownItemAnimation'
|
|
15
|
-
import { useText } from '../../../../i18n/i18n'
|
|
16
|
-
|
|
17
|
-
type VoiceTranscriptionsDropdownItemProps = {
|
|
18
|
-
attempt: number
|
|
19
|
-
content: string
|
|
20
|
-
isActive: boolean
|
|
21
|
-
isLoading?: boolean
|
|
22
|
-
onToggle: (attempt: number) => void
|
|
23
|
-
scrollToAttempt: (attempt: number) => void
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export const VoiceTranscriptionsDropdownItem = memo(
|
|
27
|
-
({
|
|
28
|
-
attempt,
|
|
29
|
-
content,
|
|
30
|
-
isActive,
|
|
31
|
-
isLoading,
|
|
32
|
-
onToggle,
|
|
33
|
-
scrollToAttempt,
|
|
34
|
-
}: VoiceTranscriptionsDropdownItemProps) => {
|
|
35
|
-
const t = useText()
|
|
36
|
-
const isActiveRef = useRef(isActive)
|
|
37
|
-
isActiveRef.current = isActive
|
|
38
|
-
|
|
39
|
-
const { contentAnimatedStyle, onLayout, progress } =
|
|
40
|
-
useVoiceTranscriptionsDropdownItemAnimation(isActive)
|
|
41
|
-
|
|
42
|
-
const handleScrollToAttempt = useCallback(
|
|
43
|
-
(attemptNumber: number) => {
|
|
44
|
-
if (!isActiveRef.current) return
|
|
45
|
-
scrollToAttempt(attemptNumber)
|
|
46
|
-
},
|
|
47
|
-
[scrollToAttempt],
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
useAnimatedReaction(
|
|
51
|
-
() => progress.value,
|
|
52
|
-
(progress) => {
|
|
53
|
-
if (progress === 1 && isActive) {
|
|
54
|
-
runOnJS(handleScrollToAttempt)(attempt)
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
[progress, attempt, isActive],
|
|
58
|
-
)
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<View style={styles.container}>
|
|
62
|
-
<Pressable disabled={isActive} style={styles.itemHeader} onPress={() => onToggle(attempt)}>
|
|
63
|
-
<Button
|
|
64
|
-
onPress={() => !isActive && onToggle(attempt)}
|
|
65
|
-
size={ButtonSize.SMALL}
|
|
66
|
-
variant={ButtonVariant.TERTIARY}
|
|
67
|
-
style={{
|
|
68
|
-
text: {
|
|
69
|
-
textTransform: 'uppercase',
|
|
70
|
-
color: isActive ? COLORS.NEUTRAL_9 : COLORS.NEUTRAL_7,
|
|
71
|
-
},
|
|
72
|
-
}}
|
|
73
|
-
>
|
|
74
|
-
{t('voice.attempt', { number: String(attempt) })}
|
|
75
|
-
</Button>
|
|
76
|
-
</Pressable>
|
|
77
|
-
{isLoading ? (
|
|
78
|
-
<View style={styles.loaderContainer}>
|
|
79
|
-
<Loader size={LoaderSize.SMALL} color={LoaderColor.BLUE} />
|
|
80
|
-
</View>
|
|
81
|
-
) : (
|
|
82
|
-
<Animated.View style={contentAnimatedStyle}>
|
|
83
|
-
<View onLayout={onLayout} style={styles.contentWrapper}>
|
|
84
|
-
<Typography
|
|
85
|
-
variant="h8"
|
|
86
|
-
style={[
|
|
87
|
-
styles.itemContent,
|
|
88
|
-
{
|
|
89
|
-
color: isActive ? COLORS.NEUTRAL_9 : COLORS.NEUTRAL_7,
|
|
90
|
-
},
|
|
91
|
-
]}
|
|
92
|
-
>
|
|
93
|
-
{content}
|
|
94
|
-
</Typography>
|
|
95
|
-
</View>
|
|
96
|
-
</Animated.View>
|
|
97
|
-
)}
|
|
98
|
-
</View>
|
|
99
|
-
)
|
|
100
|
-
},
|
|
101
|
-
)
|
|
102
|
-
|
|
103
|
-
const styles = StyleSheet.create({
|
|
104
|
-
container: {
|
|
105
|
-
borderTopWidth: 1,
|
|
106
|
-
borderColor: COLORS.NEUTRAL_3,
|
|
107
|
-
},
|
|
108
|
-
itemHeader: {
|
|
109
|
-
flexDirection: 'row',
|
|
110
|
-
justifyContent: 'space-between',
|
|
111
|
-
alignItems: 'center',
|
|
112
|
-
width: '100%',
|
|
113
|
-
paddingVertical: 8,
|
|
114
|
-
},
|
|
115
|
-
itemContent: {
|
|
116
|
-
paddingHorizontal: 8,
|
|
117
|
-
},
|
|
118
|
-
contentWrapper: {
|
|
119
|
-
width: '100%',
|
|
120
|
-
position: 'absolute',
|
|
121
|
-
},
|
|
122
|
-
loaderContainer: {
|
|
123
|
-
justifyContent: 'center',
|
|
124
|
-
alignItems: 'center',
|
|
125
|
-
paddingTop: 4,
|
|
126
|
-
paddingBottom: 8,
|
|
127
|
-
},
|
|
128
|
-
})
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { useEffect } from 'react'
|
|
2
|
-
import { LayoutChangeEvent } from 'react-native'
|
|
3
|
-
import {
|
|
4
|
-
useSharedValue,
|
|
5
|
-
withTiming,
|
|
6
|
-
useDerivedValue,
|
|
7
|
-
useAnimatedStyle,
|
|
8
|
-
interpolate,
|
|
9
|
-
} from 'react-native-reanimated'
|
|
10
|
-
|
|
11
|
-
export const useVoiceTranscriptionsDropdownItemAnimation = (isExpanded: boolean) => {
|
|
12
|
-
const height = useSharedValue(0)
|
|
13
|
-
const progress = useSharedValue(isExpanded ? 1 : 0)
|
|
14
|
-
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
progress.value = withTiming(isExpanded ? 1 : 0)
|
|
17
|
-
}, [isExpanded, progress])
|
|
18
|
-
|
|
19
|
-
const derivedHeight = useDerivedValue(() => height.value * progress.value, [height, progress])
|
|
20
|
-
|
|
21
|
-
const contentAnimatedStyle = useAnimatedStyle(() => {
|
|
22
|
-
const opacity = interpolate(progress.value, [0, 0.3, 1], [0, 0, 1])
|
|
23
|
-
|
|
24
|
-
return {
|
|
25
|
-
height: derivedHeight.value,
|
|
26
|
-
opacity,
|
|
27
|
-
overflow: 'hidden',
|
|
28
|
-
}
|
|
29
|
-
}, [progress, derivedHeight])
|
|
30
|
-
|
|
31
|
-
const onLayout = (event: LayoutChangeEvent) => {
|
|
32
|
-
height.value = event.nativeEvent.layout.height
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return {
|
|
36
|
-
contentAnimatedStyle,
|
|
37
|
-
onLayout,
|
|
38
|
-
progress,
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
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
|
-
}
|