@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
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { replaceMappedTokens } from '../helpers'
|
|
2
|
+
|
|
3
|
+
export type LanguageGlossary = {
|
|
4
|
+
[languageCode: string]: Record<string, string>
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
type TranslationProviderProps = {
|
|
8
|
+
supportedLanguages: string[]
|
|
9
|
+
glossaries?: LanguageGlossary
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export abstract class TranslationProvider {
|
|
13
|
+
protected readonly supportedLanguages: ReadonlySet<string>
|
|
14
|
+
protected readonly glossaries: LanguageGlossary = {}
|
|
15
|
+
|
|
16
|
+
protected constructor({ supportedLanguages, glossaries = {} }: TranslationProviderProps) {
|
|
17
|
+
this.supportedLanguages = new Set(supportedLanguages)
|
|
18
|
+
this.glossaries = glossaries
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public abstract request(
|
|
22
|
+
text: string,
|
|
23
|
+
targetLanguage: string,
|
|
24
|
+
sourceLanguage?: string,
|
|
25
|
+
): Promise<string>
|
|
26
|
+
public abstract requestBatch(
|
|
27
|
+
text: string[],
|
|
28
|
+
targetLanguage: string,
|
|
29
|
+
sourceLanguage?: string,
|
|
30
|
+
): Promise<string[]>
|
|
31
|
+
|
|
32
|
+
public isTargetSupported(language: string) {
|
|
33
|
+
return this.resolveLanguage(language) !== null
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Returns the provider-supported variant of `language`, falling back to the base
|
|
38
|
+
* language part (e.g. "en-SE" → "en") when the exact locale is not listed.
|
|
39
|
+
* Subclasses may override to add their own resolution (e.g. language names).
|
|
40
|
+
* Returns null when the language cannot be resolved.
|
|
41
|
+
*/
|
|
42
|
+
public resolveLanguage(language: string): string | null {
|
|
43
|
+
if (!language) return null
|
|
44
|
+
if (this.supportedLanguages.has(language)) return language
|
|
45
|
+
const base = language.split('-')[0]
|
|
46
|
+
if (base !== language && this.supportedLanguages.has(base)) return base
|
|
47
|
+
return null
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public getSupportedLanguages() {
|
|
51
|
+
return this.supportedLanguages.values()
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Replaces full standalone words in text using a custom glossary for the target language,
|
|
56
|
+
* matching words like "Hello", or "Hej" regardless of case, but not when they appear inside other words.
|
|
57
|
+
*/
|
|
58
|
+
public applyGlossary(text: string, targetLanguage: string): string {
|
|
59
|
+
const glossary = this.glossaries[targetLanguage]
|
|
60
|
+
if (!glossary) return text
|
|
61
|
+
return replaceMappedTokens(text, glossary)
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type TranslatableProblem = {
|
|
2
|
+
description: string
|
|
3
|
+
richDescription?: string
|
|
4
|
+
answerVariants: string[]
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export type TranslateAllFxParams<TProblem extends TranslatableProblem = TranslatableProblem> = {
|
|
8
|
+
problem: TProblem | null
|
|
9
|
+
translationLanguageCode?: string | null
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type TranslateFxParams = {
|
|
13
|
+
cacheKey: string
|
|
14
|
+
text: string
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type Replacement = {
|
|
18
|
+
placeholder: string
|
|
19
|
+
original: string
|
|
20
|
+
leftPad?: boolean
|
|
21
|
+
rightPad?: boolean
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type MaskSegmentParams = {
|
|
25
|
+
text: string
|
|
26
|
+
regex: RegExp
|
|
27
|
+
placeholder: string
|
|
28
|
+
replacements: Replacement[]
|
|
29
|
+
shouldSkip?: (match: string) => boolean
|
|
30
|
+
}
|
|
@@ -4,8 +4,10 @@ export * from './recording/modal/VoiceRecordDeleteModal'
|
|
|
4
4
|
export * from './recording/modal/VoiceRecordUndoModal'
|
|
5
5
|
|
|
6
6
|
export * from './playing/model/VoicePlayer.model'
|
|
7
|
-
export * from './playing/components/
|
|
7
|
+
export * from './playing/components/VoiceTranscription'
|
|
8
|
+
export * from './playing/hooks/useVoicePlayerLifecycle'
|
|
8
9
|
|
|
9
10
|
export * from './playing/components/VoiceIcon'
|
|
10
11
|
export * from './constants'
|
|
11
12
|
export * from './types'
|
|
13
|
+
export type { WithAbortSignal } from '../../types/common.types'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import { COLORS, MicrophoneIcon } from '@magmamath/react-native-ui'
|
|
3
|
+
import { COLORS, MicrophoneIcon, SPACING } from '@magmamath/react-native-ui'
|
|
4
4
|
import Animated, { FadeIn } from 'react-native-reanimated'
|
|
5
5
|
|
|
6
6
|
type VoiceIconProps = {
|
|
@@ -28,7 +28,7 @@ const styles = StyleSheet.create({
|
|
|
28
28
|
height: '80%',
|
|
29
29
|
aspectRatio: 1,
|
|
30
30
|
alignSelf: 'center',
|
|
31
|
-
padding:
|
|
31
|
+
padding: SPACING[600],
|
|
32
32
|
borderWidth: 4,
|
|
33
33
|
borderColor: COLORS.NEUTRAL_5,
|
|
34
34
|
borderRadius: 400,
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {
|
|
2
|
+
COLORS,
|
|
3
|
+
Loader,
|
|
4
|
+
LoaderColor,
|
|
5
|
+
LoaderSize,
|
|
6
|
+
SPACING,
|
|
7
|
+
Typography,
|
|
8
|
+
} from '@magmamath/react-native-ui'
|
|
9
|
+
import React from 'react'
|
|
10
|
+
import { StyleSheet, View } from 'react-native'
|
|
11
|
+
|
|
12
|
+
type VoiceTranscriptContentProps = {
|
|
13
|
+
text: string
|
|
14
|
+
isLoading: boolean
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const VoiceTranscriptContent = ({ text, isLoading }: VoiceTranscriptContentProps) => {
|
|
18
|
+
if (isLoading) {
|
|
19
|
+
return (
|
|
20
|
+
<View style={styles.loaderContainer}>
|
|
21
|
+
<Loader size={LoaderSize.SMALL} color={LoaderColor.BLUE} />
|
|
22
|
+
</View>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<Typography variant="h8" style={styles.text}>
|
|
28
|
+
{text}
|
|
29
|
+
</Typography>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const styles = StyleSheet.create({
|
|
34
|
+
text: {
|
|
35
|
+
color: COLORS.NEUTRAL_7,
|
|
36
|
+
paddingHorizontal: SPACING[200],
|
|
37
|
+
paddingVertical: SPACING[200],
|
|
38
|
+
},
|
|
39
|
+
loaderContainer: {
|
|
40
|
+
justifyContent: 'center',
|
|
41
|
+
alignItems: 'center',
|
|
42
|
+
paddingVertical: SPACING[200],
|
|
43
|
+
},
|
|
44
|
+
})
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { Typography, COLORS, SPACING } from '@magmamath/react-native-ui'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native'
|
|
4
|
+
import Animated from 'react-native-reanimated'
|
|
5
|
+
import { AnswerAudio, VoiceTranscriptionVariant } from '../../types'
|
|
6
|
+
import { useText } from '../../../../i18n/i18n'
|
|
7
|
+
import { useVoiceTranscriptionController } from '../hooks/useVoiceTranscriptionController'
|
|
8
|
+
import { VoicePlayerModel } from '../model'
|
|
9
|
+
import { VoiceTranscriptContent } from './VoiceTranscriptContent'
|
|
10
|
+
import { VoiceTranscriptionCollapsible } from './VoiceTranscriptionCollapsible'
|
|
11
|
+
import { VoiceTranscriptionHeaderActions } from './VoiceTranscriptionHeaderActions'
|
|
12
|
+
|
|
13
|
+
type VoiceTranscriptionProps = {
|
|
14
|
+
style?: StyleProp<ViewStyle>
|
|
15
|
+
model: VoicePlayerModel
|
|
16
|
+
answers: AnswerAudio[]
|
|
17
|
+
attemptOffset: number
|
|
18
|
+
attemptsCount: number
|
|
19
|
+
problemId: string
|
|
20
|
+
variant?: VoiceTranscriptionVariant
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const VoiceTranscription = ({
|
|
24
|
+
style,
|
|
25
|
+
model,
|
|
26
|
+
answers,
|
|
27
|
+
attemptOffset,
|
|
28
|
+
attemptsCount,
|
|
29
|
+
problemId,
|
|
30
|
+
variant = VoiceTranscriptionVariant.SMALL,
|
|
31
|
+
}: VoiceTranscriptionProps) => {
|
|
32
|
+
const t = useText()
|
|
33
|
+
const { display, flags, actions } = useVoiceTranscriptionController({
|
|
34
|
+
model,
|
|
35
|
+
answers,
|
|
36
|
+
attemptOffset,
|
|
37
|
+
attemptsCount,
|
|
38
|
+
problemId,
|
|
39
|
+
})
|
|
40
|
+
const isLargeVariant = variant === VoiceTranscriptionVariant.LARGE
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<Animated.View
|
|
44
|
+
style={[
|
|
45
|
+
styles.container,
|
|
46
|
+
isLargeVariant ? styles.largeContainer : styles.smallContainer,
|
|
47
|
+
style,
|
|
48
|
+
]}
|
|
49
|
+
>
|
|
50
|
+
<View style={styles.header}>
|
|
51
|
+
<Typography style={styles.title} variant="h7">
|
|
52
|
+
{t('voice.transcriptions')}
|
|
53
|
+
</Typography>
|
|
54
|
+
{flags.anyAttemptHasAudio && (
|
|
55
|
+
<VoiceTranscriptionHeaderActions
|
|
56
|
+
playerState={flags.playerState}
|
|
57
|
+
isTranslationActive={flags.isTranslationActive}
|
|
58
|
+
canTranslate={flags.canTranslate}
|
|
59
|
+
onPlayPress={actions.onPlayPress}
|
|
60
|
+
onTranslationPress={actions.onTranslationToggle}
|
|
61
|
+
/>
|
|
62
|
+
)}
|
|
63
|
+
</View>
|
|
64
|
+
|
|
65
|
+
{isLargeVariant ? (
|
|
66
|
+
<VoiceTranscriptContent text={display.text} isLoading={display.isLoading} />
|
|
67
|
+
) : (
|
|
68
|
+
<VoiceTranscriptionCollapsible
|
|
69
|
+
text={display.text}
|
|
70
|
+
isLoading={display.isLoading}
|
|
71
|
+
dropdown={model.dropdown}
|
|
72
|
+
/>
|
|
73
|
+
)}
|
|
74
|
+
</Animated.View>
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const styles = StyleSheet.create({
|
|
79
|
+
container: {
|
|
80
|
+
padding: SPACING[100],
|
|
81
|
+
boxShadow: '0px 1px 3px 0px rgba(51, 51, 51, 0.25)',
|
|
82
|
+
borderRadius: 12,
|
|
83
|
+
backgroundColor: COLORS.NEUTRAL_1,
|
|
84
|
+
overflow: 'hidden',
|
|
85
|
+
},
|
|
86
|
+
// SMALL: floats over the drawing area; consumer-positioned siblings sit
|
|
87
|
+
// beneath it. Absolute positioning is intentional here.
|
|
88
|
+
smallContainer: {
|
|
89
|
+
position: 'absolute',
|
|
90
|
+
top: 56,
|
|
91
|
+
left: SPACING[200],
|
|
92
|
+
width: 222,
|
|
93
|
+
maxHeight: 405,
|
|
94
|
+
minHeight: 51,
|
|
95
|
+
},
|
|
96
|
+
// LARGE: rendered as a flex child of the SolutionCard's column flow,
|
|
97
|
+
// between the header and footer. Auto-sizes to whatever space the footer
|
|
98
|
+
// (with or without the playable timeline) leaves — no magic numbers.
|
|
99
|
+
largeContainer: {
|
|
100
|
+
flex: 1,
|
|
101
|
+
marginHorizontal: SPACING[200],
|
|
102
|
+
marginTop: SPACING[200],
|
|
103
|
+
marginBottom: SPACING[200],
|
|
104
|
+
},
|
|
105
|
+
header: {
|
|
106
|
+
flexDirection: 'row',
|
|
107
|
+
justifyContent: 'space-between',
|
|
108
|
+
alignItems: 'center',
|
|
109
|
+
padding: SPACING[100],
|
|
110
|
+
marginBottom: SPACING[100],
|
|
111
|
+
height: 32,
|
|
112
|
+
},
|
|
113
|
+
title: {
|
|
114
|
+
color: COLORS.NEUTRAL_9,
|
|
115
|
+
marginLeft: SPACING[100],
|
|
116
|
+
},
|
|
117
|
+
})
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { CaretDownIcon } from '@magmamath/react-native-ui'
|
|
2
|
+
import React, { useCallback } from 'react'
|
|
3
|
+
import { StyleSheet, TouchableOpacity, View } from 'react-native'
|
|
4
|
+
import Animated from 'react-native-reanimated'
|
|
5
|
+
import { useDropdownAnimation } from '../hooks/useDropdownAnimation'
|
|
6
|
+
import { DropdownModel } from '../model/Dropdown.model'
|
|
7
|
+
import { VoiceTranscriptContent } from './VoiceTranscriptContent'
|
|
8
|
+
|
|
9
|
+
const AnimatedTouchableOpacity = Animated.createAnimatedComponent(TouchableOpacity)
|
|
10
|
+
|
|
11
|
+
type VoiceTranscriptionCollapsibleProps = {
|
|
12
|
+
text: string
|
|
13
|
+
isLoading: boolean
|
|
14
|
+
dropdown: DropdownModel
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const VoiceTranscriptionCollapsible = ({
|
|
18
|
+
text,
|
|
19
|
+
isLoading,
|
|
20
|
+
dropdown,
|
|
21
|
+
}: VoiceTranscriptionCollapsibleProps) => {
|
|
22
|
+
const { listAnimatedStyle, iconAnimatedStyle, onListLayout } =
|
|
23
|
+
useDropdownAnimation(dropdown)
|
|
24
|
+
|
|
25
|
+
const handleToggle = useCallback(() => {
|
|
26
|
+
dropdown.toggleExpand()
|
|
27
|
+
}, [dropdown])
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<>
|
|
31
|
+
<Animated.View style={[listAnimatedStyle, styles.collapsibleContent]}>
|
|
32
|
+
<View onLayout={onListLayout} style={styles.transcriptContainer}>
|
|
33
|
+
<VoiceTranscriptContent text={text} isLoading={isLoading} />
|
|
34
|
+
</View>
|
|
35
|
+
</Animated.View>
|
|
36
|
+
<AnimatedTouchableOpacity
|
|
37
|
+
style={[styles.expandButton, iconAnimatedStyle]}
|
|
38
|
+
onPress={handleToggle}
|
|
39
|
+
>
|
|
40
|
+
<CaretDownIcon size={22} />
|
|
41
|
+
</AnimatedTouchableOpacity>
|
|
42
|
+
</>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const styles = StyleSheet.create({
|
|
47
|
+
collapsibleContent: {
|
|
48
|
+
overflow: 'hidden',
|
|
49
|
+
},
|
|
50
|
+
transcriptContainer: {
|
|
51
|
+
position: 'absolute',
|
|
52
|
+
width: '100%',
|
|
53
|
+
paddingHorizontal: 4,
|
|
54
|
+
},
|
|
55
|
+
expandButton: {
|
|
56
|
+
justifyContent: 'center',
|
|
57
|
+
alignItems: 'center',
|
|
58
|
+
},
|
|
59
|
+
})
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Button, COLORS, GlobeIcon, SPACING } from '@magmamath/react-native-ui'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { StyleSheet, View } from 'react-native'
|
|
4
|
+
import { ColorScheme } from '../../../chatbot/types/style.types'
|
|
5
|
+
import { PlayButton } from '../../../../shared/components/PlayButton'
|
|
6
|
+
import { PlayerState } from '../model'
|
|
7
|
+
import { getAudioStatus } from '../../helpers'
|
|
8
|
+
|
|
9
|
+
type VoiceTranscriptionsHeaderActionsProps = {
|
|
10
|
+
playerState: PlayerState
|
|
11
|
+
isTranslationActive: boolean
|
|
12
|
+
canTranslate: boolean
|
|
13
|
+
onPlayPress: () => void
|
|
14
|
+
onTranslationPress: () => void
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const VoiceTranscriptionHeaderActions = ({
|
|
18
|
+
playerState,
|
|
19
|
+
isTranslationActive,
|
|
20
|
+
canTranslate,
|
|
21
|
+
onPlayPress,
|
|
22
|
+
onTranslationPress,
|
|
23
|
+
}: VoiceTranscriptionsHeaderActionsProps) => {
|
|
24
|
+
const playButtonState = {
|
|
25
|
+
isActive: playerState !== PlayerState.IDLE,
|
|
26
|
+
isLoading: playerState === PlayerState.LOADING,
|
|
27
|
+
status: getAudioStatus(playerState),
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<View style={styles.container}>
|
|
32
|
+
<PlayButton
|
|
33
|
+
state={playButtonState}
|
|
34
|
+
onPress={onPlayPress}
|
|
35
|
+
activityIndicatorColor={COLORS.NEUTRAL_1}
|
|
36
|
+
colorScheme={ColorScheme.Yellow}
|
|
37
|
+
/>
|
|
38
|
+
{canTranslate && (
|
|
39
|
+
<Button
|
|
40
|
+
variant="secondary"
|
|
41
|
+
size="small"
|
|
42
|
+
colorScheme={ColorScheme.Yellow}
|
|
43
|
+
isActive={isTranslationActive}
|
|
44
|
+
onPress={onTranslationPress}
|
|
45
|
+
icon={<GlobeIcon color={isTranslationActive ? COLORS.NEUTRAL_1 : COLORS.NEUTRAL_9} />}
|
|
46
|
+
/>
|
|
47
|
+
)}
|
|
48
|
+
</View>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const styles = StyleSheet.create({
|
|
53
|
+
container: {
|
|
54
|
+
flexDirection: 'row',
|
|
55
|
+
alignItems: 'center',
|
|
56
|
+
gap: SPACING[200],
|
|
57
|
+
},
|
|
58
|
+
hidden: {
|
|
59
|
+
opacity: 0,
|
|
60
|
+
},
|
|
61
|
+
})
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useEffect } from 'react'
|
|
2
2
|
import { useUnit } from 'effector-react'
|
|
3
3
|
import { useAnimatedStyle, useSharedValue, withTiming, interpolate } from 'react-native-reanimated'
|
|
4
|
-
import {
|
|
4
|
+
import { DropdownModel } from '../model/Dropdown.model'
|
|
5
5
|
import { DROPDOWN_MAX_CONTENT_HEIGHT } from '../../constants'
|
|
6
6
|
import { LayoutChangeEvent } from 'react-native'
|
|
7
7
|
|
|
8
|
-
export const
|
|
8
|
+
export const useDropdownAnimation = (model: DropdownModel) => {
|
|
9
9
|
const isExpanded = useUnit(model.$isExpanded)
|
|
10
10
|
|
|
11
11
|
const contentHeight = useSharedValue(0)
|
|
@@ -13,9 +13,9 @@ export const useVoiceTranscriptionsDropdown = (model: VoiceTranscriptionsDropdow
|
|
|
13
13
|
|
|
14
14
|
const onListLayout = (event: LayoutChangeEvent) => {
|
|
15
15
|
const measuredHeight = event.nativeEvent.layout.height
|
|
16
|
-
if (measuredHeight
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
if (measuredHeight <= 0) return
|
|
17
|
+
contentHeight.value =
|
|
18
|
+
contentHeight.value === 0 ? measuredHeight : withTiming(measuredHeight, { duration: 180 })
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
const listAnimatedStyle = useAnimatedStyle(() => {
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { useEffect, useMemo, useRef } from 'react'
|
|
2
|
+
import { getActiveAttempt } from '../../helpers'
|
|
3
|
+
import { AnswerAudio } from '../../types'
|
|
4
|
+
import { VoicePlayerModel } from '../model'
|
|
5
|
+
|
|
6
|
+
type Params = {
|
|
7
|
+
model: VoicePlayerModel
|
|
8
|
+
answers: AnswerAudio[]
|
|
9
|
+
attemptOffset: number
|
|
10
|
+
attemptsCount: number
|
|
11
|
+
problemId: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Owns playback engine mutations (init/reset/setCurrentAttempt/stopAudio).
|
|
15
|
+
// VoiceTranscription stays read-only; consumers call this once per page.
|
|
16
|
+
export const useVoicePlayerLifecycle = ({
|
|
17
|
+
model,
|
|
18
|
+
answers,
|
|
19
|
+
attemptOffset,
|
|
20
|
+
attemptsCount,
|
|
21
|
+
problemId,
|
|
22
|
+
}: Params) => {
|
|
23
|
+
const activeAttempt = getActiveAttempt(attemptOffset, attemptsCount)
|
|
24
|
+
|
|
25
|
+
const answersKey = useMemo(
|
|
26
|
+
() => answers.map((a) => `${a._id}:${a.audioFileId ?? ''}`).join(','),
|
|
27
|
+
[answers],
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
const hasAnyAudio = useMemo(() => answers.some((a) => !!a.audioFileId), [answers])
|
|
31
|
+
|
|
32
|
+
const answersRef = useRef(answers)
|
|
33
|
+
answersRef.current = answers
|
|
34
|
+
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
model.reinitializePlayer()
|
|
37
|
+
// No stopAudio cleanup: this hook re-runs across normal renders in some
|
|
38
|
+
// host components, and tearing down audio in the cleanup races with
|
|
39
|
+
// play() requests from other consumers (e.g. TimelineManager). The page
|
|
40
|
+
// unmount path (resetPlayer / cleanup) still releases audio properly.
|
|
41
|
+
}, [model])
|
|
42
|
+
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
model.resetPlayer()
|
|
45
|
+
}, [problemId])
|
|
46
|
+
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
if (answersRef.current.some((a) => a.audioFileId)) {
|
|
49
|
+
model.initializeWithAudios(answersRef.current)
|
|
50
|
+
}
|
|
51
|
+
}, [model, answersKey])
|
|
52
|
+
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
// No stopAudio: VoiceSource (timeline) and VoiceTranscription (manual play
|
|
55
|
+
// button) drive playback transitions themselves. Calling stopAudio here
|
|
56
|
+
// races with concurrent play() requests and aborts in-flight audio.play().
|
|
57
|
+
model.setCurrentAttempt(activeAttempt)
|
|
58
|
+
if (activeAttempt !== null) {
|
|
59
|
+
model.loader.loadTranscriptForAttempt(activeAttempt)
|
|
60
|
+
}
|
|
61
|
+
}, [model, activeAttempt, answersKey])
|
|
62
|
+
|
|
63
|
+
return { activeAttempt, hasAnyAudio }
|
|
64
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { useUnit } from 'effector-react'
|
|
2
|
+
import { useCallback, useEffect, useMemo, useRef } from 'react'
|
|
3
|
+
import { useTranslation } from 'react-i18next'
|
|
4
|
+
import { NO_AUDIO_BE_MESSAGE } from '../../constants'
|
|
5
|
+
import { getActiveAttempt } from '../../helpers'
|
|
6
|
+
import { AnswerAudio } from '../../types'
|
|
7
|
+
import { resolveGoogleLanguageCode } from '../../../translation/providers/google/supportedLanguages'
|
|
8
|
+
import { useText } from '../../../../i18n/i18n'
|
|
9
|
+
import { VoicePlayerModel } from '../model'
|
|
10
|
+
import { PlayerState } from '../model/Player.model'
|
|
11
|
+
|
|
12
|
+
type Params = {
|
|
13
|
+
model: VoicePlayerModel
|
|
14
|
+
answers: AnswerAudio[]
|
|
15
|
+
attemptOffset: number
|
|
16
|
+
attemptsCount: number
|
|
17
|
+
problemId: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type VoiceTranscriptionController = ReturnType<typeof useVoiceTranscriptionController>
|
|
21
|
+
|
|
22
|
+
export const useVoiceTranscriptionController = ({
|
|
23
|
+
model,
|
|
24
|
+
answers,
|
|
25
|
+
attemptOffset,
|
|
26
|
+
attemptsCount,
|
|
27
|
+
problemId,
|
|
28
|
+
}: Params) => {
|
|
29
|
+
const t = useText()
|
|
30
|
+
const { i18n } = useTranslation()
|
|
31
|
+
|
|
32
|
+
const [playerState, isLoadingTranscripts, isTranslationActive, translations, isTranslating] =
|
|
33
|
+
useUnit([
|
|
34
|
+
model.$playerState,
|
|
35
|
+
model.loader.loadTranscriptForAttempt.pending,
|
|
36
|
+
model.translation.$isActive,
|
|
37
|
+
model.translation.$translations,
|
|
38
|
+
model.translation.translate.pending,
|
|
39
|
+
])
|
|
40
|
+
// Auto-activate translation once per (problemId, activeAttempt) when translatable
|
|
41
|
+
const autoActivatedAttempts = useRef(new Set<number>())
|
|
42
|
+
|
|
43
|
+
const activeAttempt = getActiveAttempt(attemptOffset, attemptsCount)
|
|
44
|
+
|
|
45
|
+
const activeAudioFileId =
|
|
46
|
+
activeAttempt !== null ? answers?.[activeAttempt - 1]?.audioFileId : undefined
|
|
47
|
+
const hasActiveAudio = activeAudioFileId !== undefined
|
|
48
|
+
const anyAttemptHasAudio = useMemo(() => answers.some((a) => !!a.audioFileId), [answers])
|
|
49
|
+
|
|
50
|
+
const cachedEntry = activeAudioFileId
|
|
51
|
+
? model.loader.getCachedTranscript(activeAudioFileId)
|
|
52
|
+
: undefined
|
|
53
|
+
const activeTranscript = cachedEntry?.text ?? null
|
|
54
|
+
const hasTranscriptText = !!activeTranscript && activeTranscript !== NO_AUDIO_BE_MESSAGE
|
|
55
|
+
const isActiveTranscriptLoading = isLoadingTranscripts && hasActiveAudio && !activeTranscript
|
|
56
|
+
|
|
57
|
+
const isSourceSameAsTarget =
|
|
58
|
+
!!cachedEntry?.language &&
|
|
59
|
+
resolveGoogleLanguageCode(cachedEntry.language) === resolveGoogleLanguageCode(i18n.language)
|
|
60
|
+
|
|
61
|
+
const canTranslate = hasTranscriptText && !isSourceSameAsTarget
|
|
62
|
+
|
|
63
|
+
const cachedTranslation = activeAttempt !== null ? translations[activeAttempt] : undefined
|
|
64
|
+
const showTranslation = isTranslationActive && canTranslate
|
|
65
|
+
const isTranslationLoading = showTranslation && !cachedTranslation && isTranslating
|
|
66
|
+
|
|
67
|
+
const displayText = showTranslation
|
|
68
|
+
? (cachedTranslation ?? activeTranscript!)
|
|
69
|
+
: hasTranscriptText
|
|
70
|
+
? activeTranscript!
|
|
71
|
+
: t('voice.transcriptNotAvailable')
|
|
72
|
+
|
|
73
|
+
// UI-only lifecycle: collapse the dropdown on mount/unmount and on problem
|
|
74
|
+
// change. Playback engine mutations (init/reset/setCurrentAttempt/stopAudio)
|
|
75
|
+
// are owned by useVoicePlayerLifecycle, called by the page-level consumer.
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
return () => {
|
|
78
|
+
model.dropdown.setExpanded(false)
|
|
79
|
+
}
|
|
80
|
+
}, [model])
|
|
81
|
+
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
model.dropdown.setExpanded(false)
|
|
84
|
+
}, [problemId])
|
|
85
|
+
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
autoActivatedAttempts.current.clear()
|
|
88
|
+
}, [problemId])
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
if (
|
|
91
|
+
canTranslate &&
|
|
92
|
+
activeAttempt !== null &&
|
|
93
|
+
!autoActivatedAttempts.current.has(activeAttempt)
|
|
94
|
+
) {
|
|
95
|
+
autoActivatedAttempts.current.add(activeAttempt)
|
|
96
|
+
model.translation.setActive(true)
|
|
97
|
+
}
|
|
98
|
+
}, [canTranslate, activeAttempt, model])
|
|
99
|
+
|
|
100
|
+
// Trigger translate when we should show translation but don't have it cached
|
|
101
|
+
useEffect(() => {
|
|
102
|
+
if (showTranslation && activeAttempt !== null && !cachedTranslation && !isTranslating) {
|
|
103
|
+
model.translation.translate({
|
|
104
|
+
attemptNumber: activeAttempt,
|
|
105
|
+
targetLanguage: i18n.language,
|
|
106
|
+
})
|
|
107
|
+
}
|
|
108
|
+
}, [showTranslation, activeAttempt, cachedTranslation, isTranslating, i18n.language, model])
|
|
109
|
+
|
|
110
|
+
// Auto-open dropdown when a translation successfully completes
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
return model.translation.translate.doneData.watch((result) => {
|
|
113
|
+
if (result) {
|
|
114
|
+
model.dropdown.setExpanded(true)
|
|
115
|
+
}
|
|
116
|
+
})
|
|
117
|
+
}, [model])
|
|
118
|
+
|
|
119
|
+
const onPlayPress = useCallback(() => {
|
|
120
|
+
if (activeAttempt) {
|
|
121
|
+
model.translation.setActive(false)
|
|
122
|
+
model.togglePlayPause(activeAttempt)
|
|
123
|
+
}
|
|
124
|
+
}, [model, activeAttempt])
|
|
125
|
+
|
|
126
|
+
const onTranslationToggle = useCallback(() => {
|
|
127
|
+
model.translation.toggle()
|
|
128
|
+
model.dropdown.setExpanded(true)
|
|
129
|
+
}, [model])
|
|
130
|
+
|
|
131
|
+
return {
|
|
132
|
+
display: {
|
|
133
|
+
text: displayText,
|
|
134
|
+
isLoading: isActiveTranscriptLoading || isTranslationLoading,
|
|
135
|
+
},
|
|
136
|
+
flags: {
|
|
137
|
+
playerState: playerState as PlayerState,
|
|
138
|
+
hasActiveAudio,
|
|
139
|
+
anyAttemptHasAudio,
|
|
140
|
+
canTranslate,
|
|
141
|
+
isTranslationActive,
|
|
142
|
+
},
|
|
143
|
+
actions: {
|
|
144
|
+
onPlayPress,
|
|
145
|
+
onTranslationToggle,
|
|
146
|
+
},
|
|
147
|
+
}
|
|
148
|
+
}
|
package/src/features/voice/playing/model/{VoiceTranscriptionsDropdown.model.ts → Dropdown.model.ts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createEvent,
|
|
1
|
+
import { createEvent, restore } from 'effector'
|
|
2
2
|
|
|
3
|
-
export class
|
|
3
|
+
export class DropdownModel {
|
|
4
4
|
public readonly toggleExpand = createEvent()
|
|
5
5
|
public readonly setExpanded = createEvent<boolean>()
|
|
6
6
|
public readonly reset = createEvent()
|