@magmamath/students-features 0.9.113 → 0.9.114-rc.1

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 (367) hide show
  1. package/dist/commonjs/features/chatbot/components/ChatInput/RequestHintButton.js.map +1 -1
  2. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageButtonsBlock.js.map +1 -1
  3. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.js +8 -48
  4. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.js.map +1 -1
  5. package/dist/commonjs/features/chatbot/constants.js +4 -4
  6. package/dist/commonjs/features/chatbot/constants.js.map +1 -1
  7. package/dist/commonjs/features/gifCelebrations/helpers.js +1 -0
  8. package/dist/commonjs/features/gifCelebrations/helpers.js.map +1 -1
  9. package/dist/commonjs/features/voice/constants.js +22 -0
  10. package/dist/commonjs/features/voice/constants.js.map +1 -0
  11. package/dist/commonjs/features/voice/helpers.js +211 -0
  12. package/dist/commonjs/features/voice/helpers.js.map +1 -0
  13. package/dist/commonjs/features/voice/index.js +138 -0
  14. package/dist/commonjs/features/voice/index.js.map +1 -0
  15. package/dist/commonjs/features/voice/model/index.js +68 -0
  16. package/dist/commonjs/features/voice/model/index.js.map +1 -0
  17. package/dist/commonjs/features/voice/playing/components/VoiceIcon.js +49 -0
  18. package/dist/commonjs/features/voice/playing/components/VoiceIcon.js.map +1 -0
  19. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.js +208 -0
  20. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.js.map +1 -0
  21. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js +108 -0
  22. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js.map +1 -0
  23. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js +50 -0
  24. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js.map +1 -0
  25. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js +34 -0
  26. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js.map +1 -0
  27. package/dist/commonjs/features/voice/playing/model/Player.model.js +87 -0
  28. package/dist/commonjs/features/voice/playing/model/Player.model.js.map +1 -0
  29. package/dist/commonjs/features/voice/playing/model/VoicePlayer.model.js +244 -0
  30. package/dist/commonjs/features/voice/playing/model/VoicePlayer.model.js.map +1 -0
  31. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.js +41 -0
  32. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.js.map +1 -0
  33. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsDownloader.model.js +39 -0
  34. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsDownloader.model.js.map +1 -0
  35. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js +15 -0
  36. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js.map +1 -0
  37. package/dist/commonjs/features/voice/playing/model/index.js +47 -0
  38. package/dist/commonjs/features/voice/playing/model/index.js.map +1 -0
  39. package/dist/commonjs/features/voice/recording/components/VoiceRecord.js +74 -0
  40. package/dist/commonjs/features/voice/recording/components/VoiceRecord.js.map +1 -0
  41. package/dist/commonjs/features/voice/recording/components/VoiceRecordButton.js +61 -0
  42. package/dist/commonjs/features/voice/recording/components/VoiceRecordButton.js.map +1 -0
  43. package/dist/commonjs/features/voice/recording/components/VoiceRecordDeleteButton.js +35 -0
  44. package/dist/commonjs/features/voice/recording/components/VoiceRecordDeleteButton.js.map +1 -0
  45. package/dist/commonjs/features/voice/recording/components/VoiceRecordDevider.js +27 -0
  46. package/dist/commonjs/features/voice/recording/components/VoiceRecordDevider.js.map +1 -0
  47. package/dist/commonjs/features/voice/recording/components/VoiceRecordTimer.js +50 -0
  48. package/dist/commonjs/features/voice/recording/components/VoiceRecordTimer.js.map +1 -0
  49. package/dist/commonjs/features/voice/recording/hooks/useVoiceRecorder.js +59 -0
  50. package/dist/commonjs/features/voice/recording/hooks/useVoiceRecorder.js.map +1 -0
  51. package/dist/commonjs/features/voice/recording/hooks/useVoiceRecorderAnimation.js +22 -0
  52. package/dist/commonjs/features/voice/recording/hooks/useVoiceRecorderAnimation.js.map +1 -0
  53. package/dist/commonjs/features/voice/recording/modal/ModalFooterButtons.js +53 -0
  54. package/dist/commonjs/features/voice/recording/modal/ModalFooterButtons.js.map +1 -0
  55. package/dist/commonjs/features/voice/recording/modal/VoiceRecordDeleteModal.js +78 -0
  56. package/dist/commonjs/features/voice/recording/modal/VoiceRecordDeleteModal.js.map +1 -0
  57. package/dist/commonjs/features/voice/recording/modal/VoiceRecordUndoModal.js +51 -0
  58. package/dist/commonjs/features/voice/recording/modal/VoiceRecordUndoModal.js.map +1 -0
  59. package/dist/commonjs/features/voice/recording/model/Recorder.model.js +54 -0
  60. package/dist/commonjs/features/voice/recording/model/Recorder.model.js.map +1 -0
  61. package/dist/commonjs/features/voice/recording/model/Uploader.model.js +44 -0
  62. package/dist/commonjs/features/voice/recording/model/Uploader.model.js.map +1 -0
  63. package/dist/commonjs/features/voice/recording/model/VoiceRecord.model.js +239 -0
  64. package/dist/commonjs/features/voice/recording/model/VoiceRecord.model.js.map +1 -0
  65. package/dist/commonjs/features/voice/recording/model/VoiceRecordCollection.js +30 -0
  66. package/dist/commonjs/features/voice/recording/model/VoiceRecordCollection.js.map +1 -0
  67. package/dist/commonjs/features/voice/recording/model/index.js +34 -0
  68. package/dist/commonjs/features/voice/recording/model/index.js.map +1 -0
  69. package/dist/commonjs/features/voice/types.js +6 -0
  70. package/dist/commonjs/features/voice/types.js.map +1 -0
  71. package/dist/commonjs/index.js +12 -0
  72. package/dist/commonjs/index.js.map +1 -1
  73. package/dist/commonjs/shared/components/PlayButton.js +70 -0
  74. package/dist/commonjs/shared/components/PlayButton.js.map +1 -0
  75. package/dist/commonjs/shared/translation/localization/ca.json +17 -0
  76. package/dist/commonjs/shared/translation/localization/de.json +17 -0
  77. package/dist/commonjs/shared/translation/localization/en.json +17 -0
  78. package/dist/commonjs/shared/translation/localization/gb.json +17 -0
  79. package/dist/commonjs/shared/translation/localization/sct.json +17 -0
  80. package/dist/commonjs/shared/translation/localization/sw.json +17 -0
  81. package/dist/module/features/chatbot/components/ChatInput/RequestHintButton.js.map +1 -1
  82. package/dist/module/features/chatbot/components/ChatMessage/MessageButtonsBlock.js.map +1 -1
  83. package/dist/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.js +9 -49
  84. package/dist/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.js.map +1 -1
  85. package/dist/module/features/chatbot/constants.js +5 -5
  86. package/dist/module/features/chatbot/constants.js.map +1 -1
  87. package/dist/module/features/gifCelebrations/helpers.js +1 -0
  88. package/dist/module/features/gifCelebrations/helpers.js.map +1 -1
  89. package/dist/module/features/voice/constants.js +18 -0
  90. package/dist/module/features/voice/constants.js.map +1 -0
  91. package/dist/module/features/voice/helpers.js +194 -0
  92. package/dist/module/features/voice/helpers.js.map +1 -0
  93. package/dist/module/features/voice/index.js +20 -0
  94. package/dist/module/features/voice/index.js.map +1 -0
  95. package/dist/module/features/voice/model/index.js +15 -0
  96. package/dist/module/features/voice/model/index.js.map +1 -0
  97. package/dist/module/features/voice/playing/components/VoiceIcon.js +41 -0
  98. package/dist/module/features/voice/playing/components/VoiceIcon.js.map +1 -0
  99. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdown.js +201 -0
  100. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdown.js.map +1 -0
  101. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js +102 -0
  102. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js.map +1 -0
  103. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js +45 -0
  104. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js.map +1 -0
  105. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js +29 -0
  106. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js.map +1 -0
  107. package/dist/module/features/voice/playing/model/Player.model.js +82 -0
  108. package/dist/module/features/voice/playing/model/Player.model.js.map +1 -0
  109. package/dist/module/features/voice/playing/model/VoicePlayer.model.js +234 -0
  110. package/dist/module/features/voice/playing/model/VoicePlayer.model.js.map +1 -0
  111. package/dist/module/features/voice/playing/model/VoiceTranscriptionsCollection.js +36 -0
  112. package/dist/module/features/voice/playing/model/VoiceTranscriptionsCollection.js.map +1 -0
  113. package/dist/module/features/voice/playing/model/VoiceTranscriptionsDownloader.model.js +34 -0
  114. package/dist/module/features/voice/playing/model/VoiceTranscriptionsDownloader.model.js.map +1 -0
  115. package/dist/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js +10 -0
  116. package/dist/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js.map +1 -0
  117. package/dist/module/features/voice/playing/model/index.js +8 -0
  118. package/dist/module/features/voice/playing/model/index.js.map +1 -0
  119. package/dist/module/features/voice/recording/components/VoiceRecord.js +67 -0
  120. package/dist/module/features/voice/recording/components/VoiceRecord.js.map +1 -0
  121. package/dist/module/features/voice/recording/components/VoiceRecordButton.js +55 -0
  122. package/dist/module/features/voice/recording/components/VoiceRecordButton.js.map +1 -0
  123. package/dist/module/features/voice/recording/components/VoiceRecordDeleteButton.js +29 -0
  124. package/dist/module/features/voice/recording/components/VoiceRecordDeleteButton.js.map +1 -0
  125. package/dist/module/features/voice/recording/components/VoiceRecordDevider.js +21 -0
  126. package/dist/module/features/voice/recording/components/VoiceRecordDevider.js.map +1 -0
  127. package/dist/module/features/voice/recording/components/VoiceRecordTimer.js +44 -0
  128. package/dist/module/features/voice/recording/components/VoiceRecordTimer.js.map +1 -0
  129. package/dist/module/features/voice/recording/hooks/useVoiceRecorder.js +54 -0
  130. package/dist/module/features/voice/recording/hooks/useVoiceRecorder.js.map +1 -0
  131. package/dist/module/features/voice/recording/hooks/useVoiceRecorderAnimation.js +17 -0
  132. package/dist/module/features/voice/recording/hooks/useVoiceRecorderAnimation.js.map +1 -0
  133. package/dist/module/features/voice/recording/modal/ModalFooterButtons.js +47 -0
  134. package/dist/module/features/voice/recording/modal/ModalFooterButtons.js.map +1 -0
  135. package/dist/module/features/voice/recording/modal/VoiceRecordDeleteModal.js +71 -0
  136. package/dist/module/features/voice/recording/modal/VoiceRecordDeleteModal.js.map +1 -0
  137. package/dist/module/features/voice/recording/modal/VoiceRecordUndoModal.js +45 -0
  138. package/dist/module/features/voice/recording/modal/VoiceRecordUndoModal.js.map +1 -0
  139. package/dist/module/features/voice/recording/model/Recorder.model.js +49 -0
  140. package/dist/module/features/voice/recording/model/Recorder.model.js.map +1 -0
  141. package/dist/module/features/voice/recording/model/Uploader.model.js +39 -0
  142. package/dist/module/features/voice/recording/model/Uploader.model.js.map +1 -0
  143. package/dist/module/features/voice/recording/model/VoiceRecord.model.js +234 -0
  144. package/dist/module/features/voice/recording/model/VoiceRecord.model.js.map +1 -0
  145. package/dist/module/features/voice/recording/model/VoiceRecordCollection.js +25 -0
  146. package/dist/module/features/voice/recording/model/VoiceRecordCollection.js.map +1 -0
  147. package/dist/module/features/voice/recording/model/index.js +7 -0
  148. package/dist/module/features/voice/recording/model/index.js.map +1 -0
  149. package/dist/module/features/voice/types.js +4 -0
  150. package/dist/module/features/voice/types.js.map +1 -0
  151. package/dist/module/index.js +1 -0
  152. package/dist/module/index.js.map +1 -1
  153. package/dist/module/shared/components/PlayButton.js +64 -0
  154. package/dist/module/shared/components/PlayButton.js.map +1 -0
  155. package/dist/module/shared/translation/localization/ca.json +17 -0
  156. package/dist/module/shared/translation/localization/de.json +17 -0
  157. package/dist/module/shared/translation/localization/en.json +17 -0
  158. package/dist/module/shared/translation/localization/gb.json +17 -0
  159. package/dist/module/shared/translation/localization/sct.json +17 -0
  160. package/dist/module/shared/translation/localization/sw.json +17 -0
  161. package/dist/typescript/commonjs/features/chatbot/components/ChatInput/RequestHintButton.d.ts.map +1 -1
  162. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageButtonsBlock.d.ts.map +1 -1
  163. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts +2 -2
  164. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts.map +1 -1
  165. package/dist/typescript/commonjs/features/chatbot/constants.d.ts +5 -5
  166. package/dist/typescript/commonjs/features/chatbot/constants.d.ts.map +1 -1
  167. package/dist/typescript/commonjs/features/gifCelebrations/helpers.d.ts.map +1 -1
  168. package/dist/typescript/commonjs/features/voice/constants.d.ts +15 -0
  169. package/dist/typescript/commonjs/features/voice/constants.d.ts.map +1 -0
  170. package/dist/typescript/commonjs/features/voice/helpers.d.ts +46 -0
  171. package/dist/typescript/commonjs/features/voice/helpers.d.ts.map +1 -0
  172. package/dist/typescript/commonjs/features/voice/index.d.ts +13 -0
  173. package/dist/typescript/commonjs/features/voice/index.d.ts.map +1 -0
  174. package/dist/typescript/commonjs/features/voice/model/index.d.ts +11 -0
  175. package/dist/typescript/commonjs/features/voice/model/index.d.ts.map +1 -0
  176. package/dist/typescript/commonjs/features/voice/playing/components/VoiceIcon.d.ts +8 -0
  177. package/dist/typescript/commonjs/features/voice/playing/components/VoiceIcon.d.ts.map +1 -0
  178. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts +15 -0
  179. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts.map +1 -0
  180. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts +12 -0
  181. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts.map +1 -0
  182. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts +16 -0
  183. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts.map +1 -0
  184. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts +11 -0
  185. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts.map +1 -0
  186. package/dist/typescript/commonjs/features/voice/playing/model/Player.model.d.ts +21 -0
  187. package/dist/typescript/commonjs/features/voice/playing/model/Player.model.d.ts.map +1 -0
  188. package/dist/typescript/commonjs/features/voice/playing/model/VoicePlayer.model.d.ts +41 -0
  189. package/dist/typescript/commonjs/features/voice/playing/model/VoicePlayer.model.d.ts.map +1 -0
  190. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts +26 -0
  191. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts.map +1 -0
  192. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsDownloader.model.d.ts +18 -0
  193. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsDownloader.model.d.ts.map +1 -0
  194. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts +7 -0
  195. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts.map +1 -0
  196. package/dist/typescript/commonjs/features/voice/playing/model/index.d.ts +7 -0
  197. package/dist/typescript/commonjs/features/voice/playing/model/index.d.ts.map +1 -0
  198. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecord.d.ts +10 -0
  199. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecord.d.ts.map +1 -0
  200. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordButton.d.ts +10 -0
  201. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordButton.d.ts.map +1 -0
  202. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordDeleteButton.d.ts +8 -0
  203. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordDeleteButton.d.ts.map +1 -0
  204. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordDevider.d.ts +3 -0
  205. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordDevider.d.ts.map +1 -0
  206. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordTimer.d.ts +11 -0
  207. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordTimer.d.ts.map +1 -0
  208. package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceRecorder.d.ts +5 -0
  209. package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceRecorder.d.ts.map +1 -0
  210. package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceRecorderAnimation.d.ts +6 -0
  211. package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceRecorderAnimation.d.ts.map +1 -0
  212. package/dist/typescript/commonjs/features/voice/recording/modal/ModalFooterButtons.d.ts +12 -0
  213. package/dist/typescript/commonjs/features/voice/recording/modal/ModalFooterButtons.d.ts.map +1 -0
  214. package/dist/typescript/commonjs/features/voice/recording/modal/VoiceRecordDeleteModal.d.ts +11 -0
  215. package/dist/typescript/commonjs/features/voice/recording/modal/VoiceRecordDeleteModal.d.ts.map +1 -0
  216. package/dist/typescript/commonjs/features/voice/recording/modal/VoiceRecordUndoModal.d.ts +11 -0
  217. package/dist/typescript/commonjs/features/voice/recording/modal/VoiceRecordUndoModal.d.ts.map +1 -0
  218. package/dist/typescript/commonjs/features/voice/recording/model/Recorder.model.d.ts +19 -0
  219. package/dist/typescript/commonjs/features/voice/recording/model/Recorder.model.d.ts.map +1 -0
  220. package/dist/typescript/commonjs/features/voice/recording/model/Uploader.model.d.ts +18 -0
  221. package/dist/typescript/commonjs/features/voice/recording/model/Uploader.model.d.ts.map +1 -0
  222. package/dist/typescript/commonjs/features/voice/recording/model/VoiceRecord.model.d.ts +50 -0
  223. package/dist/typescript/commonjs/features/voice/recording/model/VoiceRecord.model.d.ts.map +1 -0
  224. package/dist/typescript/commonjs/features/voice/recording/model/VoiceRecordCollection.d.ts +10 -0
  225. package/dist/typescript/commonjs/features/voice/recording/model/VoiceRecordCollection.d.ts.map +1 -0
  226. package/dist/typescript/commonjs/features/voice/recording/model/index.d.ts +5 -0
  227. package/dist/typescript/commonjs/features/voice/recording/model/index.d.ts.map +1 -0
  228. package/dist/typescript/commonjs/features/voice/types.d.ts +58 -0
  229. package/dist/typescript/commonjs/features/voice/types.d.ts.map +1 -0
  230. package/dist/typescript/commonjs/index.d.ts +1 -0
  231. package/dist/typescript/commonjs/index.d.ts.map +1 -1
  232. package/dist/typescript/commonjs/shared/components/PlayButton.d.ts +18 -0
  233. package/dist/typescript/commonjs/shared/components/PlayButton.d.ts.map +1 -0
  234. package/dist/typescript/commonjs/shared/translation/constants.d.ts +102 -0
  235. package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
  236. package/dist/typescript/commonjs/shared/translation/model.d.ts +34 -0
  237. package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
  238. package/dist/typescript/commonjs/types/common.types.d.ts +3 -0
  239. package/dist/typescript/commonjs/types/common.types.d.ts.map +1 -1
  240. package/dist/typescript/module/features/chatbot/components/ChatInput/RequestHintButton.d.ts.map +1 -1
  241. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageButtonsBlock.d.ts.map +1 -1
  242. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts +2 -2
  243. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts.map +1 -1
  244. package/dist/typescript/module/features/chatbot/constants.d.ts +5 -5
  245. package/dist/typescript/module/features/chatbot/constants.d.ts.map +1 -1
  246. package/dist/typescript/module/features/gifCelebrations/helpers.d.ts.map +1 -1
  247. package/dist/typescript/module/features/voice/constants.d.ts +15 -0
  248. package/dist/typescript/module/features/voice/constants.d.ts.map +1 -0
  249. package/dist/typescript/module/features/voice/helpers.d.ts +46 -0
  250. package/dist/typescript/module/features/voice/helpers.d.ts.map +1 -0
  251. package/dist/typescript/module/features/voice/index.d.ts +13 -0
  252. package/dist/typescript/module/features/voice/index.d.ts.map +1 -0
  253. package/dist/typescript/module/features/voice/model/index.d.ts +11 -0
  254. package/dist/typescript/module/features/voice/model/index.d.ts.map +1 -0
  255. package/dist/typescript/module/features/voice/playing/components/VoiceIcon.d.ts +8 -0
  256. package/dist/typescript/module/features/voice/playing/components/VoiceIcon.d.ts.map +1 -0
  257. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts +15 -0
  258. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts.map +1 -0
  259. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts +12 -0
  260. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts.map +1 -0
  261. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts +16 -0
  262. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts.map +1 -0
  263. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts +11 -0
  264. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts.map +1 -0
  265. package/dist/typescript/module/features/voice/playing/model/Player.model.d.ts +21 -0
  266. package/dist/typescript/module/features/voice/playing/model/Player.model.d.ts.map +1 -0
  267. package/dist/typescript/module/features/voice/playing/model/VoicePlayer.model.d.ts +41 -0
  268. package/dist/typescript/module/features/voice/playing/model/VoicePlayer.model.d.ts.map +1 -0
  269. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts +26 -0
  270. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts.map +1 -0
  271. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsDownloader.model.d.ts +18 -0
  272. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsDownloader.model.d.ts.map +1 -0
  273. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts +7 -0
  274. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts.map +1 -0
  275. package/dist/typescript/module/features/voice/playing/model/index.d.ts +7 -0
  276. package/dist/typescript/module/features/voice/playing/model/index.d.ts.map +1 -0
  277. package/dist/typescript/module/features/voice/recording/components/VoiceRecord.d.ts +10 -0
  278. package/dist/typescript/module/features/voice/recording/components/VoiceRecord.d.ts.map +1 -0
  279. package/dist/typescript/module/features/voice/recording/components/VoiceRecordButton.d.ts +10 -0
  280. package/dist/typescript/module/features/voice/recording/components/VoiceRecordButton.d.ts.map +1 -0
  281. package/dist/typescript/module/features/voice/recording/components/VoiceRecordDeleteButton.d.ts +8 -0
  282. package/dist/typescript/module/features/voice/recording/components/VoiceRecordDeleteButton.d.ts.map +1 -0
  283. package/dist/typescript/module/features/voice/recording/components/VoiceRecordDevider.d.ts +3 -0
  284. package/dist/typescript/module/features/voice/recording/components/VoiceRecordDevider.d.ts.map +1 -0
  285. package/dist/typescript/module/features/voice/recording/components/VoiceRecordTimer.d.ts +11 -0
  286. package/dist/typescript/module/features/voice/recording/components/VoiceRecordTimer.d.ts.map +1 -0
  287. package/dist/typescript/module/features/voice/recording/hooks/useVoiceRecorder.d.ts +5 -0
  288. package/dist/typescript/module/features/voice/recording/hooks/useVoiceRecorder.d.ts.map +1 -0
  289. package/dist/typescript/module/features/voice/recording/hooks/useVoiceRecorderAnimation.d.ts +6 -0
  290. package/dist/typescript/module/features/voice/recording/hooks/useVoiceRecorderAnimation.d.ts.map +1 -0
  291. package/dist/typescript/module/features/voice/recording/modal/ModalFooterButtons.d.ts +12 -0
  292. package/dist/typescript/module/features/voice/recording/modal/ModalFooterButtons.d.ts.map +1 -0
  293. package/dist/typescript/module/features/voice/recording/modal/VoiceRecordDeleteModal.d.ts +11 -0
  294. package/dist/typescript/module/features/voice/recording/modal/VoiceRecordDeleteModal.d.ts.map +1 -0
  295. package/dist/typescript/module/features/voice/recording/modal/VoiceRecordUndoModal.d.ts +11 -0
  296. package/dist/typescript/module/features/voice/recording/modal/VoiceRecordUndoModal.d.ts.map +1 -0
  297. package/dist/typescript/module/features/voice/recording/model/Recorder.model.d.ts +19 -0
  298. package/dist/typescript/module/features/voice/recording/model/Recorder.model.d.ts.map +1 -0
  299. package/dist/typescript/module/features/voice/recording/model/Uploader.model.d.ts +18 -0
  300. package/dist/typescript/module/features/voice/recording/model/Uploader.model.d.ts.map +1 -0
  301. package/dist/typescript/module/features/voice/recording/model/VoiceRecord.model.d.ts +50 -0
  302. package/dist/typescript/module/features/voice/recording/model/VoiceRecord.model.d.ts.map +1 -0
  303. package/dist/typescript/module/features/voice/recording/model/VoiceRecordCollection.d.ts +10 -0
  304. package/dist/typescript/module/features/voice/recording/model/VoiceRecordCollection.d.ts.map +1 -0
  305. package/dist/typescript/module/features/voice/recording/model/index.d.ts +5 -0
  306. package/dist/typescript/module/features/voice/recording/model/index.d.ts.map +1 -0
  307. package/dist/typescript/module/features/voice/types.d.ts +58 -0
  308. package/dist/typescript/module/features/voice/types.d.ts.map +1 -0
  309. package/dist/typescript/module/index.d.ts +1 -0
  310. package/dist/typescript/module/index.d.ts.map +1 -1
  311. package/dist/typescript/module/shared/components/PlayButton.d.ts +18 -0
  312. package/dist/typescript/module/shared/components/PlayButton.d.ts.map +1 -0
  313. package/dist/typescript/module/shared/translation/constants.d.ts +102 -0
  314. package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
  315. package/dist/typescript/module/shared/translation/model.d.ts +34 -0
  316. package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
  317. package/dist/typescript/module/types/common.types.d.ts +3 -0
  318. package/dist/typescript/module/types/common.types.d.ts.map +1 -1
  319. package/package.json +11 -4
  320. package/src/features/chatbot/components/ChatInput/RequestHintButton.tsx +0 -1
  321. package/src/features/chatbot/components/ChatMessage/MessageButtonsBlock.tsx +1 -1
  322. package/src/features/chatbot/components/ChatMessage/MessageTextToSpeech.tsx +9 -51
  323. package/src/features/chatbot/constants.ts +4 -4
  324. package/src/features/gifCelebrations/helpers.ts +1 -0
  325. package/src/features/voice/constants.ts +14 -0
  326. package/src/features/voice/helpers.ts +254 -0
  327. package/src/features/voice/index.ts +17 -0
  328. package/src/features/voice/model/index.ts +13 -0
  329. package/src/features/voice/playing/components/VoiceIcon.tsx +38 -0
  330. package/src/features/voice/playing/components/VoiceTranscriptionsDropdown.tsx +239 -0
  331. package/src/features/voice/playing/components/VoiceTranscriptionsDropdownItem.tsx +127 -0
  332. package/src/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.ts +54 -0
  333. package/src/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.ts +40 -0
  334. package/src/features/voice/playing/model/Player.model.ts +92 -0
  335. package/src/features/voice/playing/model/VoicePlayer.model.ts +282 -0
  336. package/src/features/voice/playing/model/VoiceTranscriptionsCollection.ts +53 -0
  337. package/src/features/voice/playing/model/VoiceTranscriptionsDownloader.model.ts +43 -0
  338. package/src/features/voice/playing/model/VoiceTranscriptionsDropdown.model.ts +12 -0
  339. package/src/features/voice/playing/model/index.ts +6 -0
  340. package/src/features/voice/recording/components/VoiceRecord.tsx +65 -0
  341. package/src/features/voice/recording/components/VoiceRecordButton.tsx +63 -0
  342. package/src/features/voice/recording/components/VoiceRecordDeleteButton.tsx +25 -0
  343. package/src/features/voice/recording/components/VoiceRecordDevider.tsx +17 -0
  344. package/src/features/voice/recording/components/VoiceRecordTimer.tsx +49 -0
  345. package/src/features/voice/recording/hooks/useVoiceRecorder.ts +62 -0
  346. package/src/features/voice/recording/hooks/useVoiceRecorderAnimation.ts +19 -0
  347. package/src/features/voice/recording/modal/ModalFooterButtons.tsx +54 -0
  348. package/src/features/voice/recording/modal/VoiceRecordDeleteModal.tsx +82 -0
  349. package/src/features/voice/recording/modal/VoiceRecordUndoModal.tsx +50 -0
  350. package/src/features/voice/recording/model/Recorder.model.ts +62 -0
  351. package/src/features/voice/recording/model/Uploader.model.ts +48 -0
  352. package/src/features/voice/recording/model/VoiceRecord.model.ts +278 -0
  353. package/src/features/voice/recording/model/VoiceRecordCollection.ts +26 -0
  354. package/src/features/voice/recording/model/index.ts +4 -0
  355. package/src/features/voice/types.ts +69 -0
  356. package/src/index.ts +1 -0
  357. package/src/shared/components/PlayButton.tsx +84 -0
  358. package/src/shared/translation/localization/ca.json +17 -0
  359. package/src/shared/translation/localization/de.json +17 -0
  360. package/src/shared/translation/localization/en.json +17 -0
  361. package/src/shared/translation/localization/gb.json +17 -0
  362. package/src/shared/translation/localization/sct.json +17 -0
  363. package/src/shared/translation/localization/sw.json +17 -0
  364. package/src/types/common.types.ts +1 -0
  365. package/dist/commonjs/features/chatbot/TTS_HIGHLIGHTING.md +0 -120
  366. package/dist/module/features/chatbot/TTS_HIGHLIGHTING.md +0 -120
  367. package/src/features/chatbot/TTS_HIGHLIGHTING.md +0 -120
@@ -1,42 +1,11 @@
1
1
  import React from 'react'
2
- import { ActivityIndicator } from 'react-native'
3
- import { Button, COLORS } from '@magmamath/react-native-ui'
4
-
5
- import { SpeakerIcon } from '../../../../shared/icons/SpeakerIcon'
6
- import { PlayIcon } from '../../../../shared/icons/PlayIcon'
7
- import { PauseIcon } from '../../../../shared/icons/PauseIcon'
8
- import { AudioStatus, T2SState } from '../../types/t2s.types'
9
2
  import { useChatModel } from '../../context/ChatBotModelContext'
3
+ import { PlayButton } from '../../../../shared/components/PlayButton'
4
+ import { T2SState } from '../../types/t2s.types'
10
5
  import { ConversationMessage } from '../../types/units.types'
11
- import { ColorScheme } from '../../types/style.types'
12
6
  import { MessageVariant } from '../../types/model.types'
13
- import { CONTROLS_COLORS_MAP, MESSAGE_COLORS_MAP } from '../../constants'
14
-
15
- type TextToSpeechIconProps = {
16
- status: AudioStatus
17
- isLoading: boolean
18
- isActive: boolean
19
- colorScheme?: ColorScheme
20
- }
21
-
22
- const TextToSpeechIcon = ({
23
- status,
24
- isActive,
25
- isLoading,
26
- colorScheme = ColorScheme.Blue,
27
- }: TextToSpeechIconProps) => {
28
- if (isLoading && isActive) {
29
- return <ActivityIndicator color={CONTROLS_COLORS_MAP[colorScheme].background} />
30
- }
31
-
32
- if (!isActive) {
33
- return <SpeakerIcon />
34
- }
35
-
36
- if (status === 'playing') return <PauseIcon color={COLORS.NEUTRAL_1} />
37
- if (status === 'paused') return <PlayIcon color={COLORS.NEUTRAL_1} />
38
- return <SpeakerIcon />
39
- }
7
+ import { ColorScheme } from '../../types/style.types'
8
+ import { MESSAGE_COLORS_MAP } from '../../constants'
40
9
 
41
10
  type MessageTextToSpeechProps = {
42
11
  state: T2SState
@@ -46,14 +15,14 @@ type MessageTextToSpeechProps = {
46
15
  }
47
16
 
48
17
  export const MessageTextToSpeech = ({
49
- state: { status, disabled, isActive, isLoading },
50
- message,
18
+ state,
51
19
  variant,
20
+ message,
52
21
  colorScheme = ColorScheme.Blue,
53
22
  }: MessageTextToSpeechProps) => {
54
23
  const model = useChatModel()
55
24
 
56
- function play() {
25
+ const play = () => {
57
26
  void model.t2s.play({
58
27
  isTranslated: model.translation.$isTranslated.getState(),
59
28
  message,
@@ -61,21 +30,10 @@ export const MessageTextToSpeech = ({
61
30
  }
62
31
 
63
32
  return (
64
- <Button
65
- disabled={disabled}
66
- isActive={isActive}
67
- variant={'secondary'}
33
+ <PlayButton
68
34
  colorScheme={MESSAGE_COLORS_MAP[colorScheme][variant].icon}
69
- size={'small'}
35
+ state={state}
70
36
  onPress={play}
71
- icon={
72
- <TextToSpeechIcon
73
- isActive={isActive}
74
- isLoading={isLoading}
75
- status={status}
76
- colorScheme={colorScheme}
77
- />
78
- }
79
37
  />
80
38
  )
81
39
  }
@@ -46,24 +46,24 @@ export const MESSAGE_COLORS_MAP = {
46
46
  [MessageVariant.RECEIVED]: {
47
47
  background: COLORS.NEUTRAL_3,
48
48
  border: COLORS.NEUTRAL_3,
49
- icon: ButtonColor.BLUE,
49
+ icon: ColorScheme.Blue,
50
50
  },
51
51
  [MessageVariant.SENT]: {
52
52
  background: COLORS.PRIMARY_BLUE,
53
53
  border: COLORS.PRIMARY_BLUE,
54
- icon: ButtonColor.BLUE,
54
+ icon: ColorScheme.Blue,
55
55
  },
56
56
  },
57
57
  [ColorScheme.Yellow]: {
58
58
  [MessageVariant.RECEIVED]: {
59
59
  background: COLORS.NEUTRAL_3,
60
60
  border: COLORS.NEUTRAL_3,
61
- icon: ButtonColor.YELLOW,
61
+ icon: ColorScheme.Yellow,
62
62
  },
63
63
  [MessageVariant.SENT]: {
64
64
  background: COLORS.PRIMARY_YELLOW,
65
65
  border: COLORS.PRIMARY_YELLOW,
66
- icon: ButtonColor.YELLOW,
66
+ icon: ColorScheme.Yellow,
67
67
  },
68
68
  },
69
69
  }
@@ -52,6 +52,7 @@ export const generateProblemsGifsTable = (
52
52
  const selectedGif = unshownGif || gifsInGroup[0]
53
53
 
54
54
  if (selectedGif) {
55
+ selectedGif.isShown = true
55
56
  result[problemNumber] = {
56
57
  url: selectedGif.url,
57
58
  group: groupKey,
@@ -0,0 +1,14 @@
1
+ export const VOICE_RECORDER_CONTAINER_SIZES = {
2
+ COLLAPSED: 61,
3
+ EXPANDED: 152,
4
+ }
5
+ export const VOICE_RECORDER_MAX_DURATION_MS = 60000 // 1 minute
6
+ export enum VoiceRecorderState {
7
+ IDLE,
8
+ RECORDING,
9
+ PAUSED,
10
+ }
11
+ export const DROPDOWN_MAX_CONTENT_HEIGHT = 330
12
+ export const TRANSCRIPT_RETRY_INTERVAL_MS = 4000
13
+ export const TRANSCRIPT_MAX_RETRIES = 15
14
+ export const NO_AUDIO_BE_MESSAGE = 'No audio'
@@ -0,0 +1,254 @@
1
+ import { IS_MOBILE, IS_WEB } from '@magmamath/react-native-ui'
2
+ import {
3
+ AudioPlayer,
4
+ AudioRecorder,
5
+ createAudioPlayer,
6
+ getRecordingPermissionsAsync,
7
+ requestRecordingPermissionsAsync,
8
+ } from 'expo-audio'
9
+ import * as FileSystem from 'expo-file-system'
10
+ import { VoicePlayerApi, VoiceRecorderApi } from './types'
11
+ import { VOICE_RECORDER_MAX_DURATION_MS } from './constants'
12
+ import { PlayerState } from './playing/model'
13
+ import { AudioStatus } from '../chatbot'
14
+ import { AxiosResponse } from 'axios'
15
+
16
+ export const formatDuration = (ms: number): string => {
17
+ const totalSeconds = Math.floor(ms / 1000)
18
+ const minutes = Math.floor(totalSeconds / 60)
19
+ const seconds = totalSeconds % 60
20
+ return `${minutes}:${seconds.toString().padStart(2, '0')}`
21
+ }
22
+
23
+ export const ensureRecordingPermissions = async () => {
24
+ const { status } = await getRecordingPermissionsAsync()
25
+ console.log('permission status: ', status)
26
+
27
+ if (status !== 'granted') {
28
+ const { granted } = await requestRecordingPermissionsAsync()
29
+ return granted
30
+ }
31
+
32
+ return true
33
+ }
34
+
35
+ const getAvailableInputsWeb = async () => {
36
+ if (!navigator.mediaDevices?.enumerateDevices) return []
37
+
38
+ const devices = await navigator.mediaDevices.enumerateDevices()
39
+ return devices.filter((d) => d.kind === 'audioinput')
40
+ }
41
+
42
+ export const getAvailableInputs = async (recorder: AudioRecorder) => {
43
+ if (IS_WEB) {
44
+ return await getAvailableInputsWeb()
45
+ }
46
+ if (IS_MOBILE) {
47
+ return await recorder.getAvailableInputs()
48
+ }
49
+ return []
50
+ }
51
+
52
+ export const addAudioInputsListenerWeb = (callback: (devices: MediaDeviceInfo[]) => void) => {
53
+ if (!IS_WEB || !navigator.mediaDevices?.addEventListener) {
54
+ return () => {}
55
+ }
56
+
57
+ const handleDeviceChange = async () => {
58
+ const devices = await getAvailableInputsWeb()
59
+ callback(devices)
60
+ }
61
+
62
+ handleDeviceChange()
63
+
64
+ navigator.mediaDevices.addEventListener('devicechange', handleDeviceChange)
65
+
66
+ return () => {
67
+ navigator.mediaDevices.removeEventListener('devicechange', handleDeviceChange)
68
+ }
69
+ }
70
+ /**
71
+ *
72
+ * @param fileUri
73
+ * @param externalPlayer - is optional expo-audio player, but should be provided
74
+ * because creating player is resource consuming operation
75
+ */
76
+ export const getAudioDurationMs = (
77
+ fileUri: string,
78
+ externalPlayer?: AudioPlayer,
79
+ ): Promise<number | undefined> => {
80
+ if (!fileUri) return Promise.resolve(undefined)
81
+
82
+ const player = externalPlayer ?? createAudioPlayer()
83
+ const isInternalPlayer = !externalPlayer
84
+
85
+ player.replace(fileUri)
86
+
87
+ return new Promise((resolve, reject) => {
88
+ const subscription = player.addListener('playbackStatusUpdate', () => {
89
+ if (player.duration !== undefined && player.duration > 0) {
90
+ subscription.remove()
91
+
92
+ // player.duration is in seconds (e.g., 1.234567)
93
+ const durationMs = Math.round(player.duration * 1000) // convert to milliseconds
94
+
95
+ if (isInternalPlayer) {
96
+ player.remove()
97
+ }
98
+
99
+ resolve(durationMs)
100
+ }
101
+ })
102
+
103
+ setTimeout(() => {
104
+ subscription.remove()
105
+
106
+ if (isInternalPlayer) {
107
+ player.remove()
108
+ }
109
+
110
+ reject(new Error('Timeout loading audio metadata'))
111
+ }, 3000)
112
+ })
113
+ }
114
+
115
+ type GenerateAudioFormDataParams = {
116
+ audioFileUri: string
117
+ durationMs?: number
118
+ fileName?: string
119
+ }
120
+
121
+ export const generateAudioFormData = async ({
122
+ audioFileUri,
123
+ durationMs,
124
+ fileName,
125
+ }: GenerateAudioFormDataParams): Promise<FormData> => {
126
+ //todo: add web or ios prefix to filename
127
+
128
+ const formData = new FormData()
129
+ const duration = Math.min(durationMs || 100, VOICE_RECORDER_MAX_DURATION_MS).toString()
130
+
131
+ if (IS_WEB) {
132
+ const response = await fetch(audioFileUri)
133
+ const blob = await response.blob()
134
+ const filename = fileName + blob.type.replace('audio/', '.')
135
+
136
+ formData.append('file', blob, filename)
137
+ formData.append('filename', filename)
138
+ formData.append('duration', duration)
139
+
140
+ return formData
141
+ }
142
+
143
+ const filename = fileName + '.m4a'
144
+ const file = {
145
+ uri: audioFileUri,
146
+ type: 'audio/m4a',
147
+ name: filename,
148
+ } as any
149
+
150
+ formData.append('file', file, filename)
151
+ formData.append('filename', filename)
152
+ formData.append('duration', duration)
153
+
154
+ return formData
155
+ }
156
+
157
+ export const uploadAudioFileRequestGenerator = (
158
+ audioFileFormData: FormData,
159
+ api: VoiceRecorderApi,
160
+ ) => {
161
+ const controller = new AbortController()
162
+
163
+ return {
164
+ uploadAudio: () =>
165
+ api.uploadAudioFile(
166
+ {
167
+ audioFileFormData,
168
+ },
169
+ //@ts-ignore
170
+ {
171
+ signal: controller.signal,
172
+ },
173
+ ),
174
+ controller,
175
+ }
176
+ }
177
+
178
+ const downloadAudioMobile = async (response: any, audioFileId: string) => {
179
+ const { config } = response
180
+ const url = config.url.startsWith('http')
181
+ ? config.url
182
+ : `${config.baseURL?.replace(/\/$/, '')}/${config.url.replace(/^\//, '')}`
183
+
184
+ const fileName = `audio-${audioFileId}.mp4`
185
+ const fileUri = `${FileSystem.cacheDirectory}${fileName}`
186
+ const authHeader = config.headers?.Authorization || config.headers?.authorization
187
+
188
+ const downloadResult = await FileSystem.downloadAsync(
189
+ url,
190
+ fileUri,
191
+ authHeader ? { headers: { Authorization: authHeader } } : undefined,
192
+ )
193
+
194
+ if (downloadResult.status !== 200) {
195
+ throw new Error(`Failed to download audio file. Status: ${downloadResult.status}`)
196
+ }
197
+
198
+ return {
199
+ uri: downloadResult.uri,
200
+ fileName,
201
+ fileType: 'audio/mp4',
202
+ }
203
+ }
204
+
205
+ const downloadAudioWeb = (response: AxiosResponse<Blob>, audioFileId: string) => {
206
+ const blob: Blob = response.data
207
+
208
+ if (!(blob instanceof Blob)) {
209
+ throw new Error('Unable to extract audio blob from response')
210
+ }
211
+
212
+ return {
213
+ uri: URL.createObjectURL(blob),
214
+ fileName: `audio-${audioFileId}.mp4`,
215
+ fileType: blob.type || 'audio/mp4',
216
+ }
217
+ }
218
+
219
+ export const downloadAudioFileRequestGenerator = (audioFileId: string, api: VoicePlayerApi) => {
220
+ const controller = new AbortController()
221
+
222
+ return {
223
+ downloadAudio: async () => {
224
+ const response = await api.downloadAudioFile(audioFileId, {
225
+ //@ts-ignore
226
+ signal: controller.signal,
227
+ })
228
+
229
+ return IS_WEB
230
+ ? downloadAudioWeb(response, audioFileId)
231
+ : downloadAudioMobile(response, audioFileId)
232
+ },
233
+ controller,
234
+ }
235
+ }
236
+
237
+ export const getActiveAttempt = (attemptOffset?: number, attemptsCount?: number): number | null => {
238
+ if (attemptOffset === undefined || attemptsCount === undefined) return null
239
+ return attemptsCount - attemptOffset
240
+ }
241
+
242
+ export const getAudioStatus = (state: PlayerState): AudioStatus | undefined => {
243
+ if (state === PlayerState.PLAYING) return AudioStatus.PLAYING
244
+ if (state === PlayerState.PAUSED) return AudioStatus.PAUSED
245
+ return undefined
246
+ }
247
+
248
+ export const is400Error = (error: unknown): boolean => {
249
+ if (error instanceof Error) {
250
+ const httpError = error as any
251
+ return httpError.status === 400 || httpError.response?.status === 400
252
+ }
253
+ return false
254
+ }
@@ -0,0 +1,17 @@
1
+ // Recording exports
2
+ export * from './recording/components/VoiceRecord'
3
+ export * from './recording/model/VoiceRecord.model'
4
+ export * from './recording/modal/VoiceRecordDeleteModal'
5
+ export * from './recording/modal/VoiceRecordUndoModal'
6
+
7
+ // Playing exports
8
+ export * from './playing/model/VoicePlayer.model'
9
+ export * from './playing/model/VoiceTranscriptionsCollection'
10
+ export * from './playing/model/VoiceTranscriptionsDownloader.model'
11
+ export * from './playing/model/VoiceTranscriptionsDropdown.model'
12
+ export * from './playing/components/VoiceTranscriptionsDropdown'
13
+
14
+ // Shared exports
15
+ export * from './playing/components/VoiceIcon'
16
+ export * from './constants'
17
+ export * from './types'
@@ -0,0 +1,13 @@
1
+ // Re-export recording models
2
+ export { VoiceRecordModel } from '../recording/model/VoiceRecord.model'
3
+ export { VoiceRecordsCollection } from '../recording/model/VoiceRecordCollection'
4
+ export { RecorderModel } from '../recording/model/Recorder.model'
5
+ export { UploaderModel } from '../recording/model/Uploader.model'
6
+
7
+ // Re-export playing models
8
+ export { VoicePlayerModel } from '../playing/model/VoicePlayer.model'
9
+ export { VoiceTranscriptionsCollection } from '../playing/model/VoiceTranscriptionsCollection'
10
+ export type { VoiceTranscriptionItem } from '../playing/model/VoiceTranscriptionsCollection'
11
+ export { VoiceTranscriptionsDownloaderModel } from '../playing/model/VoiceTranscriptionsDownloader.model'
12
+ export { VoicePlayerModel as VoiceTranscriptionsPlayerModel } from '../playing/model/VoicePlayer.model'
13
+ export { VoiceTranscriptionsDropdownModel } from '../playing/model/VoiceTranscriptionsDropdown.model'
@@ -0,0 +1,38 @@
1
+ import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native'
2
+ import React from 'react'
3
+ import { COLORS, MicrophoneIcon } from '@magmamath/react-native-ui'
4
+ import Animated, { FadeIn } from 'react-native-reanimated'
5
+
6
+ type VoiceIconProps = {
7
+ style?: StyleProp<ViewStyle>
8
+ }
9
+
10
+ export const VoiceIcon = ({ style }: VoiceIconProps) => {
11
+ return (
12
+ <Animated.View entering={FadeIn.duration(250)} style={[styles.container, style]}>
13
+ <View style={styles.iconContainer}>
14
+ <MicrophoneIcon color={COLORS.NEUTRAL_5} />
15
+ </View>
16
+ </Animated.View>
17
+ )
18
+ }
19
+
20
+ const styles = StyleSheet.create({
21
+ container: {
22
+ flex: 1,
23
+ justifyContent: 'center',
24
+ alignItems: 'center',
25
+ },
26
+ iconContainer: {
27
+ maxHeight: 124,
28
+ height: '80%',
29
+ aspectRatio: 1,
30
+ alignSelf: 'center',
31
+ padding: 24,
32
+ borderWidth: 4,
33
+ borderColor: COLORS.NEUTRAL_5,
34
+ borderRadius: 400,
35
+ justifyContent: 'center',
36
+ alignItems: 'center',
37
+ },
38
+ })