@magmamath/students-features 1.3.23-rc.21 → 1.3.23-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (282) hide show
  1. package/dist/commonjs/features/voice/playing/components/VoiceTranscription.js +48 -39
  2. package/dist/commonjs/features/voice/playing/components/VoiceTranscription.js.map +1 -1
  3. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.js +2 -2
  4. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.js.map +1 -1
  5. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.js +8 -7
  6. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.js.map +1 -1
  7. package/dist/commonjs/features/voice/playing/hooks/{useDropdownAnimation.js → useVoiceTranscription.js} +7 -8
  8. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscription.js.map +1 -0
  9. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionEffects.js +37 -0
  10. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionEffects.js.map +1 -0
  11. package/dist/commonjs/features/voice/playing/model/Player.model.js +1 -24
  12. package/dist/commonjs/features/voice/playing/model/Player.model.js.map +1 -1
  13. package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.js +66 -0
  14. package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.js.map +1 -0
  15. package/dist/commonjs/features/voice/playing/model/VoiceFileDownloader.model.js +2 -2
  16. package/dist/commonjs/features/voice/playing/model/VoiceFileDownloader.model.js.map +1 -1
  17. package/dist/commonjs/features/voice/playing/model/VoicePlayer.model.js +175 -46
  18. package/dist/commonjs/features/voice/playing/model/VoicePlayer.model.js.map +1 -1
  19. package/dist/commonjs/features/voice/playing/model/{Dropdown.model.js → VoiceTranscription.model.js} +4 -4
  20. package/dist/commonjs/features/voice/playing/model/VoiceTranscription.model.js.map +1 -0
  21. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionTranslation.model.js +15 -0
  22. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionTranslation.model.js.map +1 -0
  23. package/dist/commonjs/features/voice/playing/model/{TranscriptionsCollection.js → VoiceTranscriptionsCollection.js} +4 -4
  24. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.js.map +1 -0
  25. package/dist/commonjs/features/voice/types.js.map +1 -1
  26. package/dist/commonjs/index.js +0 -12
  27. package/dist/commonjs/index.js.map +1 -1
  28. package/dist/module/features/voice/playing/components/VoiceTranscription.js +47 -40
  29. package/dist/module/features/voice/playing/components/VoiceTranscription.js.map +1 -1
  30. package/dist/module/features/voice/playing/components/VoiceTranscriptionCollapsible.js +2 -2
  31. package/dist/module/features/voice/playing/components/VoiceTranscriptionCollapsible.js.map +1 -1
  32. package/dist/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.js +7 -8
  33. package/dist/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.js.map +1 -1
  34. package/dist/module/features/voice/playing/hooks/{useDropdownAnimation.js → useVoiceTranscription.js} +5 -6
  35. package/dist/module/features/voice/playing/hooks/useVoiceTranscription.js.map +1 -0
  36. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionEffects.js +32 -0
  37. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionEffects.js.map +1 -0
  38. package/dist/module/features/voice/playing/model/Player.model.js +1 -24
  39. package/dist/module/features/voice/playing/model/Player.model.js.map +1 -1
  40. package/dist/module/features/voice/playing/model/TranscriptionsDownloaderModel.js +61 -0
  41. package/dist/module/features/voice/playing/model/TranscriptionsDownloaderModel.js.map +1 -0
  42. package/dist/module/features/voice/playing/model/VoiceFileDownloader.model.js +2 -2
  43. package/dist/module/features/voice/playing/model/VoiceFileDownloader.model.js.map +1 -1
  44. package/dist/module/features/voice/playing/model/VoicePlayer.model.js +177 -48
  45. package/dist/module/features/voice/playing/model/VoicePlayer.model.js.map +1 -1
  46. package/dist/module/features/voice/playing/model/{Dropdown.model.js → VoiceTranscription.model.js} +2 -2
  47. package/dist/module/features/voice/playing/model/VoiceTranscription.model.js.map +1 -0
  48. package/dist/module/features/voice/playing/model/VoiceTranscriptionTranslation.model.js +10 -0
  49. package/dist/module/features/voice/playing/model/VoiceTranscriptionTranslation.model.js.map +1 -0
  50. package/dist/module/features/voice/playing/model/{TranscriptionsCollection.js → VoiceTranscriptionsCollection.js} +2 -2
  51. package/dist/module/features/voice/playing/model/VoiceTranscriptionsCollection.js.map +1 -0
  52. package/dist/module/features/voice/types.js.map +1 -1
  53. package/dist/module/index.js +0 -1
  54. package/dist/module/index.js.map +1 -1
  55. package/dist/typescript/commonjs/features/voice/index.d.ts +0 -1
  56. package/dist/typescript/commonjs/features/voice/index.d.ts.map +1 -1
  57. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscription.d.ts.map +1 -1
  58. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts +2 -2
  59. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts.map +1 -1
  60. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.d.ts.map +1 -1
  61. package/dist/typescript/commonjs/features/voice/playing/hooks/{useDropdownAnimation.d.ts → useVoiceTranscription.d.ts} +3 -3
  62. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscription.d.ts.map +1 -0
  63. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionEffects.d.ts +12 -0
  64. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionEffects.d.ts.map +1 -0
  65. package/dist/typescript/commonjs/features/voice/playing/model/Player.model.d.ts +0 -3
  66. package/dist/typescript/commonjs/features/voice/playing/model/Player.model.d.ts.map +1 -1
  67. package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts +15 -0
  68. package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts.map +1 -0
  69. package/dist/typescript/commonjs/features/voice/playing/model/VoiceFileDownloader.model.d.ts +2 -2
  70. package/dist/typescript/commonjs/features/voice/playing/model/VoiceFileDownloader.model.d.ts.map +1 -1
  71. package/dist/typescript/commonjs/features/voice/playing/model/VoicePlayer.model.d.ts +20 -18
  72. package/dist/typescript/commonjs/features/voice/playing/model/VoicePlayer.model.d.ts.map +1 -1
  73. package/dist/typescript/commonjs/features/voice/playing/model/{Dropdown.model.d.ts → VoiceTranscription.model.d.ts} +2 -2
  74. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscription.model.d.ts.map +1 -0
  75. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionTranslation.model.d.ts +7 -0
  76. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionTranslation.model.d.ts.map +1 -0
  77. package/dist/typescript/{module/features/voice/playing/model/TranscriptionsCollection.d.ts → commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts} +2 -2
  78. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts.map +1 -0
  79. package/dist/typescript/commonjs/features/voice/types.d.ts +1 -4
  80. package/dist/typescript/commonjs/features/voice/types.d.ts.map +1 -1
  81. package/dist/typescript/commonjs/index.d.ts +0 -1
  82. package/dist/typescript/commonjs/index.d.ts.map +1 -1
  83. package/dist/typescript/module/features/voice/index.d.ts +0 -1
  84. package/dist/typescript/module/features/voice/index.d.ts.map +1 -1
  85. package/dist/typescript/module/features/voice/playing/components/VoiceTranscription.d.ts.map +1 -1
  86. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts +2 -2
  87. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts.map +1 -1
  88. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.d.ts.map +1 -1
  89. package/dist/typescript/module/features/voice/playing/hooks/{useDropdownAnimation.d.ts → useVoiceTranscription.d.ts} +3 -3
  90. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscription.d.ts.map +1 -0
  91. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionEffects.d.ts +12 -0
  92. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionEffects.d.ts.map +1 -0
  93. package/dist/typescript/module/features/voice/playing/model/Player.model.d.ts +0 -3
  94. package/dist/typescript/module/features/voice/playing/model/Player.model.d.ts.map +1 -1
  95. package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts +15 -0
  96. package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts.map +1 -0
  97. package/dist/typescript/module/features/voice/playing/model/VoiceFileDownloader.model.d.ts +2 -2
  98. package/dist/typescript/module/features/voice/playing/model/VoiceFileDownloader.model.d.ts.map +1 -1
  99. package/dist/typescript/module/features/voice/playing/model/VoicePlayer.model.d.ts +20 -18
  100. package/dist/typescript/module/features/voice/playing/model/VoicePlayer.model.d.ts.map +1 -1
  101. package/dist/typescript/module/features/voice/playing/model/{Dropdown.model.d.ts → VoiceTranscription.model.d.ts} +2 -2
  102. package/dist/typescript/module/features/voice/playing/model/VoiceTranscription.model.d.ts.map +1 -0
  103. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionTranslation.model.d.ts +7 -0
  104. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionTranslation.model.d.ts.map +1 -0
  105. package/dist/typescript/{commonjs/features/voice/playing/model/TranscriptionsCollection.d.ts → module/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts} +2 -2
  106. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts.map +1 -0
  107. package/dist/typescript/module/features/voice/types.d.ts +1 -4
  108. package/dist/typescript/module/features/voice/types.d.ts.map +1 -1
  109. package/dist/typescript/module/index.d.ts +0 -1
  110. package/dist/typescript/module/index.d.ts.map +1 -1
  111. package/package.json +1 -28
  112. package/src/features/voice/index.ts +0 -1
  113. package/src/features/voice/playing/components/VoiceTranscription.tsx +60 -43
  114. package/src/features/voice/playing/components/VoiceTranscriptionCollapsible.tsx +4 -4
  115. package/src/features/voice/playing/components/VoiceTranscriptionHeaderActions.tsx +9 -8
  116. package/src/features/voice/playing/hooks/{useDropdownAnimation.ts → useVoiceTranscription.ts} +5 -5
  117. package/src/features/voice/playing/hooks/useVoiceTranscriptionEffects.ts +44 -0
  118. package/src/features/voice/playing/model/Player.model.ts +1 -26
  119. package/src/features/voice/playing/model/TranscriptionsDownloaderModel.ts +80 -0
  120. package/src/features/voice/playing/model/VoiceFileDownloader.model.ts +2 -2
  121. package/src/features/voice/playing/model/VoicePlayer.model.ts +196 -56
  122. package/src/features/voice/playing/model/{Dropdown.model.ts → VoiceTranscription.model.ts} +1 -1
  123. package/src/features/voice/playing/model/VoiceTranscriptionTranslation.model.ts +11 -0
  124. package/src/features/voice/playing/model/{TranscriptionsCollection.ts → VoiceTranscriptionsCollection.ts} +1 -1
  125. package/src/features/voice/types.ts +0 -9
  126. package/src/index.ts +0 -1
  127. package/dist/commonjs/features/translation/constants.js +0 -11
  128. package/dist/commonjs/features/translation/constants.js.map +0 -1
  129. package/dist/commonjs/features/translation/helpers.js +0 -60
  130. package/dist/commonjs/features/translation/helpers.js.map +0 -1
  131. package/dist/commonjs/features/translation/index.js +0 -105
  132. package/dist/commonjs/features/translation/index.js.map +0 -1
  133. package/dist/commonjs/features/translation/model/TranslationModel.js +0 -122
  134. package/dist/commonjs/features/translation/model/TranslationModel.js.map +0 -1
  135. package/dist/commonjs/features/translation/model/TranslationPreprocessor.js +0 -142
  136. package/dist/commonjs/features/translation/model/TranslationPreprocessor.js.map +0 -1
  137. package/dist/commonjs/features/translation/model/TranslationService.js +0 -112
  138. package/dist/commonjs/features/translation/model/TranslationService.js.map +0 -1
  139. package/dist/commonjs/features/translation/preserve/wordsToPreserve.js +0 -314
  140. package/dist/commonjs/features/translation/preserve/wordsToPreserve.js.map +0 -1
  141. package/dist/commonjs/features/translation/providers/google/GoogleTranslationProvider.js +0 -50
  142. package/dist/commonjs/features/translation/providers/google/GoogleTranslationProvider.js.map +0 -1
  143. package/dist/commonjs/features/translation/providers/google/supportedLanguages.js +0 -230
  144. package/dist/commonjs/features/translation/providers/google/supportedLanguages.js.map +0 -1
  145. package/dist/commonjs/features/translation/providers/google.types.js +0 -2
  146. package/dist/commonjs/features/translation/providers/google.types.js.map +0 -1
  147. package/dist/commonjs/features/translation/providers/translation.interface.js +0 -49
  148. package/dist/commonjs/features/translation/providers/translation.interface.js.map +0 -1
  149. package/dist/commonjs/features/translation/types.js +0 -2
  150. package/dist/commonjs/features/translation/types.js.map +0 -1
  151. package/dist/commonjs/features/voice/playing/hooks/useDropdownAnimation.js.map +0 -1
  152. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.js +0 -128
  153. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.js.map +0 -1
  154. package/dist/commonjs/features/voice/playing/model/Dropdown.model.js.map +0 -1
  155. package/dist/commonjs/features/voice/playing/model/PlaybackController.js +0 -183
  156. package/dist/commonjs/features/voice/playing/model/PlaybackController.js.map +0 -1
  157. package/dist/commonjs/features/voice/playing/model/TranscriptionsCollection.js.map +0 -1
  158. package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.js +0 -82
  159. package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.js.map +0 -1
  160. package/dist/commonjs/features/voice/playing/model/Translation.model.js +0 -62
  161. package/dist/commonjs/features/voice/playing/model/Translation.model.js.map +0 -1
  162. package/dist/module/features/translation/constants.js +0 -7
  163. package/dist/module/features/translation/constants.js.map +0 -1
  164. package/dist/module/features/translation/helpers.js +0 -53
  165. package/dist/module/features/translation/helpers.js.map +0 -1
  166. package/dist/module/features/translation/index.js +0 -12
  167. package/dist/module/features/translation/index.js.map +0 -1
  168. package/dist/module/features/translation/model/TranslationModel.js +0 -117
  169. package/dist/module/features/translation/model/TranslationModel.js.map +0 -1
  170. package/dist/module/features/translation/model/TranslationPreprocessor.js +0 -137
  171. package/dist/module/features/translation/model/TranslationPreprocessor.js.map +0 -1
  172. package/dist/module/features/translation/model/TranslationService.js +0 -107
  173. package/dist/module/features/translation/model/TranslationService.js.map +0 -1
  174. package/dist/module/features/translation/preserve/wordsToPreserve.js +0 -310
  175. package/dist/module/features/translation/preserve/wordsToPreserve.js.map +0 -1
  176. package/dist/module/features/translation/providers/google/GoogleTranslationProvider.js +0 -45
  177. package/dist/module/features/translation/providers/google/GoogleTranslationProvider.js.map +0 -1
  178. package/dist/module/features/translation/providers/google/supportedLanguages.js +0 -225
  179. package/dist/module/features/translation/providers/google/supportedLanguages.js.map +0 -1
  180. package/dist/module/features/translation/providers/google.types.js +0 -2
  181. package/dist/module/features/translation/providers/google.types.js.map +0 -1
  182. package/dist/module/features/translation/providers/translation.interface.js +0 -44
  183. package/dist/module/features/translation/providers/translation.interface.js.map +0 -1
  184. package/dist/module/features/translation/types.js +0 -2
  185. package/dist/module/features/translation/types.js.map +0 -1
  186. package/dist/module/features/voice/playing/hooks/useDropdownAnimation.js.map +0 -1
  187. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionController.js +0 -123
  188. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionController.js.map +0 -1
  189. package/dist/module/features/voice/playing/model/Dropdown.model.js.map +0 -1
  190. package/dist/module/features/voice/playing/model/PlaybackController.js +0 -178
  191. package/dist/module/features/voice/playing/model/PlaybackController.js.map +0 -1
  192. package/dist/module/features/voice/playing/model/TranscriptionsCollection.js.map +0 -1
  193. package/dist/module/features/voice/playing/model/TranscriptionsDownloader.model.js +0 -77
  194. package/dist/module/features/voice/playing/model/TranscriptionsDownloader.model.js.map +0 -1
  195. package/dist/module/features/voice/playing/model/Translation.model.js +0 -57
  196. package/dist/module/features/voice/playing/model/Translation.model.js.map +0 -1
  197. package/dist/typescript/commonjs/features/translation/constants.d.ts +0 -5
  198. package/dist/typescript/commonjs/features/translation/constants.d.ts.map +0 -1
  199. package/dist/typescript/commonjs/features/translation/helpers.d.ts +0 -9
  200. package/dist/typescript/commonjs/features/translation/helpers.d.ts.map +0 -1
  201. package/dist/typescript/commonjs/features/translation/index.d.ts +0 -12
  202. package/dist/typescript/commonjs/features/translation/index.d.ts.map +0 -1
  203. package/dist/typescript/commonjs/features/translation/model/TranslationModel.d.ts +0 -33
  204. package/dist/typescript/commonjs/features/translation/model/TranslationModel.d.ts.map +0 -1
  205. package/dist/typescript/commonjs/features/translation/model/TranslationPreprocessor.d.ts +0 -34
  206. package/dist/typescript/commonjs/features/translation/model/TranslationPreprocessor.d.ts.map +0 -1
  207. package/dist/typescript/commonjs/features/translation/model/TranslationService.d.ts +0 -40
  208. package/dist/typescript/commonjs/features/translation/model/TranslationService.d.ts.map +0 -1
  209. package/dist/typescript/commonjs/features/translation/preserve/wordsToPreserve.d.ts +0 -3
  210. package/dist/typescript/commonjs/features/translation/preserve/wordsToPreserve.d.ts.map +0 -1
  211. package/dist/typescript/commonjs/features/translation/providers/google/GoogleTranslationProvider.d.ts +0 -17
  212. package/dist/typescript/commonjs/features/translation/providers/google/GoogleTranslationProvider.d.ts.map +0 -1
  213. package/dist/typescript/commonjs/features/translation/providers/google/supportedLanguages.d.ts +0 -209
  214. package/dist/typescript/commonjs/features/translation/providers/google/supportedLanguages.d.ts.map +0 -1
  215. package/dist/typescript/commonjs/features/translation/providers/google.types.d.ts +0 -15
  216. package/dist/typescript/commonjs/features/translation/providers/google.types.d.ts.map +0 -1
  217. package/dist/typescript/commonjs/features/translation/providers/translation.interface.d.ts +0 -30
  218. package/dist/typescript/commonjs/features/translation/providers/translation.interface.d.ts.map +0 -1
  219. package/dist/typescript/commonjs/features/translation/types.d.ts +0 -27
  220. package/dist/typescript/commonjs/features/translation/types.d.ts.map +0 -1
  221. package/dist/typescript/commonjs/features/voice/playing/hooks/useDropdownAnimation.d.ts.map +0 -1
  222. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts +0 -30
  223. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts.map +0 -1
  224. package/dist/typescript/commonjs/features/voice/playing/model/Dropdown.model.d.ts.map +0 -1
  225. package/dist/typescript/commonjs/features/voice/playing/model/PlaybackController.d.ts +0 -28
  226. package/dist/typescript/commonjs/features/voice/playing/model/PlaybackController.d.ts.map +0 -1
  227. package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsCollection.d.ts.map +0 -1
  228. package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.d.ts +0 -19
  229. package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.d.ts.map +0 -1
  230. package/dist/typescript/commonjs/features/voice/playing/model/Translation.model.d.ts +0 -25
  231. package/dist/typescript/commonjs/features/voice/playing/model/Translation.model.d.ts.map +0 -1
  232. package/dist/typescript/module/features/translation/constants.d.ts +0 -5
  233. package/dist/typescript/module/features/translation/constants.d.ts.map +0 -1
  234. package/dist/typescript/module/features/translation/helpers.d.ts +0 -9
  235. package/dist/typescript/module/features/translation/helpers.d.ts.map +0 -1
  236. package/dist/typescript/module/features/translation/index.d.ts +0 -12
  237. package/dist/typescript/module/features/translation/index.d.ts.map +0 -1
  238. package/dist/typescript/module/features/translation/model/TranslationModel.d.ts +0 -33
  239. package/dist/typescript/module/features/translation/model/TranslationModel.d.ts.map +0 -1
  240. package/dist/typescript/module/features/translation/model/TranslationPreprocessor.d.ts +0 -34
  241. package/dist/typescript/module/features/translation/model/TranslationPreprocessor.d.ts.map +0 -1
  242. package/dist/typescript/module/features/translation/model/TranslationService.d.ts +0 -40
  243. package/dist/typescript/module/features/translation/model/TranslationService.d.ts.map +0 -1
  244. package/dist/typescript/module/features/translation/preserve/wordsToPreserve.d.ts +0 -3
  245. package/dist/typescript/module/features/translation/preserve/wordsToPreserve.d.ts.map +0 -1
  246. package/dist/typescript/module/features/translation/providers/google/GoogleTranslationProvider.d.ts +0 -17
  247. package/dist/typescript/module/features/translation/providers/google/GoogleTranslationProvider.d.ts.map +0 -1
  248. package/dist/typescript/module/features/translation/providers/google/supportedLanguages.d.ts +0 -209
  249. package/dist/typescript/module/features/translation/providers/google/supportedLanguages.d.ts.map +0 -1
  250. package/dist/typescript/module/features/translation/providers/google.types.d.ts +0 -15
  251. package/dist/typescript/module/features/translation/providers/google.types.d.ts.map +0 -1
  252. package/dist/typescript/module/features/translation/providers/translation.interface.d.ts +0 -30
  253. package/dist/typescript/module/features/translation/providers/translation.interface.d.ts.map +0 -1
  254. package/dist/typescript/module/features/translation/types.d.ts +0 -27
  255. package/dist/typescript/module/features/translation/types.d.ts.map +0 -1
  256. package/dist/typescript/module/features/voice/playing/hooks/useDropdownAnimation.d.ts.map +0 -1
  257. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts +0 -30
  258. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts.map +0 -1
  259. package/dist/typescript/module/features/voice/playing/model/Dropdown.model.d.ts.map +0 -1
  260. package/dist/typescript/module/features/voice/playing/model/PlaybackController.d.ts +0 -28
  261. package/dist/typescript/module/features/voice/playing/model/PlaybackController.d.ts.map +0 -1
  262. package/dist/typescript/module/features/voice/playing/model/TranscriptionsCollection.d.ts.map +0 -1
  263. package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloader.model.d.ts +0 -19
  264. package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloader.model.d.ts.map +0 -1
  265. package/dist/typescript/module/features/voice/playing/model/Translation.model.d.ts +0 -25
  266. package/dist/typescript/module/features/voice/playing/model/Translation.model.d.ts.map +0 -1
  267. package/src/features/translation/constants.ts +0 -4
  268. package/src/features/translation/helpers.ts +0 -63
  269. package/src/features/translation/index.ts +0 -30
  270. package/src/features/translation/model/TranslationModel.ts +0 -174
  271. package/src/features/translation/model/TranslationPreprocessor.ts +0 -171
  272. package/src/features/translation/model/TranslationService.ts +0 -148
  273. package/src/features/translation/preserve/wordsToPreserve.ts +0 -87
  274. package/src/features/translation/providers/google/GoogleTranslationProvider.ts +0 -50
  275. package/src/features/translation/providers/google/supportedLanguages.ts +0 -229
  276. package/src/features/translation/providers/google.types.ts +0 -16
  277. package/src/features/translation/providers/translation.interface.ts +0 -63
  278. package/src/features/translation/types.ts +0 -30
  279. package/src/features/voice/playing/hooks/useVoiceTranscriptionController.ts +0 -171
  280. package/src/features/voice/playing/model/PlaybackController.ts +0 -213
  281. package/src/features/voice/playing/model/TranscriptionsDownloader.model.ts +0 -88
  282. package/src/features/voice/playing/model/Translation.model.ts +0 -75
@@ -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,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"}
1
+ {"version":3,"file":"VoicePlayer.model.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/VoicePlayer.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAA;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,EAAE,kCAAkC,EAAE,MAAM,uCAAuC,CAAA;AAC1F,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AACjF,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAA;AAE/E,KAAK,oCAAoC,GAAG;IAC1C,GAAG,EAAE,cAAc,CAAA;IACnB,MAAM,CAAC,EAAE,WAAW,EAAE,CAAA;CACvB,CAAA;AAMD,qBAAa,gBAAgB;IAC3B,SAAgB,UAAU,gCAAsC;IAChE,SAAgB,UAAU,2BAAiC;IAC3D,SAAgB,QAAQ,0BAAgC;IACxD,SAAgB,WAAW,qCAA2C;IACtE,SAAgB,WAAW,cAAoB;IAC/C,SAAgB,MAAM,EAAE,6BAA6B,CAAA;IACrD,SAAgB,GAAG,EAAE,cAAc,CAAA;IACnC,OAAO,CAAC,qBAAqB,CAAsB;IACnD,OAAO,CAAC,qBAAqB,CAAQ;IAErC,SAAgB,iBAAiB,kDAA+B;IAChE,SAAgB,KAAK,yCAAgB;IAErC,SAAgB,eAAe,kDAA0D;IACzF,SAAgB,YAAY,gDAAgC;IAE5D,SAAgB,UAAU,+CAAyB;IAEnD,SAAgB,SAAS,aAMxB;IAED,SAAgB,WAAW,aAO1B;gBAEW,MAAM,EAAE,oCAAoC;IAiBjD,oBAAoB,CAAC,WAAW,EAAE,WAAW,EAAE;IAMtD,OAAO,CAAC,8BAA8B;IAoBtC,OAAO,CAAC,0BAA0B;IAalC,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CA6DhC;IAEF,OAAO,CAAC,WAAW,CAmCjB;IAEK,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO;IAI9C,cAAc,IAAI,sBAAsB,EAAE;IAI1C,kBAAkB;IAIlB,OAAO;IAWP,eAAe,iDAUpB;CACH"}
@@ -1,7 +1,7 @@
1
- export declare class DropdownModel {
1
+ export declare class VoiceTranscriptionModel {
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=Dropdown.model.d.ts.map
7
+ //# sourceMappingURL=VoiceTranscription.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VoiceTranscription.model.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/VoiceTranscription.model.ts"],"names":[],"mappings":"AAEA,qBAAa,uBAAuB;IAClC,SAAgB,YAAY,yCAAgB;IAC5C,SAAgB,WAAW,4CAAyB;IACpD,SAAgB,KAAK,yCAAgB;IAErC,SAAgB,WAAW,4CAEP;CACrB"}
@@ -0,0 +1,7 @@
1
+ export declare class VoiceTranscriptionTranslationModel {
2
+ readonly toggle: import("effector").EventCallable<void>;
3
+ readonly setActive: import("effector").EventCallable<boolean>;
4
+ readonly reset: import("effector").EventCallable<void>;
5
+ readonly $isActive: import("effector").StoreWritable<boolean>;
6
+ }
7
+ //# sourceMappingURL=VoiceTranscriptionTranslation.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VoiceTranscriptionTranslation.model.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/VoiceTranscriptionTranslation.model.ts"],"names":[],"mappings":"AAEA,qBAAa,kCAAkC;IAC7C,SAAgB,MAAM,yCAAgB;IACtC,SAAgB,SAAS,4CAAyB;IAClD,SAAgB,KAAK,yCAAgB;IAErC,SAAgB,SAAS,4CAEL;CACrB"}
@@ -1,5 +1,5 @@
1
1
  import { VoiceTranscriptionItem } from '../../types';
2
- export declare class TranscriptionsCollection {
2
+ export declare class VoiceTranscriptionsCollection {
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 TranscriptionsCollection {
10
10
  hasTranscript(attemptNumber: number): boolean;
11
11
  hasAudio(attemptNumber: number): boolean;
12
12
  }
13
- //# sourceMappingURL=TranscriptionsCollection.d.ts.map
13
+ //# sourceMappingURL=VoiceTranscriptionsCollection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VoiceTranscriptionsCollection.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/voice/playing/model/VoiceTranscriptionsCollection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAEpD,qBAAa,6BAA6B;IACxC,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"}
@@ -2,8 +2,6 @@ import { WithAbortSignal } from 'src/types/common.types';
2
2
  import { getAvailableInputs } from './helpers';
3
3
  import { VoiceRecordModel } from './recording/model/VoiceRecord.model';
4
4
  import { AxiosResponse } from 'axios';
5
- import type { GoogleTranslateProps as GoogleTranslatePayload, GoogleTranslateResponse } from '../translation/providers/google.types';
6
- export type { GoogleTranslatePayload, GoogleTranslateResponse };
7
5
  export type VoiceRecordNotificationTypes = {
8
6
  success: (message: string) => void;
9
7
  info: (message: string) => void;
@@ -56,14 +54,12 @@ export type VoicePlayerApi = {
56
54
  downloadAudioFile: (audioFileId: string, options?: {
57
55
  signal?: AbortSignal;
58
56
  }) => Promise<AxiosResponse<Blob>>;
59
- translateText: (payload: GoogleTranslatePayload) => Promise<GoogleTranslateResponse>;
60
57
  };
61
58
  export type VoiceTranscriptionItem = {
62
59
  attemptNumber: number;
63
60
  audioFileId: string;
64
61
  _id: string;
65
62
  transcript?: string;
66
- transcriptLanguage?: string;
67
63
  transcriptLoading?: boolean;
68
64
  transcriptError?: string;
69
65
  audioUri?: string;
@@ -81,4 +77,5 @@ export declare enum VoiceTranscriptionVariant {
81
77
  SMALL = "small",
82
78
  LARGE = "large"
83
79
  }
80
+ export {};
84
81
  //# 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;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,CA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voice';
15
15
  export * from './features/featureUsage';
16
16
  export * from './features/uiMode';
17
- export * from './features/translation';
18
17
  //# sourceMappingURL=index.d.ts.map
@@ -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;AACjC,cAAc,wBAAwB,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"}
package/package.json CHANGED
@@ -1,39 +1,12 @@
1
1
  {
2
2
  "name": "@magmamath/students-features",
3
- "version": "1.3.23-rc.21",
3
+ "version": "1.3.23-rc.3",
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
- },
37
10
  "files": [
38
11
  "src",
39
12
  "dist",
@@ -9,4 +9,3 @@ export * from './playing/components/VoiceTranscription'
9
9
  export * from './playing/components/VoiceIcon'
10
10
  export * from './constants'
11
11
  export * from './types'
12
- export type { WithAbortSignal } from '../../types/common.types'
@@ -1,10 +1,13 @@
1
- import { Typography, COLORS, SPACING } from '@magmamath/react-native-ui'
2
- import React from 'react'
1
+ import { Typography, COLORS } from '@magmamath/react-native-ui'
2
+ import { useUnit } from 'effector-react'
3
+ import React, { useCallback, useMemo } from 'react'
3
4
  import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native'
4
5
  import Animated from 'react-native-reanimated'
6
+ import { NO_AUDIO_BE_MESSAGE } from '../../constants'
7
+ import { getActiveAttempt } from '../../helpers'
5
8
  import { AnswerAudio, VoiceTranscriptionVariant } from '../../types'
6
9
  import { useText } from '../../../../i18n/i18n'
7
- import { useVoiceTranscriptionController } from '../hooks/useVoiceTranscriptionController'
10
+ import { useVoiceTranscriptionEffects } from '../hooks/useVoiceTranscriptionEffects'
8
11
  import { VoicePlayerModel } from '../model'
9
12
  import { VoiceTranscriptContent } from './VoiceTranscriptContent'
10
13
  import { VoiceTranscriptionCollapsible } from './VoiceTranscriptionCollapsible'
@@ -30,44 +33,67 @@ export const VoiceTranscription = ({
30
33
  variant = VoiceTranscriptionVariant.SMALL,
31
34
  }: VoiceTranscriptionProps) => {
32
35
  const t = useText()
33
- const { display, flags, actions } = useVoiceTranscriptionController({
34
- model,
35
- answers,
36
- attemptOffset,
37
- attemptsCount,
38
- problemId,
39
- })
36
+
37
+ const [playerState, isLoadingTranscripts, isTranslationActive] = useUnit([
38
+ model.$playerState,
39
+ model.loader.loadAllTranscripts.pending,
40
+ model.translation.$isActive,
41
+ ])
42
+
43
+ const activeAttempt = getActiveAttempt(attemptOffset, attemptsCount)
40
44
  const isLargeVariant = variant === VoiceTranscriptionVariant.LARGE
41
45
 
46
+ const answersKey = useMemo(
47
+ () => answers.map((a) => `${a._id}:${a.audioFileId ?? ''}`).join(','),
48
+ [answers],
49
+ )
50
+
51
+ useVoiceTranscriptionEffects({ model, answers, answersKey, problemId, activeAttempt })
52
+
53
+ const hasActiveTranscript =
54
+ activeAttempt !== null && answers?.[activeAttempt - 1]?.audioFileId !== undefined
55
+
56
+ const activeTranscript = activeAttempt !== null ? model.loader.getTranscript(activeAttempt) : null
57
+ const hasTranscriptText = !!activeTranscript && activeTranscript !== NO_AUDIO_BE_MESSAGE
58
+ const isActiveTranscriptLoading = isLoadingTranscripts && hasActiveTranscript && !activeTranscript
59
+ const activeTranscriptText = hasTranscriptText
60
+ ? activeTranscript
61
+ : t('voice.transcriptNotAvailable')
62
+
63
+ const handlePlayPress = useCallback(() => {
64
+ if (activeAttempt) {
65
+ model.translation.setActive(false)
66
+ model.togglePlayPause(activeAttempt)
67
+ }
68
+ }, [model, activeAttempt])
69
+
70
+ const handleTranslationToggle = useCallback(() => {
71
+ model.translation.toggle()
72
+ }, [model])
73
+
42
74
  return (
43
- <Animated.View
44
- style={[
45
- styles.container,
46
- isLargeVariant ? styles.largeContainer : styles.smallContainer,
47
- style,
48
- ]}
49
- >
75
+ <Animated.View style={[styles.container, isLargeVariant && styles.largeContainer, style]}>
50
76
  <View style={styles.header}>
51
77
  <Typography style={styles.title} variant="h7">
52
78
  {t('voice.transcriptions')}
53
79
  </Typography>
54
- {flags.anyAttemptHasAudio && (
80
+ {hasActiveTranscript && (
55
81
  <VoiceTranscriptionHeaderActions
56
- playerState={flags.playerState}
57
- isTranslationActive={flags.isTranslationActive}
58
- canTranslate={flags.canTranslate}
59
- onPlayPress={actions.onPlayPress}
60
- onTranslationPress={actions.onTranslationToggle}
82
+ playerState={playerState}
83
+ isTranslationActive={isTranslationActive}
84
+ canTranslate={hasTranscriptText}
85
+ onPlayPress={handlePlayPress}
86
+ onTranslationPress={handleTranslationToggle}
61
87
  />
62
88
  )}
63
89
  </View>
64
90
 
65
91
  {isLargeVariant ? (
66
- <VoiceTranscriptContent text={display.text} isLoading={display.isLoading} />
92
+ <VoiceTranscriptContent text={activeTranscriptText} isLoading={isActiveTranscriptLoading} />
67
93
  ) : (
68
94
  <VoiceTranscriptionCollapsible
69
- text={display.text}
70
- isLoading={display.isLoading}
95
+ text={activeTranscriptText}
96
+ isLoading={isActiveTranscriptLoading}
71
97
  dropdown={model.dropdown}
72
98
  />
73
99
  )}
@@ -77,30 +103,21 @@ export const VoiceTranscription = ({
77
103
 
78
104
  const styles = StyleSheet.create({
79
105
  container: {
80
- padding: 4,
81
- boxShadow: '0px 1px 3px 0px rgba(51, 51, 51, 0.25)',
82
- borderRadius: 12,
83
- backgroundColor: COLORS.NEUTRAL_1,
84
- overflow: 'hidden',
85
- },
86
- // SMALL: floats over the drawing area; consumer-positioned siblings sit
87
- // beneath it. Absolute positioning is intentional here.
88
- smallContainer: {
89
106
  position: 'absolute',
90
107
  top: 56,
91
- left: SPACING[200],
108
+ left: 8,
92
109
  width: 222,
93
110
  maxHeight: 405,
94
111
  minHeight: 51,
112
+ padding: 4,
113
+ boxShadow: '0px 1px 3px 0px rgba(51, 51, 51, 0.25)',
114
+ borderRadius: 12,
115
+ backgroundColor: COLORS.NEUTRAL_1,
116
+ overflow: 'hidden',
95
117
  },
96
- // LARGE: rendered as a flex child of the SolutionCard's column flow,
97
- // between the header and footer. Auto-sizes to whatever space the footer
98
- // (with or without the playable timeline) leaves — no magic numbers.
99
118
  largeContainer: {
100
- flex: 1,
101
- marginHorizontal: SPACING[200],
102
- marginTop: SPACING[200],
103
- marginBottom: SPACING[200],
119
+ width: '98%',
120
+ height: '100%',
104
121
  },
105
122
  header: {
106
123
  flexDirection: 'row',
@@ -2,8 +2,8 @@ import { CaretDownIcon } from '@magmamath/react-native-ui'
2
2
  import React, { useCallback } from 'react'
3
3
  import { StyleSheet, TouchableOpacity, View } from 'react-native'
4
4
  import Animated from 'react-native-reanimated'
5
- import { useDropdownAnimation } from '../hooks/useDropdownAnimation'
6
- import { DropdownModel } from '../model/Dropdown.model'
5
+ import { useVoiceTranscriptionDropdown } from '../hooks/useVoiceTranscription'
6
+ import { VoiceTranscriptionModel } from '../model/VoiceTranscription.model'
7
7
  import { VoiceTranscriptContent } from './VoiceTranscriptContent'
8
8
 
9
9
  const AnimatedTouchableOpacity = Animated.createAnimatedComponent(TouchableOpacity)
@@ -11,7 +11,7 @@ const AnimatedTouchableOpacity = Animated.createAnimatedComponent(TouchableOpaci
11
11
  type VoiceTranscriptionCollapsibleProps = {
12
12
  text: string
13
13
  isLoading: boolean
14
- dropdown: DropdownModel
14
+ dropdown: VoiceTranscriptionModel
15
15
  }
16
16
 
17
17
  export const VoiceTranscriptionCollapsible = ({
@@ -20,7 +20,7 @@ export const VoiceTranscriptionCollapsible = ({
20
20
  dropdown,
21
21
  }: VoiceTranscriptionCollapsibleProps) => {
22
22
  const { listAnimatedStyle, iconAnimatedStyle, onListLayout } =
23
- useDropdownAnimation(dropdown)
23
+ useVoiceTranscriptionDropdown(dropdown)
24
24
 
25
25
  const handleToggle = useCallback(() => {
26
26
  dropdown.toggleExpand()
@@ -1,6 +1,7 @@
1
1
  import { Button, COLORS, GlobeIcon, SPACING } from '@magmamath/react-native-ui'
2
2
  import React from 'react'
3
- import { StyleSheet, View } from 'react-native'
3
+ import { StyleSheet } from 'react-native'
4
+ import Animated, { FadeIn, FadeOut } from 'react-native-reanimated'
4
5
  import { ColorScheme } from '../../../chatbot/types/style.types'
5
6
  import { PlayButton } from '../../../../shared/components/PlayButton'
6
7
  import { PlayerState } from '../model'
@@ -28,24 +29,27 @@ export const VoiceTranscriptionHeaderActions = ({
28
29
  }
29
30
 
30
31
  return (
31
- <View style={styles.container}>
32
+ <Animated.View
33
+ entering={FadeIn.duration(120)}
34
+ exiting={FadeOut.duration(120)}
35
+ style={styles.container}
36
+ >
32
37
  <PlayButton
33
38
  state={playButtonState}
34
39
  onPress={onPlayPress}
35
40
  activityIndicatorColor={COLORS.NEUTRAL_1}
36
- colorScheme={ColorScheme.Yellow}
37
41
  />
38
42
  {canTranslate && (
39
43
  <Button
40
44
  variant="secondary"
41
45
  size="small"
42
- colorScheme={ColorScheme.Yellow}
46
+ colorScheme={ColorScheme.Blue}
43
47
  isActive={isTranslationActive}
44
48
  onPress={onTranslationPress}
45
49
  icon={<GlobeIcon color={isTranslationActive ? COLORS.NEUTRAL_1 : COLORS.NEUTRAL_9} />}
46
50
  />
47
51
  )}
48
- </View>
52
+ </Animated.View>
49
53
  )
50
54
  }
51
55
 
@@ -55,7 +59,4 @@ const styles = StyleSheet.create({
55
59
  alignItems: 'center',
56
60
  gap: SPACING[200],
57
61
  },
58
- hidden: {
59
- opacity: 0,
60
- },
61
62
  })
@@ -1,11 +1,11 @@
1
1
  import { useEffect } from 'react'
2
2
  import { useUnit } from 'effector-react'
3
3
  import { useAnimatedStyle, useSharedValue, withTiming, interpolate } from 'react-native-reanimated'
4
- import { DropdownModel } from '../model/Dropdown.model'
4
+ import { VoiceTranscriptionModel } from '../model/VoiceTranscription.model'
5
5
  import { DROPDOWN_MAX_CONTENT_HEIGHT } from '../../constants'
6
6
  import { LayoutChangeEvent } from 'react-native'
7
7
 
8
- export const useDropdownAnimation = (model: DropdownModel) => {
8
+ export const useVoiceTranscriptionDropdown = (model: VoiceTranscriptionModel) => {
9
9
  const isExpanded = useUnit(model.$isExpanded)
10
10
 
11
11
  const contentHeight = useSharedValue(0)
@@ -13,9 +13,9 @@ export const useDropdownAnimation = (model: DropdownModel) => {
13
13
 
14
14
  const onListLayout = (event: LayoutChangeEvent) => {
15
15
  const measuredHeight = event.nativeEvent.layout.height
16
- if (measuredHeight <= 0) return
17
- contentHeight.value =
18
- contentHeight.value === 0 ? measuredHeight : withTiming(measuredHeight, { duration: 180 })
16
+ if (measuredHeight > 0) {
17
+ contentHeight.value = measuredHeight
18
+ }
19
19
  }
20
20
 
21
21
  const listAnimatedStyle = useAnimatedStyle(() => {
@@ -0,0 +1,44 @@
1
+ import { useEffect, useRef } from 'react'
2
+ import { AnswerAudio } from '../../types'
3
+ import { VoicePlayerModel } from '../model'
4
+
5
+ type Params = {
6
+ model: VoicePlayerModel
7
+ answers: AnswerAudio[]
8
+ answersKey: string
9
+ problemId: string
10
+ activeAttempt: number | null
11
+ }
12
+
13
+ export const useVoiceTranscriptionEffects = ({
14
+ model,
15
+ answers,
16
+ answersKey,
17
+ problemId,
18
+ activeAttempt,
19
+ }: Params) => {
20
+ const answersRef = useRef(answers)
21
+ answersRef.current = answers
22
+
23
+ useEffect(() => {
24
+ model.reinitializePlayer()
25
+ return () => model.cleanup()
26
+ }, [model])
27
+
28
+ useEffect(() => {
29
+ const lastAnswerHasNoDrawing = !answers[answers.length - 1]?.drawing
30
+ model.dropdown.setExpanded(answers.length > 0 && lastAnswerHasNoDrawing)
31
+ model.resetPlayer()
32
+ }, [problemId])
33
+
34
+ useEffect(() => {
35
+ if (answersRef.current.some((answer) => answer.audioFileId)) {
36
+ model.initializeWithAudios(answersRef.current)
37
+ model.loader.loadAllTranscripts()
38
+ }
39
+ }, [model, answersKey])
40
+
41
+ useEffect(() => {
42
+ model.stopAudio()
43
+ }, [activeAttempt])
44
+ }
@@ -11,7 +11,6 @@ export const enum PlayerState {
11
11
  export class PlayerModel {
12
12
  public player: AudioPlayer | null = createAudioPlayer()
13
13
  private stopped = false
14
- private primedUri: string | null = null
15
14
 
16
15
  public readonly reset = createEvent()
17
16
  public readonly setPlayerState = createEvent<PlayerState>()
@@ -40,32 +39,12 @@ export class PlayerModel {
40
39
  this.stopped = true
41
40
  if (this.player) {
42
41
  this.player.replace('')
43
- this.primedUri = null
44
42
  this.setPlayerState(PlayerState.IDLE)
45
43
  } else {
46
44
  console.warn('Cannot stop: audio player not initialized')
47
45
  }
48
46
  })
49
47
 
50
- public readonly prime = createEffect((uri: string) => {
51
- if (!this.player) return
52
- if (this.primedUri === uri) return
53
- this.primedUri = uri
54
- this.player.replace(uri)
55
- })
56
-
57
- public readonly seek = createEffect(async (seconds: number) => {
58
- if (!this.player) {
59
- console.warn('Cannot seek: audio player not initialized')
60
- return
61
- }
62
- if (!this.player.isLoaded) {
63
- console.warn('Cannot seek: audio player not loaded')
64
- return
65
- }
66
- await this.player.seekTo(seconds)
67
- })
68
-
69
48
  public readonly resume = createEffect(() => {
70
49
  if (this.player) {
71
50
  this.player.play()
@@ -82,10 +61,7 @@ export class PlayerModel {
82
61
  }
83
62
 
84
63
  this.stopped = false
85
- if (this.primedUri !== uri) {
86
- this.player.replace(uri)
87
- this.primedUri = uri
88
- }
64
+ this.player.replace(uri)
89
65
 
90
66
  const waitForLoad = () => {
91
67
  if (this.stopped) return
@@ -123,7 +99,6 @@ export class PlayerModel {
123
99
  this.player.release()
124
100
  this.player = null
125
101
  }
126
- this.primedUri = null
127
102
  this.reset()
128
103
  }
129
104
  }
@@ -0,0 +1,80 @@
1
+ import { createEffect, createEvent, restore } from 'effector'
2
+ import { VoiceTranscriptionsCollection } from './VoiceTranscriptionsCollection'
3
+ import { VoicePlayerApi } from '../../types'
4
+ import {
5
+ NO_AUDIO_BE_MESSAGE,
6
+ TRANSCRIPT_MAX_RETRIES,
7
+ TRANSCRIPT_RETRY_INTERVAL_MS,
8
+ } from '../../constants'
9
+
10
+ export class TranscriptionsDownloaderModel {
11
+ private readonly collection: VoiceTranscriptionsCollection
12
+ private readonly api: VoicePlayerApi
13
+
14
+ public readonly setTranscriptsLoaded = createEvent<boolean>()
15
+ public readonly reset = createEvent()
16
+
17
+ public readonly $transcriptsLoaded = restore(this.setTranscriptsLoaded, false).reset(this.reset)
18
+
19
+ constructor(collection: VoiceTranscriptionsCollection, api: VoicePlayerApi) {
20
+ this.collection = collection
21
+ this.api = api
22
+ }
23
+
24
+ private async fetchTranscriptWithRetry(audioFileId: string): Promise<string> {
25
+ for (let attempt = 0; attempt < TRANSCRIPT_MAX_RETRIES; attempt++) {
26
+ const response = await this.api.getAudioFileTranscript(audioFileId)
27
+
28
+ if (response.status === 'completed') {
29
+ return response.text
30
+ }
31
+
32
+ if (response.status === 'failed') {
33
+ return NO_AUDIO_BE_MESSAGE
34
+ }
35
+
36
+ if (attempt < TRANSCRIPT_MAX_RETRIES - 1) {
37
+ await new Promise((resolve) => setTimeout(resolve, TRANSCRIPT_RETRY_INTERVAL_MS))
38
+ }
39
+ }
40
+ return NO_AUDIO_BE_MESSAGE
41
+ }
42
+
43
+ public readonly loadAllTranscripts = createEffect(async () => {
44
+ const attempts = this.collection.getAll()
45
+
46
+ const transcriptPromises = attempts.map(async (item) => {
47
+ if (this.collection.hasTranscript(item.attemptNumber)) {
48
+ return
49
+ }
50
+
51
+ this.collection.update(item.attemptNumber, { transcriptLoading: true })
52
+
53
+ try {
54
+ const text = await this.fetchTranscriptWithRetry(item.audioFileId)
55
+
56
+ this.collection.update(item.attemptNumber, {
57
+ transcript: text,
58
+ transcriptLoading: false,
59
+ transcriptError: undefined,
60
+ })
61
+ } catch (error) {
62
+ this.collection.update(item.attemptNumber, {
63
+ transcriptLoading: false,
64
+ transcriptError: error instanceof Error ? error.message : 'Failed to load transcript',
65
+ })
66
+ }
67
+ })
68
+
69
+ await Promise.all(transcriptPromises)
70
+ this.setTranscriptsLoaded(true)
71
+ })
72
+
73
+ public getTranscript(attemptNumber: number): string | undefined {
74
+ return this.collection.get(attemptNumber)?.transcript
75
+ }
76
+
77
+ public isTranscriptLoading(attemptNumber: number): boolean {
78
+ return this.collection.get(attemptNumber)?.transcriptLoading || false
79
+ }
80
+ }
@@ -13,9 +13,9 @@ type DownloadResult = {
13
13
  }
14
14
 
15
15
  export class VoiceFileDownloaderModel {
16
- private readonly api: VoicePlayerApi
16
+ private api!: VoicePlayerApi
17
17
 
18
- constructor(api: VoicePlayerApi) {
18
+ public readonly setApi = (api: VoicePlayerApi) => {
19
19
  this.api = api
20
20
  }
21
21