@magmamath/students-features 0.9.107-rc.2 → 0.9.107-rc.21

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 (242) hide show
  1. package/dist/commonjs/features/chatbot/components/Chat/Chat.js +29 -18
  2. package/dist/commonjs/features/chatbot/components/Chat/Chat.js.map +1 -1
  3. package/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js +7 -2
  4. package/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js.map +1 -1
  5. package/dist/commonjs/features/chatbot/components/Chatbot.js +14 -3
  6. package/dist/commonjs/features/chatbot/components/Chatbot.js.map +1 -1
  7. package/dist/commonjs/features/chatbot/model/ChatBotModel.js +11 -2
  8. package/dist/commonjs/features/chatbot/model/ChatBotModel.js.map +1 -1
  9. package/dist/commonjs/features/chatbot/model/ChatsCacheModel.js.map +1 -1
  10. package/dist/commonjs/features/chatbot/types/model.types.js.map +1 -1
  11. package/dist/commonjs/features/voiceRecord/components/VoiceRecord.js +25 -17
  12. package/dist/commonjs/features/voiceRecord/components/VoiceRecord.js.map +1 -1
  13. package/dist/commonjs/features/voiceRecord/components/VoiceRecordButton.js +22 -8
  14. package/dist/commonjs/features/voiceRecord/components/VoiceRecordButton.js.map +1 -1
  15. package/dist/commonjs/features/voiceRecord/components/{VoiceRecordDelete.js → VoiceRecordDeleteButton.js} +9 -6
  16. package/dist/commonjs/features/voiceRecord/components/VoiceRecordDeleteButton.js.map +1 -0
  17. package/dist/commonjs/features/voiceRecord/components/VoiceRecordTimer.js +7 -2
  18. package/dist/commonjs/features/voiceRecord/components/VoiceRecordTimer.js.map +1 -1
  19. package/dist/commonjs/features/voiceRecord/constants.js +8 -1
  20. package/dist/commonjs/features/voiceRecord/constants.js.map +1 -1
  21. package/dist/commonjs/features/voiceRecord/helpers.js +89 -3
  22. package/dist/commonjs/features/voiceRecord/helpers.js.map +1 -1
  23. package/dist/commonjs/features/voiceRecord/hooks/useVoiceRecorder.js +45 -33
  24. package/dist/commonjs/features/voiceRecord/hooks/useVoiceRecorder.js.map +1 -1
  25. package/dist/commonjs/features/voiceRecord/hooks/useVoiceRecorderAnimation.js +3 -3
  26. package/dist/commonjs/features/voiceRecord/hooks/useVoiceRecorderAnimation.js.map +1 -1
  27. package/dist/commonjs/features/voiceRecord/index.js +44 -0
  28. package/dist/commonjs/features/voiceRecord/index.js.map +1 -1
  29. package/dist/commonjs/features/voiceRecord/modal/VoiceRecordDeleteModal.js +93 -0
  30. package/dist/commonjs/features/voiceRecord/modal/VoiceRecordDeleteModal.js.map +1 -0
  31. package/dist/commonjs/features/voiceRecord/modal/VoiceRecordUndoModal.js +75 -0
  32. package/dist/commonjs/features/voiceRecord/modal/VoiceRecordUndoModal.js.map +1 -0
  33. package/dist/commonjs/features/voiceRecord/model/Recorder.model.js +54 -0
  34. package/dist/commonjs/features/voiceRecord/model/Recorder.model.js.map +1 -0
  35. package/dist/commonjs/features/voiceRecord/model/VoiceRecord.model.js +162 -21
  36. package/dist/commonjs/features/voiceRecord/model/VoiceRecord.model.js.map +1 -1
  37. package/dist/commonjs/features/voiceRecord/model/VoiceRecordApi.js +21 -1
  38. package/dist/commonjs/features/voiceRecord/model/VoiceRecordApi.js.map +1 -1
  39. package/dist/commonjs/features/voiceRecord/model/VoiceRecordCollection.js +30 -0
  40. package/dist/commonjs/features/voiceRecord/model/VoiceRecordCollection.js.map +1 -0
  41. package/dist/commonjs/features/voiceRecord/types.js +6 -0
  42. package/dist/commonjs/features/voiceRecord/types.js.map +1 -0
  43. package/dist/commonjs/lib/components/ConditionalWrapper.js +23 -0
  44. package/dist/commonjs/lib/components/ConditionalWrapper.js.map +1 -0
  45. package/dist/commonjs/shared/translation/localization/ca.json +13 -0
  46. package/dist/commonjs/shared/translation/localization/de.json +13 -0
  47. package/dist/commonjs/shared/translation/localization/en.json +13 -0
  48. package/dist/commonjs/shared/translation/localization/gb.json +13 -0
  49. package/dist/commonjs/shared/translation/localization/sct.json +13 -0
  50. package/dist/commonjs/shared/translation/localization/sw.json +13 -0
  51. package/dist/module/features/chatbot/components/Chat/Chat.js +29 -18
  52. package/dist/module/features/chatbot/components/Chat/Chat.js.map +1 -1
  53. package/dist/module/features/chatbot/components/ChatControls/ChatControls.js +5 -2
  54. package/dist/module/features/chatbot/components/ChatControls/ChatControls.js.map +1 -1
  55. package/dist/module/features/chatbot/components/Chatbot.js +14 -3
  56. package/dist/module/features/chatbot/components/Chatbot.js.map +1 -1
  57. package/dist/module/features/chatbot/model/ChatBotModel.js +11 -2
  58. package/dist/module/features/chatbot/model/ChatBotModel.js.map +1 -1
  59. package/dist/module/features/chatbot/model/ChatsCacheModel.js.map +1 -1
  60. package/dist/module/features/chatbot/types/model.types.js.map +1 -1
  61. package/dist/module/features/voiceRecord/components/VoiceRecord.js +24 -16
  62. package/dist/module/features/voiceRecord/components/VoiceRecord.js.map +1 -1
  63. package/dist/module/features/voiceRecord/components/VoiceRecordButton.js +22 -8
  64. package/dist/module/features/voiceRecord/components/VoiceRecordButton.js.map +1 -1
  65. package/dist/module/features/voiceRecord/components/{VoiceRecordDelete.js → VoiceRecordDeleteButton.js} +8 -5
  66. package/dist/module/features/voiceRecord/components/VoiceRecordDeleteButton.js.map +1 -0
  67. package/dist/module/features/voiceRecord/components/VoiceRecordTimer.js +7 -2
  68. package/dist/module/features/voiceRecord/components/VoiceRecordTimer.js.map +1 -1
  69. package/dist/module/features/voiceRecord/constants.js +7 -0
  70. package/dist/module/features/voiceRecord/constants.js.map +1 -1
  71. package/dist/module/features/voiceRecord/helpers.js +84 -2
  72. package/dist/module/features/voiceRecord/helpers.js.map +1 -1
  73. package/dist/module/features/voiceRecord/hooks/useVoiceRecorder.js +47 -35
  74. package/dist/module/features/voiceRecord/hooks/useVoiceRecorder.js.map +1 -1
  75. package/dist/module/features/voiceRecord/hooks/useVoiceRecorderAnimation.js +3 -3
  76. package/dist/module/features/voiceRecord/hooks/useVoiceRecorderAnimation.js.map +1 -1
  77. package/dist/module/features/voiceRecord/index.js +4 -0
  78. package/dist/module/features/voiceRecord/index.js.map +1 -1
  79. package/dist/module/features/voiceRecord/modal/VoiceRecordDeleteModal.js +86 -0
  80. package/dist/module/features/voiceRecord/modal/VoiceRecordDeleteModal.js.map +1 -0
  81. package/dist/module/features/voiceRecord/modal/VoiceRecordUndoModal.js +69 -0
  82. package/dist/module/features/voiceRecord/modal/VoiceRecordUndoModal.js.map +1 -0
  83. package/dist/module/features/voiceRecord/model/Recorder.model.js +49 -0
  84. package/dist/module/features/voiceRecord/model/Recorder.model.js.map +1 -0
  85. package/dist/module/features/voiceRecord/model/VoiceRecord.model.js +163 -22
  86. package/dist/module/features/voiceRecord/model/VoiceRecord.model.js.map +1 -1
  87. package/dist/module/features/voiceRecord/model/VoiceRecordApi.js +21 -1
  88. package/dist/module/features/voiceRecord/model/VoiceRecordApi.js.map +1 -1
  89. package/dist/module/features/voiceRecord/model/VoiceRecordCollection.js +25 -0
  90. package/dist/module/features/voiceRecord/model/VoiceRecordCollection.js.map +1 -0
  91. package/dist/module/features/voiceRecord/types.js +4 -0
  92. package/dist/module/features/voiceRecord/types.js.map +1 -0
  93. package/dist/module/lib/components/ConditionalWrapper.js +17 -0
  94. package/dist/module/lib/components/ConditionalWrapper.js.map +1 -0
  95. package/dist/module/shared/translation/localization/ca.json +13 -0
  96. package/dist/module/shared/translation/localization/de.json +13 -0
  97. package/dist/module/shared/translation/localization/en.json +13 -0
  98. package/dist/module/shared/translation/localization/gb.json +13 -0
  99. package/dist/module/shared/translation/localization/sct.json +13 -0
  100. package/dist/module/shared/translation/localization/sw.json +13 -0
  101. package/dist/typescript/commonjs/features/chatbot/components/Chat/Chat.d.ts +4 -2
  102. package/dist/typescript/commonjs/features/chatbot/components/Chat/Chat.d.ts.map +1 -1
  103. package/dist/typescript/commonjs/features/chatbot/components/ChatControls/ChatControls.d.ts +2 -1
  104. package/dist/typescript/commonjs/features/chatbot/components/ChatControls/ChatControls.d.ts.map +1 -1
  105. package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts +2 -1
  106. package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts.map +1 -1
  107. package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts +1 -0
  108. package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
  109. package/dist/typescript/commonjs/features/chatbot/model/ChatsCacheModel.d.ts.map +1 -1
  110. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts +1 -0
  111. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts.map +1 -1
  112. package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts +1 -0
  113. package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts.map +1 -1
  114. package/dist/typescript/commonjs/features/voiceRecord/components/VoiceRecord.d.ts.map +1 -1
  115. package/dist/typescript/commonjs/features/voiceRecord/components/VoiceRecordButton.d.ts +1 -5
  116. package/dist/typescript/commonjs/features/voiceRecord/components/VoiceRecordButton.d.ts.map +1 -1
  117. package/dist/typescript/commonjs/features/voiceRecord/components/VoiceRecordDeleteButton.d.ts +8 -0
  118. package/dist/typescript/commonjs/features/voiceRecord/components/VoiceRecordDeleteButton.d.ts.map +1 -0
  119. package/dist/typescript/commonjs/features/voiceRecord/components/VoiceRecordTimer.d.ts +4 -2
  120. package/dist/typescript/commonjs/features/voiceRecord/components/VoiceRecordTimer.d.ts.map +1 -1
  121. package/dist/typescript/commonjs/features/voiceRecord/constants.d.ts +6 -0
  122. package/dist/typescript/commonjs/features/voiceRecord/constants.d.ts.map +1 -1
  123. package/dist/typescript/commonjs/features/voiceRecord/helpers.d.ts +26 -2
  124. package/dist/typescript/commonjs/features/voiceRecord/helpers.d.ts.map +1 -1
  125. package/dist/typescript/commonjs/features/voiceRecord/hooks/useVoiceRecorder.d.ts +0 -4
  126. package/dist/typescript/commonjs/features/voiceRecord/hooks/useVoiceRecorder.d.ts.map +1 -1
  127. package/dist/typescript/commonjs/features/voiceRecord/hooks/useVoiceRecorderAnimation.d.ts +1 -2
  128. package/dist/typescript/commonjs/features/voiceRecord/hooks/useVoiceRecorderAnimation.d.ts.map +1 -1
  129. package/dist/typescript/commonjs/features/voiceRecord/index.d.ts +4 -0
  130. package/dist/typescript/commonjs/features/voiceRecord/index.d.ts.map +1 -1
  131. package/dist/typescript/commonjs/features/voiceRecord/modal/VoiceRecordDeleteModal.d.ts +13 -0
  132. package/dist/typescript/commonjs/features/voiceRecord/modal/VoiceRecordDeleteModal.d.ts.map +1 -0
  133. package/dist/typescript/commonjs/features/voiceRecord/modal/VoiceRecordUndoModal.d.ts +13 -0
  134. package/dist/typescript/commonjs/features/voiceRecord/modal/VoiceRecordUndoModal.d.ts.map +1 -0
  135. package/dist/typescript/commonjs/features/voiceRecord/model/Recorder.model.d.ts +20 -0
  136. package/dist/typescript/commonjs/features/voiceRecord/model/Recorder.model.d.ts.map +1 -0
  137. package/dist/typescript/commonjs/features/voiceRecord/model/VoiceRecord.model.d.ts +38 -20
  138. package/dist/typescript/commonjs/features/voiceRecord/model/VoiceRecord.model.d.ts.map +1 -1
  139. package/dist/typescript/commonjs/features/voiceRecord/model/VoiceRecordApi.d.ts +2 -0
  140. package/dist/typescript/commonjs/features/voiceRecord/model/VoiceRecordApi.d.ts.map +1 -1
  141. package/dist/typescript/commonjs/features/voiceRecord/model/VoiceRecordCollection.d.ts +10 -0
  142. package/dist/typescript/commonjs/features/voiceRecord/model/VoiceRecordCollection.d.ts.map +1 -0
  143. package/dist/typescript/commonjs/features/voiceRecord/types.d.ts +43 -0
  144. package/dist/typescript/commonjs/features/voiceRecord/types.d.ts.map +1 -0
  145. package/dist/typescript/commonjs/lib/components/ConditionalWrapper.d.ts +9 -0
  146. package/dist/typescript/commonjs/lib/components/ConditionalWrapper.d.ts.map +1 -0
  147. package/dist/typescript/commonjs/shared/translation/constants.d.ts +78 -0
  148. package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
  149. package/dist/typescript/commonjs/shared/translation/model.d.ts +26 -0
  150. package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
  151. package/dist/typescript/commonjs/types/common.types.d.ts +3 -0
  152. package/dist/typescript/commonjs/types/common.types.d.ts.map +1 -1
  153. package/dist/typescript/module/features/chatbot/components/Chat/Chat.d.ts +4 -2
  154. package/dist/typescript/module/features/chatbot/components/Chat/Chat.d.ts.map +1 -1
  155. package/dist/typescript/module/features/chatbot/components/ChatControls/ChatControls.d.ts +2 -1
  156. package/dist/typescript/module/features/chatbot/components/ChatControls/ChatControls.d.ts.map +1 -1
  157. package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts +2 -1
  158. package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts.map +1 -1
  159. package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts +1 -0
  160. package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
  161. package/dist/typescript/module/features/chatbot/model/ChatsCacheModel.d.ts.map +1 -1
  162. package/dist/typescript/module/features/chatbot/types/api.types.d.ts +1 -0
  163. package/dist/typescript/module/features/chatbot/types/api.types.d.ts.map +1 -1
  164. package/dist/typescript/module/features/chatbot/types/model.types.d.ts +1 -0
  165. package/dist/typescript/module/features/chatbot/types/model.types.d.ts.map +1 -1
  166. package/dist/typescript/module/features/voiceRecord/components/VoiceRecord.d.ts.map +1 -1
  167. package/dist/typescript/module/features/voiceRecord/components/VoiceRecordButton.d.ts +1 -5
  168. package/dist/typescript/module/features/voiceRecord/components/VoiceRecordButton.d.ts.map +1 -1
  169. package/dist/typescript/module/features/voiceRecord/components/VoiceRecordDeleteButton.d.ts +8 -0
  170. package/dist/typescript/module/features/voiceRecord/components/VoiceRecordDeleteButton.d.ts.map +1 -0
  171. package/dist/typescript/module/features/voiceRecord/components/VoiceRecordTimer.d.ts +4 -2
  172. package/dist/typescript/module/features/voiceRecord/components/VoiceRecordTimer.d.ts.map +1 -1
  173. package/dist/typescript/module/features/voiceRecord/constants.d.ts +6 -0
  174. package/dist/typescript/module/features/voiceRecord/constants.d.ts.map +1 -1
  175. package/dist/typescript/module/features/voiceRecord/helpers.d.ts +26 -2
  176. package/dist/typescript/module/features/voiceRecord/helpers.d.ts.map +1 -1
  177. package/dist/typescript/module/features/voiceRecord/hooks/useVoiceRecorder.d.ts +0 -4
  178. package/dist/typescript/module/features/voiceRecord/hooks/useVoiceRecorder.d.ts.map +1 -1
  179. package/dist/typescript/module/features/voiceRecord/hooks/useVoiceRecorderAnimation.d.ts +1 -2
  180. package/dist/typescript/module/features/voiceRecord/hooks/useVoiceRecorderAnimation.d.ts.map +1 -1
  181. package/dist/typescript/module/features/voiceRecord/index.d.ts +4 -0
  182. package/dist/typescript/module/features/voiceRecord/index.d.ts.map +1 -1
  183. package/dist/typescript/module/features/voiceRecord/modal/VoiceRecordDeleteModal.d.ts +13 -0
  184. package/dist/typescript/module/features/voiceRecord/modal/VoiceRecordDeleteModal.d.ts.map +1 -0
  185. package/dist/typescript/module/features/voiceRecord/modal/VoiceRecordUndoModal.d.ts +13 -0
  186. package/dist/typescript/module/features/voiceRecord/modal/VoiceRecordUndoModal.d.ts.map +1 -0
  187. package/dist/typescript/module/features/voiceRecord/model/Recorder.model.d.ts +20 -0
  188. package/dist/typescript/module/features/voiceRecord/model/Recorder.model.d.ts.map +1 -0
  189. package/dist/typescript/module/features/voiceRecord/model/VoiceRecord.model.d.ts +38 -20
  190. package/dist/typescript/module/features/voiceRecord/model/VoiceRecord.model.d.ts.map +1 -1
  191. package/dist/typescript/module/features/voiceRecord/model/VoiceRecordApi.d.ts +2 -0
  192. package/dist/typescript/module/features/voiceRecord/model/VoiceRecordApi.d.ts.map +1 -1
  193. package/dist/typescript/module/features/voiceRecord/model/VoiceRecordCollection.d.ts +10 -0
  194. package/dist/typescript/module/features/voiceRecord/model/VoiceRecordCollection.d.ts.map +1 -0
  195. package/dist/typescript/module/features/voiceRecord/types.d.ts +43 -0
  196. package/dist/typescript/module/features/voiceRecord/types.d.ts.map +1 -0
  197. package/dist/typescript/module/lib/components/ConditionalWrapper.d.ts +9 -0
  198. package/dist/typescript/module/lib/components/ConditionalWrapper.d.ts.map +1 -0
  199. package/dist/typescript/module/shared/translation/constants.d.ts +78 -0
  200. package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
  201. package/dist/typescript/module/shared/translation/model.d.ts +26 -0
  202. package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
  203. package/dist/typescript/module/types/common.types.d.ts +3 -0
  204. package/dist/typescript/module/types/common.types.d.ts.map +1 -1
  205. package/package.json +3 -1
  206. package/src/features/chatbot/components/Chat/Chat.tsx +30 -19
  207. package/src/features/chatbot/components/ChatControls/ChatControls.tsx +9 -2
  208. package/src/features/chatbot/components/Chatbot.tsx +15 -2
  209. package/src/features/chatbot/model/ChatBotModel.ts +12 -3
  210. package/src/features/chatbot/model/ChatsCacheModel.ts +4 -0
  211. package/src/features/chatbot/types/api.types.ts +1 -0
  212. package/src/features/chatbot/types/model.types.ts +1 -0
  213. package/src/features/voiceRecord/components/VoiceRecord.tsx +29 -18
  214. package/src/features/voiceRecord/components/VoiceRecordButton.tsx +33 -17
  215. package/src/features/voiceRecord/components/{VoiceRecordDelete.tsx → VoiceRecordDeleteButton.tsx} +5 -4
  216. package/src/features/voiceRecord/components/VoiceRecordTimer.tsx +19 -3
  217. package/src/features/voiceRecord/constants.ts +6 -0
  218. package/src/features/voiceRecord/helpers.ts +115 -1
  219. package/src/features/voiceRecord/hooks/useVoiceRecorder.ts +50 -36
  220. package/src/features/voiceRecord/hooks/useVoiceRecorderAnimation.ts +3 -4
  221. package/src/features/voiceRecord/index.ts +4 -0
  222. package/src/features/voiceRecord/modal/VoiceRecordDeleteModal.tsx +105 -0
  223. package/src/features/voiceRecord/modal/VoiceRecordUndoModal.tsx +82 -0
  224. package/src/features/voiceRecord/model/Recorder.model.ts +62 -0
  225. package/src/features/voiceRecord/model/VoiceRecord.model.ts +193 -32
  226. package/src/features/voiceRecord/model/VoiceRecordApi.ts +25 -1
  227. package/src/features/voiceRecord/model/VoiceRecordCollection.ts +26 -0
  228. package/src/features/voiceRecord/types.ts +49 -0
  229. package/src/lib/components/ConditionalWrapper.tsx +15 -0
  230. package/src/shared/translation/localization/ca.json +13 -0
  231. package/src/shared/translation/localization/de.json +13 -0
  232. package/src/shared/translation/localization/en.json +13 -0
  233. package/src/shared/translation/localization/gb.json +13 -0
  234. package/src/shared/translation/localization/sct.json +13 -0
  235. package/src/shared/translation/localization/sw.json +13 -0
  236. package/src/types/common.types.ts +1 -0
  237. package/dist/commonjs/features/voiceRecord/components/VoiceRecordDelete.js.map +0 -1
  238. package/dist/module/features/voiceRecord/components/VoiceRecordDelete.js.map +0 -1
  239. package/dist/typescript/commonjs/features/voiceRecord/components/VoiceRecordDelete.d.ts +0 -7
  240. package/dist/typescript/commonjs/features/voiceRecord/components/VoiceRecordDelete.d.ts.map +0 -1
  241. package/dist/typescript/module/features/voiceRecord/components/VoiceRecordDelete.d.ts +0 -7
  242. package/dist/typescript/module/features/voiceRecord/components/VoiceRecordDelete.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNativeUi","_reactNative","_index","_jsxRuntime","e","__esModule","default","FooterButtons","onClose","onRedo","t","useText","jsxs","View","style","styles","footerContainer","children","jsx","Button","variant","ButtonVariant","TERTIARY","size","ButtonSize","LARGE","onPress","colorScheme","ButtonColor","BLUE","PRIMARY","VoiceRecordUndoModal","modal","closeModal","params","model","handleRedo","deleteCurrentRecording","notification","initializeRecording","BaseModal","container","modalStyle","header","content","footer","exports","StyleSheet","create","width","height","flexDirection","alignItems","gap","SPACING"],"sourceRoot":"../../../../../src","sources":["features/voiceRecord/modal/VoiceRecordUndoModal.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AAQA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;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CAAC;IACZE,KAAK,CAACI,mBAAmB,CAAC,CAAC;EAC7B,CAAC;EAED,oBACE,IAAApC,WAAA,CAAAe,GAAA,EAAClB,cAAA,CAAAwC,SAAS;IACR1B,KAAK,EAAE;MACL2B,SAAS,EAAE1B,MAAM,CAAC2B;IACpB,CAAE;IACFC,MAAM,EAAEjC,CAAC,CAAC,6BAA6B,CAAE;IACzCkC,OAAO,EAAElC,CAAC,CAAC,uCAAuC,CAAE;IACpDmC,MAAM,eAAE,IAAA1C,WAAA,CAAAe,GAAA,EAACX,aAAa;MAACC,OAAO,EAAEyB,UAAW;MAACxB,MAAM,EAAE2B;IAAW,CAAE;EAAE,CACpE,CAAC;AAEN,CAAC;AAAAU,OAAA,CAAAf,oBAAA,GAAAA,oBAAA;AAED,MAAMhB,MAAM,GAAGgC,uBAAU,CAACC,MAAM,CAAC;EAC/BN,UAAU,EAAE;IACVO,KAAK,EAAE,GAAG;IACVC,MAAM,EAAE;EACV,CAAC;EACDlC,eAAe,EAAE;IACfmC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,GAAG,EAAEC,sBAAO,CAAC,GAAG;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.RecorderModel = void 0;
7
+ var _effector = require("effector");
8
+ var _expoAudio = require("expo-audio");
9
+ var _constants = require("../constants.js");
10
+ const AUDIO_MODE_CONFIG = {
11
+ playsInSilentMode: true,
12
+ allowsRecording: true
13
+ };
14
+ class RecorderModel {
15
+ stopResolver = null;
16
+ reset = (0, _effector.createEvent)();
17
+ setAudioFileDurationMs = (0, _effector.createEvent)();
18
+ setVoiceRecordState = (0, _effector.createEvent)();
19
+ setAvailableInputs = (0, _effector.createEvent)();
20
+ $audioFileDurationMs = (0, _effector.restore)(this.setAudioFileDurationMs, 0).reset(this.reset);
21
+ $voiceRecordState = (0, _effector.restore)(this.setVoiceRecordState, _constants.VoiceRecorderState.IDLE).reset(this.reset);
22
+ $availableInputs = (0, _effector.restore)(this.setAvailableInputs, []);
23
+ start = (0, _effector.createEffect)(async () => {
24
+ try {
25
+ await (0, _expoAudio.setAudioModeAsync)(AUDIO_MODE_CONFIG);
26
+ await this.recorder.prepareToRecordAsync();
27
+ this.recorder.record();
28
+ } catch (error) {
29
+ console.error('Error starting recording:', error);
30
+ throw error;
31
+ }
32
+ });
33
+ stop = (0, _effector.createEffect)(() => {
34
+ if (!this.recorder.isRecording) return Promise.resolve();
35
+ return this.recorder.stop();
36
+ });
37
+ stopAndGetCollectionItem() {
38
+ return new Promise(resolve => {
39
+ this.stopResolver = resolve;
40
+ this.recorder.isRecording && this.recorder.stop();
41
+ });
42
+ }
43
+ resolveStopWithCollectionItem(item) {
44
+ if (this.stopResolver) {
45
+ this.stopResolver(item);
46
+ this.stopResolver = null;
47
+ }
48
+ }
49
+ clearStopResolver() {
50
+ this.stopResolver = null;
51
+ }
52
+ }
53
+ exports.RecorderModel = RecorderModel;
54
+ //# sourceMappingURL=Recorder.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_effector","require","_expoAudio","_constants","AUDIO_MODE_CONFIG","playsInSilentMode","allowsRecording","RecorderModel","stopResolver","reset","createEvent","setAudioFileDurationMs","setVoiceRecordState","setAvailableInputs","$audioFileDurationMs","restore","$voiceRecordState","VoiceRecorderState","IDLE","$availableInputs","start","createEffect","setAudioModeAsync","recorder","prepareToRecordAsync","record","error","console","stop","isRecording","Promise","resolve","stopAndGetCollectionItem","resolveStopWithCollectionItem","item","clearStopResolver","exports"],"sourceRoot":"../../../../../src","sources":["features/voiceRecord/model/Recorder.model.ts"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAGA,MAAMG,iBAAiB,GAAG;EACxBC,iBAAiB,EAAE,IAAI;EAC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AIF,OAAO,CAAEC,OAAO,IAAK;MAC9B,IAAI,CAACvB,YAAY,GAAGuB,OAAO;MAC3B,IAAI,CAACR,QAAQ,CAACM,WAAW,IAAI,IAAI,CAACN,QAAQ,CAACK,IAAI,CAAC,CAAC;IACnD,CAAC,CAAC;EACJ;EAEOK,6BAA6BA,CAACC,IAA+B,EAAQ;IAC1E,IAAI,IAAI,CAAC1B,YAAY,EAAE;MACrB,IAAI,CAACA,YAAY,CAAC0B,IAAI,CAAC;MACvB,IAAI,CAAC1B,YAAY,GAAG,IAAI;IAC1B;EACF;EAEO2B,iBAAiBA,CAAA,EAAS;IAC/B,IAAI,CAAC3B,YAAY,GAAG,IAAI;EAC1B;AACF;AAAC4B,OAAA,CAAA7B,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -5,33 +5,174 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.VoiceRecordModel = void 0;
7
7
  var _effector = require("effector");
8
+ var _helpers = require("../helpers.js");
9
+ var _index = require("../../../shared/translation/index.js");
10
+ var _RecorderModel = require("./Recorder.model.js");
11
+ var _VoiceRecordCollection = require("./VoiceRecordCollection.js");
8
12
  class VoiceRecordModel {
9
- startRecord = (0, _effector.createEvent)();
10
- stop = (0, _effector.createEvent)();
11
- deleteFile = (0, _effector.createEvent)();
12
- setAudioFilePath = (0, _effector.createEvent)();
13
- clearAudioFilePath = (0, _effector.createEvent)();
14
- $audioFilePath = (0, _effector.restore)(this.setAudioFilePath, '').reset(this.clearAudioFilePath);
15
- resetIsRecording = (0, _effector.createEvent)();
16
- setIsRecording = (0, _effector.createEvent)();
17
- $isRecording = (0, _effector.restore)(this.setIsRecording, false).reset(this.resetIsRecording);
18
- setAvailableInputs = (0, _effector.createEvent)();
19
- $availableInputs = (0, _effector.restore)(this.setAvailableInputs, []);
13
+ shouldDiscardRecording = false;
14
+ setCurrentKey = (0, _effector.createEvent)();
15
+ setCurrentRecord = (0, _effector.createEvent)();
16
+ reset = (0, _effector.createEvent)();
17
+ setIsDisabled = (0, _effector.createEvent)();
18
+ startAudioUpload = (0, _effector.createEvent)();
19
+ $currentKey = (0, _effector.restore)(this.setCurrentKey, '');
20
+ $currentRecord = (0, _effector.restore)(this.setCurrentRecord, null).reset(this.reset);
21
+ $isDisabled = (0, _effector.restore)(this.setIsDisabled, false);
22
+ deleteCurrentRecording = (0, _effector.attach)({
23
+ source: this.$currentKey,
24
+ mapParams: (props, currentKey) => ({
25
+ notification: true,
26
+ ...props,
27
+ currentKey
28
+ }),
29
+ effect: (0, _effector.createEffect)(({
30
+ currentKey,
31
+ notification
32
+ }) => {
33
+ const recordingItem = this.collection.get(currentKey);
34
+ this.abortUploadIfInProgress(recordingItem);
35
+ this.resetRecordingState(currentKey);
36
+ if (notification) {
37
+ this.notification.info((0, _index.t)('voiceRecorder.recordingDeleted'));
38
+ }
39
+ })
40
+ });
41
+ initializeRecording = (0, _effector.createEffect)(async () => {
42
+ this.deleteCurrentRecording({
43
+ notification: false
44
+ });
45
+ const hasPermissions = await (0, _helpers.ensureRecordingPermissions)();
46
+ if (!hasPermissions) {
47
+ this.notification.error((0, _index.t)('voiceRecorder.noMicrophoneAccess'));
48
+ return;
49
+ }
50
+ const inputs = await (0, _helpers.getAvailableInputs)(this.recorderModel.recorder);
51
+ this.recorderModel.setAvailableInputs(inputs);
52
+ if (inputs.length === 0) {
53
+ this.notification.error((0, _index.t)('voiceRecorder.noMicrophoneFound'));
54
+ return;
55
+ }
56
+ return this.recorderModel.start();
57
+ });
58
+ stopAndDiscard = (0, _effector.createEffect)(async () => {
59
+ this.shouldDiscardRecording = true;
60
+ await this.recorderModel.stop();
61
+ this.recorderModel.clearStopResolver();
62
+ this.recorderModel.reset();
63
+ });
64
+ recordingStatusUpdate = status => {
65
+ if (status.error) {
66
+ this.notification.error(`Recorder error: ${status.error}`);
67
+ this.recorderModel.clearStopResolver();
68
+ this.shouldDiscardRecording = false;
69
+ return;
70
+ }
71
+ if (status.isFinished && status.url) {
72
+ if (!this.shouldDiscardRecording) {
73
+ this.startAudioUpload(status.url);
74
+ }
75
+ this.shouldDiscardRecording = false;
76
+ }
77
+ };
20
78
  constructor({
21
- showToast
79
+ api,
80
+ notification,
81
+ events
22
82
  }) {
23
- this.showToast = showToast;
83
+ this.api = api;
84
+ this.notification = notification;
85
+ this.events = events;
86
+ this.recorderModel = new _RecorderModel.RecorderModel();
87
+ this.collection = new _VoiceRecordCollection.VoiceRecordsCollection();
88
+ this.setupUploadHandler();
89
+ this.setupCurrentRecordSync();
90
+ this.setupUriSync();
91
+ }
92
+ abortUploadIfInProgress(recordingItem) {
93
+ if (!recordingItem?.id && recordingItem?.controller) {
94
+ recordingItem.controller.abort();
95
+ }
96
+ }
97
+ resetRecordingState(currentKey) {
98
+ this.recorderModel.reset();
99
+ this.reset();
100
+ this.collection.delete(currentKey);
101
+ }
102
+ async handleAudioUpload({
103
+ uri,
104
+ currentKey
105
+ }) {
106
+ const durationMs = await (0, _helpers.getAudioDurationMs)(uri);
107
+ const formData = await (0, _helpers.generateAudioFormData)({
108
+ audioFileUri: uri,
109
+ durationMs
110
+ });
111
+ const {
112
+ uploadAudio,
113
+ controller
114
+ } = (0, _helpers.uploadAudioFileRequestGenerator)(formData, this.api);
115
+ const audioUploadPromise = uploadAudio().then(data => {
116
+ // Check if the item still exists (wasn't deleted during upload)
117
+ if (this.collection.get(currentKey)) {
118
+ this.collection.update(currentKey, {
119
+ id: data.id
120
+ });
121
+ }
122
+ return data;
123
+ }).catch(error => {
124
+ if (error.name === 'CanceledError') return;
125
+ this.notification.error((0, _index.t)('voiceRecorder.uploadFailed'));
126
+ });
127
+ const collectionItem = {
128
+ durationMs,
129
+ audioUploadPromise,
130
+ controller,
131
+ uri
132
+ };
133
+ this.collection.add(currentKey, collectionItem);
134
+ this.setCurrentRecord(collectionItem);
135
+ this.recorderModel.resolveStopWithCollectionItem(collectionItem);
136
+ return audioUploadPromise;
137
+ }
138
+ setupUploadHandler() {
24
139
  (0, _effector.sample)({
25
- clock: this.deleteFile,
26
- target: (0, _effector.createEffect)(() => {
27
- this.clearAudioFilePath();
28
- showToast.info('Recording deleted');
29
- })
140
+ clock: this.startAudioUpload,
141
+ source: this.$currentKey,
142
+ filter: (currentKey, uri) => !!uri && !!currentKey,
143
+ fn: (currentKey, uri) => ({
144
+ currentKey,
145
+ uri
146
+ }),
147
+ target: (0, _effector.createEffect)(({
148
+ uri,
149
+ currentKey
150
+ }) => this.handleAudioUpload({
151
+ uri,
152
+ currentKey
153
+ }))
154
+ });
155
+ }
156
+ setupUriSync() {
157
+ (0, _effector.sample)({
158
+ source: this.$currentRecord,
159
+ fn: record => record?.uri || '',
160
+ target: (0, _effector.createStore)('').reset(this.reset)
30
161
  });
162
+ }
163
+ setupCurrentRecordSync() {
31
164
  (0, _effector.sample)({
32
- clock: this.startRecord,
33
- target: (0, _effector.createEffect)(async () => {
34
- showToast.info('Recording started');
165
+ source: this.$currentKey,
166
+ fn: currentKey => this.collection.get(currentKey),
167
+ target: (0, _effector.createEffect)(recordingItem => {
168
+ if (!recordingItem) {
169
+ this.reset();
170
+ return;
171
+ }
172
+ this.setCurrentRecord(recordingItem);
173
+ if (recordingItem.durationMs) {
174
+ this.recorderModel.setAudioFileDurationMs(recordingItem.durationMs);
175
+ }
35
176
  })
36
177
  });
37
178
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_effector","require","VoiceRecordModel","startRecord","createEvent","stop","deleteFile","setAudioFilePath","clearAudioFilePath","$audioFilePath","restore","reset","resetIsRecording","setIsRecording","$isRecording","setAvailableInputs","$availableInputs","constructor","showToast","sample","clock","target","createEffect","info","exports"],"sourceRoot":"../../../../../src","sources":["features/voiceRecord/model/VoiceRecord.model.ts"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAcO,MAAMC,gBAAgB,CAAC;EACZC,WAAW,GAAG,IAAAC,qBAAW,EAAC,CAAC;EAC3BC,IAAI,GAAG,IAAAD,qBAAW,EAAC,CAAC;EAEpBE,UAAU,GAAG,IAAAF,qBAAW,EAAC,CAAC;EAE1BG,gBAAgB,GAAG,IAAAH,qBAAW,EAAS,CAAC;EACxCI,kBAAkB,GAAG,IAAAJ,qBAAW,EAAC,CAAC;EAClCK,cAAc,GAAG,IAAAC,iBAAO,EAAC,IAAI,CAACH,gBAAgB,EAAE,EAAE,CAAC,CAACI,KAAK,CAAC,IAAI,CAACH,kBAAkB,CAAC;EAIlFI,gBAAgB,GAAG,IAAAR,qBAAW,EAAC,CAAC;EAChCS,cAAc,GAAG,IAAAT,qBAAW,EAAU,CAAC;EACvCU,YAAY,GAAG,IAAAJ,iBAAO,EAAC,IAAI,CAACG,cAAc,EAAE,KAAK,CAAC,CAACF,KAAK,CAAC,IAAI,CAACC,gBAAgB,CAAC;EAE/EG,kBAAkB,GAAG,IAAAX,qBAAW,EAAiD,CAAC;EAClFY,gBAAgB,GAAG,IAAAN,iBAAO,EAAC,IAAI,CAACK,kBAAkB,EAAE,EAAE,CAAC;EAEvEE,WAAWA,CAAC;IAAEC;EAAkC,CAAC,EAAE;IACjD,IAAI,CAACA,SAAS,GAAGA,SAAS;IAE1B,IAAAC,gBAAM,EAAC;MACLC,KAAK,EAAE,IAAI,CAACd,UAAU;MACtBe,MAAM,EAAE,IAAAC,sBAAY,EAAC,MAAM;QACzB,IAAI,CAACd,kBAAkB,CAAC,CAAC;QACzBU,SAAS,CAACK,IAAI,CAAC,mBAAmB,CAAC;MACrC,CAAC;IACH,CAAC,CAAC;IAEF,IAAAJ,gBAAM,EAAC;MACLC,KAAK,EAAE,IAAI,CAACjB,WAAW;MACvBkB,MAAM,EAAE,IAAAC,sBAAY,EAAC,YAAY;QAC/BJ,SAAS,CAACK,IAAI,CAAC,mBAAmB,CAAC;MACrC,CAAC;IACH,CAAC,CAAC;EACJ;AACF;AAACC,OAAA,CAAAtB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_effector","require","_helpers","_index","_RecorderModel","_VoiceRecordCollection","VoiceRecordModel","shouldDiscardRecording","setCurrentKey","createEvent","setCurrentRecord","reset","setIsDisabled","startAudioUpload","$currentKey","restore","$currentRecord","$isDisabled","deleteCurrentRecording","attach","source","mapParams","props","currentKey","notification","effect","createEffect","recordingItem","collection","get","abortUploadIfInProgress","resetRecordingState","info","t","initializeRecording","hasPermissions","ensureRecordingPermissions","error","inputs","getAvailableInputs","recorderModel","recorder","setAvailableInputs","length","start","stopAndDiscard","stop","clearStopResolver","recordingStatusUpdate","status","isFinished","url","constructor","api","events","RecorderModel","VoiceRecordsCollection","setupUploadHandler","setupCurrentRecordSync","setupUriSync","id","controller","abort","delete","handleAudioUpload","uri","durationMs","getAudioDurationMs","formData","generateAudioFormData","audioFileUri","uploadAudio","uploadAudioFileRequestGenerator","audioUploadPromise","then","data","update","catch","name","collectionItem","add","resolveStopWithCollectionItem","sample","clock","filter","fn","target","record","createStore","setAudioFileDurationMs","exports"],"sourceRoot":"../../../../../src","sources":["features/voiceRecord/model/VoiceRecord.model.ts"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAQA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAJ,OAAA;AA2BO,MAAMK,gBAAgB,CAAC;EAMpBC,sBAAsB,GAAG,KAAK;EAEtBC,aAAa,GAAG,IAAAC,qBAAW,EAAS,CAAC;EACrCC,gBAAgB,GAAG,IAAAD,qBAAW,EAAM,CAAC;EACrCE,KAAK,GAAG,IAAAF,qBAAW,EAAC,CAAC;EACrBG,aAAa,GAAG,IAAAH,qBAAW,EAAU,CAAC;EACtCI,gBAAgB,GAAG,IAAAJ,qBAAW,EAAS,CAAC;EAExCK,WAAW,GAAG,IAAAC,iBAAO,EAAC,IAAI,CAACP,aAAa,EAAE,EAAE,CAAC;EAC7CQ,cAAc,GAAG,IAAAD,iBAAO,EAAC,IAAI,CAACL,gBAAgB,EAAE,IAAI,C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EAAC;MACL9D,MAAM,EAAE,IAAI,CAACN,WAAW;MACxBuE,EAAE,EAAG9D,UAAU,IAAK,IAAI,CAACK,UAAU,CAACC,GAAG,CAACN,UAAU,CAAC;MACnD+D,MAAM,EAAE,IAAA5D,sBAAY,EAAEC,aAAyC,IAAK;QAClE,IAAI,CAACA,aAAa,EAAE;UAClB,IAAI,CAAChB,KAAK,CAAC,CAAC;UACZ;QACF;QAEA,IAAI,CAACD,gBAAgB,CAACiB,aAAa,CAAC;QAEpC,IAAIA,aAAa,CAACuC,UAAU,EAAE;UAC5B,IAAI,CAAC1B,aAAa,CAACiD,sBAAsB,CAAC9D,aAAa,CAACuC,UAAU,CAAC;QACrE;MACF,CAAC;IACH,CAAC,CAAC;EACJ;AACF;AAACwB,OAAA,CAAApF,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -4,6 +4,26 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.VoiceRecordApi = void 0;
7
- class VoiceRecordApi {}
7
+ class VoiceRecordApi {
8
+ // public readonly uploadAudioFileFx
9
+
10
+ // public readonly abortUpload = createEffect(() => {
11
+ // if (this.uploadAudioFileFx.pending.getState()) {
12
+ // this.uploadAudioFileFx.controller.abort()
13
+ // }
14
+ // })
15
+
16
+ constructor(api) {
17
+ // this.uploadAudioFileFx = createControllerEffect((audioFileFormData: FormData, config) =>
18
+ // api.uploadAudioFile(
19
+ // { audioFileFormData },
20
+ // //@ts-ignore
21
+ // {
22
+ // signal: config?.signal,
23
+ // },
24
+ // ),
25
+ // )
26
+ }
27
+ }
8
28
  exports.VoiceRecordApi = VoiceRecordApi;
9
29
  //# sourceMappingURL=VoiceRecordApi.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["VoiceRecordApi","exports"],"sourceRoot":"../../../../../src","sources":["features/voiceRecord/model/VoiceRecordApi.ts"],"mappings":";;;;;;AAAO,MAAMA,cAAc,CAAC;AAAEC,OAAA,CAAAD,cAAA,GAAAA,cAAA","ignoreList":[]}
1
+ {"version":3,"names":["VoiceRecordApi","constructor","api","exports"],"sourceRoot":"../../../../../src","sources":["features/voiceRecord/model/VoiceRecordApi.ts"],"mappings":";;;;;;AAIO,MAAMA,cAAc,CAAC;EAC1B;;EAEA;EACA;EACA;EACA;EACA;;EAEAC,WAAWA,CAACC,GAAa,EAAE;IACzB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;EAAA;AAEJ;AAACC,OAAA,CAAAH,cAAA,GAAAA,cAAA","ignoreList":[]}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.VoiceRecordsCollection = void 0;
7
+ class VoiceRecordsCollection {
8
+ collection = new Map();
9
+ add(key, item) {
10
+ this.collection.set(key, item);
11
+ }
12
+ update(key, item) {
13
+ const existingItem = this.collection.get(key) || {};
14
+ this.collection.set(key, {
15
+ ...existingItem,
16
+ ...item
17
+ });
18
+ }
19
+ delete(key) {
20
+ this.collection.delete(key);
21
+ }
22
+ get(key) {
23
+ return this.collection.get(key);
24
+ }
25
+ clear() {
26
+ this.collection.clear();
27
+ }
28
+ }
29
+ exports.VoiceRecordsCollection = VoiceRecordsCollection;
30
+ //# sourceMappingURL=VoiceRecordCollection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["VoiceRecordsCollection","collection","Map","add","key","item","set","update","existingItem","get","delete","clear","exports"],"sourceRoot":"../../../../../src","sources":["features/voiceRecord/model/VoiceRecordCollection.ts"],"mappings":";;;;;;AAEO,MAAMA,sBAAsB,CAAC;EAClBC,UAAU,GAA2C,IAAIC,GAAG,CAAC,CAAC;EAEvEC,GAAGA,CAACC,GAAW,EAAEC,IAA+B,EAAE;IACvD,IAAI,CAACJ,UAAU,CAACK,GAAG,CAACF,GAAG,EAAEC,IAAI,CAAC;EAChC;EAEOE,MAAMA,CAACH,GAAW,EAAEC,IAAwC,EAAE;IACnE,MAAMG,YAAY,GAAG,IAAI,CAACP,UAAU,CAACQ,GAAG,CAACL,GAAG,CAAC,IAAI,CAAC,CAAC;IACnD,IAAI,CAACH,UAAU,CAACK,GAAG,CAACF,GAAG,EAAE;MAAE,GAAGI,YAAY;MAAE,GAAGH;IAAK,CAAC,CAAC;EACxD;EAEOK,MAAMA,CAACN,GAAW,EAAE;IACzB,IAAI,CAACH,UAAU,CAACS,MAAM,CAACN,GAAG,CAAC;EAC7B;EAEOK,GAAGA,CAACL,GAAW,EAAE;IACtB,OAAO,IAAI,CAACH,UAAU,CAACQ,GAAG,CAACL,GAAG,CAAC;EACjC;EAEOO,KAAKA,CAAA,EAAG;IACb,IAAI,CAACV,UAAU,CAACU,KAAK,CAAC,CAAC;EACzB;AACF;AAACC,OAAA,CAAAZ,sBAAA,GAAAA,sBAAA","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["features/voiceRecord/types.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ConditionalWrapper = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _jsxRuntime = require("react/jsx-runtime");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ const ConditionalWrapper = ({
11
+ withWrapper,
12
+ Wrapper,
13
+ children
14
+ }) => {
15
+ if (withWrapper && Wrapper) {
16
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapper, {
17
+ children: children
18
+ });
19
+ }
20
+ return children;
21
+ };
22
+ exports.ConditionalWrapper = ConditionalWrapper;
23
+ //# sourceMappingURL=ConditionalWrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_jsxRuntime","e","__esModule","default","ConditionalWrapper","withWrapper","Wrapper","children","jsx","exports"],"sourceRoot":"../../../../src","sources":["lib/components/ConditionalWrapper.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0E,IAAAC,WAAA,GAAAD,OAAA;AAAA,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAQnE,MAAMG,kBAAkB,GAAGA,CAAC;EAAEC,WAAW;EAAEC,OAAO;EAAEC;AAAkC,CAAC,KAAK;EACjG,IAAIF,WAAW,IAAIC,OAAO,EAAE;IAC1B,oBAAO,IAAAN,WAAA,CAAAQ,GAAA,EAACF,OAAO;MAAAC,QAAA,EAAEA;IAAQ,CAAU,CAAC;EACtC;EAEA,OAAOA,QAAQ;AACjB,CAAC;AAAAE,OAAA,CAAAL,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -39,5 +39,18 @@
39
39
  "volume": "Volume",
40
40
  "weight": "Weight",
41
41
  "time": "Time"
42
+ },
43
+ "voiceRecorder": {
44
+ "deleteRecording": "Delete recording?",
45
+ "youWontBeAbleToRecover": "You won't be able to recover this file once it's gone.",
46
+ "recordingDeleted": "Recording successfully deleted",
47
+ "delete": "Delete",
48
+ "cancel": "Cancel",
49
+ "noMicrophoneAccess": "No microphone access",
50
+ "noMicrophoneFound": "No microphone found",
51
+ "uploadFailed": "Upload failed. Please try again.",
52
+ "redoRecording": "Redo recording?",
53
+ "redo": "Redo",
54
+ "thisWillRemoveRecording": "This will remove your previous recording."
42
55
  }
43
56
  }
@@ -39,5 +39,18 @@
39
39
  "volume": "Volumen",
40
40
  "weight": "Gewicht",
41
41
  "time": "Zeit"
42
+ },
43
+ "voiceRecorder": {
44
+ "deleteRecording": "Aufnahme löschen?",
45
+ "youWontBeAbleToRecover": "Du kannst die Datei nicht wiederherstellen, wenn sie einmal gelöscht ist.",
46
+ "recordingDeleted": "Aufnahme gelöscht.",
47
+ "delete": "Löschen",
48
+ "cancel": "Abbrechen",
49
+ "noMicrophoneAccess": "Kein Mikrofon-Zugriff.",
50
+ "noMicrophoneFound": "Kein Mikrofon gefunden.",
51
+ "uploadFailed": "Hochladen fehlgeschlagen. Bitte versuche es erneut.",
52
+ "redoRecording": "Redo recording?",
53
+ "redo": "Redo",
54
+ "thisWillRemoveRecording": "This will remove your previous recording."
42
55
  }
43
56
  }
@@ -39,5 +39,18 @@
39
39
  "volume": "Volume",
40
40
  "weight": "Weight",
41
41
  "time": "Time"
42
+ },
43
+ "voiceRecorder": {
44
+ "deleteRecording": "Delete recording?",
45
+ "youWontBeAbleToRecover": "You won't be able to recover this file once it's gone.",
46
+ "recordingDeleted": "Recording successfully deleted",
47
+ "delete": "Delete",
48
+ "cancel": "Cancel",
49
+ "noMicrophoneAccess": "No microphone access",
50
+ "noMicrophoneFound": "No microphone found",
51
+ "uploadFailed": "Upload failed. Please try again.",
52
+ "redoRecording": "Redo recording?",
53
+ "redo": "Redo",
54
+ "thisWillRemoveRecording": "This will remove your previous recording."
42
55
  }
43
56
  }
@@ -39,5 +39,18 @@
39
39
  "volume": "Volume",
40
40
  "weight": "Weight",
41
41
  "time": "Time"
42
+ },
43
+ "voiceRecorder": {
44
+ "deleteRecording": "Delete recording?",
45
+ "youWontBeAbleToRecover": "You won't be able to recover this file once it's gone.",
46
+ "recordingDeleted": "Recording successfully deleted",
47
+ "delete": "Delete",
48
+ "cancel": "Cancel",
49
+ "noMicrophoneAccess": "No microphone access",
50
+ "noMicrophoneFound": "No microphone found",
51
+ "uploadFailed": "Upload failed. Please try again.",
52
+ "redoRecording": "Redo recording?",
53
+ "redo": "Redo",
54
+ "thisWillRemoveRecording": "This will remove your previous recording."
42
55
  }
43
56
  }
@@ -39,5 +39,18 @@
39
39
  "volume": "Volume",
40
40
  "weight": "Weight",
41
41
  "time": "Time"
42
+ },
43
+ "voiceRecorder": {
44
+ "deleteRecording": "Delete recording?",
45
+ "youWontBeAbleToRecover": "You won't be able to recover this file once it's gone.",
46
+ "recordingDeleted": "Recording successfully deleted",
47
+ "delete": "Delete",
48
+ "cancel": "Cancel",
49
+ "noMicrophoneAccess": "No microphone access",
50
+ "noMicrophoneFound": "No microphone found",
51
+ "uploadFailed": "Upload failed. Please try again.",
52
+ "redoRecording": "Redo recording?",
53
+ "redo": "Redo",
54
+ "thisWillRemoveRecording": "This will remove your previous recording."
42
55
  }
43
56
  }
@@ -39,5 +39,18 @@
39
39
  "volume": "Volym",
40
40
  "weight": "Vikt",
41
41
  "time": "Tid"
42
+ },
43
+ "voiceRecorder": {
44
+ "deleteRecording": "Radera inspelningen?",
45
+ "youWontBeAbleToRecover": "Du kommer inte att kunna återställa filen när den väl är borta.",
46
+ "recordingDeleted": "Recording deleted",
47
+ "delete": "Radera",
48
+ "cancel": "Avbryt",
49
+ "noMicrophoneAccess": "Ingen mikrofonåtkomst",
50
+ "noMicrophoneFound": "Ingen mikrofon hittades",
51
+ "uploadFailed": "Uppladdning misslyckades. Försök igen.",
52
+ "redoRecording": "Redo recording?",
53
+ "redo": "Redo",
54
+ "thisWillRemoveRecording": "This will remove your previous recording."
42
55
  }
43
56
  }
@@ -8,6 +8,7 @@ import { MessageLoader } from "../ChatMessage/MessageLoader.js";
8
8
  import { ChatInput } from "../ChatInput/ChatInput.js";
9
9
  import { MessageVariant } from "../../types/model.types.js";
10
10
  import { ColorScheme } from "../../types/style.types.js";
11
+ import { ConditionalWrapper } from "../../../../lib/components/ConditionalWrapper.js";
11
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
13
  const TOOLBAR_HEIGHT = 140;
13
14
  const BOTTOM_OFFSET = Platform.select({
@@ -18,7 +19,9 @@ export const Chat = ({
18
19
  model,
19
20
  isHintFeedback,
20
21
  isTextToSpeechEnabled,
21
- colorScheme = ColorScheme.Blue
22
+ isInputDisabled,
23
+ colorScheme = ColorScheme.Blue,
24
+ MessageWrapper
22
25
  }) => {
23
26
  const dimensions = useWindowDimensions();
24
27
  const ref = useRef(null);
@@ -34,6 +37,7 @@ export const Chat = ({
34
37
  }) => messages);
35
38
  const lastMessageId = messages.at(-1)?.id;
36
39
  const MAX_HEIGHT = dimensions.height - TOOLBAR_HEIGHT - BOTTOM_OFFSET;
40
+ const shouldWrapMessage = MessageWrapper && isInputDisabled && messages.length === 1;
37
41
  return /*#__PURE__*/_jsx(View, {
38
42
  style: [styles.container, {
39
43
  maxHeight: MAX_HEIGHT
@@ -49,25 +53,29 @@ export const Chat = ({
49
53
  }
50
54
  },
51
55
  children: [isOpen && /*#__PURE__*/_jsxs(View, {
52
- style: styles.gap,
53
- children: [messages.map(message => /*#__PURE__*/_jsx(ChatMessage, {
54
- isTranslated: isTranslated,
55
- withIcon: !message.isOwnMessage && message.id === lastMessageId,
56
- message: message,
57
- variant: message.isOwnMessage ? MessageVariant.SENT : MessageVariant.RECEIVED,
58
- colorScheme: colorScheme,
59
- withErrorSpotting: errorSpottingEnabled && !message.isOwnMessage,
60
- t2sState: {
61
- isEnabled: isTextToSpeechEnabled && !message.isOwnMessage,
62
- isActive: message.id === currentPlayingId,
63
- isLoading: isTextToSpeechPending,
64
- status: audioStatus,
65
- disabled: isTextToSpeechPending
66
- }
67
- }, message.id)), isHelpRequestPending && /*#__PURE__*/_jsx(MessageLoader, {
56
+ style: [styles.gap, isInputDisabled && styles.messagesWithoutInput],
57
+ children: [messages.map(message => /*#__PURE__*/_jsx(ConditionalWrapper, {
58
+ withWrapper: shouldWrapMessage,
59
+ Wrapper: MessageWrapper,
60
+ children: /*#__PURE__*/_jsx(ChatMessage, {
61
+ isTranslated: isTranslated,
62
+ withIcon: !message.isOwnMessage && message.id === lastMessageId,
63
+ message: message,
64
+ variant: message.isOwnMessage ? MessageVariant.SENT : MessageVariant.RECEIVED,
65
+ colorScheme: colorScheme,
66
+ withErrorSpotting: errorSpottingEnabled && !message.isOwnMessage,
67
+ t2sState: {
68
+ isEnabled: isTextToSpeechEnabled && !message.isOwnMessage,
69
+ isActive: message.id === currentPlayingId,
70
+ isLoading: isTextToSpeechPending,
71
+ status: audioStatus,
72
+ disabled: isTextToSpeechPending
73
+ }
74
+ }, message.id)
75
+ })), isHelpRequestPending && /*#__PURE__*/_jsx(MessageLoader, {
68
76
  colorScheme: colorScheme
69
77
  })]
70
- }), isOpen && /*#__PURE__*/_jsx(ChatInput, {
78
+ }), isOpen && !isInputDisabled && /*#__PURE__*/_jsx(ChatInput, {
71
79
  isHintFeedback: isHintFeedback,
72
80
  colorScheme: colorScheme,
73
81
  hasMessages: messages.length > 1
@@ -87,6 +95,9 @@ const styles = StyleSheet.create({
87
95
  paddingVertical: 2,
88
96
  paddingRight: 6
89
97
  },
98
+ messagesWithoutInput: {
99
+ marginBottom: 8
100
+ },
90
101
  gap: {
91
102
  flex: 1,
92
103
  gap: 8
@@ -1 +1 @@
1
- {"version":3,"names":["React","useRef","Platform","ScrollView","StyleSheet","useWindowDimensions","View","useStoreMap","useUnit","ChatMessage","MessageLoader","ChatInput","MessageVariant","ColorScheme","jsx","_jsx","jsxs","_jsxs","TOOLBAR_HEIGHT","BOTTOM_OFFSET","select","web","default","Chat","model","isHintFeedback","isTextToSpeechEnabled","colorScheme","Blue","dimensions","ref","isOpen","$isOpen","isHelpRequestPending","sendHelpRequestFx","pending","isTextToSpeechPending","api","textToSpeechTextFx","currentPlayingId","t2s","$currentPlayingId","isTranslated","translation","$isTranslated","audioStatus","$status","errorSpottingEnabled","errorSpotting","$isEnabled","messages","$currentChatData","lastMessageId","at","id","MAX_HEIGHT","height","style","styles","container","maxHeight","children","bounces","contentContainerStyle","list","onContentSizeChange","_","current","scrollToEnd","setScrollActive","gap","map","message","withIcon","isOwnMessage","variant","SENT","RECEIVED","withErrorSpotting","t2sState","isEnabled","isActive","isLoading","status","disabled","hasMessages","length","create","flex","alignItems","width","paddingVertical","paddingRight"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/Chat/Chat.tsx"],"mappings":";;AAA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AAI,GAAGhE,cAAc,CAACiE,QAAS;UAC9ElD,WAAW,EAAEA,WAAY;UACzBmD,iBAAiB,EAAE/B,oBAAoB,IAAI,CAACyB,OAAO,CAACE,YAAa;UACjEK,QAAQ,EAAE;YACRC,SAAS,EAAEtD,qBAAqB,IAAI,CAAC8C,OAAO,CAACE,YAAY;YACzDO,QAAQ,EAAET,OAAO,CAAClB,EAAE,KAAKf,gBAAgB;YACzC2C,SAAS,EAAE9C,qBAAqB;YAChC+C,MAAM,EAAEtC,WAAW;YACnBuC,QAAQ,EAAEhD;UACZ;QAAE,GAbGoC,OAAO,CAAClB,EAcd,CACF,CAAC,EAEDrB,oBAAoB,iBAAIlB,IAAA,CAACL,aAAa;UAACiB,WAAW,EAAEA;QAAY,CAAE,CAAC;MAAA,CAChE,CACP,EAEAI,MAAM,iBACLhB,IAAA,CAACJ,SAAS;QACRc,cAAc,EAAEA,cAAe;QAC/BE,WAAW,EAAEA,WAAY;QACzB0D,WAAW,EAAEnC,QAAQ,CAACoC,MAAM,GAAG;MAAE,CAClC,CACF;IAAA,CACS;EAAC,CACT,CAAC;AAEX,CAAC;AAED,MAAM5B,MAAM,GAAGtD,UAAU,CAACmF,MAAM,CAAC;EAC/B5B,SAAS,EAAE;IACT6B,IAAI,EAAE,CAAC;IACPC,UAAU,EAAE,UAAU;IACtBC,KAAK,EAAE,GAAG;IACVlC,MAAM,EAAE;EACV,CAAC;EACDQ,IAAI,EAAE;IACJyB,UAAU,EAAE,UAAU;IACtBE,eAAe,EAAE,CAAC;IAClBC,YAAY,EAAE;EAChB,CAAC;EACDtB,GAAG,EAAE;IACHkB,IAAI,EAAE,CAAC;IACPlB,GAAG,EAAE;EACP;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","useRef","Platform","ScrollView","StyleSheet","useWindowDimensions","View","useStoreMap","useUnit","ChatMessage","MessageLoader","ChatInput","MessageVariant","ColorScheme","ConditionalWrapper","jsx","_jsx","jsxs","_jsxs","TOOLBAR_HEIGHT","BOTTOM_OFFSET","select","web","default","Chat","model","isHintFeedback","isTextToSpeechEnabled","isInputDisabled","colorScheme","Blue","MessageWrapper","dimensions","ref","isOpen","$isOpen","isHelpRequestPending","sendHelpRequestFx","pending","isTextToSpeechPending","api","textToSpeechTextFx","currentPlayingId","t2s","$currentPlayingId","isTranslated","translation","$isTranslated","audioStatus","$status","errorSpottingEnabled","errorSpotting","$isEnabled","messages","$currentChatData","lastMessageId","at","id","MAX_HEIGHT","height","shouldWrapMessage","length","style","styles","container","maxHeight","children","bounces","contentContainerStyle","list","onContentSizeChange","_","current","scrollToEnd","setScrollActive","gap","messagesWithoutInput","map","message","withWrapper","Wrapper","withIcon","isOwnMessage","variant","SENT","RECEIVED","withErrorSpotting","t2sState","isEnabled","isActive","isLoading","status","disabled","hasMessages","create","flex","alignItems","width","paddingVertical","paddingRight","marginBottom"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/Chat/Chat.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAsCC,MAAM,QAAQ,OAAO;AACvE,SAASC,QAAQ,EAAEC,UAAU,EAAEC,UAAU,EAAEC,mBAAmB,EAAEC,IAAI,QAAQ,cAAc;AAC1F,SAASC,WAAW,EAAEC,OAAO,QAAQ,gBAAgB;AAGrD,SAASC,WAAW,QAAQ,+BAA4B;AACxD,SAASC,aAAa,QAAQ,iCAA8B;AAC5D,SAASC,SAAS,QAAQ,2BAAwB;AAClD,SAASC,cAAc,QAAQ,4BAAyB;AACxD,SAASC,WAAW,QAAQ,4BAAyB;AACrD,SAASC,kBAAkB,QAAQ,kDAA+C;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAElF,MAAMC,cAAc,GAAG,GAAG;AAC1B,MAAMC,aAAa,GAAGlB,QAAQ,CAACmB,MAAM,CAAC;EACpCC,GAAG,EAAE,GAAG;EACRC,OAAO,EAAE;AACX,CAAC,CAAC;AAWF,OAAO,MAAMC,IAAI,GAAGA,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