@magmamath/students-features 1.3.23-rc.8 → 1.3.23

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 (330) hide show
  1. package/dist/commonjs/features/pmProgress/components/chart/chart.helpers.js +1 -0
  2. package/dist/commonjs/features/pmProgress/components/chart/chart.helpers.js.map +1 -1
  3. package/dist/commonjs/features/pmProgress/components/header/StartButton.js +10 -1
  4. package/dist/commonjs/features/pmProgress/components/header/StartButton.js.map +1 -1
  5. package/dist/commonjs/features/pmProgress/components/list/{ListCard.js → DomainCard.js} +10 -22
  6. package/dist/commonjs/features/pmProgress/components/list/DomainCard.js.map +1 -0
  7. package/dist/commonjs/features/pmProgress/components/list/Fluency.js +3 -3
  8. package/dist/commonjs/features/pmProgress/components/list/Fluency.js.map +1 -1
  9. package/dist/commonjs/features/pmProgress/components/list/PmDomainList.js +3 -3
  10. package/dist/commonjs/features/pmProgress/components/list/PmDomainList.js.map +1 -1
  11. package/dist/commonjs/features/pmProgress/components/list/{ListItem.js → StandardItem.js} +5 -5
  12. package/dist/commonjs/features/pmProgress/components/list/StandardItem.js.map +1 -0
  13. package/dist/commonjs/features/pmProgress/components/recs/PmTeacherRecs.js +7 -4
  14. package/dist/commonjs/features/pmProgress/components/recs/PmTeacherRecs.js.map +1 -1
  15. package/dist/commonjs/features/pmProgress/components/standard/StandardTag.js +1 -8
  16. package/dist/commonjs/features/pmProgress/components/standard/StandardTag.js.map +1 -1
  17. package/dist/commonjs/features/pmProgress/shared/pmProgress.helpers.js +1 -1
  18. package/dist/commonjs/features/pmProgress/shared/pmProgress.helpers.js.map +1 -1
  19. package/dist/commonjs/features/voice/index.js +4 -4
  20. package/dist/commonjs/features/voice/index.js.map +1 -1
  21. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.js +245 -0
  22. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.js.map +1 -0
  23. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js +109 -0
  24. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js.map +1 -0
  25. package/dist/commonjs/features/voice/playing/hooks/{useVoiceTranscription.js → useVoiceTranscriptionsDropdown.js} +4 -4
  26. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js.map +1 -0
  27. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js +34 -0
  28. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js.map +1 -0
  29. package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.js +4 -15
  30. package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.js.map +1 -1
  31. package/dist/commonjs/features/voice/playing/model/VoicePlayer.model.js +2 -6
  32. package/dist/commonjs/features/voice/playing/model/VoicePlayer.model.js.map +1 -1
  33. package/dist/commonjs/features/voice/playing/model/{VoiceTranscription.model.js → VoiceTranscriptionsDropdown.model.js} +4 -4
  34. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js.map +1 -0
  35. package/dist/commonjs/features/voice/types.js +1 -6
  36. package/dist/commonjs/features/voice/types.js.map +1 -1
  37. package/dist/commonjs/index.js +0 -12
  38. package/dist/commonjs/index.js.map +1 -1
  39. package/dist/module/features/pmProgress/components/chart/chart.helpers.js +1 -0
  40. package/dist/module/features/pmProgress/components/chart/chart.helpers.js.map +1 -1
  41. package/dist/module/features/pmProgress/components/header/StartButton.js +10 -1
  42. package/dist/module/features/pmProgress/components/header/StartButton.js.map +1 -1
  43. package/dist/module/features/pmProgress/components/list/{ListCard.js → DomainCard.js} +8 -20
  44. package/dist/module/features/pmProgress/components/list/DomainCard.js.map +1 -0
  45. package/dist/module/features/pmProgress/components/list/Fluency.js +3 -3
  46. package/dist/module/features/pmProgress/components/list/Fluency.js.map +1 -1
  47. package/dist/module/features/pmProgress/components/list/PmDomainList.js +3 -3
  48. package/dist/module/features/pmProgress/components/list/PmDomainList.js.map +1 -1
  49. package/dist/module/features/pmProgress/components/list/{ListItem.js → StandardItem.js} +3 -3
  50. package/dist/module/features/pmProgress/components/list/StandardItem.js.map +1 -0
  51. package/dist/module/features/pmProgress/components/recs/PmTeacherRecs.js +7 -4
  52. package/dist/module/features/pmProgress/components/recs/PmTeacherRecs.js.map +1 -1
  53. package/dist/module/features/pmProgress/components/standard/StandardTag.js +2 -9
  54. package/dist/module/features/pmProgress/components/standard/StandardTag.js.map +1 -1
  55. package/dist/module/features/pmProgress/shared/pmProgress.helpers.js +1 -1
  56. package/dist/module/features/pmProgress/shared/pmProgress.helpers.js.map +1 -1
  57. package/dist/module/features/voice/index.js +1 -1
  58. package/dist/module/features/voice/index.js.map +1 -1
  59. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdown.js +238 -0
  60. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdown.js.map +1 -0
  61. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js +103 -0
  62. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js.map +1 -0
  63. package/dist/module/features/voice/playing/hooks/{useVoiceTranscription.js → useVoiceTranscriptionsDropdown.js} +2 -2
  64. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js.map +1 -0
  65. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js +29 -0
  66. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js.map +1 -0
  67. package/dist/module/features/voice/playing/model/TranscriptionsDownloaderModel.js +4 -15
  68. package/dist/module/features/voice/playing/model/TranscriptionsDownloaderModel.js.map +1 -1
  69. package/dist/module/features/voice/playing/model/VoicePlayer.model.js +2 -6
  70. package/dist/module/features/voice/playing/model/VoicePlayer.model.js.map +1 -1
  71. package/dist/module/features/voice/playing/model/{VoiceTranscription.model.js → VoiceTranscriptionsDropdown.model.js} +2 -2
  72. package/dist/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js.map +1 -0
  73. package/dist/module/features/voice/types.js +0 -5
  74. package/dist/module/features/voice/types.js.map +1 -1
  75. package/dist/module/index.js +0 -1
  76. package/dist/module/index.js.map +1 -1
  77. package/dist/typescript/commonjs/features/pmProgress/components/chart/chart.helpers.d.ts.map +1 -1
  78. package/dist/typescript/commonjs/features/pmProgress/components/header/StartButton.d.ts.map +1 -1
  79. package/dist/typescript/commonjs/features/pmProgress/components/list/{ListCard.d.ts → DomainCard.d.ts} +6 -6
  80. package/dist/typescript/commonjs/features/pmProgress/components/list/DomainCard.d.ts.map +1 -0
  81. package/dist/typescript/commonjs/features/pmProgress/components/list/StandardItem.d.ts +13 -0
  82. package/dist/typescript/commonjs/features/pmProgress/components/list/StandardItem.d.ts.map +1 -0
  83. package/dist/typescript/commonjs/features/pmProgress/components/recs/PmTeacherRecs.d.ts.map +1 -1
  84. package/dist/typescript/commonjs/features/pmProgress/shared/pmProgress.helpers.d.ts.map +1 -1
  85. package/dist/typescript/commonjs/features/voice/index.d.ts +1 -1
  86. package/dist/typescript/commonjs/features/voice/index.d.ts.map +1 -1
  87. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts +16 -0
  88. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts.map +1 -0
  89. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts +12 -0
  90. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts.map +1 -0
  91. package/dist/typescript/commonjs/features/voice/playing/hooks/{useVoiceTranscription.d.ts → useVoiceTranscriptionsDropdown.d.ts} +3 -3
  92. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts.map +1 -0
  93. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts +11 -0
  94. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts.map +1 -0
  95. package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts.map +1 -1
  96. package/dist/typescript/commonjs/features/voice/playing/model/VoicePlayer.model.d.ts +2 -4
  97. package/dist/typescript/commonjs/features/voice/playing/model/VoicePlayer.model.d.ts.map +1 -1
  98. package/dist/typescript/commonjs/features/voice/playing/model/{VoiceTranscription.model.d.ts → VoiceTranscriptionsDropdown.model.d.ts} +2 -2
  99. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts.map +1 -0
  100. package/dist/typescript/commonjs/features/voice/types.d.ts +1 -9
  101. package/dist/typescript/commonjs/features/voice/types.d.ts.map +1 -1
  102. package/dist/typescript/commonjs/index.d.ts +0 -1
  103. package/dist/typescript/commonjs/index.d.ts.map +1 -1
  104. package/dist/typescript/module/features/pmProgress/components/chart/chart.helpers.d.ts.map +1 -1
  105. package/dist/typescript/module/features/pmProgress/components/header/StartButton.d.ts.map +1 -1
  106. package/dist/typescript/module/features/pmProgress/components/list/{ListCard.d.ts → DomainCard.d.ts} +6 -6
  107. package/dist/typescript/module/features/pmProgress/components/list/DomainCard.d.ts.map +1 -0
  108. package/dist/typescript/module/features/pmProgress/components/list/StandardItem.d.ts +13 -0
  109. package/dist/typescript/module/features/pmProgress/components/list/StandardItem.d.ts.map +1 -0
  110. package/dist/typescript/module/features/pmProgress/components/recs/PmTeacherRecs.d.ts.map +1 -1
  111. package/dist/typescript/module/features/pmProgress/shared/pmProgress.helpers.d.ts.map +1 -1
  112. package/dist/typescript/module/features/voice/index.d.ts +1 -1
  113. package/dist/typescript/module/features/voice/index.d.ts.map +1 -1
  114. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts +16 -0
  115. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts.map +1 -0
  116. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts +12 -0
  117. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts.map +1 -0
  118. package/dist/typescript/module/features/voice/playing/hooks/{useVoiceTranscription.d.ts → useVoiceTranscriptionsDropdown.d.ts} +3 -3
  119. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts.map +1 -0
  120. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts +11 -0
  121. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts.map +1 -0
  122. package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts.map +1 -1
  123. package/dist/typescript/module/features/voice/playing/model/VoicePlayer.model.d.ts +2 -4
  124. package/dist/typescript/module/features/voice/playing/model/VoicePlayer.model.d.ts.map +1 -1
  125. package/dist/typescript/module/features/voice/playing/model/{VoiceTranscription.model.d.ts → VoiceTranscriptionsDropdown.model.d.ts} +2 -2
  126. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts.map +1 -0
  127. package/dist/typescript/module/features/voice/types.d.ts +1 -9
  128. package/dist/typescript/module/features/voice/types.d.ts.map +1 -1
  129. package/dist/typescript/module/index.d.ts +0 -1
  130. package/dist/typescript/module/index.d.ts.map +1 -1
  131. package/package.json +1 -1
  132. package/src/features/pmProgress/components/chart/chart.helpers.ts +1 -0
  133. package/src/features/pmProgress/components/header/StartButton.tsx +11 -1
  134. package/src/features/pmProgress/components/list/{ListCard.tsx → DomainCard.tsx} +12 -19
  135. package/src/features/pmProgress/components/list/Fluency.tsx +3 -3
  136. package/src/features/pmProgress/components/list/PmDomainList.tsx +3 -3
  137. package/src/features/pmProgress/components/list/{ListItem.tsx → StandardItem.tsx} +4 -4
  138. package/src/features/pmProgress/components/recs/PmTeacherRecs.tsx +8 -4
  139. package/src/features/pmProgress/components/standard/StandardTag.tsx +2 -6
  140. package/src/features/pmProgress/shared/pmProgress.helpers.ts +1 -2
  141. package/src/features/voice/index.ts +1 -1
  142. package/src/features/voice/playing/components/VoiceTranscriptionsDropdown.tsx +296 -0
  143. package/src/features/voice/playing/components/VoiceTranscriptionsDropdownItem.tsx +128 -0
  144. package/src/features/voice/playing/hooks/{useVoiceTranscription.ts → useVoiceTranscriptionsDropdown.ts} +2 -2
  145. package/src/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.ts +40 -0
  146. package/src/features/voice/playing/model/TranscriptionsDownloaderModel.ts +5 -8
  147. package/src/features/voice/playing/model/VoicePlayer.model.ts +2 -7
  148. package/src/features/voice/playing/model/{VoiceTranscription.model.ts → VoiceTranscriptionsDropdown.model.ts} +2 -2
  149. package/src/features/voice/types.ts +0 -15
  150. package/src/index.ts +0 -1
  151. package/dist/commonjs/features/pmProgress/components/list/ListCard.js.map +0 -1
  152. package/dist/commonjs/features/pmProgress/components/list/ListItem.js.map +0 -1
  153. package/dist/commonjs/features/translation/constants.js +0 -11
  154. package/dist/commonjs/features/translation/constants.js.map +0 -1
  155. package/dist/commonjs/features/translation/helpers.js +0 -60
  156. package/dist/commonjs/features/translation/helpers.js.map +0 -1
  157. package/dist/commonjs/features/translation/index.js +0 -105
  158. package/dist/commonjs/features/translation/index.js.map +0 -1
  159. package/dist/commonjs/features/translation/model/TranslationModel.js +0 -122
  160. package/dist/commonjs/features/translation/model/TranslationModel.js.map +0 -1
  161. package/dist/commonjs/features/translation/model/TranslationPreprocessor.js +0 -142
  162. package/dist/commonjs/features/translation/model/TranslationPreprocessor.js.map +0 -1
  163. package/dist/commonjs/features/translation/model/TranslationService.js +0 -112
  164. package/dist/commonjs/features/translation/model/TranslationService.js.map +0 -1
  165. package/dist/commonjs/features/translation/preserve/wordsToPreserve.js +0 -314
  166. package/dist/commonjs/features/translation/preserve/wordsToPreserve.js.map +0 -1
  167. package/dist/commonjs/features/translation/providers/google/GoogleTranslationProvider.js +0 -43
  168. package/dist/commonjs/features/translation/providers/google/GoogleTranslationProvider.js.map +0 -1
  169. package/dist/commonjs/features/translation/providers/google/supportedLanguages.js +0 -203
  170. package/dist/commonjs/features/translation/providers/google/supportedLanguages.js.map +0 -1
  171. package/dist/commonjs/features/translation/providers/google.types.js +0 -2
  172. package/dist/commonjs/features/translation/providers/google.types.js.map +0 -1
  173. package/dist/commonjs/features/translation/providers/translation.interface.js +0 -35
  174. package/dist/commonjs/features/translation/providers/translation.interface.js.map +0 -1
  175. package/dist/commonjs/features/translation/types.js +0 -2
  176. package/dist/commonjs/features/translation/types.js.map +0 -1
  177. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptContent.js +0 -44
  178. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptContent.js.map +0 -1
  179. package/dist/commonjs/features/voice/playing/components/VoiceTranscription.js +0 -131
  180. package/dist/commonjs/features/voice/playing/components/VoiceTranscription.js.map +0 -1
  181. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.js +0 -66
  182. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.js.map +0 -1
  183. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.js +0 -59
  184. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.js.map +0 -1
  185. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscription.js.map +0 -1
  186. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionEffects.js +0 -37
  187. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionEffects.js.map +0 -1
  188. package/dist/commonjs/features/voice/playing/model/VoiceTranscription.model.js.map +0 -1
  189. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionTranslation.model.js +0 -62
  190. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionTranslation.model.js.map +0 -1
  191. package/dist/module/features/pmProgress/components/list/ListCard.js.map +0 -1
  192. package/dist/module/features/pmProgress/components/list/ListItem.js.map +0 -1
  193. package/dist/module/features/translation/constants.js +0 -7
  194. package/dist/module/features/translation/constants.js.map +0 -1
  195. package/dist/module/features/translation/helpers.js +0 -53
  196. package/dist/module/features/translation/helpers.js.map +0 -1
  197. package/dist/module/features/translation/index.js +0 -12
  198. package/dist/module/features/translation/index.js.map +0 -1
  199. package/dist/module/features/translation/model/TranslationModel.js +0 -117
  200. package/dist/module/features/translation/model/TranslationModel.js.map +0 -1
  201. package/dist/module/features/translation/model/TranslationPreprocessor.js +0 -137
  202. package/dist/module/features/translation/model/TranslationPreprocessor.js.map +0 -1
  203. package/dist/module/features/translation/model/TranslationService.js +0 -107
  204. package/dist/module/features/translation/model/TranslationService.js.map +0 -1
  205. package/dist/module/features/translation/preserve/wordsToPreserve.js +0 -310
  206. package/dist/module/features/translation/preserve/wordsToPreserve.js.map +0 -1
  207. package/dist/module/features/translation/providers/google/GoogleTranslationProvider.js +0 -38
  208. package/dist/module/features/translation/providers/google/GoogleTranslationProvider.js.map +0 -1
  209. package/dist/module/features/translation/providers/google/supportedLanguages.js +0 -199
  210. package/dist/module/features/translation/providers/google/supportedLanguages.js.map +0 -1
  211. package/dist/module/features/translation/providers/google.types.js +0 -2
  212. package/dist/module/features/translation/providers/google.types.js.map +0 -1
  213. package/dist/module/features/translation/providers/translation.interface.js +0 -30
  214. package/dist/module/features/translation/providers/translation.interface.js.map +0 -1
  215. package/dist/module/features/translation/types.js +0 -2
  216. package/dist/module/features/translation/types.js.map +0 -1
  217. package/dist/module/features/voice/playing/components/VoiceTranscriptContent.js +0 -38
  218. package/dist/module/features/voice/playing/components/VoiceTranscriptContent.js.map +0 -1
  219. package/dist/module/features/voice/playing/components/VoiceTranscription.js +0 -123
  220. package/dist/module/features/voice/playing/components/VoiceTranscription.js.map +0 -1
  221. package/dist/module/features/voice/playing/components/VoiceTranscriptionCollapsible.js +0 -58
  222. package/dist/module/features/voice/playing/components/VoiceTranscriptionCollapsible.js.map +0 -1
  223. package/dist/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.js +0 -51
  224. package/dist/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.js.map +0 -1
  225. package/dist/module/features/voice/playing/hooks/useVoiceTranscription.js.map +0 -1
  226. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionEffects.js +0 -32
  227. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionEffects.js.map +0 -1
  228. package/dist/module/features/voice/playing/model/VoiceTranscription.model.js.map +0 -1
  229. package/dist/module/features/voice/playing/model/VoiceTranscriptionTranslation.model.js +0 -57
  230. package/dist/module/features/voice/playing/model/VoiceTranscriptionTranslation.model.js.map +0 -1
  231. package/dist/typescript/commonjs/features/pmProgress/components/list/ListCard.d.ts.map +0 -1
  232. package/dist/typescript/commonjs/features/pmProgress/components/list/ListItem.d.ts +0 -13
  233. package/dist/typescript/commonjs/features/pmProgress/components/list/ListItem.d.ts.map +0 -1
  234. package/dist/typescript/commonjs/features/translation/constants.d.ts +0 -5
  235. package/dist/typescript/commonjs/features/translation/constants.d.ts.map +0 -1
  236. package/dist/typescript/commonjs/features/translation/helpers.d.ts +0 -9
  237. package/dist/typescript/commonjs/features/translation/helpers.d.ts.map +0 -1
  238. package/dist/typescript/commonjs/features/translation/index.d.ts +0 -12
  239. package/dist/typescript/commonjs/features/translation/index.d.ts.map +0 -1
  240. package/dist/typescript/commonjs/features/translation/model/TranslationModel.d.ts +0 -33
  241. package/dist/typescript/commonjs/features/translation/model/TranslationModel.d.ts.map +0 -1
  242. package/dist/typescript/commonjs/features/translation/model/TranslationPreprocessor.d.ts +0 -34
  243. package/dist/typescript/commonjs/features/translation/model/TranslationPreprocessor.d.ts.map +0 -1
  244. package/dist/typescript/commonjs/features/translation/model/TranslationService.d.ts +0 -40
  245. package/dist/typescript/commonjs/features/translation/model/TranslationService.d.ts.map +0 -1
  246. package/dist/typescript/commonjs/features/translation/preserve/wordsToPreserve.d.ts +0 -3
  247. package/dist/typescript/commonjs/features/translation/preserve/wordsToPreserve.d.ts.map +0 -1
  248. package/dist/typescript/commonjs/features/translation/providers/google/GoogleTranslationProvider.d.ts +0 -16
  249. package/dist/typescript/commonjs/features/translation/providers/google/GoogleTranslationProvider.d.ts.map +0 -1
  250. package/dist/typescript/commonjs/features/translation/providers/google/supportedLanguages.d.ts +0 -197
  251. package/dist/typescript/commonjs/features/translation/providers/google/supportedLanguages.d.ts.map +0 -1
  252. package/dist/typescript/commonjs/features/translation/providers/google.types.d.ts +0 -15
  253. package/dist/typescript/commonjs/features/translation/providers/google.types.d.ts.map +0 -1
  254. package/dist/typescript/commonjs/features/translation/providers/translation.interface.d.ts +0 -23
  255. package/dist/typescript/commonjs/features/translation/providers/translation.interface.d.ts.map +0 -1
  256. package/dist/typescript/commonjs/features/translation/types.d.ts +0 -27
  257. package/dist/typescript/commonjs/features/translation/types.d.ts.map +0 -1
  258. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptContent.d.ts +0 -8
  259. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptContent.d.ts.map +0 -1
  260. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscription.d.ts +0 -16
  261. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscription.d.ts.map +0 -1
  262. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts +0 -10
  263. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts.map +0 -1
  264. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.d.ts +0 -12
  265. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.d.ts.map +0 -1
  266. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscription.d.ts.map +0 -1
  267. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionEffects.d.ts +0 -12
  268. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionEffects.d.ts.map +0 -1
  269. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscription.model.d.ts.map +0 -1
  270. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionTranslation.model.d.ts +0 -25
  271. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionTranslation.model.d.ts.map +0 -1
  272. package/dist/typescript/module/features/pmProgress/components/list/ListCard.d.ts.map +0 -1
  273. package/dist/typescript/module/features/pmProgress/components/list/ListItem.d.ts +0 -13
  274. package/dist/typescript/module/features/pmProgress/components/list/ListItem.d.ts.map +0 -1
  275. package/dist/typescript/module/features/translation/constants.d.ts +0 -5
  276. package/dist/typescript/module/features/translation/constants.d.ts.map +0 -1
  277. package/dist/typescript/module/features/translation/helpers.d.ts +0 -9
  278. package/dist/typescript/module/features/translation/helpers.d.ts.map +0 -1
  279. package/dist/typescript/module/features/translation/index.d.ts +0 -12
  280. package/dist/typescript/module/features/translation/index.d.ts.map +0 -1
  281. package/dist/typescript/module/features/translation/model/TranslationModel.d.ts +0 -33
  282. package/dist/typescript/module/features/translation/model/TranslationModel.d.ts.map +0 -1
  283. package/dist/typescript/module/features/translation/model/TranslationPreprocessor.d.ts +0 -34
  284. package/dist/typescript/module/features/translation/model/TranslationPreprocessor.d.ts.map +0 -1
  285. package/dist/typescript/module/features/translation/model/TranslationService.d.ts +0 -40
  286. package/dist/typescript/module/features/translation/model/TranslationService.d.ts.map +0 -1
  287. package/dist/typescript/module/features/translation/preserve/wordsToPreserve.d.ts +0 -3
  288. package/dist/typescript/module/features/translation/preserve/wordsToPreserve.d.ts.map +0 -1
  289. package/dist/typescript/module/features/translation/providers/google/GoogleTranslationProvider.d.ts +0 -16
  290. package/dist/typescript/module/features/translation/providers/google/GoogleTranslationProvider.d.ts.map +0 -1
  291. package/dist/typescript/module/features/translation/providers/google/supportedLanguages.d.ts +0 -197
  292. package/dist/typescript/module/features/translation/providers/google/supportedLanguages.d.ts.map +0 -1
  293. package/dist/typescript/module/features/translation/providers/google.types.d.ts +0 -15
  294. package/dist/typescript/module/features/translation/providers/google.types.d.ts.map +0 -1
  295. package/dist/typescript/module/features/translation/providers/translation.interface.d.ts +0 -23
  296. package/dist/typescript/module/features/translation/providers/translation.interface.d.ts.map +0 -1
  297. package/dist/typescript/module/features/translation/types.d.ts +0 -27
  298. package/dist/typescript/module/features/translation/types.d.ts.map +0 -1
  299. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptContent.d.ts +0 -8
  300. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptContent.d.ts.map +0 -1
  301. package/dist/typescript/module/features/voice/playing/components/VoiceTranscription.d.ts +0 -16
  302. package/dist/typescript/module/features/voice/playing/components/VoiceTranscription.d.ts.map +0 -1
  303. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts +0 -10
  304. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts.map +0 -1
  305. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.d.ts +0 -12
  306. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.d.ts.map +0 -1
  307. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscription.d.ts.map +0 -1
  308. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionEffects.d.ts +0 -12
  309. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionEffects.d.ts.map +0 -1
  310. package/dist/typescript/module/features/voice/playing/model/VoiceTranscription.model.d.ts.map +0 -1
  311. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionTranslation.model.d.ts +0 -25
  312. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionTranslation.model.d.ts.map +0 -1
  313. package/src/features/translation/constants.ts +0 -4
  314. package/src/features/translation/helpers.ts +0 -63
  315. package/src/features/translation/index.ts +0 -30
  316. package/src/features/translation/model/TranslationModel.ts +0 -174
  317. package/src/features/translation/model/TranslationPreprocessor.ts +0 -171
  318. package/src/features/translation/model/TranslationService.ts +0 -148
  319. package/src/features/translation/preserve/wordsToPreserve.ts +0 -87
  320. package/src/features/translation/providers/google/GoogleTranslationProvider.ts +0 -34
  321. package/src/features/translation/providers/google/supportedLanguages.ts +0 -196
  322. package/src/features/translation/providers/google.types.ts +0 -16
  323. package/src/features/translation/providers/translation.interface.ts +0 -49
  324. package/src/features/translation/types.ts +0 -30
  325. package/src/features/voice/playing/components/VoiceTranscriptContent.tsx +0 -37
  326. package/src/features/voice/playing/components/VoiceTranscription.tsx +0 -163
  327. package/src/features/voice/playing/components/VoiceTranscriptionCollapsible.tsx +0 -59
  328. package/src/features/voice/playing/components/VoiceTranscriptionHeaderActions.tsx +0 -62
  329. package/src/features/voice/playing/hooks/useVoiceTranscriptionEffects.ts +0 -44
  330. package/src/features/voice/playing/model/VoiceTranscriptionTranslation.model.ts +0 -75
@@ -1,196 +0,0 @@
1
- export const GoogleTranslateLanguage = {
2
- ABKHAZ: 'ab',
3
- ACEHNESE: 'ace',
4
- ACHOLI: 'ach',
5
- AFRIKAANS: 'af',
6
- ALBANIAN: 'sq',
7
- ALUR: 'alz',
8
- AMHARIC: 'am',
9
- ARABIC: 'ar',
10
- ARMENIAN: 'hy',
11
- ASSAMESE: 'as',
12
- AWADHI: 'awa',
13
- AYMARA: 'ay',
14
- AZERBAIJANI: 'az',
15
- BALINESE: 'ban',
16
- BAMBARA: 'bm',
17
- BASHKIR: 'ba',
18
- BASQUE: 'eu',
19
- BATAK_KARO: 'btx',
20
- BATAK_SIMALUNGUN: 'bts',
21
- BATAK_TOBA: 'bbc',
22
- BELARUSIAN: 'be',
23
- BEMBA: 'bem',
24
- BENGALI: 'bn',
25
- BETAWI: 'bew',
26
- BHOJPURI: 'bho',
27
- BIKOL: 'bik',
28
- BOSNIAN: 'bs',
29
- BRETON: 'br',
30
- BULGARIAN: 'bg',
31
- BURMESE: 'my',
32
- BURYAT: 'bua',
33
- CANTONESE: 'yue',
34
- CATALAN: 'ca',
35
- CEBUANO: 'ceb',
36
- CHICHEWA_NYANJA: 'ny',
37
- CHINESE_SIMPLIFIED: 'zh-CN',
38
- CHINESE_TRADITIONAL: 'zh-TW',
39
- CHUVASH: 'cv',
40
- CORSICAN: 'co',
41
- CRIMEAN_TATAR: 'crh',
42
- CROATIAN: 'hr',
43
- CZECH: 'cs',
44
- DANISH: 'da',
45
- DINKA: 'din',
46
- DIVEHI: 'dv',
47
- DOGRI: 'doi',
48
- DOMBE: 'dov',
49
- DUTCH: 'nl',
50
- DZONGKHA: 'dz',
51
- ENGLISH: 'en',
52
- ESPERANTO: 'eo',
53
- ESTONIAN: 'et',
54
- EWE: 'ee',
55
- FIJIAN: 'fj',
56
- FILIPINO_TAGALOG: 'fil',
57
- FINNISH: 'fi',
58
- FRENCH: 'fr',
59
- FRENCH_CANADA: 'fr-CA',
60
- FRENCH_FRANCE: 'fr-FR',
61
- FRISIAN: 'fy',
62
- FULFULDE: 'ff',
63
- GA: 'gaa',
64
- GALICIAN: 'gl',
65
- GANDA_LUGANDA: 'lg',
66
- GEORGIAN: 'ka',
67
- GERMAN: 'de',
68
- GREEK: 'el',
69
- GUARANI: 'gn',
70
- GUJARATI: 'gu',
71
- HAITIAN_CREOLE: 'ht',
72
- HAKHA_CHIN: 'cnh',
73
- HAUSA: 'ha',
74
- HAWAIIAN: 'haw',
75
- HEBREW: 'he',
76
- HILIGAYNON: 'hil',
77
- HINDI: 'hi',
78
- HMONG: 'hmn',
79
- HUNGARIAN: 'hu',
80
- HUNSRIK: 'hrx',
81
- ICELANDIC: 'is',
82
- IGBO: 'ig',
83
- ILOKO: 'ilo',
84
- INDONESIAN: 'id',
85
- IRISH: 'ga',
86
- ITALIAN: 'it',
87
- JAPANESE: 'ja',
88
- JAVANESE: 'jw',
89
- KANNADA: 'kn',
90
- KAPAMPANGAN: 'pam',
91
- KAZAKH: 'kk',
92
- KHMER: 'km',
93
- KIGA: 'cgg',
94
- KINYARWANDA: 'rw',
95
- KITUBA: 'ktu',
96
- KONKANI: 'gom',
97
- KOREAN: 'ko',
98
- KRIO: 'kri',
99
- KURMANJI: 'ku',
100
- KYRGYZ: 'ky',
101
- LAO: 'lo',
102
- LATGALIAN: 'ltg',
103
- LATIN: 'la',
104
- LATVIAN: 'lv',
105
- LIGURIAN: 'lij',
106
- LIMBURGAN: 'li',
107
- LINGALA: 'ln',
108
- LITHUANIAN: 'lt',
109
- LOMBARD: 'lmo',
110
- LUO: 'luo',
111
- LUXEMBOURGISH: 'lb',
112
- MACEDONIAN: 'mk',
113
- MAITHILI: 'mai',
114
- MAKASSAR: 'mak',
115
- MALAGASY: 'mg',
116
- MALAY: 'ms',
117
- MALAYALAM: 'ml',
118
- MALAY_JAWI: 'ms-Arab',
119
- MALTESE: 'mt',
120
- MAORI: 'mi',
121
- MARATHI: 'mr',
122
- MEADOW_MARI: 'chm',
123
- MEITEILON_MANIPURI: 'mni-Mtei',
124
- MINANG: 'min',
125
- MIZO: 'lus',
126
- MONGOLIAN: 'mn',
127
- NDEBELE_SOUTH: 'nr',
128
- NEPALBHASA_NEWARI: 'new',
129
- NEPALI: 'ne',
130
- NORTHERN_SOTHO: 'nso',
131
- NORWEGIAN: 'no',
132
- NUER: 'nus',
133
- OCCITAN: 'oc',
134
- ODIA: 'or',
135
- OROMO: 'om',
136
- PANGASINAN: 'pag',
137
- PAPIAMENTO: 'pap',
138
- PASHTO: 'ps',
139
- PERSIAN: 'fa',
140
- POLISH: 'pl',
141
- PORTUGUESE: 'pt',
142
- PORTUGUESE_BRAZIL: 'pt-BR',
143
- PORTUGUESE_PORTUGAL: 'pt-PT',
144
- PUNJABI: 'pa',
145
- PUNJABI_SHAHMUKHI: 'pa-Arab',
146
- QUECHUA: 'qu',
147
- ROMANI: 'rom',
148
- ROMANIAN: 'ro',
149
- RUNDI: 'rn',
150
- RUSSIAN: 'ru',
151
- SAMOAN: 'sm',
152
- SANGO: 'sg',
153
- SANSKRIT: 'sa',
154
- SCOTS_GAELIC: 'gd',
155
- SERBIAN: 'sr',
156
- SESOTHO: 'st',
157
- SEYCHELLOIS_CREOLE: 'crs',
158
- SHAN: 'shn',
159
- SHONA: 'sn',
160
- SICILIAN: 'scn',
161
- SILESIAN: 'szl',
162
- SINDHI: 'sd',
163
- SINHALA: 'si',
164
- SLOVAK: 'sk',
165
- SLOVENIAN: 'sl',
166
- SOMALI: 'so',
167
- SORANI: 'ckb',
168
- SPANISH: 'es',
169
- SUNDANESE: 'su',
170
- SWAHILI: 'sw',
171
- SWATI: 'ss',
172
- SWEDISH: 'sv',
173
- TAJIK: 'tg',
174
- TAMIL: 'ta',
175
- TATAR: 'tt',
176
- TELUGU: 'te',
177
- TETUM: 'tet',
178
- THAI: 'th',
179
- TIGRINYA: 'ti',
180
- TSONGA: 'ts',
181
- TSWANA: 'tn',
182
- TURKISH: 'tr',
183
- TURKMEN: 'tk',
184
- TWI_AKAN: 'ak',
185
- UKRAINIAN: 'uk',
186
- URDU: 'ur',
187
- UYGHUR: 'ug',
188
- UZBEK: 'uz',
189
- VIETNAMESE: 'vi',
190
- WELSH: 'cy',
191
- XHOSA: 'xh',
192
- YIDDISH: 'yi',
193
- YORUBA: 'yo',
194
- YUCATEC_MAYA: 'yua',
195
- ZULU: 'zu',
196
- }
@@ -1,16 +0,0 @@
1
- export type GoogleTranslateProps = {
2
- text: string[]
3
- targetLanguage: string
4
- sourceLanguage?: string
5
- }
6
-
7
- export type GoogleTranslation = {
8
- translatedText: string
9
- detectedSourceLanguage: string
10
- }
11
-
12
- export type GoogleTranslateResponse = {
13
- data: {
14
- translations: GoogleTranslation[]
15
- }
16
- }
@@ -1,49 +0,0 @@
1
- import { replaceMappedTokens } from '../helpers'
2
-
3
- export type LanguageGlossary = {
4
- [languageCode: string]: Record<string, string>
5
- }
6
-
7
- type TranslationProviderProps = {
8
- supportedLanguages: string[]
9
- glossaries?: LanguageGlossary
10
- }
11
-
12
- export abstract class TranslationProvider {
13
- protected readonly supportedLanguages: ReadonlySet<string>
14
- protected readonly glossaries: LanguageGlossary = {}
15
-
16
- protected constructor({ supportedLanguages, glossaries = {} }: TranslationProviderProps) {
17
- this.supportedLanguages = new Set(supportedLanguages)
18
- this.glossaries = glossaries
19
- }
20
-
21
- public abstract request(
22
- text: string,
23
- targetLanguage: string,
24
- sourceLanguage?: string,
25
- ): Promise<string>
26
- public abstract requestBatch(
27
- text: string[],
28
- targetLanguage: string,
29
- sourceLanguage?: string,
30
- ): Promise<string[]>
31
-
32
- public isTargetSupported(language: string) {
33
- return this.supportedLanguages.has(language)
34
- }
35
-
36
- public getSupportedLanguages() {
37
- return this.supportedLanguages.values()
38
- }
39
-
40
- /**
41
- * Replaces full standalone words in text using a custom glossary for the target language,
42
- * matching words like "Hello", or "Hej" regardless of case, but not when they appear inside other words.
43
- */
44
- public applyGlossary(text: string, targetLanguage: string): string {
45
- const glossary = this.glossaries[targetLanguage]
46
- if (!glossary) return text
47
- return replaceMappedTokens(text, glossary)
48
- }
49
- }
@@ -1,30 +0,0 @@
1
- export type TranslatableProblem = {
2
- description: string
3
- richDescription?: string
4
- answerVariants: string[]
5
- }
6
-
7
- export type TranslateAllFxParams<TProblem extends TranslatableProblem = TranslatableProblem> = {
8
- problem: TProblem | null
9
- translationLanguageCode?: string | null
10
- }
11
-
12
- export type TranslateFxParams = {
13
- cacheKey: string
14
- text: string
15
- }
16
-
17
- export type Replacement = {
18
- placeholder: string
19
- original: string
20
- leftPad?: boolean
21
- rightPad?: boolean
22
- }
23
-
24
- export type MaskSegmentParams = {
25
- text: string
26
- regex: RegExp
27
- placeholder: string
28
- replacements: Replacement[]
29
- shouldSkip?: (match: string) => boolean
30
- }
@@ -1,37 +0,0 @@
1
- import { COLORS, Loader, LoaderColor, LoaderSize, Typography } from '@magmamath/react-native-ui'
2
- import React from 'react'
3
- import { StyleSheet, View } from 'react-native'
4
-
5
- type VoiceTranscriptContentProps = {
6
- text: string
7
- isLoading: boolean
8
- }
9
-
10
- export const VoiceTranscriptContent = ({ text, isLoading }: VoiceTranscriptContentProps) => {
11
- if (isLoading) {
12
- return (
13
- <View style={styles.loaderContainer}>
14
- <Loader size={LoaderSize.SMALL} color={LoaderColor.BLUE} />
15
- </View>
16
- )
17
- }
18
-
19
- return (
20
- <Typography variant="h8" style={styles.text}>
21
- {text}
22
- </Typography>
23
- )
24
- }
25
-
26
- const styles = StyleSheet.create({
27
- text: {
28
- color: COLORS.NEUTRAL_7,
29
- paddingHorizontal: 8,
30
- paddingVertical: 8,
31
- },
32
- loaderContainer: {
33
- justifyContent: 'center',
34
- alignItems: 'center',
35
- paddingVertical: 8,
36
- },
37
- })
@@ -1,163 +0,0 @@
1
- import { Typography, COLORS } from '@magmamath/react-native-ui'
2
- import { useUnit } from 'effector-react'
3
- import React, { useCallback, useEffect, useMemo } from 'react'
4
- import { useTranslation } from 'react-i18next'
5
- import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native'
6
- import Animated from 'react-native-reanimated'
7
- import { NO_AUDIO_BE_MESSAGE } from '../../constants'
8
- import { getActiveAttempt } from '../../helpers'
9
- import { AnswerAudio, VoiceTranscriptionVariant } from '../../types'
10
- import { useText } from '../../../../i18n/i18n'
11
- import { useVoiceTranscriptionEffects } from '../hooks/useVoiceTranscriptionEffects'
12
- import { VoicePlayerModel } from '../model'
13
- import { VoiceTranscriptContent } from './VoiceTranscriptContent'
14
- import { VoiceTranscriptionCollapsible } from './VoiceTranscriptionCollapsible'
15
- import { VoiceTranscriptionHeaderActions } from './VoiceTranscriptionHeaderActions'
16
-
17
- type VoiceTranscriptionProps = {
18
- style?: StyleProp<ViewStyle>
19
- model: VoicePlayerModel
20
- answers: AnswerAudio[]
21
- attemptOffset: number
22
- attemptsCount: number
23
- problemId: string
24
- variant?: VoiceTranscriptionVariant
25
- }
26
-
27
- export const VoiceTranscription = ({
28
- style,
29
- model,
30
- answers,
31
- attemptOffset,
32
- attemptsCount,
33
- problemId,
34
- variant = VoiceTranscriptionVariant.SMALL,
35
- }: VoiceTranscriptionProps) => {
36
- const t = useText()
37
- const { i18n } = useTranslation()
38
-
39
- const [
40
- playerState,
41
- isLoadingTranscripts,
42
- isTranslationActive,
43
- translations,
44
- isTranslating,
45
- ] = useUnit([
46
- model.$playerState,
47
- model.loader.loadAllTranscripts.pending,
48
- model.translation.$isActive,
49
- model.translation.$translations,
50
- model.translation.translate.pending,
51
- ])
52
-
53
- const activeAttempt = getActiveAttempt(attemptOffset, attemptsCount)
54
- const isLargeVariant = variant === VoiceTranscriptionVariant.LARGE
55
-
56
- const answersKey = useMemo(
57
- () => answers.map((a) => `${a._id}:${a.audioFileId ?? ''}`).join(','),
58
- [answers],
59
- )
60
-
61
- useVoiceTranscriptionEffects({ model, answers, answersKey, problemId, activeAttempt })
62
-
63
- const hasActiveAudio =
64
- activeAttempt !== null && answers?.[activeAttempt - 1]?.audioFileId !== undefined
65
-
66
- const activeTranscript = activeAttempt !== null ? model.loader.getTranscript(activeAttempt) : null
67
- const hasTranscriptText = !!activeTranscript && activeTranscript !== NO_AUDIO_BE_MESSAGE
68
- const isActiveTranscriptLoading = isLoadingTranscripts && hasActiveAudio && !activeTranscript
69
-
70
- const cachedTranslation = activeAttempt !== null ? translations[activeAttempt] : undefined
71
- const showTranslation = isTranslationActive && hasTranscriptText
72
- const isTranslationLoading = showTranslation && !cachedTranslation && isTranslating
73
-
74
- const displayText = showTranslation
75
- ? cachedTranslation ?? activeTranscript!
76
- : hasTranscriptText
77
- ? activeTranscript!
78
- : t('voice.transcriptNotAvailable')
79
-
80
- useEffect(() => {
81
- if (showTranslation && activeAttempt !== null && !cachedTranslation && !isTranslating) {
82
- model.translation.translate({
83
- attemptNumber: activeAttempt,
84
- targetLanguage: i18n.language,
85
- })
86
- }
87
- }, [showTranslation, activeAttempt, cachedTranslation, isTranslating, i18n.language, model])
88
-
89
- const handlePlayPress = useCallback(() => {
90
- if (activeAttempt) {
91
- model.translation.setActive(false)
92
- model.togglePlayPause(activeAttempt)
93
- }
94
- }, [model, activeAttempt])
95
-
96
- const handleTranslationToggle = useCallback(() => {
97
- model.translation.toggle()
98
- }, [model])
99
-
100
- return (
101
- <Animated.View style={[styles.container, isLargeVariant && styles.largeContainer, style]}>
102
- <View style={styles.header}>
103
- <Typography style={styles.title} variant="h7">
104
- {t('voice.transcriptions')}
105
- </Typography>
106
- {hasActiveAudio && (
107
- <VoiceTranscriptionHeaderActions
108
- playerState={playerState}
109
- isTranslationActive={isTranslationActive}
110
- canTranslate={hasTranscriptText}
111
- onPlayPress={handlePlayPress}
112
- onTranslationPress={handleTranslationToggle}
113
- />
114
- )}
115
- </View>
116
-
117
- {isLargeVariant ? (
118
- <VoiceTranscriptContent
119
- text={displayText}
120
- isLoading={isActiveTranscriptLoading || isTranslationLoading}
121
- />
122
- ) : (
123
- <VoiceTranscriptionCollapsible
124
- text={displayText}
125
- isLoading={isActiveTranscriptLoading || isTranslationLoading}
126
- dropdown={model.dropdown}
127
- />
128
- )}
129
- </Animated.View>
130
- )
131
- }
132
-
133
- const styles = StyleSheet.create({
134
- container: {
135
- position: 'absolute',
136
- top: 56,
137
- left: 8,
138
- width: 222,
139
- maxHeight: 405,
140
- minHeight: 51,
141
- padding: 4,
142
- boxShadow: '0px 1px 3px 0px rgba(51, 51, 51, 0.25)',
143
- borderRadius: 12,
144
- backgroundColor: COLORS.NEUTRAL_1,
145
- overflow: 'hidden',
146
- },
147
- largeContainer: {
148
- width: '98%',
149
- height: '100%',
150
- },
151
- header: {
152
- flexDirection: 'row',
153
- justifyContent: 'space-between',
154
- alignItems: 'center',
155
- padding: 4,
156
- marginBottom: 4,
157
- height: 32,
158
- },
159
- title: {
160
- color: COLORS.NEUTRAL_9,
161
- marginLeft: 4,
162
- },
163
- })
@@ -1,59 +0,0 @@
1
- import { CaretDownIcon } from '@magmamath/react-native-ui'
2
- import React, { useCallback } from 'react'
3
- import { StyleSheet, TouchableOpacity, View } from 'react-native'
4
- import Animated from 'react-native-reanimated'
5
- import { useVoiceTranscriptionDropdown } from '../hooks/useVoiceTranscription'
6
- import { VoiceTranscriptionModel } from '../model/VoiceTranscription.model'
7
- import { VoiceTranscriptContent } from './VoiceTranscriptContent'
8
-
9
- const AnimatedTouchableOpacity = Animated.createAnimatedComponent(TouchableOpacity)
10
-
11
- type VoiceTranscriptionCollapsibleProps = {
12
- text: string
13
- isLoading: boolean
14
- dropdown: VoiceTranscriptionModel
15
- }
16
-
17
- export const VoiceTranscriptionCollapsible = ({
18
- text,
19
- isLoading,
20
- dropdown,
21
- }: VoiceTranscriptionCollapsibleProps) => {
22
- const { listAnimatedStyle, iconAnimatedStyle, onListLayout } =
23
- useVoiceTranscriptionDropdown(dropdown)
24
-
25
- const handleToggle = useCallback(() => {
26
- dropdown.toggleExpand()
27
- }, [dropdown])
28
-
29
- return (
30
- <>
31
- <Animated.View style={[listAnimatedStyle, styles.collapsibleContent]}>
32
- <View onLayout={onListLayout} style={styles.transcriptContainer}>
33
- <VoiceTranscriptContent text={text} isLoading={isLoading} />
34
- </View>
35
- </Animated.View>
36
- <AnimatedTouchableOpacity
37
- style={[styles.expandButton, iconAnimatedStyle]}
38
- onPress={handleToggle}
39
- >
40
- <CaretDownIcon size={22} />
41
- </AnimatedTouchableOpacity>
42
- </>
43
- )
44
- }
45
-
46
- const styles = StyleSheet.create({
47
- collapsibleContent: {
48
- overflow: 'hidden',
49
- },
50
- transcriptContainer: {
51
- position: 'absolute',
52
- width: '100%',
53
- paddingHorizontal: 4,
54
- },
55
- expandButton: {
56
- justifyContent: 'center',
57
- alignItems: 'center',
58
- },
59
- })
@@ -1,62 +0,0 @@
1
- import { Button, COLORS, GlobeIcon, SPACING } from '@magmamath/react-native-ui'
2
- import React from 'react'
3
- import { StyleSheet } from 'react-native'
4
- import Animated, { FadeIn, FadeOut } from 'react-native-reanimated'
5
- import { ColorScheme } from '../../../chatbot/types/style.types'
6
- import { PlayButton } from '../../../../shared/components/PlayButton'
7
- import { PlayerState } from '../model'
8
- import { getAudioStatus } from '../../helpers'
9
-
10
- type VoiceTranscriptionsHeaderActionsProps = {
11
- playerState: PlayerState
12
- isTranslationActive: boolean
13
- canTranslate: boolean
14
- onPlayPress: () => void
15
- onTranslationPress: () => void
16
- }
17
-
18
- export const VoiceTranscriptionHeaderActions = ({
19
- playerState,
20
- isTranslationActive,
21
- canTranslate,
22
- onPlayPress,
23
- onTranslationPress,
24
- }: VoiceTranscriptionsHeaderActionsProps) => {
25
- const playButtonState = {
26
- isActive: playerState !== PlayerState.IDLE,
27
- isLoading: playerState === PlayerState.LOADING,
28
- status: getAudioStatus(playerState),
29
- }
30
-
31
- return (
32
- <Animated.View
33
- entering={FadeIn.duration(120)}
34
- exiting={FadeOut.duration(120)}
35
- style={styles.container}
36
- >
37
- <PlayButton
38
- state={playButtonState}
39
- onPress={onPlayPress}
40
- activityIndicatorColor={COLORS.NEUTRAL_1}
41
- />
42
- {canTranslate && (
43
- <Button
44
- variant="secondary"
45
- size="small"
46
- colorScheme={ColorScheme.Blue}
47
- isActive={isTranslationActive}
48
- onPress={onTranslationPress}
49
- icon={<GlobeIcon color={isTranslationActive ? COLORS.NEUTRAL_1 : COLORS.NEUTRAL_9} />}
50
- />
51
- )}
52
- </Animated.View>
53
- )
54
- }
55
-
56
- const styles = StyleSheet.create({
57
- container: {
58
- flexDirection: 'row',
59
- alignItems: 'center',
60
- gap: SPACING[200],
61
- },
62
- })
@@ -1,44 +0,0 @@
1
- import { useEffect, useRef } from 'react'
2
- import { AnswerAudio } from '../../types'
3
- import { VoicePlayerModel } from '../model'
4
-
5
- type Params = {
6
- model: VoicePlayerModel
7
- answers: AnswerAudio[]
8
- answersKey: string
9
- problemId: string
10
- activeAttempt: number | null
11
- }
12
-
13
- export const useVoiceTranscriptionEffects = ({
14
- model,
15
- answers,
16
- answersKey,
17
- problemId,
18
- activeAttempt,
19
- }: Params) => {
20
- const answersRef = useRef(answers)
21
- answersRef.current = answers
22
-
23
- useEffect(() => {
24
- model.reinitializePlayer()
25
- return () => model.cleanup()
26
- }, [model])
27
-
28
- useEffect(() => {
29
- const lastAnswerHasNoDrawing = !answers[answers.length - 1]?.drawing
30
- model.dropdown.setExpanded(answers.length > 0 && lastAnswerHasNoDrawing)
31
- model.resetPlayer()
32
- }, [problemId])
33
-
34
- useEffect(() => {
35
- if (answersRef.current.some((answer) => answer.audioFileId)) {
36
- model.initializeWithAudios(answersRef.current)
37
- model.loader.loadAllTranscripts()
38
- }
39
- }, [model, answersKey])
40
-
41
- useEffect(() => {
42
- model.stopAudio()
43
- }, [activeAttempt])
44
- }