@magmamath/students-features 1.4.6 → 1.5.0-rc.20
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/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js +1 -6
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js.map +1 -1
- package/dist/commonjs/features/fluency/components/Fluency.js +6 -12
- package/dist/commonjs/features/fluency/components/Fluency.js.map +1 -1
- package/dist/commonjs/features/fluency/components/select-math-operator/SelectMathOperator.js +5 -13
- package/dist/commonjs/features/fluency/components/select-math-operator/SelectMathOperator.js.map +1 -1
- package/dist/commonjs/features/fluency/model/FluencyModel.js +0 -21
- package/dist/commonjs/features/fluency/model/FluencyModel.js.map +1 -1
- package/dist/commonjs/features/fluency/shared/fluency.constants.js +1 -6
- package/dist/commonjs/features/fluency/shared/fluency.constants.js.map +1 -1
- package/dist/commonjs/features/fluency/shared/fluency.helpers.js +1 -3
- package/dist/commonjs/features/fluency/shared/fluency.helpers.js.map +1 -1
- package/dist/commonjs/features/pmProgress/model/PmProgressModel.js +1 -7
- package/dist/commonjs/features/pmProgress/model/PmProgressModel.js.map +1 -1
- package/dist/commonjs/features/pmProgress/model/PmRecommendationsModel.js +4 -20
- package/dist/commonjs/features/pmProgress/model/PmRecommendationsModel.js.map +1 -1
- package/dist/commonjs/features/pmProgress/shared/pmProgress.helpers.js +1 -22
- package/dist/commonjs/features/pmProgress/shared/pmProgress.helpers.js.map +1 -1
- 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 +15 -4
- package/dist/commonjs/features/voice/index.js.map +1 -1
- package/dist/commonjs/features/voice/playing/components/VoiceIcon.js +1 -1
- package/dist/commonjs/features/voice/playing/components/VoiceIcon.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/useVoicePlayerLifecycle.js +53 -0
- package/dist/commonjs/features/voice/playing/hooks/useVoicePlayerLifecycle.js.map +1 -0
- package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.js +111 -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 +192 -0
- package/dist/commonjs/features/voice/playing/model/PlaybackController.js.map +1 -0
- package/dist/commonjs/features/voice/playing/model/Player.model.js +50 -5
- 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 +83 -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 +58 -172
- package/dist/commonjs/features/voice/playing/model/VoicePlayer.model.js.map +1 -1
- package/dist/commonjs/features/voice/recording/components/VoiceRecordDivider.js +1 -1
- package/dist/commonjs/features/voice/recording/components/VoiceRecordDivider.js.map +1 -1
- package/dist/commonjs/features/voice/types.js +12 -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/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js +2 -7
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js.map +1 -1
- package/dist/module/features/fluency/components/Fluency.js +8 -14
- package/dist/module/features/fluency/components/Fluency.js.map +1 -1
- package/dist/module/features/fluency/components/select-math-operator/SelectMathOperator.js +5 -13
- package/dist/module/features/fluency/components/select-math-operator/SelectMathOperator.js.map +1 -1
- package/dist/module/features/fluency/model/FluencyModel.js +1 -22
- package/dist/module/features/fluency/model/FluencyModel.js.map +1 -1
- package/dist/module/features/fluency/shared/fluency.constants.js +0 -5
- package/dist/module/features/fluency/shared/fluency.constants.js.map +1 -1
- package/dist/module/features/fluency/shared/fluency.helpers.js +0 -1
- package/dist/module/features/fluency/shared/fluency.helpers.js.map +1 -1
- package/dist/module/features/pmProgress/model/PmProgressModel.js +1 -7
- package/dist/module/features/pmProgress/model/PmProgressModel.js.map +1 -1
- package/dist/module/features/pmProgress/model/PmRecommendationsModel.js +4 -20
- package/dist/module/features/pmProgress/model/PmRecommendationsModel.js.map +1 -1
- package/dist/module/features/pmProgress/shared/pmProgress.helpers.js +0 -20
- package/dist/module/features/pmProgress/shared/pmProgress.helpers.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 +2 -1
- package/dist/module/features/voice/index.js.map +1 -1
- package/dist/module/features/voice/playing/components/VoiceIcon.js +2 -2
- package/dist/module/features/voice/playing/components/VoiceIcon.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/useVoicePlayerLifecycle.js +48 -0
- package/dist/module/features/voice/playing/hooks/useVoicePlayerLifecycle.js.map +1 -0
- package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionController.js +106 -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 +187 -0
- package/dist/module/features/voice/playing/model/PlaybackController.js.map +1 -0
- package/dist/module/features/voice/playing/model/Player.model.js +51 -4
- 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 +78 -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 +60 -174
- package/dist/module/features/voice/playing/model/VoicePlayer.model.js.map +1 -1
- package/dist/module/features/voice/recording/components/VoiceRecordDivider.js +2 -2
- package/dist/module/features/voice/recording/components/VoiceRecordDivider.js.map +1 -1
- package/dist/module/features/voice/types.js +11 -0
- 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/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/fluency/components/Fluency.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/fluency/components/select-math-operator/SelectMathOperator.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/fluency/model/FluencyModel.d.ts +0 -3
- package/dist/typescript/commonjs/features/fluency/model/FluencyModel.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/fluency/shared/fluency.constants.d.ts +0 -4
- package/dist/typescript/commonjs/features/fluency/shared/fluency.constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/fluency/shared/fluency.helpers.d.ts +0 -1
- package/dist/typescript/commonjs/features/fluency/shared/fluency.helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/pmProgress/model/PmProgressModel.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/pmProgress/model/PmRecommendationsModel.d.ts +38 -9
- package/dist/typescript/commonjs/features/pmProgress/model/PmRecommendationsModel.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/pmProgress/shared/pmProgress.helpers.d.ts +0 -1
- package/dist/typescript/commonjs/features/pmProgress/shared/pmProgress.helpers.d.ts.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 +3 -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/commonjs/features/voice/playing/components/VoiceTranscription.d.ts +16 -0
- 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/commonjs/features/voice/playing/hooks/{useVoiceTranscriptionsDropdown.d.ts → 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/useVoicePlayerLifecycle.d.ts +15 -0
- package/dist/typescript/commonjs/features/voice/playing/hooks/useVoicePlayerLifecycle.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 +4 -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 +19 -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 +14 -2
- 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/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts.map +1 -1
- package/dist/typescript/module/features/fluency/components/Fluency.d.ts.map +1 -1
- package/dist/typescript/module/features/fluency/components/select-math-operator/SelectMathOperator.d.ts.map +1 -1
- package/dist/typescript/module/features/fluency/model/FluencyModel.d.ts +0 -3
- package/dist/typescript/module/features/fluency/model/FluencyModel.d.ts.map +1 -1
- package/dist/typescript/module/features/fluency/shared/fluency.constants.d.ts +0 -4
- package/dist/typescript/module/features/fluency/shared/fluency.constants.d.ts.map +1 -1
- package/dist/typescript/module/features/fluency/shared/fluency.helpers.d.ts +0 -1
- package/dist/typescript/module/features/fluency/shared/fluency.helpers.d.ts.map +1 -1
- package/dist/typescript/module/features/pmProgress/model/PmProgressModel.d.ts.map +1 -1
- package/dist/typescript/module/features/pmProgress/model/PmRecommendationsModel.d.ts +38 -9
- package/dist/typescript/module/features/pmProgress/model/PmRecommendationsModel.d.ts.map +1 -1
- package/dist/typescript/module/features/pmProgress/shared/pmProgress.helpers.d.ts +0 -1
- package/dist/typescript/module/features/pmProgress/shared/pmProgress.helpers.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 +3 -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/module/features/voice/playing/components/VoiceTranscription.d.ts +16 -0
- 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/module/features/voice/playing/hooks/{useVoiceTranscriptionsDropdown.d.ts → 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/useVoicePlayerLifecycle.d.ts +15 -0
- package/dist/typescript/module/features/voice/playing/hooks/useVoicePlayerLifecycle.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 +4 -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 +19 -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 +14 -2
- 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 +37 -10
- package/src/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.tsx +2 -9
- package/src/features/fluency/components/Fluency.tsx +9 -17
- package/src/features/fluency/components/select-math-operator/SelectMathOperator.tsx +5 -13
- package/src/features/fluency/model/FluencyModel.ts +1 -25
- package/src/features/fluency/shared/fluency.constants.ts +0 -5
- package/src/features/fluency/shared/fluency.helpers.ts +0 -3
- package/src/features/pmProgress/model/PmProgressModel.ts +1 -4
- package/src/features/pmProgress/model/PmRecommendationsModel.ts +6 -22
- package/src/features/pmProgress/shared/pmProgress.helpers.ts +0 -33
- 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 +3 -1
- package/src/features/voice/playing/components/VoiceIcon.tsx +2 -2
- package/src/features/voice/playing/components/VoiceTranscriptContent.tsx +44 -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/useVoicePlayerLifecycle.ts +64 -0
- package/src/features/voice/playing/hooks/useVoiceTranscriptionController.ts +148 -0
- package/src/features/voice/playing/model/{VoiceTranscriptionsDropdown.model.ts → Dropdown.model.ts} +2 -2
- package/src/features/voice/playing/model/PlaybackController.ts +221 -0
- package/src/features/voice/playing/model/Player.model.ts +52 -4
- 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 +68 -192
- package/src/features/voice/recording/components/VoiceRecordDivider.tsx +2 -2
- package/src/features/voice/types.ts +21 -1
- package/src/i18n/.generated/schema.json +3 -7
- package/src/index.ts +1 -0
- package/dist/commonjs/features/fluency/components/FluencyStatusOverlay.js +0 -101
- package/dist/commonjs/features/fluency/components/FluencyStatusOverlay.js.map +0 -1
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.js +0 -245
- 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/fluency/components/FluencyStatusOverlay.js +0 -95
- package/dist/module/features/fluency/components/FluencyStatusOverlay.js.map +0 -1
- package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdown.js +0 -238
- 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/fluency/components/FluencyStatusOverlay.d.ts +0 -8
- package/dist/typescript/commonjs/features/fluency/components/FluencyStatusOverlay.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts +0 -16
- 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/fluency/components/FluencyStatusOverlay.d.ts +0 -8
- package/dist/typescript/module/features/fluency/components/FluencyStatusOverlay.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts +0 -16
- 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/fluency/components/FluencyStatusOverlay.tsx +0 -101
- package/src/features/voice/playing/components/VoiceTranscriptionsDropdown.tsx +0 -296
- 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 +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,MAAM,aAAa,CAAA;AAEjE,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;CAClB,CAAA;AAED,eAAO,MAAM,2BAA2B,+FAQrC,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,101 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react'
|
|
2
|
-
import { StyleSheet, View } from 'react-native'
|
|
3
|
-
import {
|
|
4
|
-
COLORS,
|
|
5
|
-
ErrorIcon,
|
|
6
|
-
HeadingVariants,
|
|
7
|
-
InfoIcon,
|
|
8
|
-
SPACING,
|
|
9
|
-
Typography,
|
|
10
|
-
} from '@magmamath/react-native-ui'
|
|
11
|
-
import { FluencyStatus } from '../shared/fluency.constants'
|
|
12
|
-
import type { TranslationKey } from '../../../i18n/i18n'
|
|
13
|
-
import { useText } from '../../../i18n/i18n'
|
|
14
|
-
|
|
15
|
-
type StatusVariant = {
|
|
16
|
-
icon: ReactNode
|
|
17
|
-
circleColor: string
|
|
18
|
-
titleKey: TranslationKey
|
|
19
|
-
subtitleKey: TranslationKey
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const FLUENCY_STATUS_VARIANTS: Record<FluencyStatus, StatusVariant> = {
|
|
23
|
-
[FluencyStatus.ERROR]: {
|
|
24
|
-
icon: <ErrorIcon color={COLORS.PRIMARY_RED} size={40} />,
|
|
25
|
-
circleColor: COLORS.RED_1,
|
|
26
|
-
titleKey: 'student.fluency.errorTitle',
|
|
27
|
-
subtitleKey: 'student.fluency.errorSubtitle',
|
|
28
|
-
},
|
|
29
|
-
[FluencyStatus.EMPTY]: {
|
|
30
|
-
icon: <InfoIcon color={COLORS.NEUTRAL_6} size={40} />,
|
|
31
|
-
circleColor: COLORS.NEUTRAL_2,
|
|
32
|
-
titleKey: 'student.fluency.emptyTitle',
|
|
33
|
-
subtitleKey: 'student.fluency.emptySubtitle',
|
|
34
|
-
},
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
type FluencyStatusOverlayProps = {
|
|
38
|
-
status: FluencyStatus
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const FluencyStatusOverlay = ({ status }: FluencyStatusOverlayProps) => {
|
|
42
|
-
const t = useText()
|
|
43
|
-
|
|
44
|
-
const variant = FLUENCY_STATUS_VARIANTS[status]
|
|
45
|
-
if (!variant) return null
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<View style={styles.container}>
|
|
49
|
-
<View style={styles.content}>
|
|
50
|
-
<View style={[styles.iconCircle, { backgroundColor: variant.circleColor }]}>
|
|
51
|
-
{variant.icon}
|
|
52
|
-
</View>
|
|
53
|
-
<View style={styles.text}>
|
|
54
|
-
<Typography variant={HeadingVariants.H2} style={styles.title}>
|
|
55
|
-
{t(variant.titleKey)}
|
|
56
|
-
</Typography>
|
|
57
|
-
<Typography variant={HeadingVariants.H7} style={styles.subtitle}>
|
|
58
|
-
{t(variant.subtitleKey)}
|
|
59
|
-
</Typography>
|
|
60
|
-
</View>
|
|
61
|
-
</View>
|
|
62
|
-
</View>
|
|
63
|
-
)
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const styles = StyleSheet.create({
|
|
67
|
-
container: {
|
|
68
|
-
flex: 1,
|
|
69
|
-
alignItems: 'center',
|
|
70
|
-
justifyContent: 'center',
|
|
71
|
-
},
|
|
72
|
-
content: {
|
|
73
|
-
alignItems: 'center',
|
|
74
|
-
gap: SPACING[500],
|
|
75
|
-
paddingBottom: SPACING[800],
|
|
76
|
-
},
|
|
77
|
-
iconCircle: {
|
|
78
|
-
width: 88,
|
|
79
|
-
height: 88,
|
|
80
|
-
borderRadius: 44,
|
|
81
|
-
alignItems: 'center',
|
|
82
|
-
justifyContent: 'center',
|
|
83
|
-
},
|
|
84
|
-
text: {
|
|
85
|
-
alignItems: 'center',
|
|
86
|
-
gap: SPACING[200],
|
|
87
|
-
maxWidth: 340,
|
|
88
|
-
},
|
|
89
|
-
title: {
|
|
90
|
-
color: COLORS.NEUTRAL_9,
|
|
91
|
-
textAlign: 'center',
|
|
92
|
-
fontSize: 24,
|
|
93
|
-
fontWeight: '500',
|
|
94
|
-
},
|
|
95
|
-
subtitle: {
|
|
96
|
-
color: COLORS.NEUTRAL_7,
|
|
97
|
-
textAlign: 'center',
|
|
98
|
-
fontSize: 16,
|
|
99
|
-
fontWeight: '400',
|
|
100
|
-
},
|
|
101
|
-
})
|
|
@@ -1,296 +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 } 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
|
-
}
|
|
42
|
-
|
|
43
|
-
export const VoiceTranscriptionsDropdown = ({
|
|
44
|
-
style,
|
|
45
|
-
model,
|
|
46
|
-
answers,
|
|
47
|
-
attemptOffset,
|
|
48
|
-
onAttemptOffsetChange,
|
|
49
|
-
attemptsCount,
|
|
50
|
-
problemId,
|
|
51
|
-
}: VoiceTranscriptionsDropdownProps) => {
|
|
52
|
-
const [attempts, setAttempts] = useState<VoiceTranscriptionItem[]>([])
|
|
53
|
-
|
|
54
|
-
const scrollRef = useRef<FlatList | null>(null)
|
|
55
|
-
const scrollViewRef = useRef<ScrollView | null>(null)
|
|
56
|
-
const itemLayoutsRef = useRef<Map<string, number>>(new Map())
|
|
57
|
-
const answersRef = useRef(answers)
|
|
58
|
-
answersRef.current = answers
|
|
59
|
-
|
|
60
|
-
const t = useText()
|
|
61
|
-
|
|
62
|
-
const [currentAttempt, transcriptsLoaded, playerState, isDropdownExpanded] = useUnit([
|
|
63
|
-
model.$currentAttempt,
|
|
64
|
-
model.loader.$transcriptsLoaded,
|
|
65
|
-
model.$playerState,
|
|
66
|
-
model.dropdown.$isExpanded,
|
|
67
|
-
])
|
|
68
|
-
|
|
69
|
-
const activeAttempt = getActiveAttempt(attemptOffset, attemptsCount)
|
|
70
|
-
|
|
71
|
-
const answersKey = useMemo(
|
|
72
|
-
() => answers.map((a) => `${a._id}:${a.audioFileId ?? ''}`).join(','),
|
|
73
|
-
[answers],
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
const hasActiveTranscript =
|
|
77
|
-
activeAttempt !== null && answers?.[activeAttempt - 1]?.audioFileId !== undefined
|
|
78
|
-
|
|
79
|
-
const playButtonState = {
|
|
80
|
-
isActive: playerState !== PlayerState.IDLE,
|
|
81
|
-
isLoading: playerState === PlayerState.LOADING,
|
|
82
|
-
status: getAudioStatus(playerState),
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const { listAnimatedStyle, iconAnimatedStyle, onListLayout } = useVoiceTranscriptionsDropdown(
|
|
86
|
-
model.dropdown,
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
const handleItemLayout = useCallback((id: string, event: LayoutChangeEvent) => {
|
|
90
|
-
itemLayoutsRef.current.set(id, event.nativeEvent.layout.y)
|
|
91
|
-
}, [])
|
|
92
|
-
|
|
93
|
-
const scrollToAttempt = useCallback(
|
|
94
|
-
(attemptNumber: number) => {
|
|
95
|
-
if (IS_WEB) {
|
|
96
|
-
const item = attempts.find((item) => item.attemptNumber === attemptNumber)
|
|
97
|
-
if (item) {
|
|
98
|
-
const y = itemLayoutsRef.current.get(item._id)
|
|
99
|
-
if (y !== undefined) {
|
|
100
|
-
scrollViewRef.current?.scrollTo({ y, animated: true })
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const index = attempts.findIndex((item) => item.attemptNumber === attemptNumber)
|
|
107
|
-
if (index !== -1) {
|
|
108
|
-
scrollRef.current?.scrollToIndex({ index, animated: true, viewPosition: 0 })
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
[attempts],
|
|
112
|
-
)
|
|
113
|
-
|
|
114
|
-
const handleItemToggle = useCallback(
|
|
115
|
-
(attempt: number) => {
|
|
116
|
-
if (onAttemptOffsetChange && attemptsCount !== undefined) {
|
|
117
|
-
onAttemptOffsetChange(attemptsCount - attempt)
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
[onAttemptOffsetChange, attemptsCount],
|
|
121
|
-
)
|
|
122
|
-
|
|
123
|
-
const handlePlayPress = useCallback(() => {
|
|
124
|
-
if (activeAttempt) {
|
|
125
|
-
model.togglePlayPause(activeAttempt)
|
|
126
|
-
}
|
|
127
|
-
}, [model, activeAttempt])
|
|
128
|
-
|
|
129
|
-
const handleScrollToIndexFailed = useCallback((info: { index: number }) => {
|
|
130
|
-
setTimeout(() => {
|
|
131
|
-
scrollRef.current?.scrollToIndex({ index: info.index, animated: true, viewPosition: 0 })
|
|
132
|
-
}, 100)
|
|
133
|
-
}, [])
|
|
134
|
-
|
|
135
|
-
useEffect(() => {
|
|
136
|
-
model.reinitializePlayer()
|
|
137
|
-
return () => model.cleanup()
|
|
138
|
-
}, [model])
|
|
139
|
-
|
|
140
|
-
useEffect(() => {
|
|
141
|
-
const isLastAttemptsWithoutDrowing = !answers[answers.length - 1].drawing
|
|
142
|
-
if (answers.length > 0 && isLastAttemptsWithoutDrowing) {
|
|
143
|
-
model.dropdown.setExpanded(true)
|
|
144
|
-
} else {
|
|
145
|
-
model.dropdown.setExpanded(false)
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
model.resetPlayer()
|
|
149
|
-
}, [problemId])
|
|
150
|
-
|
|
151
|
-
useEffect(() => {
|
|
152
|
-
if (answersRef.current.some((answer) => answer.audioFileId)) {
|
|
153
|
-
model.initializeWithAudios(answersRef.current)
|
|
154
|
-
model.loader.loadAllTranscripts()
|
|
155
|
-
}
|
|
156
|
-
}, [model, answersKey])
|
|
157
|
-
|
|
158
|
-
useEffect(() => {
|
|
159
|
-
model.stopAudio()
|
|
160
|
-
}, [activeAttempt])
|
|
161
|
-
|
|
162
|
-
useEffect(() => {
|
|
163
|
-
const allAttempts = model.getAllAttempts()
|
|
164
|
-
setAttempts(allAttempts)
|
|
165
|
-
}, [answersKey, transcriptsLoaded, currentAttempt, model])
|
|
166
|
-
|
|
167
|
-
useEffect(() => {
|
|
168
|
-
if (isDropdownExpanded && activeAttempt !== null) {
|
|
169
|
-
setTimeout(() => {
|
|
170
|
-
scrollToAttempt(activeAttempt)
|
|
171
|
-
}, 500)
|
|
172
|
-
}
|
|
173
|
-
}, [isDropdownExpanded, answersKey])
|
|
174
|
-
|
|
175
|
-
const renderItem = useCallback(
|
|
176
|
-
({ item }: { item: VoiceTranscriptionItem }) => {
|
|
177
|
-
const isLoading = model.loader.isTranscriptLoading(item.attemptNumber)
|
|
178
|
-
const transcript = model.loader.getTranscript(item.attemptNumber)
|
|
179
|
-
const isActive = activeAttempt === item.attemptNumber
|
|
180
|
-
|
|
181
|
-
return (
|
|
182
|
-
<VoiceTranscriptionsDropdownItem
|
|
183
|
-
isLoading={isActive && isLoading}
|
|
184
|
-
attempt={item.attemptNumber}
|
|
185
|
-
content={
|
|
186
|
-
transcript && transcript !== NO_AUDIO_BE_MESSAGE
|
|
187
|
-
? transcript
|
|
188
|
-
: t('voice.transcriptNotAvailable')
|
|
189
|
-
}
|
|
190
|
-
isActive={isActive}
|
|
191
|
-
onToggle={handleItemToggle}
|
|
192
|
-
scrollToAttempt={scrollToAttempt}
|
|
193
|
-
/>
|
|
194
|
-
)
|
|
195
|
-
},
|
|
196
|
-
[model, activeAttempt, t, handleItemToggle, scrollToAttempt],
|
|
197
|
-
)
|
|
198
|
-
|
|
199
|
-
return (
|
|
200
|
-
<Animated.View style={[styles.container, style]}>
|
|
201
|
-
<View style={styles.header}>
|
|
202
|
-
<Typography style={styles.title} variant="h7">
|
|
203
|
-
{t('voice.transcriptions')}
|
|
204
|
-
</Typography>
|
|
205
|
-
{hasActiveTranscript && (
|
|
206
|
-
<Animated.View entering={FadeIn.duration(120)} exiting={FadeOut.duration(120)}>
|
|
207
|
-
<PlayButton
|
|
208
|
-
state={playButtonState}
|
|
209
|
-
onPress={handlePlayPress}
|
|
210
|
-
activityIndicatorColor={COLORS.NEUTRAL_1}
|
|
211
|
-
/>
|
|
212
|
-
</Animated.View>
|
|
213
|
-
)}
|
|
214
|
-
</View>
|
|
215
|
-
|
|
216
|
-
<Animated.View style={[listAnimatedStyle, { overflow: 'hidden' }]}>
|
|
217
|
-
<View onLayout={onListLayout} style={styles.listContainer}>
|
|
218
|
-
{IS_WEB ? (
|
|
219
|
-
<ScrollableListScrollView
|
|
220
|
-
bounces={false}
|
|
221
|
-
ref={scrollViewRef}
|
|
222
|
-
hideShadow
|
|
223
|
-
style={styles.list}
|
|
224
|
-
contentContainerStyle={styles.listContent}
|
|
225
|
-
>
|
|
226
|
-
{attempts.map((item) => (
|
|
227
|
-
<View key={item._id} onLayout={(e) => handleItemLayout(item._id, e)}>
|
|
228
|
-
{renderItem({ item })}
|
|
229
|
-
</View>
|
|
230
|
-
))}
|
|
231
|
-
</ScrollableListScrollView>
|
|
232
|
-
) : (
|
|
233
|
-
<ScrollableList
|
|
234
|
-
bounces={false}
|
|
235
|
-
ref={scrollRef}
|
|
236
|
-
hideShadow
|
|
237
|
-
data={attempts}
|
|
238
|
-
keyExtractor={(item) => item._id}
|
|
239
|
-
onScrollToIndexFailed={handleScrollToIndexFailed}
|
|
240
|
-
renderItem={renderItem}
|
|
241
|
-
contentContainerStyle={styles.listContent}
|
|
242
|
-
/>
|
|
243
|
-
)}
|
|
244
|
-
</View>
|
|
245
|
-
</Animated.View>
|
|
246
|
-
|
|
247
|
-
<AnimatedTouchableOpacity
|
|
248
|
-
style={[styles.expandButton, iconAnimatedStyle]}
|
|
249
|
-
onPress={() => model.dropdown.toggleExpand()}
|
|
250
|
-
>
|
|
251
|
-
<CaretDownIcon size={22} />
|
|
252
|
-
</AnimatedTouchableOpacity>
|
|
253
|
-
</Animated.View>
|
|
254
|
-
)
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
const styles = StyleSheet.create({
|
|
258
|
-
container: {
|
|
259
|
-
position: 'absolute',
|
|
260
|
-
top: 56,
|
|
261
|
-
left: 8,
|
|
262
|
-
width: 222,
|
|
263
|
-
maxHeight: 405,
|
|
264
|
-
minHeight: 51,
|
|
265
|
-
padding: 4,
|
|
266
|
-
boxShadow: '0px 1px 3px 0px rgba(51, 51, 51, 0.25)',
|
|
267
|
-
borderRadius: 12,
|
|
268
|
-
backgroundColor: COLORS.NEUTRAL_1,
|
|
269
|
-
overflow: 'hidden',
|
|
270
|
-
},
|
|
271
|
-
header: {
|
|
272
|
-
flexDirection: 'row',
|
|
273
|
-
justifyContent: 'space-between',
|
|
274
|
-
alignItems: 'center',
|
|
275
|
-
padding: 4,
|
|
276
|
-
marginBottom: 4,
|
|
277
|
-
height: 32,
|
|
278
|
-
},
|
|
279
|
-
title: {
|
|
280
|
-
color: COLORS.NEUTRAL_9,
|
|
281
|
-
marginLeft: 4,
|
|
282
|
-
},
|
|
283
|
-
list: { flex: 1 },
|
|
284
|
-
expandButton: {
|
|
285
|
-
justifyContent: 'center',
|
|
286
|
-
alignItems: 'center',
|
|
287
|
-
},
|
|
288
|
-
listContainer: {
|
|
289
|
-
position: 'absolute',
|
|
290
|
-
maxHeight: DROPDOWN_MAX_CONTENT_HEIGHT,
|
|
291
|
-
width: '100%',
|
|
292
|
-
},
|
|
293
|
-
listContent: {
|
|
294
|
-
paddingHorizontal: 4,
|
|
295
|
-
},
|
|
296
|
-
})
|
|
@@ -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
|
-
}
|