@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
|
@@ -5,56 +5,74 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.VoicePlayerModel = void 0;
|
|
7
7
|
var _effector = require("effector");
|
|
8
|
-
var
|
|
8
|
+
var _TranscriptionsCollection = require("./TranscriptionsCollection.js");
|
|
9
9
|
var _VoiceFileDownloaderModel = require("./VoiceFileDownloader.model.js");
|
|
10
|
-
var
|
|
10
|
+
var _DropdownModel = require("./Dropdown.model.js");
|
|
11
|
+
var _TranslationModel = require("./Translation.model.js");
|
|
11
12
|
var _PlayerModel = require("./Player.model.js");
|
|
12
|
-
var _TranscriptionsDownloaderModel = require("./
|
|
13
|
+
var _TranscriptionsDownloaderModel = require("./TranscriptionsDownloader.model.js");
|
|
14
|
+
var _PlaybackController = require("./PlaybackController.js");
|
|
13
15
|
class VoicePlayerModel {
|
|
14
|
-
collection = new
|
|
15
|
-
|
|
16
|
-
dropdown = new _VoiceTranscriptionsDropdownModel.VoiceTranscriptionsDropdownModel();
|
|
16
|
+
collection = new _TranscriptionsCollection.TranscriptionsCollection();
|
|
17
|
+
dropdown = new _DropdownModel.DropdownModel();
|
|
17
18
|
playerModel = new _PlayerModel.PlayerModel();
|
|
18
|
-
currentPlayingAttempt = null;
|
|
19
|
-
shouldPreventPlayback = false;
|
|
20
19
|
setCurrentAttempt = (0, _effector.createEvent)();
|
|
21
20
|
reset = (0, _effector.createEvent)();
|
|
22
21
|
$currentAttempt = (0, _effector.restore)(this.setCurrentAttempt, null).reset(this.reset);
|
|
23
22
|
$playerState = this.playerModel.$playerState;
|
|
24
23
|
pauseAudio = this.playerModel.pause;
|
|
25
|
-
|
|
26
|
-
this.shouldPreventPlayback = true;
|
|
27
|
-
this.abortAllDownloads();
|
|
28
|
-
this.playerModel.stop();
|
|
29
|
-
this.currentPlayingAttempt = null;
|
|
30
|
-
this.setCurrentAttempt(null);
|
|
31
|
-
};
|
|
32
|
-
resetPlayer = () => {
|
|
33
|
-
this.shouldPreventPlayback = true;
|
|
34
|
-
this.releaseCollectionResources();
|
|
35
|
-
this.playerModel.stop();
|
|
36
|
-
this.currentPlayingAttempt = null;
|
|
37
|
-
this.setCurrentAttempt(null);
|
|
38
|
-
this.collection.clear();
|
|
39
|
-
};
|
|
24
|
+
seekAudio = this.playerModel.seek;
|
|
40
25
|
constructor(params) {
|
|
41
26
|
this.api = params.api;
|
|
27
|
+
this.downloader = new _VoiceFileDownloaderModel.VoiceFileDownloaderModel(params.api);
|
|
42
28
|
this.loader = new _TranscriptionsDownloaderModel.TranscriptionsDownloaderModel(this.collection, params.api);
|
|
43
|
-
this.
|
|
44
|
-
this.
|
|
45
|
-
this.
|
|
46
|
-
this.
|
|
29
|
+
this.translation = new _TranslationModel.TranslationModel(this.collection, params.api);
|
|
30
|
+
this.playback = new _PlaybackController.PlaybackController({
|
|
31
|
+
collection: this.collection,
|
|
32
|
+
player: this.playerModel,
|
|
33
|
+
downloader: this.downloader
|
|
47
34
|
});
|
|
35
|
+
this.togglePlayPause = this.playback.togglePlayPause;
|
|
48
36
|
if (params.audios) {
|
|
49
37
|
this.initializeCollectionFromAudios(params.audios);
|
|
50
38
|
}
|
|
51
39
|
this.playerModel.setupAudioMode();
|
|
52
40
|
}
|
|
41
|
+
stopAudio = () => {
|
|
42
|
+
this.playback.halt();
|
|
43
|
+
};
|
|
44
|
+
preloadAudio = attemptNumber => {
|
|
45
|
+
const target = attemptNumber ?? this.$currentAttempt.getState();
|
|
46
|
+
if (target === null) return;
|
|
47
|
+
return this.playback.preloadAudio(target);
|
|
48
|
+
};
|
|
49
|
+
resetPlayer = () => {
|
|
50
|
+
this.playback.releaseResources();
|
|
51
|
+
this.playback.halt();
|
|
52
|
+
this.collection.clear();
|
|
53
|
+
this.translation.clearCache();
|
|
54
|
+
};
|
|
53
55
|
initializeWithAudios(answerAudio) {
|
|
54
|
-
this.loader.setTranscriptsLoaded(false);
|
|
55
56
|
this.collection.clear();
|
|
56
57
|
this.initializeCollectionFromAudios(answerAudio);
|
|
57
58
|
}
|
|
59
|
+
isAudioLoading(attemptNumber) {
|
|
60
|
+
return this.collection.get(attemptNumber)?.audioLoading || false;
|
|
61
|
+
}
|
|
62
|
+
getAllAttempts() {
|
|
63
|
+
return this.collection.getAll();
|
|
64
|
+
}
|
|
65
|
+
reinitializePlayer() {
|
|
66
|
+
this.playerModel.reinitialize();
|
|
67
|
+
}
|
|
68
|
+
cleanup() {
|
|
69
|
+
this.playback.releaseResources();
|
|
70
|
+
this.collection.clear();
|
|
71
|
+
this.reset();
|
|
72
|
+
this.dropdown.reset();
|
|
73
|
+
this.translation.reset();
|
|
74
|
+
this.playerModel.release();
|
|
75
|
+
}
|
|
58
76
|
initializeCollectionFromAudios(audios) {
|
|
59
77
|
if (!audios) {
|
|
60
78
|
console.warn('VoicePlayerModel: audios is not provided');
|
|
@@ -74,150 +92,6 @@ class VoicePlayerModel {
|
|
|
74
92
|
});
|
|
75
93
|
});
|
|
76
94
|
}
|
|
77
|
-
releaseCollectionResources() {
|
|
78
|
-
this.collection.getAll().forEach(item => {
|
|
79
|
-
if (item.controller) {
|
|
80
|
-
this.downloader.abortDownload(item.controller);
|
|
81
|
-
}
|
|
82
|
-
if (item.audioUri?.startsWith('blob:')) {
|
|
83
|
-
try {
|
|
84
|
-
URL.revokeObjectURL(item.audioUri);
|
|
85
|
-
} catch (e) {}
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
abortAllDownloads() {
|
|
90
|
-
this.collection.getAll().forEach(item => {
|
|
91
|
-
if (item.controller && item.audioLoading) {
|
|
92
|
-
this.downloader.abortDownload(item.controller);
|
|
93
|
-
this.collection.update(item.attemptNumber, {
|
|
94
|
-
audioLoading: false,
|
|
95
|
-
controller: undefined,
|
|
96
|
-
audioDownloadPromise: undefined
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
handlePlayAttempt = (0, _effector.createEffect)(async attemptNumber => {
|
|
102
|
-
this.shouldPreventPlayback = false;
|
|
103
|
-
const item = this.collection.get(attemptNumber);
|
|
104
|
-
if (!item) return;
|
|
105
|
-
if (this.currentPlayingAttempt !== null && this.currentPlayingAttempt !== attemptNumber) {
|
|
106
|
-
this.abortAllDownloads();
|
|
107
|
-
}
|
|
108
|
-
if (this.collection.hasAudio(attemptNumber)) {
|
|
109
|
-
this.playAudioFx(attemptNumber);
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
try {
|
|
113
|
-
this.playerModel.setPlayerState(_PlayerModel.PlayerState.LOADING);
|
|
114
|
-
const {
|
|
115
|
-
collectionItem,
|
|
116
|
-
downloadPromise
|
|
117
|
-
} = await this.downloader.download({
|
|
118
|
-
audioFileId: item.audioFileId,
|
|
119
|
-
attemptNumber
|
|
120
|
-
});
|
|
121
|
-
if (this.shouldPreventPlayback) {
|
|
122
|
-
collectionItem.controller?.abort();
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
this.collection.update(attemptNumber, collectionItem);
|
|
126
|
-
const result = await downloadPromise;
|
|
127
|
-
if (this.shouldPreventPlayback) {
|
|
128
|
-
if (result.uri?.startsWith('blob:')) {
|
|
129
|
-
URL.revokeObjectURL(result.uri);
|
|
130
|
-
}
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
this.collection.update(attemptNumber, {
|
|
134
|
-
audioUri: result.uri,
|
|
135
|
-
audioLoading: false,
|
|
136
|
-
audioError: undefined,
|
|
137
|
-
controller: undefined,
|
|
138
|
-
audioDownloadPromise: undefined
|
|
139
|
-
});
|
|
140
|
-
this.playerModel.setPlayerState(_PlayerModel.PlayerState.IDLE);
|
|
141
|
-
this.playAudioFx(attemptNumber);
|
|
142
|
-
} catch (error) {
|
|
143
|
-
console.error('Audio download error:', error);
|
|
144
|
-
if (error instanceof Error && error.name === 'AbortError') {
|
|
145
|
-
this.playerModel.setPlayerState(_PlayerModel.PlayerState.IDLE);
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
this.collection.update(attemptNumber, {
|
|
149
|
-
audioLoading: false,
|
|
150
|
-
audioError: error instanceof Error ? error.message : 'Failed to download audio',
|
|
151
|
-
controller: undefined,
|
|
152
|
-
audioDownloadPromise: undefined
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
playAudioFx = (0, _effector.createEffect)(async attemptNumber => {
|
|
157
|
-
if (this.shouldPreventPlayback) return;
|
|
158
|
-
const item = this.collection.get(attemptNumber);
|
|
159
|
-
if (!item?.audioUri) {
|
|
160
|
-
console.warn('No audio URI available for attempt:', attemptNumber);
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
try {
|
|
164
|
-
if (this.currentPlayingAttempt !== null && this.currentPlayingAttempt !== attemptNumber) {
|
|
165
|
-
this.playerModel.player?.remove();
|
|
166
|
-
}
|
|
167
|
-
if (this.currentPlayingAttempt === attemptNumber && this.playerModel.player?.playing) {
|
|
168
|
-
this.playerModel.pause();
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
if (this.currentPlayingAttempt === attemptNumber && !this.playerModel.player?.playing) {
|
|
172
|
-
this.playerModel.resume();
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
this.currentPlayingAttempt = attemptNumber;
|
|
176
|
-
this.setCurrentAttempt(attemptNumber);
|
|
177
|
-
await this.playerModel.play(item.audioUri);
|
|
178
|
-
} catch (error) {
|
|
179
|
-
console.error('Error playing audio:', error);
|
|
180
|
-
this.playerModel.setPlayerState(_PlayerModel.PlayerState.IDLE);
|
|
181
|
-
this.collection.update(attemptNumber, {
|
|
182
|
-
audioError: error instanceof Error ? error.message : 'Failed to play audio'
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
isAudioLoading(attemptNumber) {
|
|
187
|
-
return this.collection.get(attemptNumber)?.audioLoading || false;
|
|
188
|
-
}
|
|
189
|
-
getAllAttempts() {
|
|
190
|
-
return this.collection.getAll();
|
|
191
|
-
}
|
|
192
|
-
reinitializePlayer() {
|
|
193
|
-
this.playerModel.reinitialize();
|
|
194
|
-
}
|
|
195
|
-
cleanup() {
|
|
196
|
-
this.releaseCollectionResources();
|
|
197
|
-
this.collection.clear();
|
|
198
|
-
this.currentPlayingAttempt = null;
|
|
199
|
-
this.reset();
|
|
200
|
-
this.loader.reset();
|
|
201
|
-
this.dropdown.reset();
|
|
202
|
-
this.playerModel.release();
|
|
203
|
-
}
|
|
204
|
-
togglePlayPause = (0, _effector.attach)({
|
|
205
|
-
source: this.playerModel.$playerState,
|
|
206
|
-
mapParams: (attemptNumber, playerState) => ({
|
|
207
|
-
attemptNumber,
|
|
208
|
-
playerState
|
|
209
|
-
}),
|
|
210
|
-
effect: (0, _effector.createEffect)(({
|
|
211
|
-
attemptNumber,
|
|
212
|
-
playerState
|
|
213
|
-
}) => {
|
|
214
|
-
if (this.currentPlayingAttempt === attemptNumber && playerState === _PlayerModel.PlayerState.PLAYING) {
|
|
215
|
-
this.pauseAudio();
|
|
216
|
-
} else {
|
|
217
|
-
this.handlePlayAttempt(attemptNumber);
|
|
218
|
-
}
|
|
219
|
-
})
|
|
220
|
-
});
|
|
221
95
|
}
|
|
222
96
|
exports.VoicePlayerModel = VoicePlayerModel;
|
|
223
97
|
//# sourceMappingURL=VoicePlayer.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_effector","require","
|
|
1
|
+
{"version":3,"names":["_effector","require","_TranscriptionsCollection","_VoiceFileDownloaderModel","_DropdownModel","_TranslationModel","_PlayerModel","_TranscriptionsDownloaderModel","_PlaybackController","VoicePlayerModel","collection","TranscriptionsCollection","dropdown","DropdownModel","playerModel","PlayerModel","setCurrentAttempt","createEvent","reset","$currentAttempt","restore","$playerState","pauseAudio","pause","seekAudio","seek","constructor","params","api","downloader","VoiceFileDownloaderModel","loader","TranscriptionsDownloaderModel","translation","TranslationModel","playback","PlaybackController","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","exports"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/VoicePlayer.model.ts"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,yBAAA,GAAAD,OAAA;AACA,IAAAE,yBAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AAEA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,8BAAA,GAAAN,OAAA;AACA,IAAAO,mBAAA,GAAAP,OAAA;AAOO,MAAMQ,gBAAgB,CAAC;EACZC,UAAU,GAAG,IAAIC,kDAAwB,CAAC,CAAC;EAC3CC,QAAQ,GAAG,IAAIC,4BAAa,CAAC,CAAC;EAC9BC,WAAW,GAAG,IAAIC,wBAAW,CAAC,CAAC;EAO/BC,iBAAiB,GAAG,IAAAC,qBAAW,EAAgB,CAAC;EAChDC,KAAK,GAAG,IAAAD,qBAAW,EAAC,CAAC;EAErBE,eAAe,GAAG,IAAAC,iBAAO,EAAC,IAAI,CAACJ,iBAAiB,EAAE,IAAI,CAAC,CAACE,KAAK,CAAC,IAAI,CAACA,KAAK,CAAC;EACzEG,YAAY,GAAG,IAAI,CAACP,WAAW,CAACO,YAAY;EAE5CC,UAAU,GAAG,IAAI,CAACR,WAAW,CAACS,KAAK;EACnCC,SAAS,GAAG,IAAI,CAACV,WAAW,CAACW,IAAI;EAIjDC,WAAWA,CAACC,MAA8B,EAAE;IAC1C,IAAI,CAACC,GAAG,GAAGD,MAAM,CAACC,GAAG;IACrB,IAAI,CAACC,UAAU,GAAG,IAAIC,kDAAwB,CAACH,MAAM,CAACC,GAAG,CAAC;IAC1D,IAAI,CAACG,MAAM,G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AAK,CAACM;MACtB,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ;AACF;AAACC,OAAA,CAAAhE,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RecordButtonVariant","exports","VoiceTranscriptionVariant"],"sourceRoot":"../../../../src","sources":["features/voice/types.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"names":["RecordButtonVariant","exports","VoiceTranscriptionVariant"],"sourceRoot":"../../../../src","sources":["features/voice/types.ts"],"mappings":";;;;;;IA8FYA,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,0BAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAA,OAAnBA,mBAAmB;AAAA;AAAA,IAKnBE,yBAAyB,GAAAD,OAAA,CAAAC,yBAAA,0BAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAzBA,yBAAyB;EAAA,OAAzBA,yBAAyB;AAAA","ignoreList":[]}
|
package/dist/commonjs/index.js
CHANGED
|
@@ -193,4 +193,16 @@ Object.keys(_index15).forEach(function (key) {
|
|
|
193
193
|
}
|
|
194
194
|
});
|
|
195
195
|
});
|
|
196
|
+
var _index16 = require("./features/translation/index.js");
|
|
197
|
+
Object.keys(_index16).forEach(function (key) {
|
|
198
|
+
if (key === "default" || key === "__esModule") return;
|
|
199
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
200
|
+
if (key in exports && exports[key] === _index16[key]) return;
|
|
201
|
+
Object.defineProperty(exports, key, {
|
|
202
|
+
enumerable: true,
|
|
203
|
+
get: function () {
|
|
204
|
+
return _index16[key];
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
});
|
|
196
208
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_helpers","require","_index","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_index2","_index3","_index4","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CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAqB,QAAA,CAAArB,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAa,QAAA,CAAArB,GAAA;IAAA;EAAA;AAAA;AACA,IAAAsB,QAAA,GAAA3B,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAwB,QAAA,EAAAvB,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAsB,QAAA,CAAAtB,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAc,QAAA,CAAAtB,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_helpers","require","_index","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_index2","_index3","_index4","_index5","_index6","_index7","_index8","_index9","_index10","_index11","_index12","_index13","_index14","_index15","_index16"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAF,MAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA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OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAsB,QAAA,CAAAtB,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAc,QAAA,CAAAtB,GAAA;IAAA;EAAA;AAAA;AACA,IAAAuB,QAAA,GAAA5B,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAyB,QAAA,EAAAxB,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAuB,QAAA,CAAAvB,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAe,QAAA,CAAAvB,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export const GBD_TEXT_CACHE_SUFFIX = '::gbd';
|
|
4
|
+
export const DESCRIPTION_CACHE_KEY_SUFFIX = '::description';
|
|
5
|
+
export const CHOICES_CACHE_KEY_SUFFIX = '::choices';
|
|
6
|
+
export const PRACTICE_THEORY_CACHE_KEY_SUFFIX = '::practice-theory';
|
|
7
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["GBD_TEXT_CACHE_SUFFIX","DESCRIPTION_CACHE_KEY_SUFFIX","CHOICES_CACHE_KEY_SUFFIX","PRACTICE_THEORY_CACHE_KEY_SUFFIX"],"sourceRoot":"../../../../src","sources":["features/translation/constants.ts"],"mappings":";;AAAA,OAAO,MAAMA,qBAAqB,GAAG,OAAO;AAC5C,OAAO,MAAMC,4BAA4B,GAAG,eAAe;AAC3D,OAAO,MAAMC,wBAAwB,GAAG,WAAW;AACnD,OAAO,MAAMC,gCAAgC,GAAG,mBAAmB","ignoreList":[]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export function replaceMappedTokens(input, map) {
|
|
4
|
+
let result = input;
|
|
5
|
+
for (const [original, override] of Object.entries(map)) {
|
|
6
|
+
const escaped = original.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
7
|
+
const regex = new RegExp(`\\b${escaped}\\b`, 'gi');
|
|
8
|
+
result = result.replace(regex, override);
|
|
9
|
+
}
|
|
10
|
+
return result;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Masks text segments matched by `regex` with a placeholder,
|
|
15
|
+
* while preserving spaces around the original match.
|
|
16
|
+
*/
|
|
17
|
+
export const maskSegment = ({
|
|
18
|
+
text,
|
|
19
|
+
regex,
|
|
20
|
+
placeholder,
|
|
21
|
+
replacements,
|
|
22
|
+
shouldSkip
|
|
23
|
+
}) => {
|
|
24
|
+
return text.replace(regex, (match, ...args) => {
|
|
25
|
+
if (shouldSkip?.(match)) return match;
|
|
26
|
+
const offset = args[args.length - 2];
|
|
27
|
+
const input = args[args.length - 1];
|
|
28
|
+
const before = offset > 0 ? input[offset - 1] : '';
|
|
29
|
+
const afterIdx = offset + match.length;
|
|
30
|
+
const after = afterIdx < input.length ? input[afterIdx] : '';
|
|
31
|
+
const leftPad = /\s/.test(before);
|
|
32
|
+
const rightPad = /\s/.test(after);
|
|
33
|
+
replacements.push({
|
|
34
|
+
placeholder,
|
|
35
|
+
original: match,
|
|
36
|
+
leftPad,
|
|
37
|
+
rightPad
|
|
38
|
+
});
|
|
39
|
+
return placeholder;
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
const HTML_NAMED_ENTITIES = {
|
|
43
|
+
'&': '&',
|
|
44
|
+
'<': '<',
|
|
45
|
+
'>': '>',
|
|
46
|
+
'"': '"',
|
|
47
|
+
''': "'",
|
|
48
|
+
' ': ' '
|
|
49
|
+
};
|
|
50
|
+
export const decodeHtmlEntities = text => {
|
|
51
|
+
return text.replace(/&#(\d+);/g, (_, code) => String.fromCharCode(parseInt(code, 10))).replace(/&#x([0-9a-f]+);/gi, (_, code) => String.fromCharCode(parseInt(code, 16))).replace(/&(amp|lt|gt|quot|apos|nbsp);/g, match => HTML_NAMED_ENTITIES[match] ?? match);
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["replaceMappedTokens","input","map","result","original","override","Object","entries","escaped","replace","regex","RegExp","maskSegment","text","placeholder","replacements","shouldSkip","match","args","offset","length","before","afterIdx","after","leftPad","test","rightPad","push","HTML_NAMED_ENTITIES","decodeHtmlEntities","_","code","String","fromCharCode","parseInt"],"sourceRoot":"../../../../src","sources":["features/translation/helpers.ts"],"mappings":";;AAEA,OAAO,SAASA,mBAAmBA,CAACC,KAAa,EAAEC,GAA2B,EAAU;EACtF,IAAIC,MAAM,GAAGF,KAAK;EAElB,KAAK,MAAM,CAACG,QAAQ,EAAEC,QAAQ,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACL,GAAG,CAAC,EAAE;IACtD,MAAMM,OAAO,GAAGJ,QAAQ,CAACK,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC;IAC/D,MAAMC,KAAK,GAAG,IAAIC,MAAM,CAAC,MAAMH,OAAO,KAAK,EAAE,IAAI,CAAC;IAElDL,MAAM,GAAGA,MAAM,CAACM,OAAO,CAACC,KAAK,EAAEL,QAAQ,CAAC;EAC1C;EAE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Aa;EAC1D,OAAOA,IAAI,CACRJ,OAAO,CAAC,WAAW,EAAE,CAACqB,CAAC,EAAEC,IAAY,KAAKC,MAAM,CAACC,YAAY,CAACC,QAAQ,CAACH,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAClFtB,OAAO,CAAC,mBAAmB,EAAE,CAACqB,CAAC,EAAEC,IAAY,KAAKC,MAAM,CAACC,YAAY,CAACC,QAAQ,CAACH,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAC1FtB,OAAO,CACN,+BAA+B,EAC9BQ,KAAK,IAAKW,mBAAmB,CAACX,KAAK,CAAC,IAAIA,KAC3C,CAAC;AACL,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export { TranslationModel } from "./model/TranslationModel.js";
|
|
4
|
+
export { TranslationService } from "./model/TranslationService.js";
|
|
5
|
+
export { TranslationKatexPreprocessor } from "./model/TranslationPreprocessor.js";
|
|
6
|
+
export { TranslationProvider } from "./providers/translation.interface.js";
|
|
7
|
+
export { GoogleTranslationProvider } from "./providers/google/GoogleTranslationProvider.js";
|
|
8
|
+
export { GoogleTranslateLanguage } from "./providers/google/supportedLanguages.js";
|
|
9
|
+
export { wordsToPreserve, preservedWordsReplacers } from "./preserve/wordsToPreserve.js";
|
|
10
|
+
export { GBD_TEXT_CACHE_SUFFIX, DESCRIPTION_CACHE_KEY_SUFFIX, CHOICES_CACHE_KEY_SUFFIX, PRACTICE_THEORY_CACHE_KEY_SUFFIX } from "./constants.js";
|
|
11
|
+
export { replaceMappedTokens, maskSegment, decodeHtmlEntities } from "./helpers.js";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TranslationModel","TranslationService","TranslationKatexPreprocessor","TranslationProvider","GoogleTranslationProvider","GoogleTranslateLanguage","wordsToPreserve","preservedWordsReplacers","GBD_TEXT_CACHE_SUFFIX","DESCRIPTION_CACHE_KEY_SUFFIX","CHOICES_CACHE_KEY_SUFFIX","PRACTICE_THEORY_CACHE_KEY_SUFFIX","replaceMappedTokens","maskSegment","decodeHtmlEntities"],"sourceRoot":"../../../../src","sources":["features/translation/index.ts"],"mappings":";;AAAA,SAASA,gBAAgB,QAAQ,6BAA0B;AAC3D,SAASC,kBAAkB,QAAmC,+BAA4B;AAC1F,SAASC,4BAA4B,QAAQ,oCAAiC;AAC9E,SAASC,mBAAmB,QAA+B,sCAAmC;AAC9F,SAASC,yBAAyB,QAAQ,iDAA8C;AACxF,SAASC,uBAAuB,QAAQ,0CAAuC;AAM/E,SAASC,eAAe,EAAEC,uBAAuB,QAAQ,+BAA4B;AACrF,SACEC,qBAAqB,EACrBC,4BAA4B,EAC5BC,wBAAwB,EACxBC,gCAAgC,QAC3B,gBAAa;AACpB,SACEC,mBAAmB,EACnBC,WAAW,EACXC,kBAAkB,QACb,cAAW","ignoreList":[]}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { attach, combine, createEffect, createEvent, restore, sample, split } from 'effector';
|
|
4
|
+
import { GoogleTranslationProvider } from "../providers/google/GoogleTranslationProvider.js";
|
|
5
|
+
import { TranslationService } from "./TranslationService.js";
|
|
6
|
+
import { preservedWordsReplacers, wordsToPreserve } from "../preserve/wordsToPreserve.js";
|
|
7
|
+
import { CHOICES_CACHE_KEY_SUFFIX, DESCRIPTION_CACHE_KEY_SUFFIX, GBD_TEXT_CACHE_SUFFIX } from "../constants.js";
|
|
8
|
+
export class TranslationModel {
|
|
9
|
+
toggle = createEvent();
|
|
10
|
+
setTranslated = createEvent();
|
|
11
|
+
reset = createEvent();
|
|
12
|
+
$isTranslationActive = restore(this.setTranslated, false).reset(this.reset);
|
|
13
|
+
$isTranslated = this.$isTranslationActive;
|
|
14
|
+
constructor({
|
|
15
|
+
$problem,
|
|
16
|
+
$problemId,
|
|
17
|
+
$assignmentId,
|
|
18
|
+
$currentProblemIndex,
|
|
19
|
+
$translationLanguageCode,
|
|
20
|
+
$contentLanguageCode,
|
|
21
|
+
$isTranslationLocked,
|
|
22
|
+
languageChanged,
|
|
23
|
+
api,
|
|
24
|
+
getGreatWorkFeedbackText
|
|
25
|
+
}) {
|
|
26
|
+
this.service = new TranslationService({
|
|
27
|
+
preserve: {
|
|
28
|
+
map: wordsToPreserve,
|
|
29
|
+
replacers: preservedWordsReplacers
|
|
30
|
+
},
|
|
31
|
+
providers: [new GoogleTranslationProvider({
|
|
32
|
+
api
|
|
33
|
+
})],
|
|
34
|
+
onError: () => this.reset()
|
|
35
|
+
});
|
|
36
|
+
this.service.bindCustomCacheKey($problemId, (problemId, {
|
|
37
|
+
target
|
|
38
|
+
}) => `${problemId}::${target}`);
|
|
39
|
+
this.service.bindTargetLanguage($translationLanguageCode);
|
|
40
|
+
if ($contentLanguageCode) {
|
|
41
|
+
this.service.bindSourceLanguage($contentLanguageCode);
|
|
42
|
+
}
|
|
43
|
+
this.translateAllFx = attach({
|
|
44
|
+
source: {
|
|
45
|
+
problem: $problem,
|
|
46
|
+
translationLanguageCode: $translationLanguageCode
|
|
47
|
+
},
|
|
48
|
+
mapParams: (_, source) => source,
|
|
49
|
+
effect: createEffect(({
|
|
50
|
+
problem,
|
|
51
|
+
translationLanguageCode
|
|
52
|
+
}) => {
|
|
53
|
+
if (!problem) return;
|
|
54
|
+
const promises = [this.service.translate(problem.richDescription || problem.description, {
|
|
55
|
+
cacheKeySuffix: DESCRIPTION_CACHE_KEY_SUFFIX
|
|
56
|
+
}), this.service.translate(problem.answerVariants, {
|
|
57
|
+
cacheKeySuffix: CHOICES_CACHE_KEY_SUFFIX
|
|
58
|
+
})];
|
|
59
|
+
if (getGreatWorkFeedbackText) {
|
|
60
|
+
promises.push(this.service.translate(getGreatWorkFeedbackText(), {
|
|
61
|
+
cacheKey: `${translationLanguageCode}${GBD_TEXT_CACHE_SUFFIX}`
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
return Promise.all(promises);
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
this.translateFx = createEffect(({
|
|
68
|
+
cacheKey,
|
|
69
|
+
text
|
|
70
|
+
}) => {
|
|
71
|
+
return this.service.translate(text, {
|
|
72
|
+
cacheKey
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
this.$isTranslationActive.on(this.translateAllFx.doneData, () => true);
|
|
76
|
+
this.$isTranslationActive.on(this.translateAllFx.fail, () => false);
|
|
77
|
+
split({
|
|
78
|
+
source: sample({
|
|
79
|
+
clock: this.toggle,
|
|
80
|
+
source: this.$isTranslationActive
|
|
81
|
+
}),
|
|
82
|
+
match: {
|
|
83
|
+
on: isTranslated => !isTranslated,
|
|
84
|
+
off: isTranslated => isTranslated
|
|
85
|
+
},
|
|
86
|
+
cases: {
|
|
87
|
+
on: this.translateAllFx,
|
|
88
|
+
off: this.reset
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
sample({
|
|
92
|
+
clock: languageChanged,
|
|
93
|
+
fn: () => false,
|
|
94
|
+
target: this.setTranslated
|
|
95
|
+
});
|
|
96
|
+
sample({
|
|
97
|
+
clock: [$currentProblemIndex, $assignmentId, this.$isTranslationActive],
|
|
98
|
+
source: {
|
|
99
|
+
isTranslated: this.$isTranslationActive,
|
|
100
|
+
isLocked: $isTranslationLocked
|
|
101
|
+
},
|
|
102
|
+
filter: ({
|
|
103
|
+
isTranslated,
|
|
104
|
+
isLocked
|
|
105
|
+
}) => isLocked || isTranslated,
|
|
106
|
+
target: this.translateAllFx
|
|
107
|
+
});
|
|
108
|
+
this.$isTranslationPending = combine(this.translateAllFx.pending, this.translateFx.pending, (isAllPending, isOnePending) => isAllPending || isOnePending);
|
|
109
|
+
}
|
|
110
|
+
getTranslated(key) {
|
|
111
|
+
return this.service.getCached(key);
|
|
112
|
+
}
|
|
113
|
+
clearCache() {
|
|
114
|
+
this.service.reset();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=TranslationModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["attach","combine","createEffect","createEvent","restore","sample","split","GoogleTranslationProvider","TranslationService","preservedWordsReplacers","wordsToPreserve","CHOICES_CACHE_KEY_SUFFIX","DESCRIPTION_CACHE_KEY_SUFFIX","GBD_TEXT_CACHE_SUFFIX","TranslationModel","toggle","setTranslated","reset","$isTranslationActive","$isTranslated","constructor","$problem","$problemId","$assignmentId","$currentProblemIndex","$translationLanguageCode","$contentLanguageCode","$isTranslationLocked","languageChanged","api","getGreatWorkFeedbackText","service","preserve","map","replacers","providers","onError","bindCustomCacheKey","problemId","target","bindTargetLanguage","bindSourceLanguage","translateAllFx","source","problem","translationLanguageCode","mapParams","_","effect","promises","translate","richDescription","description","cacheKeySuffix","answerVariants","push","cacheKey","Promise","all","translateFx","text","on","doneData","fail","clock","match","isTranslated","off","cases","fn","isLocked","filter","$isTranslationPending","pending","isAllPending","isOnePending","getTranslated","key","getCached","clearCache"],"sourceRoot":"../../../../../src","sources":["features/translation/model/TranslationModel.ts"],"mappings":";;AAAA,SACEA,MAAM,EACNC,OAAO,EACPC,YAAY,EACZC,WAAW,EACXC,OAAO,EACPC,MAAM,EACNC,KAAK,QAGA,UAAU;AACjB,SAASC,yBAAyB,QAAQ,kDAA+C;AAKzF,SAASC,kBAAkB,QAAQ,yBAAsB;AACzD,SACEC,uBAAuB,EACvBC,eAAe,QACV,gCAA6B;AACpC,SACEC,wBAAwB,EACxBC,4BAA4B,EAC5BC,qBAAqB,QAChB,iBAAc;AAsBrB,OAAO,MAAMC,gBAAgB,CAA6D;EAGxEC,MAAM,GAAGZ,WAAW,CAAC,CAAC;EACtBa,aAAa,GAAGb,WAAW,CAAU,CAAC;EACtCc,KAAK,GAAGd,WAAW,CAAC,CAAC;EAErBe,oBAAoB,GAAGd,OAAO,CAAC,IAAI,CAACY,aAAa,EAAE,KAAK,CAAC,CAACC,KAAK,CAAC,IAAI,CAAC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