@magmamath/students-features 0.11.0-rc.8 → 1.0.0

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 (500) hide show
  1. package/dist/commonjs/features/chatbot/components/Chat/Chat.js +49 -139
  2. package/dist/commonjs/features/chatbot/components/Chat/Chat.js.map +1 -1
  3. package/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js +58 -43
  4. package/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js.map +1 -1
  5. package/dist/commonjs/features/chatbot/components/ChatInput/ChatInput.js +1 -3
  6. package/dist/commonjs/features/chatbot/components/ChatInput/ChatInput.js.map +1 -1
  7. package/dist/commonjs/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js +2 -2
  8. package/dist/commonjs/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js.map +1 -1
  9. package/dist/commonjs/features/chatbot/components/ChatInput/FreeText/SendMessageButton.js +1 -1
  10. package/dist/commonjs/features/chatbot/components/ChatInput/RequestHintButton.js.map +1 -1
  11. package/dist/commonjs/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -1
  12. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageButtonsBlock.js.map +1 -1
  13. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageLoader.js +36 -11
  14. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -1
  15. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.js +8 -48
  16. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.js.map +1 -1
  17. package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js +20 -14
  18. package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -1
  19. package/dist/commonjs/features/chatbot/components/ChatMessage/SentMessage.js +1 -1
  20. package/dist/commonjs/features/chatbot/components/Chatbot.js +12 -22
  21. package/dist/commonjs/features/chatbot/components/Chatbot.js.map +1 -1
  22. package/dist/commonjs/features/chatbot/constants.js +4 -4
  23. package/dist/commonjs/features/chatbot/constants.js.map +1 -1
  24. package/dist/commonjs/features/chatbot/helpers.js +1 -8
  25. package/dist/commonjs/features/chatbot/helpers.js.map +1 -1
  26. package/dist/commonjs/features/chatbot/index.js.map +1 -1
  27. package/dist/commonjs/features/chatbot/model/ChatBotModel.js +10 -46
  28. package/dist/commonjs/features/chatbot/model/ChatBotModel.js.map +1 -1
  29. package/dist/commonjs/features/chatbot/model/ChatbotApi.js +1 -1
  30. package/dist/commonjs/features/chatbot/model/ChatbotApi.js.map +1 -1
  31. package/dist/commonjs/features/chatbot/model/ChatsCacheModel.js +0 -9
  32. package/dist/commonjs/features/chatbot/model/ChatsCacheModel.js.map +1 -1
  33. package/dist/commonjs/features/chatbot/types/model.types.js.map +1 -1
  34. package/dist/commonjs/features/gifCelebrations/helpers.js +1 -0
  35. package/dist/commonjs/features/gifCelebrations/helpers.js.map +1 -1
  36. package/dist/commonjs/features/voice/constants.js +23 -0
  37. package/dist/commonjs/features/voice/constants.js.map +1 -0
  38. package/dist/commonjs/features/voice/helpers.js +208 -0
  39. package/dist/commonjs/features/voice/helpers.js.map +1 -0
  40. package/dist/commonjs/features/voice/index.js +105 -0
  41. package/dist/commonjs/features/voice/index.js.map +1 -0
  42. package/dist/commonjs/features/voice/playing/components/VoiceIcon.js +49 -0
  43. package/dist/commonjs/features/voice/playing/components/VoiceIcon.js.map +1 -0
  44. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.js +215 -0
  45. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.js.map +1 -0
  46. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js +108 -0
  47. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js.map +1 -0
  48. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js +50 -0
  49. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js.map +1 -0
  50. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js +34 -0
  51. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js.map +1 -0
  52. package/dist/commonjs/features/voice/playing/model/Player.model.js +98 -0
  53. package/dist/commonjs/features/voice/playing/model/Player.model.js.map +1 -0
  54. package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.js +66 -0
  55. package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.js.map +1 -0
  56. package/dist/commonjs/features/voice/playing/model/VoiceFileDownloader.model.js +39 -0
  57. package/dist/commonjs/features/voice/playing/model/VoiceFileDownloader.model.js.map +1 -0
  58. package/dist/commonjs/features/voice/playing/model/VoicePlayer.model.js +223 -0
  59. package/dist/commonjs/features/voice/playing/model/VoicePlayer.model.js.map +1 -0
  60. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.js +41 -0
  61. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.js.map +1 -0
  62. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js +15 -0
  63. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js.map +1 -0
  64. package/dist/commonjs/features/voice/playing/model/index.js +20 -0
  65. package/dist/commonjs/features/voice/playing/model/index.js.map +1 -0
  66. package/dist/commonjs/features/voice/recording/components/VoiceRecord.js +74 -0
  67. package/dist/commonjs/features/voice/recording/components/VoiceRecord.js.map +1 -0
  68. package/dist/commonjs/features/voice/recording/components/VoiceRecordButton.js +63 -0
  69. package/dist/commonjs/features/voice/recording/components/VoiceRecordButton.js.map +1 -0
  70. package/dist/commonjs/features/voice/recording/components/VoiceRecordDeleteButton.js +35 -0
  71. package/dist/commonjs/features/voice/recording/components/VoiceRecordDeleteButton.js.map +1 -0
  72. package/dist/commonjs/features/voice/recording/components/VoiceRecordDivider.js +27 -0
  73. package/dist/commonjs/features/voice/recording/components/VoiceRecordDivider.js.map +1 -0
  74. package/dist/commonjs/features/voice/recording/components/VoiceRecordTimer.js +50 -0
  75. package/dist/commonjs/features/voice/recording/components/VoiceRecordTimer.js.map +1 -0
  76. package/dist/commonjs/features/voice/recording/hooks/useVoiceRecorder.js +59 -0
  77. package/dist/commonjs/features/voice/recording/hooks/useVoiceRecorder.js.map +1 -0
  78. package/dist/commonjs/features/voice/recording/hooks/useVoiceRecorderAnimation.js +22 -0
  79. package/dist/commonjs/features/voice/recording/hooks/useVoiceRecorderAnimation.js.map +1 -0
  80. package/dist/commonjs/features/voice/recording/modal/ModalFooterButtons.js +53 -0
  81. package/dist/commonjs/features/voice/recording/modal/ModalFooterButtons.js.map +1 -0
  82. package/dist/commonjs/features/voice/recording/modal/VoiceRecordDeleteModal.js +78 -0
  83. package/dist/commonjs/features/voice/recording/modal/VoiceRecordDeleteModal.js.map +1 -0
  84. package/dist/commonjs/features/voice/recording/modal/VoiceRecordUndoModal.js +51 -0
  85. package/dist/commonjs/features/voice/recording/modal/VoiceRecordUndoModal.js.map +1 -0
  86. package/dist/commonjs/features/voice/recording/model/Recorder.model.js +55 -0
  87. package/dist/commonjs/features/voice/recording/model/Recorder.model.js.map +1 -0
  88. package/dist/commonjs/features/voice/recording/model/Uploader.model.js +44 -0
  89. package/dist/commonjs/features/voice/recording/model/Uploader.model.js.map +1 -0
  90. package/dist/commonjs/features/voice/recording/model/VoiceRecord.model.js +248 -0
  91. package/dist/commonjs/features/voice/recording/model/VoiceRecord.model.js.map +1 -0
  92. package/dist/commonjs/features/voice/recording/model/VoiceRecordCollection.js +30 -0
  93. package/dist/commonjs/features/voice/recording/model/VoiceRecordCollection.js.map +1 -0
  94. package/dist/commonjs/features/voice/types.js +6 -0
  95. package/dist/commonjs/features/voice/types.js.map +1 -0
  96. package/dist/commonjs/index.js +12 -0
  97. package/dist/commonjs/index.js.map +1 -1
  98. package/dist/commonjs/shared/components/PlayButton.js +70 -0
  99. package/dist/commonjs/shared/components/PlayButton.js.map +1 -0
  100. package/dist/commonjs/shared/translation/localization/ca.json +17 -0
  101. package/dist/commonjs/shared/translation/localization/de.json +17 -0
  102. package/dist/commonjs/shared/translation/localization/en.json +17 -0
  103. package/dist/commonjs/shared/translation/localization/gb.json +17 -0
  104. package/dist/commonjs/shared/translation/localization/sct.json +17 -0
  105. package/dist/commonjs/shared/translation/localization/sw.json +17 -0
  106. package/dist/module/features/chatbot/components/Chat/Chat.js +51 -141
  107. package/dist/module/features/chatbot/components/Chat/Chat.js.map +1 -1
  108. package/dist/module/features/chatbot/components/ChatControls/ChatControls.js +59 -45
  109. package/dist/module/features/chatbot/components/ChatControls/ChatControls.js.map +1 -1
  110. package/dist/module/features/chatbot/components/ChatInput/ChatInput.js +1 -3
  111. package/dist/module/features/chatbot/components/ChatInput/ChatInput.js.map +1 -1
  112. package/dist/module/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js +2 -2
  113. package/dist/module/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js.map +1 -1
  114. package/dist/module/features/chatbot/components/ChatInput/FreeText/SendMessageButton.js +1 -1
  115. package/dist/module/features/chatbot/components/ChatInput/RequestHintButton.js.map +1 -1
  116. package/dist/module/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -1
  117. package/dist/module/features/chatbot/components/ChatMessage/MessageButtonsBlock.js.map +1 -1
  118. package/dist/module/features/chatbot/components/ChatMessage/MessageLoader.js +38 -14
  119. package/dist/module/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -1
  120. package/dist/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.js +9 -49
  121. package/dist/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.js.map +1 -1
  122. package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js +21 -15
  123. package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -1
  124. package/dist/module/features/chatbot/components/ChatMessage/SentMessage.js +1 -1
  125. package/dist/module/features/chatbot/components/Chatbot.js +11 -20
  126. package/dist/module/features/chatbot/components/Chatbot.js.map +1 -1
  127. package/dist/module/features/chatbot/constants.js +5 -5
  128. package/dist/module/features/chatbot/constants.js.map +1 -1
  129. package/dist/module/features/chatbot/helpers.js +1 -8
  130. package/dist/module/features/chatbot/helpers.js.map +1 -1
  131. package/dist/module/features/chatbot/index.js.map +1 -1
  132. package/dist/module/features/chatbot/model/ChatBotModel.js +10 -46
  133. package/dist/module/features/chatbot/model/ChatBotModel.js.map +1 -1
  134. package/dist/module/features/chatbot/model/ChatbotApi.js +1 -1
  135. package/dist/module/features/chatbot/model/ChatbotApi.js.map +1 -1
  136. package/dist/module/features/chatbot/model/ChatsCacheModel.js +0 -9
  137. package/dist/module/features/chatbot/model/ChatsCacheModel.js.map +1 -1
  138. package/dist/module/features/chatbot/types/model.types.js.map +1 -1
  139. package/dist/module/features/gifCelebrations/helpers.js +1 -0
  140. package/dist/module/features/gifCelebrations/helpers.js.map +1 -1
  141. package/dist/module/features/voice/constants.js +19 -0
  142. package/dist/module/features/voice/constants.js.map +1 -0
  143. package/dist/module/features/voice/helpers.js +191 -0
  144. package/dist/module/features/voice/helpers.js.map +1 -0
  145. package/dist/module/features/voice/index.js +12 -0
  146. package/dist/module/features/voice/index.js.map +1 -0
  147. package/dist/module/features/voice/playing/components/VoiceIcon.js +41 -0
  148. package/dist/module/features/voice/playing/components/VoiceIcon.js.map +1 -0
  149. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdown.js +208 -0
  150. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdown.js.map +1 -0
  151. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js +102 -0
  152. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js.map +1 -0
  153. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js +45 -0
  154. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js.map +1 -0
  155. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js +29 -0
  156. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js.map +1 -0
  157. package/dist/module/features/voice/playing/model/Player.model.js +93 -0
  158. package/dist/module/features/voice/playing/model/Player.model.js.map +1 -0
  159. package/dist/module/features/voice/playing/model/TranscriptionsDownloaderModel.js +61 -0
  160. package/dist/module/features/voice/playing/model/TranscriptionsDownloaderModel.js.map +1 -0
  161. package/dist/module/features/voice/playing/model/VoiceFileDownloader.model.js +34 -0
  162. package/dist/module/features/voice/playing/model/VoiceFileDownloader.model.js.map +1 -0
  163. package/dist/module/features/voice/playing/model/VoicePlayer.model.js +218 -0
  164. package/dist/module/features/voice/playing/model/VoicePlayer.model.js.map +1 -0
  165. package/dist/module/features/voice/playing/model/VoiceTranscriptionsCollection.js +36 -0
  166. package/dist/module/features/voice/playing/model/VoiceTranscriptionsCollection.js.map +1 -0
  167. package/dist/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js +10 -0
  168. package/dist/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js.map +1 -0
  169. package/dist/module/features/voice/playing/model/index.js +5 -0
  170. package/dist/module/features/voice/playing/model/index.js.map +1 -0
  171. package/dist/module/features/voice/recording/components/VoiceRecord.js +67 -0
  172. package/dist/module/features/voice/recording/components/VoiceRecord.js.map +1 -0
  173. package/dist/module/features/voice/recording/components/VoiceRecordButton.js +57 -0
  174. package/dist/module/features/voice/recording/components/VoiceRecordButton.js.map +1 -0
  175. package/dist/module/features/voice/recording/components/VoiceRecordDeleteButton.js +29 -0
  176. package/dist/module/features/voice/recording/components/VoiceRecordDeleteButton.js.map +1 -0
  177. package/dist/module/features/voice/recording/components/VoiceRecordDivider.js +21 -0
  178. package/dist/module/features/voice/recording/components/VoiceRecordDivider.js.map +1 -0
  179. package/dist/module/features/voice/recording/components/VoiceRecordTimer.js +44 -0
  180. package/dist/module/features/voice/recording/components/VoiceRecordTimer.js.map +1 -0
  181. package/dist/module/features/voice/recording/hooks/useVoiceRecorder.js +54 -0
  182. package/dist/module/features/voice/recording/hooks/useVoiceRecorder.js.map +1 -0
  183. package/dist/module/features/voice/recording/hooks/useVoiceRecorderAnimation.js +17 -0
  184. package/dist/module/features/voice/recording/hooks/useVoiceRecorderAnimation.js.map +1 -0
  185. package/dist/module/features/voice/recording/modal/ModalFooterButtons.js +47 -0
  186. package/dist/module/features/voice/recording/modal/ModalFooterButtons.js.map +1 -0
  187. package/dist/module/features/voice/recording/modal/VoiceRecordDeleteModal.js +71 -0
  188. package/dist/module/features/voice/recording/modal/VoiceRecordDeleteModal.js.map +1 -0
  189. package/dist/module/features/voice/recording/modal/VoiceRecordUndoModal.js +45 -0
  190. package/dist/module/features/voice/recording/modal/VoiceRecordUndoModal.js.map +1 -0
  191. package/dist/module/features/voice/recording/model/Recorder.model.js +50 -0
  192. package/dist/module/features/voice/recording/model/Recorder.model.js.map +1 -0
  193. package/dist/module/features/voice/recording/model/Uploader.model.js +39 -0
  194. package/dist/module/features/voice/recording/model/Uploader.model.js.map +1 -0
  195. package/dist/module/features/voice/recording/model/VoiceRecord.model.js +244 -0
  196. package/dist/module/features/voice/recording/model/VoiceRecord.model.js.map +1 -0
  197. package/dist/module/features/voice/recording/model/VoiceRecordCollection.js +25 -0
  198. package/dist/module/features/voice/recording/model/VoiceRecordCollection.js.map +1 -0
  199. package/dist/module/features/voice/types.js +4 -0
  200. package/dist/module/features/voice/types.js.map +1 -0
  201. package/dist/module/index.js +1 -0
  202. package/dist/module/index.js.map +1 -1
  203. package/dist/module/shared/components/PlayButton.js +64 -0
  204. package/dist/module/shared/components/PlayButton.js.map +1 -0
  205. package/dist/module/shared/translation/localization/ca.json +17 -0
  206. package/dist/module/shared/translation/localization/de.json +17 -0
  207. package/dist/module/shared/translation/localization/en.json +17 -0
  208. package/dist/module/shared/translation/localization/gb.json +17 -0
  209. package/dist/module/shared/translation/localization/sct.json +17 -0
  210. package/dist/module/shared/translation/localization/sw.json +17 -0
  211. package/dist/typescript/commonjs/features/chatbot/components/Chat/Chat.d.ts +1 -2
  212. package/dist/typescript/commonjs/features/chatbot/components/Chat/Chat.d.ts.map +1 -1
  213. package/dist/typescript/commonjs/features/chatbot/components/ChatControls/ChatControls.d.ts +3 -3
  214. package/dist/typescript/commonjs/features/chatbot/components/ChatControls/ChatControls.d.ts.map +1 -1
  215. package/dist/typescript/commonjs/features/chatbot/components/ChatInput/ChatInput.d.ts.map +1 -1
  216. package/dist/typescript/commonjs/features/chatbot/components/ChatInput/RequestHintButton.d.ts.map +1 -1
  217. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts +1 -0
  218. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -1
  219. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageButtonsBlock.d.ts.map +1 -1
  220. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageLoader.d.ts +6 -1
  221. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageLoader.d.ts.map +1 -1
  222. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts +2 -2
  223. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts.map +1 -1
  224. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts +1 -1
  225. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts.map +1 -1
  226. package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts +1 -2
  227. package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts.map +1 -1
  228. package/dist/typescript/commonjs/features/chatbot/constants.d.ts +5 -5
  229. package/dist/typescript/commonjs/features/chatbot/constants.d.ts.map +1 -1
  230. package/dist/typescript/commonjs/features/chatbot/helpers.d.ts.map +1 -1
  231. package/dist/typescript/commonjs/features/chatbot/index.d.ts +2 -2
  232. package/dist/typescript/commonjs/features/chatbot/index.d.ts.map +1 -1
  233. package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts +1 -2
  234. package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
  235. package/dist/typescript/commonjs/features/chatbot/model/ChatsCacheModel.d.ts +0 -1
  236. package/dist/typescript/commonjs/features/chatbot/model/ChatsCacheModel.d.ts.map +1 -1
  237. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts +17 -19
  238. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts.map +1 -1
  239. package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts +13 -7
  240. package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts.map +1 -1
  241. package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts +0 -1
  242. package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts.map +1 -1
  243. package/dist/typescript/commonjs/features/gifCelebrations/helpers.d.ts.map +1 -1
  244. package/dist/typescript/commonjs/features/voice/constants.d.ts +16 -0
  245. package/dist/typescript/commonjs/features/voice/constants.d.ts.map +1 -0
  246. package/dist/typescript/commonjs/features/voice/helpers.d.ts +46 -0
  247. package/dist/typescript/commonjs/features/voice/helpers.d.ts.map +1 -0
  248. package/dist/typescript/commonjs/features/voice/index.d.ts +10 -0
  249. package/dist/typescript/commonjs/features/voice/index.d.ts.map +1 -0
  250. package/dist/typescript/commonjs/features/voice/playing/components/VoiceIcon.d.ts +8 -0
  251. package/dist/typescript/commonjs/features/voice/playing/components/VoiceIcon.d.ts.map +1 -0
  252. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts +16 -0
  253. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts.map +1 -0
  254. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts +12 -0
  255. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts.map +1 -0
  256. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts +16 -0
  257. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts.map +1 -0
  258. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts +11 -0
  259. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts.map +1 -0
  260. package/dist/typescript/commonjs/features/voice/playing/model/Player.model.d.ts +23 -0
  261. package/dist/typescript/commonjs/features/voice/playing/model/Player.model.d.ts.map +1 -0
  262. package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts +15 -0
  263. package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts.map +1 -0
  264. package/dist/typescript/commonjs/features/voice/playing/model/VoiceFileDownloader.model.d.ts +17 -0
  265. package/dist/typescript/commonjs/features/voice/playing/model/VoiceFileDownloader.model.d.ts.map +1 -0
  266. package/dist/typescript/commonjs/features/voice/playing/model/VoicePlayer.model.d.ts +41 -0
  267. package/dist/typescript/commonjs/features/voice/playing/model/VoicePlayer.model.d.ts.map +1 -0
  268. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts +13 -0
  269. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts.map +1 -0
  270. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts +7 -0
  271. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts.map +1 -0
  272. package/dist/typescript/commonjs/features/voice/playing/model/index.d.ts +3 -0
  273. package/dist/typescript/commonjs/features/voice/playing/model/index.d.ts.map +1 -0
  274. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecord.d.ts +10 -0
  275. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecord.d.ts.map +1 -0
  276. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordButton.d.ts +10 -0
  277. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordButton.d.ts.map +1 -0
  278. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordDeleteButton.d.ts +8 -0
  279. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordDeleteButton.d.ts.map +1 -0
  280. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordDivider.d.ts +3 -0
  281. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordDivider.d.ts.map +1 -0
  282. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordTimer.d.ts +11 -0
  283. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordTimer.d.ts.map +1 -0
  284. package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceRecorder.d.ts +5 -0
  285. package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceRecorder.d.ts.map +1 -0
  286. package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceRecorderAnimation.d.ts +6 -0
  287. package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceRecorderAnimation.d.ts.map +1 -0
  288. package/dist/typescript/commonjs/features/voice/recording/modal/ModalFooterButtons.d.ts +12 -0
  289. package/dist/typescript/commonjs/features/voice/recording/modal/ModalFooterButtons.d.ts.map +1 -0
  290. package/dist/typescript/commonjs/features/voice/recording/modal/VoiceRecordDeleteModal.d.ts +11 -0
  291. package/dist/typescript/commonjs/features/voice/recording/modal/VoiceRecordDeleteModal.d.ts.map +1 -0
  292. package/dist/typescript/commonjs/features/voice/recording/modal/VoiceRecordUndoModal.d.ts +11 -0
  293. package/dist/typescript/commonjs/features/voice/recording/modal/VoiceRecordUndoModal.d.ts.map +1 -0
  294. package/dist/typescript/commonjs/features/voice/recording/model/Recorder.model.d.ts +19 -0
  295. package/dist/typescript/commonjs/features/voice/recording/model/Recorder.model.d.ts.map +1 -0
  296. package/dist/typescript/commonjs/features/voice/recording/model/Uploader.model.d.ts +18 -0
  297. package/dist/typescript/commonjs/features/voice/recording/model/Uploader.model.d.ts.map +1 -0
  298. package/dist/typescript/commonjs/features/voice/recording/model/VoiceRecord.model.d.ts +50 -0
  299. package/dist/typescript/commonjs/features/voice/recording/model/VoiceRecord.model.d.ts.map +1 -0
  300. package/dist/typescript/commonjs/features/voice/recording/model/VoiceRecordCollection.d.ts +10 -0
  301. package/dist/typescript/commonjs/features/voice/recording/model/VoiceRecordCollection.d.ts.map +1 -0
  302. package/dist/typescript/commonjs/features/voice/types.d.ts +72 -0
  303. package/dist/typescript/commonjs/features/voice/types.d.ts.map +1 -0
  304. package/dist/typescript/commonjs/index.d.ts +1 -0
  305. package/dist/typescript/commonjs/index.d.ts.map +1 -1
  306. package/dist/typescript/commonjs/shared/components/PlayButton.d.ts +18 -0
  307. package/dist/typescript/commonjs/shared/components/PlayButton.d.ts.map +1 -0
  308. package/dist/typescript/commonjs/shared/translation/constants.d.ts +102 -0
  309. package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
  310. package/dist/typescript/commonjs/shared/translation/model.d.ts +34 -0
  311. package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
  312. package/dist/typescript/commonjs/types/common.types.d.ts +3 -0
  313. package/dist/typescript/commonjs/types/common.types.d.ts.map +1 -1
  314. package/dist/typescript/module/features/chatbot/components/Chat/Chat.d.ts +1 -2
  315. package/dist/typescript/module/features/chatbot/components/Chat/Chat.d.ts.map +1 -1
  316. package/dist/typescript/module/features/chatbot/components/ChatControls/ChatControls.d.ts +3 -3
  317. package/dist/typescript/module/features/chatbot/components/ChatControls/ChatControls.d.ts.map +1 -1
  318. package/dist/typescript/module/features/chatbot/components/ChatInput/ChatInput.d.ts.map +1 -1
  319. package/dist/typescript/module/features/chatbot/components/ChatInput/RequestHintButton.d.ts.map +1 -1
  320. package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts +1 -0
  321. package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -1
  322. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageButtonsBlock.d.ts.map +1 -1
  323. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageLoader.d.ts +6 -1
  324. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageLoader.d.ts.map +1 -1
  325. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts +2 -2
  326. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts.map +1 -1
  327. package/dist/typescript/module/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts +1 -1
  328. package/dist/typescript/module/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts.map +1 -1
  329. package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts +1 -2
  330. package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts.map +1 -1
  331. package/dist/typescript/module/features/chatbot/constants.d.ts +5 -5
  332. package/dist/typescript/module/features/chatbot/constants.d.ts.map +1 -1
  333. package/dist/typescript/module/features/chatbot/helpers.d.ts.map +1 -1
  334. package/dist/typescript/module/features/chatbot/index.d.ts +2 -2
  335. package/dist/typescript/module/features/chatbot/index.d.ts.map +1 -1
  336. package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts +1 -2
  337. package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
  338. package/dist/typescript/module/features/chatbot/model/ChatsCacheModel.d.ts +0 -1
  339. package/dist/typescript/module/features/chatbot/model/ChatsCacheModel.d.ts.map +1 -1
  340. package/dist/typescript/module/features/chatbot/types/api.types.d.ts +17 -19
  341. package/dist/typescript/module/features/chatbot/types/api.types.d.ts.map +1 -1
  342. package/dist/typescript/module/features/chatbot/types/model.types.d.ts +13 -7
  343. package/dist/typescript/module/features/chatbot/types/model.types.d.ts.map +1 -1
  344. package/dist/typescript/module/features/chatbot/types/units.types.d.ts +0 -1
  345. package/dist/typescript/module/features/chatbot/types/units.types.d.ts.map +1 -1
  346. package/dist/typescript/module/features/gifCelebrations/helpers.d.ts.map +1 -1
  347. package/dist/typescript/module/features/voice/constants.d.ts +16 -0
  348. package/dist/typescript/module/features/voice/constants.d.ts.map +1 -0
  349. package/dist/typescript/module/features/voice/helpers.d.ts +46 -0
  350. package/dist/typescript/module/features/voice/helpers.d.ts.map +1 -0
  351. package/dist/typescript/module/features/voice/index.d.ts +10 -0
  352. package/dist/typescript/module/features/voice/index.d.ts.map +1 -0
  353. package/dist/typescript/module/features/voice/playing/components/VoiceIcon.d.ts +8 -0
  354. package/dist/typescript/module/features/voice/playing/components/VoiceIcon.d.ts.map +1 -0
  355. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts +16 -0
  356. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts.map +1 -0
  357. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts +12 -0
  358. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts.map +1 -0
  359. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts +16 -0
  360. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts.map +1 -0
  361. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts +11 -0
  362. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts.map +1 -0
  363. package/dist/typescript/module/features/voice/playing/model/Player.model.d.ts +23 -0
  364. package/dist/typescript/module/features/voice/playing/model/Player.model.d.ts.map +1 -0
  365. package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts +15 -0
  366. package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts.map +1 -0
  367. package/dist/typescript/module/features/voice/playing/model/VoiceFileDownloader.model.d.ts +17 -0
  368. package/dist/typescript/module/features/voice/playing/model/VoiceFileDownloader.model.d.ts.map +1 -0
  369. package/dist/typescript/module/features/voice/playing/model/VoicePlayer.model.d.ts +41 -0
  370. package/dist/typescript/module/features/voice/playing/model/VoicePlayer.model.d.ts.map +1 -0
  371. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts +13 -0
  372. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts.map +1 -0
  373. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts +7 -0
  374. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts.map +1 -0
  375. package/dist/typescript/module/features/voice/playing/model/index.d.ts +3 -0
  376. package/dist/typescript/module/features/voice/playing/model/index.d.ts.map +1 -0
  377. package/dist/typescript/module/features/voice/recording/components/VoiceRecord.d.ts +10 -0
  378. package/dist/typescript/module/features/voice/recording/components/VoiceRecord.d.ts.map +1 -0
  379. package/dist/typescript/module/features/voice/recording/components/VoiceRecordButton.d.ts +10 -0
  380. package/dist/typescript/module/features/voice/recording/components/VoiceRecordButton.d.ts.map +1 -0
  381. package/dist/typescript/module/features/voice/recording/components/VoiceRecordDeleteButton.d.ts +8 -0
  382. package/dist/typescript/module/features/voice/recording/components/VoiceRecordDeleteButton.d.ts.map +1 -0
  383. package/dist/typescript/module/features/voice/recording/components/VoiceRecordDivider.d.ts +3 -0
  384. package/dist/typescript/module/features/voice/recording/components/VoiceRecordDivider.d.ts.map +1 -0
  385. package/dist/typescript/module/features/voice/recording/components/VoiceRecordTimer.d.ts +11 -0
  386. package/dist/typescript/module/features/voice/recording/components/VoiceRecordTimer.d.ts.map +1 -0
  387. package/dist/typescript/module/features/voice/recording/hooks/useVoiceRecorder.d.ts +5 -0
  388. package/dist/typescript/module/features/voice/recording/hooks/useVoiceRecorder.d.ts.map +1 -0
  389. package/dist/typescript/module/features/voice/recording/hooks/useVoiceRecorderAnimation.d.ts +6 -0
  390. package/dist/typescript/module/features/voice/recording/hooks/useVoiceRecorderAnimation.d.ts.map +1 -0
  391. package/dist/typescript/module/features/voice/recording/modal/ModalFooterButtons.d.ts +12 -0
  392. package/dist/typescript/module/features/voice/recording/modal/ModalFooterButtons.d.ts.map +1 -0
  393. package/dist/typescript/module/features/voice/recording/modal/VoiceRecordDeleteModal.d.ts +11 -0
  394. package/dist/typescript/module/features/voice/recording/modal/VoiceRecordDeleteModal.d.ts.map +1 -0
  395. package/dist/typescript/module/features/voice/recording/modal/VoiceRecordUndoModal.d.ts +11 -0
  396. package/dist/typescript/module/features/voice/recording/modal/VoiceRecordUndoModal.d.ts.map +1 -0
  397. package/dist/typescript/module/features/voice/recording/model/Recorder.model.d.ts +19 -0
  398. package/dist/typescript/module/features/voice/recording/model/Recorder.model.d.ts.map +1 -0
  399. package/dist/typescript/module/features/voice/recording/model/Uploader.model.d.ts +18 -0
  400. package/dist/typescript/module/features/voice/recording/model/Uploader.model.d.ts.map +1 -0
  401. package/dist/typescript/module/features/voice/recording/model/VoiceRecord.model.d.ts +50 -0
  402. package/dist/typescript/module/features/voice/recording/model/VoiceRecord.model.d.ts.map +1 -0
  403. package/dist/typescript/module/features/voice/recording/model/VoiceRecordCollection.d.ts +10 -0
  404. package/dist/typescript/module/features/voice/recording/model/VoiceRecordCollection.d.ts.map +1 -0
  405. package/dist/typescript/module/features/voice/types.d.ts +72 -0
  406. package/dist/typescript/module/features/voice/types.d.ts.map +1 -0
  407. package/dist/typescript/module/index.d.ts +1 -0
  408. package/dist/typescript/module/index.d.ts.map +1 -1
  409. package/dist/typescript/module/shared/components/PlayButton.d.ts +18 -0
  410. package/dist/typescript/module/shared/components/PlayButton.d.ts.map +1 -0
  411. package/dist/typescript/module/shared/translation/constants.d.ts +102 -0
  412. package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
  413. package/dist/typescript/module/shared/translation/model.d.ts +34 -0
  414. package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
  415. package/dist/typescript/module/types/common.types.d.ts +3 -0
  416. package/dist/typescript/module/types/common.types.d.ts.map +1 -1
  417. package/package.json +11 -4
  418. package/src/features/chatbot/components/Chat/Chat.tsx +69 -192
  419. package/src/features/chatbot/components/ChatControls/ChatControls.tsx +66 -44
  420. package/src/features/chatbot/components/ChatInput/ChatInput.tsx +1 -3
  421. package/src/features/chatbot/components/ChatInput/FreeText/ChatTextInput.tsx +2 -2
  422. package/src/features/chatbot/components/ChatInput/FreeText/SendMessageButton.tsx +1 -1
  423. package/src/features/chatbot/components/ChatInput/RequestHintButton.tsx +0 -1
  424. package/src/features/chatbot/components/ChatMessage/ChatMessage.tsx +1 -0
  425. package/src/features/chatbot/components/ChatMessage/MessageButtonsBlock.tsx +1 -1
  426. package/src/features/chatbot/components/ChatMessage/MessageLoader.tsx +35 -11
  427. package/src/features/chatbot/components/ChatMessage/MessageTextToSpeech.tsx +9 -51
  428. package/src/features/chatbot/components/ChatMessage/ReceivedMessage.tsx +17 -11
  429. package/src/features/chatbot/components/ChatMessage/SentMessage.tsx +1 -1
  430. package/src/features/chatbot/components/Chatbot.tsx +11 -21
  431. package/src/features/chatbot/constants.ts +4 -4
  432. package/src/features/chatbot/helpers.ts +0 -3
  433. package/src/features/chatbot/index.ts +2 -16
  434. package/src/features/chatbot/model/ChatBotModel.ts +8 -51
  435. package/src/features/chatbot/model/ChatbotApi.ts +1 -1
  436. package/src/features/chatbot/model/ChatsCacheModel.ts +0 -7
  437. package/src/features/chatbot/types/api.types.ts +17 -17
  438. package/src/features/chatbot/types/model.types.ts +15 -7
  439. package/src/features/chatbot/types/units.types.ts +0 -1
  440. package/src/features/gifCelebrations/helpers.ts +1 -0
  441. package/src/features/voice/constants.ts +15 -0
  442. package/src/features/voice/helpers.ts +251 -0
  443. package/src/features/voice/index.ts +11 -0
  444. package/src/features/voice/playing/components/VoiceIcon.tsx +38 -0
  445. package/src/features/voice/playing/components/VoiceTranscriptionsDropdown.tsx +251 -0
  446. package/src/features/voice/playing/components/VoiceTranscriptionsDropdownItem.tsx +127 -0
  447. package/src/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.ts +54 -0
  448. package/src/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.ts +40 -0
  449. package/src/features/voice/playing/model/Player.model.ts +104 -0
  450. package/src/features/voice/playing/model/TranscriptionsDownloaderModel.ts +80 -0
  451. package/src/features/voice/playing/model/VoiceFileDownloader.model.ts +42 -0
  452. package/src/features/voice/playing/model/VoicePlayer.model.ts +255 -0
  453. package/src/features/voice/playing/model/VoiceTranscriptionsCollection.ts +40 -0
  454. package/src/features/voice/playing/model/VoiceTranscriptionsDropdown.model.ts +11 -0
  455. package/src/features/voice/playing/model/index.ts +2 -0
  456. package/src/features/voice/recording/components/VoiceRecord.tsx +65 -0
  457. package/src/features/voice/recording/components/VoiceRecordButton.tsx +64 -0
  458. package/src/features/voice/recording/components/VoiceRecordDeleteButton.tsx +25 -0
  459. package/src/features/voice/recording/components/VoiceRecordDivider.tsx +17 -0
  460. package/src/features/voice/recording/components/VoiceRecordTimer.tsx +49 -0
  461. package/src/features/voice/recording/hooks/useVoiceRecorder.ts +62 -0
  462. package/src/features/voice/recording/hooks/useVoiceRecorderAnimation.ts +19 -0
  463. package/src/features/voice/recording/modal/ModalFooterButtons.tsx +54 -0
  464. package/src/features/voice/recording/modal/VoiceRecordDeleteModal.tsx +82 -0
  465. package/src/features/voice/recording/modal/VoiceRecordUndoModal.tsx +50 -0
  466. package/src/features/voice/recording/model/Recorder.model.ts +63 -0
  467. package/src/features/voice/recording/model/Uploader.model.ts +48 -0
  468. package/src/features/voice/recording/model/VoiceRecord.model.ts +302 -0
  469. package/src/features/voice/recording/model/VoiceRecordCollection.ts +26 -0
  470. package/src/features/voice/types.ts +84 -0
  471. package/src/index.ts +1 -0
  472. package/src/shared/components/PlayButton.tsx +84 -0
  473. package/src/shared/translation/localization/ca.json +17 -0
  474. package/src/shared/translation/localization/de.json +17 -0
  475. package/src/shared/translation/localization/en.json +17 -0
  476. package/src/shared/translation/localization/gb.json +17 -0
  477. package/src/shared/translation/localization/sct.json +17 -0
  478. package/src/shared/translation/localization/sw.json +17 -0
  479. package/src/types/common.types.ts +1 -0
  480. package/dist/commonjs/features/chatbot/TTS_HIGHLIGHTING.md +0 -120
  481. package/dist/commonjs/features/chatbot/components/Chat/CloseButton.js +0 -39
  482. package/dist/commonjs/features/chatbot/components/Chat/CloseButton.js.map +0 -1
  483. package/dist/commonjs/features/chatbot/components/ChatMessage/AnimatedMessage.js +0 -43
  484. package/dist/commonjs/features/chatbot/components/ChatMessage/AnimatedMessage.js.map +0 -1
  485. package/dist/module/features/chatbot/TTS_HIGHLIGHTING.md +0 -120
  486. package/dist/module/features/chatbot/components/Chat/CloseButton.js +0 -33
  487. package/dist/module/features/chatbot/components/Chat/CloseButton.js.map +0 -1
  488. package/dist/module/features/chatbot/components/ChatMessage/AnimatedMessage.js +0 -40
  489. package/dist/module/features/chatbot/components/ChatMessage/AnimatedMessage.js.map +0 -1
  490. package/dist/typescript/commonjs/features/chatbot/components/Chat/CloseButton.d.ts +0 -7
  491. package/dist/typescript/commonjs/features/chatbot/components/Chat/CloseButton.d.ts.map +0 -1
  492. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/AnimatedMessage.d.ts +0 -7
  493. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/AnimatedMessage.d.ts.map +0 -1
  494. package/dist/typescript/module/features/chatbot/components/Chat/CloseButton.d.ts +0 -7
  495. package/dist/typescript/module/features/chatbot/components/Chat/CloseButton.d.ts.map +0 -1
  496. package/dist/typescript/module/features/chatbot/components/ChatMessage/AnimatedMessage.d.ts +0 -7
  497. package/dist/typescript/module/features/chatbot/components/ChatMessage/AnimatedMessage.d.ts.map +0 -1
  498. package/src/features/chatbot/TTS_HIGHLIGHTING.md +0 -120
  499. package/src/features/chatbot/components/Chat/CloseButton.tsx +0 -31
  500. package/src/features/chatbot/components/ChatMessage/AnimatedMessage.tsx +0 -38
@@ -0,0 +1,218 @@
1
+ "use strict";
2
+
3
+ import { attach, createEffect, createEvent, restore } from 'effector';
4
+ import { VoiceTranscriptionsCollection } from "./VoiceTranscriptionsCollection.js";
5
+ import { VoiceFileDownloaderModel } from "./VoiceFileDownloader.model.js";
6
+ import { VoiceTranscriptionsDropdownModel } from "./VoiceTranscriptionsDropdown.model.js";
7
+ import { PlayerModel, PlayerState } from "./Player.model.js";
8
+ import { TranscriptionsDownloaderModel } from "./TranscriptionsDownloaderModel.js";
9
+ export class VoicePlayerModel {
10
+ collection = new VoiceTranscriptionsCollection();
11
+ downloader = new VoiceFileDownloaderModel();
12
+ dropdown = new VoiceTranscriptionsDropdownModel();
13
+ playerModel = new PlayerModel();
14
+ currentPlayingAttempt = null;
15
+ shouldPreventPlayback = false;
16
+ setCurrentAttempt = createEvent();
17
+ reset = createEvent();
18
+ $currentAttempt = restore(this.setCurrentAttempt, null).reset(this.reset);
19
+ $playerState = this.playerModel.$playerState;
20
+ pauseAudio = this.playerModel.pause;
21
+ stopAudio = () => {
22
+ this.shouldPreventPlayback = true;
23
+ this.abortAllDownloads();
24
+ this.playerModel.stop();
25
+ this.currentPlayingAttempt = null;
26
+ this.setCurrentAttempt(null);
27
+ };
28
+ resetPlayer = () => {
29
+ this.shouldPreventPlayback = true;
30
+ this.releaseCollectionResources();
31
+ this.playerModel.stop();
32
+ this.currentPlayingAttempt = null;
33
+ this.setCurrentAttempt(null);
34
+ this.collection.clear();
35
+ };
36
+ constructor(params) {
37
+ this.api = params.api;
38
+ this.loader = new TranscriptionsDownloaderModel(this.collection, params.api);
39
+ this.downloader.setApi(params.api);
40
+ this.playerModel.playbackFinished.watch(() => {
41
+ this.currentPlayingAttempt = null;
42
+ this.setCurrentAttempt(null);
43
+ });
44
+ if (params.audios) {
45
+ this.initializeCollectionFromAudios(params.audios);
46
+ }
47
+ this.playerModel.setupAudioMode();
48
+ }
49
+ initializeWithAudios(answerAudio) {
50
+ this.loader.setTranscriptsLoaded(false);
51
+ this.collection.clear();
52
+ this.initializeCollectionFromAudios(answerAudio);
53
+ }
54
+ initializeCollectionFromAudios(audios) {
55
+ if (!audios) {
56
+ console.warn('VoicePlayerModel: audios is not provided');
57
+ return;
58
+ }
59
+ audios.forEach((audio, index) => {
60
+ const attemptNumber = index + 1;
61
+ if (!audio.audioFileId) {
62
+ console.warn('VoicePlayerModel: audioFileId is missing for audio', audio);
63
+ return;
64
+ }
65
+ this.collection.add(attemptNumber, {
66
+ attemptNumber,
67
+ audioFileId: audio.audioFileId,
68
+ _id: audio._id,
69
+ hasDrawing: !!audio.drawing
70
+ });
71
+ });
72
+ }
73
+ releaseCollectionResources() {
74
+ this.collection.getAll().forEach(item => {
75
+ if (item.controller) {
76
+ this.downloader.abortDownload(item.controller);
77
+ }
78
+ if (item.audioUri?.startsWith('blob:')) {
79
+ try {
80
+ URL.revokeObjectURL(item.audioUri);
81
+ } catch (e) {}
82
+ }
83
+ });
84
+ }
85
+ abortAllDownloads() {
86
+ this.collection.getAll().forEach(item => {
87
+ if (item.controller && item.audioLoading) {
88
+ this.downloader.abortDownload(item.controller);
89
+ this.collection.update(item.attemptNumber, {
90
+ audioLoading: false,
91
+ controller: undefined,
92
+ audioDownloadPromise: undefined
93
+ });
94
+ }
95
+ });
96
+ }
97
+ handlePlayAttempt = createEffect(async attemptNumber => {
98
+ this.shouldPreventPlayback = false;
99
+ const item = this.collection.get(attemptNumber);
100
+ if (!item) return;
101
+ if (this.currentPlayingAttempt !== null && this.currentPlayingAttempt !== attemptNumber) {
102
+ this.abortAllDownloads();
103
+ }
104
+ if (this.collection.hasAudio(attemptNumber)) {
105
+ this.playAudioFx(attemptNumber);
106
+ return;
107
+ }
108
+ try {
109
+ this.playerModel.setPlayerState(PlayerState.LOADING);
110
+ const {
111
+ collectionItem,
112
+ downloadPromise
113
+ } = await this.downloader.download({
114
+ audioFileId: item.audioFileId,
115
+ attemptNumber
116
+ });
117
+ if (this.shouldPreventPlayback) {
118
+ collectionItem.controller?.abort();
119
+ return;
120
+ }
121
+ this.collection.update(attemptNumber, collectionItem);
122
+ const result = await downloadPromise;
123
+ if (this.shouldPreventPlayback) {
124
+ if (result.uri?.startsWith('blob:')) {
125
+ URL.revokeObjectURL(result.uri);
126
+ }
127
+ return;
128
+ }
129
+ this.collection.update(attemptNumber, {
130
+ audioUri: result.uri,
131
+ audioLoading: false,
132
+ audioError: undefined,
133
+ controller: undefined,
134
+ audioDownloadPromise: undefined
135
+ });
136
+ this.playerModel.setPlayerState(PlayerState.IDLE);
137
+ this.playAudioFx(attemptNumber);
138
+ } catch (error) {
139
+ console.error('Audio download error:', error);
140
+ if (error instanceof Error && error.name === 'AbortError') {
141
+ this.playerModel.setPlayerState(PlayerState.IDLE);
142
+ return;
143
+ }
144
+ this.collection.update(attemptNumber, {
145
+ audioLoading: false,
146
+ audioError: error instanceof Error ? error.message : 'Failed to download audio',
147
+ controller: undefined,
148
+ audioDownloadPromise: undefined
149
+ });
150
+ }
151
+ });
152
+ playAudioFx = createEffect(async attemptNumber => {
153
+ if (this.shouldPreventPlayback) return;
154
+ const item = this.collection.get(attemptNumber);
155
+ if (!item?.audioUri) {
156
+ console.warn('No audio URI available for attempt:', attemptNumber);
157
+ return;
158
+ }
159
+ try {
160
+ if (this.currentPlayingAttempt !== null && this.currentPlayingAttempt !== attemptNumber) {
161
+ this.playerModel.player?.remove();
162
+ }
163
+ if (this.currentPlayingAttempt === attemptNumber && this.playerModel.player?.playing) {
164
+ this.playerModel.pause();
165
+ return;
166
+ }
167
+ if (this.currentPlayingAttempt === attemptNumber && !this.playerModel.player?.playing) {
168
+ this.playerModel.resume();
169
+ return;
170
+ }
171
+ this.currentPlayingAttempt = attemptNumber;
172
+ this.setCurrentAttempt(attemptNumber);
173
+ await this.playerModel.play(item.audioUri);
174
+ } catch (error) {
175
+ console.error('Error playing audio:', error);
176
+ this.playerModel.setPlayerState(PlayerState.IDLE);
177
+ this.collection.update(attemptNumber, {
178
+ audioError: error instanceof Error ? error.message : 'Failed to play audio'
179
+ });
180
+ }
181
+ });
182
+ isAudioLoading(attemptNumber) {
183
+ return this.collection.get(attemptNumber)?.audioLoading || false;
184
+ }
185
+ getAllAttempts() {
186
+ return this.collection.getAll();
187
+ }
188
+ reinitializePlayer() {
189
+ this.playerModel.reinitialize();
190
+ }
191
+ cleanup() {
192
+ this.releaseCollectionResources();
193
+ this.collection.clear();
194
+ this.currentPlayingAttempt = null;
195
+ this.reset();
196
+ this.loader.reset();
197
+ this.dropdown.reset();
198
+ this.playerModel.release();
199
+ }
200
+ togglePlayPause = attach({
201
+ source: this.playerModel.$playerState,
202
+ mapParams: (attemptNumber, playerState) => ({
203
+ attemptNumber,
204
+ playerState
205
+ }),
206
+ effect: createEffect(({
207
+ attemptNumber,
208
+ playerState
209
+ }) => {
210
+ if (this.currentPlayingAttempt === attemptNumber && playerState === PlayerState.PLAYING) {
211
+ this.pauseAudio();
212
+ } else {
213
+ this.handlePlayAttempt(attemptNumber);
214
+ }
215
+ })
216
+ });
217
+ }
218
+ //# sourceMappingURL=VoicePlayer.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["attach","createEffect","createEvent","restore","VoiceTranscriptionsCollection","VoiceFileDownloaderModel","VoiceTranscriptionsDropdownModel","PlayerModel","PlayerState","TranscriptionsDownloaderModel","VoicePlayerModel","collection","downloader","dropdown","playerModel","currentPlayingAttempt","shouldPreventPlayback","setCurrentAttempt","reset","$currentAttempt","$playerState","pauseAudio","pause","stopAudio","abortAllDownloads","stop","resetPlayer","releaseCollectionResources","clear","constructor","params","api","loader","setApi","playbackFinished","watch","audios","initializeCollectionFromAudios","setupAudioMode","initializeWithAudios","answerAudio","setTranscriptsLoaded","console","warn","forEach","audio","index","attemptNumber","audioFileId","add","_id","hasDrawing","drawing","getAll","item","controller","abortDownload","audioUri","startsWith","URL","revokeObjectURL","e","audioLoading","update","undefined","audioDownloadPromise","handlePlayAttempt","get","hasAudio","playAudioFx","setPlayerState","LOADING","collectionItem","downloadPromise","download","abort","result","uri","audioError","IDLE","error","Error","name","message","player","remove","playing","resume","play","isAudioLoading","getAllAttempts","reinitializePlayer","reinitialize","cleanup","release","togglePlayPause","source","mapParams","playerState","effect","PLAYING"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/VoicePlayer.model.ts"],"mappings":";;AAAA,SAASA,MAAM,EAAEC,YAAY,EAAEC,WAAW,EAAEC,OAAO,QAAQ,UAAU;AACrE,SAASC,6BAA6B,QAAQ,oCAAiC;AAC/E,SAASC,wBAAwB,QAAQ,gCAA6B;AACtE,SAASC,gCAAgC,QAAQ,wCAAqC;AAEtF,SAASC,WAAW,EAAEC,WAAW,QAAQ,mBAAgB;AACzD,SAASC,6BAA6B,QAAQ,oCAAiC;AAW/E,OAAO,MAAMC,gBAAgB,CAAC;EACZC,UAAU,GAAG,IAAIP,6BAA6B,CAAC,CAAC;EAChDQ,UAAU,GAAG,IAAIP,wBAAwB,CAAC,CAAC;EAC3CQ,QAAQ,GAAG,IAAIP,gCAAgC,CAAC,CAAC;EACjDQ,WAAW,GAAG,IAAIP,WAAW,CAAC,CAAC;EAGvCQ,qBAAqB,GAAkB,IAAI;EAC3CC,qBAAqB,GAAG,KAAK;EAErBC,iBAAiB,GAAGf,WAAW,CAAgB,CAAC;EAChDgB,KAAK,GAAGhB,WAAW,CAAC,CAAC;EAErBiB,eAAe,GAAGhB,OAAO,CAAC,IAAI,CAACc,iBAAiB,EAAE,IAAI,CAAC,CAACC,KAAK,CAAC,IAAI,CAACA,KAAK,CAAC;EACzEE,YAAY,GAAG,IAAI,CAACN,WAAW,CAACM,YAAY;EAE5CC,UAAU,GAAG,IAAI,CAACP,WAAW,CAACQ,KAAK;EAEnCC,SAAS,GAAGA,CAAA,KAAM;IAChC,IAAI,CAACP,qBAAqB,GAAG,IAAI;IACjC,IAAI,CAACQ,iBAAiB,CAAC,CAAC;IACxB,IAAI,CAACV,WAAW,CAACW,IAAI,CAAC,CAAC;IACvB,IAAI,CAACV,qBAAqB,GAAG,IAAI;IACjC,IAAI,CAACE,iBAAiB,CAAC,IAAI,CAAC;EAC9B,C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AG;IACf,IAAI,CAAClE,0BAA0B,CAAC,CAAC;IACjC,IAAI,CAAChB,UAAU,CAACiB,KAAK,CAAC,CAAC;IACvB,IAAI,CAACb,qBAAqB,GAAG,IAAI;IACjC,IAAI,CAACG,KAAK,CAAC,CAAC;IACZ,IAAI,CAACc,MAAM,CAACd,KAAK,CAAC,CAAC;IACnB,IAAI,CAACL,QAAQ,CAACK,KAAK,CAAC,CAAC;IACrB,IAAI,CAACJ,WAAW,CAACgF,OAAO,CAAC,CAAC;EAC5B;EAEOC,eAAe,GAAG/F,MAAM,CAAC;IAC9BgG,MAAM,EAAE,IAAI,CAAClF,WAAW,CAACM,YAAY;IACrC6E,SAAS,EAAEA,CAAClD,aAAqB,EAAEmD,WAAW,MAAM;MAAEnD,aAAa;MAAEmD;IAAY,CAAC,CAAC;IACnFC,MAAM,EAAElG,YAAY,CAAC,CAAC;MAAE8C,aAAa;MAAEmD;IAAmC,CAAC,KAAK;MAC9E,IAAI,IAAI,CAACnF,qBAAqB,KAAKgC,aAAa,IAAImD,WAAW,KAAK1F,WAAW,CAAC4F,OAAO,EAAE;QACvF,IAAI,CAAC/E,UAAU,CAAC,CAAC;MACnB,CAAC,MAAM;QACL,IAAI,CAAC6C,iBAAiB,CAACnB,aAAa,CAAC;MACvC;IACF,CAAC;EACH,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ export class VoiceTranscriptionsCollection {
4
+ collection = new Map();
5
+ add(attemptNumber, item) {
6
+ this.collection.set(attemptNumber, item);
7
+ }
8
+ update(attemptNumber, item) {
9
+ const existingItem = this.collection.get(attemptNumber) || {};
10
+ this.collection.set(attemptNumber, {
11
+ ...existingItem,
12
+ ...item
13
+ });
14
+ }
15
+ delete(attemptNumber) {
16
+ this.collection.delete(attemptNumber);
17
+ }
18
+ get(attemptNumber) {
19
+ return this.collection.get(attemptNumber);
20
+ }
21
+ getAll() {
22
+ return Array.from(this.collection.values());
23
+ }
24
+ clear() {
25
+ this.collection.clear();
26
+ }
27
+ hasTranscript(attemptNumber) {
28
+ const item = this.collection.get(attemptNumber);
29
+ return !!item?.transcript;
30
+ }
31
+ hasAudio(attemptNumber) {
32
+ const item = this.collection.get(attemptNumber);
33
+ return !!item?.audioUri;
34
+ }
35
+ }
36
+ //# sourceMappingURL=VoiceTranscriptionsCollection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["VoiceTranscriptionsCollection","collection","Map","add","attemptNumber","item","set","update","existingItem","get","delete","getAll","Array","from","values","clear","hasTranscript","transcript","hasAudio","audioUri"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/VoiceTranscriptionsCollection.ts"],"mappings":";;AAEA,OAAO,MAAMA,6BAA6B,CAAC;EACzBC,UAAU,GAAwC,IAAIC,GAAG,CAAC,CAAC;EAEpEC,GAAGA,CAACC,aAAqB,EAAEC,IAA4B,EAAE;IAC9D,IAAI,CAACJ,UAAU,CAACK,GAAG,CAACF,aAAa,EAAEC,IAAI,CAAC;EAC1C;EAEOE,MAAMA,CAACH,aAAqB,EAAEC,IAAqC,EAAE;IAC1E,MAAMG,YAAY,GAAG,IAAI,CAACP,UAAU,CAACQ,GAAG,CAACL,aAAa,CAAC,IAAK,CAAC,CAA4B;IACzF,IAAI,CAACH,UAAU,CAACK,GAAG,CAACF,aAAa,EAAE;MAAE,GAAGI,YAAY;MAAE,GAAGH;IAAK,CAAC,CAAC;EAClE;EAEOK,MAAMA,CAACN,aAAqB,EAAE;IACnC,IAAI,CAACH,UAAU,CAACS,MAAM,CAACN,aAAa,CAAC;EACvC;EAEOK,GAAGA,CAACL,aAAqB,EAAE;IAChC,OAAO,IAAI,CAACH,UAAU,CAACQ,GAAG,CAACL,aAAa,CAAC;EAC3C;EAEOO,MAAMA,CAAA,EAAG;IACd,OAAOC,KAAK,CAACC,IAAI,CAAC,IAAI,CAACZ,UAAU,CAACa,MAAM,CAAC,CAAC,CAAC;EAC7C;EAEOC,KAAKA,CAAA,EAAG;IACb,IAAI,CAACd,UAAU,CAACc,KAAK,CAAC,CAAC;EACzB;EAEOC,aAAaA,CAACZ,aAAqB,EAAE;IAC1C,MAAMC,IAAI,GAAG,IAAI,CAACJ,UAAU,CAACQ,GAAG,CAACL,aAAa,CAAC;IAC/C,OAAO,CAAC,CAACC,IAAI,EAAEY,UAAU;EAC3B;EAEOC,QAAQA,CAACd,aAAqB,EAAE;IACrC,MAAMC,IAAI,GAAG,IAAI,CAACJ,UAAU,CAACQ,GAAG,CAACL,aAAa,CAAC;IAC/C,OAAO,CAAC,CAACC,IAAI,EAAEc,QAAQ;EACzB;AACF","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ import { createEvent, restore } from 'effector';
4
+ export class VoiceTranscriptionsDropdownModel {
5
+ toggleExpand = createEvent();
6
+ setExpanded = createEvent();
7
+ reset = createEvent();
8
+ $isExpanded = restore(this.setExpanded, false).on(this.toggleExpand, state => !state).reset(this.reset);
9
+ }
10
+ //# sourceMappingURL=VoiceTranscriptionsDropdown.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createEvent","restore","VoiceTranscriptionsDropdownModel","toggleExpand","setExpanded","reset","$isExpanded","on","state"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/VoiceTranscriptionsDropdown.model.ts"],"mappings":";;AAAA,SAASA,WAAW,EAAeC,OAAO,QAAQ,UAAU;AAE5D,OAAO,MAAMC,gCAAgC,CAAC;EAC5BC,YAAY,GAAGH,WAAW,CAAC,CAAC;EAC5BI,WAAW,GAAGJ,WAAW,CAAU,CAAC;EACpCK,KAAK,GAAGL,WAAW,CAAC,CAAC;EAErBM,WAAW,GAAGL,OAAO,CAAC,IAAI,CAACG,WAAW,EAAE,KAAK,CAAC,CAC3DG,EAAE,CAAC,IAAI,CAACJ,YAAY,EAAGK,KAAK,IAAK,CAACA,KAAK,CAAC,CACxCH,KAAK,CAAC,IAAI,CAACA,KAAK,CAAC;AACtB","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ export { VoicePlayerModel } from "./VoicePlayer.model.js";
4
+ export { PlayerState } from "./Player.model.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["VoicePlayerModel","PlayerState"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/index.ts"],"mappings":";;AAAA,SAASA,gBAAgB,QAAQ,wBAAqB;AACtD,SAASC,WAAW,QAAQ,mBAAgB","ignoreList":[]}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+
3
+ import { StyleSheet } from 'react-native';
4
+ import { VoiceRecordButton } from "./VoiceRecordButton.js";
5
+ import React, { useEffect } from 'react';
6
+ import { COLORS, SPACING } from '@magmamath/react-native-ui';
7
+ import { VoiceRecordDeleteButton } from "./VoiceRecordDeleteButton.js";
8
+ import { VoiceRecordDivider } from "./VoiceRecordDivider.js";
9
+ import { VoiceRecordTimer } from "./VoiceRecordTimer.js";
10
+ import Animated, { FadeIn, FadeOut } from 'react-native-reanimated';
11
+ import { useVoiceRecorder } from "../hooks/useVoiceRecorder.js";
12
+ import { useVoiceRecorderAnimation } from "../hooks/useVoiceRecorderAnimation.js";
13
+ import { useUnit } from 'effector-react';
14
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
+ export const VoiceRecord = ({
16
+ style,
17
+ model
18
+ }) => {
19
+ const {
20
+ recorderState
21
+ } = useVoiceRecorder(model);
22
+ const [isExpanded, isDisabled] = useUnit([model.$isExpanded, model.$isButtonDisabled]);
23
+ const {
24
+ containerAnimatedStyle
25
+ } = useVoiceRecorderAnimation(isExpanded);
26
+ useEffect(() => {
27
+ return () => {
28
+ model.cleanup();
29
+ };
30
+ }, [model]);
31
+ return /*#__PURE__*/_jsxs(Animated.View, {
32
+ style: [styles.container, style, containerAnimatedStyle],
33
+ children: [/*#__PURE__*/_jsx(VoiceRecordButton, {
34
+ model: model
35
+ }), isExpanded && /*#__PURE__*/_jsxs(Animated.View, {
36
+ entering: FadeIn,
37
+ exiting: FadeOut,
38
+ style: styles.expendedContainer,
39
+ children: [/*#__PURE__*/_jsx(VoiceRecordTimer, {
40
+ style: styles.timer,
41
+ model: model,
42
+ recordingFileDurationMs: recorderState.durationMillis
43
+ }), /*#__PURE__*/_jsx(VoiceRecordDivider, {}), /*#__PURE__*/_jsx(VoiceRecordDeleteButton, {
44
+ isDisabled: isDisabled,
45
+ onPress: model.events.deleteRecord
46
+ })]
47
+ })]
48
+ });
49
+ };
50
+ const styles = StyleSheet.create({
51
+ container: {
52
+ alignItems: 'center',
53
+ padding: 3,
54
+ paddingBottom: 6,
55
+ backgroundColor: COLORS.NEUTRAL_3,
56
+ borderRadius: 32,
57
+ boxShadow: '0 1px 3px 0 rgba(51, 51, 51, 0.10), 0 0 1px 0 rgba(51, 51, 51, 0.40)',
58
+ overflow: 'hidden'
59
+ },
60
+ timer: {
61
+ marginTop: SPACING[400]
62
+ },
63
+ expendedContainer: {
64
+ alignItems: 'center'
65
+ }
66
+ });
67
+ //# sourceMappingURL=VoiceRecord.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["StyleSheet","VoiceRecordButton","React","useEffect","COLORS","SPACING","VoiceRecordDeleteButton","VoiceRecordDivider","VoiceRecordTimer","Animated","FadeIn","FadeOut","useVoiceRecorder","useVoiceRecorderAnimation","useUnit","jsx","_jsx","jsxs","_jsxs","VoiceRecord","style","model","recorderState","isExpanded","isDisabled","$isExpanded","$isButtonDisabled","containerAnimatedStyle","cleanup","View","styles","container","children","entering","exiting","expendedContainer","timer","recordingFileDurationMs","durationMillis","onPress","events","deleteRecord","create","alignItems","padding","paddingBottom","backgroundColor","NEUTRAL_3","borderRadius","boxShadow","overflow","marginTop"],"sourceRoot":"../../../../../../src","sources":["features/voice/recording/components/VoiceRecord.tsx"],"mappings":";;AAAA,SAA+BA,UAAU,QAAQ,cAAc;AAC/D,SAASC,iBAAiB,QAAQ,wBAAqB;AACvD,OAAOC,KAAK,IAAIC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B;MAAAH,QAAA,gBACjFhB,IAAA,CAACR,gBAAgB;QACfY,KAAK,EAAEU,MAAM,CAACM,KAAM;QACpBf,KAAK,EAAEA,KAAM;QACbgB,uBAAuB,EAAEf,aAAa,CAACgB;MAAe,CACvD,CAAC,eACFtB,IAAA,CAACT,kBAAkB,IAAE,CAAC,eACtBS,IAAA,CAACV,uBAAuB;QAACkB,UAAU,EAAEA,UAAW;QAACe,OAAO,EAAElB,KAAK,CAACmB,MAAM,CAACC;MAAa,CAAE,CAAC;IAAA,CAC1E,CAChB;EAAA,CACY,CAAC;AAEpB,CAAC;AAED,MAAMX,MAAM,GAAG9B,UAAU,CAAC0C,MAAM,CAAC;EAC/BX,SAAS,EAAE;IACTY,UAAU,EAAE,QAAQ;IACpBC,OAAO,EAAE,CAAC;IACVC,aAAa,EAAE,CAAC;IAChBC,eAAe,EAAE1C,MAAM,CAAC2C,SAAS;IACjCC,YAAY,EAAE,EAAE;IAChBC,SAAS,EAAE,sEAAsE;IACjFC,QAAQ,EAAE;EACZ,CAAC;EACDd,KAAK,EAAE;IACLe,SAAS,EAAE9C,OAAO,CAAC,GAAG;EACxB,CAAC;EACD8B,iBAAiB,EAAE;IACjBQ,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ import React, { useMemo } from 'react';
4
+ import { Button, ButtonColor, ButtonSize, ButtonVariant, IS_WEB } from '@magmamath/react-native-ui';
5
+ import { Pressable } from 'react-native';
6
+ import { MicrophoneIcon, CheckIcon } from '@magmamath/react-native-ui';
7
+ import { useUnit } from 'effector-react';
8
+ import { VoiceRecorderState } from "../../constants.js";
9
+ import { useText } from "../../../../shared/translation/index.js";
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ export const VoiceRecordButton = ({
12
+ style,
13
+ model
14
+ }) => {
15
+ const t = useText();
16
+ const availableInputs = useUnit(model.recorderModel.$availableInputs);
17
+ const voiceRecordState = useUnit(model.recorderModel.$voiceRecordState);
18
+ const isButtonDisabled = useUnit(model.$isButtonDisabled);
19
+ const isInitializing = useUnit(model.initializeRecording.pending);
20
+ const combinedStyles = useMemo(() => {
21
+ return {
22
+ button: [{
23
+ width: 50,
24
+ height: 50
25
+ }, style?.button],
26
+ container: [style?.container],
27
+ text: [style?.text]
28
+ };
29
+ }, [style]);
30
+ return /*#__PURE__*/_jsx(Pressable, {
31
+ onPressIn: e => {
32
+ if (availableInputs.length) return;
33
+ e.preventDefault();
34
+ model.notification.warning(t('voice.noMicrophoneFound'));
35
+ },
36
+ pointerEvents: !availableInputs.length || isInitializing ? 'box-only' : 'auto',
37
+ children: /*#__PURE__*/_jsx(Button, {
38
+ disabled: isButtonDisabled || !availableInputs.length,
39
+ onPressIn: () => model.recorderButtonHandler(),
40
+ style: combinedStyles,
41
+ size: ButtonSize.LARGE,
42
+ variant: ButtonVariant.SECONDARY,
43
+ colorScheme: ButtonColor.WHITE,
44
+ icon: voiceRecordState === VoiceRecorderState.RECORDING ? /*#__PURE__*/_jsx(CheckIcon, {
45
+ size: 25
46
+ }) : /*#__PURE__*/_jsx(MicrophoneIcon, {
47
+ style: IS_WEB ? {
48
+ width: 19
49
+ } : {
50
+ minWidth: 23,
51
+ minHeight: 23
52
+ }
53
+ })
54
+ })
55
+ });
56
+ };
57
+ //# sourceMappingURL=VoiceRecordButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useMemo","Button","ButtonColor","ButtonSize","ButtonVariant","IS_WEB","Pressable","MicrophoneIcon","CheckIcon","useUnit","VoiceRecorderState","useText","jsx","_jsx","VoiceRecordButton","style","model","t","availableInputs","recorderModel","$availableInputs","voiceRecordState","$voiceRecordState","isButtonDisabled","$isButtonDisabled","isInitializing","initializeRecording","pending","combinedStyles","button","width","height","container","text","onPressIn","e","length","preventDefault","notification","warning","pointerEvents","children","disabled","recorderButtonHandler","size","LARGE","variant","SECONDARY","colorScheme","WHITE","icon","RECORDING","minWidth","minHeight"],"sourceRo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IAAIjB,eAAe,CAACkB,MAAM,EAAE;MAC5BD,CAAC,CAACE,cAAc,CAAC,CAAC;MAClBrB,KAAK,CAACsB,YAAY,CAACC,OAAO,CAACtB,CAAC,CAAC,yBAAyB,CAAC,CAAC;IAC1D,CAAE;IACFuB,aAAa,EAAE,CAACtB,eAAe,CAACkB,MAAM,IAAIX,cAAc,GAAG,UAAU,GAAG,MAAO;IAAAgB,QAAA,eAE/E5B,IAAA,CAACZ,MAAM;MACLyC,QAAQ,EAAEnB,gBAAgB,IAAI,CAACL,eAAe,CAACkB,MAAO;MACtDF,SAAS,EAAEA,CAAA,KAAMlB,KAAK,CAAC2B,qBAAqB,CAAC,CAAE;MAC/C5B,KAAK,EAAEa,cAAe;MACtBgB,IAAI,EAAEzC,UAAU,CAAC0C,KAAM;MACvBC,OAAO,EAAE1C,aAAa,CAAC2C,SAAU;MACjCC,WAAW,EAAE9C,WAAW,CAAC+C,KAAM;MAC/BC,IAAI,EACF7B,gBAAgB,KAAKX,kBAAkB,CAACyC,SAAS,gBAC/CtC,IAAA,CAACL,SAAS;QAACoC,IAAI,EAAE;MAAG,CAAE,CAAC,gBAEvB/B,IAAA,CAACN,cAAc;QAACQ,KAAK,EAAEV,MAAM,GAAG;UAAEyB,KAAK,EAAE;QAAG,CAAC,GAAG;UAAEsB,QAAQ,EAAE,EAAE;UAAEC,SAAS,EAAE;QAAG;MAAE,CAAE;IAErF,CACF;EAAC,CACO,CAAC;AAEhB,CAAC","ignoreList":[]}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ import { StyleSheet, TouchableOpacity } from 'react-native';
4
+ import { COLORS, TrashcanIcon } from '@magmamath/react-native-ui';
5
+ import React from 'react';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ export const VoiceRecordDeleteButton = ({
8
+ onPress,
9
+ isDisabled
10
+ }) => {
11
+ return /*#__PURE__*/_jsx(TouchableOpacity, {
12
+ style: styles.container,
13
+ onPress: onPress,
14
+ disabled: isDisabled,
15
+ children: /*#__PURE__*/_jsx(TrashcanIcon, {
16
+ size: 20,
17
+ color: isDisabled ? COLORS.NEUTRAL_5 : COLORS.NEUTRAL_9
18
+ })
19
+ });
20
+ };
21
+ const styles = StyleSheet.create({
22
+ container: {
23
+ width: 36,
24
+ height: 36,
25
+ alignItems: 'center',
26
+ justifyContent: 'center'
27
+ }
28
+ });
29
+ //# sourceMappingURL=VoiceRecordDeleteButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["StyleSheet","TouchableOpacity","COLORS","TrashcanIcon","React","jsx","_jsx","VoiceRecordDeleteButton","onPress","isDisabled","style","styles","container","disabled","children","size","color","NEUTRAL_5","NEUTRAL_9","create","width","height","alignItems","justifyContent"],"sourceRoot":"../../../../../../src","sources":["features/voice/recording/components/VoiceRecordDeleteButton.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,gBAAgB,QAAQ,cAAc;AAC3D,SAASC,MAAM,EAAEC,YAAY,QAAQ,4BAA4B;AACjE,OAAOC,KAAK,MAAM,OAAO;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAOzB,OAAO,MAAMC,uBAAuB,GAAGA,CAAC;EAAEC,OAAO;EAAEC;AAAmC,CAAC,KAAK;EAC1F,oBACEH,IAAA,CAACL,gBAAgB;IAACS,KAAK,EAAEC,MAAM,CAACC,SAAU;IAACJ,OAAO,EAAEA,OAAQ;IAACK,QAAQ,EAAEJ,UAAW;IAAAK,QAAA,eAChFR,IAAA,CAACH,YAAY;MAACY,IAAI,EAAE,EAAG;MAACC,KAAK,EAAEP,UAAU,GAAGP,MAAM,CAACe,SAAS,GAAGf,MAAM,CAACgB;IAAU,CAAE;EAAC,CACnE,CAAC;AAEvB,CAAC;AAED,MAAMP,MAAM,GAAGX,UAAU,CAACmB,MAAM,CAAC;EAC/BP,SAAS,EAAE;IACTQ,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ import { StyleSheet, View } from 'react-native';
4
+ import React from 'react';
5
+ import { COLORS } from '@magmamath/react-native-ui';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ export const VoiceRecordDivider = () => {
8
+ return /*#__PURE__*/_jsx(View, {
9
+ style: styles.container
10
+ });
11
+ };
12
+ const styles = StyleSheet.create({
13
+ container: {
14
+ height: 1,
15
+ borderRadius: 1,
16
+ width: 28,
17
+ margin: 8,
18
+ backgroundColor: COLORS.NEUTRAL_6
19
+ }
20
+ });
21
+ //# sourceMappingURL=VoiceRecordDivider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["StyleSheet","View","React","COLORS","jsx","_jsx","VoiceRecordDivider","style","styles","container","create","height","borderRadius","width","margin","backgroundColor","NEUTRAL_6"],"sourceRoot":"../../../../../../src","sources":["features/voice/recording/components/VoiceRecordDivider.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,QAAQ,4BAA4B;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAEnD,OAAO,MAAMC,kBAAkB,GAAGA,CAAA,KAAM;EACtC,oBAAOD,IAAA,CAACJ,IAAI;IAACM,KAAK,EAAEC,MAAM,CAACC;EAAU,CAAE,CAAC;AAC1C,CAAC;AAED,MAAMD,MAAM,GAAGR,UAAU,CAACU,MAAM,CAAC;EAC/BD,SAAS,EAAE;IACTE,MAAM,EAAE,CAAC;IACTC,YAAY,EAAE,CAAC;IACfC,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,CAAC;IACTC,eAAe,EAAEZ,MAAM,CAACa;EAC1B;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ import { StyleSheet, View } from 'react-native';
4
+ import { COLORS, Typography } from '@magmamath/react-native-ui';
5
+ import React from 'react';
6
+ import { useUnit } from 'effector-react';
7
+ import { formatDuration } from "../../helpers.js";
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ export const VoiceRecordTimer = ({
10
+ style,
11
+ model,
12
+ recordingFileDurationMs
13
+ }) => {
14
+ const savedAudioFileDurationMs = useUnit(model.$currentRecord)?.durationMs || 0;
15
+ const displayDurationMs = recordingFileDurationMs || savedAudioFileDurationMs;
16
+ return /*#__PURE__*/_jsx(View, {
17
+ style: [styles.container, style],
18
+ children: /*#__PURE__*/_jsx(Typography, {
19
+ variant: "h9",
20
+ style: styles.text,
21
+ children: displayDurationMs ? formatDuration(displayDurationMs) : '0:00'
22
+ })
23
+ });
24
+ };
25
+ const styles = StyleSheet.create({
26
+ container: {
27
+ backgroundColor: COLORS.NEUTRAL_1,
28
+ paddingHorizontal: 8,
29
+ paddingVertical: 2,
30
+ alignItems: 'center',
31
+ borderWidth: 0.5,
32
+ borderColor: COLORS.NEUTRAL_4,
33
+ borderRadius: 18,
34
+ minWidth: 45
35
+ },
36
+ text: {
37
+ color: COLORS.NEUTRAL_10,
38
+ fontSize: 13,
39
+ fontWeight: '600',
40
+ lineHeight: 18,
41
+ textTransform: 'uppercase'
42
+ }
43
+ });
44
+ //# sourceMappingURL=VoiceRecordTimer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["StyleSheet","View","COLORS","Typography","React","useUnit","formatDuration","jsx","_jsx","VoiceRecordTimer","style","model","recordingFileDurationMs","savedAudioFileDurationMs","$currentRecord","durationMs","displayDurationMs","styles","container","children","variant","text","create","backgroundColor","NEUTRAL_1","paddingHorizontal","paddingVertical","alignItems","borderWidth","borderColor","NEUTRAL_4","borderRadius","minWidth","color","NEUTRAL_10","fontSize","fontWeight","lineHeight","textTransform"],"sourceRoot":"../../../../../../src","sources":["features/voice/recording/components/VoiceRecordTimer.tsx"],"mappings":";;AAAA,SAAoBA,UAAU,EAAEC,IAAI,QAAmB,cAAc;AACrE,SAASC,MAA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
+ "use strict";
2
+
3
+ import { RecordingPresets, useAudioRecorder, useAudioRecorderState } from 'expo-audio';
4
+ import { useEffect } from 'react';
5
+ import { IS_WEB } from '@magmamath/react-native-ui';
6
+ import { VOICE_RECORDER_MAX_DURATION_MS, VoiceRecorderState } from "../../constants.js";
7
+ import { addAudioInputsListenerWeb, getAvailableInputs } from "../../helpers.js";
8
+ export const useVoiceRecorder = model => {
9
+ const recorder = useAudioRecorder(RecordingPresets.LOW_QUALITY, model.recordingStatusUpdate);
10
+ const recorderState = useAudioRecorderState(recorder);
11
+ useEffect(() => {
12
+ if (recorderState.durationMillis >= VOICE_RECORDER_MAX_DURATION_MS && recorderState.isRecording) {
13
+ model.recorderModel.stop();
14
+ }
15
+ // Track the last known duration while recording (for old browsers where getAudioDurationMs returns Infinity)
16
+ if (recorderState.isRecording && recorderState.durationMillis > 0) {
17
+ model.recorderModel.setLastKnownDurationMs(recorderState.durationMillis);
18
+ }
19
+ }, [recorderState.durationMillis]);
20
+ useEffect(() => {
21
+ if (!IS_WEB) {
22
+ //only once for iPad and listener for WEB
23
+ getAvailableInputs(recorder).then(inputs => {
24
+ model.recorderModel.setAvailableInputs(inputs);
25
+ });
26
+ return;
27
+ }
28
+ const removeListener = addAudioInputsListenerWeb(devices => {
29
+ model.recorderModel.setAvailableInputs(devices);
30
+ });
31
+ return removeListener;
32
+ }, [recorder, model.recorderModel]);
33
+ useEffect(() => {
34
+ if (recorderState.isRecording) {
35
+ model.recorderModel.setVoiceRecordState(VoiceRecorderState.RECORDING);
36
+ return;
37
+ }
38
+ if (recorderState.durationMillis > 0) {
39
+ model.recorderModel.setVoiceRecordState(VoiceRecorderState.PAUSED);
40
+ return;
41
+ }
42
+ model.recorderModel.setVoiceRecordState(VoiceRecorderState.IDLE);
43
+ return () => {
44
+ model.recorderModel.reset();
45
+ };
46
+ }, [recorderState, model.recorderModel]);
47
+ useEffect(() => {
48
+ model.recorderModel.recorder = recorder;
49
+ }, [recorder]);
50
+ return {
51
+ recorderState
52
+ };
53
+ };
54
+ //# sourceMappingURL=useVoiceRecorder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["RecordingPresets","useAudioRecorder","useAudioRecorderState","useEffect","IS_WEB","VOICE_RECORDER_MAX_DURATION_MS","VoiceRecorderState","addAudioInputsListenerWeb","getAvailableInputs","useVoiceRecorder","model","recorder","LOW_QUALITY","recordingStatusUpdate","recorderState","durationMillis","isRecording","recorderModel","stop","setLastKnownDurationMs","then","inputs","setAvailableInputs","removeListener","devices","setVoiceRecordState","RECORDING","PAUSED","IDLE","reset"],"sourceRoot":"../../../../../../src","sources":["features/voice/recording/hooks/useVoiceRecorder.ts"],"mappings":";;AAAA,SAASA,gBAAgB,EAAEC,gBAAgB,EAAEC,qBAAqB,QAAQ,YAAY;AAEtF,SAASC,SAAS,QAAQ,OAAO;AACjC,SAASC,MAAM,QAAQ,4BAA4B;AACnD,SAASC,8BAA8B,EAAEC,kBAAkB,QAAQ,oBAAiB;AACpF,SAASC,yBAAyB,EAAEC,kBAAkB,QAAQ,kBAAe;AAE7E,OAAO,MAAMC,gBAAgB,GAAIC,KAAuB,IAAK;EAC3D,MAAMC,QAAQ,GAAGV,gBAAgB,CAACD,gBAAgB,CAACY,WAAW,EAAEF,KAAK,CAACG,qBAAqB,CAAC;EAC5F,MAAMC,aAAa,GAAGZ,qBAAqB,CAACS,QAAQ,CAAC;EAErDR,SAAS,CAAC,MAAM;IACd,IACEW,aAAa,CAACC,cAAc,IAAIV,8BAA8B,IAC9DS,aAAa,CAACE,WAAW,EACzB;MACAN,KAAK,CAACO,aAAa,CAACC,IAAI,CAAC,CAAC;IAC5B;IACA;IACA,IAAIJ,aAAa,CAACE,WAAW,IAAIF,aAAa,CAACC,cAAc,GAAG,CAAC,EAAE;MACjEL,KAAK,CAACO,aAAa,CAACE,sBAAsB,CAACL,aAAa,CAACC,cAAc,CAAC;IAC1E;EACF,CAAC,EAAE,CAACD,aAAa,CAACC,cAAc,CAAC,CAAC;EAElCZ,SAAS,CAAC,MAAM;IACd,IAAI,CAACC,MAAM,EAAE;MACX;MACAI,kBAAkB,CAACG,QAAQ,CAAC,CAACS,IAAI,CAAEC,MAAM,IAAK;QAC5CX,KAAK,CAACO,aAAa,CAACK,kBAAkB,CAACD,MAAM,CAAC;MAChD,CAAC,CAAC;MACF;IACF;IAEA,MAAME,cAAc,GAAGhB,yBAAyB,CAAEiB,OAAO,IAAK;MAC5Dd,KAAK,CAACO,aAAa,CAACK,kBAAkB,CAACE,OAAO,CAAC;IACjD,CAAC,CAAC;IAEF,OAAOD,cAAc;EACvB,CAAC,EAAE,CAACZ,QAAQ,EAAED,KAAK,CAACO,aAAa,CAAC,CAAC;EAEnCd,SAAS,CAAC,MAAM;IACd,IAAIW,aAAa,CAACE,WAAW,EAAE;MAC7BN,KAAK,CAACO,aAAa,CAACQ,mBAAmB,CAACnB,kBAAkB,CAACoB,SAAS,CAAC;MACrE;IACF;IACA,IAAIZ,aAAa,CAACC,cAAc,GAAG,CAAC,EAAE;MACpCL,KAAK,CAACO,aAAa,CAACQ,mBAAmB,CAACnB,kBAAkB,CAACqB,MAAM,CAAC;MAClE;IACF;IACAjB,KAAK,CAACO,aAAa,CAACQ,mBAAmB,CAACnB,kBAAkB,CAACsB,IAAI,CAAC;IAEhE,OAAO,MAAM;MACXlB,KAAK,CAACO,aAAa,CAACY,KAAK,CAAC,CAAC;IAC7B,CAAC;EACH,CAAC,EAAE,CAACf,aAAa,EAAEJ,KAAK,CAACO,aAAa,CAAC,CAAC;EAExCd,SAAS,CAAC,MAAM;IACdO,KAAK,CAACO,aAAa,CAACN,QAAQ,GAAGA,QAAQ;EACzC,CAAC,EAAE,CAACA,QAAQ,CAAC,CAAC;EAEd,OAAO;IAAEG;EAAc,CAAC;AAC1B,CAAC","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ import { useAnimatedStyle, withTiming } from 'react-native-reanimated';
4
+ import { VOICE_RECORDER_CONTAINER_SIZES } from "../../constants.js";
5
+ export const useVoiceRecorderAnimation = isExpanded => {
6
+ const containerAnimatedStyle = useAnimatedStyle(() => {
7
+ return {
8
+ height: withTiming(isExpanded ? VOICE_RECORDER_CONTAINER_SIZES.EXPANDED : VOICE_RECORDER_CONTAINER_SIZES.COLLAPSED, {
9
+ duration: 280
10
+ })
11
+ };
12
+ }, [isExpanded]);
13
+ return {
14
+ containerAnimatedStyle
15
+ };
16
+ };
17
+ //# sourceMappingURL=useVoiceRecorderAnimation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useAnimatedStyle","withTiming","VOICE_RECORDER_CONTAINER_SIZES","useVoiceRecorderAnimation","isExpanded","containerAnimatedStyle","height","EXPANDED","COLLAPSED","duration"],"sourceRoot":"../../../../../../src","sources":["features/voice/recording/hooks/useVoiceRecorderAnimation.ts"],"mappings":";;AAAA,SAASA,gBAAgB,EAAEC,UAAU,QAAQ,yBAAyB;AACtE,SAASC,8BAA8B,QAAQ,oBAAiB;AAEhE,OAAO,MAAMC,yBAAyB,GAAIC,UAAmB,IAAK;EAChE,MAAMC,sBAAsB,GAAGL,gBAAgB,CAAC,MAAM;IACpD,OAAO;MACLM,MAAM,EAAEL,UAAU,CAChBG,UAAU,GACNF,8BAA8B,CAACK,QAAQ,GACvCL,8BAA8B,CAACM,SAAS,EAC5C;QACEC,QAAQ,EAAE;MACZ,CACF;IACF,CAAC;EACH,CAAC,EAAE,CAACL,UAAU,CAAC,CAAC;EAEhB,OAAO;IAAEC;EAAuB,CAAC;AACnC,CAAC","ignoreList":[]}