@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
package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { useEffect } from 'react';
|
|
4
|
-
import { useSharedValue, withTiming, useDerivedValue, useAnimatedStyle, interpolate } from 'react-native-reanimated';
|
|
5
|
-
export const useVoiceTranscriptionsDropdownItemAnimation = isExpanded => {
|
|
6
|
-
const height = useSharedValue(0);
|
|
7
|
-
const progress = useSharedValue(isExpanded ? 1 : 0);
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
progress.value = withTiming(isExpanded ? 1 : 0);
|
|
10
|
-
}, [isExpanded, progress]);
|
|
11
|
-
const derivedHeight = useDerivedValue(() => height.value * progress.value, [height, progress]);
|
|
12
|
-
const contentAnimatedStyle = useAnimatedStyle(() => {
|
|
13
|
-
const opacity = interpolate(progress.value, [0, 0.3, 1], [0, 0, 1]);
|
|
14
|
-
return {
|
|
15
|
-
height: derivedHeight.value,
|
|
16
|
-
opacity,
|
|
17
|
-
overflow: 'hidden'
|
|
18
|
-
};
|
|
19
|
-
}, [progress, derivedHeight]);
|
|
20
|
-
const onLayout = event => {
|
|
21
|
-
height.value = event.nativeEvent.layout.height;
|
|
22
|
-
};
|
|
23
|
-
return {
|
|
24
|
-
contentAnimatedStyle,
|
|
25
|
-
onLayout,
|
|
26
|
-
progress
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=useVoiceTranscriptionsDropdownItemAnimation.js.map
|
package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useSharedValue","withTiming","useDerivedValue","useAnimatedStyle","interpolate","useVoiceTranscriptionsDropdownItemAnimation","isExpanded","height","progress","value","derivedHeight","contentAnimatedStyle","opacity","overflow","onLayout","event","nativeEvent","layout"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.ts"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,OAAO;AAEjC,SACEC,cAAc,EACdC,UAAU,EACVC,eAAe,EACfC,gBAAgB,EAChBC,WAAW,QACN,yBAAyB;AAEhC,OAAO,MAAMC,2CAA2C,GAAIC,UAAmB,IAAK;EAClF,MAAMC,MAAM,GAAGP,cAAc,CAAC,CAAC,CAAC;EAChC,MAAMQ,QAAQ,GAAGR,cAAc,CAACM,UAAU,GAAG,CAAC,GAAG,CAAC,CAAC;EAEnDP,SAAS,CAAC,MAAM;IACdS,QAAQ,CAACC,KAAK,GAAGR,UAAU,CAACK,UAAU,GAAG,CAAC,GAAG,CAAC,CAAC;EACjD,CAAC,EAAE,CAACA,UAAU,EAAEE,QAAQ,CAAC,CAAC;EAE1B,MAAME,aAAa,GAAGR,eAAe,CAAC,MAAMK,MAAM,CAACE,KAAK,GAAGD,QAAQ,CAACC,KAAK,EAAE,CAACF,MAAM,EAAEC,QAAQ,CAAC,CAAC;EAE9F,MAAMG,oBAAoB,GAAGR,gBAAgB,CAAC,MAAM;IAClD,MAAMS,OAAO,GAAGR,WAAW,CAACI,QAAQ,CAACC,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAEnE,OAAO;MACLF,MAAM,EAAEG,aAAa,CAACD,KAAK;MAC3BG,OAAO;MACPC,QAAQ,EAAE;IACZ,CAAC;EACH,CAAC,EAAE,CAACL,QAAQ,EAAEE,aAAa,CAAC,CAAC;EAE7B,MAAMI,QAAQ,GAAIC,KAAwB,IAAK;IAC7CR,MAAM,CAACE,KAAK,GAAGM,KAAK,CAACC,WAAW,CAACC,MAAM,CAACV,MAAM;EAChD,CAAC;EAED,OAAO;IACLI,oBAAoB;IACpBG,QAAQ;IACRN;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { createEffect, createEvent, restore } from 'effector';
|
|
4
|
-
import { NO_AUDIO_BE_MESSAGE, TRANSCRIPT_MAX_RETRIES, TRANSCRIPT_RETRY_INTERVAL_MS } from "../../constants.js";
|
|
5
|
-
export class TranscriptionsDownloaderModel {
|
|
6
|
-
setTranscriptsLoaded = createEvent();
|
|
7
|
-
reset = createEvent();
|
|
8
|
-
$transcriptsLoaded = restore(this.setTranscriptsLoaded, false).reset(this.reset);
|
|
9
|
-
constructor(collection, api) {
|
|
10
|
-
this.collection = collection;
|
|
11
|
-
this.api = api;
|
|
12
|
-
}
|
|
13
|
-
async fetchTranscriptWithRetry(audioFileId) {
|
|
14
|
-
for (let attempt = 0; attempt < TRANSCRIPT_MAX_RETRIES; attempt++) {
|
|
15
|
-
const response = await this.api.getAudioFileTranscript(audioFileId);
|
|
16
|
-
if (response.status === 'completed') {
|
|
17
|
-
return response.text;
|
|
18
|
-
}
|
|
19
|
-
if (response.status === 'failed') {
|
|
20
|
-
return NO_AUDIO_BE_MESSAGE;
|
|
21
|
-
}
|
|
22
|
-
if (attempt < TRANSCRIPT_MAX_RETRIES - 1) {
|
|
23
|
-
await new Promise(resolve => setTimeout(resolve, TRANSCRIPT_RETRY_INTERVAL_MS));
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return NO_AUDIO_BE_MESSAGE;
|
|
27
|
-
}
|
|
28
|
-
loadAllTranscripts = createEffect(async () => {
|
|
29
|
-
const attempts = this.collection.getAll();
|
|
30
|
-
const transcriptPromises = attempts.map(async item => {
|
|
31
|
-
if (this.collection.hasTranscript(item.attemptNumber)) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
this.collection.update(item.attemptNumber, {
|
|
35
|
-
transcriptLoading: true
|
|
36
|
-
});
|
|
37
|
-
try {
|
|
38
|
-
const text = await this.fetchTranscriptWithRetry(item.audioFileId);
|
|
39
|
-
this.collection.update(item.attemptNumber, {
|
|
40
|
-
transcript: text,
|
|
41
|
-
transcriptLoading: false,
|
|
42
|
-
transcriptError: undefined
|
|
43
|
-
});
|
|
44
|
-
} catch (error) {
|
|
45
|
-
this.collection.update(item.attemptNumber, {
|
|
46
|
-
transcriptLoading: false,
|
|
47
|
-
transcriptError: error instanceof Error ? error.message : 'Failed to load transcript'
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
await Promise.all(transcriptPromises);
|
|
52
|
-
this.setTranscriptsLoaded(true);
|
|
53
|
-
});
|
|
54
|
-
getTranscript(attemptNumber) {
|
|
55
|
-
return this.collection.get(attemptNumber)?.transcript;
|
|
56
|
-
}
|
|
57
|
-
isTranscriptLoading(attemptNumber) {
|
|
58
|
-
return this.collection.get(attemptNumber)?.transcriptLoading || false;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=TranscriptionsDownloaderModel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createEffect","createEvent","restore","NO_AUDIO_BE_MESSAGE","TRANSCRIPT_MAX_RETRIES","TRANSCRIPT_RETRY_INTERVAL_MS","TranscriptionsDownloaderModel","setTranscriptsLoaded","reset","$transcriptsLoaded","constructor","collection","api","fetchTranscriptWithRetry","audioFileId","attempt","response","getAudioFileTranscript","status","text","Promise","resolve","setTimeout","loadAllTranscripts","attempts","getAll","transcriptPromises","map","item","hasTranscript","attemptNumber","update","transcriptLoading","transcript","transcriptError","undefined","error","Error","message","all","getTranscript","get","isTranscriptLoading"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/TranscriptionsDownloaderModel.ts"],"mappings":";;AAAA,SAASA,YAAY,EAAEC,WAAW,EAAEC,OAAO,QAAQ,UAAU;AAG7D,SACEC,mBAAmB,EACnBC,sBAAsB,EACtBC,4BAA4B,QACvB,oBAAiB;AAExB,OAAO,MAAMC,6BAA6B,CAAC;EAIzBC,oBAAoB,GAAGN,WAAW,CAAU,CAAC;EAC7CO,KAAK,GAAGP,WAAW,CAAC,CAAC;EAErBQ,kBAAkB,GAAGP,OAAO,CAAC,IAAI,CAACK,oBAAoB,EAAE,KAAK,CAAC,CAACC,KAAK,CAAC,IAAI,CAACA,KAAK,CAAC;EAEhGE,WAAWA,CAACC,UAAyC,EAAEC,GAAmB,EAAE;IAC1E,IAAI,CAACD,UAAU,GAAGA,UAAU;IAC5B,IAAI,CAACC,GAAG,GAAGA,GAAG;EAChB;EAEA,MAAcC,wBAAwBA,CAACC,WAAmB,EAAmB;IAC3E,KAAK,IAAIC,OAAO,GAAG,CAAC,EAAEA,OAAO,GAAGX,sBAAsB,EAAEW,OAAO,EAAE,EAAE;MACjE,MAAMC,QAAQ,GAAG,MAAM,IAAI,CAACJ,GAAG,CAACK,sBAAsB,CAACH,WAAW,CAAC;MAEnE,IAAIE,QAAQ,CAACE,MAAM,KAAK,WAAW,EAAE;QACnC,OAAOF,QAAQ,CAACG,IAAI;MACtB;MAEA,IAAIH,QAAQ,CAACE,MAAM,KAAK,QAAQ,EAAE;QAChC,OAAOf,mBAAmB;MAC5B;MAEA,IAAIY,OAAO,GAAGX,sBAAsB,GAAG,CAAC,EAAE;QACxC,MAAM,IAAIgB,OAAO,CAAEC,OAAO,IAAKC,UAAU,CAACD,OAAO,EAAEhB,4BAA4B,CAAC,CAAC;MACnF;IACF;IACA,OAAOF,mBAAmB;EAC5B;EAEgBoB,kBAAkB,GAAGvB,YAAY,CAAC,YAAY;IAC5D,MAAMwB,QAAQ,GAAG,IAAI,CAACb,UAAU,CAACc,MAAM,CAAC,CAAC;IAEzC,MAAMC,kBAAkB,GAAGF,QAAQ,CAACG,GAAG,CAAC,MAAOC,IAAI,IAAK;MACtD,IAAI,IAAI,CAACjB,UAAU,CAACkB,aAAa,CAACD,IAAI,CAACE,aAAa,CAAC,EAAE;QACrD;MACF;MAEA,IAAI,CAACnB,UAAU,CAACoB,MAAM,CAACH,IAAI,CAACE,aAAa,EAAE;QAAEE,iBAAiB,EAAE;MAAK,CAAC,CAAC;MAEvE,IAAI;QACF,MAAMb,IAAI,GAAG,MAAM,IAAI,CAACN,wBAAwB,CAACe,IAAI,CAACd,WAAW,CAAC;QAElE,IAAI,CAACH,UAAU,CAACoB,MAAM,CAACH,IAAI,CAACE,aAAa,EAAE;UACzCG,UAAU,EAAEd,IAAI;UAChBa,iBAAiB,EAAE,KAAK;UACxBE,eAAe,EAAEC;QACnB,CAAC,CAAC;MACJ,CAAC,CAAC,OAAOC,KAAK,EAAE;QACd,IAAI,CAACzB,UAAU,CAACoB,MAAM,CAACH,IAAI,CAACE,aAAa,EAAE;UACzCE,iBAAiB,EAAE,KAAK;UACxBE,eAAe,EAAEE,KAAK,YAAYC,KAAK,GAAGD,KAAK,CAACE,OAAO,GAAG;QAC5D,CAAC,CAAC;MACJ;IACF,CAAC,CAAC;IAEF,MAAMlB,OAAO,CAACmB,GAAG,CAACb,kBAAkB,CAAC;IACrC,IAAI,CAACnB,oBAAoB,CAAC,IAAI,CAAC;EACjC,CAAC,CAAC;EAEKiC,aAAaA,CAACV,aAAqB,EAAsB;IAC9D,OAAO,IAAI,CAACnB,UAAU,CAAC8B,GAAG,CAACX,aAAa,CAAC,EAAEG,UAAU;EACvD;EAEOS,mBAAmBA,CAACZ,aAAqB,EAAW;IACzD,OAAO,IAAI,CAACnB,UAAU,CAAC8B,GAAG,CAACX,aAAa,CAAC,EAAEE,iBAAiB,IAAI,KAAK;EACvE;AACF","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["VoiceTranscriptionsCollection","collection","Map","add","attemptNumber","item","set","update","existingItem","get","delete","getAll","Array","from","values","clear","hasTranscript","transcript","hasAudio","audioUri"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/VoiceTranscriptionsCollection.ts"],"mappings":";;AAEA,OAAO,MAAMA,6BAA6B,CAAC;EACzBC,UAAU,GAAwC,IAAIC,GAAG,CAAC,CAAC;EAEpEC,GAAGA,CAACC,aAAqB,EAAEC,IAA4B,EAAE;IAC9D,IAAI,CAACJ,UAAU,CAACK,GAAG,CAACF,aAAa,EAAEC,IAAI,CAAC;EAC1C;EAEOE,MAAMA,CAACH,aAAqB,EAAEC,IAAqC,EAAE;IAC1E,MAAMG,YAAY,GAAG,IAAI,CAACP,UAAU,CAACQ,GAAG,CAACL,aAAa,CAAC,IAAK,CAAC,CAA4B;IACzF,IAAI,CAACH,UAAU,CAACK,GAAG,CAACF,aAAa,EAAE;MAAE,GAAGI,YAAY;MAAE,GAAGH;IAAK,CAAC,CAAC;EAClE;EAEOK,MAAMA,CAACN,aAAqB,EAAE;IACnC,IAAI,CAACH,UAAU,CAACS,MAAM,CAACN,aAAa,CAAC;EACvC;EAEOK,GAAGA,CAACL,aAAqB,EAAE;IAChC,OAAO,IAAI,CAACH,UAAU,CAACQ,GAAG,CAACL,aAAa,CAAC;EAC3C;EAEOO,MAAMA,CAAA,EAAG;IACd,OAAOC,KAAK,CAACC,IAAI,CAAC,IAAI,CAACZ,UAAU,CAACa,MAAM,CAAC,CAAC,CAAC;EAC7C;EAEOC,KAAKA,CAAA,EAAG;IACb,IAAI,CAACd,UAAU,CAACc,KAAK,CAAC,CAAC;EACzB;EAEOC,aAAaA,CAACZ,aAAqB,EAAE;IAC1C,MAAMC,IAAI,GAAG,IAAI,CAACJ,UAAU,CAACQ,GAAG,CAACL,aAAa,CAAC;IAC/C,OAAO,CAAC,CAACC,IAAI,EAAEY,UAAU;EAC3B;EAEOC,QAAQA,CAACd,aAAqB,EAAE;IACrC,MAAMC,IAAI,GAAG,IAAI,CAACJ,UAAU,CAACQ,GAAG,CAACL,aAAa,CAAC;IAC/C,OAAO,CAAC,CAACC,IAAI,EAAEc,QAAQ;EACzB;AACF","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createEvent","restore","VoiceTranscriptionsDropdownModel","toggleExpand","setExpanded","reset","$isExpanded","on","state"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/VoiceTranscriptionsDropdown.model.ts"],"mappings":";;AAAA,SAASA,WAAW,EAAeC,OAAO,QAAQ,UAAU;AAE5D,OAAO,MAAMC,gCAAgC,CAAC;EAC5BC,YAAY,GAAGH,WAAW,CAAC,CAAC;EAC5BI,WAAW,GAAGJ,WAAW,CAAU,CAAC;EACpCK,KAAK,GAAGL,WAAW,CAAC,CAAC;EAErBM,WAAW,GAAGL,OAAO,CAAC,IAAI,CAACG,WAAW,EAAE,KAAK,CAAC,CAC3DG,EAAE,CAAC,IAAI,CAACJ,YAAY,EAAGK,KAAK,IAAK,CAACA,KAAK,CAAC,CACxCH,KAAK,CAAC,IAAI,CAACA,KAAK,CAAC;AACtB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceTranscriptionsDropdown.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/components/VoiceTranscriptionsDropdown.tsx"],"names":[],"mappings":"AASA,OAAO,KAA4D,MAAM,OAAO,CAAA;AAChF,OAAO,EAEL,SAAS,EACT,SAAS,EAMV,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,WAAW,EAA0B,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAE5F,OAAO,EAAE,gBAAgB,EAAe,MAAM,UAAU,CAAA;AASxD,KAAK,gCAAgC,GAAG;IACtC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAC5B,KAAK,EAAE,gBAAgB,CAAA;IACvB,OAAO,EAAE,WAAW,EAAE,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;IACrB,qBAAqB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/C,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,yBAAyB,CAAA;CACpC,CAAA;AAED,eAAO,MAAM,2BAA2B,wGASrC,gCAAgC,sBA4MlC,CAAA"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
type VoiceTranscriptionsDropdownItemProps = {
|
|
3
|
-
attempt: number;
|
|
4
|
-
content: string;
|
|
5
|
-
isActive: boolean;
|
|
6
|
-
isLoading?: boolean;
|
|
7
|
-
onToggle: (attempt: number) => void;
|
|
8
|
-
scrollToAttempt: (attempt: number) => void;
|
|
9
|
-
};
|
|
10
|
-
export declare const VoiceTranscriptionsDropdownItem: React.MemoExoticComponent<({ attempt, content, isActive, isLoading, onToggle, scrollToAttempt, }: VoiceTranscriptionsDropdownItemProps) => React.JSX.Element>;
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=VoiceTranscriptionsDropdownItem.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceTranscriptionsDropdownItem.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/components/VoiceTranscriptionsDropdownItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoC,MAAM,OAAO,CAAA;AAexD,KAAK,oCAAoC,GAAG;IAC1C,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAC3C,CAAA;AAED,eAAO,MAAM,+BAA+B,oGAQvC,oCAAoC,uBAmExC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useVoiceTranscriptionsDropdown.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gCAAgC,EAAE,MAAM,4CAA4C,CAAA;AAE7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEhD,eAAO,MAAM,8BAA8B,UAAW,gCAAgC;;;;;;;;;;;0BAMvD,iBAAiB;CAwC/C,CAAA"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { LayoutChangeEvent } from 'react-native';
|
|
2
|
-
export declare const useVoiceTranscriptionsDropdownItemAnimation: (isExpanded: boolean) => {
|
|
3
|
-
contentAnimatedStyle: {
|
|
4
|
-
height: number;
|
|
5
|
-
opacity: number;
|
|
6
|
-
overflow: "hidden";
|
|
7
|
-
};
|
|
8
|
-
onLayout: (event: LayoutChangeEvent) => void;
|
|
9
|
-
progress: import("react-native-reanimated").SharedValue<number>;
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=useVoiceTranscriptionsDropdownItemAnimation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useVoiceTranscriptionsDropdownItemAnimation.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAShD,eAAO,MAAM,2CAA2C,eAAgB,OAAO;;;;;;sBAoBpD,iBAAiB;;CAS3C,CAAA"}
|
package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { VoiceTranscriptionsCollection } from './VoiceTranscriptionsCollection';
|
|
2
|
-
import { VoicePlayerApi } from '../../types';
|
|
3
|
-
export declare class TranscriptionsDownloaderModel {
|
|
4
|
-
private readonly collection;
|
|
5
|
-
private readonly api;
|
|
6
|
-
readonly setTranscriptsLoaded: import("effector").EventCallable<boolean>;
|
|
7
|
-
readonly reset: import("effector").EventCallable<void>;
|
|
8
|
-
readonly $transcriptsLoaded: import("effector").StoreWritable<boolean>;
|
|
9
|
-
constructor(collection: VoiceTranscriptionsCollection, api: VoicePlayerApi);
|
|
10
|
-
private fetchTranscriptWithRetry;
|
|
11
|
-
readonly loadAllTranscripts: import("effector").Effect<void, void, Error>;
|
|
12
|
-
getTranscript(attemptNumber: number): string | undefined;
|
|
13
|
-
isTranscriptLoading(attemptNumber: number): boolean;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=TranscriptionsDownloaderModel.d.ts.map
|
package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TranscriptionsDownloaderModel.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/TranscriptionsDownloaderModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAA;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAO5C,qBAAa,6BAA6B;IACxC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA+B;IAC1D,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAgB;IAEpC,SAAgB,oBAAoB,4CAAyB;IAC7D,SAAgB,KAAK,yCAAgB;IAErC,SAAgB,kBAAkB,4CAA8D;gBAEpF,UAAU,EAAE,6BAA6B,EAAE,GAAG,EAAE,cAAc;YAK5D,wBAAwB;IAmBtC,SAAgB,kBAAkB,+CA4BhC;IAEK,aAAa,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAIxD,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO;CAG3D"}
|
package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceTranscriptionsDropdown.model.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/VoiceTranscriptionsDropdown.model.ts"],"names":[],"mappings":"AAEA,qBAAa,gCAAgC;IAC3C,SAAgB,YAAY,yCAAgB;IAC5C,SAAgB,WAAW,4CAAyB;IACpD,SAAgB,KAAK,yCAAgB;IAErC,SAAgB,WAAW,4CAEP;CACrB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceTranscriptionsDropdown.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/components/VoiceTranscriptionsDropdown.tsx"],"names":[],"mappings":"AASA,OAAO,KAA4D,MAAM,OAAO,CAAA;AAChF,OAAO,EAEL,SAAS,EACT,SAAS,EAMV,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,WAAW,EAA0B,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAE5F,OAAO,EAAE,gBAAgB,EAAe,MAAM,UAAU,CAAA;AASxD,KAAK,gCAAgC,GAAG;IACtC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAC5B,KAAK,EAAE,gBAAgB,CAAA;IACvB,OAAO,EAAE,WAAW,EAAE,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;IACrB,qBAAqB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/C,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,yBAAyB,CAAA;CACpC,CAAA;AAED,eAAO,MAAM,2BAA2B,wGASrC,gCAAgC,sBA4MlC,CAAA"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
type VoiceTranscriptionsDropdownItemProps = {
|
|
3
|
-
attempt: number;
|
|
4
|
-
content: string;
|
|
5
|
-
isActive: boolean;
|
|
6
|
-
isLoading?: boolean;
|
|
7
|
-
onToggle: (attempt: number) => void;
|
|
8
|
-
scrollToAttempt: (attempt: number) => void;
|
|
9
|
-
};
|
|
10
|
-
export declare const VoiceTranscriptionsDropdownItem: React.MemoExoticComponent<({ attempt, content, isActive, isLoading, onToggle, scrollToAttempt, }: VoiceTranscriptionsDropdownItemProps) => React.JSX.Element>;
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=VoiceTranscriptionsDropdownItem.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceTranscriptionsDropdownItem.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/components/VoiceTranscriptionsDropdownItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoC,MAAM,OAAO,CAAA;AAexD,KAAK,oCAAoC,GAAG;IAC1C,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAC3C,CAAA;AAED,eAAO,MAAM,+BAA+B,oGAQvC,oCAAoC,uBAmExC,CAAA"}
|
package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useVoiceTranscriptionsDropdown.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gCAAgC,EAAE,MAAM,4CAA4C,CAAA;AAE7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEhD,eAAO,MAAM,8BAA8B,UAAW,gCAAgC;;;;;;;;;;;0BAMvD,iBAAiB;CAwC/C,CAAA"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { LayoutChangeEvent } from 'react-native';
|
|
2
|
-
export declare const useVoiceTranscriptionsDropdownItemAnimation: (isExpanded: boolean) => {
|
|
3
|
-
contentAnimatedStyle: {
|
|
4
|
-
height: number;
|
|
5
|
-
opacity: number;
|
|
6
|
-
overflow: "hidden";
|
|
7
|
-
};
|
|
8
|
-
onLayout: (event: LayoutChangeEvent) => void;
|
|
9
|
-
progress: import("react-native-reanimated").SharedValue<number>;
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=useVoiceTranscriptionsDropdownItemAnimation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useVoiceTranscriptionsDropdownItemAnimation.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAShD,eAAO,MAAM,2CAA2C,eAAgB,OAAO;;;;;;sBAoBpD,iBAAiB;;CAS3C,CAAA"}
|
package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { VoiceTranscriptionsCollection } from './VoiceTranscriptionsCollection';
|
|
2
|
-
import { VoicePlayerApi } from '../../types';
|
|
3
|
-
export declare class TranscriptionsDownloaderModel {
|
|
4
|
-
private readonly collection;
|
|
5
|
-
private readonly api;
|
|
6
|
-
readonly setTranscriptsLoaded: import("effector").EventCallable<boolean>;
|
|
7
|
-
readonly reset: import("effector").EventCallable<void>;
|
|
8
|
-
readonly $transcriptsLoaded: import("effector").StoreWritable<boolean>;
|
|
9
|
-
constructor(collection: VoiceTranscriptionsCollection, api: VoicePlayerApi);
|
|
10
|
-
private fetchTranscriptWithRetry;
|
|
11
|
-
readonly loadAllTranscripts: import("effector").Effect<void, void, Error>;
|
|
12
|
-
getTranscript(attemptNumber: number): string | undefined;
|
|
13
|
-
isTranscriptLoading(attemptNumber: number): boolean;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=TranscriptionsDownloaderModel.d.ts.map
|
package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TranscriptionsDownloaderModel.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/TranscriptionsDownloaderModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAA;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAO5C,qBAAa,6BAA6B;IACxC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA+B;IAC1D,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAgB;IAEpC,SAAgB,oBAAoB,4CAAyB;IAC7D,SAAgB,KAAK,yCAAgB;IAErC,SAAgB,kBAAkB,4CAA8D;gBAEpF,UAAU,EAAE,6BAA6B,EAAE,GAAG,EAAE,cAAc;YAK5D,wBAAwB;IAmBtC,SAAgB,kBAAkB,+CA4BhC;IAEK,aAAa,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAIxD,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO;CAG3D"}
|
package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceTranscriptionsDropdown.model.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/VoiceTranscriptionsDropdown.model.ts"],"names":[],"mappings":"AAEA,qBAAa,gCAAgC;IAC3C,SAAgB,YAAY,yCAAgB;IAC5C,SAAgB,WAAW,4CAAyB;IACpD,SAAgB,KAAK,yCAAgB;IAErC,SAAgB,WAAW,4CAEP;CACrB"}
|
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Typography,
|
|
3
|
-
ScrollableList,
|
|
4
|
-
CaretDownIcon,
|
|
5
|
-
COLORS,
|
|
6
|
-
IS_WEB,
|
|
7
|
-
ScrollableListScrollView,
|
|
8
|
-
} from '@magmamath/react-native-ui'
|
|
9
|
-
import { useUnit } from 'effector-react'
|
|
10
|
-
import React, { useRef, useEffect, useState, useCallback, useMemo } from 'react'
|
|
11
|
-
import {
|
|
12
|
-
TouchableOpacity,
|
|
13
|
-
StyleProp,
|
|
14
|
-
ViewStyle,
|
|
15
|
-
FlatList,
|
|
16
|
-
LayoutChangeEvent,
|
|
17
|
-
ScrollView,
|
|
18
|
-
View,
|
|
19
|
-
StyleSheet,
|
|
20
|
-
} from 'react-native'
|
|
21
|
-
import Animated, { FadeIn, FadeOut } from 'react-native-reanimated'
|
|
22
|
-
import { AnswerAudio, VoiceTranscriptionItem, VoiceTranscriptionVariant } from '../../types'
|
|
23
|
-
import { useVoiceTranscriptionsDropdown } from '../hooks/useVoiceTranscriptionsDropdown'
|
|
24
|
-
import { VoicePlayerModel, PlayerState } from '../model'
|
|
25
|
-
import { VoiceTranscriptionsDropdownItem } from './VoiceTranscriptionsDropdownItem'
|
|
26
|
-
import { DROPDOWN_MAX_CONTENT_HEIGHT, NO_AUDIO_BE_MESSAGE } from '../../constants'
|
|
27
|
-
import { useText } from '../../../../i18n/i18n'
|
|
28
|
-
import { PlayButton } from '../../../../shared/components/PlayButton'
|
|
29
|
-
import { getActiveAttempt, getAudioStatus } from '../../helpers'
|
|
30
|
-
|
|
31
|
-
const AnimatedTouchableOpacity = Animated.createAnimatedComponent(TouchableOpacity)
|
|
32
|
-
|
|
33
|
-
type VoiceTranscriptionsDropdownProps = {
|
|
34
|
-
style?: StyleProp<ViewStyle>
|
|
35
|
-
model: VoicePlayerModel
|
|
36
|
-
answers: AnswerAudio[]
|
|
37
|
-
attemptOffset: number
|
|
38
|
-
onAttemptOffsetChange: (offset: number) => void
|
|
39
|
-
attemptsCount: number
|
|
40
|
-
problemId: string
|
|
41
|
-
variant?: VoiceTranscriptionVariant
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export const VoiceTranscriptionsDropdown = ({
|
|
45
|
-
style,
|
|
46
|
-
model,
|
|
47
|
-
answers,
|
|
48
|
-
attemptOffset,
|
|
49
|
-
onAttemptOffsetChange,
|
|
50
|
-
attemptsCount,
|
|
51
|
-
problemId,
|
|
52
|
-
variant = VoiceTranscriptionVariant.SMALL,
|
|
53
|
-
}: VoiceTranscriptionsDropdownProps) => {
|
|
54
|
-
const [attempts, setAttempts] = useState<VoiceTranscriptionItem[]>([])
|
|
55
|
-
|
|
56
|
-
const scrollRef = useRef<FlatList | null>(null)
|
|
57
|
-
const scrollViewRef = useRef<ScrollView | null>(null)
|
|
58
|
-
const itemLayoutsRef = useRef<Map<string, number>>(new Map())
|
|
59
|
-
const answersRef = useRef(answers)
|
|
60
|
-
answersRef.current = answers
|
|
61
|
-
|
|
62
|
-
const t = useText()
|
|
63
|
-
|
|
64
|
-
const [currentAttempt, transcriptsLoaded, playerState, isDropdownExpanded] = useUnit([
|
|
65
|
-
model.$currentAttempt,
|
|
66
|
-
model.loader.$transcriptsLoaded,
|
|
67
|
-
model.$playerState,
|
|
68
|
-
model.dropdown.$isExpanded,
|
|
69
|
-
])
|
|
70
|
-
|
|
71
|
-
const activeAttempt = getActiveAttempt(attemptOffset, attemptsCount)
|
|
72
|
-
|
|
73
|
-
const answersKey = useMemo(
|
|
74
|
-
() => answers.map((a) => `${a._id}:${a.audioFileId ?? ''}`).join(','),
|
|
75
|
-
[answers],
|
|
76
|
-
)
|
|
77
|
-
|
|
78
|
-
const hasActiveTranscript =
|
|
79
|
-
activeAttempt !== null && answers?.[activeAttempt - 1]?.audioFileId !== undefined
|
|
80
|
-
|
|
81
|
-
const playButtonState = {
|
|
82
|
-
isActive: playerState !== PlayerState.IDLE,
|
|
83
|
-
isLoading: playerState === PlayerState.LOADING,
|
|
84
|
-
status: getAudioStatus(playerState),
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const { listAnimatedStyle, iconAnimatedStyle, onListLayout } = useVoiceTranscriptionsDropdown(
|
|
88
|
-
model.dropdown,
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
const handleItemLayout = useCallback((id: string, event: LayoutChangeEvent) => {
|
|
92
|
-
itemLayoutsRef.current.set(id, event.nativeEvent.layout.y)
|
|
93
|
-
}, [])
|
|
94
|
-
|
|
95
|
-
const scrollToAttempt = useCallback(
|
|
96
|
-
(attemptNumber: number) => {
|
|
97
|
-
if (IS_WEB) {
|
|
98
|
-
const item = attempts.find((item) => item.attemptNumber === attemptNumber)
|
|
99
|
-
if (item) {
|
|
100
|
-
const y = itemLayoutsRef.current.get(item._id)
|
|
101
|
-
if (y !== undefined) {
|
|
102
|
-
scrollViewRef.current?.scrollTo({ y, animated: true })
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
const index = attempts.findIndex((item) => item.attemptNumber === attemptNumber)
|
|
109
|
-
if (index !== -1) {
|
|
110
|
-
scrollRef.current?.scrollToIndex({ index, animated: true, viewPosition: 0 })
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
[attempts],
|
|
114
|
-
)
|
|
115
|
-
|
|
116
|
-
const handleItemToggle = useCallback(
|
|
117
|
-
(attempt: number) => {
|
|
118
|
-
if (onAttemptOffsetChange && attemptsCount !== undefined) {
|
|
119
|
-
onAttemptOffsetChange(attemptsCount - attempt)
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
[onAttemptOffsetChange, attemptsCount],
|
|
123
|
-
)
|
|
124
|
-
|
|
125
|
-
const handlePlayPress = useCallback(() => {
|
|
126
|
-
if (activeAttempt) {
|
|
127
|
-
model.togglePlayPause(activeAttempt)
|
|
128
|
-
}
|
|
129
|
-
}, [model, activeAttempt])
|
|
130
|
-
|
|
131
|
-
const handleScrollToIndexFailed = useCallback((info: { index: number }) => {
|
|
132
|
-
setTimeout(() => {
|
|
133
|
-
scrollRef.current?.scrollToIndex({ index: info.index, animated: true, viewPosition: 0 })
|
|
134
|
-
}, 100)
|
|
135
|
-
}, [])
|
|
136
|
-
|
|
137
|
-
useEffect(() => {
|
|
138
|
-
model.reinitializePlayer()
|
|
139
|
-
return () => model.cleanup()
|
|
140
|
-
}, [model])
|
|
141
|
-
|
|
142
|
-
useEffect(() => {
|
|
143
|
-
const isLastAttemptsWithoutDrowing = !answers[answers.length - 1].drawing
|
|
144
|
-
if (answers.length > 0 && isLastAttemptsWithoutDrowing) {
|
|
145
|
-
model.dropdown.setExpanded(true)
|
|
146
|
-
} else {
|
|
147
|
-
model.dropdown.setExpanded(false)
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
model.resetPlayer()
|
|
151
|
-
}, [problemId])
|
|
152
|
-
|
|
153
|
-
useEffect(() => {
|
|
154
|
-
if (answersRef.current.some((answer) => answer.audioFileId)) {
|
|
155
|
-
model.initializeWithAudios(answersRef.current)
|
|
156
|
-
model.loader.loadAllTranscripts()
|
|
157
|
-
}
|
|
158
|
-
}, [model, answersKey])
|
|
159
|
-
|
|
160
|
-
useEffect(() => {
|
|
161
|
-
model.stopAudio()
|
|
162
|
-
}, [activeAttempt])
|
|
163
|
-
|
|
164
|
-
useEffect(() => {
|
|
165
|
-
const allAttempts = model.getAllAttempts()
|
|
166
|
-
setAttempts(allAttempts)
|
|
167
|
-
}, [answersKey, transcriptsLoaded, currentAttempt, model])
|
|
168
|
-
|
|
169
|
-
useEffect(() => {
|
|
170
|
-
if (isDropdownExpanded && activeAttempt !== null) {
|
|
171
|
-
setTimeout(() => {
|
|
172
|
-
scrollToAttempt(activeAttempt)
|
|
173
|
-
}, 500)
|
|
174
|
-
}
|
|
175
|
-
}, [isDropdownExpanded, answersKey])
|
|
176
|
-
|
|
177
|
-
const renderItem = useCallback(
|
|
178
|
-
({ item }: { item: VoiceTranscriptionItem }) => {
|
|
179
|
-
const isLoading = model.loader.isTranscriptLoading(item.attemptNumber)
|
|
180
|
-
const transcript = model.loader.getTranscript(item.attemptNumber)
|
|
181
|
-
const isActive = activeAttempt === item.attemptNumber
|
|
182
|
-
|
|
183
|
-
return (
|
|
184
|
-
<VoiceTranscriptionsDropdownItem
|
|
185
|
-
isLoading={isActive && isLoading}
|
|
186
|
-
attempt={item.attemptNumber}
|
|
187
|
-
content={
|
|
188
|
-
transcript && transcript !== NO_AUDIO_BE_MESSAGE
|
|
189
|
-
? transcript
|
|
190
|
-
: t('voice.transcriptNotAvailable')
|
|
191
|
-
}
|
|
192
|
-
isActive={isActive}
|
|
193
|
-
onToggle={handleItemToggle}
|
|
194
|
-
scrollToAttempt={scrollToAttempt}
|
|
195
|
-
/>
|
|
196
|
-
)
|
|
197
|
-
},
|
|
198
|
-
[model, activeAttempt, t, handleItemToggle, scrollToAttempt],
|
|
199
|
-
)
|
|
200
|
-
|
|
201
|
-
return (
|
|
202
|
-
<Animated.View style={[styles.container, style]}>
|
|
203
|
-
<View style={styles.header}>
|
|
204
|
-
<Typography style={styles.title} variant="h7">
|
|
205
|
-
{t('voice.transcriptions')}
|
|
206
|
-
</Typography>
|
|
207
|
-
{hasActiveTranscript && (
|
|
208
|
-
<Animated.View entering={FadeIn.duration(120)} exiting={FadeOut.duration(120)}>
|
|
209
|
-
<PlayButton
|
|
210
|
-
state={playButtonState}
|
|
211
|
-
onPress={handlePlayPress}
|
|
212
|
-
activityIndicatorColor={COLORS.NEUTRAL_1}
|
|
213
|
-
/>
|
|
214
|
-
</Animated.View>
|
|
215
|
-
)}
|
|
216
|
-
</View>
|
|
217
|
-
|
|
218
|
-
<Animated.View style={[listAnimatedStyle, { overflow: 'hidden' }]}>
|
|
219
|
-
<View onLayout={onListLayout} style={styles.listContainer}>
|
|
220
|
-
{IS_WEB ? (
|
|
221
|
-
<ScrollableListScrollView
|
|
222
|
-
bounces={false}
|
|
223
|
-
ref={scrollViewRef}
|
|
224
|
-
hideShadow
|
|
225
|
-
style={styles.list}
|
|
226
|
-
contentContainerStyle={styles.listContent}
|
|
227
|
-
>
|
|
228
|
-
{attempts.map((item) => (
|
|
229
|
-
<View key={item._id} onLayout={(e) => handleItemLayout(item._id, e)}>
|
|
230
|
-
{renderItem({ item })}
|
|
231
|
-
</View>
|
|
232
|
-
))}
|
|
233
|
-
</ScrollableListScrollView>
|
|
234
|
-
) : (
|
|
235
|
-
<ScrollableList
|
|
236
|
-
bounces={false}
|
|
237
|
-
ref={scrollRef}
|
|
238
|
-
hideShadow
|
|
239
|
-
data={attempts}
|
|
240
|
-
keyExtractor={(item) => item._id}
|
|
241
|
-
onScrollToIndexFailed={handleScrollToIndexFailed}
|
|
242
|
-
renderItem={renderItem}
|
|
243
|
-
contentContainerStyle={styles.listContent}
|
|
244
|
-
/>
|
|
245
|
-
)}
|
|
246
|
-
</View>
|
|
247
|
-
</Animated.View>
|
|
248
|
-
|
|
249
|
-
<AnimatedTouchableOpacity
|
|
250
|
-
style={[styles.expandButton, iconAnimatedStyle]}
|
|
251
|
-
onPress={() => model.dropdown.toggleExpand()}
|
|
252
|
-
>
|
|
253
|
-
<CaretDownIcon size={22} />
|
|
254
|
-
</AnimatedTouchableOpacity>
|
|
255
|
-
</Animated.View>
|
|
256
|
-
)
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
const styles = StyleSheet.create({
|
|
260
|
-
container: {
|
|
261
|
-
position: 'absolute',
|
|
262
|
-
top: 56,
|
|
263
|
-
left: 8,
|
|
264
|
-
width: 222,
|
|
265
|
-
maxHeight: 405,
|
|
266
|
-
minHeight: 51,
|
|
267
|
-
padding: 4,
|
|
268
|
-
boxShadow: '0px 1px 3px 0px rgba(51, 51, 51, 0.25)',
|
|
269
|
-
borderRadius: 12,
|
|
270
|
-
backgroundColor: COLORS.NEUTRAL_1,
|
|
271
|
-
overflow: 'hidden',
|
|
272
|
-
},
|
|
273
|
-
// hugeContainer: {
|
|
274
|
-
// width: '98%',
|
|
275
|
-
// height: '100%',
|
|
276
|
-
// },
|
|
277
|
-
header: {
|
|
278
|
-
flexDirection: 'row',
|
|
279
|
-
justifyContent: 'space-between',
|
|
280
|
-
alignItems: 'center',
|
|
281
|
-
padding: 4,
|
|
282
|
-
marginBottom: 4,
|
|
283
|
-
height: 32,
|
|
284
|
-
},
|
|
285
|
-
title: {
|
|
286
|
-
color: COLORS.NEUTRAL_9,
|
|
287
|
-
marginLeft: 4,
|
|
288
|
-
},
|
|
289
|
-
list: { flex: 1 },
|
|
290
|
-
expandButton: {
|
|
291
|
-
justifyContent: 'center',
|
|
292
|
-
alignItems: 'center',
|
|
293
|
-
},
|
|
294
|
-
listContainer: {
|
|
295
|
-
position: 'absolute',
|
|
296
|
-
maxHeight: DROPDOWN_MAX_CONTENT_HEIGHT,
|
|
297
|
-
width: '100%',
|
|
298
|
-
},
|
|
299
|
-
listContent: {
|
|
300
|
-
paddingHorizontal: 4,
|
|
301
|
-
},
|
|
302
|
-
})
|