@magmamath/students-features 1.4.6 → 1.5.0-rc.10

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 (412) hide show
  1. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js +1 -6
  2. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js.map +1 -1
  3. package/dist/commonjs/features/fluency/components/Fluency.js +6 -12
  4. package/dist/commonjs/features/fluency/components/Fluency.js.map +1 -1
  5. package/dist/commonjs/features/fluency/components/select-math-operator/SelectMathOperator.js +5 -13
  6. package/dist/commonjs/features/fluency/components/select-math-operator/SelectMathOperator.js.map +1 -1
  7. package/dist/commonjs/features/fluency/model/FluencyModel.js +0 -21
  8. package/dist/commonjs/features/fluency/model/FluencyModel.js.map +1 -1
  9. package/dist/commonjs/features/fluency/shared/fluency.constants.js +1 -6
  10. package/dist/commonjs/features/fluency/shared/fluency.constants.js.map +1 -1
  11. package/dist/commonjs/features/fluency/shared/fluency.helpers.js +1 -3
  12. package/dist/commonjs/features/fluency/shared/fluency.helpers.js.map +1 -1
  13. package/dist/commonjs/features/pmProgress/model/PmProgressModel.js +1 -7
  14. package/dist/commonjs/features/pmProgress/model/PmProgressModel.js.map +1 -1
  15. package/dist/commonjs/features/pmProgress/model/PmRecommendationsModel.js +4 -20
  16. package/dist/commonjs/features/pmProgress/model/PmRecommendationsModel.js.map +1 -1
  17. package/dist/commonjs/features/pmProgress/shared/pmProgress.helpers.js +1 -22
  18. package/dist/commonjs/features/pmProgress/shared/pmProgress.helpers.js.map +1 -1
  19. package/dist/commonjs/features/translation/constants.js +11 -0
  20. package/dist/commonjs/features/translation/constants.js.map +1 -0
  21. package/dist/commonjs/features/translation/helpers.js +60 -0
  22. package/dist/commonjs/features/translation/helpers.js.map +1 -0
  23. package/dist/commonjs/features/translation/index.js +105 -0
  24. package/dist/commonjs/features/translation/index.js.map +1 -0
  25. package/dist/commonjs/features/translation/model/TranslationModel.js +122 -0
  26. package/dist/commonjs/features/translation/model/TranslationModel.js.map +1 -0
  27. package/dist/commonjs/features/translation/model/TranslationPreprocessor.js +142 -0
  28. package/dist/commonjs/features/translation/model/TranslationPreprocessor.js.map +1 -0
  29. package/dist/commonjs/features/translation/model/TranslationService.js +112 -0
  30. package/dist/commonjs/features/translation/model/TranslationService.js.map +1 -0
  31. package/dist/commonjs/features/translation/preserve/wordsToPreserve.js +314 -0
  32. package/dist/commonjs/features/translation/preserve/wordsToPreserve.js.map +1 -0
  33. package/dist/commonjs/features/translation/providers/google/GoogleTranslationProvider.js +50 -0
  34. package/dist/commonjs/features/translation/providers/google/GoogleTranslationProvider.js.map +1 -0
  35. package/dist/commonjs/features/translation/providers/google/supportedLanguages.js +230 -0
  36. package/dist/commonjs/features/translation/providers/google/supportedLanguages.js.map +1 -0
  37. package/dist/commonjs/features/translation/providers/google.types.js +2 -0
  38. package/dist/commonjs/features/translation/providers/google.types.js.map +1 -0
  39. package/dist/commonjs/features/translation/providers/translation.interface.js +49 -0
  40. package/dist/commonjs/features/translation/providers/translation.interface.js.map +1 -0
  41. package/dist/commonjs/features/translation/types.js +2 -0
  42. package/dist/commonjs/features/translation/types.js.map +1 -0
  43. package/dist/commonjs/features/voice/index.js +15 -4
  44. package/dist/commonjs/features/voice/index.js.map +1 -1
  45. package/dist/commonjs/features/voice/playing/components/VoiceIcon.js +1 -1
  46. package/dist/commonjs/features/voice/playing/components/VoiceIcon.js.map +1 -1
  47. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptContent.js +44 -0
  48. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptContent.js.map +1 -0
  49. package/dist/commonjs/features/voice/playing/components/VoiceTranscription.js +107 -0
  50. package/dist/commonjs/features/voice/playing/components/VoiceTranscription.js.map +1 -0
  51. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.js +66 -0
  52. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.js.map +1 -0
  53. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.js +58 -0
  54. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.js.map +1 -0
  55. package/dist/commonjs/features/voice/playing/hooks/{useVoiceTranscriptionsDropdown.js → useDropdownAnimation.js} +8 -7
  56. package/dist/commonjs/features/voice/playing/hooks/useDropdownAnimation.js.map +1 -0
  57. package/dist/commonjs/features/voice/playing/hooks/useVoicePlayerLifecycle.js +53 -0
  58. package/dist/commonjs/features/voice/playing/hooks/useVoicePlayerLifecycle.js.map +1 -0
  59. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.js +111 -0
  60. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.js.map +1 -0
  61. package/dist/commonjs/features/voice/playing/model/{VoiceTranscriptionsDropdown.model.js → Dropdown.model.js} +4 -4
  62. package/dist/commonjs/features/voice/playing/model/Dropdown.model.js.map +1 -0
  63. package/dist/commonjs/features/voice/playing/model/PlaybackController.js +192 -0
  64. package/dist/commonjs/features/voice/playing/model/PlaybackController.js.map +1 -0
  65. package/dist/commonjs/features/voice/playing/model/Player.model.js +50 -5
  66. package/dist/commonjs/features/voice/playing/model/Player.model.js.map +1 -1
  67. package/dist/commonjs/features/voice/playing/model/{VoiceTranscriptionsCollection.js → TranscriptionsCollection.js} +4 -4
  68. package/dist/commonjs/features/voice/playing/model/TranscriptionsCollection.js.map +1 -0
  69. package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.js +83 -0
  70. package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.js.map +1 -0
  71. package/dist/commonjs/features/voice/playing/model/Translation.model.js +62 -0
  72. package/dist/commonjs/features/voice/playing/model/Translation.model.js.map +1 -0
  73. package/dist/commonjs/features/voice/playing/model/VoiceFileDownloader.model.js +2 -2
  74. package/dist/commonjs/features/voice/playing/model/VoiceFileDownloader.model.js.map +1 -1
  75. package/dist/commonjs/features/voice/playing/model/VoicePlayer.model.js +58 -172
  76. package/dist/commonjs/features/voice/playing/model/VoicePlayer.model.js.map +1 -1
  77. package/dist/commonjs/features/voice/recording/components/VoiceRecordDivider.js +1 -1
  78. package/dist/commonjs/features/voice/recording/components/VoiceRecordDivider.js.map +1 -1
  79. package/dist/commonjs/features/voice/types.js +12 -1
  80. package/dist/commonjs/features/voice/types.js.map +1 -1
  81. package/dist/commonjs/index.js +12 -0
  82. package/dist/commonjs/index.js.map +1 -1
  83. package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js +2 -7
  84. package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js.map +1 -1
  85. package/dist/module/features/fluency/components/Fluency.js +8 -14
  86. package/dist/module/features/fluency/components/Fluency.js.map +1 -1
  87. package/dist/module/features/fluency/components/select-math-operator/SelectMathOperator.js +5 -13
  88. package/dist/module/features/fluency/components/select-math-operator/SelectMathOperator.js.map +1 -1
  89. package/dist/module/features/fluency/model/FluencyModel.js +1 -22
  90. package/dist/module/features/fluency/model/FluencyModel.js.map +1 -1
  91. package/dist/module/features/fluency/shared/fluency.constants.js +0 -5
  92. package/dist/module/features/fluency/shared/fluency.constants.js.map +1 -1
  93. package/dist/module/features/fluency/shared/fluency.helpers.js +0 -1
  94. package/dist/module/features/fluency/shared/fluency.helpers.js.map +1 -1
  95. package/dist/module/features/pmProgress/model/PmProgressModel.js +1 -7
  96. package/dist/module/features/pmProgress/model/PmProgressModel.js.map +1 -1
  97. package/dist/module/features/pmProgress/model/PmRecommendationsModel.js +4 -20
  98. package/dist/module/features/pmProgress/model/PmRecommendationsModel.js.map +1 -1
  99. package/dist/module/features/pmProgress/shared/pmProgress.helpers.js +0 -20
  100. package/dist/module/features/pmProgress/shared/pmProgress.helpers.js.map +1 -1
  101. package/dist/module/features/translation/constants.js +7 -0
  102. package/dist/module/features/translation/constants.js.map +1 -0
  103. package/dist/module/features/translation/helpers.js +53 -0
  104. package/dist/module/features/translation/helpers.js.map +1 -0
  105. package/dist/module/features/translation/index.js +12 -0
  106. package/dist/module/features/translation/index.js.map +1 -0
  107. package/dist/module/features/translation/model/TranslationModel.js +117 -0
  108. package/dist/module/features/translation/model/TranslationModel.js.map +1 -0
  109. package/dist/module/features/translation/model/TranslationPreprocessor.js +137 -0
  110. package/dist/module/features/translation/model/TranslationPreprocessor.js.map +1 -0
  111. package/dist/module/features/translation/model/TranslationService.js +107 -0
  112. package/dist/module/features/translation/model/TranslationService.js.map +1 -0
  113. package/dist/module/features/translation/preserve/wordsToPreserve.js +310 -0
  114. package/dist/module/features/translation/preserve/wordsToPreserve.js.map +1 -0
  115. package/dist/module/features/translation/providers/google/GoogleTranslationProvider.js +45 -0
  116. package/dist/module/features/translation/providers/google/GoogleTranslationProvider.js.map +1 -0
  117. package/dist/module/features/translation/providers/google/supportedLanguages.js +225 -0
  118. package/dist/module/features/translation/providers/google/supportedLanguages.js.map +1 -0
  119. package/dist/module/features/translation/providers/google.types.js +2 -0
  120. package/dist/module/features/translation/providers/google.types.js.map +1 -0
  121. package/dist/module/features/translation/providers/translation.interface.js +44 -0
  122. package/dist/module/features/translation/providers/translation.interface.js.map +1 -0
  123. package/dist/module/features/translation/types.js +2 -0
  124. package/dist/module/features/translation/types.js.map +1 -0
  125. package/dist/module/features/voice/index.js +2 -1
  126. package/dist/module/features/voice/index.js.map +1 -1
  127. package/dist/module/features/voice/playing/components/VoiceIcon.js +2 -2
  128. package/dist/module/features/voice/playing/components/VoiceIcon.js.map +1 -1
  129. package/dist/module/features/voice/playing/components/VoiceTranscriptContent.js +38 -0
  130. package/dist/module/features/voice/playing/components/VoiceTranscriptContent.js.map +1 -0
  131. package/dist/module/features/voice/playing/components/VoiceTranscription.js +101 -0
  132. package/dist/module/features/voice/playing/components/VoiceTranscription.js.map +1 -0
  133. package/dist/module/features/voice/playing/components/VoiceTranscriptionCollapsible.js +58 -0
  134. package/dist/module/features/voice/playing/components/VoiceTranscriptionCollapsible.js.map +1 -0
  135. package/dist/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.js +52 -0
  136. package/dist/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.js.map +1 -0
  137. package/dist/module/features/voice/playing/hooks/{useVoiceTranscriptionsDropdown.js → useDropdownAnimation.js} +6 -5
  138. package/dist/module/features/voice/playing/hooks/useDropdownAnimation.js.map +1 -0
  139. package/dist/module/features/voice/playing/hooks/useVoicePlayerLifecycle.js +48 -0
  140. package/dist/module/features/voice/playing/hooks/useVoicePlayerLifecycle.js.map +1 -0
  141. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionController.js +106 -0
  142. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionController.js.map +1 -0
  143. package/dist/module/features/voice/playing/model/{VoiceTranscriptionsDropdown.model.js → Dropdown.model.js} +2 -2
  144. package/dist/module/features/voice/playing/model/Dropdown.model.js.map +1 -0
  145. package/dist/module/features/voice/playing/model/PlaybackController.js +187 -0
  146. package/dist/module/features/voice/playing/model/PlaybackController.js.map +1 -0
  147. package/dist/module/features/voice/playing/model/Player.model.js +51 -4
  148. package/dist/module/features/voice/playing/model/Player.model.js.map +1 -1
  149. package/dist/module/features/voice/playing/model/{VoiceTranscriptionsCollection.js → TranscriptionsCollection.js} +2 -2
  150. package/dist/module/features/voice/playing/model/TranscriptionsCollection.js.map +1 -0
  151. package/dist/module/features/voice/playing/model/TranscriptionsDownloader.model.js +78 -0
  152. package/dist/module/features/voice/playing/model/TranscriptionsDownloader.model.js.map +1 -0
  153. package/dist/module/features/voice/playing/model/Translation.model.js +57 -0
  154. package/dist/module/features/voice/playing/model/Translation.model.js.map +1 -0
  155. package/dist/module/features/voice/playing/model/VoiceFileDownloader.model.js +2 -2
  156. package/dist/module/features/voice/playing/model/VoiceFileDownloader.model.js.map +1 -1
  157. package/dist/module/features/voice/playing/model/VoicePlayer.model.js +60 -174
  158. package/dist/module/features/voice/playing/model/VoicePlayer.model.js.map +1 -1
  159. package/dist/module/features/voice/recording/components/VoiceRecordDivider.js +2 -2
  160. package/dist/module/features/voice/recording/components/VoiceRecordDivider.js.map +1 -1
  161. package/dist/module/features/voice/types.js +11 -0
  162. package/dist/module/features/voice/types.js.map +1 -1
  163. package/dist/module/index.js +1 -0
  164. package/dist/module/index.js.map +1 -1
  165. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts.map +1 -1
  166. package/dist/typescript/commonjs/features/fluency/components/Fluency.d.ts.map +1 -1
  167. package/dist/typescript/commonjs/features/fluency/components/select-math-operator/SelectMathOperator.d.ts.map +1 -1
  168. package/dist/typescript/commonjs/features/fluency/model/FluencyModel.d.ts +0 -3
  169. package/dist/typescript/commonjs/features/fluency/model/FluencyModel.d.ts.map +1 -1
  170. package/dist/typescript/commonjs/features/fluency/shared/fluency.constants.d.ts +0 -4
  171. package/dist/typescript/commonjs/features/fluency/shared/fluency.constants.d.ts.map +1 -1
  172. package/dist/typescript/commonjs/features/fluency/shared/fluency.helpers.d.ts +0 -1
  173. package/dist/typescript/commonjs/features/fluency/shared/fluency.helpers.d.ts.map +1 -1
  174. package/dist/typescript/commonjs/features/pmProgress/model/PmProgressModel.d.ts.map +1 -1
  175. package/dist/typescript/commonjs/features/pmProgress/model/PmRecommendationsModel.d.ts +38 -9
  176. package/dist/typescript/commonjs/features/pmProgress/model/PmRecommendationsModel.d.ts.map +1 -1
  177. package/dist/typescript/commonjs/features/pmProgress/shared/pmProgress.helpers.d.ts +0 -1
  178. package/dist/typescript/commonjs/features/pmProgress/shared/pmProgress.helpers.d.ts.map +1 -1
  179. package/dist/typescript/commonjs/features/translation/constants.d.ts +5 -0
  180. package/dist/typescript/commonjs/features/translation/constants.d.ts.map +1 -0
  181. package/dist/typescript/commonjs/features/translation/helpers.d.ts +9 -0
  182. package/dist/typescript/commonjs/features/translation/helpers.d.ts.map +1 -0
  183. package/dist/typescript/commonjs/features/translation/index.d.ts +12 -0
  184. package/dist/typescript/commonjs/features/translation/index.d.ts.map +1 -0
  185. package/dist/typescript/commonjs/features/translation/model/TranslationModel.d.ts +33 -0
  186. package/dist/typescript/commonjs/features/translation/model/TranslationModel.d.ts.map +1 -0
  187. package/dist/typescript/commonjs/features/translation/model/TranslationPreprocessor.d.ts +34 -0
  188. package/dist/typescript/commonjs/features/translation/model/TranslationPreprocessor.d.ts.map +1 -0
  189. package/dist/typescript/commonjs/features/translation/model/TranslationService.d.ts +40 -0
  190. package/dist/typescript/commonjs/features/translation/model/TranslationService.d.ts.map +1 -0
  191. package/dist/typescript/commonjs/features/translation/preserve/wordsToPreserve.d.ts +3 -0
  192. package/dist/typescript/commonjs/features/translation/preserve/wordsToPreserve.d.ts.map +1 -0
  193. package/dist/typescript/commonjs/features/translation/providers/google/GoogleTranslationProvider.d.ts +17 -0
  194. package/dist/typescript/commonjs/features/translation/providers/google/GoogleTranslationProvider.d.ts.map +1 -0
  195. package/dist/typescript/commonjs/features/translation/providers/google/supportedLanguages.d.ts +209 -0
  196. package/dist/typescript/commonjs/features/translation/providers/google/supportedLanguages.d.ts.map +1 -0
  197. package/dist/typescript/commonjs/features/translation/providers/google.types.d.ts +15 -0
  198. package/dist/typescript/commonjs/features/translation/providers/google.types.d.ts.map +1 -0
  199. package/dist/typescript/commonjs/features/translation/providers/translation.interface.d.ts +30 -0
  200. package/dist/typescript/commonjs/features/translation/providers/translation.interface.d.ts.map +1 -0
  201. package/dist/typescript/commonjs/features/translation/types.d.ts +27 -0
  202. package/dist/typescript/commonjs/features/translation/types.d.ts.map +1 -0
  203. package/dist/typescript/commonjs/features/voice/index.d.ts +3 -1
  204. package/dist/typescript/commonjs/features/voice/index.d.ts.map +1 -1
  205. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptContent.d.ts +8 -0
  206. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptContent.d.ts.map +1 -0
  207. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscription.d.ts +16 -0
  208. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscription.d.ts.map +1 -0
  209. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts +10 -0
  210. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts.map +1 -0
  211. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.d.ts +12 -0
  212. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.d.ts.map +1 -0
  213. package/dist/typescript/commonjs/features/voice/playing/hooks/{useVoiceTranscriptionsDropdown.d.ts → useDropdownAnimation.d.ts} +3 -3
  214. package/dist/typescript/commonjs/features/voice/playing/hooks/useDropdownAnimation.d.ts.map +1 -0
  215. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoicePlayerLifecycle.d.ts +15 -0
  216. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoicePlayerLifecycle.d.ts.map +1 -0
  217. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts +30 -0
  218. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts.map +1 -0
  219. package/dist/typescript/{module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts → commonjs/features/voice/playing/model/Dropdown.model.d.ts} +2 -2
  220. package/dist/typescript/commonjs/features/voice/playing/model/Dropdown.model.d.ts.map +1 -0
  221. package/dist/typescript/commonjs/features/voice/playing/model/PlaybackController.d.ts +28 -0
  222. package/dist/typescript/commonjs/features/voice/playing/model/PlaybackController.d.ts.map +1 -0
  223. package/dist/typescript/commonjs/features/voice/playing/model/Player.model.d.ts +4 -0
  224. package/dist/typescript/commonjs/features/voice/playing/model/Player.model.d.ts.map +1 -1
  225. package/dist/typescript/{module/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts → commonjs/features/voice/playing/model/TranscriptionsCollection.d.ts} +2 -2
  226. package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsCollection.d.ts.map +1 -0
  227. package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.d.ts +19 -0
  228. package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.d.ts.map +1 -0
  229. package/dist/typescript/commonjs/features/voice/playing/model/Translation.model.d.ts +25 -0
  230. package/dist/typescript/commonjs/features/voice/playing/model/Translation.model.d.ts.map +1 -0
  231. package/dist/typescript/commonjs/features/voice/playing/model/VoiceFileDownloader.model.d.ts +2 -2
  232. package/dist/typescript/commonjs/features/voice/playing/model/VoiceFileDownloader.model.d.ts.map +1 -1
  233. package/dist/typescript/commonjs/features/voice/playing/model/VoicePlayer.model.d.ts +19 -18
  234. package/dist/typescript/commonjs/features/voice/playing/model/VoicePlayer.model.d.ts.map +1 -1
  235. package/dist/typescript/commonjs/features/voice/types.d.ts +14 -2
  236. package/dist/typescript/commonjs/features/voice/types.d.ts.map +1 -1
  237. package/dist/typescript/commonjs/index.d.ts +1 -0
  238. package/dist/typescript/commonjs/index.d.ts.map +1 -1
  239. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts.map +1 -1
  240. package/dist/typescript/module/features/fluency/components/Fluency.d.ts.map +1 -1
  241. package/dist/typescript/module/features/fluency/components/select-math-operator/SelectMathOperator.d.ts.map +1 -1
  242. package/dist/typescript/module/features/fluency/model/FluencyModel.d.ts +0 -3
  243. package/dist/typescript/module/features/fluency/model/FluencyModel.d.ts.map +1 -1
  244. package/dist/typescript/module/features/fluency/shared/fluency.constants.d.ts +0 -4
  245. package/dist/typescript/module/features/fluency/shared/fluency.constants.d.ts.map +1 -1
  246. package/dist/typescript/module/features/fluency/shared/fluency.helpers.d.ts +0 -1
  247. package/dist/typescript/module/features/fluency/shared/fluency.helpers.d.ts.map +1 -1
  248. package/dist/typescript/module/features/pmProgress/model/PmProgressModel.d.ts.map +1 -1
  249. package/dist/typescript/module/features/pmProgress/model/PmRecommendationsModel.d.ts +38 -9
  250. package/dist/typescript/module/features/pmProgress/model/PmRecommendationsModel.d.ts.map +1 -1
  251. package/dist/typescript/module/features/pmProgress/shared/pmProgress.helpers.d.ts +0 -1
  252. package/dist/typescript/module/features/pmProgress/shared/pmProgress.helpers.d.ts.map +1 -1
  253. package/dist/typescript/module/features/translation/constants.d.ts +5 -0
  254. package/dist/typescript/module/features/translation/constants.d.ts.map +1 -0
  255. package/dist/typescript/module/features/translation/helpers.d.ts +9 -0
  256. package/dist/typescript/module/features/translation/helpers.d.ts.map +1 -0
  257. package/dist/typescript/module/features/translation/index.d.ts +12 -0
  258. package/dist/typescript/module/features/translation/index.d.ts.map +1 -0
  259. package/dist/typescript/module/features/translation/model/TranslationModel.d.ts +33 -0
  260. package/dist/typescript/module/features/translation/model/TranslationModel.d.ts.map +1 -0
  261. package/dist/typescript/module/features/translation/model/TranslationPreprocessor.d.ts +34 -0
  262. package/dist/typescript/module/features/translation/model/TranslationPreprocessor.d.ts.map +1 -0
  263. package/dist/typescript/module/features/translation/model/TranslationService.d.ts +40 -0
  264. package/dist/typescript/module/features/translation/model/TranslationService.d.ts.map +1 -0
  265. package/dist/typescript/module/features/translation/preserve/wordsToPreserve.d.ts +3 -0
  266. package/dist/typescript/module/features/translation/preserve/wordsToPreserve.d.ts.map +1 -0
  267. package/dist/typescript/module/features/translation/providers/google/GoogleTranslationProvider.d.ts +17 -0
  268. package/dist/typescript/module/features/translation/providers/google/GoogleTranslationProvider.d.ts.map +1 -0
  269. package/dist/typescript/module/features/translation/providers/google/supportedLanguages.d.ts +209 -0
  270. package/dist/typescript/module/features/translation/providers/google/supportedLanguages.d.ts.map +1 -0
  271. package/dist/typescript/module/features/translation/providers/google.types.d.ts +15 -0
  272. package/dist/typescript/module/features/translation/providers/google.types.d.ts.map +1 -0
  273. package/dist/typescript/module/features/translation/providers/translation.interface.d.ts +30 -0
  274. package/dist/typescript/module/features/translation/providers/translation.interface.d.ts.map +1 -0
  275. package/dist/typescript/module/features/translation/types.d.ts +27 -0
  276. package/dist/typescript/module/features/translation/types.d.ts.map +1 -0
  277. package/dist/typescript/module/features/voice/index.d.ts +3 -1
  278. package/dist/typescript/module/features/voice/index.d.ts.map +1 -1
  279. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptContent.d.ts +8 -0
  280. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptContent.d.ts.map +1 -0
  281. package/dist/typescript/module/features/voice/playing/components/VoiceTranscription.d.ts +16 -0
  282. package/dist/typescript/module/features/voice/playing/components/VoiceTranscription.d.ts.map +1 -0
  283. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts +10 -0
  284. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts.map +1 -0
  285. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.d.ts +12 -0
  286. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.d.ts.map +1 -0
  287. package/dist/typescript/module/features/voice/playing/hooks/{useVoiceTranscriptionsDropdown.d.ts → useDropdownAnimation.d.ts} +3 -3
  288. package/dist/typescript/module/features/voice/playing/hooks/useDropdownAnimation.d.ts.map +1 -0
  289. package/dist/typescript/module/features/voice/playing/hooks/useVoicePlayerLifecycle.d.ts +15 -0
  290. package/dist/typescript/module/features/voice/playing/hooks/useVoicePlayerLifecycle.d.ts.map +1 -0
  291. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts +30 -0
  292. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts.map +1 -0
  293. package/dist/typescript/{commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts → module/features/voice/playing/model/Dropdown.model.d.ts} +2 -2
  294. package/dist/typescript/module/features/voice/playing/model/Dropdown.model.d.ts.map +1 -0
  295. package/dist/typescript/module/features/voice/playing/model/PlaybackController.d.ts +28 -0
  296. package/dist/typescript/module/features/voice/playing/model/PlaybackController.d.ts.map +1 -0
  297. package/dist/typescript/module/features/voice/playing/model/Player.model.d.ts +4 -0
  298. package/dist/typescript/module/features/voice/playing/model/Player.model.d.ts.map +1 -1
  299. package/dist/typescript/{commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts → module/features/voice/playing/model/TranscriptionsCollection.d.ts} +2 -2
  300. package/dist/typescript/module/features/voice/playing/model/TranscriptionsCollection.d.ts.map +1 -0
  301. package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloader.model.d.ts +19 -0
  302. package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloader.model.d.ts.map +1 -0
  303. package/dist/typescript/module/features/voice/playing/model/Translation.model.d.ts +25 -0
  304. package/dist/typescript/module/features/voice/playing/model/Translation.model.d.ts.map +1 -0
  305. package/dist/typescript/module/features/voice/playing/model/VoiceFileDownloader.model.d.ts +2 -2
  306. package/dist/typescript/module/features/voice/playing/model/VoiceFileDownloader.model.d.ts.map +1 -1
  307. package/dist/typescript/module/features/voice/playing/model/VoicePlayer.model.d.ts +19 -18
  308. package/dist/typescript/module/features/voice/playing/model/VoicePlayer.model.d.ts.map +1 -1
  309. package/dist/typescript/module/features/voice/types.d.ts +14 -2
  310. package/dist/typescript/module/features/voice/types.d.ts.map +1 -1
  311. package/dist/typescript/module/index.d.ts +1 -0
  312. package/dist/typescript/module/index.d.ts.map +1 -1
  313. package/package.json +37 -10
  314. package/src/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.tsx +2 -9
  315. package/src/features/fluency/components/Fluency.tsx +9 -17
  316. package/src/features/fluency/components/select-math-operator/SelectMathOperator.tsx +5 -13
  317. package/src/features/fluency/model/FluencyModel.ts +1 -25
  318. package/src/features/fluency/shared/fluency.constants.ts +0 -5
  319. package/src/features/fluency/shared/fluency.helpers.ts +0 -3
  320. package/src/features/pmProgress/model/PmProgressModel.ts +1 -4
  321. package/src/features/pmProgress/model/PmRecommendationsModel.ts +6 -22
  322. package/src/features/pmProgress/shared/pmProgress.helpers.ts +0 -33
  323. package/src/features/translation/constants.ts +4 -0
  324. package/src/features/translation/helpers.ts +63 -0
  325. package/src/features/translation/index.ts +30 -0
  326. package/src/features/translation/model/TranslationModel.ts +174 -0
  327. package/src/features/translation/model/TranslationPreprocessor.ts +171 -0
  328. package/src/features/translation/model/TranslationService.ts +148 -0
  329. package/src/features/translation/preserve/wordsToPreserve.ts +87 -0
  330. package/src/features/translation/providers/google/GoogleTranslationProvider.ts +50 -0
  331. package/src/features/translation/providers/google/supportedLanguages.ts +229 -0
  332. package/src/features/translation/providers/google.types.ts +16 -0
  333. package/src/features/translation/providers/translation.interface.ts +63 -0
  334. package/src/features/translation/types.ts +30 -0
  335. package/src/features/voice/index.ts +3 -1
  336. package/src/features/voice/playing/components/VoiceIcon.tsx +2 -2
  337. package/src/features/voice/playing/components/VoiceTranscriptContent.tsx +44 -0
  338. package/src/features/voice/playing/components/VoiceTranscription.tsx +117 -0
  339. package/src/features/voice/playing/components/VoiceTranscriptionCollapsible.tsx +59 -0
  340. package/src/features/voice/playing/components/VoiceTranscriptionHeaderActions.tsx +61 -0
  341. package/src/features/voice/playing/hooks/{useVoiceTranscriptionsDropdown.ts → useDropdownAnimation.ts} +5 -5
  342. package/src/features/voice/playing/hooks/useVoicePlayerLifecycle.ts +64 -0
  343. package/src/features/voice/playing/hooks/useVoiceTranscriptionController.ts +148 -0
  344. package/src/features/voice/playing/model/{VoiceTranscriptionsDropdown.model.ts → Dropdown.model.ts} +2 -2
  345. package/src/features/voice/playing/model/PlaybackController.ts +221 -0
  346. package/src/features/voice/playing/model/Player.model.ts +52 -4
  347. package/src/features/voice/playing/model/{VoiceTranscriptionsCollection.ts → TranscriptionsCollection.ts} +1 -1
  348. package/src/features/voice/playing/model/TranscriptionsDownloader.model.ts +88 -0
  349. package/src/features/voice/playing/model/Translation.model.ts +75 -0
  350. package/src/features/voice/playing/model/VoiceFileDownloader.model.ts +2 -2
  351. package/src/features/voice/playing/model/VoicePlayer.model.ts +68 -192
  352. package/src/features/voice/recording/components/VoiceRecordDivider.tsx +2 -2
  353. package/src/features/voice/types.ts +21 -1
  354. package/src/i18n/.generated/schema.json +3 -7
  355. package/src/index.ts +1 -0
  356. package/dist/commonjs/features/fluency/components/FluencyStatusOverlay.js +0 -101
  357. package/dist/commonjs/features/fluency/components/FluencyStatusOverlay.js.map +0 -1
  358. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.js +0 -245
  359. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.js.map +0 -1
  360. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js +0 -109
  361. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js.map +0 -1
  362. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js.map +0 -1
  363. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js +0 -34
  364. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js.map +0 -1
  365. package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.js +0 -66
  366. package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.js.map +0 -1
  367. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.js.map +0 -1
  368. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js.map +0 -1
  369. package/dist/module/features/fluency/components/FluencyStatusOverlay.js +0 -95
  370. package/dist/module/features/fluency/components/FluencyStatusOverlay.js.map +0 -1
  371. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdown.js +0 -238
  372. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdown.js.map +0 -1
  373. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js +0 -103
  374. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js.map +0 -1
  375. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js.map +0 -1
  376. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js +0 -29
  377. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js.map +0 -1
  378. package/dist/module/features/voice/playing/model/TranscriptionsDownloaderModel.js +0 -61
  379. package/dist/module/features/voice/playing/model/TranscriptionsDownloaderModel.js.map +0 -1
  380. package/dist/module/features/voice/playing/model/VoiceTranscriptionsCollection.js.map +0 -1
  381. package/dist/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js.map +0 -1
  382. package/dist/typescript/commonjs/features/fluency/components/FluencyStatusOverlay.d.ts +0 -8
  383. package/dist/typescript/commonjs/features/fluency/components/FluencyStatusOverlay.d.ts.map +0 -1
  384. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts +0 -16
  385. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts.map +0 -1
  386. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts +0 -12
  387. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts.map +0 -1
  388. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts.map +0 -1
  389. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts +0 -11
  390. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts.map +0 -1
  391. package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts +0 -15
  392. package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts.map +0 -1
  393. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts.map +0 -1
  394. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts.map +0 -1
  395. package/dist/typescript/module/features/fluency/components/FluencyStatusOverlay.d.ts +0 -8
  396. package/dist/typescript/module/features/fluency/components/FluencyStatusOverlay.d.ts.map +0 -1
  397. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts +0 -16
  398. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts.map +0 -1
  399. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts +0 -12
  400. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts.map +0 -1
  401. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts.map +0 -1
  402. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts +0 -11
  403. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts.map +0 -1
  404. package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts +0 -15
  405. package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts.map +0 -1
  406. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts.map +0 -1
  407. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts.map +0 -1
  408. package/src/features/fluency/components/FluencyStatusOverlay.tsx +0 -101
  409. package/src/features/voice/playing/components/VoiceTranscriptionsDropdown.tsx +0 -296
  410. package/src/features/voice/playing/components/VoiceTranscriptionsDropdownItem.tsx +0 -128
  411. package/src/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.ts +0 -40
  412. package/src/features/voice/playing/model/TranscriptionsDownloaderModel.ts +0 -80
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_helpers","require","TranslationProvider","glossaries","constructor","supportedLanguages","Set","isTargetSupported","language","resolveLanguage","has","base","split","getSupportedLanguages","values","applyGlossary","text","targetLanguage","glossary","replaceMappedTokens","exports"],"sourceRoot":"../../../../../src","sources":["features/translation/providers/translation.interface.ts"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAWO,MAAeC,mBAAmB,CAA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ot":"../../../../src","sources":["features/translation/types.ts"],"mappings":"","ignoreList":[]}
@@ -58,14 +58,25 @@ Object.keys(_VoicePlayerModel).forEach(function (key) {
58
58
  }
59
59
  });
60
60
  });
61
- var _VoiceTranscriptionsDropdown = require("./playing/components/VoiceTranscriptionsDropdown.js");
62
- Object.keys(_VoiceTranscriptionsDropdown).forEach(function (key) {
61
+ var _VoiceTranscription = require("./playing/components/VoiceTranscription.js");
62
+ Object.keys(_VoiceTranscription).forEach(function (key) {
63
63
  if (key === "default" || key === "__esModule") return;
64
- if (key in exports && exports[key] === _VoiceTranscriptionsDropdown[key]) return;
64
+ if (key in exports && exports[key] === _VoiceTranscription[key]) return;
65
65
  Object.defineProperty(exports, key, {
66
66
  enumerable: true,
67
67
  get: function () {
68
- return _VoiceTranscriptionsDropdown[key];
68
+ return _VoiceTranscription[key];
69
+ }
70
+ });
71
+ });
72
+ var _useVoicePlayerLifecycle = require("./playing/hooks/useVoicePlayerLifecycle.js");
73
+ Object.keys(_useVoicePlayerLifecycle).forEach(function (key) {
74
+ if (key === "default" || key === "__esModule") return;
75
+ if (key in exports && exports[key] === _useVoicePlayerLifecycle[key]) return;
76
+ Object.defineProperty(exports, key, {
77
+ enumerable: true,
78
+ get: function () {
79
+ return _useVoicePlayerLifecycle[key];
69
80
  }
70
81
  });
71
82
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_VoiceRecord","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_VoiceRecordModel","_VoiceRecordDeleteModal","_VoiceRecordUndoModal","_VoicePlayerModel","_VoiceTranscriptionsDropdown","_VoiceIcon","_constants","_types"],"sourceRoot":"../../../../src","sources":["features/voice/index.ts"],"mappings":";;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,YAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAA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AA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAW,UAAA,CAAAX,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAO,UAAA,CAAAX,GAAA;IAAA;EAAA;AAAA;AACA,IAAAY,MAAA,GAAAhB,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAc,MAAA,EAAAb,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAY,MAAA,CAAAZ,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAQ,MAAA,CAAAZ,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["_VoiceRecord","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_VoiceRecordModel","_VoiceRecordDeleteModal","_VoiceRecordUndoModal","_VoicePlayerModel","_VoiceTranscription","_useVoicePlayerLifecycle","_VoiceIcon","_constants","_types"],"sourceRoot":"../../../../src","sources":["features/voice/index.ts"],"mappings":";;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,YAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,YAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,YAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,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AG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAO,UAAA,CAAAX,GAAA;IAAA;EAAA;AAAA;AACA,IAAAY,UAAA,GAAAhB,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAc,UAAA,EAAAb,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAY,UAAA,CAAAZ,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAQ,UAAA,CAAAZ,GAAA;IAAA;EAAA;AAAA;AACA,IAAAa,MAAA,GAAAjB,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAe,MAAA,EAAAd,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAa,MAAA,CAAAb,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAS,MAAA,CAAAb,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -38,7 +38,7 @@ const styles = _reactNative.StyleSheet.create({
38
38
  height: '80%',
39
39
  aspectRatio: 1,
40
40
  alignSelf: 'center',
41
- padding: 24,
41
+ padding: _reactNativeUi.SPACING[600],
42
42
  borderWidth: 4,
43
43
  borderColor: _reactNativeUi.COLORS.NEUTRAL_5,
44
44
  borderRadius: 400,
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_react","_interopRequireDefault","_reactNativeUi","_reactNativeReanimated","_interopRequireWildcard","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","VoiceIcon","style","jsx","View","entering","FadeIn","duration","styles","container","children","iconContainer","MicrophoneIcon","color","COLORS","NEUTRAL_5","exports","StyleSheet","create","flex","justifyContent","alignItems","maxHeight","height","aspectRatio","alignSelf","padding","borderWidth","borderColor","borderRadius"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/components/VoiceIcon.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAC,uBAAA,CAAAL,OAAA;AAA0D,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,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;IACnBC,OAAO,EAAE,EAAE;IACXC,WAAW,EAAE,CAAC;IACdC,WAAW,EAAEd,qBAAM,CAACC,SAAS;IAC7Bc,YAAY,EAAE,GAAG;IACjBT,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_react","_interopRequireDefault","_reactNativeUi","_reactNativeReanimated","_interopRequireWildcard","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","VoiceIcon","style","jsx","View","entering","FadeIn","duration","styles","container","children","iconContainer","MicrophoneIcon","color","COLORS","NEUTRAL_5","exports","StyleSheet","create","flex","justifyContent","alignItems","maxHeight","height","aspectRatio","alignSelf","padding","SPACING","borderWidth","borderColor","borderRadius"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/components/VoiceIcon.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAC,uBAAA,CAAAL,OAAA;AAA0D,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IA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K,EAAEC,qBAAM,CAACC;MAAU,CAAE;IAAC,CACvC;EAAC,CACM,CAAC;AAEpB,CAAC;AAAAC,OAAA,CAAAf,SAAA,GAAAA,SAAA;AAED,MAAMO,MAAM,GAAGS,uBAAU,CAACC,MAAM,CAAC;EAC/BT,SAAS,EAAE;IACTU,IAAI,EAAE,CAAC;IACPC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd,CAAC;EACDV,aAAa,EAAE;IACbW,SAAS,EAAE,GAAG;IACdC,MAAM,EAAE,KAAK;IACbC,WAAW,EAAE,CAAC;IACdC,SAAS,EAAE,QAAQ;IACnBC,OAAO,EAAEC,sBAAO,CAAC,GAAG,CAAC;IACrBC,WAAW,EAAE,CAAC;IACdC,WAAW,EAAEf,qBAAM,CAACC,SAAS;IAC7Be,YAAY,EAAE,GAAG;IACjBV,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.VoiceTranscriptContent = void 0;
7
+ var _reactNativeUi = require("@magmamath/react-native-ui");
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _reactNative = require("react-native");
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ const VoiceTranscriptContent = ({
13
+ text,
14
+ isLoading
15
+ }) => {
16
+ if (isLoading) {
17
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
18
+ style: styles.loaderContainer,
19
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Loader, {
20
+ size: _reactNativeUi.LoaderSize.SMALL,
21
+ color: _reactNativeUi.LoaderColor.BLUE
22
+ })
23
+ });
24
+ }
25
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Typography, {
26
+ variant: "h8",
27
+ style: styles.text,
28
+ children: text
29
+ });
30
+ };
31
+ exports.VoiceTranscriptContent = VoiceTranscriptContent;
32
+ const styles = _reactNative.StyleSheet.create({
33
+ text: {
34
+ color: _reactNativeUi.COLORS.NEUTRAL_7,
35
+ paddingHorizontal: _reactNativeUi.SPACING[200],
36
+ paddingVertical: _reactNativeUi.SPACING[200]
37
+ },
38
+ loaderContainer: {
39
+ justifyContent: 'center',
40
+ alignItems: 'center',
41
+ paddingVertical: _reactNativeUi.SPACING[200]
42
+ }
43
+ });
44
+ //# sourceMappingURL=VoiceTranscriptContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNativeUi","require","_react","_interopRequireDefault","_reactNative","_jsxRuntime","e","__esModule","default","VoiceTranscriptContent","text","isLoading","jsx","View","style","styles","loaderContainer","children","Loader","size","LoaderSize","SMALL","color","LoaderColor","BLUE","Typography","variant","exports","StyleSheet","create","COLORS","NEUTRAL_7","paddingHorizontal","SPACING","paddingVertical","justifyContent","alignItems"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/components/VoiceTranscriptContent.tsx"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAQA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAA+C,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAOxC,MAAMG,sBAAsB,GAAGA,CAAC;EAAEC,IAAI;EAAEC;AAAuC,CAAC,KAAK;EAC1F,IAAIA,SAAS,EAAE;IACb,oBACE,IAAAN,WAAA,CAAAO,GAAA,EAACR,YAAA,CAAAS,IAAI;MAACC,KAAK,EAAEC,MAAM,CAACC,eAAgB;MAAAC,QAAA,eAClC,IAAAZ,WAAA,CAAAO,GAAA,EAACZ,cAAA,CAAAkB,MAAM;QAACC,IAAI,EAAEC,yBAAU,CAACC,KAAM;QAACC,KAAK,EAAEC,0BAAW,CAACC;MAAK,CAAE;IAAC,CACvD,CAAC;EAEX;EAEA,oBACE,IAAAnB,WAAA,CAAAO,GAAA,EAACZ,cAAA,CAAAyB,UAAU;IAACC,OAAO,EAAC,IAAI;IAACZ,KAAK,EAAEC,MAAM,CAACL,IAAK;IAAAO,QAAA,EACzCP;EAAI,CACK,CAAC;AAEjB,CAAC;AAAAiB,OAAA,CAAAlB,sBAAA,GAAAA,sBAAA;AAED,MAAMM,MAAM,GAAGa,uBAAU,CAACC,MAAM,CAAC;EAC/BnB,IAAI,EAAE;IACJY,KAAK,EAAEQ,qBAAM,CAACC,SAAS;IACvBC,iBAAiB,EAAEC,sBAAO,CAAC,GAAG,CAAC;IAC/BC,eAAe,EAAED,sBAAO,CAAC,GAAG;EAC9B,CAAC;EACDjB,eAAe,EAAE;IACfmB,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBF,eAAe,EAAED,sBAAO,CAAC,GAAG;EAC9B;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.VoiceTranscription = void 0;
7
+ var _reactNativeUi = require("@magmamath/react-native-ui");
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _reactNative = require("react-native");
10
+ var _reactNativeReanimated = _interopRequireDefault(require("react-native-reanimated"));
11
+ var _types = require("../../types.js");
12
+ var _i18n = require("../../../../i18n/i18n.js");
13
+ var _useVoiceTranscriptionController = require("../hooks/useVoiceTranscriptionController.js");
14
+ var _VoiceTranscriptContent = require("./VoiceTranscriptContent.js");
15
+ var _VoiceTranscriptionCollapsible = require("./VoiceTranscriptionCollapsible.js");
16
+ var _VoiceTranscriptionHeaderActions = require("./VoiceTranscriptionHeaderActions.js");
17
+ var _jsxRuntime = require("react/jsx-runtime");
18
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
19
+ const VoiceTranscription = ({
20
+ style,
21
+ model,
22
+ answers,
23
+ attemptOffset,
24
+ attemptsCount,
25
+ problemId,
26
+ variant = _types.VoiceTranscriptionVariant.SMALL
27
+ }) => {
28
+ const t = (0, _i18n.useText)();
29
+ const {
30
+ display,
31
+ flags,
32
+ actions
33
+ } = (0, _useVoiceTranscriptionController.useVoiceTranscriptionController)({
34
+ model,
35
+ answers,
36
+ attemptOffset,
37
+ attemptsCount,
38
+ problemId
39
+ });
40
+ const isLargeVariant = variant === _types.VoiceTranscriptionVariant.LARGE;
41
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeReanimated.default.View, {
42
+ style: [styles.container, isLargeVariant ? styles.largeContainer : styles.smallContainer, style],
43
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
44
+ style: styles.header,
45
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Typography, {
46
+ style: styles.title,
47
+ variant: "h7",
48
+ children: t('voice.transcriptions')
49
+ }), flags.anyAttemptHasAudio && /*#__PURE__*/(0, _jsxRuntime.jsx)(_VoiceTranscriptionHeaderActions.VoiceTranscriptionHeaderActions, {
50
+ playerState: flags.playerState,
51
+ isTranslationActive: flags.isTranslationActive,
52
+ canTranslate: flags.canTranslate,
53
+ onPlayPress: actions.onPlayPress,
54
+ onTranslationPress: actions.onTranslationToggle
55
+ })]
56
+ }), isLargeVariant ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_VoiceTranscriptContent.VoiceTranscriptContent, {
57
+ text: display.text,
58
+ isLoading: display.isLoading
59
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_VoiceTranscriptionCollapsible.VoiceTranscriptionCollapsible, {
60
+ text: display.text,
61
+ isLoading: display.isLoading,
62
+ dropdown: model.dropdown
63
+ })]
64
+ });
65
+ };
66
+ exports.VoiceTranscription = VoiceTranscription;
67
+ const styles = _reactNative.StyleSheet.create({
68
+ container: {
69
+ padding: _reactNativeUi.SPACING[100],
70
+ boxShadow: '0px 1px 3px 0px rgba(51, 51, 51, 0.25)',
71
+ borderRadius: 12,
72
+ backgroundColor: _reactNativeUi.COLORS.NEUTRAL_1,
73
+ overflow: 'hidden'
74
+ },
75
+ // SMALL: floats over the drawing area; consumer-positioned siblings sit
76
+ // beneath it. Absolute positioning is intentional here.
77
+ smallContainer: {
78
+ position: 'absolute',
79
+ top: 56,
80
+ left: _reactNativeUi.SPACING[200],
81
+ width: 222,
82
+ maxHeight: 405,
83
+ minHeight: 51
84
+ },
85
+ // LARGE: rendered as a flex child of the SolutionCard's column flow,
86
+ // between the header and footer. Auto-sizes to whatever space the footer
87
+ // (with or without the playable timeline) leaves — no magic numbers.
88
+ largeContainer: {
89
+ flex: 1,
90
+ marginHorizontal: _reactNativeUi.SPACING[200],
91
+ marginTop: _reactNativeUi.SPACING[200],
92
+ marginBottom: _reactNativeUi.SPACING[200]
93
+ },
94
+ header: {
95
+ flexDirection: 'row',
96
+ justifyContent: 'space-between',
97
+ alignItems: 'center',
98
+ padding: _reactNativeUi.SPACING[100],
99
+ marginBottom: _reactNativeUi.SPACING[100],
100
+ height: 32
101
+ },
102
+ title: {
103
+ color: _reactNativeUi.COLORS.NEUTRAL_9,
104
+ marginLeft: _reactNativeUi.SPACING[100]
105
+ }
106
+ });
107
+ //# sourceMappingURL=VoiceTranscription.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNativeUi","require","_react","_interopRequireDefault","_reactNative","_reactNativeReanimated","_types","_i18n","_useVoiceTranscriptionController","_VoiceTranscriptContent","_VoiceTranscriptionCollapsible","_VoiceTranscriptionHeaderActions","_jsxRuntime","e","__esModule","default","VoiceTranscription","style","model","answers","attemptOffset","attemptsCount","problemId","variant","VoiceTranscriptionVariant","SMALL","t","useText","display","flags","actions","useVoiceTranscriptionController","isLargeVariant","LARGE","jsxs","View","styles","container","largeContainer","smallContainer","children","header","jsx","Typography","title","anyAttemptHasAudio","VoiceTranscriptionHeaderActions","playerState","isTranslationActive","canTranslate","onPlayPress","onTranslationPress","onTranslationToggle","VoiceTranscriptContent","text","isLoading","VoiceTranscriptionCollapsible","dropdown","exports","StyleSheet","create","padding","SPACING","boxShadow","borderRadius","backgroundColor","COLORS","NEUTRAL_1","overflow","position","top","left","width","maxHeight","minHeight","flex","marginHorizontal","marginTop","marginBottom","flexDirection","justifyContent","alignItems","height","color","NEUTRAL_9","marginLeft"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/components/VoiceTranscription.tsx"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,gCAAA,GAAAP,OAAA;AAEA,IAAAQ,uBAAA,GAAAR,OAAA;AACA,IAAAS,8BAAA,GAAAT,OAAA;AACA,IAAAU,gCAAA,GAAAV,OAAA;AAAmF,IAAAW,WAAA,GAAAX,OAAA;AAAA,SAAAE,uBAAAU,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAY5E,MAAMG,kBAAkB,GAAGA,CAAC;EACjCC,KAAK;EACLC,KAAK;EACLC,OAAO;EACPC,aAAa;EACbC,aAAa;EACbC,SAAS;EACTC,OAAO,GAAGC,gCAAyB,CAACC;AACb,CAAC,KAAK;EAC7B,MAAMC,CAAC,GAAG,IAAAC,aAAO,EAAC,CAAC;EACnB,MAAM;IAAEC,OAAO;IAAEC,KAAK;IAAEC;EAAQ,CAAC,GAAG,IAAAC,gEAA+B,EAAC;IAClEb,KAAK;IACLC,OAAO;IACPC,aAAa;IACbC,aAAa;IACbC;EACF,CAAC,CAAC;EACF,MAAM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
+ value: true
5
+ });
6
+ exports.VoiceTranscriptionCollapsible = void 0;
7
+ var _reactNativeUi = require("@magmamath/react-native-ui");
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _reactNative = require("react-native");
10
+ var _reactNativeReanimated = _interopRequireDefault(require("react-native-reanimated"));
11
+ var _useDropdownAnimation = require("../hooks/useDropdownAnimation.js");
12
+ var _VoiceTranscriptContent = require("./VoiceTranscriptContent.js");
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
16
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
+ const AnimatedTouchableOpacity = _reactNativeReanimated.default.createAnimatedComponent(_reactNative.TouchableOpacity);
18
+ const VoiceTranscriptionCollapsible = ({
19
+ text,
20
+ isLoading,
21
+ dropdown
22
+ }) => {
23
+ const {
24
+ listAnimatedStyle,
25
+ iconAnimatedStyle,
26
+ onListLayout
27
+ } = (0, _useDropdownAnimation.useDropdownAnimation)(dropdown);
28
+ const handleToggle = (0, _react.useCallback)(() => {
29
+ dropdown.toggleExpand();
30
+ }, [dropdown]);
31
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
32
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
33
+ style: [listAnimatedStyle, styles.collapsibleContent],
34
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
35
+ onLayout: onListLayout,
36
+ style: styles.transcriptContainer,
37
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_VoiceTranscriptContent.VoiceTranscriptContent, {
38
+ text: text,
39
+ isLoading: isLoading
40
+ })
41
+ })
42
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(AnimatedTouchableOpacity, {
43
+ style: [styles.expandButton, iconAnimatedStyle],
44
+ onPress: handleToggle,
45
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.CaretDownIcon, {
46
+ size: 22
47
+ })
48
+ })]
49
+ });
50
+ };
51
+ exports.VoiceTranscriptionCollapsible = VoiceTranscriptionCollapsible;
52
+ const styles = _reactNative.StyleSheet.create({
53
+ collapsibleContent: {
54
+ overflow: 'hidden'
55
+ },
56
+ transcriptContainer: {
57
+ position: 'absolute',
58
+ width: '100%',
59
+ paddingHorizontal: 4
60
+ },
61
+ expandButton: {
62
+ justifyContent: 'center',
63
+ alignItems: 'center'
64
+ }
65
+ });
66
+ //# sourceMappingURL=VoiceTranscriptionCollapsible.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNativeUi","require","_react","_interopRequireWildcard","_reactNative","_reactNativeReanimated","_interopRequireDefault","_useDropdownAnimation","_VoiceTranscriptContent","_jsxRuntime","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","AnimatedTouchableOpacity","Animated","createAnimatedComponent","TouchableOpacity","VoiceTranscriptionCollapsible","text","isLoading","dropdown","listAnimatedStyle","iconAnimatedStyle","onListLayout","useDropdownAnimation","handleToggle","useCallback","toggleExpand","jsxs","Fragment","children","jsx","View","style","styles","collapsibleContent","onLayout","transcriptContainer","VoiceTranscriptContent","expandButton","onPress","CaretDownIcon","size","exports","StyleSheet","create","overflow","position","width","paddingHorizontal","justifyContent","alignItems"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/components/VoiceTranscriptionCollapsible.tsx"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,qBAAA,GAAAN,OAAA;AAEA,IAAAO,uBAAA,GAAAP,OAAA;AAAiE,IAAAQ,WAAA,GAAAR,OAAA;AAAA,SAAAK,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAE,OAAA,EAAAF,CAAA,QAAAM,CAAA,GAAAH,wBAAA,CAAAE,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAP,CAAA,UAAAM,CAAA,CAAAE,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAf,CAAA,oBAAAe,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAe,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAd,CAAA,EAAAe,CAAA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AAC,CACM,CAAC,eAChB,IAAA3B,WAAA,CAAAuC,GAAA,EAAClB,wBAAwB;MACvBoB,KAAK,EAAE,CAACC,MAAM,CAACK,YAAY,EAAEjB,iBAAiB,CAAE;MAChDkB,OAAO,EAAEf,YAAa;MAAAK,QAAA,eAEtB,IAAAtC,WAAA,CAAAuC,GAAA,EAAChD,cAAA,CAAA0D,aAAa;QAACC,IAAI,EAAE;MAAG,CAAE;IAAC,CACH,CAAC;EAAA,CAC3B,CAAC;AAEP,CAAC;AAAAC,OAAA,CAAA1B,6BAAA,GAAAA,6BAAA;AAED,MAAMiB,MAAM,GAAGU,uBAAU,CAACC,MAAM,CAAC;EAC/BV,kBAAkB,EAAE;IAClBW,QAAQ,EAAE;EACZ,CAAC;EACDT,mBAAmB,EAAE;IACnBU,QAAQ,EAAE,UAAU;IACpBC,KAAK,EAAE,MAAM;IACbC,iBAAiB,EAAE;EACrB,CAAC;EACDV,YAAY,EAAE;IACZW,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.VoiceTranscriptionHeaderActions = void 0;
7
+ var _reactNativeUi = require("@magmamath/react-native-ui");
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _reactNative = require("react-native");
10
+ var _styleTypes = require("../../../chatbot/types/style.types.js");
11
+ var _PlayButton = require("../../../../shared/components/PlayButton.js");
12
+ var _index = require("../model/index.js");
13
+ var _helpers = require("../../helpers.js");
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
+ const VoiceTranscriptionHeaderActions = ({
17
+ playerState,
18
+ isTranslationActive,
19
+ canTranslate,
20
+ onPlayPress,
21
+ onTranslationPress
22
+ }) => {
23
+ const playButtonState = {
24
+ isActive: playerState !== _index.PlayerState.IDLE,
25
+ isLoading: playerState === _index.PlayerState.LOADING,
26
+ status: (0, _helpers.getAudioStatus)(playerState)
27
+ };
28
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
29
+ style: styles.container,
30
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_PlayButton.PlayButton, {
31
+ state: playButtonState,
32
+ onPress: onPlayPress,
33
+ activityIndicatorColor: _reactNativeUi.COLORS.NEUTRAL_1,
34
+ colorScheme: _styleTypes.ColorScheme.Yellow
35
+ }), canTranslate && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Button, {
36
+ variant: "secondary",
37
+ size: "small",
38
+ colorScheme: _styleTypes.ColorScheme.Yellow,
39
+ isActive: isTranslationActive,
40
+ onPress: onTranslationPress,
41
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.GlobeIcon, {
42
+ color: isTranslationActive ? _reactNativeUi.COLORS.NEUTRAL_1 : _reactNativeUi.COLORS.NEUTRAL_9
43
+ })
44
+ })]
45
+ });
46
+ };
47
+ exports.VoiceTranscriptionHeaderActions = VoiceTranscriptionHeaderActions;
48
+ const styles = _reactNative.StyleSheet.create({
49
+ container: {
50
+ flexDirection: 'row',
51
+ alignItems: 'center',
52
+ gap: _reactNativeUi.SPACING[200]
53
+ },
54
+ hidden: {
55
+ opacity: 0
56
+ }
57
+ });
58
+ //# sourceMappingURL=VoiceTranscriptionHeaderActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNativeUi","require","_react","_interopRequireDefault","_reactNative","_styleTypes","_PlayButton","_index","_helpers","_jsxRuntime","e","__esModule","default","VoiceTranscriptionHeaderActions","playerState","isTranslationActive","canTranslate","onPlayPress","onTranslationPress","playButtonState","isActive","PlayerState","IDLE","isLoading","LOADING","status","getAudioStatus","jsxs","View","style","styles","container","children","jsx","PlayButton","state","onPress","activityIndicatorColor","COLORS","NEUTRAL_1","colorScheme","ColorScheme","Yellow","Button","variant","size","icon","GlobeIcon","color","NEUTRAL_9","exports","StyleSheet","create","flexDirection","alignItems","gap","SPACING","hidden","opacity"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/components/VoiceTranscriptionHeaderActions.tsx"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAA8C,IAAAQ,WAAA,GAAAR,OAAA;AAAA,SAAAE,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAUvC,MAAMG,+BAA+B,GAAGA,CAAC;EAC9CC,WAAW;EACXC,mBAAmB;EACnBC,YAAY;EACZC,WAAW;EACXC;AACqC,CAAC,KAAK;EAC3C,MAAMC,eAAe,GAAG;IACtBC,QAAQ,EAAEN,WAAW,KAAKO,kBAAW,CAACC,IAAI;IAC1CC,SAAS,EAAET,WAAW,KAAKO,kBAAW,CAACG,OAAO;IAC9CC,MAAM,EAAE,IAAAC,uBAAc,EAACZ,WAAW;EACpC,CAAC;EAED,oBACE,IAAAL,WAAA,CAAAkB,IAAA,EAACvB,YAAA,CAAAwB,IAAI;IAACC,KAAK,EAAEC,MAAM,CAACC,SAAU;IAAAC,QAAA,gBAC5B,IAAAvB,WAAA,CAAAwB,GAAA,EAAC3B,WAAA,CAAA4B,UAAU;MACTC,KAAK,EAAEhB,eAAgB;MACvBiB,OAAO,EAAEnB,WAAY;MACrBoB,sBAAsB,EAAEC,qBAAM,CAACC,SAAU;MACzCC,WAAW,EAAEC,uBAAW,CAACC;IAAO,CACjC,CAAC,EACD1B,YAAY,iBACX,IAAAP,WAAA,CAAAwB,GAAA,EAACjC,cAAA,CAAA2C,MAAM;MACLC,OAAO,EAAC,WAAW;MACnBC,IAAI,EAAC,OAAO;MACZL,WAAW,EAAEC,uBAAW,CAACC,MAAO;MAChCtB,QAAQ,EAAEL,mBAAoB;MAC9BqB,OAAO,EAAElB,kBAAmB;MAC5B4B,IAAI,eAAE,IAAArC,WAAA,CAAAwB,GAAA,EAACjC,cAAA,CAAA+C,SAAS;QAACC,KAAK,EAAEjC,mBAAmB,GAAGuB,qBAAM,CAACC,SAAS,GAAGD,qBAAM,CAACW;MAAU,CAAE;IAAE,CACvF,CACF;EAAA,CACG,CAAC;AAEX,CAAC;AAAAC,OAAA,CAAArC,+BAAA,GAAAA,+BAAA;AAED,MAAMiB,MAAM,GAAGqB,uBAAU,CAACC,MAAM,CAAC;EAC/BrB,SAAS,EAAE;IACTsB,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,GAAG,EAAEC,sBAAO,CAAC,GAAG;EAClB,CAAC;EACDC,MAAM,EAAE;IACNC,OAAO,EAAE;EACX;AACF,CAAC,CAAC","ignoreList":[]}
@@ -3,20 +3,21 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useVoiceTranscriptionsDropdown = void 0;
6
+ exports.useDropdownAnimation = void 0;
7
7
  var _react = require("react");
8
8
  var _effectorReact = require("effector-react");
9
9
  var _reactNativeReanimated = require("react-native-reanimated");
10
10
  var _constants = require("../../constants.js");
11
- const useVoiceTranscriptionsDropdown = model => {
11
+ const useDropdownAnimation = model => {
12
12
  const isExpanded = (0, _effectorReact.useUnit)(model.$isExpanded);
13
13
  const contentHeight = (0, _reactNativeReanimated.useSharedValue)(0);
14
14
  const animationProgress = (0, _reactNativeReanimated.useSharedValue)(isExpanded ? 1 : 0);
15
15
  const onListLayout = event => {
16
16
  const measuredHeight = event.nativeEvent.layout.height;
17
- if (measuredHeight > 0) {
18
- contentHeight.value = measuredHeight;
19
- }
17
+ if (measuredHeight <= 0) return;
18
+ contentHeight.value = contentHeight.value === 0 ? measuredHeight : (0, _reactNativeReanimated.withTiming)(measuredHeight, {
19
+ duration: 180
20
+ });
20
21
  };
21
22
  const listAnimatedStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
22
23
  const height = (0, _reactNativeReanimated.interpolate)(animationProgress.value, [0, 1], [0, contentHeight.value || _constants.DROPDOWN_MAX_CONTENT_HEIGHT]);
@@ -46,5 +47,5 @@ const useVoiceTranscriptionsDropdown = model => {
46
47
  onListLayout
47
48
  };
48
49
  };
49
- exports.useVoiceTranscriptionsDropdown = useVoiceTranscriptionsDropdown;
50
- //# sourceMappingURL=useVoiceTranscriptionsDropdown.js.map
50
+ exports.useDropdownAnimation = useDropdownAnimation;
51
+ //# sourceMappingURL=useDropdownAnimation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_effectorReact","_reactNativeReanimated","_constants","useDropdownAnimation","model","isExpanded","useUnit","$isExpanded","contentHeight","useSharedValue","animationProgress","onListLayout","event","measuredHeight","nativeEvent","layout","height","value","withTiming","duration","listAnimatedStyle","useAnimatedStyle","interpolate","DROPDOWN_MAX_CONTENT_HEIGHT","opacity","iconAnimatedStyle","rotation","transform","rotate","useEffect","exports"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/hooks/useDropdownAnimation.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAEA,IAAAG,UAAA,GAAAH,OAAA;AAGO,MAAMI,oBAAoB,GAAIC,KAAoB,IAAK;EAC5D,MAAMC,UAAU,GAAG,IAAAC,sBAAO,EAACF,KAAK,CAACG,WAAW,CAAC;EAE7C,MAAMC,aAAa,GAAG,IAAAC,qCAAc,EAAC,CAAC,CAAC;EACvC,MAAMC,iBAAiB,GAAG,IAAAD,qCAAc,EAACJ,UAAU,GAAG,CAAC,GAAG,CAAC,CAAC;EAE5D,MAAMM,YAAY,GAA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AG,CAAC,GAAG,CAAC,EAAE;MAAEc,QAAQ,EAAE;IAAI,CAAC,CAAC;EAC7E,CAAC,EAAE,CAACd,UAAU,EAAEK,iBAAiB,CAAC,CAAC;EAEnC,OAAO;IACLL,UAAU;IACVe,iBAAiB;IACjBK,iBAAiB;IACjBd;EACF,CAAC;AACH,CAAC;AAAAmB,OAAA,CAAA3B,oBAAA,GAAAA,oBAAA","ignoreList":[]}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useVoicePlayerLifecycle = void 0;
7
+ var _react = require("react");
8
+ var _helpers = require("../../helpers.js");
9
+ // Owns playback engine mutations (init/reset/setCurrentAttempt/stopAudio).
10
+ // VoiceTranscription stays read-only; consumers call this once per page.
11
+ const useVoicePlayerLifecycle = ({
12
+ model,
13
+ answers,
14
+ attemptOffset,
15
+ attemptsCount,
16
+ problemId
17
+ }) => {
18
+ const activeAttempt = (0, _helpers.getActiveAttempt)(attemptOffset, attemptsCount);
19
+ const answersKey = (0, _react.useMemo)(() => answers.map(a => `${a._id}:${a.audioFileId ?? ''}`).join(','), [answers]);
20
+ const hasAnyAudio = (0, _react.useMemo)(() => answers.some(a => !!a.audioFileId), [answers]);
21
+ const answersRef = (0, _react.useRef)(answers);
22
+ answersRef.current = answers;
23
+ (0, _react.useEffect)(() => {
24
+ model.reinitializePlayer();
25
+ // No stopAudio cleanup: this hook re-runs across normal renders in some
26
+ // host components, and tearing down audio in the cleanup races with
27
+ // play() requests from other consumers (e.g. TimelineManager). The page
28
+ // unmount path (resetPlayer / cleanup) still releases audio properly.
29
+ }, [model]);
30
+ (0, _react.useEffect)(() => {
31
+ model.resetPlayer();
32
+ }, [problemId]);
33
+ (0, _react.useEffect)(() => {
34
+ if (answersRef.current.some(a => a.audioFileId)) {
35
+ model.initializeWithAudios(answersRef.current);
36
+ }
37
+ }, [model, answersKey]);
38
+ (0, _react.useEffect)(() => {
39
+ // No stopAudio: VoiceSource (timeline) and VoiceTranscription (manual play
40
+ // button) drive playback transitions themselves. Calling stopAudio here
41
+ // races with concurrent play() requests and aborts in-flight audio.play().
42
+ model.setCurrentAttempt(activeAttempt);
43
+ if (activeAttempt !== null) {
44
+ model.loader.loadTranscriptForAttempt(activeAttempt);
45
+ }
46
+ }, [model, activeAttempt, answersKey]);
47
+ return {
48
+ activeAttempt,
49
+ hasAnyAudio
50
+ };
51
+ };
52
+ exports.useVoicePlayerLifecycle = useVoicePlayerLifecycle;
53
+ //# sourceMappingURL=useVoicePlayerLifecycle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_helpers","useVoicePlayerLifecycle","model","answers","attemptOffset","attemptsCount","problemId","activeAttempt","getActiveAttempt","answersKey","useMemo","map","a","_id","audioFileId","join","hasAnyAudio","some","answersRef","useRef","current","useEffect","reinitializePlayer","resetPlayer","initializeWithAudios","setCurrentAttempt","loader","loadTranscriptForAttempt","exports"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/hooks/useVoicePlayerLifecycle.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAYA;AACA;AACO,MAAME,uBAAuB,GAAGA,CAAC;EACtCC,KAAK;EACLC,OAAO;EACPC,aAAa;EACbC,aAAa;EACbC;AACM,CAAC,KAAK;EACZ,MAAMC,aAAa,GAAG,IAAAC,yBAAgB,EAACJ,aAAa,EAAEC,aAAa,CAAC;EAEpE,MAAMI,UAAU,GAAG,IAAAC,cAAO,EACxB,MAAMP,OAAO,CAACQ,GAAG,CAAEC,CAAC,IAAK,GAAGA,CAAC,CAACC,GAAG,IAAID,CAAC,CAACE,WAAW,IAAI,EAAE,EAAE,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,EACrE,CAACZ,OAAO,CACV,CAAC;EAED,MAAMa,WAAW,GAAG,IAAAN,cAAO,EAAC,MAAMP,OAAO,CAACc,IAAI,CAAEL,CAAC,IAAK,CAAC,CAACA,CAAC,CAACE,WAAW,CAAC,EAAE,CAACX,OAAO,CAAC,CAAC;EAElF,MAAMe,UAAU,GAAG,IAAAC,aAAM,EAAChB,OAAO,CAAC;EAClCe,UAAU,CAACE,OAAO,GAAGjB,OAAO;EAE5B,IAAAkB,gBAAS,EAAC,MAAM;IACdnB,KAAK,CAACoB,kBAAkB,CAAC,CAAC;IAC1B;IACA;IACA;IACA;EACF,CAAC,EAAE,CAACpB,KAAK,CAAC,CAAC;EAEX,IAAAmB,gBAAS,EAAC,MAAM;IACdnB,KAAK,CAACqB,WAAW,CAAC,CAAC;EACrB,CAAC,EAAE,CAACjB,SAAS,CAAC,CAAC;EAEf,IAAAe,gBAAS,EAAC,MAAM;IACd,IAAIH,UAAU,CAACE,OAAO,CAACH,IAAI,CAAEL,CAAC,IAAKA,CAAC,CAACE,WAAW,CAAC,EAAE;MACjDZ,KAAK,CAACsB,oBAAoB,CAACN,UAAU,CAACE,OAAO,CAAC;IAChD;EACF,CAAC,EAAE,CAAClB,KAAK,EAAEO,UAAU,CAAC,CAAC;EAEvB,IAAAY,gBAAS,EAAC,MAAM;IACd;IACA;IACA;IACAnB,KAAK,CAACuB,iBAAiB,CAAClB,aAAa,CAAC;IACtC,IAAIA,aAAa,KAAK,IAAI,EAAE;MAC1BL,KAAK,CAACwB,MAAM,CAACC,wBAAwB,CAACpB,aAAa,CAAC;IACtD;EACF,CAAC,EAAE,CAACL,KAAK,EAAEK,aAAa,EAAEE,UAAU,CAAC,CAAC;EAEtC,OAAO;IAAEF,aAAa;IAAES;EAAY,CAAC;AACvC,CAAC;AAAAY,OAAA,CAAA3B,uBAAA,GAAAA,uBAAA","ignoreList":[]}
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useVoiceTranscriptionController = void 0;
7
+ var _effectorReact = require("effector-react");
8
+ var _react = require("react");
9
+ var _reactI18next = require("react-i18next");
10
+ var _constants = require("../../constants.js");
11
+ var _helpers = require("../../helpers.js");
12
+ var _supportedLanguages = require("../../../translation/providers/google/supportedLanguages.js");
13
+ var _i18n = require("../../../../i18n/i18n.js");
14
+ const useVoiceTranscriptionController = ({
15
+ model,
16
+ answers,
17
+ attemptOffset,
18
+ attemptsCount,
19
+ problemId
20
+ }) => {
21
+ const t = (0, _i18n.useText)();
22
+ const {
23
+ i18n
24
+ } = (0, _reactI18next.useTranslation)();
25
+ const [playerState, isLoadingTranscripts, isTranslationActive, translations, isTranslating] = (0, _effectorReact.useUnit)([model.$playerState, model.loader.loadTranscriptForAttempt.pending, model.translation.$isActive, model.translation.$translations, model.translation.translate.pending]);
26
+ // Auto-activate translation once per (problemId, activeAttempt) when translatable
27
+ const autoActivatedAttempts = (0, _react.useRef)(new Set());
28
+ const activeAttempt = (0, _helpers.getActiveAttempt)(attemptOffset, attemptsCount);
29
+ const activeAudioFileId = activeAttempt !== null ? answers?.[activeAttempt - 1]?.audioFileId : undefined;
30
+ const hasActiveAudio = activeAudioFileId !== undefined;
31
+ const anyAttemptHasAudio = (0, _react.useMemo)(() => answers.some(a => !!a.audioFileId), [answers]);
32
+ const cachedEntry = activeAudioFileId ? model.loader.getCachedTranscript(activeAudioFileId) : undefined;
33
+ const activeTranscript = cachedEntry?.text ?? null;
34
+ const hasTranscriptText = !!activeTranscript && activeTranscript !== _constants.NO_AUDIO_BE_MESSAGE;
35
+ const isActiveTranscriptLoading = isLoadingTranscripts && hasActiveAudio && !activeTranscript;
36
+ const isSourceSameAsTarget = !!cachedEntry?.language && (0, _supportedLanguages.resolveGoogleLanguageCode)(cachedEntry.language) === (0, _supportedLanguages.resolveGoogleLanguageCode)(i18n.language);
37
+ const canTranslate = hasTranscriptText && !isSourceSameAsTarget;
38
+ const cachedTranslation = activeAttempt !== null ? translations[activeAttempt] : undefined;
39
+ const showTranslation = isTranslationActive && canTranslate;
40
+ const isTranslationLoading = showTranslation && !cachedTranslation && isTranslating;
41
+ const displayText = showTranslation ? cachedTranslation ?? activeTranscript : hasTranscriptText ? activeTranscript : t('voice.transcriptNotAvailable');
42
+
43
+ // UI-only lifecycle: collapse the dropdown on mount/unmount and on problem
44
+ // change. Playback engine mutations (init/reset/setCurrentAttempt/stopAudio)
45
+ // are owned by useVoicePlayerLifecycle, called by the page-level consumer.
46
+ (0, _react.useEffect)(() => {
47
+ return () => {
48
+ model.dropdown.setExpanded(false);
49
+ };
50
+ }, [model]);
51
+ (0, _react.useEffect)(() => {
52
+ model.dropdown.setExpanded(false);
53
+ }, [problemId]);
54
+ (0, _react.useEffect)(() => {
55
+ autoActivatedAttempts.current.clear();
56
+ }, [problemId]);
57
+ (0, _react.useEffect)(() => {
58
+ if (canTranslate && activeAttempt !== null && !autoActivatedAttempts.current.has(activeAttempt)) {
59
+ autoActivatedAttempts.current.add(activeAttempt);
60
+ model.translation.setActive(true);
61
+ }
62
+ }, [canTranslate, activeAttempt, model]);
63
+
64
+ // Trigger translate when we should show translation but don't have it cached
65
+ (0, _react.useEffect)(() => {
66
+ if (showTranslation && activeAttempt !== null && !cachedTranslation && !isTranslating) {
67
+ model.translation.translate({
68
+ attemptNumber: activeAttempt,
69
+ targetLanguage: i18n.language
70
+ });
71
+ }
72
+ }, [showTranslation, activeAttempt, cachedTranslation, isTranslating, i18n.language, model]);
73
+
74
+ // Auto-open dropdown when a translation successfully completes
75
+ (0, _react.useEffect)(() => {
76
+ return model.translation.translate.doneData.watch(result => {
77
+ if (result) {
78
+ model.dropdown.setExpanded(true);
79
+ }
80
+ });
81
+ }, [model]);
82
+ const onPlayPress = (0, _react.useCallback)(() => {
83
+ if (activeAttempt) {
84
+ model.translation.setActive(false);
85
+ model.togglePlayPause(activeAttempt);
86
+ }
87
+ }, [model, activeAttempt]);
88
+ const onTranslationToggle = (0, _react.useCallback)(() => {
89
+ model.translation.toggle();
90
+ model.dropdown.setExpanded(true);
91
+ }, [model]);
92
+ return {
93
+ display: {
94
+ text: displayText,
95
+ isLoading: isActiveTranscriptLoading || isTranslationLoading
96
+ },
97
+ flags: {
98
+ playerState: playerState,
99
+ hasActiveAudio,
100
+ anyAttemptHasAudio,
101
+ canTranslate,
102
+ isTranslationActive
103
+ },
104
+ actions: {
105
+ onPlayPress,
106
+ onTranslationToggle
107
+ }
108
+ };
109
+ };
110
+ exports.useVoiceTranscriptionController = useVoiceTranscriptionController;
111
+ //# sourceMappingURL=useVoiceTranscriptionController.js.map