@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
@@ -2,7 +2,8 @@
2
2
 
3
3
  import { Button, COLORS, GlobeIcon, SPACING } from '@magmamath/react-native-ui';
4
4
  import React from 'react';
5
- import { StyleSheet, View } from 'react-native';
5
+ import { StyleSheet } from 'react-native';
6
+ import Animated, { FadeIn, FadeOut } from 'react-native-reanimated';
6
7
  import { ColorScheme } from "../../../chatbot/types/style.types.js";
7
8
  import { PlayButton } from "../../../../shared/components/PlayButton.js";
8
9
  import { PlayerState } from "../model/index.js";
@@ -20,17 +21,18 @@ export const VoiceTranscriptionHeaderActions = ({
20
21
  isLoading: playerState === PlayerState.LOADING,
21
22
  status: getAudioStatus(playerState)
22
23
  };
23
- return /*#__PURE__*/_jsxs(View, {
24
+ return /*#__PURE__*/_jsxs(Animated.View, {
25
+ entering: FadeIn.duration(120),
26
+ exiting: FadeOut.duration(120),
24
27
  style: styles.container,
25
28
  children: [/*#__PURE__*/_jsx(PlayButton, {
26
29
  state: playButtonState,
27
30
  onPress: onPlayPress,
28
- activityIndicatorColor: COLORS.NEUTRAL_1,
29
- colorScheme: ColorScheme.Yellow
31
+ activityIndicatorColor: COLORS.NEUTRAL_1
30
32
  }), canTranslate && /*#__PURE__*/_jsx(Button, {
31
33
  variant: "secondary",
32
34
  size: "small",
33
- colorScheme: ColorScheme.Yellow,
35
+ colorScheme: ColorScheme.Blue,
34
36
  isActive: isTranslationActive,
35
37
  onPress: onTranslationPress,
36
38
  icon: /*#__PURE__*/_jsx(GlobeIcon, {
@@ -44,9 +46,6 @@ const styles = StyleSheet.create({
44
46
  flexDirection: 'row',
45
47
  alignItems: 'center',
46
48
  gap: SPACING[200]
47
- },
48
- hidden: {
49
- opacity: 0
50
49
  }
51
50
  });
52
51
  //# sourceMappingURL=VoiceTranscriptionHeaderActions.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Button","COLORS","GlobeIcon","SPACING","React","StyleSheet","View","ColorScheme","PlayButton","PlayerState","getAudioStatus","jsx","_jsx","jsxs","_jsxs","VoiceTranscriptionHeaderActions","playerState","isTranslationActive","canTranslate","onPlayPress","onTranslationPress","playButtonState","isActive","IDLE","isLoading","LOADING","status","style","styles","container","children","state","onPress","activityIndicatorColor","NEUTRAL_1","colorScheme","Yellow","variant","size","icon","color","NEUTRAL_9","create","flexDirection","alignItems","gap","hidden","opacity"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/components/VoiceTranscriptionHeaderActions.tsx"],"mappings":";;AAAA,SAASA,MAAM,EAAEC,MAAM,EAAEC,SAAS,EAAEC,OAAO,QAAQ,4BAA4B;AAC/E,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SAASC,WAAW,QAAQ,uCAAoC;AAChE,SAASC,UAAU,QAAQ,6CAA0C;AACrE,SAASC,WAAW,QAAQ,mBAAU;AACtC,SAASC,cAAc,QAAQ,kBAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAU9C,OAAO,MAAMC,+BAA+B,GAAGA,CAAC;EAC9CC,WAAW;EACXC,mBAAmB;EACnBC,YAAY;EACZC,WAAW;EACXC;AACqC,CAAC,KAAK;EAC3C,MAAMC,eAAe,GAAG;IACtBC,QAAQ,EAAEN,WAAW,KAAKP,WAAW,CAACc,IAAI;IAC1CC,SAAS,EAAER,WAAW,KAAKP,WAAW,CAACgB,OAAO;IAC9CC,MAAM,EAAEhB,cAAc,CAACM,WAAW;EACpC,CAAC;EAED,oBACEF,KAAA,CAACR,IAAI;IAACqB,KAAK,EAAEC,MAAM,CAACC,SAAU;IAAAC,QAAA,gBAC5BlB,IAAA,CAACJ,UAAU;MACTuB,KAAK,EAAEV,eAAgB;MACvBW,OAAO,EAAEb,WAAY;MACrBc,sBAAsB,EAAEhC,MAAM,CAACiC,SAAU;MACzCC,WAAW,EAAE5B,WAAW,CAAC6B;IAAO,CACjC,CAAC,EACDlB,YAAY,iBACXN,IAAA,CAACZ,MAAM;MACLqC,OAAO,EAAC,WAAW;MACnBC,IAAI,EAAC,OAAO;MACZH,WAAW,EAAE5B,WAAW,CAAC6B,MAAO;MAChCd,QAAQ,EAAEL,mBAAoB;MAC9Be,OAAO,EAAEZ,kBAAmB;MAC5BmB,IAAI,eAAE3B,IAAA,CAACV,SAAS;QAACsC,KAAK,EAAEvB,mBAAmB,GAAGhB,MAAM,CAACiC,SAAS,GAAGjC,MAAM,CAACwC;MAAU,CAAE;IAAE,CACvF,CACF;EAAA,CACG,CAAC;AAEX,CAAC;AAED,MAAMb,MAAM,GAAGvB,UAAU,CAACqC,MAAM,CAAC;EAC/Bb,SAAS,EAAE;IACTc,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,GAAG,EAAE1C,OAAO,CAAC,GAAG;EAClB,CAAC;EACD2C,MAAM,EAAE;IACNC,OAAO,EAAE;EACX;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Button","COLORS","GlobeIcon","SPACING","React","StyleSheet","Animated","FadeIn","FadeOut","ColorScheme","PlayButton","PlayerState","getAudioStatus","jsx","_jsx","jsxs","_jsxs","VoiceTranscriptionHeaderActions","playerState","isTranslationActive","canTranslate","onPlayPress","onTranslationPress","playButtonState","isActive","IDLE","isLoading","LOADING","status","View","entering","duration","exiting","style","styles","container","children","state","onPress","activityIndicatorColor","NEUTRAL_1","variant","size","colorScheme","Blue","icon","color","NEUTRAL_9","create","flexDirection","alignItems","gap"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/components/VoiceTranscriptionHeaderActions.tsx"],"mappings":";;AAAA,SAASA,MAAM,EAAEC,MAAM,EAAEC,SAAS,EAAEC,OAAO,QAAQ,4BAA4B;AAC/E,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,cAAc;AACzC,OAAOC,QAAQ,IAAIC,MAAM,EAAEC,OAAO,QAAQ,yBAAyB;AACnE,SAASC,WAAW,QAAQ,uCAAoC;AAChE,SAASC,UAAU,QAAQ,6CAA0C;AACrE,SAASC,WAAW,QAAQ,mBAAU;AACtC,SAASC,cAAc,QAAQ,kBAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAU9C,OAAO,MAAMC,+BAA+B,GAAGA,CAAC;EAC9CC,WAAW;EACXC,mBAAmB;EACnBC,YAAY;EACZC,WAAW;EACXC;AACqC,CAAC,KAAK;EAC3C,MAAMC,eAAe,GAAG;IACtBC,QAAQ,EAAEN,WAAW,KAAKP,WAAW,CAACc,IAAI;IAC1CC,SAAS,EAAER,WAAW,KAAKP,WAAW,CAACgB,OAAO;IAC9CC,MAAM,EAAEhB,cAAc,CAACM,WAAW;EACpC,CAAC;EAED,oBACEF,KAAA,CAACV,QAAQ,CAACuB,IAAI;IACZC,QAAQ,EAAEvB,MAAM,CAACwB,QAAQ,CAAC,GAAG,CAAE;IAC/BC,OAAO,EAAExB,OAAO,CAACuB,QAAQ,CAAC,GAAG,CAAE;IAC/BE,KAAK,EAAEC,MAAM,CAACC,SAAU;IAAAC,QAAA,gBAExBtB,IAAA,CAACJ,UAAU;MACT2B,KAAK,EAAEd,eAAgB;MACvBe,OAAO,EAAEjB,WAAY;MACrBkB,sBAAsB,EAAEtC,MAAM,CAACuC;IAAU,CAC1C,CAAC,EACDpB,YAAY,iBACXN,IAAA,CAACd,MAAM;MACLyC,OAAO,EAAC,WAAW;MACnBC,IAAI,EAAC,OAAO;MACZC,WAAW,EAAElC,WAAW,CAACmC,IAAK;MAC9BpB,QAAQ,EAAEL,mBAAoB;MAC9BmB,OAAO,EAAEhB,kBAAmB;MAC5BuB,IAAI,eAAE/B,IAAA,CAACZ,SAAS;QAAC4C,KAAK,EAAE3B,mBAAmB,GAAGlB,MAAM,CAACuC,SAAS,GAAGvC,MAAM,CAAC8C;MAAU,CAAE;IAAE,CACvF,CACF;EAAA,CACY,CAAC;AAEpB,CAAC;AAED,MAAMb,MAAM,GAAG7B,UAAU,CAAC2C,MAAM,CAAC;EAC/Bb,SAAS,EAAE;IACTc,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,GAAG,EAAEhD,OAAO,CAAC,GAAG;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -4,16 +4,15 @@ import { useEffect } from 'react';
4
4
  import { useUnit } from 'effector-react';
5
5
  import { useAnimatedStyle, useSharedValue, withTiming, interpolate } from 'react-native-reanimated';
6
6
  import { DROPDOWN_MAX_CONTENT_HEIGHT } from "../../constants.js";
7
- export const useDropdownAnimation = model => {
7
+ export const useVoiceTranscriptionDropdown = model => {
8
8
  const isExpanded = useUnit(model.$isExpanded);
9
9
  const contentHeight = useSharedValue(0);
10
10
  const animationProgress = useSharedValue(isExpanded ? 1 : 0);
11
11
  const onListLayout = event => {
12
12
  const measuredHeight = event.nativeEvent.layout.height;
13
- if (measuredHeight <= 0) return;
14
- contentHeight.value = contentHeight.value === 0 ? measuredHeight : withTiming(measuredHeight, {
15
- duration: 180
16
- });
13
+ if (measuredHeight > 0) {
14
+ contentHeight.value = measuredHeight;
15
+ }
17
16
  };
18
17
  const listAnimatedStyle = useAnimatedStyle(() => {
19
18
  const height = interpolate(animationProgress.value, [0, 1], [0, contentHeight.value || DROPDOWN_MAX_CONTENT_HEIGHT]);
@@ -43,4 +42,4 @@ export const useDropdownAnimation = model => {
43
42
  onListLayout
44
43
  };
45
44
  };
46
- //# sourceMappingURL=useDropdownAnimation.js.map
45
+ //# sourceMappingURL=useVoiceTranscription.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useEffect","useUnit","useAnimatedStyle","useSharedValue","withTiming","interpolate","DROPDOWN_MAX_CONTENT_HEIGHT","useVoiceTranscriptionDropdown","model","isExpanded","$isExpanded","contentHeight","animationProgress","onListLayout","event","measuredHeight","nativeEvent","layout","height","value","listAnimatedStyle","opacity","iconAnimatedStyle","rotation","transform","rotate","duration"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/hooks/useVoiceTranscription.ts"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,OAAO,QAAQ,gBAAgB;AACxC,SAASC,gBAAgB,EAAEC,cAAc,EAAEC,UAAU,EAAEC,WAAW,QAAQ,yBAAyB;AAEnG,SAASC,2BAA2B,QAAQ,oBAAiB;AAG7D,OAAO,MAAMC,6BAA6B,GAAIC,KAA8B,IAAK;EAC/E,MAAMC,UAAU,GAAGR,OAAO,CAACO,KAAK,CAACE,WAAW,CAAC;EAE7C,MAAMC,aAAa,GAAGR,cAAc,CAAC,CAAC,CAAC;EACvC,MAAMS,iBAAiB,GAAGT,cAAc,CAACM,UAAU,GAAG,CAAC,GAAG,CAAC,CAAC;EAE5D,MAAMI,YAAY,GAAIC,KAAwB,IAAK;IACjD,MAAMC,cAAc,GAAGD,KAAK,CAACE,WAAW,CAACC,MAAM,CAACC,MAAM;IACtD,IAAIH,cAAc,GAAG,CAAC,EAAE;MACtBJ,aAAa,CAACQ,KAAK,GAAGJ,cAAc;IACtC;EACF,CAAC;EAED,MAAMK,iBAAiB,GAAGlB,gBAAgB,CAAC,MAAM;IAC/C,MAAMgB,MAAM,GAAGb,WAAW,CACxBO,iBAAiB,CAACO,KAAK,EACvB,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,CAAC,CAAC,EAAER,aAAa,CAACQ,KAAK,IAAIb,2BAA2B,CACxD,CAAC;IAED,MAAMe,OAAO,GAAGhB,WAAW,CAACO,iBAAiB,CAACO,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAE5E,OAAO;MACLD,MAAM;MACNG;IACF,CAAC;EACH,CAAC,EAAE,CAACT,iBAAiB,EAAED,aAAa,CAAC,CAAC;EAEtC,MAAMW,iBAAiB,GAAGpB,gBAAgB,CAAC,MAAM;IAC/C,MAAMqB,QAAQ,GAAGlB,WAAW,CAACO,iBAAiB,CAACO,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAEvE,OAAO;MACLK,SAAS,EAAE,CAAC;QAAEC,MAAM,EAAE,GAAGF,QAAQ;MAAM,CAAC;IAC1C,CAAC;EACH,CAAC,EAAE,CAACX,iBAAiB,CAAC,CAAC;EAEvBZ,SAAS,CAAC,MAAM;IACdY,iBAAiB,CAACO,KAAK,GAAGf,UAAU,CAACK,UAAU,GAAG,CAAC,GAAG,CAAC,EAAE;MAAEiB,QAAQ,EAAE;IAAI,CAAC,CAAC;EAC7E,CAAC,EAAE,CAACjB,UAAU,EAAEG,iBAAiB,CAAC,CAAC;EAEnC,OAAO;IACLH,UAAU;IACVW,iBAAiB;IACjBE,iBAAiB;IACjBT;EACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ import { useEffect, useRef } from 'react';
4
+ export const useVoiceTranscriptionEffects = ({
5
+ model,
6
+ answers,
7
+ answersKey,
8
+ problemId,
9
+ activeAttempt
10
+ }) => {
11
+ const answersRef = useRef(answers);
12
+ answersRef.current = answers;
13
+ useEffect(() => {
14
+ model.reinitializePlayer();
15
+ return () => model.cleanup();
16
+ }, [model]);
17
+ useEffect(() => {
18
+ const lastAnswerHasNoDrawing = !answers[answers.length - 1]?.drawing;
19
+ model.dropdown.setExpanded(answers.length > 0 && lastAnswerHasNoDrawing);
20
+ model.resetPlayer();
21
+ }, [problemId]);
22
+ useEffect(() => {
23
+ if (answersRef.current.some(answer => answer.audioFileId)) {
24
+ model.initializeWithAudios(answersRef.current);
25
+ model.loader.loadAllTranscripts();
26
+ }
27
+ }, [model, answersKey]);
28
+ useEffect(() => {
29
+ model.stopAudio();
30
+ }, [activeAttempt]);
31
+ };
32
+ //# sourceMappingURL=useVoiceTranscriptionEffects.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useEffect","useRef","useVoiceTranscriptionEffects","model","answers","answersKey","problemId","activeAttempt","answersRef","current","reinitializePlayer","cleanup","lastAnswerHasNoDrawing","length","drawing","dropdown","setExpanded","resetPlayer","some","answer","audioFileId","initializeWithAudios","loader","loadAllTranscripts","stopAudio"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/hooks/useVoiceTranscriptionEffects.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAYzC,OAAO,MAAMC,4BAA4B,GAAGA,CAAC;EAC3CC,KAAK;EACLC,OAAO;EACPC,UAAU;EACVC,SAAS;EACTC;AACM,CAAC,KAAK;EACZ,MAAMC,UAAU,GAAGP,MAAM,CAACG,OAAO,CAAC;EAClCI,UAAU,CAACC,OAAO,GAAGL,OAAO;EAE5BJ,SAAS,CAAC,MAAM;IACdG,KAAK,CAACO,kBAAkB,CAAC,CAAC;IAC1B,OAAO,MAAMP,KAAK,CAACQ,OAAO,CAAC,CAAC;EAC9B,CAAC,EAAE,CAACR,KAAK,CAAC,CAAC;EAEXH,SAAS,CAAC,MAAM;IACd,MAAMY,sBAAsB,GAAG,CAACR,OAAO,CAACA,OAAO,CAACS,MAAM,GAAG,CAAC,CAAC,EAAEC,OAAO;IACpEX,KAAK,CAACY,QAAQ,CAACC,WAAW,CAACZ,OAAO,CAACS,MAAM,GAAG,CAAC,IAAID,sBAAsB,CAAC;IACxET,KAAK,CAACc,WAAW,CAAC,CAAC;EACrB,CAAC,EAAE,CAACX,SAAS,CAAC,CAAC;EAEfN,SAAS,CAAC,MAAM;IACd,IAAIQ,UAAU,CAACC,OAAO,CAACS,IAAI,CAAEC,MAAM,IAAKA,MAAM,CAACC,WAAW,CAAC,EAAE;MAC3DjB,KAAK,CAACkB,oBAAoB,CAACb,UAAU,CAACC,OAAO,CAAC;MAC9CN,KAAK,CAACmB,MAAM,CAACC,kBAAkB,CAAC,CAAC;IACnC;EACF,CAAC,EAAE,CAACpB,KAAK,EAAEE,UAAU,CAAC,CAAC;EAEvBL,SAAS,CAAC,MAAM;IACdG,KAAK,CAACqB,SAAS,CAAC,CAAC;EACnB,CAAC,EAAE,CAACjB,aAAa,CAAC,CAAC;AACrB,CAAC","ignoreList":[]}
@@ -12,7 +12,6 @@ export let PlayerState = /*#__PURE__*/function (PlayerState) {
12
12
  export class PlayerModel {
13
13
  player = createAudioPlayer();
14
14
  stopped = false;
15
- primedUri = null;
16
15
  reset = createEvent();
17
16
  setPlayerState = createEvent();
18
17
  playbackFinished = createEvent();
@@ -36,29 +35,11 @@ export class PlayerModel {
36
35
  this.stopped = true;
37
36
  if (this.player) {
38
37
  this.player.replace('');
39
- this.primedUri = null;
40
38
  this.setPlayerState(PlayerState.IDLE);
41
39
  } else {
42
40
  console.warn('Cannot stop: audio player not initialized');
43
41
  }
44
42
  });
45
- prime = createEffect(uri => {
46
- if (!this.player) return;
47
- if (this.primedUri === uri) return;
48
- this.primedUri = uri;
49
- this.player.replace(uri);
50
- });
51
- seek = createEffect(async seconds => {
52
- if (!this.player) {
53
- console.warn('Cannot seek: audio player not initialized');
54
- return;
55
- }
56
- if (!this.player.isLoaded) {
57
- console.warn('Cannot seek: audio player not loaded');
58
- return;
59
- }
60
- await this.player.seekTo(seconds);
61
- });
62
43
  resume = createEffect(() => {
63
44
  if (this.player) {
64
45
  this.player.play();
@@ -73,10 +54,7 @@ export class PlayerModel {
73
54
  return;
74
55
  }
75
56
  this.stopped = false;
76
- if (this.primedUri !== uri) {
77
- this.player.replace(uri);
78
- this.primedUri = uri;
79
- }
57
+ this.player.replace(uri);
80
58
  const waitForLoad = () => {
81
59
  if (this.stopped) return;
82
60
  if (this.player && this.player.isLoaded) {
@@ -109,7 +87,6 @@ export class PlayerModel {
109
87
  this.player.release();
110
88
  this.player = null;
111
89
  }
112
- this.primedUri = null;
113
90
  this.reset();
114
91
  }
115
92
  }
@@ -1 +1 @@
1
- {"version":3,"names":["createEffect","createEvent","restore","createAudioPlayer","setAudioModeAsync","PlayerState","PlayerModel","player","stopped","primedUri","reset","setPlayerState","playbackFinished","$playerState","IDLE","setupAudioMode","playsInSilentMode","shouldPlayInBackground","interruptionMode","pause","PAUSED","console","warn","stop","replace","prime","uri","seek","seconds","isLoaded","seekTo","resume","play","PLAYING","waitForLoad","unsubscribe","addListener","status","didJustFinish","remove","setTimeout","reinitialize","release","error"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/Player.model.ts"],"mappings":";;AAAA,SAASA,YAAY,EAAEC,WAAW,EAAEC,OAAO,QAAQ,UAAU;AAC7D,SAAsBC,iBAAiB,EAAEC,iBAAiB,QAAQ,YAAY;AAE9E,WAAkBC,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAO7B,OAAO,MAAMC,WAAW,CAAC;EAChBC,MAAM,GAAuBJ,iBAAiB,CAAC,CAAC;EAC/CK,OAAO,GAAG,KAAK;EACfC,SAAS,GAAkB,IAAI;EAEvBC,KAAK,GAAGT,WAAW,CAAC,CAAC;EACrBU,cAAc,GAAGV,WAAW,CAAc,CAAC;EAC3CW,gBAAgB,GAAGX,WAAW,CAAC,CAAC;EAEhCY,YAAY,GAAGX,OAAO,CAAC,IAAI,CAACS,cAAc,EAAEN,WAAW,CAACS,IAAI,CAAC,CAACJ,KAAK,CAAC,IAAI,CAACA,KAAK,CAAC;EAE/EK,cAAc,GAAGf,YAAY,CAAC,YAAY;IACxD,MAAMI,iBAAiB,CAAC;MACtBY,iBAAiB,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4B,OAAO,CAAC;MAC1C,CAAC,MAAM;QACLO,UAAU,CAACN,WAAW,EAAE,EAAE,CAAC;MAC7B;IACF,CAAC;IAEDA,WAAW,CAAC,CAAC;EACf,CAAC,CAAC;EAEKO,YAAYA,CAAA,EAAG;IACpB,IAAI,CAAC,IAAI,CAAClC,MAAM,EAAE;MAChB,IAAI,CAACA,MAAM,GAAGJ,iBAAiB,CAAC,CAAC;IACnC;EACF;EAEOuC,OAAOA,CAAA,EAAG;IACf,IAAI,IAAI,CAACnC,MAAM,EAAE;MACf,IAAI;QACF,IAAI,CAACgB,IAAI,CAAC,CAAC;QACX,IAAI,CAAChB,MAAM,CAACgC,MAAM,CAAC,CAAC;MACtB,CAAC,CAAC,OAAOI,KAAK,EAAE,CAAC;MACjB,IAAI,CAACpC,MAAM,CAACmC,OAAO,CAAC,CAAC;MACrB,IAAI,CAACnC,MAAM,GAAG,IAAI;IACpB;IACA,IAAI,CAACE,SAAS,GAAG,IAAI;IACrB,IAAI,CAACC,KAAK,CAAC,CAAC;EACd;AACF","ignoreList":[]}
1
+ {"version":3,"names":["createEffect","createEvent","restore","createAudioPlayer","setAudioModeAsync","PlayerState","PlayerModel","player","stopped","reset","setPlayerState","playbackFinished","$playerState","IDLE","setupAudioMode","playsInSilentMode","shouldPlayInBackground","interruptionMode","pause","PAUSED","console","warn","stop","replace","resume","play","PLAYING","uri","waitForLoad","isLoaded","unsubscribe","addListener","status","didJustFinish","remove","setTimeout","reinitialize","release","error"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/Player.model.ts"],"mappings":";;AAAA,SAASA,YAAY,EAAEC,WAAW,EAAEC,OAAO,QAAQ,UAAU;AAC7D,SAAsBC,iBAAiB,EAAEC,iBAAiB,QAAQ,YAAY;AAE9E,WAAkBC,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAO7B,OAAO,MAAMC,WAAW,CAAC;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QACF,IAAI,CAACe,IAAI,CAAC,CAAC;QACX,IAAI,CAACf,MAAM,CAAC2B,MAAM,CAAC,CAAC;MACtB,CAAC,CAAC,OAAOI,KAAK,EAAE,CAAC;MACjB,IAAI,CAAC/B,MAAM,CAAC8B,OAAO,CAAC,CAAC;MACrB,IAAI,CAAC9B,MAAM,GAAG,IAAI;IACpB;IACA,IAAI,CAACE,KAAK,CAAC,CAAC;EACd;AACF","ignoreList":[]}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ import { createEffect, createEvent, restore } from 'effector';
4
+ import { NO_AUDIO_BE_MESSAGE, TRANSCRIPT_MAX_RETRIES, TRANSCRIPT_RETRY_INTERVAL_MS } from "../../constants.js";
5
+ export class TranscriptionsDownloaderModel {
6
+ setTranscriptsLoaded = createEvent();
7
+ reset = createEvent();
8
+ $transcriptsLoaded = restore(this.setTranscriptsLoaded, false).reset(this.reset);
9
+ constructor(collection, api) {
10
+ this.collection = collection;
11
+ this.api = api;
12
+ }
13
+ async fetchTranscriptWithRetry(audioFileId) {
14
+ for (let attempt = 0; attempt < TRANSCRIPT_MAX_RETRIES; attempt++) {
15
+ const response = await this.api.getAudioFileTranscript(audioFileId);
16
+ if (response.status === 'completed') {
17
+ return response.text;
18
+ }
19
+ if (response.status === 'failed') {
20
+ return NO_AUDIO_BE_MESSAGE;
21
+ }
22
+ if (attempt < TRANSCRIPT_MAX_RETRIES - 1) {
23
+ await new Promise(resolve => setTimeout(resolve, TRANSCRIPT_RETRY_INTERVAL_MS));
24
+ }
25
+ }
26
+ return NO_AUDIO_BE_MESSAGE;
27
+ }
28
+ loadAllTranscripts = createEffect(async () => {
29
+ const attempts = this.collection.getAll();
30
+ const transcriptPromises = attempts.map(async item => {
31
+ if (this.collection.hasTranscript(item.attemptNumber)) {
32
+ return;
33
+ }
34
+ this.collection.update(item.attemptNumber, {
35
+ transcriptLoading: true
36
+ });
37
+ try {
38
+ const text = await this.fetchTranscriptWithRetry(item.audioFileId);
39
+ this.collection.update(item.attemptNumber, {
40
+ transcript: text,
41
+ transcriptLoading: false,
42
+ transcriptError: undefined
43
+ });
44
+ } catch (error) {
45
+ this.collection.update(item.attemptNumber, {
46
+ transcriptLoading: false,
47
+ transcriptError: error instanceof Error ? error.message : 'Failed to load transcript'
48
+ });
49
+ }
50
+ });
51
+ await Promise.all(transcriptPromises);
52
+ this.setTranscriptsLoaded(true);
53
+ });
54
+ getTranscript(attemptNumber) {
55
+ return this.collection.get(attemptNumber)?.transcript;
56
+ }
57
+ isTranscriptLoading(attemptNumber) {
58
+ return this.collection.get(attemptNumber)?.transcriptLoading || false;
59
+ }
60
+ }
61
+ //# sourceMappingURL=TranscriptionsDownloaderModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createEffect","createEvent","restore","NO_AUDIO_BE_MESSAGE","TRANSCRIPT_MAX_RETRIES","TRANSCRIPT_RETRY_INTERVAL_MS","TranscriptionsDownloaderModel","setTranscriptsLoaded","reset","$transcriptsLoaded","constructor","collection","api","fetchTranscriptWithRetry","audioFileId","attempt","response","getAudioFileTranscript","status","text","Promise","resolve","setTimeout","loadAllTranscripts","attempts","getAll","transcriptPromises","map","item","hasTranscript","attemptNumber","update","transcriptLoading","transcript","transcriptError","undefined","error","Error","message","all","getTranscript","get","isTranscriptLoading"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/TranscriptionsDownloaderModel.ts"],"mappings":";;AAAA,SAASA,YAAY,EAAEC,WAAW,EAAEC,OAAO,QAAQ,UAAU;AAG7D,SACEC,mBAAmB,EACnBC,sBAAsB,EACtBC,4BAA4B,QACvB,oBAAiB;AAExB,OAAO,MAAMC,6BAA6B,CAAC;EAIzBC,oBAAoB,GAAGN,WAAW,CAAU,CAAC;EAC7CO,KAAK,GAAGP,WAAW,CAAC,CAAC;EAErBQ,kBAAkB,GAAGP,OAAO,CAAC,IAAI,CAACK,oBAAoB,EAAE,KAAK,CAAC,CAACC,KAAK,CAAC,IAAI,CAACA,KAAK,CAAC;E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H,IAAI,CAACE,aAAa,EAAE;UACzCG,UAAU,EAAEd,IAAI;UAChBa,iBAAiB,EAAE,KAAK;UACxBE,eAAe,EAAEC;QACnB,CAAC,CAAC;MACJ,CAAC,CAAC,OAAOC,KAAK,EAAE;QACd,IAAI,CAACzB,UAAU,CAACoB,MAAM,CAACH,IAAI,CAACE,aAAa,EAAE;UACzCE,iBAAiB,EAAE,KAAK;UACxBE,eAAe,EAAEE,KAAK,YAAYC,KAAK,GAAGD,KAAK,CAACE,OAAO,GAAG;QAC5D,CAAC,CAAC;MACJ;IACF,CAAC,CAAC;IAEF,MAAMlB,OAAO,CAACmB,GAAG,CAACb,kBAAkB,CAAC;IACrC,IAAI,CAACnB,oBAAoB,CAAC,IAAI,CAAC;EACjC,CAAC,CAAC;EAEKiC,aAAaA,CAACV,aAAqB,EAAsB;IAC9D,OAAO,IAAI,CAACnB,UAAU,CAAC8B,GAAG,CAACX,aAAa,CAAC,EAAEG,UAAU;EACvD;EAEOS,mBAAmBA,CAACZ,aAAqB,EAAW;IACzD,OAAO,IAAI,CAACnB,UAAU,CAAC8B,GAAG,CAACX,aAAa,CAAC,EAAEE,iBAAiB,IAAI,KAAK;EACvE;AACF","ignoreList":[]}
@@ -3,9 +3,9 @@
3
3
  import { createEffect } from 'effector';
4
4
  import { downloadAudioFileRequestGenerator } from "../../helpers.js";
5
5
  export class VoiceFileDownloaderModel {
6
- constructor(api) {
6
+ setApi = api => {
7
7
  this.api = api;
8
- }
8
+ };
9
9
  download = createEffect(async ({
10
10
  audioFileId,
11
11
  attemptNumber
@@ -1 +1 @@
1
- {"version":3,"names":["createEffect","downloadAudioFileRequestGenerator","VoiceFileDownloaderModel","constructor","api","download","audioFileId","attemptNumber","downloadAudio","controller","downloadPromise","collectionItem","audioLoading","audioDownloadPromise","abortDownload","abort"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/VoiceFileDownloader.model.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,UAAU;AAEvC,SAASC,iCAAiC,QAAQ,kBAAe;AAYjE,OAAO,MAAMC,wBAAwB,CAAC;EAGpCC,WAAWA,CAACC,GAAmB,EAAE;IAC/B,IAAI,CAACA,GAAG,GAAGA,GAAG;EAChB;EAEgBC,QAAQ,GAAGL,YAAY,CACrC,OAAO;IAAEM,WAAW;IAAEC;EAA8B,CAAC,KAA8B;IACjF,MAAM;MAAEC,aAAa;MAAEC;IAAW,CAAC,GAAGR,iCAAiC,CAACK,WAAW,EAAE,IAAI,CAACF,GAAG,CAAC;IAC9F,MAAMM,eAAe,GAAGF,aAAa,CAAC,CAAC;IAEvC,MAAMG,cAA+C,GAAG;MACtDJ,aAAa;MACbD,WAAW;MACXM,YAAY,EAAE,IAAI;MAClBC,oBAAoB,EAAEH,eAAe;MACrCD;IACF,CAAC;IAED,OAAO;MAAEE,cAAc;MAAED;IAAgB,CAAC;EAC5C,CACF,CAAC;EAEeI,aAAa,GAAIL,UAA4B,IAAK;IAChEA,UAAU,EAAEM,KAAK,CAAC,CAAC;EACrB,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"names":["createEffect","downloadAudioFileRequestGenerator","VoiceFileDownloaderModel","setApi","api","download","audioFileId","attemptNumber","downloadAudio","controller","downloadPromise","collectionItem","audioLoading","audioDownloadPromise","abortDownload","abort"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/VoiceFileDownloader.model.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,UAAU;AAEvC,SAASC,iCAAiC,QAAQ,kBAAe;AAYjE,OAAO,MAAMC,wBAAwB,CAAC;EAGpBC,MAAM,GAAIC,GAAmB,IAAK;IAChD,IAAI,CAACA,GAAG,GAAGA,GAAG;EAChB,CAAC;EAEeC,QAAQ,GAAGL,YAAY,CACrC,OAAO;IAAEM,WAAW;IAAEC;EAA8B,CAAC,KAA8B;IACjF,MAAM;MAAEC,aAAa;MAAEC;IAAW,CAAC,GAAGR,iCAAiC,CAACK,WAAW,EAAE,IAAI,CAACF,GAAG,CAAC;IAC9F,MAAMM,eAAe,GAAGF,aAAa,CAAC,CAAC;IAEvC,MAAMG,cAA+C,GAAG;MACtDJ,aAAa;MACbD,WAAW;MACXM,YAAY,EAAE,IAAI;MAClBC,oBAAoB,EAAEH,eAAe;MACrCD;IACF,CAAC;IAED,OAAO;MAAEE,cAAc;MAAED;IAAgB,CAAC;EAC5C,CACF,CAAC;EAEeI,aAAa,GAAIL,UAA4B,IAAK;IAChEA,UAAU,EAAEM,KAAK,CAAC,CAAC;EACrB,CAAC;AACH","ignoreList":[]}
@@ -1,74 +1,58 @@
1
1
  "use strict";
2
2
 
3
- import { createEvent, restore } from 'effector';
4
- import { TranscriptionsCollection } from "./TranscriptionsCollection.js";
3
+ import { attach, createEffect, createEvent, restore } from 'effector';
4
+ import { VoiceTranscriptionsCollection } from "./VoiceTranscriptionsCollection.js";
5
5
  import { VoiceFileDownloaderModel } from "./VoiceFileDownloader.model.js";
6
- import { DropdownModel } from "./Dropdown.model.js";
7
- import { TranslationModel } from "./Translation.model.js";
8
- import { PlayerModel } from "./Player.model.js";
9
- import { TranscriptionsDownloaderModel } from "./TranscriptionsDownloader.model.js";
10
- import { PlaybackController } from "./PlaybackController.js";
6
+ import { VoiceTranscriptionModel } from "./VoiceTranscription.model.js";
7
+ import { VoiceTranscriptionTranslationModel } from "./VoiceTranscriptionTranslation.model.js";
8
+ import { PlayerModel, PlayerState } from "./Player.model.js";
9
+ import { TranscriptionsDownloaderModel } from "./TranscriptionsDownloaderModel.js";
11
10
  export class VoicePlayerModel {
12
- collection = new TranscriptionsCollection();
13
- dropdown = new DropdownModel();
11
+ collection = new VoiceTranscriptionsCollection();
12
+ downloader = new VoiceFileDownloaderModel();
13
+ dropdown = new VoiceTranscriptionModel();
14
+ translation = new VoiceTranscriptionTranslationModel();
14
15
  playerModel = new PlayerModel();
16
+ currentPlayingAttempt = null;
17
+ shouldPreventPlayback = false;
15
18
  setCurrentAttempt = createEvent();
16
19
  reset = createEvent();
17
20
  $currentAttempt = restore(this.setCurrentAttempt, null).reset(this.reset);
18
21
  $playerState = this.playerModel.$playerState;
19
22
  pauseAudio = this.playerModel.pause;
20
- seekAudio = this.playerModel.seek;
23
+ stopAudio = () => {
24
+ this.shouldPreventPlayback = true;
25
+ this.abortAllDownloads();
26
+ this.playerModel.stop();
27
+ this.currentPlayingAttempt = null;
28
+ this.setCurrentAttempt(null);
29
+ };
30
+ resetPlayer = () => {
31
+ this.shouldPreventPlayback = true;
32
+ this.releaseCollectionResources();
33
+ this.playerModel.stop();
34
+ this.currentPlayingAttempt = null;
35
+ this.setCurrentAttempt(null);
36
+ this.collection.clear();
37
+ };
21
38
  constructor(params) {
22
39
  this.api = params.api;
23
- this.downloader = new VoiceFileDownloaderModel(params.api);
24
40
  this.loader = new TranscriptionsDownloaderModel(this.collection, params.api);
25
- this.translation = new TranslationModel(this.collection, params.api);
26
- this.playback = new PlaybackController({
27
- collection: this.collection,
28
- player: this.playerModel,
29
- downloader: this.downloader
41
+ this.downloader.setApi(params.api);
42
+ this.playerModel.playbackFinished.watch(() => {
43
+ this.currentPlayingAttempt = null;
44
+ this.setCurrentAttempt(null);
30
45
  });
31
- this.togglePlayPause = this.playback.togglePlayPause;
32
46
  if (params.audios) {
33
47
  this.initializeCollectionFromAudios(params.audios);
34
48
  }
35
49
  this.playerModel.setupAudioMode();
36
50
  }
37
- stopAudio = () => {
38
- this.playback.halt();
39
- };
40
- preloadAudio = attemptNumber => {
41
- const target = attemptNumber ?? this.$currentAttempt.getState();
42
- if (target === null) return;
43
- return this.playback.preloadAudio(target);
44
- };
45
- resetPlayer = () => {
46
- this.playback.releaseResources();
47
- this.playback.halt();
48
- this.collection.clear();
49
- this.translation.clearCache();
50
- };
51
51
  initializeWithAudios(answerAudio) {
52
+ this.loader.setTranscriptsLoaded(false);
52
53
  this.collection.clear();
53
54
  this.initializeCollectionFromAudios(answerAudio);
54
55
  }
55
- isAudioLoading(attemptNumber) {
56
- return this.collection.get(attemptNumber)?.audioLoading || false;
57
- }
58
- getAllAttempts() {
59
- return this.collection.getAll();
60
- }
61
- reinitializePlayer() {
62
- this.playerModel.reinitialize();
63
- }
64
- cleanup() {
65
- this.playback.releaseResources();
66
- this.collection.clear();
67
- this.reset();
68
- this.dropdown.reset();
69
- this.translation.reset();
70
- this.playerModel.release();
71
- }
72
56
  initializeCollectionFromAudios(audios) {
73
57
  if (!audios) {
74
58
  console.warn('VoicePlayerModel: audios is not provided');
@@ -88,5 +72,150 @@ export class VoicePlayerModel {
88
72
  });
89
73
  });
90
74
  }
75
+ releaseCollectionResources() {
76
+ this.collection.getAll().forEach(item => {
77
+ if (item.controller) {
78
+ this.downloader.abortDownload(item.controller);
79
+ }
80
+ if (item.audioUri?.startsWith('blob:')) {
81
+ try {
82
+ URL.revokeObjectURL(item.audioUri);
83
+ } catch (e) {}
84
+ }
85
+ });
86
+ }
87
+ abortAllDownloads() {
88
+ this.collection.getAll().forEach(item => {
89
+ if (item.controller && item.audioLoading) {
90
+ this.downloader.abortDownload(item.controller);
91
+ this.collection.update(item.attemptNumber, {
92
+ audioLoading: false,
93
+ controller: undefined,
94
+ audioDownloadPromise: undefined
95
+ });
96
+ }
97
+ });
98
+ }
99
+ handlePlayAttempt = createEffect(async attemptNumber => {
100
+ this.shouldPreventPlayback = false;
101
+ const item = this.collection.get(attemptNumber);
102
+ if (!item) return;
103
+ if (this.currentPlayingAttempt !== null && this.currentPlayingAttempt !== attemptNumber) {
104
+ this.abortAllDownloads();
105
+ }
106
+ if (this.collection.hasAudio(attemptNumber)) {
107
+ this.playAudioFx(attemptNumber);
108
+ return;
109
+ }
110
+ try {
111
+ this.playerModel.setPlayerState(PlayerState.LOADING);
112
+ const {
113
+ collectionItem,
114
+ downloadPromise
115
+ } = await this.downloader.download({
116
+ audioFileId: item.audioFileId,
117
+ attemptNumber
118
+ });
119
+ if (this.shouldPreventPlayback) {
120
+ collectionItem.controller?.abort();
121
+ return;
122
+ }
123
+ this.collection.update(attemptNumber, collectionItem);
124
+ const result = await downloadPromise;
125
+ if (this.shouldPreventPlayback) {
126
+ if (result.uri?.startsWith('blob:')) {
127
+ URL.revokeObjectURL(result.uri);
128
+ }
129
+ return;
130
+ }
131
+ this.collection.update(attemptNumber, {
132
+ audioUri: result.uri,
133
+ audioLoading: false,
134
+ audioError: undefined,
135
+ controller: undefined,
136
+ audioDownloadPromise: undefined
137
+ });
138
+ this.playerModel.setPlayerState(PlayerState.IDLE);
139
+ this.playAudioFx(attemptNumber);
140
+ } catch (error) {
141
+ console.error('Audio download error:', error);
142
+ if (error instanceof Error && error.name === 'AbortError') {
143
+ this.playerModel.setPlayerState(PlayerState.IDLE);
144
+ return;
145
+ }
146
+ this.collection.update(attemptNumber, {
147
+ audioLoading: false,
148
+ audioError: error instanceof Error ? error.message : 'Failed to download audio',
149
+ controller: undefined,
150
+ audioDownloadPromise: undefined
151
+ });
152
+ }
153
+ });
154
+ playAudioFx = createEffect(async attemptNumber => {
155
+ if (this.shouldPreventPlayback) return;
156
+ const item = this.collection.get(attemptNumber);
157
+ if (!item?.audioUri) {
158
+ console.warn('No audio URI available for attempt:', attemptNumber);
159
+ return;
160
+ }
161
+ try {
162
+ if (this.currentPlayingAttempt !== null && this.currentPlayingAttempt !== attemptNumber) {
163
+ this.playerModel.player?.remove();
164
+ }
165
+ if (this.currentPlayingAttempt === attemptNumber && this.playerModel.player?.playing) {
166
+ this.playerModel.pause();
167
+ return;
168
+ }
169
+ if (this.currentPlayingAttempt === attemptNumber && !this.playerModel.player?.playing) {
170
+ this.playerModel.resume();
171
+ return;
172
+ }
173
+ this.currentPlayingAttempt = attemptNumber;
174
+ this.setCurrentAttempt(attemptNumber);
175
+ await this.playerModel.play(item.audioUri);
176
+ } catch (error) {
177
+ console.error('Error playing audio:', error);
178
+ this.playerModel.setPlayerState(PlayerState.IDLE);
179
+ this.collection.update(attemptNumber, {
180
+ audioError: error instanceof Error ? error.message : 'Failed to play audio'
181
+ });
182
+ }
183
+ });
184
+ isAudioLoading(attemptNumber) {
185
+ return this.collection.get(attemptNumber)?.audioLoading || false;
186
+ }
187
+ getAllAttempts() {
188
+ return this.collection.getAll();
189
+ }
190
+ reinitializePlayer() {
191
+ this.playerModel.reinitialize();
192
+ }
193
+ cleanup() {
194
+ this.releaseCollectionResources();
195
+ this.collection.clear();
196
+ this.currentPlayingAttempt = null;
197
+ this.reset();
198
+ this.loader.reset();
199
+ this.dropdown.reset();
200
+ this.translation.reset();
201
+ this.playerModel.release();
202
+ }
203
+ togglePlayPause = attach({
204
+ source: this.playerModel.$playerState,
205
+ mapParams: (attemptNumber, playerState) => ({
206
+ attemptNumber,
207
+ playerState
208
+ }),
209
+ effect: createEffect(({
210
+ attemptNumber,
211
+ playerState
212
+ }) => {
213
+ if (this.currentPlayingAttempt === attemptNumber && playerState === PlayerState.PLAYING) {
214
+ this.pauseAudio();
215
+ } else {
216
+ this.handlePlayAttempt(attemptNumber);
217
+ }
218
+ })
219
+ });
91
220
  }
92
221
  //# sourceMappingURL=VoicePlayer.model.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createEvent","restore","TranscriptionsCollection","VoiceFileDownloaderModel","DropdownModel","TranslationModel","PlayerModel","TranscriptionsDownloaderModel","PlaybackController","VoicePlayerModel","collection","dropdown","playerModel","setCurrentAttempt","reset","$currentAttempt","$playerState","pauseAudio","pause","seekAudio","seek","constructor","params","api","downloader","loader","translation","playback","player","togglePlayPause","audios","initializeCollectionFromAudios","setupAudioMode","stopAudio","halt","preloadAudio","attemptNumber","target","getState","resetPlayer","releaseResources","clear","clearCache","initializeWithAudios","answerAudio","isAudioLoading","get","audioLoading","getAllAttempts","getAll","reinitializePlayer","reinitialize","cleanup","release","console","warn","forEach","audio","index","audioFileId","add","_id","hasDrawing","drawing"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/VoicePlayer.model.ts"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,OAAO,QAAQ,UAAU;AAC/C,SAASC,wBAAwB,QAAQ,+BAA4B;AACrE,SAASC,wBAAwB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ACtC,WAAW,CAACuC,YAAY,CAAC,CAAC;EACjC;EAEOC,OAAOA,CAAA,EAAG;IACf,IAAI,CAACzB,QAAQ,CAACa,gBAAgB,CAAC,CAAC;IAChC,IAAI,CAAC9B,UAAU,CAAC+B,KAAK,CAAC,CAAC;IACvB,IAAI,CAAC3B,KAAK,CAAC,CAAC;IACZ,IAAI,CAACH,QAAQ,CAACG,KAAK,CAAC,CAAC;IACrB,IAAI,CAACY,WAAW,CAACZ,KAAK,CAAC,CAAC;IACxB,IAAI,CAACF,WAAW,CAACyC,OAAO,CAAC,CAAC;EAC5B;EAEQtB,8BAA8BA,CAACD,MAAqB,EAAE;IAC5D,IAAI,CAACA,MAAM,EAAE;MACXwB,OAAO,CAACC,IAAI,CAAC,0CAA0C,CAAC;MACxD;IACF;IACAzB,MAAM,CAAC0B,OAAO,CAAC,CAACC,KAAK,EAAEC,KAAK,KAAK;MAC/B,MAAMtB,aAAa,GAAGsB,KAAK,GAAG,CAAC;MAC/B,IAAI,CAACD,KAAK,CAACE,WAAW,EAAE;QACtBL,OAAO,CAACC,IAAI,CAAC,oDAAoD,EAAEE,KAAK,CAAC;QACzE;MACF;MACA,IAAI,CAAC/C,UAAU,CAACkD,GAAG,CAACxB,aAAa,EAAE;QACjCA,aAAa;QACbuB,WAAW,EAAEF,KAAK,CAACE,WAAW;QAC9BE,GAAG,EAAEJ,KAAK,CAACI,GAAG;QACdC,UAAU,EAAE,CAAC,CAACL,KAAK,CAACM;MACtB,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
1
+ {"version":3,"names":["attach","createEffect","createEvent","restore","VoiceTranscriptionsCollection","VoiceFileDownloaderModel","VoiceTranscriptionModel","VoiceTranscriptionTranslationModel","PlayerModel","PlayerState","TranscriptionsDownloaderModel","VoicePlayerModel","collection","downloader","dropdown","translation","playerModel","currentPlayingAttempt","shouldPreventPlayback","setCurrentAttempt","reset","$currentAttempt","$playerState","pauseAudio","pause","stopAudio","abortAllDownloads","stop","resetPlayer","releaseCollectionResources","clear","constructor","params","api","loader","setApi","playbackFinished","watch","audios","initializeCollectionFromAudios","setupAudioMode","initializeWithAudios","answerAudio","setTranscriptsLoaded","console","warn","forEach","audio","index","attemptNumber","audioFileId","add","_id","hasDrawing","drawing","getAll","item","controller","abortDownload","audioUri","startsWith","URL","revokeObjectURL","e","audioLoading","update","undefined","audioDownloadPromise","handlePlayAttempt","get","hasAudio","playAudioFx","setPlayerState","LOADING","collectionItem","downloadPromise","download","abort","result","uri","audioError","IDLE","error","Error","name","message","player","remove","playing","resume","play","isAudioLoading","getAllAttempts","reinitializePlayer","reinitialize","cleanup","release","togglePlayPause","source","mapParams","playerState","effect","PLAYING"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/VoicePlayer.model.ts"],"mappings":";;AAAA,SAASA,MAAM,EAAEC,YAAY,EAAEC,WAAW,EAAEC,OAAO,QAAQ,UAAU;AACrE,SAASC,6BAA6B,QAAQ,oCAAiC;AAC/E,SAASC,wBAAwB,QAAQ,gCAA6B;AACtE,SAASC,uBAAuB,QAAQ,+BAA4B;AACpE,SAASC,kCAAkC,QAAQ,0CAAuC;AAE1F,SAASC,WAAW,EAAEC,WAAW,QAAQ,mBAAgB;AACzD,SAASC,6BAA6B,QAAQ,oCAAiC;AAW/E,OAAO,MAAMC,gBAAgB,CAAC;EACZC,UAAU,GAAG,IAAIR,6BAA6B,CAAC,CAAC;EAChDS,UAAU,GAAG,IAAIR,wBAAwB,CAAC,CAAC;EAC3CS,QAAQ,GAAG,IAAIR,uBAAuB,CAAC,CAAC;EACxCS,WAAW,GAAG,IAAIR,kCAAkC,CAAC,CAAC;EACtDS,WAAW,GAAG,IAAIR,WAAW,CAAC,CAAC;EAGvCS,qBAAqB,GAAkB,IAAI;EAC3CC,qBAAqB,GAAG,KAAK;EAErBC,iBAAiB,GAAGjB,WAAW,CAAgB,CAAC;EAChDkB,KAAK,GAAGlB,WAAW,CAAC,CAAC;EAErBmB,eAAe,GAAGl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MAAM;QACL,IAAI,CAAC6C,iBAAiB,CAACnB,aAAa,CAAC;MACvC;IACF,CAAC;EACH,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
 
3
3
  import { createEvent, restore } from 'effector';
4
- export class DropdownModel {
4
+ export class VoiceTranscriptionModel {
5
5
  toggleExpand = createEvent();
6
6
  setExpanded = createEvent();
7
7
  reset = createEvent();
8
8
  $isExpanded = restore(this.setExpanded, false).on(this.toggleExpand, state => !state).reset(this.reset);
9
9
  }
10
- //# sourceMappingURL=Dropdown.model.js.map
10
+ //# sourceMappingURL=VoiceTranscription.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createEvent","restore","VoiceTranscriptionModel","toggleExpand","setExpanded","reset","$isExpanded","on","state"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/VoiceTranscription.model.ts"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,OAAO,QAAQ,UAAU;AAE/C,OAAO,MAAMC,uBAAuB,CAAC;EACnBC,YAAY,GAAGH,WAAW,CAAC,CAAC;EAC5BI,WAAW,GAAGJ,WAAW,CAAU,CAAC;EACpCK,KAAK,GAAGL,WAAW,CAAC,CAAC;EAErBM,WAAW,GAAGL,OAAO,CAAC,IAAI,CAACG,WAAW,EAAE,KAAK,CAAC,CAC3DG,EAAE,CAAC,IAAI,CAACJ,YAAY,EAAGK,KAAK,IAAK,CAACA,KAAK,CAAC,CACxCH,KAAK,CAAC,IAAI,CAACA,KAAK,CAAC;AACtB","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ import { createEvent, restore } from 'effector';
4
+ export class VoiceTranscriptionTranslationModel {
5
+ toggle = createEvent();
6
+ setActive = createEvent();
7
+ reset = createEvent();
8
+ $isActive = restore(this.setActive, false).on(this.toggle, state => !state).reset(this.reset);
9
+ }
10
+ //# sourceMappingURL=VoiceTranscriptionTranslation.model.js.map