@magmamath/students-features 0.3.2 → 0.4.0-rc.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 (248) hide show
  1. package/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js +12 -4
  2. package/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js.map +1 -1
  3. package/dist/commonjs/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -1
  4. package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js +6 -4
  5. package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -1
  6. package/dist/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.js +12 -1
  7. package/dist/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +1 -1
  8. package/dist/commonjs/features/chatbot/components/Chatbot.js +5 -1
  9. package/dist/commonjs/features/chatbot/components/Chatbot.js.map +1 -1
  10. package/dist/commonjs/features/chatbot/context/ChatBotContext.js +17 -0
  11. package/dist/commonjs/features/chatbot/context/ChatBotContext.js.map +1 -0
  12. package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingButton.js +58 -0
  13. package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingButton.js.map +1 -0
  14. package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.js +99 -0
  15. package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.js.map +1 -0
  16. package/dist/commonjs/features/chatbot/index.js +0 -7
  17. package/dist/commonjs/features/chatbot/index.js.map +1 -1
  18. package/dist/commonjs/features/chatbot/model/ChatBotModel.js +136 -117
  19. package/dist/commonjs/features/chatbot/model/ChatBotModel.js.map +1 -1
  20. package/dist/commonjs/features/chatbot/model/{ChatBotMessageHandler.js → ChatBotThreadManager.js} +28 -17
  21. package/dist/commonjs/features/chatbot/model/ChatBotThreadManager.js.map +1 -0
  22. package/dist/commonjs/features/chatbot/model/{api.js → ChatbotApi.js} +16 -1
  23. package/dist/commonjs/features/chatbot/model/ChatbotApi.js.map +1 -0
  24. package/dist/commonjs/features/chatbot/model/ChatsCacheModel.js +110 -0
  25. package/dist/commonjs/features/chatbot/model/ChatsCacheModel.js.map +1 -0
  26. package/dist/commonjs/features/chatbot/model/DefaultMessageCreator.js +0 -1
  27. package/dist/commonjs/features/chatbot/model/DefaultMessageCreator.js.map +1 -1
  28. package/dist/commonjs/features/chatbot/model/ThreadItem.js +21 -8
  29. package/dist/commonjs/features/chatbot/model/ThreadItem.js.map +1 -1
  30. package/dist/commonjs/features/chatbot/model/messagesHelper.js +1 -5
  31. package/dist/commonjs/features/chatbot/model/messagesHelper.js.map +1 -1
  32. package/dist/commonjs/features/chatbot/model/t2s.js +0 -6
  33. package/dist/commonjs/features/chatbot/model/t2s.js.map +1 -1
  34. package/dist/commonjs/features/chatbot/model/translation.helpers.js.map +1 -1
  35. package/dist/commonjs/features/chatbot/model/translation.js +54 -45
  36. package/dist/commonjs/features/chatbot/model/translation.js.map +1 -1
  37. package/dist/commonjs/features/chatbot/types/api.types.js +4 -0
  38. package/dist/commonjs/features/chatbot/types/model.types.js.map +1 -1
  39. package/dist/commonjs/features/chatbot/types/units.types.js +2 -0
  40. package/dist/commonjs/features/chatbot/types/units.types.js.map +1 -0
  41. package/dist/commonjs/features/feedback/components/TeacherFeedbackButton/colorSchemes.js +18 -9
  42. package/dist/commonjs/features/feedback/components/TeacherFeedbackButton/colorSchemes.js.map +1 -1
  43. package/dist/commonjs/lib/effector/createEntityFieldStore.js +4 -0
  44. package/dist/commonjs/lib/effector/createEntityFieldStore.js.map +1 -1
  45. package/dist/commonjs/lib/helpers/randomElements.js +24 -0
  46. package/dist/commonjs/lib/helpers/randomElements.js.map +1 -0
  47. package/dist/commonjs/shared/icons/HighlighterIcon.js +36 -0
  48. package/dist/commonjs/shared/icons/HighlighterIcon.js.map +1 -0
  49. package/dist/commonjs/shared/icons/StopIcon.js +33 -0
  50. package/dist/commonjs/shared/icons/StopIcon.js.map +1 -0
  51. package/dist/commonjs/shared/icons/icon.types.js +4 -0
  52. package/dist/module/features/chatbot/components/ChatControls/ChatControls.js +12 -4
  53. package/dist/module/features/chatbot/components/ChatControls/ChatControls.js.map +1 -1
  54. package/dist/module/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -1
  55. package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js +6 -4
  56. package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -1
  57. package/dist/module/features/chatbot/components/ChatMessages/ChatbotMessages.js +12 -1
  58. package/dist/module/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +1 -1
  59. package/dist/module/features/chatbot/components/Chatbot.js +6 -2
  60. package/dist/module/features/chatbot/components/Chatbot.js.map +1 -1
  61. package/dist/module/features/chatbot/context/ChatBotContext.js +12 -0
  62. package/dist/module/features/chatbot/context/ChatBotContext.js.map +1 -0
  63. package/dist/module/features/chatbot/errorSpotting/ErrorSpottingButton.js +52 -0
  64. package/dist/module/features/chatbot/errorSpotting/ErrorSpottingButton.js.map +1 -0
  65. package/dist/module/features/chatbot/errorSpotting/ErrorSpottingModel.js +94 -0
  66. package/dist/module/features/chatbot/errorSpotting/ErrorSpottingModel.js.map +1 -0
  67. package/dist/module/features/chatbot/index.js +0 -1
  68. package/dist/module/features/chatbot/index.js.map +1 -1
  69. package/dist/module/features/chatbot/model/ChatBotModel.js +138 -119
  70. package/dist/module/features/chatbot/model/ChatBotModel.js.map +1 -1
  71. package/dist/module/features/chatbot/model/{ChatBotMessageHandler.js → ChatBotThreadManager.js} +26 -15
  72. package/dist/module/features/chatbot/model/ChatBotThreadManager.js.map +1 -0
  73. package/dist/module/features/chatbot/model/{api.js → ChatbotApi.js} +16 -1
  74. package/dist/module/features/chatbot/model/ChatbotApi.js.map +1 -0
  75. package/dist/module/features/chatbot/model/ChatsCacheModel.js +104 -0
  76. package/dist/module/features/chatbot/model/ChatsCacheModel.js.map +1 -0
  77. package/dist/module/features/chatbot/model/DefaultMessageCreator.js +0 -1
  78. package/dist/module/features/chatbot/model/DefaultMessageCreator.js.map +1 -1
  79. package/dist/module/features/chatbot/model/ThreadItem.js +21 -8
  80. package/dist/module/features/chatbot/model/ThreadItem.js.map +1 -1
  81. package/dist/module/features/chatbot/model/messagesHelper.js +1 -5
  82. package/dist/module/features/chatbot/model/messagesHelper.js.map +1 -1
  83. package/dist/module/features/chatbot/model/t2s.js +1 -7
  84. package/dist/module/features/chatbot/model/t2s.js.map +1 -1
  85. package/dist/module/features/chatbot/model/translation.helpers.js.map +1 -1
  86. package/dist/module/features/chatbot/model/translation.js +54 -45
  87. package/dist/module/features/chatbot/model/translation.js.map +1 -1
  88. package/dist/module/features/chatbot/types/api.types.js +2 -0
  89. package/dist/module/features/chatbot/types/model.types.js.map +1 -1
  90. package/dist/module/features/chatbot/types/units.types.js +2 -0
  91. package/dist/module/features/chatbot/types/units.types.js.map +1 -0
  92. package/dist/module/features/feedback/components/TeacherFeedbackButton/colorSchemes.js +18 -9
  93. package/dist/module/features/feedback/components/TeacherFeedbackButton/colorSchemes.js.map +1 -1
  94. package/dist/module/lib/effector/createEntityFieldStore.js +4 -0
  95. package/dist/module/lib/effector/createEntityFieldStore.js.map +1 -1
  96. package/dist/module/lib/helpers/randomElements.js +20 -0
  97. package/dist/module/lib/helpers/randomElements.js.map +1 -0
  98. package/dist/module/shared/icons/HighlighterIcon.js +29 -0
  99. package/dist/module/shared/icons/HighlighterIcon.js.map +1 -0
  100. package/dist/module/shared/icons/StopIcon.js +26 -0
  101. package/dist/module/shared/icons/StopIcon.js.map +1 -0
  102. package/dist/module/shared/icons/icon.types.js +2 -0
  103. package/dist/typescript/commonjs/features/chatbot/components/ChatControls/ChatControls.d.ts.map +1 -1
  104. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts +1 -0
  105. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -1
  106. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts +1 -1
  107. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts.map +1 -1
  108. package/dist/typescript/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts.map +1 -1
  109. package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts.map +1 -1
  110. package/dist/typescript/commonjs/features/chatbot/context/ChatBotContext.d.ts +8 -0
  111. package/dist/typescript/commonjs/features/chatbot/context/ChatBotContext.d.ts.map +1 -0
  112. package/dist/typescript/commonjs/features/chatbot/errorSpotting/ErrorSpottingButton.d.ts +3 -0
  113. package/dist/typescript/commonjs/features/chatbot/errorSpotting/ErrorSpottingButton.d.ts.map +1 -0
  114. package/dist/typescript/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts +28 -0
  115. package/dist/typescript/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts.map +1 -0
  116. package/dist/typescript/commonjs/features/chatbot/index.d.ts +4 -3
  117. package/dist/typescript/commonjs/features/chatbot/index.d.ts.map +1 -1
  118. package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts +19 -14
  119. package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
  120. package/dist/typescript/{module/features/chatbot/model/ChatBotMessageHandler.d.ts → commonjs/features/chatbot/model/ChatBotThreadManager.d.ts} +11 -8
  121. package/dist/typescript/commonjs/features/chatbot/model/ChatBotThreadManager.d.ts.map +1 -0
  122. package/dist/typescript/commonjs/features/chatbot/model/{api.d.ts → ChatbotApi.d.ts} +4 -3
  123. package/dist/typescript/commonjs/features/chatbot/model/ChatbotApi.d.ts.map +1 -0
  124. package/dist/typescript/commonjs/features/chatbot/model/ChatsCacheModel.d.ts +26 -0
  125. package/dist/typescript/commonjs/features/chatbot/model/ChatsCacheModel.d.ts.map +1 -0
  126. package/dist/typescript/commonjs/features/chatbot/model/DefaultMessageCreator.d.ts +3 -2
  127. package/dist/typescript/commonjs/features/chatbot/model/DefaultMessageCreator.d.ts.map +1 -1
  128. package/dist/typescript/commonjs/features/chatbot/model/ThreadItem.d.ts +12 -6
  129. package/dist/typescript/commonjs/features/chatbot/model/ThreadItem.d.ts.map +1 -1
  130. package/dist/typescript/commonjs/features/chatbot/model/messagesHelper.d.ts +3 -4
  131. package/dist/typescript/commonjs/features/chatbot/model/messagesHelper.d.ts.map +1 -1
  132. package/dist/typescript/commonjs/features/chatbot/model/t2s.d.ts +2 -4
  133. package/dist/typescript/commonjs/features/chatbot/model/t2s.d.ts.map +1 -1
  134. package/dist/typescript/commonjs/features/chatbot/model/translation.d.ts +7 -8
  135. package/dist/typescript/commonjs/features/chatbot/model/translation.d.ts.map +1 -1
  136. package/dist/typescript/commonjs/features/chatbot/model/translation.helpers.d.ts +2 -1
  137. package/dist/typescript/commonjs/features/chatbot/model/translation.helpers.d.ts.map +1 -1
  138. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts +2 -11
  139. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts.map +1 -1
  140. package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts +26 -19
  141. package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts.map +1 -1
  142. package/dist/typescript/commonjs/features/chatbot/types/translation.types.d.ts +2 -1
  143. package/dist/typescript/commonjs/features/chatbot/types/translation.types.d.ts.map +1 -1
  144. package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts +31 -0
  145. package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts.map +1 -0
  146. package/dist/typescript/commonjs/features/feedback/components/TeacherFeedbackButton/colorSchemes.d.ts.map +1 -1
  147. package/dist/typescript/commonjs/lib/effector/createEntityFieldStore.d.ts +2 -0
  148. package/dist/typescript/commonjs/lib/effector/createEntityFieldStore.d.ts.map +1 -1
  149. package/dist/typescript/commonjs/lib/helpers/randomElements.d.ts +2 -0
  150. package/dist/typescript/commonjs/lib/helpers/randomElements.d.ts.map +1 -0
  151. package/dist/typescript/commonjs/shared/icons/HighlighterIcon.d.ts +4 -0
  152. package/dist/typescript/commonjs/shared/icons/HighlighterIcon.d.ts.map +1 -0
  153. package/dist/typescript/commonjs/shared/icons/StopIcon.d.ts +4 -0
  154. package/dist/typescript/commonjs/shared/icons/StopIcon.d.ts.map +1 -0
  155. package/dist/typescript/commonjs/shared/icons/icon.types.d.ts +2 -0
  156. package/dist/typescript/commonjs/shared/icons/icon.types.d.ts.map +1 -1
  157. package/dist/typescript/module/features/chatbot/components/ChatControls/ChatControls.d.ts.map +1 -1
  158. package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts +1 -0
  159. package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -1
  160. package/dist/typescript/module/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts +1 -1
  161. package/dist/typescript/module/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts.map +1 -1
  162. package/dist/typescript/module/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts.map +1 -1
  163. package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts.map +1 -1
  164. package/dist/typescript/module/features/chatbot/context/ChatBotContext.d.ts +8 -0
  165. package/dist/typescript/module/features/chatbot/context/ChatBotContext.d.ts.map +1 -0
  166. package/dist/typescript/module/features/chatbot/errorSpotting/ErrorSpottingButton.d.ts +3 -0
  167. package/dist/typescript/module/features/chatbot/errorSpotting/ErrorSpottingButton.d.ts.map +1 -0
  168. package/dist/typescript/module/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts +28 -0
  169. package/dist/typescript/module/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts.map +1 -0
  170. package/dist/typescript/module/features/chatbot/index.d.ts +4 -3
  171. package/dist/typescript/module/features/chatbot/index.d.ts.map +1 -1
  172. package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts +19 -14
  173. package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
  174. package/dist/typescript/{commonjs/features/chatbot/model/ChatBotMessageHandler.d.ts → module/features/chatbot/model/ChatBotThreadManager.d.ts} +11 -8
  175. package/dist/typescript/module/features/chatbot/model/ChatBotThreadManager.d.ts.map +1 -0
  176. package/dist/typescript/module/features/chatbot/model/{api.d.ts → ChatbotApi.d.ts} +4 -3
  177. package/dist/typescript/module/features/chatbot/model/ChatbotApi.d.ts.map +1 -0
  178. package/dist/typescript/module/features/chatbot/model/ChatsCacheModel.d.ts +26 -0
  179. package/dist/typescript/module/features/chatbot/model/ChatsCacheModel.d.ts.map +1 -0
  180. package/dist/typescript/module/features/chatbot/model/DefaultMessageCreator.d.ts +3 -2
  181. package/dist/typescript/module/features/chatbot/model/DefaultMessageCreator.d.ts.map +1 -1
  182. package/dist/typescript/module/features/chatbot/model/ThreadItem.d.ts +12 -6
  183. package/dist/typescript/module/features/chatbot/model/ThreadItem.d.ts.map +1 -1
  184. package/dist/typescript/module/features/chatbot/model/messagesHelper.d.ts +3 -4
  185. package/dist/typescript/module/features/chatbot/model/messagesHelper.d.ts.map +1 -1
  186. package/dist/typescript/module/features/chatbot/model/t2s.d.ts +2 -4
  187. package/dist/typescript/module/features/chatbot/model/t2s.d.ts.map +1 -1
  188. package/dist/typescript/module/features/chatbot/model/translation.d.ts +7 -8
  189. package/dist/typescript/module/features/chatbot/model/translation.d.ts.map +1 -1
  190. package/dist/typescript/module/features/chatbot/model/translation.helpers.d.ts +2 -1
  191. package/dist/typescript/module/features/chatbot/model/translation.helpers.d.ts.map +1 -1
  192. package/dist/typescript/module/features/chatbot/types/api.types.d.ts +2 -11
  193. package/dist/typescript/module/features/chatbot/types/api.types.d.ts.map +1 -1
  194. package/dist/typescript/module/features/chatbot/types/model.types.d.ts +26 -19
  195. package/dist/typescript/module/features/chatbot/types/model.types.d.ts.map +1 -1
  196. package/dist/typescript/module/features/chatbot/types/translation.types.d.ts +2 -1
  197. package/dist/typescript/module/features/chatbot/types/translation.types.d.ts.map +1 -1
  198. package/dist/typescript/module/features/chatbot/types/units.types.d.ts +31 -0
  199. package/dist/typescript/module/features/chatbot/types/units.types.d.ts.map +1 -0
  200. package/dist/typescript/module/features/feedback/components/TeacherFeedbackButton/colorSchemes.d.ts.map +1 -1
  201. package/dist/typescript/module/lib/effector/createEntityFieldStore.d.ts +2 -0
  202. package/dist/typescript/module/lib/effector/createEntityFieldStore.d.ts.map +1 -1
  203. package/dist/typescript/module/lib/helpers/randomElements.d.ts +2 -0
  204. package/dist/typescript/module/lib/helpers/randomElements.d.ts.map +1 -0
  205. package/dist/typescript/module/shared/icons/HighlighterIcon.d.ts +4 -0
  206. package/dist/typescript/module/shared/icons/HighlighterIcon.d.ts.map +1 -0
  207. package/dist/typescript/module/shared/icons/StopIcon.d.ts +4 -0
  208. package/dist/typescript/module/shared/icons/StopIcon.d.ts.map +1 -0
  209. package/dist/typescript/module/shared/icons/icon.types.d.ts +2 -0
  210. package/dist/typescript/module/shared/icons/icon.types.d.ts.map +1 -1
  211. package/package.json +4 -4
  212. package/src/features/chatbot/components/ChatControls/ChatControls.tsx +10 -3
  213. package/src/features/chatbot/components/ChatMessage/ChatMessage.tsx +1 -0
  214. package/src/features/chatbot/components/ChatMessage/ReceivedMessage.tsx +3 -0
  215. package/src/features/chatbot/components/ChatMessages/ChatbotMessages.tsx +14 -0
  216. package/src/features/chatbot/components/Chatbot.tsx +3 -2
  217. package/src/features/chatbot/context/ChatBotContext.ts +18 -0
  218. package/src/features/chatbot/errorSpotting/ErrorSpottingButton.tsx +53 -0
  219. package/src/features/chatbot/errorSpotting/ErrorSpottingModel.ts +116 -0
  220. package/src/features/chatbot/index.ts +3 -3
  221. package/src/features/chatbot/model/ChatBotModel.ts +123 -124
  222. package/src/features/chatbot/model/{ChatBotMessageHandler.ts → ChatBotThreadManager.ts} +28 -16
  223. package/src/features/chatbot/model/{api.ts → ChatbotApi.ts} +19 -2
  224. package/src/features/chatbot/model/ChatsCacheModel.ts +94 -0
  225. package/src/features/chatbot/model/DefaultMessageCreator.ts +3 -3
  226. package/src/features/chatbot/model/ThreadItem.ts +20 -9
  227. package/src/features/chatbot/model/messagesHelper.ts +2 -6
  228. package/src/features/chatbot/model/t2s.ts +3 -10
  229. package/src/features/chatbot/model/translation.helpers.ts +2 -1
  230. package/src/features/chatbot/model/translation.ts +52 -46
  231. package/src/features/chatbot/types/api.types.ts +2 -12
  232. package/src/features/chatbot/types/model.types.ts +38 -26
  233. package/src/features/chatbot/types/translation.types.ts +2 -1
  234. package/src/features/chatbot/types/units.types.ts +34 -0
  235. package/src/features/feedback/components/TeacherFeedbackButton/colorSchemes.ts +9 -0
  236. package/src/lib/effector/createEntityFieldStore.ts +9 -1
  237. package/src/lib/helpers/randomElements.ts +22 -0
  238. package/src/shared/icons/HighlighterIcon.tsx +21 -0
  239. package/src/shared/icons/StopIcon.tsx +17 -0
  240. package/src/shared/icons/icon.types.ts +9 -6
  241. package/dist/commonjs/features/chatbot/model/ChatBotMessageHandler.js.map +0 -1
  242. package/dist/commonjs/features/chatbot/model/api.js.map +0 -1
  243. package/dist/module/features/chatbot/model/ChatBotMessageHandler.js.map +0 -1
  244. package/dist/module/features/chatbot/model/api.js.map +0 -1
  245. package/dist/typescript/commonjs/features/chatbot/model/ChatBotMessageHandler.d.ts.map +0 -1
  246. package/dist/typescript/commonjs/features/chatbot/model/api.d.ts.map +0 -1
  247. package/dist/typescript/module/features/chatbot/model/ChatBotMessageHandler.d.ts.map +0 -1
  248. package/dist/typescript/module/features/chatbot/model/api.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ReceivedMessage.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/chatbot/components/ChatMessage/ReceivedMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAK5C,eAAO,MAAM,eAAe,gHAQzB,YAAY,sBAuBd,CAAA"}
1
+ {"version":3,"file":"ReceivedMessage.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/chatbot/components/ChatMessage/ReceivedMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAM5C,eAAO,MAAM,eAAe,mIASzB,YAAY,sBAwBd,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ChatbotMessages.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/chatbot/components/ChatMessages/ChatbotMessages.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAU,MAAM,OAAO,CAAA;AAGhD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIvD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAyB,MAAM,iBAAiB,CAAA;AACpF,OAAO,EAAkB,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAEzE,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE,YAAY,CAAA;IACnB,cAAc,EAAE,OAAO,CAAA;IACvB,mBAAmB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAA;IAC/C,qBAAqB,EAAE,OAAO,CAAA;IAC9B,kBAAkB,CAAC,EAAE;QACnB,KAAK,EAAE,OAAO,aAAa,CAAA;QAC3B,WAAW,EAAE,OAAO,YAAY,CAAA;KACjC,CAAA;IACD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,SAAS,CAAA;CACjD,CAAA;AAQD,eAAO,MAAM,eAAe,yGAOzB,oBAAoB,sBA0EtB,CAAA"}
1
+ {"version":3,"file":"ChatbotMessages.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/chatbot/components/ChatMessages/ChatbotMessages.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAU,MAAM,OAAO,CAAA;AAGhD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIvD,OAAO,EA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O,MAAM,OAAO,wJAUjB,YAAY,6BAqCd,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { ChatbotModel } from '../model/ChatBotModel';
2
+ type ChatBotContextProps = {
3
+ model: ChatbotModel;
4
+ };
5
+ export declare const ChatBotContext: import("react").Context<ChatBotContextProps | null>;
6
+ export declare function useChatModel(): ChatbotModel;
7
+ export {};
8
+ //# sourceMappingURL=ChatBotContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatBotContext.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/context/ChatBotContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEpD,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE,YAAY,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,cAAc,qDAAkD,CAAA;AAE7E,wBAAgB,YAAY,iBAQ3B"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const ErrorSpottingButton: () => React.JSX.Element | null;
3
+ //# sourceMappingURL=ErrorSpottingButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorSpottingButton.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/errorSpotting/ErrorSpottingButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,eAAO,MAAM,mBAAmB,gCA8B/B,CAAA"}
@@ -0,0 +1,28 @@
1
+ import { ChatbotAPI } from '../model/ChatbotApi';
2
+ import { Store } from 'effector';
3
+ import { ChatItem } from '../types/units.types';
4
+ type ErrorSpottingProps = {
5
+ api: ChatbotAPI;
6
+ $currentChatData: Store<ChatItem>;
7
+ };
8
+ type ActiveErrorSpottingData = {
9
+ isActive: boolean;
10
+ isDisabled: boolean;
11
+ strokesIds: string[];
12
+ validationKey: null | string;
13
+ };
14
+ export declare class ErrorSpottingModel {
15
+ private readonly api;
16
+ readonly errorSpottingPressed: import("effector").EventCallable<void>;
17
+ private readonly activeDataChanged;
18
+ readonly $validationKey: import("effector").StoreWritable<string | null>;
19
+ readonly $activeData: import("effector").StoreWritable<ActiveErrorSpottingData | null>;
20
+ readonly $isLoading: Store<boolean>;
21
+ constructor({ api, $currentChatData }: ErrorSpottingProps);
22
+ private toggleActiveSpotting;
23
+ bindStrokesValidation($store: Store<string | null>): this;
24
+ abortPendingRequest(): void;
25
+ reset(): void;
26
+ }
27
+ export {};
28
+ //# sourceMappingURL=ErrorSpottingModel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorSpottingModel.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/errorSpotting/ErrorSpottingModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAkD,KAAK,EAAE,MAAM,UAAU,CAAA;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE/C,KAAK,kBAAkB,GAAG;IACxB,GAAG,EAAE,UAAU,CAAA;IACf,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;CAClC,CAAA;AAED,KAAK,uBAAuB,GAAG;IAC7B,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,EAAE,OAAO,CAAA;IACnB,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,aAAa,EAAE,IAAI,GAAG,MAAM,CAAA;CAC7B,CAAA;AAOD,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAY;IAEhC,SAAgB,oBAAoB,yCAAgB;IACpD,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAI/B;IAEH,SAAgB,cAAc,kDAAmC;IACjE,SAAgB,WAAW,mEASvB;IAEJ,SAAgB,UAAU,iBAAA;gBAEP,EAAE,GAAG,EAAE,gBAAgB,EAAE,EAAE,kBAAkB;IA+ChE,OAAO,CAAC,oBAAoB;IAMrB,qBAAqB,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;IAQlD,mBAAmB;IAKnB,KAAK;CAIb"}
@@ -1,8 +1,9 @@
1
1
  export { Chatbot } from './components/Chatbot';
2
2
  export { ChatbotModel } from './model/ChatBotModel';
3
3
  export { AudioStatus, type AudioProvider } from './types/t2s.types';
4
- export { MessageVariant, type ConversationMessage, type ChatbotRenderer, type ChatbotModelProps, type IChatDrawBoardAdapter, } from './types/model.types';
5
- export type { PostMessageResponse, ChatAnswer } from './types/api.types';
6
- export { ChatMessageHandler } from './model/ChatBotMessageHandler';
4
+ export { MessageVariant, type ChatbotRenderer, type ChatbotModelProps, type IChatDrawBoardAdapter, } from './types/model.types';
5
+ export type { PostMessageResponse } from './types/api.types';
7
6
  export { DefaultMessagesCreator } from './model/DefaultMessageCreator';
7
+ export type { ChatAnswer } from './types/units.types';
8
+ export type { ConversationMessage } from './types/units.types';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/chatbot/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACnE,OAAO,EACL,cAAc,EACd,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,GAC3B,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/chatbot/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACnE,OAAO,EACL,cAAc,EACd,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,GAC3B,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AACtE,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA"}
@@ -1,17 +1,21 @@
1
1
  import { type Store } from 'effector';
2
- import { ChatbotContext, ChatbotModelProps, ConversationMessage, SendHelpParams, SetHintMessageProps, StartConversationProps } from '../types/model.types';
2
+ import { ChatbotContext, ChatbotModelProps, IChatDrawBoardAdapter, SendHelpParams, SetHintMessageProps, StartConversationProps } from '../types/model.types';
3
3
  import { GetAlternativesResponse } from '../types/api.types';
4
- import { ChatbotAPI } from './api';
4
+ import { ChatbotAPI } from './ChatbotApi';
5
5
  import { ChatbotTranslation } from './translation';
6
6
  import { ChatTextToSpeechModel } from './t2s';
7
7
  import { AudioProvider } from '../types/t2s.types';
8
+ import { ChatBotThreadManager } from './ChatBotThreadManager';
9
+ import { ErrorSpottingModel } from '../errorSpotting/ErrorSpottingModel';
8
10
  type ReinitConversationProps = {
9
11
  key: string;
10
12
  };
11
13
  export declare class ChatbotModel {
14
+ readonly threadManager: ChatBotThreadManager;
12
15
  readonly api: ChatbotAPI;
13
16
  readonly translation: ChatbotTranslation;
14
17
  readonly t2s: ChatTextToSpeechModel;
18
+ readonly errorSpotting: ErrorSpottingModel;
15
19
  readonly $currentKey: import("effector").StoreWritable<string>;
16
20
  readonly resetAlternatives: import("effector").EventCallable<void>;
17
21
  readonly setAlternatives: import("effector").EventCallable<GetAlternativesResponse | null>;
@@ -26,25 +30,26 @@ export declare class ChatbotModel {
26
30
  readonly $context: import("effector").StoreWritable<ChatbotContext | null>;
27
31
  readonly setScrollActive: import("effector").EventCallable<boolean>;
28
32
  readonly $isScrollActive: import("effector").StoreWritable<boolean>;
29
- readonly sendHelpRequestFx: import("effector").Effect<SendHelpParams, void, Error>;
30
33
  readonly defaultMessages: ChatbotModelProps['messages'];
31
- readonly messages: import("../../../lib/effector/createEntityFieldStore").EntityFieldStore<ConversationMessage[]>;
32
- readonly threadIds: import("../../../lib/effector/createEntityFieldStore").EntityFieldStore<string>;
33
- readonly availableChats: import("../../../lib/effector/createEntityFieldStore").EntityFieldStore<boolean>;
34
+ private readonly cache;
34
35
  readonly $currentChatData: Store<{
35
- messages: ConversationMessage[];
36
- threadId: string;
37
- isAvailable: boolean;
38
36
  key: string;
37
+ messages: import("..").ConversationMessage[];
38
+ isAvailable: boolean;
39
+ currentThread: import("../types/units.types").IThreadItem | null;
39
40
  }>;
40
- constructor({ api, messages, $key }: ChatbotModelProps);
41
+ constructor({ api, messages, $key, threadMessagesLimit }: ChatbotModelProps);
41
42
  private createSendHelpRequestFx;
42
- private initChatReplyWatcher;
43
- readonly startConversation: import("effector").Effect<void | StartConversationProps, void | undefined, Error>;
44
- setHintMessage({ key, ...message }: SetHintMessageProps): void;
45
- readonly reinitConversation: import("effector").Effect<ReinitConversationProps, void, Error>;
46
43
  bindKey($store: Store<string>): this;
47
44
  setT2SAudioProvider(audioProvider: AudioProvider): this;
45
+ setDrawBoardAdapter(adapter: IChatDrawBoardAdapter): this;
46
+ readonly sendHelpRequestFx: import("effector").Effect<SendHelpParams, void, Error>;
47
+ readonly startConversation: import("effector").Effect<void | StartConversationProps, void, Error>;
48
+ setHintMessage({ key, ...message }: SetHintMessageProps): void;
49
+ readonly reinitConversation: ({ key }: ReinitConversationProps) => void;
50
+ disableChat(key: string): void;
51
+ softReset: import("effector").Effect<void, void, Error>;
52
+ readonly reset: () => void;
48
53
  }
49
54
  export {};
50
55
  //# sourceMappingURL=ChatBotModel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChatBotModel.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/model/ChatBotModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,KAAK,EAIX,MAAM,UAAU,CAAA;AAEjB,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EAEd,mBAAmB,EAEnB,sBAAsB,EACvB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAGlD,KAAK,uBAAuB,GAAG;IAC7B,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,qBAAa,YAAY;IACvB,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAA;IACxB,QAAQ,CAAC,WAAW,EAAE,kBAAkB,CAAA;IACxC,QAAQ,CAAC,GAAG,EAAE,qBAAqB,CAAA;IAEnC,SAAgB,WAAW,2CAAkB;IAE7C,QAAQ,CAAC,iBAAiB,yCAAgB;IAC1C,QAAQ,CAAC,eAAe,mEAAgD;IACxE,QAAQ,CAAC,aAAa,EAAE,KAAK,CAAC,uBAAuB,GAAG,IAAI,CAAC,CAAA;IAE7D,QAAQ,CAAC,SAAS,4CAAyB;IAC3C,QAAQ,CAAC,UAAU,yCAAgB;IACnC,QAAQ,CAAC,OAAO,4CAA0E;IAE1F,SAAgB,iBAAiB,yCAAgB;IACjD,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAwB;IAC1D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C,MAAM,CAAC;IAS7B,mBAAmB,CAAC,aAAa,EAAE,aAAa;IAKhD,mBAAmB,CAAC,OAAO,EAAE,qBAAqB;IAMzD,SAAgB,iBAAiB,yDAAiC;IAElE,SAAgB,iBAAiB,wEAiB/B;IAEK,cAAc,CAAC,EAAE,GAAG,EAAE,GAAG,OAAO,EAAE,EAAE,mBAAmB;IAK9D,SAAgB,kBAAkB,YAAa,uBAAuB,UAGrE;IAEM,WAAW,CAAC,GAAG,EAAE,MAAM;IAMvB,SAAS,+CAkBd;IAEF,SAAgB,KAAK,aAKpB;CACF"}
@@ -1,10 +1,11 @@
1
+ import { ThreadItem } from './ThreadItem';
1
2
  import { Store } from 'effector';
2
3
  import { ChatHintPayload, ChatHintResponse, PostMessagePayload, PostMessageResponse } from '../types/api.types';
3
4
  import { ChatbotMessages, IChatDrawBoardAdapter } from '../types/model.types';
4
- type ChatMessageHandlerProps = {
5
+ type ChatBotThreadManagerProps = {
5
6
  messagesLimit?: number;
7
+ drawBoardAdapter?: IChatDrawBoardAdapter;
6
8
  messages: ChatbotMessages;
7
- drawBoardAdapter: IChatDrawBoardAdapter;
8
9
  api: {
9
10
  getHint: (props: ChatHintPayload) => Promise<ChatHintResponse>;
10
11
  };
@@ -12,20 +13,22 @@ type ChatMessageHandlerProps = {
12
13
  type ResetCacheProps = {
13
14
  key: string;
14
15
  };
15
- export declare class ChatMessageHandler {
16
+ export declare class ChatBotThreadManager {
16
17
  private readonly api;
17
- private readonly drawBoardAdapter;
18
+ private drawBoardAdapter;
18
19
  private readonly threads;
20
+ readonly $threads: import("effector").StoreWritable<Map<string, ThreadItem>>;
19
21
  private readonly messagesLimit;
20
22
  private currentKey;
21
23
  private currentBinding;
22
24
  private readonly defaultMessages;
23
- constructor({ drawBoardAdapter, api, messagesLimit, messages, }: ChatMessageHandlerProps);
25
+ constructor({ drawBoardAdapter, api, messagesLimit, messages, }: ChatBotThreadManagerProps);
24
26
  bindKeyStore($store: Store<string>): this;
25
27
  private getThreadItem;
26
- readonly postMessageFx: ({ problemAnswer, problem, answer, language, imageAltText, }: PostMessagePayload) => Promise<PostMessageResponse>;
27
- resetThread: import("effector/effector.umd").Effect<ResetCacheProps, void, Error>;
28
+ setDrawBoardAdapter(adapter: IChatDrawBoardAdapter): void;
29
+ readonly postMessage: ({ problemAnswer, problem, answer, language, imageAltText, }: PostMessagePayload) => Promise<PostMessageResponse>;
30
+ resetThread: ({ key }: ResetCacheProps) => void;
28
31
  resetAll(): void;
29
32
  }
30
33
  export {};
31
- //# sourceMappingURL=ChatBotMessageHandler.d.ts.map
34
+ //# sourceMappingURL=ChatBotThreadManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatBotThreadManager.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/model/ChatBotThreadManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAe,KAAK,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAG7E,KAAK,yBAAyB,GAAG;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,gBAAgB,CAAC,EAAE,qBAAqB,CAAA;IACxC,QAAQ,EAAE,eAAe,CAAA;IACzB,GAAG,EAAE;QACH,OAAO,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAA;KAC/D,CAAA;CACF,CAAA;AAED,KAAK,eAAe,GAAG;IACrB,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAA;IACpB,OAAO,CAAC,gBAAgB,CAAqC;IAC7D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgC;IAExD,SAAgB,QAAQ,4DAA6C;IAErE,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAA;IAC9B,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,cAAc,CAA4B;IAElD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAA;gBAEb,EACjB,gBAAgB,EAChB,GAAG,EACH,aAA6D,EAC7D,QAAQ,GACT,EAAE,yBAAyB;IAOrB,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;YAQ3B,aAAa;IAqBpB,mBAAmB,CAAC,OAAO,EAAE,qBAAqB;IAIzD,SAAgB,WAAW,gEAMxB,kBAAkB,KAAG,OAAO,CAAC,mBAAmB,CAAC,CAsBnD;IAEM,WAAW,YAAa,eAAe,UAE7C;IAEM,QAAQ;CAGhB"}
@@ -1,10 +1,11 @@
1
- import { ChatbotModelProps } from '../types/model.types';
1
+ import { ChatbotApiRequests, SpotErrorPayload, SpotErrorResponse } from '../types/model.types';
2
2
  import { GoogleTranslatePayload, GoogleTranslateResponse } from '../types/api.types';
3
3
  export declare class ChatbotAPI {
4
4
  readonly postMessageFx: import("../../../lib/effector/createControllerEffect").ControlledEffect<import("../types/api.types").PostMessagePayload, import("../types/api.types").PostMessageResponse>;
5
5
  readonly getAlternativesFx: import("effector").Effect<import("../types/api.types").GetAlternativesPayload, import("../types/api.types").GetAlternativesResponse, Error>;
6
6
  readonly translateTextFx: import("effector").Effect<GoogleTranslatePayload, GoogleTranslateResponse, Error>;
7
7
  readonly textToSpeechTextFx: import("effector").Effect<import("../types/api.types").GoogleText2SpeechPayload, import("../types/api.types").GoogleText2SpeechResponse, Error>;
8
- constructor(api: ChatbotModelProps['api']);
8
+ readonly spotErrorFx: import("../../../lib/effector/createControllerEffect").ControlledEffect<SpotErrorPayload, SpotErrorResponse>;
9
+ constructor(api: ChatbotApiRequests);
9
10
  }
10
- //# sourceMappingURL=api.d.ts.map
11
+ //# sourceMappingURL=ChatbotApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatbotApi.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/model/ChatbotApi.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAC9F,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AAIpF,qBAAa,UAAU;IACrB,SAAgB,aAAa,6KAAA;IAC7B,SAAgB,iBAAiB,8IAAA;IACjC,SAAgB,eAAe,oFAAA;IAC/B,SAAgB,kBAAkB,kJAAA;IAElC,SAAgB,WAAW,+GAAA;gBAEf,GAAG,EAAE,kBAAkB;CAsCpC"}
@@ -0,0 +1,26 @@
1
+ import { ChatAnswer, ChatItem, ConversationMessage, IThreadItem } from '../types/units.types';
2
+ type ReinitChatThreadSettings = {
3
+ initialOption: ChatAnswer;
4
+ };
5
+ type UpdateProps = {
6
+ key: string;
7
+ data: Partial<ChatItem>;
8
+ };
9
+ type AddMessagesProps = {
10
+ messages: ConversationMessage[];
11
+ thread?: IThreadItem | null;
12
+ };
13
+ export declare function defaultChatData(props?: Partial<ChatItem>): ChatItem;
14
+ export declare class ChatsCacheModel {
15
+ readonly update: import("effector").EventCallable<UpdateProps>;
16
+ private readonly cache;
17
+ readonly $data: import("effector").StoreWritable<Record<string, ChatItem>>;
18
+ readonly reset: import("effector").EventCallable<void>;
19
+ disableChat(key: string): void;
20
+ reinitChatThread(key: string, { initialOption }: ReinitChatThreadSettings): void;
21
+ setSingleMessage(key: string, message: ConversationMessage): void;
22
+ addMessages(key: string, { messages, thread }: AddMessagesProps): void;
23
+ add(key: string, data: ChatItem): void;
24
+ }
25
+ export {};
26
+ //# sourceMappingURL=ChatsCacheModel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatsCacheModel.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/model/ChatsCacheModel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAE7F,KAAK,wBAAwB,GAAG;IAC9B,aAAa,EAAE,UAAU,CAAA;CAC1B,CAAA;AAED,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;CACxB,CAAA;AAED,KAAK,gBAAgB,GAAG;IACtB,QAAQ,EAAE,mBAAmB,EAAE,CAAA;IAC/B,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;CAC5B,CAAA;AAED,wBAAgB,eAAe,CAAC,KAAK,GAAE,OAAO,CAAC,QAAQ,CAAM,GAAG,QAAQ,CAOvE;AAED,qBAAa,eAAe;IAC1B,SAAgB,MAAM,gDAA6B;IACnD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAMrB;IAED,SAAgB,KAAK,6DAAoB;IACzC,SAAgB,KAAK,yCAAmB;IAEjC,WAAW,CAAC,GAAG,EAAE,MAAM;IAQvB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,aAAa,EAAE,EAAE,wBAAwB;IAoBzE,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB;IAU1D,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAa,EAAE,EAAE,gBAAgB;IAYtE,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ;CAGvC"}
@@ -1,5 +1,6 @@
1
- import { ChatAnswer, PostMessageResponse } from '../types/api.types';
2
- type ChatMessage = PostMessageResponse & {
1
+ import { PostMessageResponse } from '../types/api.types';
2
+ import { ChatAnswer } from '../types/units.types';
3
+ type ChatMessage = Omit<PostMessageResponse, 'thread'> & {
3
4
  id: string;
4
5
  isOwnMessage: boolean;
5
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultMessageCreator.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/model/DefaultMessageCreator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAGpE,KAAK,WAAW,GAAG,mBAAmB,GAAG;IACvC,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,OAAO,CAAA;CACtB,CAAA;AAED,KAAK,sBAAsB,GAAG;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,KAAK,0BAA0B,CAAC,CAAC,SAAS,MAAM,IAAI;IAClD,UAAU,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,CAAA;CAC/B,CAAA;AAED,qBAAa,sBAAsB,CAAC,CAAC,SAAS,MAAM;IAClD,SAAgB,eAAe,yCAAgB;IAE/C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAyC;IAC9D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAA;gBAEX,EAAE,UAAU,EAAE,EAAE,0BAA0B,CAAC,CAAC,CAAC;IAclD,aAAa,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,KAAa,EAAE,GAAE,sBAA2B;IAYpE,YAAY,CAAC,GAAG,EAAE,CAAC;CAQ3B"}
1
+ {"version":3,"file":"DefaultMessageCreator.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/model/DefaultMessageCreator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEjD,KAAK,WAAW,GAAG,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC,GAAG;IACvD,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,OAAO,CAAA;CACtB,CAAA;AAED,KAAK,sBAAsB,GAAG;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,KAAK,0BAA0B,CAAC,CAAC,SAAS,MAAM,IAAI;IAClD,UAAU,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,CAAA;CAC/B,CAAA;AAED,qBAAa,sBAAsB,CAAC,CAAC,SAAS,MAAM;IAClD,SAAgB,eAAe,yCAAgB;IAE/C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAyC;IAC9D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAA;gBAEX,EAAE,UAAU,EAAE,EAAE,0BAA0B,CAAC,CAAC,CAAC;IAclD,aAAa,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,KAAa,EAAE,GAAE,sBAA2B;IAWpE,YAAY,CAAC,GAAG,EAAE,CAAC;CAQ3B"}
@@ -1,21 +1,27 @@
1
- import { Stroke } from '../types/api.types';
1
+ import { FullStrokeData, IThreadItem } from '../types/units.types';
2
2
  type ThreadItemProps = {
3
- strokes?: Stroke[] | null;
3
+ strokes: FullStrokeData[];
4
+ key: string;
4
5
  };
5
6
  export declare class ThreadItem {
6
- readonly strokes: Stroke[] | null;
7
- readonly hints: string[];
8
- constructor({ strokes }?: ThreadItemProps);
7
+ readonly key: string | null;
8
+ readonly strokes: FullStrokeData[] | null;
9
+ readonly history: string[];
10
+ constructor(props?: ThreadItemProps | null);
9
11
  getNextHintProps(): {
10
12
  previousHint: string;
11
13
  stroke?: undefined;
12
14
  } | {
13
- stroke: Stroke[];
15
+ stroke: {
16
+ x: number[];
17
+ y: number[];
18
+ }[];
14
19
  previousHint?: undefined;
15
20
  } | {
16
21
  previousHint?: undefined;
17
22
  stroke?: undefined;
18
23
  };
24
+ toObject(): IThreadItem;
19
25
  }
20
26
  export {};
21
27
  //# sourceMappingURL=ThreadItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadItem.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/model/ThreadItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAE3C,KAAK,eAAe,GAAG;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;CAC1B,CAAA;AAED,qBAAa,UAAU;IACrB,SAAgB,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IACxC,SAAgB,KAAK,EAAE,MAAM,EAAE,CAAK;gBAEjB,EAAE,OAAO,EAAE,GAAE,eAAoB;IAI7C,gBAAgB;;;;;;;;;;CAaxB"}
1
+ {"version":3,"file":"ThreadItem.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/model/ThreadItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAElE,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,cAAc,EAAE,CAAA;IACzB,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,qBAAa,UAAU;IACrB,SAAgB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAO;IACzC,SAAgB,OAAO,EAAE,cAAc,EAAE,GAAG,IAAI,CAAA;IAChD,SAAgB,OAAO,EAAE,MAAM,EAAE,CAAK;gBAEnB,KAAK,CAAC,EAAE,eAAe,GAAG,IAAI;IAK1C,gBAAgB;;;;;;;;;;;;;IAchB,QAAQ,IAAI,WAAW;CAO/B"}
@@ -1,8 +1,8 @@
1
- import { ConversationMessage, CreateMessageResponse } from '../types/model.types';
1
+ import { CreateMessageResponse } from '../types/model.types';
2
+ import { ConversationMessage } from '../types/units.types';
2
3
  type OwnMessageProps = {
3
4
  message?: string;
4
5
  translatedMessage?: string;
5
- threadId?: string | null;
6
6
  };
7
7
  export declare class messagesHelper {
8
8
  static createAnswer(data: CreateMessageResponse): ConversationMessage;
@@ -12,10 +12,9 @@ export declare class messagesHelper {
12
12
  translatedMessage: string | undefined;
13
13
  isOwnMessage: boolean;
14
14
  options: never[];
15
- threadId: string;
16
15
  endMessage: boolean;
17
16
  };
18
- static createOwn({ message, translatedMessage, threadId, }: OwnMessageProps): ConversationMessage;
17
+ static createOwn({ message, translatedMessage, }: OwnMessageProps): ConversationMessage;
19
18
  }
20
19
  export {};
21
20
  //# sourceMappingURL=messagesHelper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"messagesHelper.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/model/messagesHelper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAEjF,KAAK,eAAe,GAAG;IACrB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB,CAAA;AAED,qBAAa,cAAc;WACX,YAAY,CAAC,IAAI,EAAE,qBAAqB,GAAG,mBAAmB;WAW9D,UAAU,CAAC,IAAI,EAAE,qBAAqB;;;;;;;;;WAYtC,SAAS,CAAC,EACtB,OAAY,EACZ,iBAAiB,EACjB,QAAQ,GACT,EAAE,eAAe,GAAG,mBAAmB;CAUzC"}
1
+ {"version":3,"file":"messagesHelper.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/model/messagesHelper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAE1D,KAAK,eAAe,GAAG;IACrB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAA;AAED,qBAAa,cAAc;WACX,YAAY,CAAC,IAAI,EAAE,qBAAqB,GAAG,mBAAmB;WAU9D,UAAU,CAAC,IAAI,EAAE,qBAAqB;;;;;;;;WAWtC,SAAS,CAAC,EACtB,OAAY,EACZ,iBAAiB,GAClB,EAAE,eAAe,GAAG,mBAAmB;CASzC"}
@@ -1,8 +1,6 @@
1
- import { Store } from 'effector';
2
1
  import { AudioProvider, AudioStatus, PlayTextToSpeechProps } from '../types/t2s.types';
3
- import { ChatbotAPI } from './api';
2
+ import { ChatbotAPI } from './ChatbotApi';
4
3
  type ChatTextToSpeechModelProps = {
5
- $isOpen: Store<boolean>;
6
4
  api: ChatbotAPI;
7
5
  };
8
6
  export declare class ChatTextToSpeechModel {
@@ -13,7 +11,7 @@ export declare class ChatTextToSpeechModel {
13
11
  readonly $currentPlayingId: import("effector").StoreWritable<string | null>;
14
12
  readonly setStatus: import("effector").EventCallable<AudioStatus>;
15
13
  readonly $status: import("effector").StoreWritable<AudioStatus>;
16
- constructor({ $isOpen, api }: ChatTextToSpeechModelProps);
14
+ constructor({ api }: ChatTextToSpeechModelProps);
17
15
  setAudioProvider(audioProvider: AudioProvider): void;
18
16
  private getCacheKey;
19
17
  play({ text, messageId, isTranslated, config }: PlayTextToSpeechProps): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"t2s.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/model/t2s.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,EAAwB,MAAM,UAAU,CAAA;AAE5E,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAElC,KAAK,0BAA0B,GAAG;IAChC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;IACvB,GAAG,EAAE,UAAU,CAAA;CAChB,CAAA;AAED,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAY;IAChC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA6B;IACxD,OAAO,CAAC,aAAa,CAA6B;IAElD,QAAQ,CAAC,mBAAmB,kDAA+B;IAC3D,QAAQ,CAAC,iBAAiB,kDAA0C;IACpE,QAAQ,CAAC,SAAS,gDAA6B;IAC/C,QAAQ,CAAC,OAAO,gDAA+C;gBAEnD,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,0BAA0B;IAUjD,gBAAgB,CAAC,aAAa,EAAE,aAAa;IAIpD,OAAO,CAAC,WAAW,CAElB;IAEK,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,qBAAqB;IA0DpE,IAAI;IAKX,SAAgB,KAAK,+CAInB;CACH"}
1
+ {"version":3,"file":"t2s.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/model/t2s.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,KAAK,0BAA0B,GAAG;IAChC,GAAG,EAAE,UAAU,CAAA;CAChB,CAAA;AAED,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAY;IAChC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA6B;IACxD,OAAO,CAAC,aAAa,CAA6B;IAElD,QAAQ,CAAC,mBAAmB,kDAA+B;IAC3D,QAAQ,CAAC,iBAAiB,kDAA0C;IACpE,QAAQ,CAAC,SAAS,gDAA6B;IAC/C,QAAQ,CAAC,OAAO,gDAA+C;gBAEnD,EAAE,GAAG,EAAE,EAAE,0BAA0B;IAIxC,gBAAgB,CAAC,aAAa,EAAE,aAAa;IAIpD,OAAO,CAAC,WAAW,CAElB;IAEK,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,qBAAqB;IA0DpE,IAAI;IAKX,SAAgB,KAAK,+CAInB;CACH"}
@@ -1,37 +1,36 @@
1
1
  import { EventCallable, Store } from 'effector';
2
2
  import { TranslateMessageFxProps } from '../types/translation.types';
3
- import { ChatbotContext, ChatbotMessages, ConversationMessage } from '../types/model.types';
3
+ import { ChatbotContext, ChatbotMessages } from '../types/model.types';
4
4
  import { GetAlternativesResponse } from '../types/api.types';
5
- import { ChatbotAPI } from './api';
6
- import { EntityFieldStore } from '../../../lib/effector/createEntityFieldStore';
5
+ import { ChatbotAPI } from './ChatbotApi';
6
+ import { ChatsCacheModel } from './ChatsCacheModel';
7
+ import { ConversationMessage } from '../types/units.types';
7
8
  type ChatbotTranslationProps = {
8
9
  api: ChatbotAPI;
9
10
  $key: Store<string>;
10
11
  defaultMessages: ChatbotMessages;
11
- messagesModel: EntityFieldStore<ConversationMessage[]>;
12
12
  $context: Store<ChatbotContext | null>;
13
13
  alternativesModel: {
14
14
  set: EventCallable<GetAlternativesResponse | null>;
15
15
  $store: Store<GetAlternativesResponse | null>;
16
16
  };
17
+ chats: ChatsCacheModel;
17
18
  };
18
19
  export declare class ChatbotTranslation {
19
20
  private readonly api;
20
21
  private readonly $key;
21
22
  private readonly $context;
22
23
  private readonly defaultMessages;
23
- private readonly messagesModel;
24
24
  private readonly alternativesModel;
25
25
  readonly setIsTranslated: EventCallable<boolean>;
26
26
  readonly $isTranslated: import("effector").StoreWritable<boolean>;
27
27
  readonly translateAllMessagesFx: import("effector").Effect<void, ConversationMessage[], Error>;
28
- constructor({ api, $key, defaultMessages, messagesModel, alternativesModel, $context, }: ChatbotTranslationProps);
28
+ constructor({ api, $key, defaultMessages, alternativesModel, $context, chats, }: ChatbotTranslationProps);
29
29
  private shouldSkipTranslation;
30
- private initTranslationSamples;
31
30
  private translateRequest;
32
31
  private addTranslationToAlternatives;
33
32
  private readonly translateBatchFx;
34
- readonly translateMessagesFx: import("effector").Effect<TranslateMessageFxProps, ConversationMessage[], Error>;
33
+ readonly applyTranslationFx: import("effector").Effect<Omit<TranslateMessageFxProps, "isTranslated">, ConversationMessage[], Error>;
35
34
  reset(): void;
36
35
  }
37
36
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"translation.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/model/translation.ts"],"names":[],"mapp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,CAAC,QAAQ,CAAA;IACzB,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAA;IAChC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAA;IAElC,QAAQ,CAAC,eAAe,yBAAyB;IACjD,QAAQ,CAAC,aAAa,4CAAuC;IAE7D,QAAQ,CAAC,sBAAsB,gEAAA;gBAEnB,EACV,GAAG,EACH,IAAI,EACJ,eAAe,EACf,iBAAiB,EACjB,QAAQ,EACR,KAAK,GACN,EAAE,uBAAuB;IAyB1B,OAAO,CAAC,qBAAqB;YAef,gBAAgB;IAmB9B,OAAO,CAAC,4BAA4B;IAIpC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAkDhC;IAED,SAAgB,kBAAkB,yGAmChC;IAEK,KAAK;CAGb"}
@@ -1,5 +1,6 @@
1
1
  import { AddTranslationToAlternativesProps, GetOptionsProps, GetOptionsResult } from '../types/translation.types';
2
- import { ChatAnswer, GetAlternativesResponse } from '../types/api.types';
2
+ import { GetAlternativesResponse } from '../types/api.types';
3
+ import { ChatAnswer } from '../types/units.types';
3
4
  export declare function getOptionsForTranslation({ lastMessage, alternatives, }: GetOptionsProps): GetOptionsResult;
4
5
  export declare function addTranslationsToAlternative({ alternatives, translatedHints, translatedDefaults, }: AddTranslationToAlternativesProps): GetAlternativesResponse;
5
6
  export declare function addTranslationToOptions(options: ChatAnswer[], translations: string[]): {
@@ -1 +1 @@
1
- {"version":3,"file":"translation.helpers.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/model/translation.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EACjC,eAAe,EACf,gBAAgB,EACjB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AAExE,wBAAgB,wBAAwB,CAAC,EACvC,WAAW,EACX,YAAY,GACb,EAAE,eAAe,GAAG,gBAAgB,CAmBpC;AAED,wBAAgB,4BAA4B,CAAC,EAC3C,YAAY,EACZ,eAAe,EACf,kBAAkB,GACnB,EAAE,iCAAiC,GAAG,uBAAuB,CAe7D;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE;;;;IAKpF"}
1
+ {"version":3,"file":"translation.helpers.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/model/translation.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EACjC,eAAe,EACf,gBAAgB,EACjB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEjD,wBAAgB,wBAAwB,CAAC,EACvC,WAAW,EACX,YAAY,GACb,EAAE,eAAe,GAAG,gBAAgB,CAmBpC;AAED,wBAAgB,4BAA4B,CAAC,EAC3C,YAAY,EACZ,eAAe,EACf,kBAAkB,GACnB,EAAE,iCAAiC,GAAG,uBAAuB,CAe7D;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE;;;;IAKpF"}
@@ -1,8 +1,4 @@
1
- export type ChatAnswer = {
2
- text: string;
3
- promptKey: string;
4
- translatedText?: string;
5
- };
1
+ import { ChatAnswer, IThreadItem, Stroke } from './units.types';
6
2
  export type GetAlternativesPayload = {
7
3
  municipalityId: string;
8
4
  assignmentClassGrade: number;
@@ -18,15 +14,14 @@ export type PostMessagePayload = {
18
14
  language: string;
19
15
  problemAnswer: string[];
20
16
  answer?: string | string[];
21
- threadId?: string | null;
22
17
  problem: string;
23
18
  imageAltText?: string;
24
19
  };
25
20
  export type PostMessageResponse = {
26
21
  message: string;
27
- threadId: string;
28
22
  options: ChatAnswer[];
29
23
  endMessage?: boolean;
24
+ thread: IThreadItem;
30
25
  };
31
26
  export type GoogleTranslatePayload = {
32
27
  text: string[];
@@ -57,10 +52,6 @@ export type GoogleText2SpeechPayload = {
57
52
  export type GoogleText2SpeechResponse = string | undefined | {
58
53
  audioContent?: string;
59
54
  };
60
- export type Stroke = {
61
- x: number[];
62
- y: number[];
63
- };
64
55
  export type ChatHintPayload = {
65
56
  problemDescription: string;
66
57
  correctAnswer: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"api.types.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/types/api.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,cAAc,EAAE,MAAM,CAAA;IACtB,oBAAoB,EAAE,MAAM,CAAA;CAC7B,GAAG,IAAI,CAAA;AAER,MAAM,MAAM,uBAAuB,GAAG;IACpC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,EAAE;QACP,OAAO,EAAE,UAAU,EAAE,CAAA;QACrB,KAAK,EAAE,UAAU,EAAE,CAAA;KACpB,CAAA;CACF,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,UAAU,EAAE,CAAA;IACrB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE;QACJ,YAAY,EAAE;YAAE,cAAc,EAAE,MAAM,CAAC;YAAC,sBAAsB,EAAE,MAAM,CAAA;SAAE,EAAE,CAAA;KAC3E,CAAA;CACF,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAA;KACb,CAAA;IACD,KAAK,EAAE;QACL,YAAY,EAAE,MAAM,CAAA;QACpB,IAAI,EAAE,MAAM,CAAA;KACb,CAAA;IACD,WAAW,EAAE;QACX,aAAa,EAAE,MAAM,CAAA;QACrB,KAAK,EAAE,MAAM,CAAA;QACb,YAAY,EAAE,MAAM,CAAA;KACrB,CAAA;CACF,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG,MAAM,GAAG,SAAS,GAAG;IAAE,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAEtF,MAAM,MAAM,MAAM,GAAG;IACnB,CAAC,EAAE,MAAM,EAAE,CAAA;IACX,CAAC,EAAE,MAAM,EAAE,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,kBAAkB,EAAE,MAAM,CAAA;IAC1B,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC9B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA"}
1
+ {"version":3,"file":"api.types.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/types/api.types.ts"],"names":[],"mappings":"AAAA,O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,WAAW,EAAE;QACX,aAAa,EAAE,MAAM,CAAA;QACrB,KAAK,EAAE,MAAM,CAAA;QACb,YAAY,EAAE,MAAM,CAAA;KACrB,CAAA;CACF,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG,MAAM,GAAG,SAAS,GAAG;IAAE,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAEtF,MAAM,MAAM,eAAe,GAAG;IAC5B,kBAAkB,EAAE,MAAM,CAAA;IAC1B,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC9B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA"}
@@ -1,30 +1,33 @@
1
1
  import type { Store } from 'effector';
2
- import { GetAlternativesResponse, PostMessagePayload, PostMessageResponse, GoogleTranslatePayload, GoogleTranslateResponse, GoogleText2SpeechPayload, GoogleText2SpeechResponse, ChatAnswer, GetAlternativesPayload, Stroke } from './api.types';
2
+ import { ChatHintPayload, ChatHintResponse, GetAlternativesPayload, GetAlternativesResponse, GoogleText2SpeechPayload, GoogleText2SpeechResponse, GoogleTranslatePayload, GoogleTranslateResponse, PostMessagePayload, PostMessageResponse } from './api.types';
3
3
  import { ExtendWithOptional } from '../../../lib/helpers/types';
4
- export type ConversationMessage = {
5
- id: string;
6
- message: string;
7
- threadId: string;
8
- options: ChatAnswer[];
9
- isOwnMessage: boolean;
10
- translatedMessage?: string;
11
- endMessage?: boolean;
12
- };
4
+ import { ChatAnswer, ConversationMessage, FullStrokeData } from './units.types';
13
5
  export type ChatbotMessages = {
14
6
  error: ConversationMessage;
15
7
  start: ConversationMessage;
16
8
  endMessage: ConversationMessage;
17
9
  anotherHintOption: ChatAnswer;
18
10
  };
11
+ export type SpotErrorPayload = {
12
+ strokes: FullStrokeData[];
13
+ };
14
+ export type SpotErrorResponse = {
15
+ strokesIds: string[];
16
+ };
17
+ export type ChatbotApiRequests = {
18
+ getAlternatives: (props: GetAlternativesPayload) => Promise<GetAlternativesResponse>;
19
+ postMessage: (props: PostMessagePayload) => Promise<PostMessageResponse>;
20
+ postTranslateText: (props: GoogleTranslatePayload) => Promise<GoogleTranslateResponse>;
21
+ postTextToSpeech: (props: GoogleText2SpeechPayload) => Promise<GoogleText2SpeechResponse>;
22
+ spotError: (props: SpotErrorPayload) => Promise<SpotErrorResponse>;
23
+ };
19
24
  export type ChatbotModelProps = {
20
25
  $key?: Store<string>;
21
- api: {
22
- getAlternatives: (props: GetAlternativesPayload) => Promise<GetAlternativesResponse>;
23
- postMessage: (props: PostMessagePayload) => Promise<PostMessageResponse>;
24
- postTranslateText: (props: GoogleTranslatePayload) => Promise<GoogleTranslateResponse>;
25
- postTextToSpeech: (props: GoogleText2SpeechPayload) => Promise<GoogleText2SpeechResponse>;
26
+ api: Omit<ChatbotApiRequests, 'postMessage'> & {
27
+ requestHint: (props: ChatHintPayload) => Promise<ChatHintResponse>;
26
28
  };
27
29
  messages: ChatbotMessages;
30
+ threadMessagesLimit?: number;
28
31
  };
29
32
  export type SendHelpParams = {
30
33
  message: string;
@@ -32,8 +35,6 @@ export type SendHelpParams = {
32
35
  };
33
36
  export type SendHelpProps = SendHelpParams & {
34
37
  key: string;
35
- isTranslated: boolean;
36
- threadId: string;
37
38
  context: ChatbotContext | null;
38
39
  };
39
40
  export type SetHintMessageProps = {
@@ -55,9 +56,14 @@ export type ChatbotRenderer = {
55
56
  variant: MessageVariant;
56
57
  withTextToSpeech: boolean;
57
58
  };
58
- export type CreateMessageResponse = ExtendWithOptional<PostMessageResponse, ConversationMessage>;
59
+ export type CreateMessageResponse = ExtendWithOptional<Omit<PostMessageResponse, 'thread'>, ConversationMessage>;
60
+ type GetVisibleStrokesResponse = {
61
+ strokes: FullStrokeData[];
62
+ validationKey: string;
63
+ };
59
64
  export type IChatDrawBoardAdapter = {
60
- getVisibleStrokes(): Promise<Stroke[] | null>;
65
+ $strokesValidationKey: Store<string | null>;
66
+ getVisibleStrokes(): Promise<GetVisibleStrokesResponse | null>;
61
67
  };
62
68
  export type ChatbotContext = {
63
69
  language: string;
@@ -67,4 +73,5 @@ export type ChatbotContext = {
67
73
  translationTargetLanguage: string;
68
74
  imageDescription?: string;
69
75
  };
76
+ export {};
70
77
  //# sourceMappingURL=model.types.d.ts.map