@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,27 +1,31 @@
|
|
|
1
|
-
import { createEvent, restore } from 'effector'
|
|
2
|
-
import {
|
|
1
|
+
import { attach, createEffect, createEvent, restore } from 'effector'
|
|
2
|
+
import { VoiceTranscriptionsCollection } from './VoiceTranscriptionsCollection'
|
|
3
3
|
import { VoiceFileDownloaderModel } from './VoiceFileDownloader.model'
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { VoiceTranscriptionModel } from './VoiceTranscription.model'
|
|
5
|
+
import { VoiceTranscriptionTranslationModel } from './VoiceTranscriptionTranslation.model'
|
|
6
6
|
import { AnswerAudio, VoicePlayerApi, VoiceTranscriptionItem } from '../../types'
|
|
7
|
-
import { PlayerModel } from './Player.model'
|
|
8
|
-
import { TranscriptionsDownloaderModel } from './
|
|
9
|
-
import { PlaybackController } from './PlaybackController'
|
|
7
|
+
import { PlayerModel, PlayerState } from './Player.model'
|
|
8
|
+
import { TranscriptionsDownloaderModel } from './TranscriptionsDownloaderModel'
|
|
10
9
|
|
|
11
|
-
type
|
|
10
|
+
type VoiceTranscriptionsPlayerModelParams = {
|
|
12
11
|
api: VoicePlayerApi
|
|
13
12
|
audios?: AnswerAudio[]
|
|
14
13
|
}
|
|
14
|
+
type TogglePlayPauseParams = {
|
|
15
|
+
attemptNumber: number
|
|
16
|
+
playerState: PlayerState
|
|
17
|
+
}
|
|
15
18
|
|
|
16
19
|
export class VoicePlayerModel {
|
|
17
|
-
public readonly collection = new
|
|
18
|
-
public readonly
|
|
20
|
+
public readonly collection = new VoiceTranscriptionsCollection()
|
|
21
|
+
public readonly downloader = new VoiceFileDownloaderModel()
|
|
22
|
+
public readonly dropdown = new VoiceTranscriptionModel()
|
|
23
|
+
public readonly translation = new VoiceTranscriptionTranslationModel()
|
|
19
24
|
public readonly playerModel = new PlayerModel()
|
|
20
|
-
public readonly downloader: VoiceFileDownloaderModel
|
|
21
|
-
public readonly translation: TranslationModel
|
|
22
25
|
public readonly loader: TranscriptionsDownloaderModel
|
|
23
26
|
public readonly api: VoicePlayerApi
|
|
24
|
-
private
|
|
27
|
+
private currentPlayingAttempt: number | null = null
|
|
28
|
+
private shouldPreventPlayback = false
|
|
25
29
|
|
|
26
30
|
public readonly setCurrentAttempt = createEvent<number | null>()
|
|
27
31
|
public readonly reset = createEvent()
|
|
@@ -30,21 +34,33 @@ export class VoicePlayerModel {
|
|
|
30
34
|
public readonly $playerState = this.playerModel.$playerState
|
|
31
35
|
|
|
32
36
|
public readonly pauseAudio = this.playerModel.pause
|
|
33
|
-
public readonly seekAudio = this.playerModel.seek
|
|
34
37
|
|
|
35
|
-
public readonly
|
|
38
|
+
public readonly stopAudio = () => {
|
|
39
|
+
this.shouldPreventPlayback = true
|
|
40
|
+
this.abortAllDownloads()
|
|
41
|
+
this.playerModel.stop()
|
|
42
|
+
this.currentPlayingAttempt = null
|
|
43
|
+
this.setCurrentAttempt(null)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public readonly resetPlayer = () => {
|
|
47
|
+
this.shouldPreventPlayback = true
|
|
48
|
+
this.releaseCollectionResources()
|
|
49
|
+
this.playerModel.stop()
|
|
50
|
+
this.currentPlayingAttempt = null
|
|
51
|
+
this.setCurrentAttempt(null)
|
|
52
|
+
this.collection.clear()
|
|
53
|
+
}
|
|
36
54
|
|
|
37
|
-
constructor(params:
|
|
55
|
+
constructor(params: VoiceTranscriptionsPlayerModelParams) {
|
|
38
56
|
this.api = params.api
|
|
39
|
-
this.downloader = new VoiceFileDownloaderModel(params.api)
|
|
40
57
|
this.loader = new TranscriptionsDownloaderModel(this.collection, params.api)
|
|
41
|
-
this.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
58
|
+
this.downloader.setApi(params.api)
|
|
59
|
+
|
|
60
|
+
this.playerModel.playbackFinished.watch(() => {
|
|
61
|
+
this.currentPlayingAttempt = null
|
|
62
|
+
this.setCurrentAttempt(null)
|
|
46
63
|
})
|
|
47
|
-
this.togglePlayPause = this.playback.togglePlayPause
|
|
48
64
|
|
|
49
65
|
if (params.audios) {
|
|
50
66
|
this.initializeCollectionFromAudios(params.audios)
|
|
@@ -53,28 +69,158 @@ export class VoicePlayerModel {
|
|
|
53
69
|
this.playerModel.setupAudioMode()
|
|
54
70
|
}
|
|
55
71
|
|
|
56
|
-
public
|
|
57
|
-
this.
|
|
72
|
+
public initializeWithAudios(answerAudio: AnswerAudio[]) {
|
|
73
|
+
this.loader.setTranscriptsLoaded(false)
|
|
74
|
+
this.collection.clear()
|
|
75
|
+
this.initializeCollectionFromAudios(answerAudio)
|
|
58
76
|
}
|
|
59
77
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
78
|
+
private initializeCollectionFromAudios(audios: AnswerAudio[]) {
|
|
79
|
+
if (!audios) {
|
|
80
|
+
console.warn('VoicePlayerModel: audios is not provided')
|
|
81
|
+
return
|
|
82
|
+
}
|
|
83
|
+
audios.forEach((audio, index) => {
|
|
84
|
+
const attemptNumber = index + 1
|
|
85
|
+
if (!audio.audioFileId) {
|
|
86
|
+
console.warn('VoicePlayerModel: audioFileId is missing for audio', audio)
|
|
87
|
+
return
|
|
88
|
+
}
|
|
89
|
+
this.collection.add(attemptNumber, {
|
|
90
|
+
attemptNumber,
|
|
91
|
+
audioFileId: audio.audioFileId,
|
|
92
|
+
_id: audio._id,
|
|
93
|
+
hasDrawing: !!audio.drawing,
|
|
94
|
+
})
|
|
95
|
+
})
|
|
64
96
|
}
|
|
65
97
|
|
|
66
|
-
|
|
67
|
-
this.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
98
|
+
private releaseCollectionResources() {
|
|
99
|
+
this.collection.getAll().forEach((item) => {
|
|
100
|
+
if (item.controller) {
|
|
101
|
+
this.downloader.abortDownload(item.controller)
|
|
102
|
+
}
|
|
103
|
+
if (item.audioUri?.startsWith('blob:')) {
|
|
104
|
+
try {
|
|
105
|
+
URL.revokeObjectURL(item.audioUri)
|
|
106
|
+
} catch (e) {}
|
|
107
|
+
}
|
|
108
|
+
})
|
|
71
109
|
}
|
|
72
110
|
|
|
73
|
-
|
|
74
|
-
this.collection.
|
|
75
|
-
|
|
111
|
+
private abortAllDownloads() {
|
|
112
|
+
this.collection.getAll().forEach((item) => {
|
|
113
|
+
if (item.controller && item.audioLoading) {
|
|
114
|
+
this.downloader.abortDownload(item.controller)
|
|
115
|
+
this.collection.update(item.attemptNumber, {
|
|
116
|
+
audioLoading: false,
|
|
117
|
+
controller: undefined,
|
|
118
|
+
audioDownloadPromise: undefined,
|
|
119
|
+
})
|
|
120
|
+
}
|
|
121
|
+
})
|
|
76
122
|
}
|
|
77
123
|
|
|
124
|
+
private readonly handlePlayAttempt = createEffect(async (attemptNumber: number) => {
|
|
125
|
+
this.shouldPreventPlayback = false
|
|
126
|
+
const item = this.collection.get(attemptNumber)
|
|
127
|
+
if (!item) return
|
|
128
|
+
|
|
129
|
+
if (this.currentPlayingAttempt !== null && this.currentPlayingAttempt !== attemptNumber) {
|
|
130
|
+
this.abortAllDownloads()
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (this.collection.hasAudio(attemptNumber)) {
|
|
134
|
+
this.playAudioFx(attemptNumber)
|
|
135
|
+
return
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
try {
|
|
139
|
+
this.playerModel.setPlayerState(PlayerState.LOADING)
|
|
140
|
+
const { collectionItem, downloadPromise } = await this.downloader.download({
|
|
141
|
+
audioFileId: item.audioFileId,
|
|
142
|
+
attemptNumber,
|
|
143
|
+
})
|
|
144
|
+
|
|
145
|
+
if (this.shouldPreventPlayback) {
|
|
146
|
+
collectionItem.controller?.abort()
|
|
147
|
+
return
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
this.collection.update(attemptNumber, collectionItem)
|
|
151
|
+
|
|
152
|
+
const result = await downloadPromise
|
|
153
|
+
|
|
154
|
+
if (this.shouldPreventPlayback) {
|
|
155
|
+
if (result.uri?.startsWith('blob:')) {
|
|
156
|
+
URL.revokeObjectURL(result.uri)
|
|
157
|
+
}
|
|
158
|
+
return
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
this.collection.update(attemptNumber, {
|
|
162
|
+
audioUri: result.uri,
|
|
163
|
+
audioLoading: false,
|
|
164
|
+
audioError: undefined,
|
|
165
|
+
controller: undefined,
|
|
166
|
+
audioDownloadPromise: undefined,
|
|
167
|
+
})
|
|
168
|
+
|
|
169
|
+
this.playerModel.setPlayerState(PlayerState.IDLE)
|
|
170
|
+
this.playAudioFx(attemptNumber)
|
|
171
|
+
} catch (error) {
|
|
172
|
+
console.error('Audio download error:', error)
|
|
173
|
+
if (error instanceof Error && error.name === 'AbortError') {
|
|
174
|
+
this.playerModel.setPlayerState(PlayerState.IDLE)
|
|
175
|
+
return
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
this.collection.update(attemptNumber, {
|
|
179
|
+
audioLoading: false,
|
|
180
|
+
audioError: error instanceof Error ? error.message : 'Failed to download audio',
|
|
181
|
+
controller: undefined,
|
|
182
|
+
audioDownloadPromise: undefined,
|
|
183
|
+
})
|
|
184
|
+
}
|
|
185
|
+
})
|
|
186
|
+
|
|
187
|
+
private playAudioFx = createEffect(async (attemptNumber: number) => {
|
|
188
|
+
if (this.shouldPreventPlayback) return
|
|
189
|
+
|
|
190
|
+
const item = this.collection.get(attemptNumber)
|
|
191
|
+
if (!item?.audioUri) {
|
|
192
|
+
console.warn('No audio URI available for attempt:', attemptNumber)
|
|
193
|
+
return
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
try {
|
|
197
|
+
if (this.currentPlayingAttempt !== null && this.currentPlayingAttempt !== attemptNumber) {
|
|
198
|
+
this.playerModel.player?.remove()
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
if (this.currentPlayingAttempt === attemptNumber && this.playerModel.player?.playing) {
|
|
202
|
+
this.playerModel.pause()
|
|
203
|
+
return
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
if (this.currentPlayingAttempt === attemptNumber && !this.playerModel.player?.playing) {
|
|
207
|
+
this.playerModel.resume()
|
|
208
|
+
return
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
this.currentPlayingAttempt = attemptNumber
|
|
212
|
+
this.setCurrentAttempt(attemptNumber)
|
|
213
|
+
await this.playerModel.play(item.audioUri)
|
|
214
|
+
} catch (error) {
|
|
215
|
+
console.error('Error playing audio:', error)
|
|
216
|
+
this.playerModel.setPlayerState(PlayerState.IDLE)
|
|
217
|
+
|
|
218
|
+
this.collection.update(attemptNumber, {
|
|
219
|
+
audioError: error instanceof Error ? error.message : 'Failed to play audio',
|
|
220
|
+
})
|
|
221
|
+
}
|
|
222
|
+
})
|
|
223
|
+
|
|
78
224
|
public isAudioLoading(attemptNumber: number): boolean {
|
|
79
225
|
return this.collection.get(attemptNumber)?.audioLoading || false
|
|
80
226
|
}
|
|
@@ -88,31 +234,25 @@ export class VoicePlayerModel {
|
|
|
88
234
|
}
|
|
89
235
|
|
|
90
236
|
public cleanup() {
|
|
91
|
-
this.
|
|
237
|
+
this.releaseCollectionResources()
|
|
92
238
|
this.collection.clear()
|
|
239
|
+
this.currentPlayingAttempt = null
|
|
93
240
|
this.reset()
|
|
241
|
+
this.loader.reset()
|
|
94
242
|
this.dropdown.reset()
|
|
95
243
|
this.translation.reset()
|
|
96
244
|
this.playerModel.release()
|
|
97
245
|
}
|
|
98
246
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
console.warn('VoicePlayerModel: audioFileId is missing for audio', audio)
|
|
108
|
-
return
|
|
247
|
+
public togglePlayPause = attach({
|
|
248
|
+
source: this.playerModel.$playerState,
|
|
249
|
+
mapParams: (attemptNumber: number, playerState) => ({ attemptNumber, playerState }),
|
|
250
|
+
effect: createEffect(({ attemptNumber, playerState }: TogglePlayPauseParams) => {
|
|
251
|
+
if (this.currentPlayingAttempt === attemptNumber && playerState === PlayerState.PLAYING) {
|
|
252
|
+
this.pauseAudio()
|
|
253
|
+
} else {
|
|
254
|
+
this.handlePlayAttempt(attemptNumber)
|
|
109
255
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
audioFileId: audio.audioFileId,
|
|
113
|
-
_id: audio._id,
|
|
114
|
-
hasDrawing: !!audio.drawing,
|
|
115
|
-
})
|
|
116
|
-
})
|
|
117
|
-
}
|
|
256
|
+
}),
|
|
257
|
+
})
|
|
118
258
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createEvent, restore } from 'effector'
|
|
2
|
+
|
|
3
|
+
export class VoiceTranscriptionTranslationModel {
|
|
4
|
+
public readonly toggle = createEvent()
|
|
5
|
+
public readonly setActive = createEvent<boolean>()
|
|
6
|
+
public readonly reset = createEvent()
|
|
7
|
+
|
|
8
|
+
public readonly $isActive = restore(this.setActive, false)
|
|
9
|
+
.on(this.toggle, (state) => !state)
|
|
10
|
+
.reset(this.reset)
|
|
11
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VoiceTranscriptionItem } from '../../types'
|
|
2
2
|
|
|
3
|
-
export class
|
|
3
|
+
export class VoiceTranscriptionsCollection {
|
|
4
4
|
public readonly collection: Map<number, VoiceTranscriptionItem> = new Map()
|
|
5
5
|
|
|
6
6
|
public add(attemptNumber: number, item: VoiceTranscriptionItem) {
|
|
@@ -2,12 +2,6 @@ import { WithAbortSignal } from 'src/types/common.types'
|
|
|
2
2
|
import { getAvailableInputs } from './helpers'
|
|
3
3
|
import { VoiceRecordModel } from './recording/model/VoiceRecord.model'
|
|
4
4
|
import { AxiosResponse } from 'axios'
|
|
5
|
-
import type {
|
|
6
|
-
GoogleTranslateProps as GoogleTranslatePayload,
|
|
7
|
-
GoogleTranslateResponse,
|
|
8
|
-
} from '../translation/providers/google.types'
|
|
9
|
-
|
|
10
|
-
export type { GoogleTranslatePayload, GoogleTranslateResponse }
|
|
11
5
|
|
|
12
6
|
export type VoiceRecordNotificationTypes = {
|
|
13
7
|
success: (message: string) => void
|
|
@@ -73,7 +67,6 @@ export type VoicePlayerApi = {
|
|
|
73
67
|
audioFileId: string,
|
|
74
68
|
options?: { signal?: AbortSignal },
|
|
75
69
|
) => Promise<AxiosResponse<Blob>>
|
|
76
|
-
translateText: (payload: GoogleTranslatePayload) => Promise<GoogleTranslateResponse>
|
|
77
70
|
}
|
|
78
71
|
|
|
79
72
|
export type VoiceTranscriptionItem = {
|
|
@@ -81,7 +74,6 @@ export type VoiceTranscriptionItem = {
|
|
|
81
74
|
audioFileId: string
|
|
82
75
|
_id: string
|
|
83
76
|
transcript?: string
|
|
84
|
-
transcriptLanguage?: string
|
|
85
77
|
transcriptLoading?: boolean
|
|
86
78
|
transcriptError?: string
|
|
87
79
|
audioUri?: string
|
|
@@ -101,4 +93,3 @@ export enum VoiceTranscriptionVariant {
|
|
|
101
93
|
SMALL = 'small',
|
|
102
94
|
LARGE = 'large',
|
|
103
95
|
}
|
|
104
|
-
|
package/src/index.ts
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.PRACTICE_THEORY_CACHE_KEY_SUFFIX = exports.GBD_TEXT_CACHE_SUFFIX = exports.DESCRIPTION_CACHE_KEY_SUFFIX = exports.CHOICES_CACHE_KEY_SUFFIX = void 0;
|
|
7
|
-
const GBD_TEXT_CACHE_SUFFIX = exports.GBD_TEXT_CACHE_SUFFIX = '::gbd';
|
|
8
|
-
const DESCRIPTION_CACHE_KEY_SUFFIX = exports.DESCRIPTION_CACHE_KEY_SUFFIX = '::description';
|
|
9
|
-
const CHOICES_CACHE_KEY_SUFFIX = exports.CHOICES_CACHE_KEY_SUFFIX = '::choices';
|
|
10
|
-
const PRACTICE_THEORY_CACHE_KEY_SUFFIX = exports.PRACTICE_THEORY_CACHE_KEY_SUFFIX = '::practice-theory';
|
|
11
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["GBD_TEXT_CACHE_SUFFIX","exports","DESCRIPTION_CACHE_KEY_SUFFIX","CHOICES_CACHE_KEY_SUFFIX","PRACTICE_THEORY_CACHE_KEY_SUFFIX"],"sourceRoot":"../../../../src","sources":["features/translation/constants.ts"],"mappings":";;;;;;AAAO,MAAMA,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG,OAAO;AACrC,MAAME,4BAA4B,GAAAD,OAAA,CAAAC,4BAAA,GAAG,eAAe;AACpD,MAAMC,wBAAwB,GAAAF,OAAA,CAAAE,wBAAA,GAAG,WAAW;AAC5C,MAAMC,gCAAgC,GAAAH,OAAA,CAAAG,gCAAA,GAAG,mBAAmB","ignoreList":[]}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.maskSegment = exports.decodeHtmlEntities = void 0;
|
|
7
|
-
exports.replaceMappedTokens = replaceMappedTokens;
|
|
8
|
-
function replaceMappedTokens(input, map) {
|
|
9
|
-
let result = input;
|
|
10
|
-
for (const [original, override] of Object.entries(map)) {
|
|
11
|
-
const escaped = original.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
12
|
-
const regex = new RegExp(`\\b${escaped}\\b`, 'gi');
|
|
13
|
-
result = result.replace(regex, override);
|
|
14
|
-
}
|
|
15
|
-
return result;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Masks text segments matched by `regex` with a placeholder,
|
|
20
|
-
* while preserving spaces around the original match.
|
|
21
|
-
*/
|
|
22
|
-
const maskSegment = ({
|
|
23
|
-
text,
|
|
24
|
-
regex,
|
|
25
|
-
placeholder,
|
|
26
|
-
replacements,
|
|
27
|
-
shouldSkip
|
|
28
|
-
}) => {
|
|
29
|
-
return text.replace(regex, (match, ...args) => {
|
|
30
|
-
if (shouldSkip?.(match)) return match;
|
|
31
|
-
const offset = args[args.length - 2];
|
|
32
|
-
const input = args[args.length - 1];
|
|
33
|
-
const before = offset > 0 ? input[offset - 1] : '';
|
|
34
|
-
const afterIdx = offset + match.length;
|
|
35
|
-
const after = afterIdx < input.length ? input[afterIdx] : '';
|
|
36
|
-
const leftPad = /\s/.test(before);
|
|
37
|
-
const rightPad = /\s/.test(after);
|
|
38
|
-
replacements.push({
|
|
39
|
-
placeholder,
|
|
40
|
-
original: match,
|
|
41
|
-
leftPad,
|
|
42
|
-
rightPad
|
|
43
|
-
});
|
|
44
|
-
return placeholder;
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
exports.maskSegment = maskSegment;
|
|
48
|
-
const HTML_NAMED_ENTITIES = {
|
|
49
|
-
'&': '&',
|
|
50
|
-
'<': '<',
|
|
51
|
-
'>': '>',
|
|
52
|
-
'"': '"',
|
|
53
|
-
''': "'",
|
|
54
|
-
' ': ' '
|
|
55
|
-
};
|
|
56
|
-
const decodeHtmlEntities = text => {
|
|
57
|
-
return text.replace(/&#(\d+);/g, (_, code) => String.fromCharCode(parseInt(code, 10))).replace(/&#x([0-9a-f]+);/gi, (_, code) => String.fromCharCode(parseInt(code, 16))).replace(/&(amp|lt|gt|quot|apos|nbsp);/g, match => HTML_NAMED_ENTITIES[match] ?? match);
|
|
58
|
-
};
|
|
59
|
-
exports.decodeHtmlEntities = decodeHtmlEntities;
|
|
60
|
-
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["replaceMappedTokens","input","map","result","original","override","Object","entries","escaped","replace","regex","RegExp","maskSegment","text","placeholder","replacements","shouldSkip","match","args","offset","length","before","afterIdx","after","leftPad","test","rightPad","push","exports","HTML_NAMED_ENTITIES","decodeHtmlEntities","_","code","String","fromCharCode","parseInt"],"sourceRoot":"../../../../src","sources":["features/translation/helpers.ts"],"mappings":";;;;;;;AAEO,SAASA,mBAAmBA,CAACC,KAAa,EAAEC,GAA2B,EAAU;EACtF,IAAIC,MAAM,GAAGF,KAAK;EAElB,KAAK,MAAM,CAACG,QAAQ,EAAEC,QAAQ,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACL,GAAG,CAAC,EAAE;IACtD,MAAMM,OAAO,GAAGJ,QAAQ,CAACK,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC;IAC/D,MAAMC,KAAK,GAAG,IAAIC,MAAM,CAAC,MAAMH,OAAO,KAAK,EAAE,IAAI,CAAC;IAElDL,MAAM,GAAGA,MAAM,CAACM,OAAO,CAACC,KAAK,EAAEL,QAAQ,CAAC;EAC1C;EAEA,OAAOF,MAAM;AACf;;AAEA;AACA;AACA;AACA;AACO,MAAMS,WAAW,GAAGA,CAAC;EAC1BC,IAAI;EACJH,KAAK;EACLI,WAAW;EACXC,YAAY;EACZC;AACiB,CAAC,KAAa;EAC/B,OAAOH,IAAI,CAACJ,OAAO,CAACC,KAAK,EAAE,CAACO,KAAK,EAAE,GAAGC,IAAI,KAAK;IAC7C,IAAIF,UAAU,GAAGC,KAAK,CAAC,EAAE,OAAOA,KAAK;IAErC,MAAME,MAAM,GAAGD,IAAI,CAACA,IAAI,CAACE,MAAM,GAAG,CAAC,CAAW;IAC9C,MAAMnB,KAAK,GAAGiB,IAAI,CAACA,IAAI,CAACE,MAAM,GAAG,CAAC,CAAW;IAE7C,MAAMC,MAAM,GAAGF,MAAM,GAAG,CAAC,GAAGlB,KAAK,CAACkB,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE;IAClD,MAAMG,QAAQ,GAAGH,MAAM,GAAGF,KAAK,CAACG,MAAM;IACtC,MAAMG,KAAK,GAAGD,QAAQ,GAAGrB,KAAK,CAACmB,MAAM,GAAGnB,KAAK,CAACqB,QAAQ,CAAC,GAAG,EAAE;IAE5D,MAAME,OAAO,GAAG,IAAI,CAACC,IAAI,CAACJ,MAAM,CAAC;IACjC,MAAMK,QAAQ,GAAG,IAAI,CAACD,IAAI,CAACF,KAAK,CAAC;IAEjCR,YAAY,CAACY,IAAI,CAAC;MAAEb,WAAW;MAAEV,QAAQ,EAAEa,KAAK;MAAEO,OAAO;MAAEE;IAAS,CAAC,CAAC;IAEtE,OAAOZ,WAAW;EACpB,CAAC,CAAC;AACJ,CAAC;AAAAc,OAAA,CAAAhB,WAAA,GAAAA,WAAA;AAED,MAAMiB,mBAA2C,GAAG;EAClD,OAAO,EAAE,GAAG;EACZ,MAAM,EAAE,GAAG;EACX,MAAM,EAAE,GAAG;EACX,QAAQ,EAAE,GAAG;EACb,QAAQ,EAAE,GAAG;EACb,QAAQ,EAAE;AACZ,CAAC;AAEM,MAAMC,kBAAkB,GAAIjB,IAAY,IAAa;EAC1D,OAAOA,IAAI,CACRJ,OAAO,CAAC,WAAW,EAAE,CAACsB,CAAC,EAAEC,IAAY,KAAKC,MAAM,CAACC,YAAY,CAACC,QAAQ,CAACH,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAClFvB,OAAO,CAAC,mBAAmB,EAAE,CAACsB,CAAC,EAAEC,IAAY,KAAKC,MAAM,CAACC,YAAY,CAACC,QAAQ,CAACH,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAC1FvB,OAAO,CACN,+BAA+B,EAC9BQ,KAAK,IAAKY,mBAAmB,CAACZ,KAAK,CAAC,IAAIA,KAC3C,CAAC;AACL,CAAC;AAAAW,OAAA,CAAAE,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "CHOICES_CACHE_KEY_SUFFIX", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _constants.CHOICES_CACHE_KEY_SUFFIX;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "DESCRIPTION_CACHE_KEY_SUFFIX", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _constants.DESCRIPTION_CACHE_KEY_SUFFIX;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "GBD_TEXT_CACHE_SUFFIX", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _constants.GBD_TEXT_CACHE_SUFFIX;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "GoogleTranslateLanguage", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _supportedLanguages.GoogleTranslateLanguage;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "GoogleTranslationProvider", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () {
|
|
33
|
-
return _GoogleTranslationProvider.GoogleTranslationProvider;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(exports, "PRACTICE_THEORY_CACHE_KEY_SUFFIX", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function () {
|
|
39
|
-
return _constants.PRACTICE_THEORY_CACHE_KEY_SUFFIX;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
Object.defineProperty(exports, "TranslationKatexPreprocessor", {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: function () {
|
|
45
|
-
return _TranslationPreprocessor.TranslationKatexPreprocessor;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(exports, "TranslationModel", {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
get: function () {
|
|
51
|
-
return _TranslationModel.TranslationModel;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
Object.defineProperty(exports, "TranslationProvider", {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function () {
|
|
57
|
-
return _translationInterface.TranslationProvider;
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
Object.defineProperty(exports, "TranslationService", {
|
|
61
|
-
enumerable: true,
|
|
62
|
-
get: function () {
|
|
63
|
-
return _TranslationService.TranslationService;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
Object.defineProperty(exports, "decodeHtmlEntities", {
|
|
67
|
-
enumerable: true,
|
|
68
|
-
get: function () {
|
|
69
|
-
return _helpers.decodeHtmlEntities;
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
Object.defineProperty(exports, "maskSegment", {
|
|
73
|
-
enumerable: true,
|
|
74
|
-
get: function () {
|
|
75
|
-
return _helpers.maskSegment;
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
Object.defineProperty(exports, "preservedWordsReplacers", {
|
|
79
|
-
enumerable: true,
|
|
80
|
-
get: function () {
|
|
81
|
-
return _wordsToPreserve.preservedWordsReplacers;
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
Object.defineProperty(exports, "replaceMappedTokens", {
|
|
85
|
-
enumerable: true,
|
|
86
|
-
get: function () {
|
|
87
|
-
return _helpers.replaceMappedTokens;
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
Object.defineProperty(exports, "wordsToPreserve", {
|
|
91
|
-
enumerable: true,
|
|
92
|
-
get: function () {
|
|
93
|
-
return _wordsToPreserve.wordsToPreserve;
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
var _TranslationModel = require("./model/TranslationModel.js");
|
|
97
|
-
var _TranslationService = require("./model/TranslationService.js");
|
|
98
|
-
var _TranslationPreprocessor = require("./model/TranslationPreprocessor.js");
|
|
99
|
-
var _translationInterface = require("./providers/translation.interface.js");
|
|
100
|
-
var _GoogleTranslationProvider = require("./providers/google/GoogleTranslationProvider.js");
|
|
101
|
-
var _supportedLanguages = require("./providers/google/supportedLanguages.js");
|
|
102
|
-
var _wordsToPreserve = require("./preserve/wordsToPreserve.js");
|
|
103
|
-
var _constants = require("./constants.js");
|
|
104
|
-
var _helpers = require("./helpers.js");
|
|
105
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_TranslationModel","require","_TranslationService","_TranslationPreprocessor","_translationInterface","_GoogleTranslationProvider","_supportedLanguages","_wordsToPreserve","_constants","_helpers"],"sourceRoot":"../../../../src","sources":["features/translation/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,wBAAA,GAAAF,OAAA;AACA,IAAAG,qBAAA,GAAAH,OAAA;AACA,IAAAI,0BAAA,GAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAL,OAAA;AAMA,IAAAM,gBAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AAMA,IAAAQ,QAAA,GAAAR,OAAA","ignoreList":[]}
|