@magmamath/students-features 0.1.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 (405) hide show
  1. package/README.md +33 -0
  2. package/dist/commonjs/features/chatbot/components/Alternatives/Alternatives.js +60 -0
  3. package/dist/commonjs/features/chatbot/components/Alternatives/Alternatives.js.map +1 -0
  4. package/dist/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.js +96 -0
  5. package/dist/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.js.map +1 -0
  6. package/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js +97 -0
  7. package/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js.map +1 -0
  8. package/dist/commonjs/features/chatbot/components/ChatMessage/ChatMessage.js +27 -0
  9. package/dist/commonjs/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -0
  10. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageLoader.js +56 -0
  11. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -0
  12. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.js +88 -0
  13. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.js.map +1 -0
  14. package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js +87 -0
  15. package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -0
  16. package/dist/commonjs/features/chatbot/components/ChatMessage/SentMessage.js +43 -0
  17. package/dist/commonjs/features/chatbot/components/ChatMessage/SentMessage.js.map +1 -0
  18. package/dist/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.js +130 -0
  19. package/dist/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +1 -0
  20. package/dist/commonjs/features/chatbot/components/Chatbot.js +69 -0
  21. package/dist/commonjs/features/chatbot/components/Chatbot.js.map +1 -0
  22. package/dist/commonjs/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.js +65 -0
  23. package/dist/commonjs/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.js.map +1 -0
  24. package/dist/commonjs/features/chatbot/constants.js +31 -0
  25. package/dist/commonjs/features/chatbot/constants.js.map +1 -0
  26. package/dist/commonjs/features/chatbot/helpers.js +12 -0
  27. package/dist/commonjs/features/chatbot/helpers.js.map +1 -0
  28. package/dist/commonjs/features/chatbot/index.js +34 -0
  29. package/dist/commonjs/features/chatbot/index.js.map +1 -0
  30. package/dist/commonjs/features/chatbot/model/api.js +18 -0
  31. package/dist/commonjs/features/chatbot/model/api.js.map +1 -0
  32. package/dist/commonjs/features/chatbot/model/model.js +244 -0
  33. package/dist/commonjs/features/chatbot/model/model.js.map +1 -0
  34. package/dist/commonjs/features/chatbot/model/t2s.js +104 -0
  35. package/dist/commonjs/features/chatbot/model/t2s.js.map +1 -0
  36. package/dist/commonjs/features/chatbot/model/translation.js +203 -0
  37. package/dist/commonjs/features/chatbot/model/translation.js.map +1 -0
  38. package/dist/commonjs/features/chatbot/types/api.types.js +2 -0
  39. package/dist/commonjs/features/chatbot/types/api.types.js.map +1 -0
  40. package/dist/commonjs/features/chatbot/types/model.types.js +12 -0
  41. package/dist/commonjs/features/chatbot/types/model.types.js.map +1 -0
  42. package/dist/commonjs/features/chatbot/types/t2s.types.js +13 -0
  43. package/dist/commonjs/features/chatbot/types/t2s.types.js.map +1 -0
  44. package/dist/commonjs/features/chatbot/types/translation.types.js +6 -0
  45. package/dist/commonjs/features/chatbot/types/translation.types.js.map +1 -0
  46. package/dist/commonjs/index.js +42 -0
  47. package/dist/commonjs/index.js.map +1 -0
  48. package/dist/commonjs/lib/createFeature/createFeature.js +28 -0
  49. package/dist/commonjs/lib/createFeature/createFeature.js.map +1 -0
  50. package/dist/commonjs/lib/effector/createControllerEffect.js +51 -0
  51. package/dist/commonjs/lib/effector/createControllerEffect.js.map +1 -0
  52. package/dist/commonjs/lib/effector/createEntityFieldStore.js +42 -0
  53. package/dist/commonjs/lib/effector/createEntityFieldStore.js.map +1 -0
  54. package/dist/commonjs/lib/effector/index.js +20 -0
  55. package/dist/commonjs/lib/effector/index.js.map +1 -0
  56. package/dist/commonjs/lib/helpers/helpers.js +9 -0
  57. package/dist/commonjs/lib/helpers/helpers.js.map +1 -0
  58. package/dist/commonjs/lib/localization/en.json +2 -0
  59. package/dist/commonjs/lib/localization/gb.json +2 -0
  60. package/dist/commonjs/lib/localization/sw.json +2 -0
  61. package/dist/commonjs/shared/hooks/useDebounce.js +21 -0
  62. package/dist/commonjs/shared/hooks/useDebounce.js.map +1 -0
  63. package/dist/commonjs/shared/icons/ArrowRightIcon.js +30 -0
  64. package/dist/commonjs/shared/icons/ArrowRightIcon.js.map +1 -0
  65. package/dist/commonjs/shared/icons/ChatbotIcon.js +148 -0
  66. package/dist/commonjs/shared/icons/ChatbotIcon.js.map +1 -0
  67. package/dist/commonjs/shared/icons/CloseIcon.js +28 -0
  68. package/dist/commonjs/shared/icons/CloseIcon.js.map +1 -0
  69. package/dist/commonjs/shared/icons/GlobeIcon.js +30 -0
  70. package/dist/commonjs/shared/icons/GlobeIcon.js.map +1 -0
  71. package/dist/commonjs/shared/icons/PauseIcon.js +32 -0
  72. package/dist/commonjs/shared/icons/PauseIcon.js.map +1 -0
  73. package/dist/commonjs/shared/icons/PlayIcon.js +32 -0
  74. package/dist/commonjs/shared/icons/PlayIcon.js.map +1 -0
  75. package/dist/commonjs/shared/icons/SpeakerIcon.js +37 -0
  76. package/dist/commonjs/shared/icons/SpeakerIcon.js.map +1 -0
  77. package/dist/commonjs/shared/icons/icon.types.js +2 -0
  78. package/dist/commonjs/shared/icons/icon.types.js.map +1 -0
  79. package/dist/commonjs/shared/translation/constants.js +17 -0
  80. package/dist/commonjs/shared/translation/constants.js.map +1 -0
  81. package/dist/commonjs/shared/translation/helpers.js +31 -0
  82. package/dist/commonjs/shared/translation/helpers.js.map +1 -0
  83. package/dist/commonjs/shared/translation/hooks.js +28 -0
  84. package/dist/commonjs/shared/translation/hooks.js.map +1 -0
  85. package/dist/commonjs/shared/translation/index.js +52 -0
  86. package/dist/commonjs/shared/translation/index.js.map +1 -0
  87. package/dist/commonjs/shared/translation/model.js +15 -0
  88. package/dist/commonjs/shared/translation/model.js.map +1 -0
  89. package/dist/commonjs/shared/translation/types.js +13 -0
  90. package/dist/commonjs/shared/translation/types.js.map +1 -0
  91. package/dist/commonjs/types/types.d.js +2 -0
  92. package/dist/commonjs/types/types.d.js.map +1 -0
  93. package/dist/module/features/chatbot/components/Alternatives/Alternatives.js +54 -0
  94. package/dist/module/features/chatbot/components/Alternatives/Alternatives.js.map +1 -0
  95. package/dist/module/features/chatbot/components/Alternatives/HelpRequestOption.js +90 -0
  96. package/dist/module/features/chatbot/components/Alternatives/HelpRequestOption.js.map +1 -0
  97. package/dist/module/features/chatbot/components/ChatControls/ChatControls.js +91 -0
  98. package/dist/module/features/chatbot/components/ChatControls/ChatControls.js.map +1 -0
  99. package/dist/module/features/chatbot/components/ChatMessage/ChatMessage.js +21 -0
  100. package/dist/module/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -0
  101. package/dist/module/features/chatbot/components/ChatMessage/MessageLoader.js +50 -0
  102. package/dist/module/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -0
  103. package/dist/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.js +82 -0
  104. package/dist/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.js.map +1 -0
  105. package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js +81 -0
  106. package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -0
  107. package/dist/module/features/chatbot/components/ChatMessage/SentMessage.js +37 -0
  108. package/dist/module/features/chatbot/components/ChatMessage/SentMessage.js.map +1 -0
  109. package/dist/module/features/chatbot/components/ChatMessages/ChatbotMessages.js +123 -0
  110. package/dist/module/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +1 -0
  111. package/dist/module/features/chatbot/components/Chatbot.js +63 -0
  112. package/dist/module/features/chatbot/components/Chatbot.js.map +1 -0
  113. package/dist/module/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.js +59 -0
  114. package/dist/module/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.js.map +1 -0
  115. package/dist/module/features/chatbot/constants.js +27 -0
  116. package/dist/module/features/chatbot/constants.js.map +1 -0
  117. package/dist/module/features/chatbot/helpers.js +7 -0
  118. package/dist/module/features/chatbot/helpers.js.map +1 -0
  119. package/dist/module/features/chatbot/index.js +7 -0
  120. package/dist/module/features/chatbot/index.js.map +1 -0
  121. package/dist/module/features/chatbot/model/api.js +13 -0
  122. package/dist/module/features/chatbot/model/api.js.map +1 -0
  123. package/dist/module/features/chatbot/model/model.js +239 -0
  124. package/dist/module/features/chatbot/model/model.js.map +1 -0
  125. package/dist/module/features/chatbot/model/t2s.js +99 -0
  126. package/dist/module/features/chatbot/model/t2s.js.map +1 -0
  127. package/dist/module/features/chatbot/model/translation.js +198 -0
  128. package/dist/module/features/chatbot/model/translation.js.map +1 -0
  129. package/dist/module/features/chatbot/types/api.types.js +2 -0
  130. package/dist/module/features/chatbot/types/api.types.js.map +1 -0
  131. package/dist/module/features/chatbot/types/model.types.js +8 -0
  132. package/dist/module/features/chatbot/types/model.types.js.map +1 -0
  133. package/dist/module/features/chatbot/types/t2s.types.js +9 -0
  134. package/dist/module/features/chatbot/types/t2s.types.js.map +1 -0
  135. package/dist/module/features/chatbot/types/translation.types.js +4 -0
  136. package/dist/module/features/chatbot/types/translation.types.js.map +1 -0
  137. package/dist/module/index.js +5 -0
  138. package/dist/module/index.js.map +1 -0
  139. package/dist/module/lib/createFeature/createFeature.js +22 -0
  140. package/dist/module/lib/createFeature/createFeature.js.map +1 -0
  141. package/dist/module/lib/effector/createControllerEffect.js +45 -0
  142. package/dist/module/lib/effector/createControllerEffect.js.map +1 -0
  143. package/dist/module/lib/effector/createEntityFieldStore.js +38 -0
  144. package/dist/module/lib/effector/createEntityFieldStore.js.map +1 -0
  145. package/dist/module/lib/effector/index.js +5 -0
  146. package/dist/module/lib/effector/index.js.map +1 -0
  147. package/dist/module/lib/helpers/helpers.js +4 -0
  148. package/dist/module/lib/helpers/helpers.js.map +1 -0
  149. package/dist/module/lib/localization/en.json +2 -0
  150. package/dist/module/lib/localization/gb.json +2 -0
  151. package/dist/module/lib/localization/sw.json +2 -0
  152. package/dist/module/shared/hooks/useDebounce.js +16 -0
  153. package/dist/module/shared/hooks/useDebounce.js.map +1 -0
  154. package/dist/module/shared/icons/ArrowRightIcon.js +22 -0
  155. package/dist/module/shared/icons/ArrowRightIcon.js.map +1 -0
  156. package/dist/module/shared/icons/ChatbotIcon.js +140 -0
  157. package/dist/module/shared/icons/ChatbotIcon.js.map +1 -0
  158. package/dist/module/shared/icons/CloseIcon.js +20 -0
  159. package/dist/module/shared/icons/CloseIcon.js.map +1 -0
  160. package/dist/module/shared/icons/GlobeIcon.js +22 -0
  161. package/dist/module/shared/icons/GlobeIcon.js.map +1 -0
  162. package/dist/module/shared/icons/PauseIcon.js +24 -0
  163. package/dist/module/shared/icons/PauseIcon.js.map +1 -0
  164. package/dist/module/shared/icons/PlayIcon.js +24 -0
  165. package/dist/module/shared/icons/PlayIcon.js.map +1 -0
  166. package/dist/module/shared/icons/SpeakerIcon.js +29 -0
  167. package/dist/module/shared/icons/SpeakerIcon.js.map +1 -0
  168. package/dist/module/shared/icons/icon.types.js +2 -0
  169. package/dist/module/shared/icons/icon.types.js.map +1 -0
  170. package/dist/module/shared/translation/constants.js +12 -0
  171. package/dist/module/shared/translation/constants.js.map +1 -0
  172. package/dist/module/shared/translation/helpers.js +24 -0
  173. package/dist/module/shared/translation/helpers.js.map +1 -0
  174. package/dist/module/shared/translation/hooks.js +22 -0
  175. package/dist/module/shared/translation/hooks.js.map +1 -0
  176. package/dist/module/shared/translation/index.js +7 -0
  177. package/dist/module/shared/translation/index.js.map +1 -0
  178. package/dist/module/shared/translation/model.js +11 -0
  179. package/dist/module/shared/translation/model.js.map +1 -0
  180. package/dist/module/shared/translation/types.js +9 -0
  181. package/dist/module/shared/translation/types.js.map +1 -0
  182. package/dist/module/types/types.d.js +2 -0
  183. package/dist/module/types/types.d.js.map +1 -0
  184. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/Alternatives.d.ts +11 -0
  185. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/Alternatives.d.ts.map +1 -0
  186. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.d.ts +9 -0
  187. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.d.ts.map +1 -0
  188. package/dist/typescript/commonjs/features/chatbot/components/ChatControls/ChatControls.d.ts +14 -0
  189. package/dist/typescript/commonjs/features/chatbot/components/ChatControls/ChatControls.d.ts.map +1 -0
  190. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts +17 -0
  191. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -0
  192. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageLoader.d.ts +3 -0
  193. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageLoader.d.ts.map +1 -0
  194. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts +12 -0
  195. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts.map +1 -0
  196. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts +4 -0
  197. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts.map +1 -0
  198. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/SentMessage.d.ts +4 -0
  199. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/SentMessage.d.ts.map +1 -0
  200. package/dist/typescript/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts +21 -0
  201. package/dist/typescript/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts.map +1 -0
  202. package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts +25 -0
  203. package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts.map +1 -0
  204. package/dist/typescript/commonjs/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.d.ts +9 -0
  205. package/dist/typescript/commonjs/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.d.ts.map +1 -0
  206. package/dist/typescript/commonjs/features/chatbot/constants.d.ts +21 -0
  207. package/dist/typescript/commonjs/features/chatbot/constants.d.ts.map +1 -0
  208. package/dist/typescript/commonjs/features/chatbot/helpers.d.ts +2 -0
  209. package/dist/typescript/commonjs/features/chatbot/helpers.d.ts.map +1 -0
  210. package/dist/typescript/commonjs/features/chatbot/index.d.ts +5 -0
  211. package/dist/typescript/commonjs/features/chatbot/index.d.ts.map +1 -0
  212. package/dist/typescript/commonjs/features/chatbot/model/api.d.ts +12 -0
  213. package/dist/typescript/commonjs/features/chatbot/model/api.d.ts.map +1 -0
  214. package/dist/typescript/commonjs/features/chatbot/model/model.d.ts +73 -0
  215. package/dist/typescript/commonjs/features/chatbot/model/model.d.ts.map +1 -0
  216. package/dist/typescript/commonjs/features/chatbot/model/t2s.d.ts +18 -0
  217. package/dist/typescript/commonjs/features/chatbot/model/t2s.d.ts.map +1 -0
  218. package/dist/typescript/commonjs/features/chatbot/model/translation.d.ts +22 -0
  219. package/dist/typescript/commonjs/features/chatbot/model/translation.d.ts.map +1 -0
  220. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts +60 -0
  221. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts.map +1 -0
  222. package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts +64 -0
  223. package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts.map +1 -0
  224. package/dist/typescript/commonjs/features/chatbot/types/t2s.types.d.ts +22 -0
  225. package/dist/typescript/commonjs/features/chatbot/types/t2s.types.d.ts.map +1 -0
  226. package/dist/typescript/commonjs/features/chatbot/types/translation.types.d.ts +23 -0
  227. package/dist/typescript/commonjs/features/chatbot/types/translation.types.d.ts.map +1 -0
  228. package/dist/typescript/commonjs/index.d.ts +4 -0
  229. package/dist/typescript/commonjs/index.d.ts.map +1 -0
  230. package/dist/typescript/commonjs/lib/createFeature/createFeature.d.ts +7 -0
  231. package/dist/typescript/commonjs/lib/createFeature/createFeature.d.ts.map +1 -0
  232. package/dist/typescript/commonjs/lib/effector/createControllerEffect.d.ts +16 -0
  233. package/dist/typescript/commonjs/lib/effector/createControllerEffect.d.ts.map +1 -0
  234. package/dist/typescript/commonjs/lib/effector/createEntityFieldStore.d.ts +16 -0
  235. package/dist/typescript/commonjs/lib/effector/createEntityFieldStore.d.ts.map +1 -0
  236. package/dist/typescript/commonjs/lib/effector/index.d.ts +3 -0
  237. package/dist/typescript/commonjs/lib/effector/index.d.ts.map +1 -0
  238. package/dist/typescript/commonjs/lib/helpers/helpers.d.ts +2 -0
  239. package/dist/typescript/commonjs/lib/helpers/helpers.d.ts.map +1 -0
  240. package/dist/typescript/commonjs/package.json +1 -0
  241. package/dist/typescript/commonjs/shared/hooks/useDebounce.d.ts +2 -0
  242. package/dist/typescript/commonjs/shared/hooks/useDebounce.d.ts.map +1 -0
  243. package/dist/typescript/commonjs/shared/icons/ArrowRightIcon.d.ts +4 -0
  244. package/dist/typescript/commonjs/shared/icons/ArrowRightIcon.d.ts.map +1 -0
  245. package/dist/typescript/commonjs/shared/icons/ChatbotIcon.d.ts +4 -0
  246. package/dist/typescript/commonjs/shared/icons/ChatbotIcon.d.ts.map +1 -0
  247. package/dist/typescript/commonjs/shared/icons/CloseIcon.d.ts +4 -0
  248. package/dist/typescript/commonjs/shared/icons/CloseIcon.d.ts.map +1 -0
  249. package/dist/typescript/commonjs/shared/icons/GlobeIcon.d.ts +4 -0
  250. package/dist/typescript/commonjs/shared/icons/GlobeIcon.d.ts.map +1 -0
  251. package/dist/typescript/commonjs/shared/icons/PauseIcon.d.ts +4 -0
  252. package/dist/typescript/commonjs/shared/icons/PauseIcon.d.ts.map +1 -0
  253. package/dist/typescript/commonjs/shared/icons/PlayIcon.d.ts +4 -0
  254. package/dist/typescript/commonjs/shared/icons/PlayIcon.d.ts.map +1 -0
  255. package/dist/typescript/commonjs/shared/icons/SpeakerIcon.d.ts +4 -0
  256. package/dist/typescript/commonjs/shared/icons/SpeakerIcon.d.ts.map +1 -0
  257. package/dist/typescript/commonjs/shared/icons/icon.types.d.ts +9 -0
  258. package/dist/typescript/commonjs/shared/icons/icon.types.d.ts.map +1 -0
  259. package/dist/typescript/commonjs/shared/translation/constants.d.ts +6 -0
  260. package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -0
  261. package/dist/typescript/commonjs/shared/translation/helpers.d.ts +6 -0
  262. package/dist/typescript/commonjs/shared/translation/helpers.d.ts.map +1 -0
  263. package/dist/typescript/commonjs/shared/translation/hooks.d.ts +5 -0
  264. package/dist/typescript/commonjs/shared/translation/hooks.d.ts.map +1 -0
  265. package/dist/typescript/commonjs/shared/translation/index.d.ts +6 -0
  266. package/dist/typescript/commonjs/shared/translation/index.d.ts.map +1 -0
  267. package/dist/typescript/commonjs/shared/translation/model.d.ts +5 -0
  268. package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -0
  269. package/dist/typescript/commonjs/shared/translation/types.d.ts +8 -0
  270. package/dist/typescript/commonjs/shared/translation/types.d.ts.map +1 -0
  271. package/dist/typescript/module/features/chatbot/components/Alternatives/Alternatives.d.ts +11 -0
  272. package/dist/typescript/module/features/chatbot/components/Alternatives/Alternatives.d.ts.map +1 -0
  273. package/dist/typescript/module/features/chatbot/components/Alternatives/HelpRequestOption.d.ts +9 -0
  274. package/dist/typescript/module/features/chatbot/components/Alternatives/HelpRequestOption.d.ts.map +1 -0
  275. package/dist/typescript/module/features/chatbot/components/ChatControls/ChatControls.d.ts +14 -0
  276. package/dist/typescript/module/features/chatbot/components/ChatControls/ChatControls.d.ts.map +1 -0
  277. package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts +17 -0
  278. package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -0
  279. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageLoader.d.ts +3 -0
  280. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageLoader.d.ts.map +1 -0
  281. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts +12 -0
  282. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts.map +1 -0
  283. package/dist/typescript/module/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts +4 -0
  284. package/dist/typescript/module/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts.map +1 -0
  285. package/dist/typescript/module/features/chatbot/components/ChatMessage/SentMessage.d.ts +4 -0
  286. package/dist/typescript/module/features/chatbot/components/ChatMessage/SentMessage.d.ts.map +1 -0
  287. package/dist/typescript/module/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts +21 -0
  288. package/dist/typescript/module/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts.map +1 -0
  289. package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts +25 -0
  290. package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts.map +1 -0
  291. package/dist/typescript/module/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.d.ts +9 -0
  292. package/dist/typescript/module/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.d.ts.map +1 -0
  293. package/dist/typescript/module/features/chatbot/constants.d.ts +21 -0
  294. package/dist/typescript/module/features/chatbot/constants.d.ts.map +1 -0
  295. package/dist/typescript/module/features/chatbot/helpers.d.ts +2 -0
  296. package/dist/typescript/module/features/chatbot/helpers.d.ts.map +1 -0
  297. package/dist/typescript/module/features/chatbot/index.d.ts +5 -0
  298. package/dist/typescript/module/features/chatbot/index.d.ts.map +1 -0
  299. package/dist/typescript/module/features/chatbot/model/api.d.ts +12 -0
  300. package/dist/typescript/module/features/chatbot/model/api.d.ts.map +1 -0
  301. package/dist/typescript/module/features/chatbot/model/model.d.ts +73 -0
  302. package/dist/typescript/module/features/chatbot/model/model.d.ts.map +1 -0
  303. package/dist/typescript/module/features/chatbot/model/t2s.d.ts +18 -0
  304. package/dist/typescript/module/features/chatbot/model/t2s.d.ts.map +1 -0
  305. package/dist/typescript/module/features/chatbot/model/translation.d.ts +22 -0
  306. package/dist/typescript/module/features/chatbot/model/translation.d.ts.map +1 -0
  307. package/dist/typescript/module/features/chatbot/types/api.types.d.ts +60 -0
  308. package/dist/typescript/module/features/chatbot/types/api.types.d.ts.map +1 -0
  309. package/dist/typescript/module/features/chatbot/types/model.types.d.ts +64 -0
  310. package/dist/typescript/module/features/chatbot/types/model.types.d.ts.map +1 -0
  311. package/dist/typescript/module/features/chatbot/types/t2s.types.d.ts +22 -0
  312. package/dist/typescript/module/features/chatbot/types/t2s.types.d.ts.map +1 -0
  313. package/dist/typescript/module/features/chatbot/types/translation.types.d.ts +23 -0
  314. package/dist/typescript/module/features/chatbot/types/translation.types.d.ts.map +1 -0
  315. package/dist/typescript/module/index.d.ts +4 -0
  316. package/dist/typescript/module/index.d.ts.map +1 -0
  317. package/dist/typescript/module/lib/createFeature/createFeature.d.ts +7 -0
  318. package/dist/typescript/module/lib/createFeature/createFeature.d.ts.map +1 -0
  319. package/dist/typescript/module/lib/effector/createControllerEffect.d.ts +16 -0
  320. package/dist/typescript/module/lib/effector/createControllerEffect.d.ts.map +1 -0
  321. package/dist/typescript/module/lib/effector/createEntityFieldStore.d.ts +16 -0
  322. package/dist/typescript/module/lib/effector/createEntityFieldStore.d.ts.map +1 -0
  323. package/dist/typescript/module/lib/effector/index.d.ts +3 -0
  324. package/dist/typescript/module/lib/effector/index.d.ts.map +1 -0
  325. package/dist/typescript/module/lib/helpers/helpers.d.ts +2 -0
  326. package/dist/typescript/module/lib/helpers/helpers.d.ts.map +1 -0
  327. package/dist/typescript/module/package.json +1 -0
  328. package/dist/typescript/module/shared/hooks/useDebounce.d.ts +2 -0
  329. package/dist/typescript/module/shared/hooks/useDebounce.d.ts.map +1 -0
  330. package/dist/typescript/module/shared/icons/ArrowRightIcon.d.ts +4 -0
  331. package/dist/typescript/module/shared/icons/ArrowRightIcon.d.ts.map +1 -0
  332. package/dist/typescript/module/shared/icons/ChatbotIcon.d.ts +4 -0
  333. package/dist/typescript/module/shared/icons/ChatbotIcon.d.ts.map +1 -0
  334. package/dist/typescript/module/shared/icons/CloseIcon.d.ts +4 -0
  335. package/dist/typescript/module/shared/icons/CloseIcon.d.ts.map +1 -0
  336. package/dist/typescript/module/shared/icons/GlobeIcon.d.ts +4 -0
  337. package/dist/typescript/module/shared/icons/GlobeIcon.d.ts.map +1 -0
  338. package/dist/typescript/module/shared/icons/PauseIcon.d.ts +4 -0
  339. package/dist/typescript/module/shared/icons/PauseIcon.d.ts.map +1 -0
  340. package/dist/typescript/module/shared/icons/PlayIcon.d.ts +4 -0
  341. package/dist/typescript/module/shared/icons/PlayIcon.d.ts.map +1 -0
  342. package/dist/typescript/module/shared/icons/SpeakerIcon.d.ts +4 -0
  343. package/dist/typescript/module/shared/icons/SpeakerIcon.d.ts.map +1 -0
  344. package/dist/typescript/module/shared/icons/icon.types.d.ts +9 -0
  345. package/dist/typescript/module/shared/icons/icon.types.d.ts.map +1 -0
  346. package/dist/typescript/module/shared/translation/constants.d.ts +6 -0
  347. package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -0
  348. package/dist/typescript/module/shared/translation/helpers.d.ts +6 -0
  349. package/dist/typescript/module/shared/translation/helpers.d.ts.map +1 -0
  350. package/dist/typescript/module/shared/translation/hooks.d.ts +5 -0
  351. package/dist/typescript/module/shared/translation/hooks.d.ts.map +1 -0
  352. package/dist/typescript/module/shared/translation/index.d.ts +6 -0
  353. package/dist/typescript/module/shared/translation/index.d.ts.map +1 -0
  354. package/dist/typescript/module/shared/translation/model.d.ts +5 -0
  355. package/dist/typescript/module/shared/translation/model.d.ts.map +1 -0
  356. package/dist/typescript/module/shared/translation/types.d.ts +8 -0
  357. package/dist/typescript/module/shared/translation/types.d.ts.map +1 -0
  358. package/package.json +73 -0
  359. package/src/features/chatbot/components/Alternatives/Alternatives.tsx +64 -0
  360. package/src/features/chatbot/components/Alternatives/HelpRequestOption.tsx +92 -0
  361. package/src/features/chatbot/components/ChatControls/ChatControls.tsx +103 -0
  362. package/src/features/chatbot/components/ChatMessage/ChatMessage.tsx +28 -0
  363. package/src/features/chatbot/components/ChatMessage/MessageLoader.tsx +42 -0
  364. package/src/features/chatbot/components/ChatMessage/MessageTextToSpeech.tsx +78 -0
  365. package/src/features/chatbot/components/ChatMessage/ReceivedMessage.tsx +73 -0
  366. package/src/features/chatbot/components/ChatMessage/SentMessage.tsx +31 -0
  367. package/src/features/chatbot/components/ChatMessages/ChatbotMessages.tsx +148 -0
  368. package/src/features/chatbot/components/Chatbot.tsx +92 -0
  369. package/src/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.tsx +77 -0
  370. package/src/features/chatbot/constants.ts +30 -0
  371. package/src/features/chatbot/helpers.ts +4 -0
  372. package/src/features/chatbot/index.ts +4 -0
  373. package/src/features/chatbot/model/api.ts +28 -0
  374. package/src/features/chatbot/model/model.ts +277 -0
  375. package/src/features/chatbot/model/t2s.ts +107 -0
  376. package/src/features/chatbot/model/translation.ts +231 -0
  377. package/src/features/chatbot/types/api.types.ts +59 -0
  378. package/src/features/chatbot/types/model.types.ts +73 -0
  379. package/src/features/chatbot/types/t2s.types.ts +24 -0
  380. package/src/features/chatbot/types/translation.types.ts +23 -0
  381. package/src/index.ts +3 -0
  382. package/src/lib/createFeature/createFeature.tsx +21 -0
  383. package/src/lib/effector/createControllerEffect.ts +66 -0
  384. package/src/lib/effector/createEntityFieldStore.ts +43 -0
  385. package/src/lib/effector/index.ts +2 -0
  386. package/src/lib/helpers/helpers.ts +2 -0
  387. package/src/lib/localization/en.json +2 -0
  388. package/src/lib/localization/gb.json +2 -0
  389. package/src/lib/localization/sw.json +2 -0
  390. package/src/shared/hooks/useDebounce.ts +17 -0
  391. package/src/shared/icons/ArrowRightIcon.tsx +14 -0
  392. package/src/shared/icons/ChatbotIcon.tsx +109 -0
  393. package/src/shared/icons/CloseIcon.tsx +12 -0
  394. package/src/shared/icons/GlobeIcon.tsx +14 -0
  395. package/src/shared/icons/PauseIcon.tsx +16 -0
  396. package/src/shared/icons/PlayIcon.tsx +16 -0
  397. package/src/shared/icons/SpeakerIcon.tsx +22 -0
  398. package/src/shared/icons/icon.types.ts +8 -0
  399. package/src/shared/translation/constants.ts +10 -0
  400. package/src/shared/translation/helpers.ts +34 -0
  401. package/src/shared/translation/hooks.ts +28 -0
  402. package/src/shared/translation/index.ts +5 -0
  403. package/src/shared/translation/model.ts +15 -0
  404. package/src/shared/translation/types.ts +9 -0
  405. package/src/types/types.d.ts +4 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Alternatives.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/chatbot/components/Alternatives/Alternatives.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGhD,KAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE,YAAY,CAAA;IACnB,kBAAkB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5F,WAAW,EAAE,OAAO,CAAA;IACpB,cAAc,EAAE,OAAO,CAAA;CACxB,CAAA;AAED,eAAO,MAAM,YAAY,gEAKtB,iBAAiB,sBAkCnB,CAAA"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ type HelpRequestOptionProps = {
3
+ onPress: () => void;
4
+ message: string;
5
+ disabled: boolean;
6
+ };
7
+ export declare const HelpRequestOption: ({ onPress, message, disabled, }: HelpRequestOptionProps) => React.JSX.Element;
8
+ export {};
9
+ //# sourceMappingURL=HelpRequestOption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HelpRequestOption.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/chatbot/components/Alternatives/HelpRequestOption.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAYzB,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,iBAAiB,oCAI3B,sBAAsB,sBAoCxB,CAAA"}
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { ComponentType, PropsWithChildren } from 'react';
3
+ import { ChatbotModel } from '../../model/model';
4
+ type ChatControlsProps = {
5
+ model: ChatbotModel;
6
+ onPressTranslate: () => void;
7
+ onPressChatIcon: () => void;
8
+ onPressClose: () => void;
9
+ isTranslationEnabled: boolean;
10
+ ButtonWrapper: ComponentType<PropsWithChildren>;
11
+ };
12
+ export declare const ChatControls: ({ model, onPressTranslate, onPressChatIcon, onPressClose, isTranslationEnabled, ButtonWrapper, }: ChatControlsProps) => React.JSX.Element;
13
+ export {};
14
+ //# sourceMappingURL=ChatControls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatControls.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/chatbot/components/ChatControls/ChatControls.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAIxD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAKhD,KAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE,YAAY,CAAA;IACnB,gBAAgB,EAAE,MAAM,IAAI,CAAA;IAC5B,eAAe,EAAE,MAAM,IAAI,CAAA;IAC3B,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB,oBAAoB,EAAE,OAAO,CAAA;IAC7B,aAAa,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAA;CAChD,CAAA;AAED,eAAO,MAAM,YAAY,qGAOtB,iBAAiB,sBA+CnB,CAAA"}
@@ -0,0 +1,17 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { AudioStatus } from '../../types/t2s.types';
3
+ import { MessageVariant, ChatbotRenderer } from '../../types/model.types';
4
+ type ChatMessageProps = {
5
+ variant: MessageVariant;
6
+ message: string;
7
+ onPressTextToSpeech: () => void;
8
+ isTextToSpeechPending: boolean;
9
+ isActive: boolean;
10
+ withTextToSpeech?: boolean;
11
+ audioStatus: AudioStatus;
12
+ renderer?: (props: ChatbotRenderer) => ReactNode;
13
+ };
14
+ export type VariantProps = Omit<ChatMessageProps, 'variant'>;
15
+ export declare const ChatMessage: ({ variant, ...props }: ChatMessageProps) => React.JSX.Element;
16
+ export {};
17
+ //# sourceMappingURL=ChatMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatMessage.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/chatbot/components/ChatMessage/ChatMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAA;AAGvD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAEzE,KAAK,gBAAgB,GAAG;IACtB,OAAO,EAAE,cAAc,CAAA;IACvB,OAAO,EAAE,MAAM,CAAA;IACf,mBAAmB,EAAE,MAAM,IAAI,CAAA;IAC/B,qBAAqB,EAAE,OAAO,CAAA;IAC9B,QAAQ,EAAE,OAAO,CAAA;IACjB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,WAAW,EAAE,WAAW,CAAA;IACxB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,SAAS,CAAA;CACjD,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAA;AAO5D,eAAO,MAAM,WAAW,0BAA2B,gBAAgB,sBAGlE,CAAA"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const MessageLoader: () => React.JSX.Element;
3
+ //# sourceMappingURL=MessageLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessageLoader.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/chatbot/components/ChatMessage/MessageLoader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,eAAO,MAAM,aAAa,yBASzB,CAAA"}
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { AudioStatus } from '../../types/t2s.types';
3
+ type MessageTextToSpeechProps = {
4
+ status: AudioStatus;
5
+ disabled: boolean;
6
+ isActive: boolean;
7
+ isLoading: boolean;
8
+ onPress: () => void;
9
+ };
10
+ export declare const MessageTextToSpeech: ({ status, disabled, isActive, isLoading, onPress, }: MessageTextToSpeechProps) => React.JSX.Element;
11
+ export {};
12
+ //# sourceMappingURL=MessageTextToSpeech.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessageTextToSpeech.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/chatbot/components/ChatMessage/MessageTextToSpeech.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAsBnD,KAAK,wBAAwB,GAAG;IAC9B,MAAM,EAAE,WAAW,CAAA;IACnB,QAAQ,EAAE,OAAO,CAAA;IACjB,QAAQ,EAAE,OAAO,CAAA;IACjB,SAAS,EAAE,OAAO,CAAA;IAClB,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,mBAAmB,wDAM7B,wBAAwB,sBAU1B,CAAA"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { VariantProps } from './ChatMessage';
3
+ export declare const ReceivedMessage: ({ message, onPressTextToSpeech, isTextToSpeechPending, isActive, audioStatus, renderer, withTextToSpeech, }: VariantProps) => React.JSX.Element;
4
+ //# sourceMappingURL=ReceivedMessage.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { VariantProps } from './ChatMessage';
3
+ export declare const SentMessage: ({ message, renderer }: VariantProps) => React.JSX.Element;
4
+ //# sourceMappingURL=SentMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SentMessage.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/chatbot/components/ChatMessage/SentMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAG5C,eAAO,MAAM,WAAW,0BAA2B,YAAY,sBAQ9D,CAAA"}
@@ -0,0 +1,21 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { ChatbotModel } from '../../model/model';
3
+ import { PostMessagePayload } from '../../types/api.types';
4
+ import { AUDIO_CONFIG, DEFAULT_VOICE } from '../../constants';
5
+ import { ChatbotRenderer } from '../../types/model.types';
6
+ type ChatbotMessagesProps = {
7
+ model: ChatbotModel;
8
+ isHintFeedback: boolean;
9
+ sendHelpRequestPayload: Omit<PostMessagePayload, 'type'>;
10
+ translationTargetLanguage: string;
11
+ sanitizeSpeechInput: (speech: string) => string;
12
+ isTextToSpeechEnabled: boolean;
13
+ textToSpeechConfig?: {
14
+ voice: typeof DEFAULT_VOICE;
15
+ audioConfig: typeof AUDIO_CONFIG;
16
+ };
17
+ renderer?: (props: ChatbotRenderer) => ReactNode;
18
+ };
19
+ export declare const ChatbotMessages: ({ model, isHintFeedback, sendHelpRequestPayload, translationTargetLanguage, sanitizeSpeechInput, isTextToSpeechEnabled, textToSpeechConfig, renderer, }: ChatbotMessagesProps) => React.JSX.Element;
20
+ export {};
21
+ //# sourceMappingURL=ChatbotMessages.d.ts.map
@@ -0,0 +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,mBAAmB,CAAA;AAIhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC1D,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,sBAAsB,EAAE,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAA;IACxD,yBAAyB,EAAE,MAAM,CAAA;IACjC,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;AAKD,eAAO,MAAM,eAAe,4JASzB,oBAAoB,sBA6FtB,CAAA"}
@@ -0,0 +1,25 @@
1
+ import { ComponentType, PropsWithChildren, ReactNode } from 'react';
2
+ import { ChatbotModel } from '../model/model';
3
+ import { PostMessagePayload } from '../types/api.types';
4
+ import { AUDIO_CONFIG, DEFAULT_VOICE } from '../constants';
5
+ import { ChatbotRenderer } from '../types/model.types';
6
+ import React from 'react';
7
+ type ChatbotProps = {
8
+ model: ChatbotModel;
9
+ translationTargetLanguage: string;
10
+ isEnabled: boolean;
11
+ isHintFeedback: boolean;
12
+ sendHelpRequestPayload: Omit<PostMessagePayload, 'type'>;
13
+ sanitizeSpeechInput: (speech: string) => string;
14
+ isTextToSpeechEnabled: boolean;
15
+ isTranslationEnabled: boolean;
16
+ textToSpeechConfig?: {
17
+ voice: typeof DEFAULT_VOICE;
18
+ audioConfig: typeof AUDIO_CONFIG;
19
+ };
20
+ ButtonWrapper: ComponentType<PropsWithChildren>;
21
+ renderer?: (props: ChatbotRenderer) => ReactNode;
22
+ };
23
+ export declare const Chatbot: ({ model, translationTargetLanguage, isEnabled, isHintFeedback, sendHelpRequestPayload, sanitizeSpeechInput, isTextToSpeechEnabled, textToSpeechConfig, isTranslationEnabled, renderer, ButtonWrapper, }: ChatbotProps) => React.JSX.Element | null;
24
+ export {};
25
+ //# sourceMappingURL=Chatbot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Chatbot.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/components/Chatbot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,SAAS,EAAa,MAAM,OAAO,CAAA;AAG9E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAG7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,YAAY,CAAA;IACnB,yBAAyB,EAAE,MAAM,CAAA;IACjC,SAAS,EAAE,OAAO,CAAA;IAClB,cAAc,EAAE,OAAO,CAAA;IACvB,sBAAsB,EAAE,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAA;IACxD,mBAAmB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAA;IAC/C,qBAAqB,EAAE,OAAO,CAAA;IAC9B,oBAAoB,EAAE,OAAO,CAAA;IAC7B,kBAAkB,CAAC,EAAE;QACnB,KAAK,EAAE,OAAO,aAAa,CAAA;QAC3B,WAAW,EAAE,OAAO,YAAY,CAAA;KACjC,CAAA;IACD,aAAa,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAA;IAC/C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,SAAS,CAAA;CACjD,CAAA;AAED,eAAO,MAAM,OAAO,4MAYjB,YAAY,6BAmDd,CAAA"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ type ChatLoaderProps = {
3
+ dotsCount?: number;
4
+ animationDuration?: number;
5
+ backgroundColor?: string;
6
+ };
7
+ export declare const ThreeDotsLoader: ({ dotsCount, animationDuration, backgroundColor, }: ChatLoaderProps) => React.JSX.Element;
8
+ export {};
9
+ //# sourceMappingURL=ThreeDotsLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThreeDotsLoader.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,KAAK,eAAe,GAAG;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB,CAAA;AAED,eAAO,MAAM,eAAe,uDAIzB,eAAe,sBAgDjB,CAAA"}
@@ -0,0 +1,21 @@
1
+ export declare const AUDIO_CONFIG: {
2
+ audioEncoding: string;
3
+ pitch: number;
4
+ speakingRate: number;
5
+ };
6
+ export declare const DEFAULT_VOICE: {
7
+ languageCode: string;
8
+ name: string;
9
+ };
10
+ export declare const TEXT_TO_SPEECH_CONFIG: {
11
+ audioConfig: {
12
+ audioEncoding: string;
13
+ pitch: number;
14
+ speakingRate: number;
15
+ };
16
+ voice: {
17
+ languageCode: string;
18
+ name: string;
19
+ };
20
+ };
21
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/features/chatbot/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;;;;CAIxB,CAAA;AAED,eAAO,MAAM,aAAa;;;CAGzB,CAAA;AAED,eAAO,MAAM,qBAAqB;;;;;;;;;;CAgBvB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const decodeHTMLEntities: (input: string) => string;
2
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/features/chatbot/helpers.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kBAAkB,UAAW,MAAM,WAE/C,CAAA"}
@@ -0,0 +1,5 @@
1
+ export { Chatbot } from './components/Chatbot';
2
+ export { ChatbotModel } from './model/model';
3
+ export { AudioStatus, type AudioProvider } from './types/t2s.types';
4
+ export { MessageVariant, type ConversationMessage, type ChatbotRenderer } from './types/model.types';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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,eAAe,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAA"}
@@ -0,0 +1,12 @@
1
+ import { Effect } from 'effector';
2
+ import { ControlledEffect } from '../../../lib/effector/createControllerEffect';
3
+ import { ChatbotModelProps } from '../types/model.types';
4
+ import { GetAlternativesResponse, PostMessagePayload, PostMessageResponse, GoogleTranslatePayload, GoogleTranslateResponse, GoogleText2SpeechPayload, GoogleText2SpeechResponse } from '../types/api.types';
5
+ export declare class ChatbotAPI {
6
+ postMessageFx: ControlledEffect<PostMessagePayload, PostMessageResponse>;
7
+ getAlternativesFx: Effect<void, GetAlternativesResponse>;
8
+ translateTextFx: Effect<GoogleTranslatePayload, GoogleTranslateResponse>;
9
+ textToSpeechTextFx: Effect<GoogleText2SpeechPayload, GoogleText2SpeechResponse>;
10
+ constructor(api: ChatbotModelProps['api']);
11
+ }
12
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/model/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,MAAM,UAAU,CAAA;AAG/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAA;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EACH,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EAC5B,MAAM,oBAAoB,CAAA;AAE3B,qBAAa,UAAU;IACnB,aAAa,EAAE,gBAAgB,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAA;IACxE,iBAAiB,EAAE,MAAM,CAAC,IAAI,EAAE,uBAAuB,CAAC,CAAA;IACxD,eAAe,EAAE,MAAM,CAAC,sBAAsB,EAAE,uBAAuB,CAAC,CAAA;IACxE,kBAAkB,EAAE,MAAM,CAAC,wBAAwB,EAAE,yBAAyB,CAAC,CAAA;gBAEnE,GAAG,EAAE,iBAAiB,CAAC,KAAK,CAAC;CAM5C"}
@@ -0,0 +1,73 @@
1
+ import { type Store, type Effect } from 'effector';
2
+ import { AvailableChatsModel, ChatbotModelProps, ChatMessagesModel, ConversationMessage, EntityIds, SendHelpParams, SetHintMessageProps, ThreadIdsModel } from '../types/model.types';
3
+ import { GetAlternativesResponse, PostMessageResponse } from '../types/api.types';
4
+ import { ChatbotAPI } from './api';
5
+ import { ChatbotTranslation } from './translation';
6
+ import { ChatTextToSpeech } from './t2s';
7
+ export declare class ChatbotModel {
8
+ readonly api: ChatbotAPI;
9
+ readonly translation: ChatbotTranslation;
10
+ readonly t2s: ChatTextToSpeech;
11
+ readonly credits: ChatbotModelProps['credits'];
12
+ readonly resetAlternatives: import("effector").EventCallable<void>;
13
+ readonly setAlternatives: import("effector").EventCallable<GetAlternativesResponse | null>;
14
+ readonly $alternatives: Store<GetAlternativesResponse | null>;
15
+ readonly setIsOpen: import("effector").EventCallable<boolean>;
16
+ readonly toggleOpen: import("effector").EventCallable<void>;
17
+ readonly $isOpen: import("effector").StoreWritable<boolean>;
18
+ readonly removeLastMessage: import("effector").EventCallable<void>;
19
+ readonly setLastMessageIds: import("effector").EventCallable<EntityIds | null>;
20
+ readonly $lastMessageIds: import("effector").StoreWritable<EntityIds | null>;
21
+ readonly setScrollActive: import("effector").EventCallable<boolean>;
22
+ readonly $isScrollActive: import("effector").StoreWritable<boolean>;
23
+ readonly sendHelpRequestFx: Effect<SendHelpParams, PostMessageResponse | ConversationMessage>;
24
+ readonly defaultMessages: ChatbotModelProps['messages'];
25
+ constructor({ credits, api, messages, }: ChatbotModelProps);
26
+ readonly messages: {
27
+ $state: import("effector").StoreWritable<Record<string, Record<string, {
28
+ messages: ConversationMessage[];
29
+ }>>>;
30
+ setField: (value: ChatMessagesModel) => void;
31
+ fieldAdded: import("effector").EventCallable<{
32
+ entityId: string;
33
+ fieldId: string;
34
+ data: {
35
+ messages: ConversationMessage[];
36
+ };
37
+ }>;
38
+ reset: import("effector").EventCallable<void>;
39
+ };
40
+ readonly threadIds: {
41
+ $state: import("effector").StoreWritable<Record<string, Record<string, {
42
+ threadId: string;
43
+ }>>>;
44
+ setField: (value: ThreadIdsModel) => void;
45
+ fieldAdded: import("effector").EventCallable<{
46
+ entityId: string;
47
+ fieldId: string;
48
+ data: {
49
+ threadId: string;
50
+ };
51
+ }>;
52
+ reset: import("effector").EventCallable<void>;
53
+ };
54
+ readonly availableChats: {
55
+ $state: import("effector").StoreWritable<Record<string, Record<string, {
56
+ isAvailable: boolean;
57
+ }>>>;
58
+ setField: (value: AvailableChatsModel) => void;
59
+ fieldAdded: import("effector").EventCallable<{
60
+ entityId: string;
61
+ fieldId: string;
62
+ data: {
63
+ isAvailable: boolean;
64
+ };
65
+ }>;
66
+ reset: import("effector").EventCallable<void>;
67
+ };
68
+ private createSendHelpRequestFx;
69
+ private initChatReplyWatcher;
70
+ startConversation(): void;
71
+ setHintMessage({ entityId, fieldId, ...message }: SetHintMessageProps): void;
72
+ }
73
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/model/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,KAAK,KAAK,EAAE,KAAK,MAAM,EAAE,MAAM,UAAU,CAAA;AAGxF,OAAO,EACH,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,SAAS,EACT,cAAc,EAEd,mBAAmB,EACnB,cAAc,EACjB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAGjF,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAA;AAExC,qBAAa,YAAY;IACrB,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAA;IACxB,QAAQ,CAAC,WAAW,EAAE,kBAAkB,CAAA;IACxC,QAAQ,CAAC,GAAG,EAAE,gBAAgB,CAAA;IAE9B,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAA;IAE9C,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,4CAAwE;IAGxF,QAAQ,CAAC,iBAAiB,yCAAgB;IAC1C,QAAQ,CAAC,iBAAiB,qDAAkC;IAC5D,QAAQ,CAAC,eAAe,qDAAwC;IAEhE,QAAQ,CAAC,eAAe,4CAAyB;IACjD,QAAQ,CAAC,eAAe,4CAAuC;IAE/D,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC,cAAc,EAAE,mBAAmB,GAAG,mBAAmB,CAAC,CAAA;IAE7F,QAAQ,CAAC,eAAe,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAA;gBAE3C,EACR,OAAO,EACP,GAAG,EACH,QAAQ,GACX,EAAE,iBAAiB;IAkBpB,QAAQ,CAAC,QAAQ;;;;;;;;;;;;;MAMf;IAEF,QAAQ,CAAC,SAAS;;;;;;;;;;;;;MAMhB;IAEF,QAAQ,CAAC,cAAc;;;;;;;;;;;;;MAMrB;IAEF,OAAO,CAAC,uBAAuB;IAsE/B,OAAO,CAAC,oBAAoB;IA6ErB,iBAAiB;IAoBjB,cAAc,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,EAAE,mBAAmB;CAe/E"}
@@ -0,0 +1,18 @@
1
+ import { ChatbotModel } from './model';
2
+ import { AudioProvider, AudioStatus, PlayTextToSpeechProps } from '../types/t2s.types';
3
+ export declare class ChatTextToSpeech {
4
+ private readonly model;
5
+ private readonly audioCache;
6
+ private audioProvider;
7
+ readonly setCurrentPlayingId: import("effector").EventCallable<string | null>;
8
+ readonly $currentPlayingId: import("effector").StoreWritable<string | null>;
9
+ readonly setStatus: import("effector").EventCallable<AudioStatus>;
10
+ readonly $status: import("effector").StoreWritable<AudioStatus>;
11
+ constructor(chatbotModel: ChatbotModel);
12
+ setAudioProvider(audioProvider: AudioProvider): void;
13
+ private getCacheKey;
14
+ play({ text, messageId, isTranslated, config }: PlayTextToSpeechProps): Promise<void>;
15
+ stop(): void;
16
+ reset(): void;
17
+ }
18
+ //# sourceMappingURL=t2s.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"t2s.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/model/t2s.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAGtC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAEtF,qBAAa,gBAAgB;IACzB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IACpC,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,YAAY,EAAE,YAAY;IAQ/B,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;IAYJ,KAAK;CAKf"}
@@ -0,0 +1,22 @@
1
+ import { type Effect } from 'effector';
2
+ import { ChatbotModel } from './model';
3
+ import { TranslateAlternativesFxProps, TranslateBatchFxProps, TranslateMessageFxProps } from '../types/translation.types';
4
+ import { ConversationMessage } from '../types/model.types';
5
+ import { GetAlternativesResponse } from '../types/api.types';
6
+ export declare class ChatbotTranslation {
7
+ private readonly model;
8
+ readonly setIsTranslated: import("effector").EventCallable<boolean>;
9
+ readonly $isTranslated: import("effector").StoreWritable<boolean>;
10
+ readonly translateMessageFx: Effect<TranslateMessageFxProps, ConversationMessage>;
11
+ readonly translateBatchFx: Effect<TranslateBatchFxProps['params'], ConversationMessage[]>;
12
+ readonly translateAlternativesFx: Effect<TranslateAlternativesFxProps['params'], GetAlternativesResponse | null>;
13
+ constructor(chatbotModel: ChatbotModel);
14
+ private shouldSkipTranslation;
15
+ private initTranslationSamples;
16
+ private createTranslateAlternativesEffect;
17
+ private createTranslateMessageEffect;
18
+ private createTranslateBatchEffect;
19
+ private translateMessageOptions;
20
+ reset(): void;
21
+ }
22
+ //# sourceMappingURL=translation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translation.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/model/translation.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8C,KAAK,MAAM,EAAU,MAAM,UAAU,CAAA;AAC1F,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEtC,OAAO,EACH,4BAA4B,EAC5B,qBAAqB,EACrB,uBAAuB,EAC1B,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AAG5D,qBAAa,kBAAkB;IAC3B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IAEpC,QAAQ,CAAC,eAAe,4CAAyB;IACjD,QAAQ,CAAC,aAAa,4CAAuC;IAE7D,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC,uBAAuB,EAAE,mBAAmB,CAAC,CAAA;IACjF,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC,qBAAqB,CAAC,QAAQ,CAAC,EAAE,mBAAmB,EAAE,CAAC,CAAA;IACzF,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CACpC,4BAA4B,CAAC,QAAQ,CAAC,EACtC,uBAAuB,GAAG,IAAI,CACjC,CAAA;gBAEW,YAAY,EAAE,YAAY;IAUtC,OAAO,CAAC,qBAAqB;IAe7B,OAAO,CAAC,sBAAsB;IAkB9B,OAAO,CAAC,iCAAiC;IAwDzC,OAAO,CAAC,4BAA4B;IAuBpC,OAAO,CAAC,0BAA0B;YA6DpB,uBAAuB;IAmB9B,KAAK;CAGf"}
@@ -0,0 +1,60 @@
1
+ export type ChatAnswer = {
2
+ text: string;
3
+ promptKey: string;
4
+ translatedText?: string;
5
+ };
6
+ export type GetAlternativesResponse = {
7
+ options: {
8
+ default: ChatAnswer[];
9
+ hints: ChatAnswer[];
10
+ };
11
+ };
12
+ export type PostMessagePayload = {
13
+ hint: string | null;
14
+ language: string;
15
+ problem: string;
16
+ problemAnswer: string[];
17
+ solutionImages: {
18
+ canvasDrawing: string | null;
19
+ };
20
+ type: string;
21
+ problemId?: string;
22
+ answer?: string | string[];
23
+ grade?: string | null;
24
+ threadId?: string | null;
25
+ };
26
+ export type PostMessageResponse = {
27
+ message: string;
28
+ threadId: string;
29
+ options: ChatAnswer[];
30
+ };
31
+ export type GoogleTranslatePayload = {
32
+ text: string[];
33
+ targetLanguage: string;
34
+ };
35
+ export type GoogleTranslateResponse = {
36
+ data: {
37
+ translations: {
38
+ translatedText: string;
39
+ detectedSourceLanguage: string;
40
+ }[];
41
+ };
42
+ };
43
+ export type GoogleText2SpeechPayload = {
44
+ input: {
45
+ text: string;
46
+ };
47
+ voice: {
48
+ languageCode: string;
49
+ name: string;
50
+ };
51
+ audioConfig: {
52
+ audioEncoding: string;
53
+ pitch: number;
54
+ speakingRate: number;
55
+ };
56
+ };
57
+ export type GoogleText2SpeechResponse = string | undefined | {
58
+ audioContent?: string;
59
+ };
60
+ //# sourceMappingURL=api.types.d.ts.map
@@ -0,0 +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;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,cAAc,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IAClC,OAAO,EAAE;QACL,OAAO,EAAE,UAAU,EAAE,CAAA;QACrB,KAAK,EAAE,UAAU,EAAE,CAAA;KACtB,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC7B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,cAAc,EAAE;QAAE,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAA;IAChD,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC1B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,UAAU,EAAE,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACjC,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,cAAc,EAAE,MAAM,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IAClC,IAAI,EAAE;QACF,YAAY,EAAE;YAAE,cAAc,EAAE,MAAM,CAAC;YAAC,sBAAsB,EAAE,MAAM,CAAA;SAAE,EAAE,CAAA;KAC7E,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACnC,KAAK,EAAE;QACH,IAAI,EAAE,MAAM,CAAA;KACf,CAAA;IACD,KAAK,EAAE;QACH,YAAY,EAAE,MAAM,CAAA;QACpB,IAAI,EAAE,MAAM,CAAA;KACf,CAAA;IACD,WAAW,EAAE;QACT,aAAa,EAAE,MAAM,CAAA;QACrB,KAAK,EAAE,MAAM,CAAA;QACb,YAAY,EAAE,MAAM,CAAA;KACvB,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG,MAAM,GAAG,SAAS,GAAG;IAAE,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA"}
@@ -0,0 +1,64 @@
1
+ import type { Store } from 'effector';
2
+ import { GetAlternativesResponse, PostMessagePayload, PostMessageResponse, GoogleTranslatePayload, GoogleTranslateResponse, GoogleText2SpeechPayload, GoogleText2SpeechResponse, ChatAnswer } from './api.types';
3
+ export type ConversationMessage = {
4
+ id: string;
5
+ message: string;
6
+ threadId: string;
7
+ options: ChatAnswer[];
8
+ isOwnMessage: boolean;
9
+ translatedMessage?: string;
10
+ };
11
+ export type EntityIds = {
12
+ entityId: string;
13
+ fieldId: string;
14
+ };
15
+ export type ChatMessagesModel = EntityIds & {
16
+ messages: ConversationMessage[];
17
+ };
18
+ export type ThreadIdsModel = EntityIds & {
19
+ threadId: string;
20
+ };
21
+ export type AvailableChatsModel = EntityIds & {
22
+ isAvailable: boolean;
23
+ };
24
+ export type ChatbotModelProps = {
25
+ credits: {
26
+ $assignmentId: Store<string>;
27
+ $exerciseId: Store<string>;
28
+ };
29
+ api: {
30
+ getAlternatives: (props: void) => Promise<GetAlternativesResponse>;
31
+ postMessage: (props: PostMessagePayload) => Promise<PostMessageResponse>;
32
+ postTranslateText: (props: GoogleTranslatePayload) => Promise<GoogleTranslateResponse>;
33
+ postTextToSpeech: (props: GoogleText2SpeechPayload) => Promise<GoogleText2SpeechResponse>;
34
+ };
35
+ messages: {
36
+ error: ConversationMessage;
37
+ start: ConversationMessage;
38
+ };
39
+ };
40
+ export type SendHelpParams = {
41
+ payload: PostMessagePayload;
42
+ message: string;
43
+ translationTargetLanguage: string;
44
+ translatedMessage?: string;
45
+ };
46
+ export type SendHelpProps = SendHelpParams & {
47
+ assignmentId: string;
48
+ exerciseId: string;
49
+ messages: Record<string, Record<string, {
50
+ messages: ConversationMessage[];
51
+ }>>;
52
+ isTranslated: boolean;
53
+ };
54
+ export type SetHintMessageProps = EntityIds & ConversationMessage;
55
+ export declare enum MessageVariant {
56
+ SENT = "sent",
57
+ RECEIVED = "received"
58
+ }
59
+ export type ChatbotRenderer = {
60
+ message: string;
61
+ variant: MessageVariant;
62
+ withTextToSpeech: boolean;
63
+ };
64
+ //# sourceMappingURL=model.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.types.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/types/model.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EACH,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,UAAU,EACb,MAAM,aAAa,CAAA;AAEpB,MAAM,MAAM,mBAAmB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,UAAU,EAAE,CAAA;IACrB,YAAY,EAAE,OAAO,CAAA;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC7B,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG;IAAE,QAAQ,EAAE,mBAAmB,EAAE,CAAA;CAAE,CAAA;AAC/E,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAA;AAC7D,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG;IAAE,WAAW,EAAE,OAAO,CAAA;CAAE,CAAA;AAEtE,MAAM,MAAM,iBAAiB,GAAG;IAC5B,OAAO,EAAE;QACL,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;QAC5B,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;KAC7B,CAAC;IACF,GAAG,EAAE;QACD,eAAe,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAA;QAClE,WAAW,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAA;QACxE,iBAAiB,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAA;QACtF,gBAAgB,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,OAAO,CAAC,yBAAyB,CAAC,CAAA;KAC5F,CAAA;IACD,QAAQ,EAAE;QACN,KAAK,EAAE,mBAAmB,CAAC;QAC3B,KAAK,EAAE,mBAAmB,CAAA;KAC7B,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IACzB,OAAO,EAAE,kBAAkB,CAAA;IAC3B,OAAO,EAAE,MAAM,CAAA;IACf,yBAAyB,EAAE,MAAM,CAAA;IACjC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC7B,CAAA;AAED,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG;IACzC,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,mBAAmB,EAAE,CAAA;KAAE,CAAC,CAAC,CAAA;IAC7E,YAAY,EAAE,OAAO,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,mBAAmB,CAAA;AAEjE,oBAAY,cAAc;IACtB,IAAI,SAAS;IACb,QAAQ,aAAa;CACxB;AAED,MAAM,MAAM,eAAe,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,cAAc,CAAA;IACvB,gBAAgB,EAAE,OAAO,CAAA;CAC5B,CAAA"}
@@ -0,0 +1,22 @@
1
+ import { AUDIO_CONFIG, DEFAULT_VOICE } from '../constants';
2
+ export declare enum AudioStatus {
3
+ PLAYING = "playing",
4
+ STOPPED = "stopped",
5
+ PAUSED = "paused"
6
+ }
7
+ export type AudioProvider = {
8
+ play: (audioPath: string, onPlaybackComplete: () => void) => Promise<void>;
9
+ pause: () => void;
10
+ resume: () => void;
11
+ stop: () => void;
12
+ };
13
+ export type PlayTextToSpeechProps = {
14
+ text: string;
15
+ messageId: string;
16
+ isTranslated: boolean;
17
+ config?: {
18
+ voice?: typeof DEFAULT_VOICE;
19
+ audioConfig?: typeof AUDIO_CONFIG;
20
+ };
21
+ };
22
+ //# sourceMappingURL=t2s.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"t2s.types.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/types/t2s.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAE1D,oBAAY,WAAW;IACnB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,MAAM,WAAW;CACpB;AAED,MAAM,MAAM,aAAa,GAAG;IACxB,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1E,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,IAAI,EAAE,MAAM,IAAI,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,OAAO,CAAA;IACrB,MAAM,CAAC,EAAE;QACL,KAAK,CAAC,EAAE,OAAO,aAAa,CAAA;QAC5B,WAAW,CAAC,EAAE,OAAO,YAAY,CAAA;KACpC,CAAA;CACJ,CAAA"}
@@ -0,0 +1,23 @@
1
+ import { ConversationMessage } from './model.types';
2
+ import { GetAlternativesResponse } from './api.types';
3
+ export type TranslateBatchFxProps = {
4
+ messages: Record<string, Record<string, {
5
+ messages: ConversationMessage[];
6
+ }>>;
7
+ assignmentId: string;
8
+ exerciseId: string;
9
+ params: {
10
+ targetLanguage: string;
11
+ };
12
+ };
13
+ export type TranslateMessageFxProps = {
14
+ message: ConversationMessage;
15
+ targetLanguage: string;
16
+ };
17
+ export type TranslateAlternativesFxProps = {
18
+ alternatives: GetAlternativesResponse | null;
19
+ params: {
20
+ targetLanguage: string;
21
+ };
22
+ };
23
+ //# sourceMappingURL=translation.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translation.types.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/types/translation.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAErD,MAAM,MAAM,qBAAqB,GAAG;IAChC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,mBAAmB,EAAE,CAAA;KAAE,CAAC,CAAC,CAAA;IAC7E,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE;QACJ,cAAc,EAAE,MAAM,CAAA;KACzB,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IAClC,OAAO,EAAE,mBAAmB,CAAA;IAC5B,cAAc,EAAE,MAAM,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,4BAA4B,GAAG;IACvC,YAAY,EAAE,uBAAuB,GAAG,IAAI,CAAA;IAC5C,MAAM,EAAE;QACJ,cAAc,EAAE,MAAM,CAAA;KACzB,CAAA;CACJ,CAAA"}
@@ -0,0 +1,4 @@
1
+ export { useFeaturesLocalization, setFeaturesLocalization, Locale } from './shared/translation';
2
+ export type { LocalizationConfig } from './shared/translation';
3
+ export * from './features/chatbot';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC/F,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC9D,cAAc,oBAAoB,CAAA"}
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ export declare function createFeature<T>(): readonly [({ children, model }: {
3
+ model: T | null;
4
+ } & {
5
+ children?: React.ReactNode | undefined;
6
+ }) => React.JSX.Element | null, () => T, React.Context<T | null>];
7
+ //# sourceMappingURL=createFeature.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createFeature.d.ts","sourceRoot":"","sources":["../../../../../src/lib/createFeature/createFeature.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuD,MAAM,OAAO,CAAA;AAE3E,wBAAgB,aAAa,CAAC,CAAC;WAIpB,CAAC,GAAG,IAAI;;;sCAUe,CAAC,2BAIlC"}
@@ -0,0 +1,16 @@
1
+ import { type Effect } from 'effector';
2
+ export type ControlledEffect<P, T> = Effect<P, T> & {
3
+ controller: AbortController;
4
+ };
5
+ type ControlledRequestProps<P> = {
6
+ data: P;
7
+ controller?: AbortController;
8
+ abortAfter?: number;
9
+ };
10
+ type RequestOptionalConfig = {
11
+ signal?: AbortSignal;
12
+ };
13
+ export declare function controlledRequest<R = void, P = void>(request: (props: P, config?: RequestOptionalConfig) => Promise<R>): ({ data, controller, abortAfter, }: ControlledRequestProps<P>) => Promise<R>;
14
+ export declare const createControllerEffect: <T, P>(fn: (props: P, config?: RequestOptionalConfig) => Promise<T>) => ControlledEffect<P, T>;
15
+ export {};
16
+ //# sourceMappingURL=createControllerEffect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createControllerEffect.d.ts","sourceRoot":"","sources":["../../../../../src/lib/effector/createControllerEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,UAAU,CAAA;AAMpD,MAAM,MAAM,gBAAgB,CAAC,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;IAChD,UAAU,EAAE,eAAe,CAAA;CAC9B,CAAA;AAED,KAAK,sBAAsB,CAAC,CAAC,IAAI;IAC7B,IAAI,EAAE,CAAC,CAAA;IACP,UAAU,CAAC,EAAE,eAAe,CAAA;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,KAAK,qBAAqB,GAAG;IAAE,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE,CAAA;AAErD,wBAAgB,iBAAiB,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,IAAI,EAChD,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,qBAAqB,KAAK,OAAO,CAAC,CAAC,CAAC,uCAM9D,sBAAsB,CAAC,CAAC,CAAC,gBAwB/B;AAED,eAAO,MAAM,sBAAsB,GAAI,CAAC,EAAE,CAAC,MACnC,CAAC,KAAK,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,qBAAqB,KAAK,OAAO,CAAC,CAAC,CAAC,2BAa/D,CAAA"}