@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,56 +1,74 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { createEvent, restore } from 'effector';
|
|
4
|
+
import { TranscriptionsCollection } from "./TranscriptionsCollection.js";
|
|
5
5
|
import { VoiceFileDownloaderModel } from "./VoiceFileDownloader.model.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { DropdownModel } from "./Dropdown.model.js";
|
|
7
|
+
import { TranslationModel } from "./Translation.model.js";
|
|
8
|
+
import { PlayerModel } from "./Player.model.js";
|
|
9
|
+
import { TranscriptionsDownloaderModel } from "./TranscriptionsDownloader.model.js";
|
|
10
|
+
import { PlaybackController } from "./PlaybackController.js";
|
|
9
11
|
export class VoicePlayerModel {
|
|
10
|
-
collection = new
|
|
11
|
-
|
|
12
|
-
dropdown = new VoiceTranscriptionsDropdownModel();
|
|
12
|
+
collection = new TranscriptionsCollection();
|
|
13
|
+
dropdown = new DropdownModel();
|
|
13
14
|
playerModel = new PlayerModel();
|
|
14
|
-
currentPlayingAttempt = null;
|
|
15
|
-
shouldPreventPlayback = false;
|
|
16
15
|
setCurrentAttempt = createEvent();
|
|
17
16
|
reset = createEvent();
|
|
18
17
|
$currentAttempt = restore(this.setCurrentAttempt, null).reset(this.reset);
|
|
19
18
|
$playerState = this.playerModel.$playerState;
|
|
20
19
|
pauseAudio = this.playerModel.pause;
|
|
21
|
-
|
|
22
|
-
this.shouldPreventPlayback = true;
|
|
23
|
-
this.abortAllDownloads();
|
|
24
|
-
this.playerModel.stop();
|
|
25
|
-
this.currentPlayingAttempt = null;
|
|
26
|
-
this.setCurrentAttempt(null);
|
|
27
|
-
};
|
|
28
|
-
resetPlayer = () => {
|
|
29
|
-
this.shouldPreventPlayback = true;
|
|
30
|
-
this.releaseCollectionResources();
|
|
31
|
-
this.playerModel.stop();
|
|
32
|
-
this.currentPlayingAttempt = null;
|
|
33
|
-
this.setCurrentAttempt(null);
|
|
34
|
-
this.collection.clear();
|
|
35
|
-
};
|
|
20
|
+
seekAudio = this.playerModel.seek;
|
|
36
21
|
constructor(params) {
|
|
37
22
|
this.api = params.api;
|
|
23
|
+
this.downloader = new VoiceFileDownloaderModel(params.api);
|
|
38
24
|
this.loader = new TranscriptionsDownloaderModel(this.collection, params.api);
|
|
39
|
-
this.
|
|
40
|
-
this.
|
|
41
|
-
this.
|
|
42
|
-
this.
|
|
25
|
+
this.translation = new TranslationModel(this.collection, params.api);
|
|
26
|
+
this.playback = new PlaybackController({
|
|
27
|
+
collection: this.collection,
|
|
28
|
+
player: this.playerModel,
|
|
29
|
+
downloader: this.downloader
|
|
43
30
|
});
|
|
31
|
+
this.togglePlayPause = this.playback.togglePlayPause;
|
|
44
32
|
if (params.audios) {
|
|
45
33
|
this.initializeCollectionFromAudios(params.audios);
|
|
46
34
|
}
|
|
47
35
|
this.playerModel.setupAudioMode();
|
|
48
36
|
}
|
|
37
|
+
stopAudio = () => {
|
|
38
|
+
this.playback.halt();
|
|
39
|
+
};
|
|
40
|
+
preloadAudio = attemptNumber => {
|
|
41
|
+
const target = attemptNumber ?? this.$currentAttempt.getState();
|
|
42
|
+
if (target === null) return;
|
|
43
|
+
return this.playback.preloadAudio(target);
|
|
44
|
+
};
|
|
45
|
+
resetPlayer = () => {
|
|
46
|
+
this.playback.releaseResources();
|
|
47
|
+
this.playback.halt();
|
|
48
|
+
this.collection.clear();
|
|
49
|
+
this.translation.clearCache();
|
|
50
|
+
};
|
|
49
51
|
initializeWithAudios(answerAudio) {
|
|
50
|
-
this.loader.setTranscriptsLoaded(false);
|
|
51
52
|
this.collection.clear();
|
|
52
53
|
this.initializeCollectionFromAudios(answerAudio);
|
|
53
54
|
}
|
|
55
|
+
isAudioLoading(attemptNumber) {
|
|
56
|
+
return this.collection.get(attemptNumber)?.audioLoading || false;
|
|
57
|
+
}
|
|
58
|
+
getAllAttempts() {
|
|
59
|
+
return this.collection.getAll();
|
|
60
|
+
}
|
|
61
|
+
reinitializePlayer() {
|
|
62
|
+
this.playerModel.reinitialize();
|
|
63
|
+
}
|
|
64
|
+
cleanup() {
|
|
65
|
+
this.playback.releaseResources();
|
|
66
|
+
this.collection.clear();
|
|
67
|
+
this.reset();
|
|
68
|
+
this.dropdown.reset();
|
|
69
|
+
this.translation.reset();
|
|
70
|
+
this.playerModel.release();
|
|
71
|
+
}
|
|
54
72
|
initializeCollectionFromAudios(audios) {
|
|
55
73
|
if (!audios) {
|
|
56
74
|
console.warn('VoicePlayerModel: audios is not provided');
|
|
@@ -70,149 +88,5 @@ export class VoicePlayerModel {
|
|
|
70
88
|
});
|
|
71
89
|
});
|
|
72
90
|
}
|
|
73
|
-
releaseCollectionResources() {
|
|
74
|
-
this.collection.getAll().forEach(item => {
|
|
75
|
-
if (item.controller) {
|
|
76
|
-
this.downloader.abortDownload(item.controller);
|
|
77
|
-
}
|
|
78
|
-
if (item.audioUri?.startsWith('blob:')) {
|
|
79
|
-
try {
|
|
80
|
-
URL.revokeObjectURL(item.audioUri);
|
|
81
|
-
} catch (e) {}
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
abortAllDownloads() {
|
|
86
|
-
this.collection.getAll().forEach(item => {
|
|
87
|
-
if (item.controller && item.audioLoading) {
|
|
88
|
-
this.downloader.abortDownload(item.controller);
|
|
89
|
-
this.collection.update(item.attemptNumber, {
|
|
90
|
-
audioLoading: false,
|
|
91
|
-
controller: undefined,
|
|
92
|
-
audioDownloadPromise: undefined
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
handlePlayAttempt = createEffect(async attemptNumber => {
|
|
98
|
-
this.shouldPreventPlayback = false;
|
|
99
|
-
const item = this.collection.get(attemptNumber);
|
|
100
|
-
if (!item) return;
|
|
101
|
-
if (this.currentPlayingAttempt !== null && this.currentPlayingAttempt !== attemptNumber) {
|
|
102
|
-
this.abortAllDownloads();
|
|
103
|
-
}
|
|
104
|
-
if (this.collection.hasAudio(attemptNumber)) {
|
|
105
|
-
this.playAudioFx(attemptNumber);
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
try {
|
|
109
|
-
this.playerModel.setPlayerState(PlayerState.LOADING);
|
|
110
|
-
const {
|
|
111
|
-
collectionItem,
|
|
112
|
-
downloadPromise
|
|
113
|
-
} = await this.downloader.download({
|
|
114
|
-
audioFileId: item.audioFileId,
|
|
115
|
-
attemptNumber
|
|
116
|
-
});
|
|
117
|
-
if (this.shouldPreventPlayback) {
|
|
118
|
-
collectionItem.controller?.abort();
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
this.collection.update(attemptNumber, collectionItem);
|
|
122
|
-
const result = await downloadPromise;
|
|
123
|
-
if (this.shouldPreventPlayback) {
|
|
124
|
-
if (result.uri?.startsWith('blob:')) {
|
|
125
|
-
URL.revokeObjectURL(result.uri);
|
|
126
|
-
}
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
this.collection.update(attemptNumber, {
|
|
130
|
-
audioUri: result.uri,
|
|
131
|
-
audioLoading: false,
|
|
132
|
-
audioError: undefined,
|
|
133
|
-
controller: undefined,
|
|
134
|
-
audioDownloadPromise: undefined
|
|
135
|
-
});
|
|
136
|
-
this.playerModel.setPlayerState(PlayerState.IDLE);
|
|
137
|
-
this.playAudioFx(attemptNumber);
|
|
138
|
-
} catch (error) {
|
|
139
|
-
console.error('Audio download error:', error);
|
|
140
|
-
if (error instanceof Error && error.name === 'AbortError') {
|
|
141
|
-
this.playerModel.setPlayerState(PlayerState.IDLE);
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
this.collection.update(attemptNumber, {
|
|
145
|
-
audioLoading: false,
|
|
146
|
-
audioError: error instanceof Error ? error.message : 'Failed to download audio',
|
|
147
|
-
controller: undefined,
|
|
148
|
-
audioDownloadPromise: undefined
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
playAudioFx = createEffect(async attemptNumber => {
|
|
153
|
-
if (this.shouldPreventPlayback) return;
|
|
154
|
-
const item = this.collection.get(attemptNumber);
|
|
155
|
-
if (!item?.audioUri) {
|
|
156
|
-
console.warn('No audio URI available for attempt:', attemptNumber);
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
try {
|
|
160
|
-
if (this.currentPlayingAttempt !== null && this.currentPlayingAttempt !== attemptNumber) {
|
|
161
|
-
this.playerModel.player?.remove();
|
|
162
|
-
}
|
|
163
|
-
if (this.currentPlayingAttempt === attemptNumber && this.playerModel.player?.playing) {
|
|
164
|
-
this.playerModel.pause();
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
if (this.currentPlayingAttempt === attemptNumber && !this.playerModel.player?.playing) {
|
|
168
|
-
this.playerModel.resume();
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
this.currentPlayingAttempt = attemptNumber;
|
|
172
|
-
this.setCurrentAttempt(attemptNumber);
|
|
173
|
-
await this.playerModel.play(item.audioUri);
|
|
174
|
-
} catch (error) {
|
|
175
|
-
console.error('Error playing audio:', error);
|
|
176
|
-
this.playerModel.setPlayerState(PlayerState.IDLE);
|
|
177
|
-
this.collection.update(attemptNumber, {
|
|
178
|
-
audioError: error instanceof Error ? error.message : 'Failed to play audio'
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
|
-
isAudioLoading(attemptNumber) {
|
|
183
|
-
return this.collection.get(attemptNumber)?.audioLoading || false;
|
|
184
|
-
}
|
|
185
|
-
getAllAttempts() {
|
|
186
|
-
return this.collection.getAll();
|
|
187
|
-
}
|
|
188
|
-
reinitializePlayer() {
|
|
189
|
-
this.playerModel.reinitialize();
|
|
190
|
-
}
|
|
191
|
-
cleanup() {
|
|
192
|
-
this.releaseCollectionResources();
|
|
193
|
-
this.collection.clear();
|
|
194
|
-
this.currentPlayingAttempt = null;
|
|
195
|
-
this.reset();
|
|
196
|
-
this.loader.reset();
|
|
197
|
-
this.dropdown.reset();
|
|
198
|
-
this.playerModel.release();
|
|
199
|
-
}
|
|
200
|
-
togglePlayPause = attach({
|
|
201
|
-
source: this.playerModel.$playerState,
|
|
202
|
-
mapParams: (attemptNumber, playerState) => ({
|
|
203
|
-
attemptNumber,
|
|
204
|
-
playerState
|
|
205
|
-
}),
|
|
206
|
-
effect: createEffect(({
|
|
207
|
-
attemptNumber,
|
|
208
|
-
playerState
|
|
209
|
-
}) => {
|
|
210
|
-
if (this.currentPlayingAttempt === attemptNumber && playerState === PlayerState.PLAYING) {
|
|
211
|
-
this.pauseAudio();
|
|
212
|
-
} else {
|
|
213
|
-
this.handlePlayAttempt(attemptNumber);
|
|
214
|
-
}
|
|
215
|
-
})
|
|
216
|
-
});
|
|
217
91
|
}
|
|
218
92
|
//# sourceMappingURL=VoicePlayer.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["createEvent","restore","TranscriptionsCollection","VoiceFileDownloaderModel","DropdownModel","TranslationModel","PlayerModel","TranscriptionsDownloaderModel","PlaybackController","VoicePlayerModel","collection","dropdown","playerModel","setCurrentAttempt","reset","$currentAttempt","$playerState","pauseAudio","pause","seekAudio","seek","constructor","params","api","downloader","loader","translation","playback","player","togglePlayPause","audios","initializeCollectionFromAudios","setupAudioMode","stopAudio","halt","preloadAudio","attemptNumber","target","getState","resetPlayer","releaseResources","clear","clearCache","initializeWithAudios","answerAudio","isAudioLoading","get","audioLoading","getAllAttempts","getAll","reinitializePlayer","reinitialize","cleanup","release","console","warn","forEach","audio","index","audioFileId","add","_id","hasDrawing","drawing"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/VoicePlayer.model.ts"],"mappings":"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","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RecordButtonVariant","VoiceTranscriptionVariant"],"sourceRoot":"../../../../src","sources":["features/voice/types.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["RecordButtonVariant","VoiceTranscriptionVariant"],"sourceRoot":"../../../../src","sources":["features/voice/types.ts"],"mappings":";;AA8FA,WAAYA,mBAAmB,0BAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAA,OAAnBA,mBAAmB;AAAA;AAK/B,WAAYC,yBAAyB,0BAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAA,OAAzBA,yBAAyB;AAAA","ignoreList":[]}
|
package/dist/module/index.js
CHANGED
|
@@ -16,4 +16,5 @@ export * from "./shared/icons/index.js";
|
|
|
16
16
|
export * from "./features/voice/index.js";
|
|
17
17
|
export * from "./features/featureUsage/index.js";
|
|
18
18
|
export * from "./features/uiMode/index.js";
|
|
19
|
+
export * from "./features/translation/index.js";
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
package/dist/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["generateRandomId"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,gBAAgB,QAAQ,0BAAuB;AACxD,cAAc,6BAAoB;AAClC,cAAc,8BAAqB;AACnC,cAAc,kCAAyB;AACvC,cAAc,qCAA4B;AAC1C,cAAc,kCAAyB;AACvC,cAAc,qCAA4B;AAC1C,cAAc,qCAA4B;AAC1C,cAAc,qCAA4B;AAC1C,cAAc,8BAAqB;AACnC,cAAc,gCAAuB;AACrC,cAAc,+BAAsB;AACpC,cAAc,yBAAgB;AAC9B,cAAc,2BAAkB;AAChC,cAAc,kCAAyB;AACvC,cAAc,4BAAmB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["generateRandomId"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,gBAAgB,QAAQ,0BAAuB;AACxD,cAAc,6BAAoB;AAClC,cAAc,8BAAqB;AACnC,cAAc,kCAAyB;AACvC,cAAc,qCAA4B;AAC1C,cAAc,kCAAyB;AACvC,cAAc,qCAA4B;AAC1C,cAAc,qCAA4B;AAC1C,cAAc,qCAA4B;AAC1C,cAAc,8BAAqB;AACnC,cAAc,gCAAuB;AACrC,cAAc,+BAAsB;AACpC,cAAc,yBAAgB;AAC9B,cAAc,2BAAkB;AAChC,cAAc,kCAAyB;AACvC,cAAc,4BAAmB;AACjC,cAAc,iCAAwB","ignoreList":[]}
|
|
@@ -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,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA4B;IACtD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAA;IAExB,OAAO,CAAC,oBAAoB,CAAsB;IAClD,OAAO,CAAC,cAAc,CAAsB;IAC5C,OAAO,CAAC,gBAAgB,CAAqE;gBAEjF,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,uBAAuB;IAYrE,OAAO,CAAC,iBAAiB;IAUzB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,cAAc;IAYf,SAAS,GAAU,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,SAC7C,CAAC,WACE,oBAAoB,KAC5B,OAAO,CAAC,CAAC,CAAC,CAgCZ;IAEM,kBAAkB,CAAC,CAAC,SAAS,MAAM,EACxC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,GAC9B,IAAI;IAUA,kBAAkB,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI;IAQ3D,kBAAkB,CAAC,CAAC,SAAS,MAAM,EACxC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EACf,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,GACjF,IAAI;IASA,SAAS,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAIlE,KAAK;CAGb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wordsToPreserve.d.ts","sourceRoot":"","sources":["../../../../../../src/features/translation/preserve/wordsToPreserve.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA4ElE,CAAA;AAOD,eAAO,MAAM,uBAAuB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAGrD,CAAA"}
|
|
@@ -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"}
|