@magmamath/students-features 1.3.23-rc.2 → 1.3.23-rc.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/features/translation/constants.js +11 -0
- package/dist/commonjs/features/translation/constants.js.map +1 -0
- package/dist/commonjs/features/translation/helpers.js +60 -0
- package/dist/commonjs/features/translation/helpers.js.map +1 -0
- package/dist/commonjs/features/translation/index.js +105 -0
- package/dist/commonjs/features/translation/index.js.map +1 -0
- package/dist/commonjs/features/translation/model/TranslationModel.js +122 -0
- package/dist/commonjs/features/translation/model/TranslationModel.js.map +1 -0
- package/dist/commonjs/features/translation/model/TranslationPreprocessor.js +142 -0
- package/dist/commonjs/features/translation/model/TranslationPreprocessor.js.map +1 -0
- package/dist/commonjs/features/translation/model/TranslationService.js +112 -0
- package/dist/commonjs/features/translation/model/TranslationService.js.map +1 -0
- package/dist/commonjs/features/translation/preserve/wordsToPreserve.js +314 -0
- package/dist/commonjs/features/translation/preserve/wordsToPreserve.js.map +1 -0
- package/dist/commonjs/features/translation/providers/google/GoogleTranslationProvider.js +50 -0
- package/dist/commonjs/features/translation/providers/google/GoogleTranslationProvider.js.map +1 -0
- package/dist/commonjs/features/translation/providers/google/supportedLanguages.js +230 -0
- package/dist/commonjs/features/translation/providers/google/supportedLanguages.js.map +1 -0
- package/dist/commonjs/features/translation/providers/google.types.js +2 -0
- package/dist/commonjs/features/translation/providers/google.types.js.map +1 -0
- package/dist/commonjs/features/translation/providers/translation.interface.js +49 -0
- package/dist/commonjs/features/translation/providers/translation.interface.js.map +1 -0
- package/dist/commonjs/features/translation/types.js +2 -0
- package/dist/commonjs/features/translation/types.js.map +1 -0
- package/dist/commonjs/features/voice/index.js +4 -4
- package/dist/commonjs/features/voice/index.js.map +1 -1
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptContent.js +44 -0
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptContent.js.map +1 -0
- package/dist/commonjs/features/voice/playing/components/VoiceTranscription.js +107 -0
- package/dist/commonjs/features/voice/playing/components/VoiceTranscription.js.map +1 -0
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.js +66 -0
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.js.map +1 -0
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.js +58 -0
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.js.map +1 -0
- package/dist/commonjs/features/voice/playing/hooks/{useVoiceTranscriptionsDropdown.js → useDropdownAnimation.js} +8 -7
- package/dist/commonjs/features/voice/playing/hooks/useDropdownAnimation.js.map +1 -0
- package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.js +128 -0
- package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.js.map +1 -0
- package/dist/commonjs/features/voice/playing/model/{VoiceTranscriptionsDropdown.model.js → Dropdown.model.js} +4 -4
- package/dist/commonjs/features/voice/playing/model/Dropdown.model.js.map +1 -0
- package/dist/commonjs/features/voice/playing/model/PlaybackController.js +183 -0
- package/dist/commonjs/features/voice/playing/model/PlaybackController.js.map +1 -0
- package/dist/commonjs/features/voice/playing/model/Player.model.js +24 -1
- package/dist/commonjs/features/voice/playing/model/Player.model.js.map +1 -1
- package/dist/commonjs/features/voice/playing/model/{VoiceTranscriptionsCollection.js → TranscriptionsCollection.js} +4 -4
- package/dist/commonjs/features/voice/playing/model/TranscriptionsCollection.js.map +1 -0
- package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.js +82 -0
- package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.js.map +1 -0
- package/dist/commonjs/features/voice/playing/model/Translation.model.js +62 -0
- package/dist/commonjs/features/voice/playing/model/Translation.model.js.map +1 -0
- package/dist/commonjs/features/voice/playing/model/VoiceFileDownloader.model.js +2 -2
- package/dist/commonjs/features/voice/playing/model/VoiceFileDownloader.model.js.map +1 -1
- package/dist/commonjs/features/voice/playing/model/VoicePlayer.model.js +46 -172
- package/dist/commonjs/features/voice/playing/model/VoicePlayer.model.js.map +1 -1
- package/dist/commonjs/features/voice/types.js.map +1 -1
- package/dist/commonjs/index.js +12 -0
- package/dist/commonjs/index.js.map +1 -1
- package/dist/module/features/translation/constants.js +7 -0
- package/dist/module/features/translation/constants.js.map +1 -0
- package/dist/module/features/translation/helpers.js +53 -0
- package/dist/module/features/translation/helpers.js.map +1 -0
- package/dist/module/features/translation/index.js +12 -0
- package/dist/module/features/translation/index.js.map +1 -0
- package/dist/module/features/translation/model/TranslationModel.js +117 -0
- package/dist/module/features/translation/model/TranslationModel.js.map +1 -0
- package/dist/module/features/translation/model/TranslationPreprocessor.js +137 -0
- package/dist/module/features/translation/model/TranslationPreprocessor.js.map +1 -0
- package/dist/module/features/translation/model/TranslationService.js +107 -0
- package/dist/module/features/translation/model/TranslationService.js.map +1 -0
- package/dist/module/features/translation/preserve/wordsToPreserve.js +310 -0
- package/dist/module/features/translation/preserve/wordsToPreserve.js.map +1 -0
- package/dist/module/features/translation/providers/google/GoogleTranslationProvider.js +45 -0
- package/dist/module/features/translation/providers/google/GoogleTranslationProvider.js.map +1 -0
- package/dist/module/features/translation/providers/google/supportedLanguages.js +225 -0
- package/dist/module/features/translation/providers/google/supportedLanguages.js.map +1 -0
- package/dist/module/features/translation/providers/google.types.js +2 -0
- package/dist/module/features/translation/providers/google.types.js.map +1 -0
- package/dist/module/features/translation/providers/translation.interface.js +44 -0
- package/dist/module/features/translation/providers/translation.interface.js.map +1 -0
- package/dist/module/features/translation/types.js +2 -0
- package/dist/module/features/translation/types.js.map +1 -0
- package/dist/module/features/voice/index.js +1 -1
- package/dist/module/features/voice/index.js.map +1 -1
- package/dist/module/features/voice/playing/components/VoiceTranscriptContent.js +38 -0
- package/dist/module/features/voice/playing/components/VoiceTranscriptContent.js.map +1 -0
- package/dist/module/features/voice/playing/components/VoiceTranscription.js +101 -0
- package/dist/module/features/voice/playing/components/VoiceTranscription.js.map +1 -0
- package/dist/module/features/voice/playing/components/VoiceTranscriptionCollapsible.js +58 -0
- package/dist/module/features/voice/playing/components/VoiceTranscriptionCollapsible.js.map +1 -0
- package/dist/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.js +52 -0
- package/dist/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.js.map +1 -0
- package/dist/module/features/voice/playing/hooks/{useVoiceTranscriptionsDropdown.js → useDropdownAnimation.js} +6 -5
- package/dist/module/features/voice/playing/hooks/useDropdownAnimation.js.map +1 -0
- package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionController.js +123 -0
- package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionController.js.map +1 -0
- package/dist/module/features/voice/playing/model/{VoiceTranscriptionsDropdown.model.js → Dropdown.model.js} +2 -2
- package/dist/module/features/voice/playing/model/Dropdown.model.js.map +1 -0
- package/dist/module/features/voice/playing/model/PlaybackController.js +178 -0
- package/dist/module/features/voice/playing/model/PlaybackController.js.map +1 -0
- package/dist/module/features/voice/playing/model/Player.model.js +24 -1
- package/dist/module/features/voice/playing/model/Player.model.js.map +1 -1
- package/dist/module/features/voice/playing/model/{VoiceTranscriptionsCollection.js → TranscriptionsCollection.js} +2 -2
- package/dist/module/features/voice/playing/model/TranscriptionsCollection.js.map +1 -0
- package/dist/module/features/voice/playing/model/TranscriptionsDownloader.model.js +77 -0
- package/dist/module/features/voice/playing/model/TranscriptionsDownloader.model.js.map +1 -0
- package/dist/module/features/voice/playing/model/Translation.model.js +57 -0
- package/dist/module/features/voice/playing/model/Translation.model.js.map +1 -0
- package/dist/module/features/voice/playing/model/VoiceFileDownloader.model.js +2 -2
- package/dist/module/features/voice/playing/model/VoiceFileDownloader.model.js.map +1 -1
- package/dist/module/features/voice/playing/model/VoicePlayer.model.js +48 -174
- package/dist/module/features/voice/playing/model/VoicePlayer.model.js.map +1 -1
- package/dist/module/features/voice/types.js.map +1 -1
- package/dist/module/index.js +1 -0
- package/dist/module/index.js.map +1 -1
- package/dist/typescript/commonjs/features/translation/constants.d.ts +5 -0
- package/dist/typescript/commonjs/features/translation/constants.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/translation/helpers.d.ts +9 -0
- package/dist/typescript/commonjs/features/translation/helpers.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/translation/index.d.ts +12 -0
- package/dist/typescript/commonjs/features/translation/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/translation/model/TranslationModel.d.ts +33 -0
- package/dist/typescript/commonjs/features/translation/model/TranslationModel.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/translation/model/TranslationPreprocessor.d.ts +34 -0
- package/dist/typescript/commonjs/features/translation/model/TranslationPreprocessor.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/translation/model/TranslationService.d.ts +40 -0
- package/dist/typescript/commonjs/features/translation/model/TranslationService.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/translation/preserve/wordsToPreserve.d.ts +3 -0
- package/dist/typescript/commonjs/features/translation/preserve/wordsToPreserve.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/translation/providers/google/GoogleTranslationProvider.d.ts +17 -0
- package/dist/typescript/commonjs/features/translation/providers/google/GoogleTranslationProvider.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/translation/providers/google/supportedLanguages.d.ts +209 -0
- package/dist/typescript/commonjs/features/translation/providers/google/supportedLanguages.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/translation/providers/google.types.d.ts +15 -0
- package/dist/typescript/commonjs/features/translation/providers/google.types.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/translation/providers/translation.interface.d.ts +30 -0
- package/dist/typescript/commonjs/features/translation/providers/translation.interface.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/translation/types.d.ts +27 -0
- package/dist/typescript/commonjs/features/translation/types.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/index.d.ts +2 -1
- package/dist/typescript/commonjs/features/voice/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptContent.d.ts +8 -0
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptContent.d.ts.map +1 -0
- package/dist/typescript/{module/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts → commonjs/features/voice/playing/components/VoiceTranscription.d.ts} +3 -4
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscription.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts +10 -0
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.d.ts +12 -0
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.d.ts.map +1 -0
- package/dist/typescript/{module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts → commonjs/features/voice/playing/hooks/useDropdownAnimation.d.ts} +3 -3
- package/dist/typescript/commonjs/features/voice/playing/hooks/useDropdownAnimation.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts +30 -0
- package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts.map +1 -0
- package/dist/typescript/{module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts → commonjs/features/voice/playing/model/Dropdown.model.d.ts} +2 -2
- package/dist/typescript/commonjs/features/voice/playing/model/Dropdown.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/model/PlaybackController.d.ts +28 -0
- package/dist/typescript/commonjs/features/voice/playing/model/PlaybackController.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/model/Player.model.d.ts +3 -0
- package/dist/typescript/commonjs/features/voice/playing/model/Player.model.d.ts.map +1 -1
- package/dist/typescript/{module/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts → commonjs/features/voice/playing/model/TranscriptionsCollection.d.ts} +2 -2
- package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsCollection.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.d.ts +19 -0
- package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/model/Translation.model.d.ts +25 -0
- package/dist/typescript/commonjs/features/voice/playing/model/Translation.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/model/VoiceFileDownloader.model.d.ts +2 -2
- package/dist/typescript/commonjs/features/voice/playing/model/VoiceFileDownloader.model.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/playing/model/VoicePlayer.model.d.ts +18 -18
- package/dist/typescript/commonjs/features/voice/playing/model/VoicePlayer.model.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/types.d.ts +5 -1
- package/dist/typescript/commonjs/features/voice/types.d.ts.map +1 -1
- package/dist/typescript/commonjs/index.d.ts +1 -0
- package/dist/typescript/commonjs/index.d.ts.map +1 -1
- package/dist/typescript/module/features/translation/constants.d.ts +5 -0
- package/dist/typescript/module/features/translation/constants.d.ts.map +1 -0
- package/dist/typescript/module/features/translation/helpers.d.ts +9 -0
- package/dist/typescript/module/features/translation/helpers.d.ts.map +1 -0
- package/dist/typescript/module/features/translation/index.d.ts +12 -0
- package/dist/typescript/module/features/translation/index.d.ts.map +1 -0
- package/dist/typescript/module/features/translation/model/TranslationModel.d.ts +33 -0
- package/dist/typescript/module/features/translation/model/TranslationModel.d.ts.map +1 -0
- package/dist/typescript/module/features/translation/model/TranslationPreprocessor.d.ts +34 -0
- package/dist/typescript/module/features/translation/model/TranslationPreprocessor.d.ts.map +1 -0
- package/dist/typescript/module/features/translation/model/TranslationService.d.ts +40 -0
- package/dist/typescript/module/features/translation/model/TranslationService.d.ts.map +1 -0
- package/dist/typescript/module/features/translation/preserve/wordsToPreserve.d.ts +3 -0
- package/dist/typescript/module/features/translation/preserve/wordsToPreserve.d.ts.map +1 -0
- package/dist/typescript/module/features/translation/providers/google/GoogleTranslationProvider.d.ts +17 -0
- package/dist/typescript/module/features/translation/providers/google/GoogleTranslationProvider.d.ts.map +1 -0
- package/dist/typescript/module/features/translation/providers/google/supportedLanguages.d.ts +209 -0
- package/dist/typescript/module/features/translation/providers/google/supportedLanguages.d.ts.map +1 -0
- package/dist/typescript/module/features/translation/providers/google.types.d.ts +15 -0
- package/dist/typescript/module/features/translation/providers/google.types.d.ts.map +1 -0
- package/dist/typescript/module/features/translation/providers/translation.interface.d.ts +30 -0
- package/dist/typescript/module/features/translation/providers/translation.interface.d.ts.map +1 -0
- package/dist/typescript/module/features/translation/types.d.ts +27 -0
- package/dist/typescript/module/features/translation/types.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/index.d.ts +2 -1
- package/dist/typescript/module/features/voice/index.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptContent.d.ts +8 -0
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptContent.d.ts.map +1 -0
- package/dist/typescript/{commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts → module/features/voice/playing/components/VoiceTranscription.d.ts} +3 -4
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscription.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts +10 -0
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.d.ts +12 -0
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.d.ts.map +1 -0
- package/dist/typescript/{commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts → module/features/voice/playing/hooks/useDropdownAnimation.d.ts} +3 -3
- package/dist/typescript/module/features/voice/playing/hooks/useDropdownAnimation.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts +30 -0
- package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts.map +1 -0
- package/dist/typescript/{commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts → module/features/voice/playing/model/Dropdown.model.d.ts} +2 -2
- package/dist/typescript/module/features/voice/playing/model/Dropdown.model.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/model/PlaybackController.d.ts +28 -0
- package/dist/typescript/module/features/voice/playing/model/PlaybackController.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/model/Player.model.d.ts +3 -0
- package/dist/typescript/module/features/voice/playing/model/Player.model.d.ts.map +1 -1
- package/dist/typescript/{commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts → module/features/voice/playing/model/TranscriptionsCollection.d.ts} +2 -2
- package/dist/typescript/module/features/voice/playing/model/TranscriptionsCollection.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloader.model.d.ts +19 -0
- package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloader.model.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/model/Translation.model.d.ts +25 -0
- package/dist/typescript/module/features/voice/playing/model/Translation.model.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/model/VoiceFileDownloader.model.d.ts +2 -2
- package/dist/typescript/module/features/voice/playing/model/VoiceFileDownloader.model.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/playing/model/VoicePlayer.model.d.ts +18 -18
- package/dist/typescript/module/features/voice/playing/model/VoicePlayer.model.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/types.d.ts +5 -1
- package/dist/typescript/module/features/voice/types.d.ts.map +1 -1
- package/dist/typescript/module/index.d.ts +1 -0
- package/dist/typescript/module/index.d.ts.map +1 -1
- package/package.json +28 -1
- package/src/features/translation/constants.ts +4 -0
- package/src/features/translation/helpers.ts +63 -0
- package/src/features/translation/index.ts +30 -0
- package/src/features/translation/model/TranslationModel.ts +174 -0
- package/src/features/translation/model/TranslationPreprocessor.ts +171 -0
- package/src/features/translation/model/TranslationService.ts +148 -0
- package/src/features/translation/preserve/wordsToPreserve.ts +87 -0
- package/src/features/translation/providers/google/GoogleTranslationProvider.ts +50 -0
- package/src/features/translation/providers/google/supportedLanguages.ts +229 -0
- package/src/features/translation/providers/google.types.ts +16 -0
- package/src/features/translation/providers/translation.interface.ts +63 -0
- package/src/features/translation/types.ts +30 -0
- package/src/features/voice/index.ts +2 -1
- package/src/features/voice/playing/components/VoiceTranscriptContent.tsx +37 -0
- package/src/features/voice/playing/components/VoiceTranscription.tsx +117 -0
- package/src/features/voice/playing/components/VoiceTranscriptionCollapsible.tsx +59 -0
- package/src/features/voice/playing/components/VoiceTranscriptionHeaderActions.tsx +61 -0
- package/src/features/voice/playing/hooks/{useVoiceTranscriptionsDropdown.ts → useDropdownAnimation.ts} +5 -5
- package/src/features/voice/playing/hooks/useVoiceTranscriptionController.ts +171 -0
- package/src/features/voice/playing/model/{VoiceTranscriptionsDropdown.model.ts → Dropdown.model.ts} +2 -2
- package/src/features/voice/playing/model/PlaybackController.ts +213 -0
- package/src/features/voice/playing/model/Player.model.ts +26 -1
- package/src/features/voice/playing/model/{VoiceTranscriptionsCollection.ts → TranscriptionsCollection.ts} +1 -1
- package/src/features/voice/playing/model/TranscriptionsDownloader.model.ts +88 -0
- package/src/features/voice/playing/model/Translation.model.ts +75 -0
- package/src/features/voice/playing/model/VoiceFileDownloader.model.ts +2 -2
- package/src/features/voice/playing/model/VoicePlayer.model.ts +57 -194
- package/src/features/voice/types.ts +10 -0
- package/src/index.ts +1 -0
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.js +0 -251
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.js.map +0 -1
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js +0 -109
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js.map +0 -1
- package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js.map +0 -1
- package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js +0 -34
- package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js.map +0 -1
- package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.js +0 -66
- package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.js.map +0 -1
- package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.js.map +0 -1
- package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js.map +0 -1
- package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdown.js +0 -244
- package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdown.js.map +0 -1
- package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js +0 -103
- package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js.map +0 -1
- package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js.map +0 -1
- package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js +0 -29
- package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js.map +0 -1
- package/dist/module/features/voice/playing/model/TranscriptionsDownloaderModel.js +0 -61
- package/dist/module/features/voice/playing/model/TranscriptionsDownloaderModel.js.map +0 -1
- package/dist/module/features/voice/playing/model/VoiceTranscriptionsCollection.js.map +0 -1
- package/dist/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts +0 -12
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts +0 -11
- package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts +0 -15
- package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts +0 -12
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts +0 -11
- package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts +0 -15
- package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts.map +0 -1
- package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts.map +0 -1
- package/src/features/voice/playing/components/VoiceTranscriptionsDropdown.tsx +0 -302
- package/src/features/voice/playing/components/VoiceTranscriptionsDropdownItem.tsx +0 -128
- package/src/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.ts +0 -40
- package/src/features/voice/playing/model/TranscriptionsDownloaderModel.ts +0 -80
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TranscriptionsCollection } from './TranscriptionsCollection';
|
|
2
2
|
import { VoiceFileDownloaderModel } from './VoiceFileDownloader.model';
|
|
3
|
-
import {
|
|
3
|
+
import { DropdownModel } from './Dropdown.model';
|
|
4
|
+
import { TranslationModel } from './Translation.model';
|
|
4
5
|
import { AnswerAudio, VoicePlayerApi, VoiceTranscriptionItem } from '../../types';
|
|
5
|
-
import { PlayerModel
|
|
6
|
-
import { TranscriptionsDownloaderModel } from './
|
|
7
|
-
|
|
6
|
+
import { PlayerModel } from './Player.model';
|
|
7
|
+
import { TranscriptionsDownloaderModel } from './TranscriptionsDownloader.model';
|
|
8
|
+
import { PlaybackController } from './PlaybackController';
|
|
9
|
+
type VoicePlayerModelParams = {
|
|
8
10
|
api: VoicePlayerApi;
|
|
9
11
|
audios?: AnswerAudio[];
|
|
10
12
|
};
|
|
11
13
|
export declare class VoicePlayerModel {
|
|
12
|
-
readonly collection:
|
|
13
|
-
readonly
|
|
14
|
-
readonly dropdown: VoiceTranscriptionsDropdownModel;
|
|
14
|
+
readonly collection: TranscriptionsCollection;
|
|
15
|
+
readonly dropdown: DropdownModel;
|
|
15
16
|
readonly playerModel: PlayerModel;
|
|
17
|
+
readonly downloader: VoiceFileDownloaderModel;
|
|
18
|
+
readonly translation: TranslationModel;
|
|
16
19
|
readonly loader: TranscriptionsDownloaderModel;
|
|
17
20
|
readonly api: VoicePlayerApi;
|
|
18
|
-
private
|
|
19
|
-
private shouldPreventPlayback;
|
|
21
|
+
private readonly playback;
|
|
20
22
|
readonly setCurrentAttempt: import("effector").EventCallable<number | null>;
|
|
21
23
|
readonly reset: import("effector").EventCallable<void>;
|
|
22
24
|
readonly $currentAttempt: import("effector").StoreWritable<number | null>;
|
|
23
|
-
readonly $playerState: import("effector").StoreWritable<PlayerState>;
|
|
25
|
+
readonly $playerState: import("effector").StoreWritable<import("./Player.model").PlayerState>;
|
|
24
26
|
readonly pauseAudio: import("effector").Effect<void, void, Error>;
|
|
27
|
+
readonly seekAudio: import("effector").Effect<number, void, Error>;
|
|
28
|
+
readonly togglePlayPause: PlaybackController['togglePlayPause'];
|
|
29
|
+
constructor(params: VoicePlayerModelParams);
|
|
25
30
|
readonly stopAudio: () => void;
|
|
31
|
+
readonly preloadAudio: (attemptNumber?: number) => Promise<void> | undefined;
|
|
26
32
|
readonly resetPlayer: () => void;
|
|
27
|
-
constructor(params: VoiceTranscriptionsPlayerModelParams);
|
|
28
33
|
initializeWithAudios(answerAudio: AnswerAudio[]): void;
|
|
29
|
-
private initializeCollectionFromAudios;
|
|
30
|
-
private releaseCollectionResources;
|
|
31
|
-
private abortAllDownloads;
|
|
32
|
-
private readonly handlePlayAttempt;
|
|
33
|
-
private playAudioFx;
|
|
34
34
|
isAudioLoading(attemptNumber: number): boolean;
|
|
35
35
|
getAllAttempts(): VoiceTranscriptionItem[];
|
|
36
36
|
reinitializePlayer(): void;
|
|
37
37
|
cleanup(): void;
|
|
38
|
-
|
|
38
|
+
private initializeCollectionFromAudios;
|
|
39
39
|
}
|
|
40
40
|
export {};
|
|
41
41
|
//# sourceMappingURL=VoicePlayer.model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoicePlayer.model.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/VoicePlayer.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"VoicePlayer.model.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/VoicePlayer.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAA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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 { GoogleTranslateProps as GoogleTranslatePayload, GoogleTranslateResponse } from '../translation/providers/google.types';
|
|
6
|
+
export type { GoogleTranslatePayload, GoogleTranslateResponse };
|
|
5
7
|
export type VoiceRecordNotificationTypes = {
|
|
6
8
|
success: (message: string) => void;
|
|
7
9
|
info: (message: string) => void;
|
|
@@ -46,6 +48,7 @@ export type VoiceRecorderApi = {
|
|
|
46
48
|
type TranscriptionStatus = 'pending' | 'completed' | 'failed';
|
|
47
49
|
export type AudioTranscriptResponse = {
|
|
48
50
|
text: string;
|
|
51
|
+
language: string;
|
|
49
52
|
status: TranscriptionStatus;
|
|
50
53
|
};
|
|
51
54
|
export type VoicePlayerApi = {
|
|
@@ -53,12 +56,14 @@ export type VoicePlayerApi = {
|
|
|
53
56
|
downloadAudioFile: (audioFileId: string, options?: {
|
|
54
57
|
signal?: AbortSignal;
|
|
55
58
|
}) => Promise<AxiosResponse<Blob>>;
|
|
59
|
+
translateText: (payload: GoogleTranslatePayload) => Promise<GoogleTranslateResponse>;
|
|
56
60
|
};
|
|
57
61
|
export type VoiceTranscriptionItem = {
|
|
58
62
|
attemptNumber: number;
|
|
59
63
|
audioFileId: string;
|
|
60
64
|
_id: string;
|
|
61
65
|
transcript?: string;
|
|
66
|
+
transcriptLanguage?: string;
|
|
62
67
|
transcriptLoading?: boolean;
|
|
63
68
|
transcriptError?: string;
|
|
64
69
|
audioUri?: string;
|
|
@@ -76,5 +81,4 @@ export declare enum VoiceTranscriptionVariant {
|
|
|
76
81
|
SMALL = "small",
|
|
77
82
|
LARGE = "large"
|
|
78
83
|
}
|
|
79
|
-
export {};
|
|
80
84
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/voice/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAA;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/voice/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAA;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AACrC,OAAO,KAAK,EACV,oBAAoB,IAAI,sBAAsB,EAC9C,uBAAuB,EACxB,MAAM,uCAAuC,CAAA;AAE9C,YAAY,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,CAAA;AAE/D,MAAM,MAAM,4BAA4B,GAAG;IACzC,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAAC;IAC/C,iBAAiB,EAAE,QAAQ,CAAA;CAC5B,CAAC,CAAA;AAEF,KAAK,mBAAmB,GAAG;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,UAAU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AAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,yBAAyB,CAAA;AACvC,cAAc,mBAAmB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,yBAAyB,CAAA;AACvC,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const GBD_TEXT_CACHE_SUFFIX = "::gbd";
|
|
2
|
+
export declare const DESCRIPTION_CACHE_KEY_SUFFIX = "::description";
|
|
3
|
+
export declare const CHOICES_CACHE_KEY_SUFFIX = "::choices";
|
|
4
|
+
export declare const PRACTICE_THEORY_CACHE_KEY_SUFFIX = "::practice-theory";
|
|
5
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/features/translation/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,UAAU,CAAA;AAC5C,eAAO,MAAM,4BAA4B,kBAAkB,CAAA;AAC3D,eAAO,MAAM,wBAAwB,cAAc,CAAA;AACnD,eAAO,MAAM,gCAAgC,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MaskSegmentParams } from './types';
|
|
2
|
+
export declare function replaceMappedTokens(input: string, map: Record<string, string>): string;
|
|
3
|
+
/**
|
|
4
|
+
* Masks text segments matched by `regex` with a placeholder,
|
|
5
|
+
* while preserving spaces around the original match.
|
|
6
|
+
*/
|
|
7
|
+
export declare const maskSegment: ({ text, regex, placeholder, replacements, shouldSkip, }: MaskSegmentParams) => string;
|
|
8
|
+
export declare const decodeHtmlEntities: (text: string) => string;
|
|
9
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/features/translation/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAE3C,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAWtF;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,4DAMrB,iBAAiB,KAAG,MAkBtB,CAAA;AAWD,eAAO,MAAM,kBAAkB,SAAU,MAAM,KAAG,MAQjD,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { TranslationModel } from './model/TranslationModel';
|
|
2
|
+
export { TranslationService, type TranslateConfigProps } from './model/TranslationService';
|
|
3
|
+
export { TranslationKatexPreprocessor } from './model/TranslationPreprocessor';
|
|
4
|
+
export { TranslationProvider, type LanguageGlossary } from './providers/translation.interface';
|
|
5
|
+
export { GoogleTranslationProvider } from './providers/google/GoogleTranslationProvider';
|
|
6
|
+
export { GoogleTranslateLanguage } from './providers/google/supportedLanguages';
|
|
7
|
+
export type { GoogleTranslateProps, GoogleTranslateResponse, GoogleTranslation, } from './providers/google.types';
|
|
8
|
+
export { wordsToPreserve, preservedWordsReplacers } from './preserve/wordsToPreserve';
|
|
9
|
+
export { GBD_TEXT_CACHE_SUFFIX, DESCRIPTION_CACHE_KEY_SUFFIX, CHOICES_CACHE_KEY_SUFFIX, PRACTICE_THEORY_CACHE_KEY_SUFFIX, } from './constants';
|
|
10
|
+
export { replaceMappedTokens, maskSegment, decodeHtmlEntities, } from './helpers';
|
|
11
|
+
export type { TranslatableProblem, TranslateAllFxParams, TranslateFxParams, Replacement, MaskSegmentParams, } from './types';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/translation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,kBAAkB,EAAE,KAAK,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAC1F,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAA;AAC9E,OAAO,EAAE,mBAAmB,EAAE,KAAK,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAA;AACxF,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAA;AAC/E,YAAY,EACV,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AACrF,OAAO,EACL,qBAAqB,EACrB,4BAA4B,EAC5B,wBAAwB,EACxB,gCAAgC,GACjC,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,kBAAkB,GACnB,MAAM,WAAW,CAAA;AAClB,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,WAAW,EACX,iBAAiB,GAClB,MAAM,SAAS,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Store, Unit } from 'effector';
|
|
2
|
+
import { GoogleTranslateProps, GoogleTranslateResponse } from '../providers/google.types';
|
|
3
|
+
import { TranslatableProblem, TranslateFxParams } from '../types';
|
|
4
|
+
type TranslationModelProps<TProblem extends TranslatableProblem> = {
|
|
5
|
+
$problem: Store<TProblem | null>;
|
|
6
|
+
$problemId: Store<string>;
|
|
7
|
+
$assignmentId: Store<string>;
|
|
8
|
+
$currentProblemIndex: Store<number>;
|
|
9
|
+
$translationLanguageCode: Store<string>;
|
|
10
|
+
$contentLanguageCode?: Store<string>;
|
|
11
|
+
$isTranslationLocked: Store<boolean>;
|
|
12
|
+
languageChanged: Unit<unknown>;
|
|
13
|
+
api: {
|
|
14
|
+
translateRequest: (payload: GoogleTranslateProps) => Promise<GoogleTranslateResponse>;
|
|
15
|
+
};
|
|
16
|
+
getGreatWorkFeedbackText?: () => string;
|
|
17
|
+
};
|
|
18
|
+
export declare class TranslationModel<TProblem extends TranslatableProblem = TranslatableProblem> {
|
|
19
|
+
private readonly service;
|
|
20
|
+
readonly toggle: import("effector").EventCallable<void>;
|
|
21
|
+
readonly setTranslated: import("effector").EventCallable<boolean>;
|
|
22
|
+
readonly reset: import("effector").EventCallable<void>;
|
|
23
|
+
readonly $isTranslationActive: import("effector").StoreWritable<boolean>;
|
|
24
|
+
readonly $isTranslated: import("effector").StoreWritable<boolean>;
|
|
25
|
+
readonly $isTranslationPending: Store<boolean>;
|
|
26
|
+
readonly translateFx: import("effector").Effect<TranslateFxParams, string, Error>;
|
|
27
|
+
readonly translateAllFx: import("effector").Effect<void, unknown[] | undefined, Error>;
|
|
28
|
+
constructor({ $problem, $problemId, $assignmentId, $currentProblemIndex, $translationLanguageCode, $contentLanguageCode, $isTranslationLocked, languageChanged, api, getGreatWorkFeedbackText, }: TranslationModelProps<TProblem>);
|
|
29
|
+
getTranslated<T extends string | string[]>(key: string): T | undefined;
|
|
30
|
+
clearCache(): void;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=TranslationModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TranslationModel.d.ts","sourceRoot":"","sources":["../../../../../../src/features/translation/model/TranslationModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,EACL,IAAI,EACL,MAAM,UAAU,CAAA;AAEjB,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACxB,MAAM,2BAA2B,CAAA;AAWlC,OAAO,EACL,mBAAmB,EAEnB,iBAAiB,EAClB,MAAM,UAAU,CAAA;AAEjB,KAAK,qBAAqB,CAAC,QAAQ,SAAS,mBAAmB,IAAI;IACjE,QAAQ,EAAE,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAA;IAChC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACzB,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAC5B,oBAAoB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACnC,wBAAwB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACvC,oBAAoB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACpC,oBAAoB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;IACpC,eAAe,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IAC9B,GAAG,EAAE;QACH,gBAAgB,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAA;KACtF,CAAA;IACD,wBAAwB,CAAC,EAAE,MAAM,MAAM,CAAA;CACxC,CAAA;AAED,qBAAa,gBAAgB,CAAC,QAAQ,SAAS,mBAAmB,GAAG,mBAAmB;IACtF,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;IAE5C,SAAgB,MAAM,yCAAgB;IACtC,SAAgB,aAAa,4CAAyB;IACtD,SAAgB,KAAK,yCAAgB;IAErC,SAAgB,oBAAoB,4CAAuD;IAC3F,SAAgB,aAAa,4CAA4B;IACzD,SAAgB,qBAAqB,iBAAA;IAErC,SAAgB,WAAW,8DAAA;IAC3B,SAAgB,cAAc,gEAAA;gBAElB,EACV,QAAQ,EACR,UAAU,EACV,aAAa,EACb,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,GAAG,EACH,wBAAwB,GACzB,EAAE,qBAAqB,CAAC,QAAQ,CAAC;IA8F3B,aAAa,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAItE,UAAU;CAGlB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { LanguageGlossary } from '../providers/translation.interface';
|
|
2
|
+
import { Replacement } from '../types';
|
|
3
|
+
type SetupPreservableProps = {
|
|
4
|
+
glossaryToPreserve: LanguageGlossary;
|
|
5
|
+
preserveWordsReplacers: [RegExp, string][];
|
|
6
|
+
};
|
|
7
|
+
export declare class TranslationKatexPreprocessor {
|
|
8
|
+
private static plaintextConverter;
|
|
9
|
+
static setPlaintextConverter(converter: (text: string) => string): void;
|
|
10
|
+
static shouldSkipTranslation(text?: string | string[]): boolean;
|
|
11
|
+
static isMathExpressionOnly(text: string): boolean;
|
|
12
|
+
static isSingleLetter(text: string): boolean;
|
|
13
|
+
static isMathSymbolsOnly(text: string): boolean;
|
|
14
|
+
private globalTargetLanguage;
|
|
15
|
+
private preserveWordsMap;
|
|
16
|
+
private preserveWordsReplacers;
|
|
17
|
+
private normalizePlaceholderSpacing;
|
|
18
|
+
sanitize(text: string): {
|
|
19
|
+
sanitized: string;
|
|
20
|
+
replacements: Replacement[];
|
|
21
|
+
};
|
|
22
|
+
restore(text: string, replacements: Replacement[]): string;
|
|
23
|
+
sanitizeBatch(texts: string[]): {
|
|
24
|
+
sanitized: string[];
|
|
25
|
+
replacements: Replacement[][];
|
|
26
|
+
};
|
|
27
|
+
restoreBatch(texts: string[], replacementsArray: Replacement[][]): string[];
|
|
28
|
+
setupPreservable({ glossaryToPreserve, preserveWordsReplacers }: SetupPreservableProps): void;
|
|
29
|
+
setupTarget(language: string): void;
|
|
30
|
+
private skipCustomReplacerSanitizeWithoutGlossary;
|
|
31
|
+
private applyPreserved;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=TranslationPreprocessor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TranslationPreprocessor.d.ts","sourceRoot":"","sources":["../../../../../../src/features/translation/model/TranslationPreprocessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAA;AAErE,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AA2BtC,KAAK,qBAAqB,GAAG;IAC3B,kBAAkB,EAAE,gBAAgB,CAAA;IACpC,sBAAsB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAA;CAC3C,CAAA;AAED,qBAAa,4BAA4B;IACvC,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAA2C;WAE9D,qBAAqB,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM;WAIzD,qBAAqB,CAAC,IAAI,GAAE,MAAM,GAAG,MAAM,EAAO;WAYlD,oBAAoB,CAAC,IAAI,EAAE,MAAM;WAIjC,cAAc,CAAC,IAAI,EAAE,MAAM;WAI3B,iBAAiB,CAAC,IAAI,EAAE,MAAM;IAO5C,OAAO,CAAC,oBAAoB,CAAsB;IAClD,OAAO,CAAC,gBAAgB,CAAuB;IAC/C,OAAO,CAAC,sBAAsB,CAAyB;IAEvD,OAAO,CAAC,2BAA2B;IAM5B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,WAAW,EAAE,CAAA;KAAE;IA8B1E,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE;IAUjD,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG;QAAE,SAAS,EAAE,MAAM,EAAE,CAAC;QAAC,YAAY,EAAE,WAAW,EAAE,EAAE,CAAA;KAAE;IAatF,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,iBAAiB,EAAE,WAAW,EAAE,EAAE;IAYhE,gBAAgB,CAAC,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,EAAE,qBAAqB;IAKtF,WAAW,CAAC,QAAQ,EAAE,MAAM;IAInC,OAAO,CAAC,yCAAyC;IAYjD,OAAO,CAAC,cAAc;CAMvB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Store } from 'effector';
|
|
2
|
+
import { LanguageGlossary, TranslationProvider } from '../providers/translation.interface';
|
|
3
|
+
type TranslationServiceProps = {
|
|
4
|
+
providers: TranslationProvider[];
|
|
5
|
+
preserve?: {
|
|
6
|
+
map: LanguageGlossary;
|
|
7
|
+
replacers: [RegExp, string][];
|
|
8
|
+
};
|
|
9
|
+
onError?: () => void;
|
|
10
|
+
};
|
|
11
|
+
export type TranslateConfigProps = {
|
|
12
|
+
targetLang?: string;
|
|
13
|
+
sourceLang?: string;
|
|
14
|
+
cacheKeySuffix?: string;
|
|
15
|
+
cacheKey?: string;
|
|
16
|
+
};
|
|
17
|
+
export declare class TranslationService {
|
|
18
|
+
private readonly preprocessor;
|
|
19
|
+
private readonly cache;
|
|
20
|
+
private readonly providers;
|
|
21
|
+
private readonly onError;
|
|
22
|
+
private globalTargetLanguage;
|
|
23
|
+
private sourceLanguage;
|
|
24
|
+
private customCacheKeyFn;
|
|
25
|
+
constructor({ providers, preserve, onError }: TranslationServiceProps);
|
|
26
|
+
private getTargetLanguage;
|
|
27
|
+
private getProvider;
|
|
28
|
+
private createCacheKey;
|
|
29
|
+
translate: <T extends string | string[]>(text?: T, config?: TranslateConfigProps) => Promise<T>;
|
|
30
|
+
bindTargetLanguage<T extends string>(store: Store<T>, callback?: (value: T) => string): this;
|
|
31
|
+
bindSourceLanguage<T extends string>(store: Store<T>): this;
|
|
32
|
+
bindCustomCacheKey<T extends string>(store: Store<T>, callback: (value: T, input: {
|
|
33
|
+
text: string | string[];
|
|
34
|
+
target: string;
|
|
35
|
+
}) => string): this;
|
|
36
|
+
getCached<T extends string | string[]>(key: string): T | undefined;
|
|
37
|
+
reset(): void;
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=TranslationService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TranslationService.d.ts","sourceRoot":"","sources":["../../../../../../src/features/translation/model/TranslationService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAEhC,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAA;AAE1F,KAAK,uBAAuB,GAAG;IAC7B,SAAS,EAAE,mBAAmB,EAAE,CAAA;IAChC,QAAQ,CAAC,EAAE;QACT,GAAG,EAAE,gBAAgB,CAAA;QACrB,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAA;KAC9B,CAAA;IACD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAqC;IAClE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAuC;IAC7D,OA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AAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA4ElE,CAAA;AAOD,eAAO,MAAM,uBAAuB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAGrD,CAAA"}
|
package/dist/typescript/module/features/translation/providers/google/GoogleTranslationProvider.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LanguageGlossary, TranslationProvider } from '../translation.interface';
|
|
2
|
+
import { GoogleTranslateProps, GoogleTranslateResponse } from '../google.types';
|
|
3
|
+
type GoogleTranslationProviderProps = {
|
|
4
|
+
api: {
|
|
5
|
+
translateRequest: (payload: GoogleTranslateProps) => Promise<GoogleTranslateResponse>;
|
|
6
|
+
};
|
|
7
|
+
glossaries?: LanguageGlossary;
|
|
8
|
+
};
|
|
9
|
+
export declare class GoogleTranslationProvider extends TranslationProvider {
|
|
10
|
+
private readonly getTranslationFx;
|
|
11
|
+
constructor({ api, glossaries }: GoogleTranslationProviderProps);
|
|
12
|
+
resolveLanguage(language: string): string | null;
|
|
13
|
+
request(text: string, targetLanguage: string, sourceLanguage?: string): Promise<string>;
|
|
14
|
+
requestBatch(text: string[], targetLanguage: string, sourceLanguage?: string): Promise<string[]>;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=GoogleTranslationProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleTranslationProvider.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/translation/providers/google/GoogleTranslationProvider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAEhF,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAG/E,KAAK,8BAA8B,GAAG;IACpC,GAAG,EAAE;QACH,gBAAgB,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAA;KACtF,CAAA;IACD,UAAU,CAAC,EAAE,gBAAgB,CAAA;CAC9B,CAAA;AAED,qBAAa,yBAA0B,SAAQ,mBAAmB;IAChE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAuD;gBAE5E,EAAE,GAAG,EAAE,UAAU,EAAE,EAAE,8BAA8B;IAKxD,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAI1C,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM;IAYrE,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM;CAY1F"}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves an arbitrary language input (ISO code, locale, or English name) to the
|
|
3
|
+
* Google Translate ISO code. Returns null when the language is not supported.
|
|
4
|
+
*
|
|
5
|
+
* Examples:
|
|
6
|
+
* "en" → "en"
|
|
7
|
+
* "en-SE" → "en" (base fallback)
|
|
8
|
+
* "zh-CN" → "zh-CN" (exact match)
|
|
9
|
+
* "Spanish" → "es" (name lookup)
|
|
10
|
+
* "Chinese Simplified" → "zh-CN"
|
|
11
|
+
*/
|
|
12
|
+
export declare const resolveGoogleLanguageCode: (language?: string | null) => string | null;
|
|
13
|
+
export declare const GoogleTranslateLanguage: {
|
|
14
|
+
ABKHAZ: string;
|
|
15
|
+
ACEHNESE: string;
|
|
16
|
+
ACHOLI: string;
|
|
17
|
+
AFRIKAANS: string;
|
|
18
|
+
ALBANIAN: string;
|
|
19
|
+
ALUR: string;
|
|
20
|
+
AMHARIC: string;
|
|
21
|
+
ARABIC: string;
|
|
22
|
+
ARMENIAN: string;
|
|
23
|
+
ASSAMESE: string;
|
|
24
|
+
AWADHI: string;
|
|
25
|
+
AYMARA: string;
|
|
26
|
+
AZERBAIJANI: string;
|
|
27
|
+
BALINESE: string;
|
|
28
|
+
BAMBARA: string;
|
|
29
|
+
BASHKIR: string;
|
|
30
|
+
BASQUE: string;
|
|
31
|
+
BATAK_KARO: string;
|
|
32
|
+
BATAK_SIMALUNGUN: string;
|
|
33
|
+
BATAK_TOBA: string;
|
|
34
|
+
BELARUSIAN: string;
|
|
35
|
+
BEMBA: string;
|
|
36
|
+
BENGALI: string;
|
|
37
|
+
BETAWI: string;
|
|
38
|
+
BHOJPURI: string;
|
|
39
|
+
BIKOL: string;
|
|
40
|
+
BOSNIAN: string;
|
|
41
|
+
BRETON: string;
|
|
42
|
+
BULGARIAN: string;
|
|
43
|
+
BURMESE: string;
|
|
44
|
+
BURYAT: string;
|
|
45
|
+
CANTONESE: string;
|
|
46
|
+
CATALAN: string;
|
|
47
|
+
CEBUANO: string;
|
|
48
|
+
CHICHEWA_NYANJA: string;
|
|
49
|
+
CHINESE_SIMPLIFIED: string;
|
|
50
|
+
CHINESE_TRADITIONAL: string;
|
|
51
|
+
CHUVASH: string;
|
|
52
|
+
CORSICAN: string;
|
|
53
|
+
CRIMEAN_TATAR: string;
|
|
54
|
+
CROATIAN: string;
|
|
55
|
+
CZECH: string;
|
|
56
|
+
DANISH: string;
|
|
57
|
+
DINKA: string;
|
|
58
|
+
DIVEHI: string;
|
|
59
|
+
DOGRI: string;
|
|
60
|
+
DOMBE: string;
|
|
61
|
+
DUTCH: string;
|
|
62
|
+
DZONGKHA: string;
|
|
63
|
+
ENGLISH: string;
|
|
64
|
+
ESPERANTO: string;
|
|
65
|
+
ESTONIAN: string;
|
|
66
|
+
EWE: string;
|
|
67
|
+
FIJIAN: string;
|
|
68
|
+
FILIPINO_TAGALOG: string;
|
|
69
|
+
FINNISH: string;
|
|
70
|
+
FRENCH: string;
|
|
71
|
+
FRENCH_CANADA: string;
|
|
72
|
+
FRENCH_FRANCE: string;
|
|
73
|
+
FRISIAN: string;
|
|
74
|
+
FULFULDE: string;
|
|
75
|
+
GA: string;
|
|
76
|
+
GALICIAN: string;
|
|
77
|
+
GANDA_LUGANDA: string;
|
|
78
|
+
GEORGIAN: string;
|
|
79
|
+
GERMAN: string;
|
|
80
|
+
GREEK: string;
|
|
81
|
+
GUARANI: string;
|
|
82
|
+
GUJARATI: string;
|
|
83
|
+
HAITIAN_CREOLE: string;
|
|
84
|
+
HAKHA_CHIN: string;
|
|
85
|
+
HAUSA: string;
|
|
86
|
+
HAWAIIAN: string;
|
|
87
|
+
HEBREW: string;
|
|
88
|
+
HILIGAYNON: string;
|
|
89
|
+
HINDI: string;
|
|
90
|
+
HMONG: string;
|
|
91
|
+
HUNGARIAN: string;
|
|
92
|
+
HUNSRIK: string;
|
|
93
|
+
ICELANDIC: string;
|
|
94
|
+
IGBO: string;
|
|
95
|
+
ILOKO: string;
|
|
96
|
+
INDONESIAN: string;
|
|
97
|
+
IRISH: string;
|
|
98
|
+
ITALIAN: string;
|
|
99
|
+
JAPANESE: string;
|
|
100
|
+
JAVANESE: string;
|
|
101
|
+
KANNADA: string;
|
|
102
|
+
KAPAMPANGAN: string;
|
|
103
|
+
KAZAKH: string;
|
|
104
|
+
KHMER: string;
|
|
105
|
+
KIGA: string;
|
|
106
|
+
KINYARWANDA: string;
|
|
107
|
+
KITUBA: string;
|
|
108
|
+
KONKANI: string;
|
|
109
|
+
KOREAN: string;
|
|
110
|
+
KRIO: string;
|
|
111
|
+
KURMANJI: string;
|
|
112
|
+
KYRGYZ: string;
|
|
113
|
+
LAO: string;
|
|
114
|
+
LATGALIAN: string;
|
|
115
|
+
LATIN: string;
|
|
116
|
+
LATVIAN: string;
|
|
117
|
+
LIGURIAN: string;
|
|
118
|
+
LIMBURGAN: string;
|
|
119
|
+
LINGALA: string;
|
|
120
|
+
LITHUANIAN: string;
|
|
121
|
+
LOMBARD: string;
|
|
122
|
+
LUO: string;
|
|
123
|
+
LUXEMBOURGISH: string;
|
|
124
|
+
MACEDONIAN: string;
|
|
125
|
+
MAITHILI: string;
|
|
126
|
+
MAKASSAR: string;
|
|
127
|
+
MALAGASY: string;
|
|
128
|
+
MALAY: string;
|
|
129
|
+
MALAYALAM: string;
|
|
130
|
+
MALAY_JAWI: string;
|
|
131
|
+
MALTESE: string;
|
|
132
|
+
MAORI: string;
|
|
133
|
+
MARATHI: string;
|
|
134
|
+
MEADOW_MARI: string;
|
|
135
|
+
MEITEILON_MANIPURI: string;
|
|
136
|
+
MINANG: string;
|
|
137
|
+
MIZO: string;
|
|
138
|
+
MONGOLIAN: string;
|
|
139
|
+
NDEBELE_SOUTH: string;
|
|
140
|
+
NEPALBHASA_NEWARI: string;
|
|
141
|
+
NEPALI: string;
|
|
142
|
+
NORTHERN_SOTHO: string;
|
|
143
|
+
NORWEGIAN: string;
|
|
144
|
+
NUER: string;
|
|
145
|
+
OCCITAN: string;
|
|
146
|
+
ODIA: string;
|
|
147
|
+
OROMO: string;
|
|
148
|
+
PANGASINAN: string;
|
|
149
|
+
PAPIAMENTO: string;
|
|
150
|
+
PASHTO: string;
|
|
151
|
+
PERSIAN: string;
|
|
152
|
+
POLISH: string;
|
|
153
|
+
PORTUGUESE: string;
|
|
154
|
+
PORTUGUESE_BRAZIL: string;
|
|
155
|
+
PORTUGUESE_PORTUGAL: string;
|
|
156
|
+
PUNJABI: string;
|
|
157
|
+
PUNJABI_SHAHMUKHI: string;
|
|
158
|
+
QUECHUA: string;
|
|
159
|
+
ROMANI: string;
|
|
160
|
+
ROMANIAN: string;
|
|
161
|
+
RUNDI: string;
|
|
162
|
+
RUSSIAN: string;
|
|
163
|
+
SAMOAN: string;
|
|
164
|
+
SANGO: string;
|
|
165
|
+
SANSKRIT: string;
|
|
166
|
+
SCOTS_GAELIC: string;
|
|
167
|
+
SERBIAN: string;
|
|
168
|
+
SESOTHO: string;
|
|
169
|
+
SEYCHELLOIS_CREOLE: string;
|
|
170
|
+
SHAN: string;
|
|
171
|
+
SHONA: string;
|
|
172
|
+
SICILIAN: string;
|
|
173
|
+
SILESIAN: string;
|
|
174
|
+
SINDHI: string;
|
|
175
|
+
SINHALA: string;
|
|
176
|
+
SLOVAK: string;
|
|
177
|
+
SLOVENIAN: string;
|
|
178
|
+
SOMALI: string;
|
|
179
|
+
SORANI: string;
|
|
180
|
+
SPANISH: string;
|
|
181
|
+
SUNDANESE: string;
|
|
182
|
+
SWAHILI: string;
|
|
183
|
+
SWATI: string;
|
|
184
|
+
SWEDISH: string;
|
|
185
|
+
TAJIK: string;
|
|
186
|
+
TAMIL: string;
|
|
187
|
+
TATAR: string;
|
|
188
|
+
TELUGU: string;
|
|
189
|
+
TETUM: string;
|
|
190
|
+
THAI: string;
|
|
191
|
+
TIGRINYA: string;
|
|
192
|
+
TSONGA: string;
|
|
193
|
+
TSWANA: string;
|
|
194
|
+
TURKISH: string;
|
|
195
|
+
TURKMEN: string;
|
|
196
|
+
TWI_AKAN: string;
|
|
197
|
+
UKRAINIAN: string;
|
|
198
|
+
URDU: string;
|
|
199
|
+
UYGHUR: string;
|
|
200
|
+
UZBEK: string;
|
|
201
|
+
VIETNAMESE: string;
|
|
202
|
+
WELSH: string;
|
|
203
|
+
XHOSA: string;
|
|
204
|
+
YIDDISH: string;
|
|
205
|
+
YORUBA: string;
|
|
206
|
+
YUCATEC_MAYA: string;
|
|
207
|
+
ZULU: string;
|
|
208
|
+
};
|
|
209
|
+
//# sourceMappingURL=supportedLanguages.d.ts.map
|
package/dist/typescript/module/features/translation/providers/google/supportedLanguages.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supportedLanguages.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/translation/providers/google/supportedLanguages.ts"],"names":[],"mappings":"AASA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB,cAAe,MAAM,GAAG,IAAI,KAAG,MAAM,GAAG,IAM7E,CAAA;AAED,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmMnC,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type GoogleTranslateProps = {
|
|
2
|
+
text: string[];
|
|
3
|
+
targetLanguage: string;
|
|
4
|
+
sourceLanguage?: string;
|
|
5
|
+
};
|
|
6
|
+
export type GoogleTranslation = {
|
|
7
|
+
translatedText: string;
|
|
8
|
+
detectedSourceLanguage: string;
|
|
9
|
+
};
|
|
10
|
+
export type GoogleTranslateResponse = {
|
|
11
|
+
data: {
|
|
12
|
+
translations: GoogleTranslation[];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=google.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google.types.d.ts","sourceRoot":"","sources":["../../../../../../src/features/translation/providers/google.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,cAAc,EAAE,MAAM,CAAA;IACtB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,cAAc,EAAE,MAAM,CAAA;IACtB,sBAAsB,EAAE,MAAM,CAAA;CAC/B,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE;QACJ,YAAY,EAAE,iBAAiB,EAAE,CAAA;KAClC,CAAA;CACF,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type LanguageGlossary = {
|
|
2
|
+
[languageCode: string]: Record<string, string>;
|
|
3
|
+
};
|
|
4
|
+
type TranslationProviderProps = {
|
|
5
|
+
supportedLanguages: string[];
|
|
6
|
+
glossaries?: LanguageGlossary;
|
|
7
|
+
};
|
|
8
|
+
export declare abstract class TranslationProvider {
|
|
9
|
+
protected readonly supportedLanguages: ReadonlySet<string>;
|
|
10
|
+
protected readonly glossaries: LanguageGlossary;
|
|
11
|
+
protected constructor({ supportedLanguages, glossaries }: TranslationProviderProps);
|
|
12
|
+
abstract request(text: string, targetLanguage: string, sourceLanguage?: string): Promise<string>;
|
|
13
|
+
abstract requestBatch(text: string[], targetLanguage: string, sourceLanguage?: string): Promise<string[]>;
|
|
14
|
+
isTargetSupported(language: string): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Returns the provider-supported variant of `language`, falling back to the base
|
|
17
|
+
* language part (e.g. "en-SE" → "en") when the exact locale is not listed.
|
|
18
|
+
* Subclasses may override to add their own resolution (e.g. language names).
|
|
19
|
+
* Returns null when the language cannot be resolved.
|
|
20
|
+
*/
|
|
21
|
+
resolveLanguage(language: string): string | null;
|
|
22
|
+
getSupportedLanguages(): SetIterator<string>;
|
|
23
|
+
/**
|
|
24
|
+
* Replaces full standalone words in text using a custom glossary for the target language,
|
|
25
|
+
* matching words like "Hello", or "Hej" regardless of case, but not when they appear inside other words.
|
|
26
|
+
*/
|
|
27
|
+
applyGlossary(text: string, targetLanguage: string): string;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=translation.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translation.interface.d.ts","sourceRoot":"","sources":["../../../../../../src/features/translation/providers/translation.interface.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC/C,CAAA;AAED,KAAK,wBAAwB,GAAG;IAC9B,kBAAkB,EAAE,MAAM,EAAE,CAAA;IAC5B,UAAU,CAAC,EAAE,gBAAgB,CAAA;CAC9B,CAAA;AAED,8BAAsB,mBAAmB;IACvC,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC1D,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAK;IAEpD,SAAS,aAAa,EAAE,kBAAkB,EAAE,UAAe,EAAE,EAAE,wBAAwB;aAKvE,OAAO,CACrB,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM,EACtB,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,MAAM,CAAC;aACF,YAAY,CAC1B,IAAI,EAAE,MAAM,EAAE,EACd,cAAc,EAAE,MAAM,EACtB,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,MAAM,EAAE,CAAC;IAEb,iBAAiB,CAAC,QAAQ,EAAE,MAAM;IAIzC;;;;;OAKG;IACI,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAQhD,qBAAqB;IAI5B;;;OAGG;IACI,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM;CAKnE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type TranslatableProblem = {
|
|
2
|
+
description: string;
|
|
3
|
+
richDescription?: string;
|
|
4
|
+
answerVariants: string[];
|
|
5
|
+
};
|
|
6
|
+
export type TranslateAllFxParams<TProblem extends TranslatableProblem = TranslatableProblem> = {
|
|
7
|
+
problem: TProblem | null;
|
|
8
|
+
translationLanguageCode?: string | null;
|
|
9
|
+
};
|
|
10
|
+
export type TranslateFxParams = {
|
|
11
|
+
cacheKey: string;
|
|
12
|
+
text: string;
|
|
13
|
+
};
|
|
14
|
+
export type Replacement = {
|
|
15
|
+
placeholder: string;
|
|
16
|
+
original: string;
|
|
17
|
+
leftPad?: boolean;
|
|
18
|
+
rightPad?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export type MaskSegmentParams = {
|
|
21
|
+
text: string;
|
|
22
|
+
regex: RegExp;
|
|
23
|
+
placeholder: string;
|
|
24
|
+
replacements: Replacement[];
|
|
25
|
+
shouldSkip?: (match: string) => boolean;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/translation/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,EAAE,MAAM,CAAA;IACnB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,cAAc,EAAE,MAAM,EAAE,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,oBAAoB,CAAC,QAAQ,SAAS,mBAAmB,GAAG,mBAAmB,IAAI;IAC7F,OAAO,EAAE,QAAQ,GAAG,IAAI,CAAA;IACxB,uBAAuB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACxC,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAA;CACxC,CAAA"}
|