@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
|
@@ -3,8 +3,9 @@ export * from './recording/model/VoiceRecord.model';
|
|
|
3
3
|
export * from './recording/modal/VoiceRecordDeleteModal';
|
|
4
4
|
export * from './recording/modal/VoiceRecordUndoModal';
|
|
5
5
|
export * from './playing/model/VoicePlayer.model';
|
|
6
|
-
export * from './playing/components/
|
|
6
|
+
export * from './playing/components/VoiceTranscription';
|
|
7
7
|
export * from './playing/components/VoiceIcon';
|
|
8
8
|
export * from './constants';
|
|
9
9
|
export * from './types';
|
|
10
|
+
export type { WithAbortSignal } from '../../types/common.types';
|
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/voice/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAA;AAClD,cAAc,qCAAqC,CAAA;AACnD,cAAc,0CAA0C,CAAA;AACxD,cAAc,wCAAwC,CAAA;AAEtD,cAAc,mCAAmC,CAAA;AACjD,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/voice/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAA;AAClD,cAAc,qCAAqC,CAAA;AACnD,cAAc,0CAA0C,CAAA;AACxD,cAAc,wCAAwC,CAAA;AAEtD,cAAc,mCAAmC,CAAA;AACjD,cAAc,yCAAyC,CAAA;AAEvD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type VoiceTranscriptContentProps = {
|
|
3
|
+
text: string;
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const VoiceTranscriptContent: ({ text, isLoading }: VoiceTranscriptContentProps) => React.JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=VoiceTranscriptContent.d.ts.map
|
package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptContent.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoiceTranscriptContent.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/components/VoiceTranscriptContent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,KAAK,2BAA2B,GAAG;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,sBAAsB,wBAAyB,2BAA2B,sBActF,CAAA"}
|
|
@@ -2,16 +2,15 @@ import React from 'react';
|
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
import { AnswerAudio, VoiceTranscriptionVariant } from '../../types';
|
|
4
4
|
import { VoicePlayerModel } from '../model';
|
|
5
|
-
type
|
|
5
|
+
type VoiceTranscriptionProps = {
|
|
6
6
|
style?: StyleProp<ViewStyle>;
|
|
7
7
|
model: VoicePlayerModel;
|
|
8
8
|
answers: AnswerAudio[];
|
|
9
9
|
attemptOffset: number;
|
|
10
|
-
onAttemptOffsetChange: (offset: number) => void;
|
|
11
10
|
attemptsCount: number;
|
|
12
11
|
problemId: string;
|
|
13
12
|
variant?: VoiceTranscriptionVariant;
|
|
14
13
|
};
|
|
15
|
-
export declare const
|
|
14
|
+
export declare const VoiceTranscription: ({ style, model, answers, attemptOffset, attemptsCount, problemId, variant, }: VoiceTranscriptionProps) => React.JSX.Element;
|
|
16
15
|
export {};
|
|
17
|
-
//# sourceMappingURL=
|
|
16
|
+
//# sourceMappingURL=VoiceTranscription.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoiceTranscription.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/components/VoiceTranscription.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAoB,SAAS,EAAE,MAAM,cAAc,CAAA;AAErE,OAAO,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAGpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAK3C,KAAK,uBAAuB,GAAG;IAC7B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAC5B,KAAK,EAAE,gBAAgB,CAAA;IACvB,OAAO,EAAE,WAAW,EAAE,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,yBAAyB,CAAA;CACpC,CAAA;AAED,eAAO,MAAM,kBAAkB,iFAQ5B,uBAAuB,sBA6CzB,CAAA"}
|
package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DropdownModel } from '../model/Dropdown.model';
|
|
3
|
+
type VoiceTranscriptionCollapsibleProps = {
|
|
4
|
+
text: string;
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
dropdown: DropdownModel;
|
|
7
|
+
};
|
|
8
|
+
export declare const VoiceTranscriptionCollapsible: ({ text, isLoading, dropdown, }: VoiceTranscriptionCollapsibleProps) => React.JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=VoiceTranscriptionCollapsible.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoiceTranscriptionCollapsible.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/components/VoiceTranscriptionCollapsible.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsB,MAAM,OAAO,CAAA;AAI1C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAKvD,KAAK,kCAAkC,GAAG;IACxC,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,aAAa,CAAA;CACxB,CAAA;AAED,eAAO,MAAM,6BAA6B,mCAIvC,kCAAkC,sBAuBpC,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PlayerState } from '../model';
|
|
3
|
+
type VoiceTranscriptionsHeaderActionsProps = {
|
|
4
|
+
playerState: PlayerState;
|
|
5
|
+
isTranslationActive: boolean;
|
|
6
|
+
canTranslate: boolean;
|
|
7
|
+
onPlayPress: () => void;
|
|
8
|
+
onTranslationPress: () => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const VoiceTranscriptionHeaderActions: ({ playerState, isTranslationActive, canTranslate, onPlayPress, onTranslationPress, }: VoiceTranscriptionsHeaderActionsProps) => React.JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=VoiceTranscriptionHeaderActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoiceTranscriptionHeaderActions.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/components/VoiceTranscriptionHeaderActions.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAGtC,KAAK,qCAAqC,GAAG;IAC3C,WAAW,EAAE,WAAW,CAAA;IACxB,mBAAmB,EAAE,OAAO,CAAA;IAC5B,YAAY,EAAE,OAAO,CAAA;IACrB,WAAW,EAAE,MAAM,IAAI,CAAA;IACvB,kBAAkB,EAAE,MAAM,IAAI,CAAA;CAC/B,CAAA;AAED,eAAO,MAAM,+BAA+B,yFAMzC,qCAAqC,sBA2BvC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DropdownModel } from '../model/Dropdown.model';
|
|
2
2
|
import { LayoutChangeEvent } from 'react-native';
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const useDropdownAnimation: (model: DropdownModel) => {
|
|
4
4
|
isExpanded: boolean;
|
|
5
5
|
listAnimatedStyle: {
|
|
6
6
|
height: number;
|
|
@@ -13,4 +13,4 @@ export declare const useVoiceTranscriptionsDropdown: (model: VoiceTranscriptions
|
|
|
13
13
|
};
|
|
14
14
|
onListLayout: (event: LayoutChangeEvent) => void;
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=
|
|
16
|
+
//# sourceMappingURL=useDropdownAnimation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDropdownAnimation.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/hooks/useDropdownAnimation.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEhD,eAAO,MAAM,oBAAoB,UAAW,aAAa;;;;;;;;;;;0BAM1B,iBAAiB;CAwC/C,CAAA"}
|
package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { AnswerAudio } from '../../types';
|
|
2
|
+
import { VoicePlayerModel } from '../model';
|
|
3
|
+
import { PlayerState } from '../model/Player.model';
|
|
4
|
+
type Params = {
|
|
5
|
+
model: VoicePlayerModel;
|
|
6
|
+
answers: AnswerAudio[];
|
|
7
|
+
attemptOffset: number;
|
|
8
|
+
attemptsCount: number;
|
|
9
|
+
problemId: string;
|
|
10
|
+
};
|
|
11
|
+
export type VoiceTranscriptionController = ReturnType<typeof useVoiceTranscriptionController>;
|
|
12
|
+
export declare const useVoiceTranscriptionController: ({ model, answers, attemptOffset, attemptsCount, problemId, }: Params) => {
|
|
13
|
+
display: {
|
|
14
|
+
text: string;
|
|
15
|
+
isLoading: boolean;
|
|
16
|
+
};
|
|
17
|
+
flags: {
|
|
18
|
+
playerState: PlayerState;
|
|
19
|
+
hasActiveAudio: boolean;
|
|
20
|
+
anyAttemptHasAudio: boolean;
|
|
21
|
+
canTranslate: boolean;
|
|
22
|
+
isTranslationActive: boolean;
|
|
23
|
+
};
|
|
24
|
+
actions: {
|
|
25
|
+
onPlayPress: () => void;
|
|
26
|
+
onTranslationToggle: () => void;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=useVoiceTranscriptionController.d.ts.map
|
package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useVoiceTranscriptionController.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/hooks/useVoiceTranscriptionController.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAGzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEnD,KAAK,MAAM,GAAG;IACZ,KAAK,EAAE,gBAAgB,CAAA;IACvB,OAAO,EAAE,WAAW,EAAE,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,4BAA4B,GAAG,UAAU,CAAC,OAAO,+BAA+B,CAAC,CAAA;AAE7F,eAAO,MAAM,+BAA+B,iEAMzC,MAAM;;;;;;qBAoIyB,WAAW;;;;;;;;;;CAW5C,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare class
|
|
1
|
+
export declare class DropdownModel {
|
|
2
2
|
readonly toggleExpand: import("effector").EventCallable<void>;
|
|
3
3
|
readonly setExpanded: import("effector").EventCallable<boolean>;
|
|
4
4
|
readonly reset: import("effector").EventCallable<void>;
|
|
5
5
|
readonly $isExpanded: import("effector").StoreWritable<boolean>;
|
|
6
6
|
}
|
|
7
|
-
//# sourceMappingURL=
|
|
7
|
+
//# sourceMappingURL=Dropdown.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dropdown.model.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/Dropdown.model.ts"],"names":[],"mappings":"AAEA,qBAAa,aAAa;IACxB,SAAgB,YAAY,yCAAgB;IAC5C,SAAgB,WAAW,4CAAyB;IACpD,SAAgB,KAAK,yCAAgB;IAErC,SAAgB,WAAW,4CAEP;CACrB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { PlayerModel } from './Player.model';
|
|
2
|
+
import { TranscriptionsCollection } from './TranscriptionsCollection';
|
|
3
|
+
import { VoiceFileDownloaderModel } from './VoiceFileDownloader.model';
|
|
4
|
+
type PlaybackControllerDeps = {
|
|
5
|
+
collection: TranscriptionsCollection;
|
|
6
|
+
player: PlayerModel;
|
|
7
|
+
downloader: VoiceFileDownloaderModel;
|
|
8
|
+
};
|
|
9
|
+
export declare class PlaybackController {
|
|
10
|
+
private readonly collection;
|
|
11
|
+
private readonly player;
|
|
12
|
+
private readonly downloader;
|
|
13
|
+
private currentPlayingAttempt;
|
|
14
|
+
private shouldPreventPlayback;
|
|
15
|
+
constructor(deps: PlaybackControllerDeps);
|
|
16
|
+
readonly togglePlayPause: (attemptNumber: number) => void;
|
|
17
|
+
readonly preloadAudio: import("effector").Effect<number, void, Error>;
|
|
18
|
+
private primePlayerIfIdle;
|
|
19
|
+
halt(): void;
|
|
20
|
+
releaseResources(): void;
|
|
21
|
+
private clearCurrentAttempt;
|
|
22
|
+
private abortAllDownloads;
|
|
23
|
+
private downloadAudio;
|
|
24
|
+
private readonly handlePlayAttempt;
|
|
25
|
+
private readonly playAudioFx;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=PlaybackController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlaybackController.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/PlaybackController.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAe,MAAM,gBAAgB,CAAA;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AAEtE,KAAK,sBAAsB,GAAG;IAC5B,UAAU,EAAE,wBAAwB,CAAA;IACpC,MAAM,EAAE,WAAW,CAAA;IACnB,UAAU,EAAE,wBAAwB,CAAA;CACrC,CAAA;AAED,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA0B;IACrD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAa;IACpC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA0B;IACrD,OAAO,CAAC,qBAAqB,CAAsB;IACnD,OAAO,CAAC,qBAAqB,CAAQ;gBAEzB,IAAI,EAAE,sBAAsB;IAOxC,SAAgB,eAAe,kBAAmB,MAAM,UAOvD;IAED,SAAgB,YAAY,iDAqB1B;IAEF,OAAO,CAAC,iBAAiB;IAQlB,IAAI;IAOJ,gBAAgB;IAavB,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,iBAAiB;YAaX,aAAa;IAmC3B,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAsChC;IAEF,OAAO,CAAC,QAAQ,CAAC,WAAW,CAkC1B;CACH"}
|
|
@@ -8,6 +8,7 @@ export declare const enum PlayerState {
|
|
|
8
8
|
export declare class PlayerModel {
|
|
9
9
|
player: AudioPlayer | null;
|
|
10
10
|
private stopped;
|
|
11
|
+
private primedUri;
|
|
11
12
|
readonly reset: import("effector").EventCallable<void>;
|
|
12
13
|
readonly setPlayerState: import("effector").EventCallable<PlayerState>;
|
|
13
14
|
readonly playbackFinished: import("effector").EventCallable<void>;
|
|
@@ -15,6 +16,8 @@ export declare class PlayerModel {
|
|
|
15
16
|
readonly setupAudioMode: import("effector").Effect<void, void, Error>;
|
|
16
17
|
readonly pause: import("effector").Effect<void, void, Error>;
|
|
17
18
|
readonly stop: import("effector").Effect<void, void, Error>;
|
|
19
|
+
readonly prime: import("effector").Effect<string, void, Error>;
|
|
20
|
+
readonly seek: import("effector").Effect<number, void, Error>;
|
|
18
21
|
readonly resume: import("effector").Effect<void, void, Error>;
|
|
19
22
|
readonly play: import("effector").Effect<string, void, Error>;
|
|
20
23
|
reinitialize(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Player.model.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/Player.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAwC,MAAM,YAAY,CAAA;AAE9E,0BAAkB,WAAW;IAC3B,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,IAAI,SAAS;CACd;AAED,qBAAa,WAAW;IACf,MAAM,EAAE,WAAW,GAAG,IAAI,CAAsB;IACvD,OAAO,CAAC,OAAO,CAAQ;
|
|
1
|
+
{"version":3,"file":"Player.model.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/Player.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAwC,MAAM,YAAY,CAAA;AAE9E,0BAAkB,WAAW;IAC3B,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,IAAI,SAAS;CACd;AAED,qBAAa,WAAW;IACf,MAAM,EAAE,WAAW,GAAG,IAAI,CAAsB;IACvD,OAAO,CAAC,OAAO,CAAQ;IACvB,OAAO,CAAC,SAAS,CAAsB;IAEvC,SAAgB,KAAK,yCAAgB;IACrC,SAAgB,cAAc,gDAA6B;IAC3D,SAAgB,gBAAgB,yCAAgB;IAEhD,SAAgB,YAAY,gDAAmE;IAE/F,SAAgB,cAAc,+CAM5B;IAEF,SAAgB,KAAK,+CAOnB;IAEF,SAAgB,IAAI,+CASlB;IAEF,SAAgB,KAAK,iDAKnB;IAEF,SAAgB,IAAI,iDAUlB;IAEF,SAAgB,MAAM,+CAOpB;IAEF,SAAgB,IAAI,iDA+BlB;IAEK,YAAY;IAMZ,OAAO;CAYf"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VoiceTranscriptionItem } from '../../types';
|
|
2
|
-
export declare class
|
|
2
|
+
export declare class TranscriptionsCollection {
|
|
3
3
|
readonly collection: Map<number, VoiceTranscriptionItem>;
|
|
4
4
|
add(attemptNumber: number, item: VoiceTranscriptionItem): void;
|
|
5
5
|
update(attemptNumber: number, item: Partial<VoiceTranscriptionItem>): void;
|
|
@@ -10,4 +10,4 @@ export declare class VoiceTranscriptionsCollection {
|
|
|
10
10
|
hasTranscript(attemptNumber: number): boolean;
|
|
11
11
|
hasAudio(attemptNumber: number): boolean;
|
|
12
12
|
}
|
|
13
|
-
//# sourceMappingURL=
|
|
13
|
+
//# sourceMappingURL=TranscriptionsCollection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TranscriptionsCollection.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/TranscriptionsCollection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAEpD,qBAAa,wBAAwB;IACnC,SAAgB,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAY;IAEpE,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,sBAAsB;IAIvD,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,sBAAsB,CAAC;IAKnE,MAAM,CAAC,aAAa,EAAE,MAAM;IAI5B,GAAG,CAAC,aAAa,EAAE,MAAM;IAIzB,MAAM;IAIN,KAAK;IAIL,aAAa,CAAC,aAAa,EAAE,MAAM;IAKnC,QAAQ,CAAC,aAAa,EAAE,MAAM;CAItC"}
|
package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloader.model.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TranscriptionsCollection } from './TranscriptionsCollection';
|
|
2
|
+
import { VoicePlayerApi } from '../../types';
|
|
3
|
+
type TranscriptResult = {
|
|
4
|
+
text: string;
|
|
5
|
+
language?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare class TranscriptionsDownloaderModel {
|
|
8
|
+
private readonly collection;
|
|
9
|
+
private readonly api;
|
|
10
|
+
private readonly inflightFetches;
|
|
11
|
+
private readonly transcriptCache;
|
|
12
|
+
constructor(collection: TranscriptionsCollection, api: VoicePlayerApi);
|
|
13
|
+
private fetchTranscriptWithRetry;
|
|
14
|
+
private runFetchWithRetry;
|
|
15
|
+
readonly loadTranscriptForAttempt: import("effector").Effect<number, void, Error>;
|
|
16
|
+
getCachedTranscript(audioFileId: string): TranscriptResult | undefined;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=TranscriptionsDownloader.model.d.ts.map
|
package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloader.model.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TranscriptionsDownloader.model.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/TranscriptionsDownloader.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAO5C,KAAK,gBAAgB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAE3D,qBAAa,6BAA6B;IACxC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA0B;IACrD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAgB;IACpC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA+C;IAC/E,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAsC;gBAE1D,UAAU,EAAE,wBAAwB,EAAE,GAAG,EAAE,cAAc;IAKrE,OAAO,CAAC,wBAAwB;YAmBlB,iBAAiB;IAmB/B,SAAgB,wBAAwB,iDAsBtC;IAEK,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS;CAG9E"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { TranscriptionsCollection } from './TranscriptionsCollection';
|
|
2
|
+
import { VoicePlayerApi } from '../../types';
|
|
3
|
+
type TranslateParams = {
|
|
4
|
+
attemptNumber: number;
|
|
5
|
+
targetLanguage: string;
|
|
6
|
+
};
|
|
7
|
+
type TranslateResult = {
|
|
8
|
+
attemptNumber: number;
|
|
9
|
+
text: string;
|
|
10
|
+
};
|
|
11
|
+
export declare class TranslationModel {
|
|
12
|
+
private readonly collection;
|
|
13
|
+
private readonly service;
|
|
14
|
+
readonly toggle: import("effector").EventCallable<void>;
|
|
15
|
+
readonly setActive: import("effector").EventCallable<boolean>;
|
|
16
|
+
readonly clearCache: import("effector").EventCallable<void>;
|
|
17
|
+
readonly reset: import("effector").EventCallable<void>;
|
|
18
|
+
readonly $isActive: import("effector").StoreWritable<boolean>;
|
|
19
|
+
readonly translate: import("effector").Effect<TranslateParams, TranslateResult | null, Error>;
|
|
20
|
+
readonly $translations: import("effector").StoreWritable<Record<number, string>>;
|
|
21
|
+
constructor(collection: TranscriptionsCollection, api: VoicePlayerApi);
|
|
22
|
+
getTranslation(attemptNumber: number): string | undefined;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=Translation.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Translation.model.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/Translation.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAQ5C,KAAK,eAAe,GAAG;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,KAAK,eAAe,GAAG;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA0B;IACrD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;IAE5C,SAAgB,MAAM,yCAAgB;IACtC,SAAgB,SAAS,4CAAyB;IAClD,SAAgB,UAAU,yCAAgB;IAC1C,SAAgB,KAAK,yCAAgB;IAErC,SAAgB,SAAS,4CAEL;IAEpB,SAAgB,SAAS,4EAexB;IAED,SAAgB,aAAa,2DAKQ;gBAEzB,UAAU,EAAE,wBAAwB,EAAE,GAAG,EAAE,cAAc;IAc9D,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAGjE"}
|
|
@@ -8,8 +8,8 @@ type DownloadResult = {
|
|
|
8
8
|
downloadPromise: Promise<any>;
|
|
9
9
|
};
|
|
10
10
|
export declare class VoiceFileDownloaderModel {
|
|
11
|
-
private api;
|
|
12
|
-
|
|
11
|
+
private readonly api;
|
|
12
|
+
constructor(api: VoicePlayerApi);
|
|
13
13
|
readonly download: import("effector").Effect<DownloadParams, DownloadResult, Error>;
|
|
14
14
|
readonly abortDownload: (controller?: AbortController) => void;
|
|
15
15
|
}
|
package/dist/typescript/module/features/voice/playing/model/VoiceFileDownloader.model.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceFileDownloader.model.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/VoiceFileDownloader.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAGpE,KAAK,cAAc,GAAG;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,aAAa,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,KAAK,cAAc,GAAG;IACpB,cAAc,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAA;IAC/C,eAAe,EAAE,OAAO,CAAC,GAAG,CAAC,CAAA;CAC9B,CAAA;AAED,qBAAa,wBAAwB;IACnC,OAAO,CAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"VoiceFileDownloader.model.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/VoiceFileDownloader.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAGpE,KAAK,cAAc,GAAG;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,aAAa,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,KAAK,cAAc,GAAG;IACpB,cAAc,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAA;IAC/C,eAAe,EAAE,OAAO,CAAC,GAAG,CAAC,CAAA;CAC9B,CAAA;AAED,qBAAa,wBAAwB;IACnC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAgB;gBAExB,GAAG,EAAE,cAAc;IAI/B,SAAgB,QAAQ,mEAevB;IAED,SAAgB,aAAa,gBAAiB,eAAe,UAE5D;CACF"}
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TranscriptionsCollection } from './TranscriptionsCollection';
|
|
2
2
|
import { VoiceFileDownloaderModel } from './VoiceFileDownloader.model';
|
|
3
|
-
import {
|
|
3
|
+
import { DropdownModel } from './Dropdown.model';
|
|
4
|
+
import { TranslationModel } from './Translation.model';
|
|
4
5
|
import { AnswerAudio, VoicePlayerApi, VoiceTranscriptionItem } from '../../types';
|
|
5
|
-
import { PlayerModel
|
|
6
|
-
import { TranscriptionsDownloaderModel } from './
|
|
7
|
-
|
|
6
|
+
import { PlayerModel } from './Player.model';
|
|
7
|
+
import { TranscriptionsDownloaderModel } from './TranscriptionsDownloader.model';
|
|
8
|
+
import { PlaybackController } from './PlaybackController';
|
|
9
|
+
type VoicePlayerModelParams = {
|
|
8
10
|
api: VoicePlayerApi;
|
|
9
11
|
audios?: AnswerAudio[];
|
|
10
12
|
};
|
|
11
13
|
export declare class VoicePlayerModel {
|
|
12
|
-
readonly collection:
|
|
13
|
-
readonly
|
|
14
|
-
readonly dropdown: VoiceTranscriptionsDropdownModel;
|
|
14
|
+
readonly collection: TranscriptionsCollection;
|
|
15
|
+
readonly dropdown: DropdownModel;
|
|
15
16
|
readonly playerModel: PlayerModel;
|
|
17
|
+
readonly downloader: VoiceFileDownloaderModel;
|
|
18
|
+
readonly translation: TranslationModel;
|
|
16
19
|
readonly loader: TranscriptionsDownloaderModel;
|
|
17
20
|
readonly api: VoicePlayerApi;
|
|
18
|
-
private
|
|
19
|
-
private shouldPreventPlayback;
|
|
21
|
+
private readonly playback;
|
|
20
22
|
readonly setCurrentAttempt: import("effector").EventCallable<number | null>;
|
|
21
23
|
readonly reset: import("effector").EventCallable<void>;
|
|
22
24
|
readonly $currentAttempt: import("effector").StoreWritable<number | null>;
|
|
23
|
-
readonly $playerState: import("effector").StoreWritable<PlayerState>;
|
|
25
|
+
readonly $playerState: import("effector").StoreWritable<import("./Player.model").PlayerState>;
|
|
24
26
|
readonly pauseAudio: import("effector").Effect<void, void, Error>;
|
|
27
|
+
readonly seekAudio: import("effector").Effect<number, void, Error>;
|
|
28
|
+
readonly togglePlayPause: PlaybackController['togglePlayPause'];
|
|
29
|
+
constructor(params: VoicePlayerModelParams);
|
|
25
30
|
readonly stopAudio: () => void;
|
|
31
|
+
readonly preloadAudio: (attemptNumber?: number) => Promise<void> | undefined;
|
|
26
32
|
readonly resetPlayer: () => void;
|
|
27
|
-
constructor(params: VoiceTranscriptionsPlayerModelParams);
|
|
28
33
|
initializeWithAudios(answerAudio: AnswerAudio[]): void;
|
|
29
|
-
private initializeCollectionFromAudios;
|
|
30
|
-
private releaseCollectionResources;
|
|
31
|
-
private abortAllDownloads;
|
|
32
|
-
private readonly handlePlayAttempt;
|
|
33
|
-
private playAudioFx;
|
|
34
34
|
isAudioLoading(attemptNumber: number): boolean;
|
|
35
35
|
getAllAttempts(): VoiceTranscriptionItem[];
|
|
36
36
|
reinitializePlayer(): void;
|
|
37
37
|
cleanup(): void;
|
|
38
|
-
|
|
38
|
+
private initializeCollectionFromAudios;
|
|
39
39
|
}
|
|
40
40
|
export {};
|
|
41
41
|
//# sourceMappingURL=VoicePlayer.model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoicePlayer.model.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/VoicePlayer.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"VoicePlayer.model.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/VoicePlayer.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAA;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEzD,KAAK,sBAAsB,GAAG;IAC5B,GAAG,EAAE,cAAc,CAAA;IACnB,MAAM,CAAC,EAAE,WAAW,EAAE,CAAA;CACvB,CAAA;AAED,qBAAa,gBAAgB;IAC3B,SAAgB,UAAU,2BAAiC;IAC3D,SAAgB,QAAQ,gBAAsB;IAC9C,SAAgB,WAAW,cAAoB;IAC/C,SAAgB,UAAU,EAAE,wBAAwB,CAAA;IACpD,SAAgB,WAAW,EAAE,gBAAgB,CAAA;IAC7C,SAAgB,MAAM,EAAE,6BAA6B,CAAA;IACrD,SAAgB,GAAG,EAAE,cAAc,CAAA;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoB;IAE7C,SAAgB,iBAAiB,kDAA+B;IAChE,SAAgB,KAAK,yCAAgB;IAErC,SAAgB,eAAe,kDAA0D;IACzF,SAAgB,YAAY,yEAAgC;IAE5D,SAAgB,UAAU,+CAAyB;IACnD,SAAgB,SAAS,iDAAwB;IAEjD,SAAgB,eAAe,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,CAAA;gBAE1D,MAAM,EAAE,sBAAsB;IAmB1C,SAAgB,SAAS,aAExB;IAED,SAAgB,YAAY,mBAAoB,MAAM,+BAIrD;IAED,SAAgB,WAAW,aAK1B;IAEM,oBAAoB,CAAC,WAAW,EAAE,WAAW,EAAE;IAK/C,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO;IAI9C,cAAc,IAAI,sBAAsB,EAAE;IAI1C,kBAAkB;IAIlB,OAAO;IASd,OAAO,CAAC,8BAA8B;CAmBvC"}
|
|
@@ -2,6 +2,8 @@ import { WithAbortSignal } from 'src/types/common.types';
|
|
|
2
2
|
import { getAvailableInputs } from './helpers';
|
|
3
3
|
import { VoiceRecordModel } from './recording/model/VoiceRecord.model';
|
|
4
4
|
import { AxiosResponse } from 'axios';
|
|
5
|
+
import type { GoogleTranslateProps as GoogleTranslatePayload, GoogleTranslateResponse } from '../translation/providers/google.types';
|
|
6
|
+
export type { GoogleTranslatePayload, GoogleTranslateResponse };
|
|
5
7
|
export type VoiceRecordNotificationTypes = {
|
|
6
8
|
success: (message: string) => void;
|
|
7
9
|
info: (message: string) => void;
|
|
@@ -46,6 +48,7 @@ export type VoiceRecorderApi = {
|
|
|
46
48
|
type TranscriptionStatus = 'pending' | 'completed' | 'failed';
|
|
47
49
|
export type AudioTranscriptResponse = {
|
|
48
50
|
text: string;
|
|
51
|
+
language: string;
|
|
49
52
|
status: TranscriptionStatus;
|
|
50
53
|
};
|
|
51
54
|
export type VoicePlayerApi = {
|
|
@@ -53,12 +56,14 @@ export type VoicePlayerApi = {
|
|
|
53
56
|
downloadAudioFile: (audioFileId: string, options?: {
|
|
54
57
|
signal?: AbortSignal;
|
|
55
58
|
}) => Promise<AxiosResponse<Blob>>;
|
|
59
|
+
translateText: (payload: GoogleTranslatePayload) => Promise<GoogleTranslateResponse>;
|
|
56
60
|
};
|
|
57
61
|
export type VoiceTranscriptionItem = {
|
|
58
62
|
attemptNumber: number;
|
|
59
63
|
audioFileId: string;
|
|
60
64
|
_id: string;
|
|
61
65
|
transcript?: string;
|
|
66
|
+
transcriptLanguage?: string;
|
|
62
67
|
transcriptLoading?: boolean;
|
|
63
68
|
transcriptError?: string;
|
|
64
69
|
audioUri?: string;
|
|
@@ -76,5 +81,4 @@ export declare enum VoiceTranscriptionVariant {
|
|
|
76
81
|
SMALL = "small",
|
|
77
82
|
LARGE = "large"
|
|
78
83
|
}
|
|
79
|
-
export {};
|
|
80
84
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/voice/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAA;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/voice/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAA;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AACrC,OAAO,KAAK,EACV,oBAAoB,IAAI,sBAAsB,EAC9C,uBAAuB,EACxB,MAAM,uCAAuC,CAAA;AAE9C,YAAY,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,CAAA;AAE/D,MAAM,MAAM,4BAA4B,GAAG;IACzC,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAAC;IAC/C,iBAAiB,EAAE,QAAQ,CAAA;CAC5B,CAAC,CAAA;AAEF,KAAK,mBAAmB,GAAG;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,kBAAkB,CAAC,EAAE,OAAO,CAAC,IAAI,GAAG,mBAAmB,CAAC,CAAA;IACxD,UAAU,CAAC,EAAE,eAAe,CAAA;CAC7B,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,CAAC,SAAS,EAAE,MAAM,GAAG,yBAAyB,CAAA;CAC/C,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAA;AAEjF,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,gBAAgB,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,eAAe,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAA;IAC3E,eAAe,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACxD,CAAA;AAED,KAAK,mBAAmB,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAA;AAC7D,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,mBAAmB,CAAA;CAC5B,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,sBAAsB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAA;IACjF,iBAAiB,EAAE,CACjB,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,KAC/B,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAA;IACjC,aAAa,EAAE,CAAC,OAAO,EAAE,sBAAsB,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAA;CACrF,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;IACnB,GAAG,EAAE,MAAM,CAAA;IACX,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,oBAAoB,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,CAAA;IACnC,UAAU,CAAC,EAAE,eAAe,CAAA;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,oBAAY,mBAAmB;IAC7B,OAAO,YAAY;IACnB,QAAQ,aAAa;CACtB;AAED,oBAAY,yBAAyB;IACnC,KAAK,UAAU;IACf,KAAK,UAAU;CAChB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,yBAAyB,CAAA;AACvC,cAAc,mBAAmB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,yBAAyB,CAAA;AACvC,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magmamath/students-features",
|
|
3
|
-
"version": "1.3.23-rc.
|
|
3
|
+
"version": "1.3.23-rc.21",
|
|
4
4
|
"description": "Magmamath features library",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"react-native": "src/index.ts",
|
|
8
8
|
"module": "dist/module/index.js",
|
|
9
9
|
"types": "dist/typescript/module/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"react-native": "./src/index.ts",
|
|
13
|
+
"source": "./src/index.ts",
|
|
14
|
+
"import": {
|
|
15
|
+
"types": "./dist/typescript/module/index.d.ts",
|
|
16
|
+
"default": "./dist/module/index.js"
|
|
17
|
+
},
|
|
18
|
+
"require": {
|
|
19
|
+
"types": "./dist/typescript/commonjs/index.d.ts",
|
|
20
|
+
"default": "./dist/commonjs/index.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"./voice": {
|
|
24
|
+
"react-native": "./src/features/voice/index.ts",
|
|
25
|
+
"source": "./src/features/voice/index.ts",
|
|
26
|
+
"import": {
|
|
27
|
+
"types": "./dist/typescript/module/features/voice/index.d.ts",
|
|
28
|
+
"default": "./dist/module/features/voice/index.js"
|
|
29
|
+
},
|
|
30
|
+
"require": {
|
|
31
|
+
"types": "./dist/typescript/commonjs/features/voice/index.d.ts",
|
|
32
|
+
"default": "./dist/commonjs/features/voice/index.js"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"./package.json": "./package.json"
|
|
36
|
+
},
|
|
10
37
|
"files": [
|
|
11
38
|
"src",
|
|
12
39
|
"dist",
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { MaskSegmentParams } from './types'
|
|
2
|
+
|
|
3
|
+
export function replaceMappedTokens(input: string, map: Record<string, string>): string {
|
|
4
|
+
let result = input
|
|
5
|
+
|
|
6
|
+
for (const [original, override] of Object.entries(map)) {
|
|
7
|
+
const escaped = original.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
|
|
8
|
+
const regex = new RegExp(`\\b${escaped}\\b`, 'gi')
|
|
9
|
+
|
|
10
|
+
result = result.replace(regex, override)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return result
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Masks text segments matched by `regex` with a placeholder,
|
|
18
|
+
* while preserving spaces around the original match.
|
|
19
|
+
*/
|
|
20
|
+
export const maskSegment = ({
|
|
21
|
+
text,
|
|
22
|
+
regex,
|
|
23
|
+
placeholder,
|
|
24
|
+
replacements,
|
|
25
|
+
shouldSkip,
|
|
26
|
+
}: MaskSegmentParams): string => {
|
|
27
|
+
return text.replace(regex, (match, ...args) => {
|
|
28
|
+
if (shouldSkip?.(match)) return match
|
|
29
|
+
|
|
30
|
+
const offset = args[args.length - 2] as number
|
|
31
|
+
const input = args[args.length - 1] as string
|
|
32
|
+
|
|
33
|
+
const before = offset > 0 ? input[offset - 1] : ''
|
|
34
|
+
const afterIdx = offset + match.length
|
|
35
|
+
const after = afterIdx < input.length ? input[afterIdx] : ''
|
|
36
|
+
|
|
37
|
+
const leftPad = /\s/.test(before)
|
|
38
|
+
const rightPad = /\s/.test(after)
|
|
39
|
+
|
|
40
|
+
replacements.push({ placeholder, original: match, leftPad, rightPad })
|
|
41
|
+
|
|
42
|
+
return placeholder
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const HTML_NAMED_ENTITIES: Record<string, string> = {
|
|
47
|
+
'&': '&',
|
|
48
|
+
'<': '<',
|
|
49
|
+
'>': '>',
|
|
50
|
+
'"': '"',
|
|
51
|
+
''': "'",
|
|
52
|
+
' ': ' ',
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const decodeHtmlEntities = (text: string): string => {
|
|
56
|
+
return text
|
|
57
|
+
.replace(/&#(\d+);/g, (_, code: string) => String.fromCharCode(parseInt(code, 10)))
|
|
58
|
+
.replace(/&#x([0-9a-f]+);/gi, (_, code: string) => String.fromCharCode(parseInt(code, 16)))
|
|
59
|
+
.replace(
|
|
60
|
+
/&(amp|lt|gt|quot|apos|nbsp);/g,
|
|
61
|
+
(match) => HTML_NAMED_ENTITIES[match] ?? match,
|
|
62
|
+
)
|
|
63
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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 {
|
|
8
|
+
GoogleTranslateProps,
|
|
9
|
+
GoogleTranslateResponse,
|
|
10
|
+
GoogleTranslation,
|
|
11
|
+
} from './providers/google.types'
|
|
12
|
+
export { wordsToPreserve, preservedWordsReplacers } from './preserve/wordsToPreserve'
|
|
13
|
+
export {
|
|
14
|
+
GBD_TEXT_CACHE_SUFFIX,
|
|
15
|
+
DESCRIPTION_CACHE_KEY_SUFFIX,
|
|
16
|
+
CHOICES_CACHE_KEY_SUFFIX,
|
|
17
|
+
PRACTICE_THEORY_CACHE_KEY_SUFFIX,
|
|
18
|
+
} from './constants'
|
|
19
|
+
export {
|
|
20
|
+
replaceMappedTokens,
|
|
21
|
+
maskSegment,
|
|
22
|
+
decodeHtmlEntities,
|
|
23
|
+
} from './helpers'
|
|
24
|
+
export type {
|
|
25
|
+
TranslatableProblem,
|
|
26
|
+
TranslateAllFxParams,
|
|
27
|
+
TranslateFxParams,
|
|
28
|
+
Replacement,
|
|
29
|
+
MaskSegmentParams,
|
|
30
|
+
} from './types'
|