@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
@@ -0,0 +1,201 @@
1
+ "use strict";
2
+
3
+ import { Typography, ScrollableList, CaretDownIcon, COLORS, IS_WEB } from '@magmamath/react-native-ui';
4
+ import { useUnit } from 'effector-react';
5
+ import React, { useRef, useEffect, useState, useCallback } from 'react';
6
+ import { TouchableOpacity, View, StyleSheet } from 'react-native';
7
+ import Animated, { FadeIn, FadeOut } from 'react-native-reanimated';
8
+ import { useVoiceTranscriptionsDropdown } from "../hooks/useVoiceTranscriptionsDropdown.js";
9
+ import { PlayerState } from "../model/index.js";
10
+ import { VoiceTranscriptionsDropdownItem } from "./VoiceTranscriptionsDropdownItem.js";
11
+ import { DROPDOWN_MAX_CONTENT_HEIGHT, NO_AUDIO_BE_MESSAGE } from "../../constants.js";
12
+ import { useText } from "../../../../shared/translation/index.js";
13
+ import { PlayButton } from "../../../../shared/components/PlayButton.js";
14
+ import { getActiveAttempt, getAudioStatus } from "../../helpers.js";
15
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
+ const AnimatedTouchableOpacity = Animated.createAnimatedComponent(TouchableOpacity);
17
+ export const VoiceTranscriptionsDropdown = ({
18
+ style,
19
+ model,
20
+ answers,
21
+ attemptOffset,
22
+ onAttemptOffsetChange,
23
+ attemptsCount
24
+ }) => {
25
+ const scrollRef = useRef(null);
26
+ const t = useText();
27
+ const [currentAttempt, transcriptsLoaded, playerState] = useUnit([model.$currentAttempt, model.$transcriptsLoaded, model.$playerState]);
28
+ const [attempts, setAttempts] = useState([]);
29
+ const activeAttempt = getActiveAttempt(attemptOffset, attemptsCount);
30
+ const answersKey = answers.map(a => `${a._id}:${a.audioFileId ?? ''}`).join(',');
31
+ const answersRef = useRef(answers);
32
+ answersRef.current = answers;
33
+ const {
34
+ listAnimatedStyle,
35
+ iconAnimatedStyle,
36
+ onListLayout
37
+ } = useVoiceTranscriptionsDropdown(model.dropdown);
38
+ const hasActiveTranscript = activeAttempt !== null && answers?.[activeAttempt - 1]?.audioFileId !== undefined;
39
+ const playButtonState = {
40
+ isActive: playerState !== PlayerState.IDLE,
41
+ isLoading: playerState === PlayerState.LOADING,
42
+ status: getAudioStatus(playerState)
43
+ };
44
+ const scrollToAttempt = useCallback(attemptNumber => {
45
+ const index = attempts.findIndex(item => item.attemptNumber === attemptNumber);
46
+ if (index !== -1) {
47
+ scrollRef.current?.scrollToIndex({
48
+ index,
49
+ animated: true,
50
+ viewPosition: 0
51
+ });
52
+ }
53
+ }, [attempts]);
54
+ const handleItemToggle = useCallback(attempt => {
55
+ if (onAttemptOffsetChange && attemptsCount !== undefined) {
56
+ onAttemptOffsetChange(attemptsCount - attempt);
57
+ }
58
+ }, [onAttemptOffsetChange, attemptsCount]);
59
+ const handlePlayPress = useCallback(() => {
60
+ if (activeAttempt) {
61
+ model.togglePlayPause(activeAttempt);
62
+ }
63
+ }, [model, activeAttempt]);
64
+ const handleScrollToIndexFailed = useCallback(info => {
65
+ setTimeout(() => {
66
+ scrollRef.current?.scrollToIndex({
67
+ index: info.index,
68
+ animated: true,
69
+ viewPosition: 0
70
+ });
71
+ }, 100);
72
+ }, []);
73
+ useEffect(() => {
74
+ model.reinitializePlayer();
75
+ return () => model.cleanup();
76
+ }, [model]);
77
+ useEffect(() => {
78
+ if (answersRef.current.some(answer => answer.audioFileId)) {
79
+ model.initializeWithAudios(answersRef.current);
80
+ model.loadAllTranscripts();
81
+ }
82
+ }, [model, answersKey]);
83
+ useEffect(() => {
84
+ if (answers.length > 0 && !answers.find(answer => answer.drawing)) {
85
+ model.dropdown.setExpanded(true);
86
+ }
87
+ model.stopAudio();
88
+ }, [attemptOffset]);
89
+ useEffect(() => {
90
+ const allAttempts = model.getAllAttempts();
91
+ const validAttempts = allAttempts.filter(item => typeof item.attemptNumber === 'number' && !isNaN(item.attemptNumber));
92
+ setAttempts(validAttempts);
93
+ }, [answersKey, transcriptsLoaded, currentAttempt, model]);
94
+ useEffect(() => {
95
+ if (activeAttempt !== null) {
96
+ scrollToAttempt(activeAttempt);
97
+ }
98
+ }, [activeAttempt, hasActiveTranscript, scrollToAttempt, model]);
99
+ const renderItem = useCallback(({
100
+ item
101
+ }) => {
102
+ const isLoading = model.isTranscriptLoading(item.attemptNumber);
103
+ const transcript = model.getTranscript(item.attemptNumber);
104
+ const isActive = activeAttempt === item.attemptNumber;
105
+ return /*#__PURE__*/_jsx(VoiceTranscriptionsDropdownItem, {
106
+ isLoading: isActive && isLoading,
107
+ attempt: item.attemptNumber,
108
+ content: transcript && transcript !== NO_AUDIO_BE_MESSAGE ? transcript : t('voice.transcriptNotAvailable'),
109
+ isActive: isActive,
110
+ onToggle: handleItemToggle,
111
+ scrollToAttempt: scrollToAttempt
112
+ });
113
+ }, [model, activeAttempt, t, handleItemToggle, scrollToAttempt]);
114
+ return /*#__PURE__*/_jsxs(Animated.View, {
115
+ style: [styles.container, style],
116
+ children: [/*#__PURE__*/_jsxs(View, {
117
+ style: styles.header,
118
+ children: [/*#__PURE__*/_jsx(Typography, {
119
+ style: styles.title,
120
+ variant: "h7",
121
+ children: t('voice.transcriptions')
122
+ }), hasActiveTranscript && /*#__PURE__*/_jsx(Animated.View, {
123
+ entering: FadeIn.duration(120),
124
+ exiting: FadeOut.duration(120),
125
+ children: /*#__PURE__*/_jsx(PlayButton, {
126
+ state: playButtonState,
127
+ onPress: handlePlayPress,
128
+ activityIndicatorColor: COLORS.NEUTRAL_1
129
+ })
130
+ })]
131
+ }), /*#__PURE__*/_jsx(Animated.View, {
132
+ style: [listAnimatedStyle, {
133
+ overflow: 'hidden'
134
+ }],
135
+ children: /*#__PURE__*/_jsx(View, {
136
+ onLayout: onListLayout,
137
+ style: styles.listContainer,
138
+ children: /*#__PURE__*/_jsx(ScrollableList, {
139
+ bounces: false,
140
+ ref: scrollRef,
141
+ hideShadow: true,
142
+ data: attempts,
143
+ keyExtractor: item => item._id,
144
+ onScrollToIndexFailed: handleScrollToIndexFailed,
145
+ renderItem: renderItem,
146
+ style: IS_WEB && styles.list,
147
+ contentContainerStyle: styles.listContent
148
+ })
149
+ })
150
+ }), /*#__PURE__*/_jsx(AnimatedTouchableOpacity, {
151
+ style: [styles.expandButton, iconAnimatedStyle],
152
+ onPress: () => model.dropdown.toggleExpand(),
153
+ children: /*#__PURE__*/_jsx(CaretDownIcon, {
154
+ size: 22
155
+ })
156
+ })]
157
+ });
158
+ };
159
+ const styles = StyleSheet.create({
160
+ container: {
161
+ position: 'absolute',
162
+ top: 56,
163
+ left: 8,
164
+ width: 222,
165
+ maxHeight: 405,
166
+ minHeight: 51,
167
+ padding: 4,
168
+ boxShadow: '0px 1px 3px 0px rgba(51, 51, 51, 0.25)',
169
+ borderRadius: 12,
170
+ backgroundColor: COLORS.NEUTRAL_1,
171
+ overflow: 'hidden'
172
+ },
173
+ header: {
174
+ flexDirection: 'row',
175
+ justifyContent: 'space-between',
176
+ alignItems: 'center',
177
+ padding: 4,
178
+ marginBottom: 4,
179
+ height: 32
180
+ },
181
+ title: {
182
+ color: COLORS.NEUTRAL_9,
183
+ marginLeft: 4
184
+ },
185
+ list: {
186
+ flex: 1
187
+ },
188
+ expandButton: {
189
+ justifyContent: 'center',
190
+ alignItems: 'center'
191
+ },
192
+ listContainer: {
193
+ position: 'absolute',
194
+ maxHeight: DROPDOWN_MAX_CONTENT_HEIGHT,
195
+ width: '100%'
196
+ },
197
+ listContent: {
198
+ paddingHorizontal: 4
199
+ }
200
+ });
201
+ //# sourceMappingURL=VoiceTranscriptionsDropdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Typography","ScrollableList","CaretDownIcon","COLORS","IS_WEB","useUnit","React","useRef","useEffect","useState","useCallback","TouchableOpacity","View","StyleSheet","Animated","FadeIn","FadeOut","useVoiceTranscriptionsDropdown","PlayerState","VoiceTranscriptionsDropdownItem","DROPDOWN_MAX_CONTENT_HEIGHT","NO_AUDIO_BE_MESSAGE","useText","PlayButton","getActiveAttempt","getAudioStatus","jsx","_jsx","jsxs","_jsxs","AnimatedTouchableOpacity","createAnimatedComponent","VoiceTranscriptionsDropdown","style","model","answers","attemptOffset","onAttemptOffsetChange","attemptsCount","scrollRef","t","currentAttempt","transcriptsLoaded","playerState","$currentAttempt","$transcriptsLoaded","$playerState","attempts","setAttempts","activeAttempt","answersKey","map","a","_id","audioFileId","join","answersRef","current","listAnimatedStyle","iconAnimatedStyle","onListLayout","dropdown","hasActiveTranscript","undefined","playButtonState","isActive","IDLE","isLoading","LOADING","status","scrollToAttempt","attemptNumber","index","findIndex","item","scrollToIndex","animated","viewPosition","handleItemToggle","attempt","handlePlayPress","togglePlayPause","handleScrollToIndexFailed","info","setTimeout","reinitializePlayer","cleanup","some","answer","initializeWithAudios","loadAllTranscripts","length","find","drawing","setExpanded","stopAudio","allAttempts","getAllAttempts","validAttempts","filter","isNaN","renderItem","isTranscriptLoading","transcript","getTranscript","content","onToggle","styles","container","children","header","title","variant","entering","duration","exiting","state","onPress","activityIndicatorColor","NEUTRAL_1","overflow","onLayout","listContainer","bounces","ref","hideShadow","data","keyExtractor","onScrollToIndexFailed","list","contentContainerStyle","listContent","expandButton","toggleExpand","size","create","position","top","left","width","maxHeight","minHeight","padding","boxShadow","borderRadius","backgroundColor","flexDirection","justifyContent","alignItems","marginBottom","height","color","NEUTRAL_9","marginLeft","flex","paddingHorizontal"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/components/VoiceTranscriptionsDropdown.tsx"],"mappings":";;AAAA,SACEA,UAAU,EACVC,cAAc,EACdC,aAAa,EACbC,MAAM,EACNC,MAAM,QACD,4BAA4B;AACnC,SAASC,OAAO,QAAQ,gBAAgB;AACxC,OAAOC,KAAK,IAAIC,MAAM,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,WAAW,QAAQ,OAAO;AACvE,SAASC,gBAAgB,EAAkCC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AACjG,OAAOC,QAAQ,IAAIC,MAAM,EAAEC,OAAO,QAAQ,yBAAyB;AAEnE,SAASC,8BAA8B,QAAQ,4CAAyC;AACxF,SAA2BC,WAAW,QAAgC,mBAAU;AAChF,SAASC,+BAA+B,QAAQ,sCAAmC;AACnF,SAASC,2BAA2B,EAAEC,mBAAmB,QAAQ,oBAAiB;AAClF,SAASC,OAAO,QAAQ,yCAAgC;AACxD,SAASC,UAAU,QAAQ,6CAA0C;AACrE,SAASC,gBAAgB,EAAEC,cAAc,QAAQ,kBAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEhE,MAAMC,wBAAwB,GAAGhB,QAAQ,CAACiB,uBAAuB,CAACpB,gBAAgB,CAAC;AAWnF,OAAO,MAAMqB,2BAA2B,GAAGA,CAAC;EAC1CC,KAAK;EACLC,KAAK;EACLC,OAAO;EACPC,aAAa;EACbC,qBAAqB;EACrBC;AACgC,CAAC,KAAK;EACtC,MAAMC,SAAS,GAAGhC,MAAM,CAAkB,IAAI,CAAC;EAC/C,MAAMiC,CAAC,GAAGlB,OAAO,CAAC,CAAC;EAEnB,MAAM,CAACmB,cAAc,EAAEC,iBAA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AK;IACpBC,cAAc,EAAE,eAAe;IAC/BC,UAAU,EAAE,QAAQ;IACpBN,OAAO,EAAE,CAAC;IACVO,YAAY,EAAE,CAAC;IACfC,MAAM,EAAE;EACV,CAAC;EACDvC,KAAK,EAAE;IACLwC,KAAK,EAAEpJ,MAAM,CAACqJ,SAAS;IACvBC,UAAU,EAAE;EACd,CAAC;EACDxB,IAAI,EAAE;IAAEyB,IAAI,EAAE;EAAE,CAAC;EACjBtB,YAAY,EAAE;IACZe,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd,CAAC;EACD1B,aAAa,EAAE;IACbc,QAAQ,EAAE,UAAU;IACpBI,SAAS,EAAExH,2BAA2B;IACtCuH,KAAK,EAAE;EACT,CAAC;EACDR,WAAW,EAAE;IACXwB,iBAAiB,EAAE;EACrB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+
3
+ import { Pressable, StyleSheet, View } from 'react-native';
4
+ import React, { memo, useCallback } from 'react';
5
+ import { Button, ButtonSize, ButtonVariant, COLORS, Loader, LoaderColor, LoaderSize, Typography } from '@magmamath/react-native-ui';
6
+ import Animated, { runOnJS, useAnimatedReaction } from 'react-native-reanimated';
7
+ import { useVoiceTranscriptionsDropdownItemAnimation } from "../hooks/useVoiceTranscriptionsDropdownItemAnimation.js";
8
+ import { useText } from "../../../../shared/translation/index.js";
9
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
+ export const VoiceTranscriptionsDropdownItem = /*#__PURE__*/memo(({
11
+ attempt,
12
+ content,
13
+ isActive,
14
+ isLoading,
15
+ onToggle,
16
+ scrollToAttempt
17
+ }) => {
18
+ const t = useText();
19
+ const {
20
+ contentAnimatedStyle,
21
+ onLayout,
22
+ progress
23
+ } = useVoiceTranscriptionsDropdownItemAnimation(isActive);
24
+ const handleScrollToAttempt = useCallback(attemptNumber => {
25
+ setTimeout(() => {
26
+ scrollToAttempt(attemptNumber);
27
+ }, 300);
28
+ }, [scrollToAttempt]);
29
+ useAnimatedReaction(() => progress.value, progress => {
30
+ if (progress === 1 && isActive) {
31
+ runOnJS(handleScrollToAttempt)(attempt);
32
+ }
33
+ }, [progress, attempt, isActive]);
34
+ return /*#__PURE__*/_jsxs(View, {
35
+ style: styles.container,
36
+ children: [/*#__PURE__*/_jsx(Pressable, {
37
+ disabled: isActive,
38
+ style: styles.itemHeader,
39
+ onPress: () => onToggle(attempt),
40
+ children: /*#__PURE__*/_jsx(Button, {
41
+ onPress: () => !isActive && onToggle(attempt),
42
+ size: ButtonSize.SMALL,
43
+ variant: ButtonVariant.TERTIARY,
44
+ style: {
45
+ text: {
46
+ textTransform: 'uppercase',
47
+ color: isActive ? COLORS.NEUTRAL_9 : COLORS.NEUTRAL_7
48
+ }
49
+ },
50
+ children: t('voice.attempt', {
51
+ number: String(attempt)
52
+ })
53
+ })
54
+ }), isLoading ? /*#__PURE__*/_jsx(View, {
55
+ style: styles.loaderContainer,
56
+ children: /*#__PURE__*/_jsx(Loader, {
57
+ size: LoaderSize.SMALL,
58
+ color: LoaderColor.BLUE
59
+ })
60
+ }) : /*#__PURE__*/_jsx(Animated.View, {
61
+ style: contentAnimatedStyle,
62
+ children: /*#__PURE__*/_jsx(View, {
63
+ onLayout: onLayout,
64
+ style: styles.contentWrapper,
65
+ children: /*#__PURE__*/_jsx(Typography, {
66
+ variant: "h8",
67
+ style: [styles.itemContent, {
68
+ color: isActive ? COLORS.NEUTRAL_9 : COLORS.NEUTRAL_7
69
+ }],
70
+ children: content
71
+ })
72
+ })
73
+ })]
74
+ });
75
+ });
76
+ const styles = StyleSheet.create({
77
+ container: {
78
+ borderTopWidth: 1,
79
+ borderColor: COLORS.NEUTRAL_3
80
+ },
81
+ itemHeader: {
82
+ flexDirection: 'row',
83
+ justifyContent: 'space-between',
84
+ alignItems: 'center',
85
+ width: '100%',
86
+ paddingVertical: 8
87
+ },
88
+ itemContent: {
89
+ paddingHorizontal: 8
90
+ },
91
+ contentWrapper: {
92
+ width: '100%',
93
+ position: 'absolute'
94
+ },
95
+ loaderContainer: {
96
+ justifyContent: 'center',
97
+ alignItems: 'center',
98
+ paddingTop: 4,
99
+ paddingBottom: 8
100
+ }
101
+ });
102
+ //# sourceMappingURL=VoiceTranscriptionsDropdownItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Pressable","StyleSheet","View","React","memo","useCallback","Button","ButtonSize","ButtonVariant","COLORS","Loader","LoaderColor","LoaderSize","Typography","Animated","runOnJS","useAnimatedReaction","useVoiceTranscriptionsDropdownItemAnimation","useText","jsx","_jsx","jsxs","_jsxs","VoiceTranscriptionsDropdownItem","attempt","content","isActive","isLoading","onToggle","scrollToAttempt","t","contentAnimatedStyle","onLayout","progress","handleScrollToAttempt","attemptNumber","setTimeout","value","style","styles","container","children","disabled","itemHeader","onPress","size","SMALL","variant","TERTIARY","text","textTransform","color","NEUTRAL_9","NEUTRAL_7","number","String","loaderContainer","BLUE","contentWrapper","itemContent","create","borderTopWidth","borderColor","NEUTRAL_3","flexDirection","justifyContent","alignItems","width","paddingVertical","paddingHorizontal","position","paddingTop","paddingBottom"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/components/VoiceTranscriptionsDropdownItem.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC1D,OAAOC,KAAK,IAAIC,IAAI,EAAEC,WAAW,QAAQ,OAAO;AAChD,SACEC,MAAM,EACNC,UAAU,EACVC,aAAa,EACbC,MAAM,EACNC,MAAM,EACNC,WAAW,EACXC,UAAU,EACVC,UAAU,QACL,4BAA4B;AACnC,OAAOC,QAAQ,IAAIC,OAAO,EAAEC,mBAAmB,QAAQ,yBAAyB;AAChF,SAASC,2CAA2C,QAAQ,yDAAsD;AAClH,SAASC,OAAO,QAAQ,yCAAgC;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAWxD,OAAO,MAAMC,+BAA+B,gBA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U,iBAAiB,EAAE;EACrB,CAAC;EACDX,cAAc,EAAE;IACdS,KAAK,EAAE,MAAM;IACbG,QAAQ,EAAE;EACZ,CAAC;EACDd,eAAe,EAAE;IACfS,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBK,UAAU,EAAE,CAAC;IACbC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+
3
+ import { useEffect } from 'react';
4
+ import { useUnit } from 'effector-react';
5
+ import { useAnimatedStyle, useSharedValue, withTiming, interpolate } from 'react-native-reanimated';
6
+ import { DROPDOWN_MAX_CONTENT_HEIGHT } from "../../constants.js";
7
+ export const useVoiceTranscriptionsDropdown = model => {
8
+ const isExpanded = useUnit(model.$isExpanded);
9
+ const contentHeight = useSharedValue(0);
10
+ const animationProgress = useSharedValue(isExpanded ? 1 : 0);
11
+ const onListLayout = event => {
12
+ const measuredHeight = event.nativeEvent.layout.height;
13
+ if (measuredHeight > 0) {
14
+ contentHeight.value = measuredHeight;
15
+ }
16
+ };
17
+ const listAnimatedStyle = useAnimatedStyle(() => {
18
+ const height = interpolate(animationProgress.value, [0, 1], [0, contentHeight.value || DROPDOWN_MAX_CONTENT_HEIGHT]);
19
+ const opacity = interpolate(animationProgress.value, [0, 0.3, 1], [0, 0, 1]);
20
+ return {
21
+ height,
22
+ opacity
23
+ };
24
+ }, [animationProgress, contentHeight]);
25
+ const iconAnimatedStyle = useAnimatedStyle(() => {
26
+ const rotation = interpolate(animationProgress.value, [0, 1], [0, 180]);
27
+ return {
28
+ transform: [{
29
+ rotate: `${rotation}deg`
30
+ }]
31
+ };
32
+ }, [animationProgress]);
33
+ useEffect(() => {
34
+ animationProgress.value = withTiming(isExpanded ? 1 : 0, {
35
+ duration: 300
36
+ });
37
+ }, [isExpanded, animationProgress]);
38
+ return {
39
+ isExpanded,
40
+ listAnimatedStyle,
41
+ iconAnimatedStyle,
42
+ onListLayout
43
+ };
44
+ };
45
+ //# sourceMappingURL=useVoiceTranscriptionsDropdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useEffect","useUnit","useAnimatedStyle","useSharedValue","withTiming","interpolate","DROPDOWN_MAX_CONTENT_HEIGHT","useVoiceTranscriptionsDropdown","model","isExpanded","$isExpanded","contentHeight","animationProgress","onListLayout","event","measuredHeight","nativeEvent","layout","height","value","listAnimatedStyle","opacity","iconAnimatedStyle","rotation","transform","rotate","duration"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/hooks/useVoiceTranscriptionsDropdown.ts"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,OAAO,QAAQ,gBAAgB;AACxC,SAASC,gBAAgB,EAAEC,cAAc,EAAEC,UAAU,EAAEC,WAAW,QAAQ,yBAAyB;AAEnG,SAASC,2BAA2B,QAAQ,oBAAiB;AAG7D,OAAO,MAAMC,8BAA8B,GAAIC,KAAuC,IAAK;EACzF,MAAMC,UAAU,GAAGR,OAAO,CAACO,KAAK,CAACE,WAAW,CAAC;EAE7C,MAAMC,aAAa,GAAGR,cAAc,CAAC,CAAC,CAAC;EACvC,MAAMS,iBAAiB,GAAGT,cAAc,CAACM,UAAU,GAAG,CAAC,GAAG,CAAC,CAAC;EAE5D,MAAMI,YAAY,GAAIC,KAAwB,IAAK;IACjD,MAAMC,cAAc,GAAGD,KAAK,CAACE,WAAW,CAACC,MAAM,CAACC,MAAM;IACtD,IAAIH,cAAc,GAAG,CAAC,EAAE;MACtBJ,aAAa,CAACQ,KAAK,GAAGJ,cAAc;IACtC;EACF,CAAC;EAED,MAAMK,iBAAiB,GAAGlB,gBAAgB,CAAC,MAAM;IAC/C,MAAMgB,MAAM,GAAGb,WAAW,CACxBO,iBAAiB,CAACO,KAAK,EACvB,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,CAAC,CAAC,EAAER,aAAa,CAACQ,KAAK,IAAIb,2BAA2B,CACxD,CAAC;IAED,MAAMe,OAAO,GAAGhB,WAAW,CAACO,iBAAiB,CAACO,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAE5E,OAAO;MACLD,MAAM;MACNG;IACF,CAAC;EACH,CAAC,EAAE,CAACT,iBAAiB,EAAED,aAAa,CAAC,CAAC;EAEtC,MAAMW,iBAAiB,GAAGpB,gBAAgB,CAAC,MAAM;IAC/C,MAAMqB,QAAQ,GAAGlB,WAAW,CAACO,iBAAiB,CAACO,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAEvE,OAAO;MACLK,SAAS,EAAE,CAAC;QAAEC,MAAM,EAAE,GAAGF,QAAQ;MAAM,CAAC;IAC1C,CAAC;EACH,CAAC,EAAE,CAACX,iBAAiB,CAAC,CAAC;EAEvBZ,SAAS,CAAC,MAAM;IACdY,iBAAiB,CAACO,KAAK,GAAGf,UAAU,CAACK,UAAU,GAAG,CAAC,GAAG,CAAC,EAAE;MAAEiB,QAAQ,EAAE;IAAI,CAAC,CAAC;EAC7E,CAAC,EAAE,CAACjB,UAAU,EAAEG,iBAAiB,CAAC,CAAC;EAEnC,OAAO;IACLH,UAAU;IACVW,iBAAiB;IACjBE,iBAAiB;IACjBT;EACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ import { useEffect } from 'react';
4
+ import { useSharedValue, withTiming, useDerivedValue, useAnimatedStyle, interpolate } from 'react-native-reanimated';
5
+ export const useVoiceTranscriptionsDropdownItemAnimation = isExpanded => {
6
+ const height = useSharedValue(0);
7
+ const progress = useSharedValue(isExpanded ? 1 : 0);
8
+ useEffect(() => {
9
+ progress.value = withTiming(isExpanded ? 1 : 0);
10
+ }, [isExpanded, progress]);
11
+ const derivedHeight = useDerivedValue(() => height.value * progress.value, [height, progress]);
12
+ const contentAnimatedStyle = useAnimatedStyle(() => {
13
+ const opacity = interpolate(progress.value, [0, 0.3, 1], [0, 0, 1]);
14
+ return {
15
+ height: derivedHeight.value,
16
+ opacity,
17
+ overflow: 'hidden'
18
+ };
19
+ }, [progress, derivedHeight]);
20
+ const onLayout = event => {
21
+ height.value = event.nativeEvent.layout.height;
22
+ };
23
+ return {
24
+ contentAnimatedStyle,
25
+ onLayout,
26
+ progress
27
+ };
28
+ };
29
+ //# sourceMappingURL=useVoiceTranscriptionsDropdownItemAnimation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useEffect","useSharedValue","withTiming","useDerivedValue","useAnimatedStyle","interpolate","useVoiceTranscriptionsDropdownItemAnimation","isExpanded","height","progress","value","derivedHeight","contentAnimatedStyle","opacity","overflow","onLayout","event","nativeEvent","layout"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.ts"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,OAAO;AAEjC,SACEC,cAAc,EACdC,UAAU,EACVC,eAAe,EACfC,gBAAgB,EAChBC,WAAW,QACN,yBAAyB;AAEhC,OAAO,MAAMC,2CAA2C,GAAIC,UAAmB,IAAK;EAClF,MAAMC,MAAM,GAAGP,cAAc,CAAC,CAAC,CAAC;EAChC,MAAMQ,QAAQ,GAAGR,cAAc,CAACM,UAAU,GAAG,CAAC,GAAG,CAAC,CAAC;EAEnDP,SAAS,CAAC,MAAM;IACdS,QAAQ,CAACC,KAAK,GAAGR,UAAU,CAACK,UAAU,GAAG,CAAC,GAAG,CAAC,CAAC;EACjD,CAAC,EAAE,CAACA,UAAU,EAAEE,QAAQ,CAAC,CAAC;EAE1B,MAAME,aAAa,GAAGR,eAAe,CAAC,MAAMK,MAAM,CAACE,KAAK,GAAGD,QAAQ,CAACC,KAAK,EAAE,CAACF,MAAM,EAAEC,QAAQ,CAAC,CAAC;EAE9F,MAAMG,oBAAoB,GAAGR,gBAAgB,CAAC,MAAM;IAClD,MAAMS,OAAO,GAAGR,WAAW,CAACI,QAAQ,CAACC,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAEnE,OAAO;MACLF,MAAM,EAAEG,aAAa,CAACD,KAAK;MAC3BG,OAAO;MACPC,QAAQ,EAAE;IACZ,CAAC;EACH,CAAC,EAAE,CAACL,QAAQ,EAAEE,aAAa,CAAC,CAAC;EAE7B,MAAMI,QAAQ,GAAIC,KAAwB,IAAK;IAC7CR,MAAM,CAACE,KAAK,GAAGM,KAAK,CAACC,WAAW,CAACC,MAAM,CAACV,MAAM;EAChD,CAAC;EAED,OAAO;IACLI,oBAAoB;IACpBG,QAAQ;IACRN;EACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+
3
+ import { createEffect, createEvent, restore } from 'effector';
4
+ import { createAudioPlayer } from 'expo-audio';
5
+ export let PlayerState = /*#__PURE__*/function (PlayerState) {
6
+ PlayerState["PLAYING"] = "playing";
7
+ PlayerState["PAUSED"] = "paused";
8
+ PlayerState["LOADING"] = "loading";
9
+ PlayerState["IDLE"] = "idle";
10
+ return PlayerState;
11
+ }({});
12
+ export class PlayerModel {
13
+ player = createAudioPlayer();
14
+ reset = createEvent();
15
+ setPlayerState = createEvent();
16
+ playbackFinished = createEvent();
17
+ $playerState = restore(this.setPlayerState, PlayerState.IDLE).reset(this.reset);
18
+ pause = createEffect(() => {
19
+ if (this.player) {
20
+ this.player.pause();
21
+ this.setPlayerState(PlayerState.PAUSED);
22
+ } else {
23
+ console.warn('Cannot pause: audio player not initialized');
24
+ }
25
+ });
26
+ stop = createEffect(() => {
27
+ if (this.player) {
28
+ this.player.replace('');
29
+ this.setPlayerState(PlayerState.IDLE);
30
+ } else {
31
+ console.warn('Cannot stop: audio player not initialized');
32
+ }
33
+ });
34
+ resume = createEffect(() => {
35
+ if (this.player) {
36
+ this.player.play();
37
+ this.setPlayerState(PlayerState.PLAYING);
38
+ } else {
39
+ console.warn('Cannot resume: audio player not initialized');
40
+ }
41
+ });
42
+ play = createEffect(async uri => {
43
+ if (!this.player) {
44
+ console.warn('Audio player not initialized');
45
+ return;
46
+ }
47
+ this.player.replace(uri);
48
+ const waitForLoad = () => {
49
+ if (this.player && this.player.isLoaded) {
50
+ const unsubscribe = this.player.addListener('playbackStatusUpdate', status => {
51
+ if (status.didJustFinish) {
52
+ this.playbackFinished();
53
+ unsubscribe?.remove?.();
54
+ this.setPlayerState(PlayerState.IDLE);
55
+ }
56
+ });
57
+ this.player.play();
58
+ this.setPlayerState(PlayerState.PLAYING);
59
+ } else {
60
+ setTimeout(waitForLoad, 10);
61
+ }
62
+ };
63
+ waitForLoad();
64
+ });
65
+ reinitialize() {
66
+ if (!this.player) {
67
+ this.player = createAudioPlayer();
68
+ }
69
+ }
70
+ release() {
71
+ if (this.player) {
72
+ try {
73
+ this.stop();
74
+ this.player.remove();
75
+ } catch (error) {}
76
+ this.player.release();
77
+ this.player = null;
78
+ }
79
+ this.reset();
80
+ }
81
+ }
82
+ //# sourceMappingURL=Player.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createEffect","createEvent","restore","createAudioPlayer","PlayerState","PlayerModel","player","reset","setPlayerState","playbackFinished","$playerState","IDLE","pause","PAUSED","console","warn","stop","replace","resume","play","PLAYING","uri","waitForLoad","isLoaded","unsubscribe","addListener","status","didJustFinish","remove","setTimeout","reinitialize","release","error"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/Player.model.ts"],"mappings":";;AAAA,SAASA,YAAY,EAAEC,WAAW,EAAEC,OAAO,QAAQ,UAAU;AAC7D,SAAsBC,iBAAiB,QAAQ,YAAY;AAE3D,WAAYC,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAOvB,OAAO,MAAMC,WAAW,CAAC;E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