@magmamath/students-features 1.3.23-rc.21 → 1.3.23-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/features/voice/playing/components/VoiceTranscription.js +48 -39
- package/dist/commonjs/features/voice/playing/components/VoiceTranscription.js.map +1 -1
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.js +2 -2
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.js.map +1 -1
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.js +8 -7
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.js.map +1 -1
- package/dist/commonjs/features/voice/playing/hooks/{useDropdownAnimation.js → useVoiceTranscription.js} +7 -8
- package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscription.js.map +1 -0
- package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionEffects.js +37 -0
- package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionEffects.js.map +1 -0
- package/dist/commonjs/features/voice/playing/model/Player.model.js +1 -24
- package/dist/commonjs/features/voice/playing/model/Player.model.js.map +1 -1
- package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.js +66 -0
- package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.js.map +1 -0
- package/dist/commonjs/features/voice/playing/model/VoiceFileDownloader.model.js +2 -2
- package/dist/commonjs/features/voice/playing/model/VoiceFileDownloader.model.js.map +1 -1
- package/dist/commonjs/features/voice/playing/model/VoicePlayer.model.js +175 -46
- package/dist/commonjs/features/voice/playing/model/VoicePlayer.model.js.map +1 -1
- package/dist/commonjs/features/voice/playing/model/{Dropdown.model.js → VoiceTranscription.model.js} +4 -4
- package/dist/commonjs/features/voice/playing/model/VoiceTranscription.model.js.map +1 -0
- package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionTranslation.model.js +15 -0
- package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionTranslation.model.js.map +1 -0
- package/dist/commonjs/features/voice/playing/model/{TranscriptionsCollection.js → VoiceTranscriptionsCollection.js} +4 -4
- package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.js.map +1 -0
- package/dist/commonjs/features/voice/types.js.map +1 -1
- package/dist/commonjs/index.js +0 -12
- package/dist/commonjs/index.js.map +1 -1
- package/dist/module/features/voice/playing/components/VoiceTranscription.js +47 -40
- package/dist/module/features/voice/playing/components/VoiceTranscription.js.map +1 -1
- package/dist/module/features/voice/playing/components/VoiceTranscriptionCollapsible.js +2 -2
- package/dist/module/features/voice/playing/components/VoiceTranscriptionCollapsible.js.map +1 -1
- package/dist/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.js +7 -8
- package/dist/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.js.map +1 -1
- package/dist/module/features/voice/playing/hooks/{useDropdownAnimation.js → useVoiceTranscription.js} +5 -6
- package/dist/module/features/voice/playing/hooks/useVoiceTranscription.js.map +1 -0
- package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionEffects.js +32 -0
- package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionEffects.js.map +1 -0
- package/dist/module/features/voice/playing/model/Player.model.js +1 -24
- package/dist/module/features/voice/playing/model/Player.model.js.map +1 -1
- package/dist/module/features/voice/playing/model/TranscriptionsDownloaderModel.js +61 -0
- package/dist/module/features/voice/playing/model/TranscriptionsDownloaderModel.js.map +1 -0
- package/dist/module/features/voice/playing/model/VoiceFileDownloader.model.js +2 -2
- package/dist/module/features/voice/playing/model/VoiceFileDownloader.model.js.map +1 -1
- package/dist/module/features/voice/playing/model/VoicePlayer.model.js +177 -48
- package/dist/module/features/voice/playing/model/VoicePlayer.model.js.map +1 -1
- package/dist/module/features/voice/playing/model/{Dropdown.model.js → VoiceTranscription.model.js} +2 -2
- package/dist/module/features/voice/playing/model/VoiceTranscription.model.js.map +1 -0
- package/dist/module/features/voice/playing/model/VoiceTranscriptionTranslation.model.js +10 -0
- package/dist/module/features/voice/playing/model/VoiceTranscriptionTranslation.model.js.map +1 -0
- package/dist/module/features/voice/playing/model/{TranscriptionsCollection.js → VoiceTranscriptionsCollection.js} +2 -2
- package/dist/module/features/voice/playing/model/VoiceTranscriptionsCollection.js.map +1 -0
- package/dist/module/features/voice/types.js.map +1 -1
- package/dist/module/index.js +0 -1
- package/dist/module/index.js.map +1 -1
- package/dist/typescript/commonjs/features/voice/index.d.ts +0 -1
- package/dist/typescript/commonjs/features/voice/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscription.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts +2 -2
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/playing/hooks/{useDropdownAnimation.d.ts → useVoiceTranscription.d.ts} +3 -3
- package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscription.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionEffects.d.ts +12 -0
- package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionEffects.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/model/Player.model.d.ts +0 -3
- package/dist/typescript/commonjs/features/voice/playing/model/Player.model.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts +15 -0
- package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/model/VoiceFileDownloader.model.d.ts +2 -2
- package/dist/typescript/commonjs/features/voice/playing/model/VoiceFileDownloader.model.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/playing/model/VoicePlayer.model.d.ts +20 -18
- package/dist/typescript/commonjs/features/voice/playing/model/VoicePlayer.model.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/playing/model/{Dropdown.model.d.ts → VoiceTranscription.model.d.ts} +2 -2
- package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscription.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionTranslation.model.d.ts +7 -0
- package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionTranslation.model.d.ts.map +1 -0
- package/dist/typescript/{module/features/voice/playing/model/TranscriptionsCollection.d.ts → commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts} +2 -2
- package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/types.d.ts +1 -4
- package/dist/typescript/commonjs/features/voice/types.d.ts.map +1 -1
- package/dist/typescript/commonjs/index.d.ts +0 -1
- package/dist/typescript/commonjs/index.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/index.d.ts +0 -1
- package/dist/typescript/module/features/voice/index.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscription.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts +2 -2
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/playing/hooks/{useDropdownAnimation.d.ts → useVoiceTranscription.d.ts} +3 -3
- package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscription.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionEffects.d.ts +12 -0
- package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionEffects.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/model/Player.model.d.ts +0 -3
- package/dist/typescript/module/features/voice/playing/model/Player.model.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts +15 -0
- package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/model/VoiceFileDownloader.model.d.ts +2 -2
- package/dist/typescript/module/features/voice/playing/model/VoiceFileDownloader.model.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/playing/model/VoicePlayer.model.d.ts +20 -18
- package/dist/typescript/module/features/voice/playing/model/VoicePlayer.model.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/playing/model/{Dropdown.model.d.ts → VoiceTranscription.model.d.ts} +2 -2
- package/dist/typescript/module/features/voice/playing/model/VoiceTranscription.model.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionTranslation.model.d.ts +7 -0
- package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionTranslation.model.d.ts.map +1 -0
- package/dist/typescript/{commonjs/features/voice/playing/model/TranscriptionsCollection.d.ts → module/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts} +2 -2
- package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/types.d.ts +1 -4
- package/dist/typescript/module/features/voice/types.d.ts.map +1 -1
- package/dist/typescript/module/index.d.ts +0 -1
- package/dist/typescript/module/index.d.ts.map +1 -1
- package/package.json +1 -28
- package/src/features/voice/index.ts +0 -1
- package/src/features/voice/playing/components/VoiceTranscription.tsx +60 -43
- package/src/features/voice/playing/components/VoiceTranscriptionCollapsible.tsx +4 -4
- package/src/features/voice/playing/components/VoiceTranscriptionHeaderActions.tsx +9 -8
- package/src/features/voice/playing/hooks/{useDropdownAnimation.ts → useVoiceTranscription.ts} +5 -5
- package/src/features/voice/playing/hooks/useVoiceTranscriptionEffects.ts +44 -0
- package/src/features/voice/playing/model/Player.model.ts +1 -26
- package/src/features/voice/playing/model/TranscriptionsDownloaderModel.ts +80 -0
- package/src/features/voice/playing/model/VoiceFileDownloader.model.ts +2 -2
- package/src/features/voice/playing/model/VoicePlayer.model.ts +196 -56
- package/src/features/voice/playing/model/{Dropdown.model.ts → VoiceTranscription.model.ts} +1 -1
- package/src/features/voice/playing/model/VoiceTranscriptionTranslation.model.ts +11 -0
- package/src/features/voice/playing/model/{TranscriptionsCollection.ts → VoiceTranscriptionsCollection.ts} +1 -1
- package/src/features/voice/types.ts +0 -9
- package/src/index.ts +0 -1
- package/dist/commonjs/features/translation/constants.js +0 -11
- package/dist/commonjs/features/translation/constants.js.map +0 -1
- package/dist/commonjs/features/translation/helpers.js +0 -60
- package/dist/commonjs/features/translation/helpers.js.map +0 -1
- package/dist/commonjs/features/translation/index.js +0 -105
- package/dist/commonjs/features/translation/index.js.map +0 -1
- package/dist/commonjs/features/translation/model/TranslationModel.js +0 -122
- package/dist/commonjs/features/translation/model/TranslationModel.js.map +0 -1
- package/dist/commonjs/features/translation/model/TranslationPreprocessor.js +0 -142
- package/dist/commonjs/features/translation/model/TranslationPreprocessor.js.map +0 -1
- package/dist/commonjs/features/translation/model/TranslationService.js +0 -112
- package/dist/commonjs/features/translation/model/TranslationService.js.map +0 -1
- package/dist/commonjs/features/translation/preserve/wordsToPreserve.js +0 -314
- package/dist/commonjs/features/translation/preserve/wordsToPreserve.js.map +0 -1
- package/dist/commonjs/features/translation/providers/google/GoogleTranslationProvider.js +0 -50
- package/dist/commonjs/features/translation/providers/google/GoogleTranslationProvider.js.map +0 -1
- package/dist/commonjs/features/translation/providers/google/supportedLanguages.js +0 -230
- package/dist/commonjs/features/translation/providers/google/supportedLanguages.js.map +0 -1
- package/dist/commonjs/features/translation/providers/google.types.js +0 -2
- package/dist/commonjs/features/translation/providers/google.types.js.map +0 -1
- package/dist/commonjs/features/translation/providers/translation.interface.js +0 -49
- package/dist/commonjs/features/translation/providers/translation.interface.js.map +0 -1
- package/dist/commonjs/features/translation/types.js +0 -2
- package/dist/commonjs/features/translation/types.js.map +0 -1
- package/dist/commonjs/features/voice/playing/hooks/useDropdownAnimation.js.map +0 -1
- package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.js +0 -128
- package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.js.map +0 -1
- package/dist/commonjs/features/voice/playing/model/Dropdown.model.js.map +0 -1
- package/dist/commonjs/features/voice/playing/model/PlaybackController.js +0 -183
- package/dist/commonjs/features/voice/playing/model/PlaybackController.js.map +0 -1
- package/dist/commonjs/features/voice/playing/model/TranscriptionsCollection.js.map +0 -1
- package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.js +0 -82
- package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.js.map +0 -1
- package/dist/commonjs/features/voice/playing/model/Translation.model.js +0 -62
- package/dist/commonjs/features/voice/playing/model/Translation.model.js.map +0 -1
- package/dist/module/features/translation/constants.js +0 -7
- package/dist/module/features/translation/constants.js.map +0 -1
- package/dist/module/features/translation/helpers.js +0 -53
- package/dist/module/features/translation/helpers.js.map +0 -1
- package/dist/module/features/translation/index.js +0 -12
- package/dist/module/features/translation/index.js.map +0 -1
- package/dist/module/features/translation/model/TranslationModel.js +0 -117
- package/dist/module/features/translation/model/TranslationModel.js.map +0 -1
- package/dist/module/features/translation/model/TranslationPreprocessor.js +0 -137
- package/dist/module/features/translation/model/TranslationPreprocessor.js.map +0 -1
- package/dist/module/features/translation/model/TranslationService.js +0 -107
- package/dist/module/features/translation/model/TranslationService.js.map +0 -1
- package/dist/module/features/translation/preserve/wordsToPreserve.js +0 -310
- package/dist/module/features/translation/preserve/wordsToPreserve.js.map +0 -1
- package/dist/module/features/translation/providers/google/GoogleTranslationProvider.js +0 -45
- package/dist/module/features/translation/providers/google/GoogleTranslationProvider.js.map +0 -1
- package/dist/module/features/translation/providers/google/supportedLanguages.js +0 -225
- package/dist/module/features/translation/providers/google/supportedLanguages.js.map +0 -1
- package/dist/module/features/translation/providers/google.types.js +0 -2
- package/dist/module/features/translation/providers/google.types.js.map +0 -1
- package/dist/module/features/translation/providers/translation.interface.js +0 -44
- package/dist/module/features/translation/providers/translation.interface.js.map +0 -1
- package/dist/module/features/translation/types.js +0 -2
- package/dist/module/features/translation/types.js.map +0 -1
- package/dist/module/features/voice/playing/hooks/useDropdownAnimation.js.map +0 -1
- package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionController.js +0 -123
- package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionController.js.map +0 -1
- package/dist/module/features/voice/playing/model/Dropdown.model.js.map +0 -1
- package/dist/module/features/voice/playing/model/PlaybackController.js +0 -178
- package/dist/module/features/voice/playing/model/PlaybackController.js.map +0 -1
- package/dist/module/features/voice/playing/model/TranscriptionsCollection.js.map +0 -1
- package/dist/module/features/voice/playing/model/TranscriptionsDownloader.model.js +0 -77
- package/dist/module/features/voice/playing/model/TranscriptionsDownloader.model.js.map +0 -1
- package/dist/module/features/voice/playing/model/Translation.model.js +0 -57
- package/dist/module/features/voice/playing/model/Translation.model.js.map +0 -1
- package/dist/typescript/commonjs/features/translation/constants.d.ts +0 -5
- package/dist/typescript/commonjs/features/translation/constants.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/translation/helpers.d.ts +0 -9
- package/dist/typescript/commonjs/features/translation/helpers.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/translation/index.d.ts +0 -12
- package/dist/typescript/commonjs/features/translation/index.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/translation/model/TranslationModel.d.ts +0 -33
- package/dist/typescript/commonjs/features/translation/model/TranslationModel.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/translation/model/TranslationPreprocessor.d.ts +0 -34
- package/dist/typescript/commonjs/features/translation/model/TranslationPreprocessor.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/translation/model/TranslationService.d.ts +0 -40
- package/dist/typescript/commonjs/features/translation/model/TranslationService.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/translation/preserve/wordsToPreserve.d.ts +0 -3
- package/dist/typescript/commonjs/features/translation/preserve/wordsToPreserve.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/translation/providers/google/GoogleTranslationProvider.d.ts +0 -17
- package/dist/typescript/commonjs/features/translation/providers/google/GoogleTranslationProvider.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/translation/providers/google/supportedLanguages.d.ts +0 -209
- package/dist/typescript/commonjs/features/translation/providers/google/supportedLanguages.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/translation/providers/google.types.d.ts +0 -15
- package/dist/typescript/commonjs/features/translation/providers/google.types.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/translation/providers/translation.interface.d.ts +0 -30
- package/dist/typescript/commonjs/features/translation/providers/translation.interface.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/translation/types.d.ts +0 -27
- package/dist/typescript/commonjs/features/translation/types.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/hooks/useDropdownAnimation.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts +0 -30
- package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/model/Dropdown.model.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/model/PlaybackController.d.ts +0 -28
- package/dist/typescript/commonjs/features/voice/playing/model/PlaybackController.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsCollection.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.d.ts +0 -19
- package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/model/Translation.model.d.ts +0 -25
- package/dist/typescript/commonjs/features/voice/playing/model/Translation.model.d.ts.map +0 -1
- package/dist/typescript/module/features/translation/constants.d.ts +0 -5
- package/dist/typescript/module/features/translation/constants.d.ts.map +0 -1
- package/dist/typescript/module/features/translation/helpers.d.ts +0 -9
- package/dist/typescript/module/features/translation/helpers.d.ts.map +0 -1
- package/dist/typescript/module/features/translation/index.d.ts +0 -12
- package/dist/typescript/module/features/translation/index.d.ts.map +0 -1
- package/dist/typescript/module/features/translation/model/TranslationModel.d.ts +0 -33
- package/dist/typescript/module/features/translation/model/TranslationModel.d.ts.map +0 -1
- package/dist/typescript/module/features/translation/model/TranslationPreprocessor.d.ts +0 -34
- package/dist/typescript/module/features/translation/model/TranslationPreprocessor.d.ts.map +0 -1
- package/dist/typescript/module/features/translation/model/TranslationService.d.ts +0 -40
- package/dist/typescript/module/features/translation/model/TranslationService.d.ts.map +0 -1
- package/dist/typescript/module/features/translation/preserve/wordsToPreserve.d.ts +0 -3
- package/dist/typescript/module/features/translation/preserve/wordsToPreserve.d.ts.map +0 -1
- package/dist/typescript/module/features/translation/providers/google/GoogleTranslationProvider.d.ts +0 -17
- package/dist/typescript/module/features/translation/providers/google/GoogleTranslationProvider.d.ts.map +0 -1
- package/dist/typescript/module/features/translation/providers/google/supportedLanguages.d.ts +0 -209
- package/dist/typescript/module/features/translation/providers/google/supportedLanguages.d.ts.map +0 -1
- package/dist/typescript/module/features/translation/providers/google.types.d.ts +0 -15
- package/dist/typescript/module/features/translation/providers/google.types.d.ts.map +0 -1
- package/dist/typescript/module/features/translation/providers/translation.interface.d.ts +0 -30
- package/dist/typescript/module/features/translation/providers/translation.interface.d.ts.map +0 -1
- package/dist/typescript/module/features/translation/types.d.ts +0 -27
- package/dist/typescript/module/features/translation/types.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/hooks/useDropdownAnimation.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts +0 -30
- package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/model/Dropdown.model.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/model/PlaybackController.d.ts +0 -28
- package/dist/typescript/module/features/voice/playing/model/PlaybackController.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/model/TranscriptionsCollection.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloader.model.d.ts +0 -19
- package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloader.model.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/model/Translation.model.d.ts +0 -25
- package/dist/typescript/module/features/voice/playing/model/Translation.model.d.ts.map +0 -1
- package/src/features/translation/constants.ts +0 -4
- package/src/features/translation/helpers.ts +0 -63
- package/src/features/translation/index.ts +0 -30
- package/src/features/translation/model/TranslationModel.ts +0 -174
- package/src/features/translation/model/TranslationPreprocessor.ts +0 -171
- package/src/features/translation/model/TranslationService.ts +0 -148
- package/src/features/translation/preserve/wordsToPreserve.ts +0 -87
- package/src/features/translation/providers/google/GoogleTranslationProvider.ts +0 -50
- package/src/features/translation/providers/google/supportedLanguages.ts +0 -229
- package/src/features/translation/providers/google.types.ts +0 -16
- package/src/features/translation/providers/translation.interface.ts +0 -63
- package/src/features/translation/types.ts +0 -30
- package/src/features/voice/playing/hooks/useVoiceTranscriptionController.ts +0 -171
- package/src/features/voice/playing/model/PlaybackController.ts +0 -213
- package/src/features/voice/playing/model/TranscriptionsDownloader.model.ts +0 -88
- package/src/features/voice/playing/model/Translation.model.ts +0 -75
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { attach, combine, createEffect, createEvent, restore, sample, split } from 'effector';
|
|
4
|
-
import { GoogleTranslationProvider } from "../providers/google/GoogleTranslationProvider.js";
|
|
5
|
-
import { TranslationService } from "./TranslationService.js";
|
|
6
|
-
import { preservedWordsReplacers, wordsToPreserve } from "../preserve/wordsToPreserve.js";
|
|
7
|
-
import { CHOICES_CACHE_KEY_SUFFIX, DESCRIPTION_CACHE_KEY_SUFFIX, GBD_TEXT_CACHE_SUFFIX } from "../constants.js";
|
|
8
|
-
export class TranslationModel {
|
|
9
|
-
toggle = createEvent();
|
|
10
|
-
setTranslated = createEvent();
|
|
11
|
-
reset = createEvent();
|
|
12
|
-
$isTranslationActive = restore(this.setTranslated, false).reset(this.reset);
|
|
13
|
-
$isTranslated = this.$isTranslationActive;
|
|
14
|
-
constructor({
|
|
15
|
-
$problem,
|
|
16
|
-
$problemId,
|
|
17
|
-
$assignmentId,
|
|
18
|
-
$currentProblemIndex,
|
|
19
|
-
$translationLanguageCode,
|
|
20
|
-
$contentLanguageCode,
|
|
21
|
-
$isTranslationLocked,
|
|
22
|
-
languageChanged,
|
|
23
|
-
api,
|
|
24
|
-
getGreatWorkFeedbackText
|
|
25
|
-
}) {
|
|
26
|
-
this.service = new TranslationService({
|
|
27
|
-
preserve: {
|
|
28
|
-
map: wordsToPreserve,
|
|
29
|
-
replacers: preservedWordsReplacers
|
|
30
|
-
},
|
|
31
|
-
providers: [new GoogleTranslationProvider({
|
|
32
|
-
api
|
|
33
|
-
})],
|
|
34
|
-
onError: () => this.reset()
|
|
35
|
-
});
|
|
36
|
-
this.service.bindCustomCacheKey($problemId, (problemId, {
|
|
37
|
-
target
|
|
38
|
-
}) => `${problemId}::${target}`);
|
|
39
|
-
this.service.bindTargetLanguage($translationLanguageCode);
|
|
40
|
-
if ($contentLanguageCode) {
|
|
41
|
-
this.service.bindSourceLanguage($contentLanguageCode);
|
|
42
|
-
}
|
|
43
|
-
this.translateAllFx = attach({
|
|
44
|
-
source: {
|
|
45
|
-
problem: $problem,
|
|
46
|
-
translationLanguageCode: $translationLanguageCode
|
|
47
|
-
},
|
|
48
|
-
mapParams: (_, source) => source,
|
|
49
|
-
effect: createEffect(({
|
|
50
|
-
problem,
|
|
51
|
-
translationLanguageCode
|
|
52
|
-
}) => {
|
|
53
|
-
if (!problem) return;
|
|
54
|
-
const promises = [this.service.translate(problem.richDescription || problem.description, {
|
|
55
|
-
cacheKeySuffix: DESCRIPTION_CACHE_KEY_SUFFIX
|
|
56
|
-
}), this.service.translate(problem.answerVariants, {
|
|
57
|
-
cacheKeySuffix: CHOICES_CACHE_KEY_SUFFIX
|
|
58
|
-
})];
|
|
59
|
-
if (getGreatWorkFeedbackText) {
|
|
60
|
-
promises.push(this.service.translate(getGreatWorkFeedbackText(), {
|
|
61
|
-
cacheKey: `${translationLanguageCode}${GBD_TEXT_CACHE_SUFFIX}`
|
|
62
|
-
}));
|
|
63
|
-
}
|
|
64
|
-
return Promise.all(promises);
|
|
65
|
-
})
|
|
66
|
-
});
|
|
67
|
-
this.translateFx = createEffect(({
|
|
68
|
-
cacheKey,
|
|
69
|
-
text
|
|
70
|
-
}) => {
|
|
71
|
-
return this.service.translate(text, {
|
|
72
|
-
cacheKey
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
this.$isTranslationActive.on(this.translateAllFx.doneData, () => true);
|
|
76
|
-
this.$isTranslationActive.on(this.translateAllFx.fail, () => false);
|
|
77
|
-
split({
|
|
78
|
-
source: sample({
|
|
79
|
-
clock: this.toggle,
|
|
80
|
-
source: this.$isTranslationActive
|
|
81
|
-
}),
|
|
82
|
-
match: {
|
|
83
|
-
on: isTranslated => !isTranslated,
|
|
84
|
-
off: isTranslated => isTranslated
|
|
85
|
-
},
|
|
86
|
-
cases: {
|
|
87
|
-
on: this.translateAllFx,
|
|
88
|
-
off: this.reset
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
sample({
|
|
92
|
-
clock: languageChanged,
|
|
93
|
-
fn: () => false,
|
|
94
|
-
target: this.setTranslated
|
|
95
|
-
});
|
|
96
|
-
sample({
|
|
97
|
-
clock: [$currentProblemIndex, $assignmentId, this.$isTranslationActive],
|
|
98
|
-
source: {
|
|
99
|
-
isTranslated: this.$isTranslationActive,
|
|
100
|
-
isLocked: $isTranslationLocked
|
|
101
|
-
},
|
|
102
|
-
filter: ({
|
|
103
|
-
isTranslated,
|
|
104
|
-
isLocked
|
|
105
|
-
}) => isLocked || isTranslated,
|
|
106
|
-
target: this.translateAllFx
|
|
107
|
-
});
|
|
108
|
-
this.$isTranslationPending = combine(this.translateAllFx.pending, this.translateFx.pending, (isAllPending, isOnePending) => isAllPending || isOnePending);
|
|
109
|
-
}
|
|
110
|
-
getTranslated(key) {
|
|
111
|
-
return this.service.getCached(key);
|
|
112
|
-
}
|
|
113
|
-
clearCache() {
|
|
114
|
-
this.service.reset();
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
//# sourceMappingURL=TranslationModel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["attach","combine","createEffect","createEvent","restore","sample","split","GoogleTranslationProvider","TranslationService","preservedWordsReplacers","wordsToPreserve","CHOICES_CACHE_KEY_SUFFIX","DESCRIPTION_CACHE_KEY_SUFFIX","GBD_TEXT_CACHE_SUFFIX","TranslationModel","toggle","setTranslated","reset","$isTranslationActive","$isTranslated","constructor","$problem","$problemId","$assignmentId","$currentProblemIndex","$translationLanguageCode","$contentLanguageCode","$isTranslationLocked","languageChanged","api","getGreatWorkFeedbackText","service","preserve","map","replacers","providers","onError","bindCustomCacheKey","problemId","target","bindTargetLanguage","bindSourceLanguage","translateAllFx","source","problem","translationLanguageCode","mapParams","_","effect","promises","translate","richDescription","description","cacheKeySuffix","answerVariants","push","cacheKey","Promise","all","translateFx","text","on","doneData","fail","clock","match","isTranslated","off","cases","fn","isLocked","filter","$isTranslationPending","pending","isAllPending","isOnePending","getTranslated","key","getCached","clearCache"],"sourceRoot":"../../../../../src","sources":["features/translation/model/TranslationModel.ts"],"mappings":";;AAAA,SACEA,MAAM,EACNC,OAAO,EACPC,YAAY,EACZC,WAAW,EACXC,OAAO,EACPC,MAAM,EACNC,KAAK,QAGA,UAAU;AACjB,SAASC,yBAAyB,QAAQ,kDAA+C;AAKzF,SAASC,kBAAkB,QAAQ,yBAAsB;AACzD,SACEC,uBAAuB,EACvBC,eAAe,QACV,gCAA6B;AACpC,SACEC,wBAAwB,EACxBC,4BAA4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edTokens } from "../helpers.js";
|
|
4
|
-
const KATEX_REGEX = /\$(.+?)\$/g;
|
|
5
|
-
const NEWLINE_REGEX = /\n/g;
|
|
6
|
-
const QUOTE_REGEX = /\\(['"])/g;
|
|
7
|
-
const DOLLAR_REGEX = /\\\$/gm;
|
|
8
|
-
const COMMA_REGEX = /,/gm;
|
|
9
|
-
const DOT_REGEX = /\./gm;
|
|
10
|
-
const wrapNoTranslate = content => `<span translate="no">${content}</span>`;
|
|
11
|
-
const KATEX_PLACEHOLDER = wrapNoTranslate('{{@}}');
|
|
12
|
-
const NEWLINE__PLACEHOLDER = wrapNoTranslate('{{#}}');
|
|
13
|
-
const QUOTE_PLACEHOLDER = wrapNoTranslate('{{""}}');
|
|
14
|
-
const DOLLAR_PLACEHOLDER = wrapNoTranslate('{{!}}');
|
|
15
|
-
const COMMA_PLACEHOLDER = wrapNoTranslate('{{,}}');
|
|
16
|
-
const DOT_PLACEHOLDER = wrapNoTranslate('{{.}}');
|
|
17
|
-
const defaultOrderedReplacersMap = [[DOLLAR_REGEX, DOLLAR_PLACEHOLDER], [KATEX_REGEX, KATEX_PLACEHOLDER], [NEWLINE_REGEX, NEWLINE__PLACEHOLDER], [QUOTE_REGEX, QUOTE_PLACEHOLDER], [COMMA_REGEX, COMMA_PLACEHOLDER], [DOT_REGEX, DOT_PLACEHOLDER]];
|
|
18
|
-
export class TranslationKatexPreprocessor {
|
|
19
|
-
static plaintextConverter = text => text;
|
|
20
|
-
static setPlaintextConverter(converter) {
|
|
21
|
-
this.plaintextConverter = converter;
|
|
22
|
-
}
|
|
23
|
-
static shouldSkipTranslation(text = '') {
|
|
24
|
-
if (Array.isArray(text)) {
|
|
25
|
-
return text.every(t => this.isMathExpressionOnly(t) || this.isSingleLetter(t) || this.isMathSymbolsOnly(t));
|
|
26
|
-
}
|
|
27
|
-
return this.isMathExpressionOnly(text) || this.isSingleLetter(text) || this.isMathSymbolsOnly(text);
|
|
28
|
-
}
|
|
29
|
-
static isMathExpressionOnly(text) {
|
|
30
|
-
return /^[\d\s+\-*/^=().\\><%!|]+$/.test(text.trim());
|
|
31
|
-
}
|
|
32
|
-
static isSingleLetter(text) {
|
|
33
|
-
return /^[a-zA-Z]$/.test(text);
|
|
34
|
-
}
|
|
35
|
-
static isMathSymbolsOnly(text) {
|
|
36
|
-
const plainText = this.plaintextConverter(text);
|
|
37
|
-
const cleanedUp = plainText.replace(/(\\\\|\\|\$|\−|\+|\=|\*|kr|pln|€|£|x|y|\{|\}|\÷)/gi, '');
|
|
38
|
-
const mathOnlyRegex = /^(?=.*\d)[0-9+\-×÷*/^().\s]+$/u;
|
|
39
|
-
return cleanedUp.length > 0 && mathOnlyRegex.test(cleanedUp);
|
|
40
|
-
}
|
|
41
|
-
globalTargetLanguage = null;
|
|
42
|
-
preserveWordsMap = {};
|
|
43
|
-
preserveWordsReplacers = [];
|
|
44
|
-
normalizePlaceholderSpacing(text) {
|
|
45
|
-
return text.replace(/\s+(<span[^>]*translate="no"[^>]*>)/g, '$1').replace(/(<\/span>)\s+/g, '$1');
|
|
46
|
-
}
|
|
47
|
-
sanitize(text) {
|
|
48
|
-
const language = this.globalTargetLanguage ?? '';
|
|
49
|
-
const replacements = [];
|
|
50
|
-
let sanitizedText = text;
|
|
51
|
-
defaultOrderedReplacersMap.forEach(([regex, placeholder]) => {
|
|
52
|
-
sanitizedText = maskSegment({
|
|
53
|
-
text: sanitizedText,
|
|
54
|
-
regex,
|
|
55
|
-
placeholder,
|
|
56
|
-
replacements
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
this.preserveWordsReplacers.forEach(([regex, placeholder]) => {
|
|
60
|
-
const preserveWordsMapTarget = this.preserveWordsMap[language];
|
|
61
|
-
sanitizedText = maskSegment({
|
|
62
|
-
text: sanitizedText,
|
|
63
|
-
regex,
|
|
64
|
-
placeholder,
|
|
65
|
-
replacements,
|
|
66
|
-
shouldSkip: match => this.skipCustomReplacerSanitizeWithoutGlossary(match, preserveWordsMapTarget)
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
return {
|
|
70
|
-
sanitized: sanitizedText,
|
|
71
|
-
replacements
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
restore(text, replacements) {
|
|
75
|
-
let restored = this.normalizePlaceholderSpacing(text);
|
|
76
|
-
replacements.forEach(({
|
|
77
|
-
placeholder,
|
|
78
|
-
original,
|
|
79
|
-
leftPad,
|
|
80
|
-
rightPad
|
|
81
|
-
}) => {
|
|
82
|
-
const wrapped = `${leftPad ? ' ' : ''}${original}${rightPad ? ' ' : ''}`;
|
|
83
|
-
restored = restored.replace(placeholder, wrapped);
|
|
84
|
-
});
|
|
85
|
-
return this.applyPreserved(restored);
|
|
86
|
-
}
|
|
87
|
-
sanitizeBatch(texts) {
|
|
88
|
-
const sanitized = [];
|
|
89
|
-
const replacements = [];
|
|
90
|
-
texts.forEach(t => {
|
|
91
|
-
const {
|
|
92
|
-
sanitized: s,
|
|
93
|
-
replacements: r
|
|
94
|
-
} = this.sanitize(t);
|
|
95
|
-
sanitized.push(s);
|
|
96
|
-
replacements.push(r);
|
|
97
|
-
});
|
|
98
|
-
return {
|
|
99
|
-
sanitized,
|
|
100
|
-
replacements
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
restoreBatch(texts, replacementsArray) {
|
|
104
|
-
return texts.map((t, i) => {
|
|
105
|
-
const restored = this.restore(t, replacementsArray[i]);
|
|
106
|
-
return this.applyPreserved(restored);
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// Glossaries apply after translation response and do not remove words from payload.
|
|
111
|
-
// This replaces words from the string before sending request to API to completely avoid
|
|
112
|
-
// translating it. We use it to avoid "context localization" e.g. Google API changes numbers
|
|
113
|
-
// when units are passed and target language is from a different region. We must preserve
|
|
114
|
-
// words like "miles" and the exact number in this case.
|
|
115
|
-
setupPreservable({
|
|
116
|
-
glossaryToPreserve,
|
|
117
|
-
preserveWordsReplacers
|
|
118
|
-
}) {
|
|
119
|
-
this.preserveWordsMap = glossaryToPreserve;
|
|
120
|
-
this.preserveWordsReplacers = preserveWordsReplacers;
|
|
121
|
-
}
|
|
122
|
-
setupTarget(language) {
|
|
123
|
-
this.globalTargetLanguage = language;
|
|
124
|
-
}
|
|
125
|
-
skipCustomReplacerSanitizeWithoutGlossary(match, preserveWordsMapTarget) {
|
|
126
|
-
if (!preserveWordsMapTarget) return true;
|
|
127
|
-
const normalized = match.toLowerCase();
|
|
128
|
-
const glossaryKeys = Object.keys(preserveWordsMapTarget).map(key => key.toLowerCase());
|
|
129
|
-
return !glossaryKeys.includes(normalized);
|
|
130
|
-
}
|
|
131
|
-
applyPreserved(restored) {
|
|
132
|
-
const language = this.globalTargetLanguage ?? '';
|
|
133
|
-
const preservedMap = this.preserveWordsMap[language];
|
|
134
|
-
return preservedMap ? replaceMappedTokens(restored, preservedMap) : restored;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
//# sourceMappingURL=TranslationPreprocessor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["maskSegment","replaceMappedTokens","KATEX_REGEX","NEWLINE_REGEX","QUOTE_REGEX","DOLLAR_REGEX","COMMA_REGEX","DOT_REGEX","wrapNoTranslate","content","KATEX_PLACEHOLDER","NEWLINE__PLACEHOLDER","QUOTE_PLACEHOLDER","DOLLAR_PLACEHOLDER","COMMA_PLACEHOLDER","DOT_PLACEHOLDER","defaultOrderedReplacersMap","TranslationKatexPreprocessor","plaintextConverter","text","setPlaintextConverter","converter","shouldSkipTranslation","Array","isArray","every","t","isMathExpressionOnly","isSingleLetter","isMathSymbolsOnly","test","trim","plainText","cleanedUp","replace","mathOnlyRegex","length","globalTargetLanguage","preserveWordsMap","preserveWordsReplacers","normalizePlaceholderSpacing","sanitize","language","replacements","sanitizedText","forEach","regex","placeholder","preserveWordsMapTarget","shouldSkip","match","skipCustomReplacerSanitizeWithoutGlossary","sanitized","restore","restored","original","leftPad","rightPad","wrapped","applyPreserved","sanitizeBatch","texts","s","r","push","restoreBatch","replacementsArray","map","i","setupPreservable","glossaryToPreserve","setupTarget","normalized","toLowerCase","glossaryKeys","Object","keys","key","includes","preservedMap"],"sourceRoot":"../../../../../src","sources":["features/translation/model/TranslationPreprocessor.ts"],"mappings":";;AACA,SAASA,WAAW,EAAEC,mBAAmB,QAAQ,eAAY;AAG7D,MAAMC,WAAW,GAAG,YAAY;AAChC,MAAMC,aAAa,GAAG,KAAK;AAC3B,MAAMC,WAAW,GAAG,WAAW;AAC/B,MAAMC,YAAY,GAAG,QAAQ;AAC7B,MAAMC,WAAW,GAAG,KAAK;AACzB,MAAMC,SAAS,GAAG,MAAM;AAExB,MAAMC,eAAe,GAAIC,OAAe,IAAK,wBAAwBA,OAAO,SAAS;AAErF,MAAMC,iBAAiB,GAAGF,eAAe,CAAC,OAAO,CAAC;AAClD,MAAMG,oBAAoB,GAAGH,eAAe,CAAC,OAAO,CAAC;AACrD,MAAMI,iBAAiB,GAAGJ,eAAe,CAAC,QAAQ,CAAC;AACnD,MAAMK,kBAAkB,GAAGL,eAAe,CAAC,OAAO,CAAC;AACnD,MAAMM,iBAAiB,GAAGN,eAAe,CAAC,OAAO,CAAC;AAClD,MAAMO,eAAe,GAAGP,eAAe,CAAC,OAAO,CAAC;AAEhD,MAAMQ,0BAA0B,GAAG,CACjC,CAACX,YAAY,EAAEQ,kBAAkB,CAAC,EAClC,CAACX,WAAW,EAAEQ,iBAAiB,CAAC,EAChC,CAACP,aAAa,EAAEQ,oBAAoB,CAAC,EACrC,CAACP,WAAW,EAAEQ,iBAAiB,CAAC,EAChC,CAACN,WAAW,EAAEQ,iBAAiB,CAAC,EAChC,CAACP,SAAS,EAAEQ,eAAe,CAAC,CACpB;AAOV,OAAO,MAAME,4BAA4B,CAAC;EACxC,OAAeC,kBAAkB,GAA8BC,IAAI,IAAKA,IAAI;EAE5E,OAAcC,qBAAqBA,CAACC,SAAmC,EAAE;IACvE,IAAI,CAACH,kBAAkB,GAAGG,S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AGC,MAAM,CAACC,IAAI,CAAC5B,sBAAsB,CAAC,CAACmB,GAAG,CAAEU,GAAG,IAAKA,GAAG,CAACJ,WAAW,CAAC,CAAC,CAAC;IAExF,OAAO,CAACC,YAAY,CAACI,QAAQ,CAACN,UAAU,CAAC;EAC3C;EAEQb,cAAcA,CAACL,QAAgB,EAAE;IACvC,MAAMZ,QAAQ,GAAG,IAAI,CAACL,oBAAoB,IAAI,EAAE;IAChD,MAAM0C,YAAY,GAAG,IAAI,CAACzC,gBAAgB,CAACI,QAAQ,CAAC;IAEpD,OAAOqC,YAAY,GAAG9E,mBAAmB,CAACqD,QAAQ,EAAEyB,YAAY,CAAC,GAAGzB,QAAQ;EAC9E;AACF","ignoreList":[]}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { TranslationKatexPreprocessor } from "./TranslationPreprocessor.js";
|
|
4
|
-
export class TranslationService {
|
|
5
|
-
preprocessor = new TranslationKatexPreprocessor();
|
|
6
|
-
cache = new Map();
|
|
7
|
-
providers = [];
|
|
8
|
-
globalTargetLanguage = null;
|
|
9
|
-
sourceLanguage = null;
|
|
10
|
-
customCacheKeyFn = null;
|
|
11
|
-
constructor({
|
|
12
|
-
providers,
|
|
13
|
-
preserve,
|
|
14
|
-
onError
|
|
15
|
-
}) {
|
|
16
|
-
this.providers = providers;
|
|
17
|
-
this.onError = onError;
|
|
18
|
-
if (preserve) {
|
|
19
|
-
this.preprocessor.setupPreservable({
|
|
20
|
-
glossaryToPreserve: preserve.map,
|
|
21
|
-
preserveWordsReplacers: preserve.replacers
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
getTargetLanguage(targetLang) {
|
|
26
|
-
const target = targetLang || this.globalTargetLanguage;
|
|
27
|
-
if (!target) {
|
|
28
|
-
throw new Error('Target language is missing, either provide in arguments or use .bindTargetLanguage()');
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
}
|
|
32
|
-
getProvider(target) {
|
|
33
|
-
const provider = this.providers.find(svc => svc.isTargetSupported(target));
|
|
34
|
-
if (!provider) throw new Error(`This target language: "${target}" is not supported.`);
|
|
35
|
-
return provider;
|
|
36
|
-
}
|
|
37
|
-
createCacheKey(text, target, suffix) {
|
|
38
|
-
let baseKey;
|
|
39
|
-
if (this.customCacheKeyFn) {
|
|
40
|
-
baseKey = this.customCacheKeyFn(text, target);
|
|
41
|
-
} else {
|
|
42
|
-
baseKey = Array.isArray(text) ? `${JSON.stringify(text)}::${target}` : `${text}::${target}`;
|
|
43
|
-
}
|
|
44
|
-
return suffix ? `${baseKey}${suffix}` : baseKey;
|
|
45
|
-
}
|
|
46
|
-
translate = async (text = '', config) => {
|
|
47
|
-
const isArrayInput = Array.isArray(text);
|
|
48
|
-
const target = this.getTargetLanguage(config?.targetLang) ?? '';
|
|
49
|
-
if (!text.length || TranslationKatexPreprocessor.shouldSkipTranslation(text)) {
|
|
50
|
-
const key = config?.cacheKey ?? this.createCacheKey(text, target, config?.cacheKeySuffix);
|
|
51
|
-
if (this.cache.has(key)) return this.cache.get(key);
|
|
52
|
-
return text;
|
|
53
|
-
}
|
|
54
|
-
const source = config?.sourceLang ?? this.sourceLanguage ?? undefined;
|
|
55
|
-
const provider = this.getProvider(target);
|
|
56
|
-
const key = config?.cacheKey ?? this.createCacheKey(text, target, config?.cacheKeySuffix);
|
|
57
|
-
if (this.cache.has(key)) return this.cache.get(key);
|
|
58
|
-
let translated;
|
|
59
|
-
if (isArrayInput) {
|
|
60
|
-
const {
|
|
61
|
-
sanitized,
|
|
62
|
-
replacements
|
|
63
|
-
} = this.preprocessor.sanitizeBatch(text);
|
|
64
|
-
const response = await provider.requestBatch(sanitized, target, source);
|
|
65
|
-
translated = this.preprocessor.restoreBatch(response, replacements);
|
|
66
|
-
} else {
|
|
67
|
-
const {
|
|
68
|
-
sanitized,
|
|
69
|
-
replacements
|
|
70
|
-
} = this.preprocessor.sanitize(text);
|
|
71
|
-
const response = await provider.request(sanitized, target, source);
|
|
72
|
-
translated = this.preprocessor.restore(response, replacements);
|
|
73
|
-
}
|
|
74
|
-
this.cache.set(key, translated);
|
|
75
|
-
return translated;
|
|
76
|
-
};
|
|
77
|
-
bindTargetLanguage(store, callback) {
|
|
78
|
-
store.watch(t => {
|
|
79
|
-
const value = callback ? callback(t) : t;
|
|
80
|
-
this.globalTargetLanguage = value;
|
|
81
|
-
this.preprocessor.setupTarget(value);
|
|
82
|
-
});
|
|
83
|
-
return this;
|
|
84
|
-
}
|
|
85
|
-
bindSourceLanguage(store) {
|
|
86
|
-
store.watch(value => {
|
|
87
|
-
this.sourceLanguage = value;
|
|
88
|
-
});
|
|
89
|
-
return this;
|
|
90
|
-
}
|
|
91
|
-
bindCustomCacheKey(store, callback) {
|
|
92
|
-
store.watch(t => {
|
|
93
|
-
this.customCacheKeyFn = (text, target) => callback(t, {
|
|
94
|
-
text,
|
|
95
|
-
target
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
return this;
|
|
99
|
-
}
|
|
100
|
-
getCached(key) {
|
|
101
|
-
return this.cache.get(key);
|
|
102
|
-
}
|
|
103
|
-
reset() {
|
|
104
|
-
this.cache.clear();
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
//# sourceMappingURL=TranslationService.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["TranslationKatexPreprocessor","TranslationService","preprocessor","cache","Map","providers","globalTargetLanguage","sourceLanguage","customCacheKeyFn","constructor","preserve","onError","setupPreservable","glossaryToPreserve","map","preserveWordsReplacers","replacers","getTargetLanguage","targetLang","target","Error","getProvider","provider","find","svc","isTargetSupported","createCacheKey","text","suffix","baseKey","Array","isArray","JSON","stringify","translate","config","isArrayInput","length","shouldSkipTranslation","key","cacheKey","cacheKeySuffix","has","get","source","sourceLang","undefined","translated","sanitized","replacements","sanitizeBatch","response","requestBatch","restoreBatch","sanitize","request","restore","set","bindTargetLanguage","store","callback","watch","t","value","setupTarget","bindSourceLanguage","bindCustomCacheKey","getCached","reset","clear"],"sourceRoot":"../../../../../src","sources":["features/translation/model/TranslationService.ts"],"mappings":";;AACA,SAASA,4BAA4B,QAAQ,8BAA2B;AAmBxE,OAAO,MAAMC,kBAAkB,CAAC;EACbC,YAAY,GAAG,IAAIF,4BAA4B,CAAC,CAAC;EACjDG,KAAK,GAAG,IAAIC,GAAG,CAA4B,CAAC;EAC5CC,SAAS,GAA0B,EAAE;EAG9CC,oBAAoB,GAAkB,IAAI;EAC1CC,cAAc,GAAkB,IAAI;EACpCC,gBAAgB,GAAiE,IAAI;EAE7FC,WAAWA,CAAC;IAAEJ,SAAS;IAAEK,QAAQ;IAAEC;EAAiC,CAAC,EAAE;IACrE,IAAI,CAACN,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACM,OAAO,GAAGA,OAAO;IAEtB,IAAID,QAAQ,EAAE;MACZ,IAAI,CAACR,YAAY,CAACU,gBAAgB,CAAC;QACjCC,kBAAkB,EAAEH,QAAQ,CAACI,GAAG;QAChCC,sBAAsB,EAAEL,QAAQ,CAACM;MACnC,CAAC,CAAC;IACJ;EACF;EAEQC,iBAAiBA,CAACC,UAAmB,EAAE;IAC7C,MAAMC,MAAM,GAAGD,UAAU,IAAI,IAAI,CAACZ,oBAAoB;IACtD,IAAI,CAACa,MAAM,EAAE;MACX,MAAM,IAAIC,KAAK,CACb,sFACF,CAAC;IACH;IACA,OAAOD,MAAM;EACf;EAEQE,WAAWA,CAACF,MAAc,EAAE;IAClC,MAAMG,QAAQ,GAAG,IAAI,CAACjB,SAAS,CAACkB,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACC,iBAAiB,CAACN,MAAM,CAAC,CAAC;IAC5E,IAAI,CAACG,QAAQ,EAAE,MAAM,IAAIF,KAAK,CAAC,0BAA0BD,MAAM,qBAAqB,CAAC;IACrF,OAAOG,QAAQ;EACjB;EAEQI,cAAcA,CAACC,IAAuB,EAAER,MAAc,EAAES,MAAe,EAAE;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