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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (274) hide show
  1. package/dist/commonjs/features/chatbot/components/{ChatMessages/ChatbotMessages.js → Chat/Chat.js} +8 -15
  2. package/dist/commonjs/features/chatbot/components/Chat/Chat.js.map +1 -0
  3. package/dist/commonjs/features/chatbot/components/ChatInput/ChatInput.js +74 -0
  4. package/dist/commonjs/features/chatbot/components/ChatInput/ChatInput.js.map +1 -0
  5. package/dist/commonjs/features/chatbot/components/ChatInput/RequestHintButton.js +144 -0
  6. package/dist/commonjs/features/chatbot/components/ChatInput/RequestHintButton.js.map +1 -0
  7. package/dist/commonjs/features/chatbot/components/ChatInput/freeText/ChatTextInput.js +135 -0
  8. package/dist/commonjs/features/chatbot/components/ChatInput/freeText/ChatTextInput.js.map +1 -0
  9. package/dist/commonjs/features/chatbot/components/ChatInput/freeText/FreeTextInputBlock.js +77 -0
  10. package/dist/commonjs/features/chatbot/components/ChatInput/freeText/FreeTextInputBlock.js.map +1 -0
  11. package/dist/commonjs/features/chatbot/components/{Alternatives/InputButton.js → ChatInput/freeText/SendMessageButton.js} +26 -17
  12. package/dist/commonjs/features/chatbot/components/ChatInput/freeText/SendMessageButton.js.map +1 -0
  13. package/dist/commonjs/features/chatbot/components/Chatbot.js +2 -2
  14. package/dist/commonjs/features/chatbot/components/Chatbot.js.map +1 -1
  15. package/dist/commonjs/features/chatbot/constants.js +2 -1
  16. package/dist/commonjs/features/chatbot/constants.js.map +1 -1
  17. package/dist/commonjs/features/chatbot/index.js +7 -0
  18. package/dist/commonjs/features/chatbot/index.js.map +1 -1
  19. package/dist/commonjs/features/chatbot/model/ChatBotModel.js +44 -8
  20. package/dist/commonjs/features/chatbot/model/ChatBotModel.js.map +1 -1
  21. package/dist/commonjs/features/chatbot/model/ChatBotTextInput.js +16 -0
  22. package/dist/commonjs/features/chatbot/model/ChatBotTextInput.js.map +1 -0
  23. package/dist/commonjs/features/chatbot/model/ChatBotThreadManager.js +44 -11
  24. package/dist/commonjs/features/chatbot/model/ChatBotThreadManager.js.map +1 -1
  25. package/dist/commonjs/features/chatbot/types/model.types.js.map +1 -1
  26. package/dist/commonjs/features/chatbot/types/types.js +2 -0
  27. package/dist/commonjs/features/chatbot/types/types.js.map +1 -0
  28. package/dist/commonjs/features/chatbot/types/units.types.js +10 -0
  29. package/dist/commonjs/features/chatbot/types/units.types.js.map +1 -1
  30. package/dist/commonjs/features/exampleSolution/ExampleSolutionModal.js +1 -3
  31. package/dist/commonjs/features/exampleSolution/ExampleSolutionModal.js.map +1 -1
  32. package/dist/commonjs/features/exampleSolution/assets/grid.webp +0 -0
  33. package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js +18 -11
  34. package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -1
  35. package/dist/commonjs/features/exampleSolution/components/QuestionSection.js +7 -7
  36. package/dist/commonjs/features/exampleSolution/components/QuestionSection.js.map +1 -1
  37. package/dist/commonjs/features/exampleSolution/components/SolutionSection.js +55 -29
  38. package/dist/commonjs/features/exampleSolution/components/SolutionSection.js.map +1 -1
  39. package/dist/commonjs/features/exampleSolution/model/ExampleSolution.model.js +3 -1
  40. package/dist/commonjs/features/exampleSolution/model/ExampleSolution.model.js.map +1 -1
  41. package/dist/commonjs/features/formulaSheet/components/FormulaSheet.js +5 -4
  42. package/dist/commonjs/features/formulaSheet/components/FormulaSheet.js.map +1 -1
  43. package/dist/commonjs/shared/hooks/useKeyDownListener.js +3 -2
  44. package/dist/commonjs/shared/hooks/useKeyDownListener.js.map +1 -1
  45. package/dist/commonjs/shared/translation/localization/ca.json +2 -1
  46. package/dist/commonjs/shared/translation/localization/en.json +3 -2
  47. package/dist/commonjs/shared/translation/localization/gb.json +2 -1
  48. package/dist/commonjs/shared/translation/localization/sct.json +2 -1
  49. package/dist/commonjs/shared/translation/localization/sw.json +3 -2
  50. package/dist/module/features/chatbot/components/{ChatMessages/ChatbotMessages.js → Chat/Chat.js} +6 -13
  51. package/dist/module/features/chatbot/components/Chat/Chat.js.map +1 -0
  52. package/dist/module/features/chatbot/components/ChatInput/ChatInput.js +67 -0
  53. package/dist/module/features/chatbot/components/ChatInput/ChatInput.js.map +1 -0
  54. package/dist/module/features/chatbot/components/ChatInput/RequestHintButton.js +138 -0
  55. package/dist/module/features/chatbot/components/ChatInput/RequestHintButton.js.map +1 -0
  56. package/dist/module/features/chatbot/components/ChatInput/freeText/ChatTextInput.js +128 -0
  57. package/dist/module/features/chatbot/components/ChatInput/freeText/ChatTextInput.js.map +1 -0
  58. package/dist/module/features/chatbot/components/ChatInput/freeText/FreeTextInputBlock.js +71 -0
  59. package/dist/module/features/chatbot/components/ChatInput/freeText/FreeTextInputBlock.js.map +1 -0
  60. package/dist/module/features/chatbot/components/{Alternatives/InputButton.js → ChatInput/freeText/SendMessageButton.js} +25 -16
  61. package/dist/module/features/chatbot/components/ChatInput/freeText/SendMessageButton.js.map +1 -0
  62. package/dist/module/features/chatbot/components/Chatbot.js +2 -2
  63. package/dist/module/features/chatbot/components/Chatbot.js.map +1 -1
  64. package/dist/module/features/chatbot/constants.js +1 -0
  65. package/dist/module/features/chatbot/constants.js.map +1 -1
  66. package/dist/module/features/chatbot/index.js +1 -0
  67. package/dist/module/features/chatbot/index.js.map +1 -1
  68. package/dist/module/features/chatbot/model/ChatBotModel.js +44 -8
  69. package/dist/module/features/chatbot/model/ChatBotModel.js.map +1 -1
  70. package/dist/module/features/chatbot/model/ChatBotTextInput.js +11 -0
  71. package/dist/module/features/chatbot/model/ChatBotTextInput.js.map +1 -0
  72. package/dist/module/features/chatbot/model/ChatBotThreadManager.js +44 -11
  73. package/dist/module/features/chatbot/model/ChatBotThreadManager.js.map +1 -1
  74. package/dist/module/features/chatbot/types/model.types.js.map +1 -1
  75. package/dist/module/features/chatbot/types/types.js +2 -0
  76. package/dist/module/features/chatbot/types/types.js.map +1 -0
  77. package/dist/module/features/chatbot/types/units.types.js +6 -0
  78. package/dist/module/features/chatbot/types/units.types.js.map +1 -1
  79. package/dist/module/features/exampleSolution/ExampleSolutionModal.js +1 -3
  80. package/dist/module/features/exampleSolution/ExampleSolutionModal.js.map +1 -1
  81. package/dist/module/features/exampleSolution/assets/grid.webp +0 -0
  82. package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js +19 -12
  83. package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -1
  84. package/dist/module/features/exampleSolution/components/QuestionSection.js +9 -9
  85. package/dist/module/features/exampleSolution/components/QuestionSection.js.map +1 -1
  86. package/dist/module/features/exampleSolution/components/SolutionSection.js +57 -31
  87. package/dist/module/features/exampleSolution/components/SolutionSection.js.map +1 -1
  88. package/dist/module/features/exampleSolution/model/ExampleSolution.model.js +3 -1
  89. package/dist/module/features/exampleSolution/model/ExampleSolution.model.js.map +1 -1
  90. package/dist/module/features/formulaSheet/components/FormulaSheet.js +5 -4
  91. package/dist/module/features/formulaSheet/components/FormulaSheet.js.map +1 -1
  92. package/dist/module/shared/hooks/useKeyDownListener.js +3 -2
  93. package/dist/module/shared/hooks/useKeyDownListener.js.map +1 -1
  94. package/dist/module/shared/translation/localization/ca.json +2 -1
  95. package/dist/module/shared/translation/localization/en.json +3 -2
  96. package/dist/module/shared/translation/localization/gb.json +2 -1
  97. package/dist/module/shared/translation/localization/sct.json +2 -1
  98. package/dist/module/shared/translation/localization/sw.json +3 -2
  99. package/dist/typescript/commonjs/features/chatbot/components/{ChatMessages/ChatbotMessages.d.ts → Chat/Chat.d.ts} +3 -3
  100. package/dist/typescript/commonjs/features/chatbot/components/Chat/Chat.d.ts.map +1 -0
  101. package/dist/typescript/commonjs/features/chatbot/components/ChatInput/ChatInput.d.ts +9 -0
  102. package/dist/typescript/commonjs/features/chatbot/components/ChatInput/ChatInput.d.ts.map +1 -0
  103. package/dist/typescript/commonjs/features/chatbot/components/ChatInput/RequestHintButton.d.ts +16 -0
  104. package/dist/typescript/commonjs/features/chatbot/components/ChatInput/RequestHintButton.d.ts.map +1 -0
  105. package/dist/typescript/commonjs/features/chatbot/components/ChatInput/freeText/ChatTextInput.d.ts +16 -0
  106. package/dist/typescript/commonjs/features/chatbot/components/ChatInput/freeText/ChatTextInput.d.ts.map +1 -0
  107. package/dist/typescript/commonjs/features/chatbot/components/ChatInput/freeText/FreeTextInputBlock.d.ts +11 -0
  108. package/dist/typescript/commonjs/features/chatbot/components/ChatInput/freeText/FreeTextInputBlock.d.ts.map +1 -0
  109. package/dist/typescript/{module/features/chatbot/components/Alternatives/InputButton.d.ts → commonjs/features/chatbot/components/ChatInput/freeText/SendMessageButton.d.ts} +2 -2
  110. package/dist/typescript/commonjs/features/chatbot/components/ChatInput/freeText/SendMessageButton.d.ts.map +1 -0
  111. package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts +2 -0
  112. package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts.map +1 -1
  113. package/dist/typescript/commonjs/features/chatbot/constants.d.ts +1 -0
  114. package/dist/typescript/commonjs/features/chatbot/constants.d.ts.map +1 -1
  115. package/dist/typescript/commonjs/features/chatbot/index.d.ts +1 -0
  116. package/dist/typescript/commonjs/features/chatbot/index.d.ts.map +1 -1
  117. package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts +5 -6
  118. package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
  119. package/dist/typescript/commonjs/features/chatbot/model/ChatBotTextInput.d.ts +8 -0
  120. package/dist/typescript/commonjs/features/chatbot/model/ChatBotTextInput.d.ts.map +1 -0
  121. package/dist/typescript/commonjs/features/chatbot/model/ChatBotThreadManager.d.ts +3 -2
  122. package/dist/typescript/commonjs/features/chatbot/model/ChatBotThreadManager.d.ts.map +1 -1
  123. package/dist/typescript/commonjs/features/chatbot/model/translation.d.ts +1 -1
  124. package/dist/typescript/commonjs/features/chatbot/model/translation.d.ts.map +1 -1
  125. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts +23 -1
  126. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts.map +1 -1
  127. package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts +11 -2
  128. package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts.map +1 -1
  129. package/dist/typescript/commonjs/features/chatbot/types/types.d.ts +1 -0
  130. package/dist/typescript/commonjs/features/chatbot/types/types.d.ts.map +1 -0
  131. package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts +5 -0
  132. package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts.map +1 -1
  133. package/dist/typescript/commonjs/features/exampleSolution/ExampleSolutionModal.d.ts.map +1 -1
  134. package/dist/typescript/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.d.ts +5 -1
  135. package/dist/typescript/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -1
  136. package/dist/typescript/commonjs/features/exampleSolution/components/QuestionSection.d.ts +2 -1
  137. package/dist/typescript/commonjs/features/exampleSolution/components/QuestionSection.d.ts.map +1 -1
  138. package/dist/typescript/commonjs/features/exampleSolution/components/SolutionSection.d.ts.map +1 -1
  139. package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolution.model.d.ts +3 -2
  140. package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolution.model.d.ts.map +1 -1
  141. package/dist/typescript/commonjs/features/exampleSolution/types.d.ts +2 -1
  142. package/dist/typescript/commonjs/features/exampleSolution/types.d.ts.map +1 -1
  143. package/dist/typescript/commonjs/features/formulaSheet/components/FormulaSheet.d.ts.map +1 -1
  144. package/dist/typescript/commonjs/shared/hooks/useKeyDownListener.d.ts +1 -1
  145. package/dist/typescript/commonjs/shared/hooks/useKeyDownListener.d.ts.map +1 -1
  146. package/dist/typescript/commonjs/shared/hooks/useKeyboard.d.ts +1 -1
  147. package/dist/typescript/commonjs/shared/hooks/useKeyboard.d.ts.map +1 -1
  148. package/dist/typescript/commonjs/shared/translation/constants.d.ts +5 -0
  149. package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
  150. package/dist/typescript/commonjs/shared/translation/model.d.ts +2 -0
  151. package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
  152. package/dist/typescript/module/features/chatbot/components/{ChatMessages/ChatbotMessages.d.ts → Chat/Chat.d.ts} +3 -3
  153. package/dist/typescript/module/features/chatbot/components/Chat/Chat.d.ts.map +1 -0
  154. package/dist/typescript/module/features/chatbot/components/ChatInput/ChatInput.d.ts +9 -0
  155. package/dist/typescript/module/features/chatbot/components/ChatInput/ChatInput.d.ts.map +1 -0
  156. package/dist/typescript/module/features/chatbot/components/ChatInput/RequestHintButton.d.ts +16 -0
  157. package/dist/typescript/module/features/chatbot/components/ChatInput/RequestHintButton.d.ts.map +1 -0
  158. package/dist/typescript/module/features/chatbot/components/ChatInput/freeText/ChatTextInput.d.ts +16 -0
  159. package/dist/typescript/module/features/chatbot/components/ChatInput/freeText/ChatTextInput.d.ts.map +1 -0
  160. package/dist/typescript/module/features/chatbot/components/ChatInput/freeText/FreeTextInputBlock.d.ts +11 -0
  161. package/dist/typescript/module/features/chatbot/components/ChatInput/freeText/FreeTextInputBlock.d.ts.map +1 -0
  162. package/dist/typescript/{commonjs/features/chatbot/components/Alternatives/InputButton.d.ts → module/features/chatbot/components/ChatInput/freeText/SendMessageButton.d.ts} +2 -2
  163. package/dist/typescript/module/features/chatbot/components/ChatInput/freeText/SendMessageButton.d.ts.map +1 -0
  164. package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts +2 -0
  165. package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts.map +1 -1
  166. package/dist/typescript/module/features/chatbot/constants.d.ts +1 -0
  167. package/dist/typescript/module/features/chatbot/constants.d.ts.map +1 -1
  168. package/dist/typescript/module/features/chatbot/index.d.ts +1 -0
  169. package/dist/typescript/module/features/chatbot/index.d.ts.map +1 -1
  170. package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts +5 -6
  171. package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
  172. package/dist/typescript/module/features/chatbot/model/ChatBotTextInput.d.ts +8 -0
  173. package/dist/typescript/module/features/chatbot/model/ChatBotTextInput.d.ts.map +1 -0
  174. package/dist/typescript/module/features/chatbot/model/ChatBotThreadManager.d.ts +3 -2
  175. package/dist/typescript/module/features/chatbot/model/ChatBotThreadManager.d.ts.map +1 -1
  176. package/dist/typescript/module/features/chatbot/model/translation.d.ts +1 -1
  177. package/dist/typescript/module/features/chatbot/model/translation.d.ts.map +1 -1
  178. package/dist/typescript/module/features/chatbot/types/api.types.d.ts +23 -1
  179. package/dist/typescript/module/features/chatbot/types/api.types.d.ts.map +1 -1
  180. package/dist/typescript/module/features/chatbot/types/model.types.d.ts +11 -2
  181. package/dist/typescript/module/features/chatbot/types/model.types.d.ts.map +1 -1
  182. package/dist/typescript/module/features/chatbot/types/types.d.ts +1 -0
  183. package/dist/typescript/module/features/chatbot/types/types.d.ts.map +1 -0
  184. package/dist/typescript/module/features/chatbot/types/units.types.d.ts +5 -0
  185. package/dist/typescript/module/features/chatbot/types/units.types.d.ts.map +1 -1
  186. package/dist/typescript/module/features/exampleSolution/ExampleSolutionModal.d.ts.map +1 -1
  187. package/dist/typescript/module/features/exampleSolution/components/ExampleSolutionModalContent.d.ts +5 -1
  188. package/dist/typescript/module/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -1
  189. package/dist/typescript/module/features/exampleSolution/components/QuestionSection.d.ts +2 -1
  190. package/dist/typescript/module/features/exampleSolution/components/QuestionSection.d.ts.map +1 -1
  191. package/dist/typescript/module/features/exampleSolution/components/SolutionSection.d.ts.map +1 -1
  192. package/dist/typescript/module/features/exampleSolution/model/ExampleSolution.model.d.ts +3 -2
  193. package/dist/typescript/module/features/exampleSolution/model/ExampleSolution.model.d.ts.map +1 -1
  194. package/dist/typescript/module/features/exampleSolution/types.d.ts +2 -1
  195. package/dist/typescript/module/features/exampleSolution/types.d.ts.map +1 -1
  196. package/dist/typescript/module/features/formulaSheet/components/FormulaSheet.d.ts.map +1 -1
  197. package/dist/typescript/module/shared/hooks/useKeyDownListener.d.ts +1 -1
  198. package/dist/typescript/module/shared/hooks/useKeyDownListener.d.ts.map +1 -1
  199. package/dist/typescript/module/shared/hooks/useKeyboard.d.ts +1 -1
  200. package/dist/typescript/module/shared/hooks/useKeyboard.d.ts.map +1 -1
  201. package/dist/typescript/module/shared/translation/constants.d.ts +5 -0
  202. package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
  203. package/dist/typescript/module/shared/translation/model.d.ts +2 -0
  204. package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
  205. package/package.json +2 -2
  206. package/src/features/chatbot/components/{ChatMessages/ChatbotMessages.tsx → Chat/Chat.tsx} +12 -17
  207. package/src/features/chatbot/components/ChatInput/ChatInput.tsx +83 -0
  208. package/src/features/chatbot/components/ChatInput/RequestHintButton.tsx +156 -0
  209. package/src/features/chatbot/components/ChatInput/freeText/ChatTextInput.tsx +153 -0
  210. package/src/features/chatbot/components/ChatInput/freeText/FreeTextInputBlock.tsx +83 -0
  211. package/src/features/chatbot/components/{Alternatives/InputButton.tsx → ChatInput/freeText/SendMessageButton.tsx} +37 -16
  212. package/src/features/chatbot/components/Chatbot.tsx +4 -2
  213. package/src/features/chatbot/constants.ts +3 -0
  214. package/src/features/chatbot/index.ts +2 -0
  215. package/src/features/chatbot/model/ChatBotModel.ts +67 -33
  216. package/src/features/chatbot/model/ChatBotTextInput.ts +10 -0
  217. package/src/features/chatbot/model/ChatBotThreadManager.ts +35 -9
  218. package/src/features/chatbot/model/translation.ts +1 -1
  219. package/src/features/chatbot/types/api.types.ts +25 -1
  220. package/src/features/chatbot/types/model.types.ts +16 -1
  221. package/src/features/chatbot/types/types.ts +0 -0
  222. package/src/features/chatbot/types/units.types.ts +6 -0
  223. package/src/features/exampleSolution/ExampleSolutionModal.tsx +1 -7
  224. package/src/features/exampleSolution/assets/grid.webp +0 -0
  225. package/src/features/exampleSolution/components/ExampleSolutionModalContent.tsx +24 -12
  226. package/src/features/exampleSolution/components/QuestionSection.tsx +11 -7
  227. package/src/features/exampleSolution/components/SolutionSection.tsx +72 -29
  228. package/src/features/exampleSolution/model/ExampleSolution.model.ts +5 -2
  229. package/src/features/exampleSolution/types.ts +2 -1
  230. package/src/features/formulaSheet/components/FormulaSheet.tsx +6 -4
  231. package/src/shared/hooks/useKeyDownListener.ts +3 -1
  232. package/src/shared/translation/localization/ca.json +2 -1
  233. package/src/shared/translation/localization/en.json +3 -2
  234. package/src/shared/translation/localization/gb.json +2 -1
  235. package/src/shared/translation/localization/sct.json +2 -1
  236. package/src/shared/translation/localization/sw.json +3 -2
  237. package/dist/commonjs/features/chatbot/components/Alternatives/Alternatives.js +0 -111
  238. package/dist/commonjs/features/chatbot/components/Alternatives/Alternatives.js.map +0 -1
  239. package/dist/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.js +0 -208
  240. package/dist/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.js.map +0 -1
  241. package/dist/commonjs/features/chatbot/components/Alternatives/InputButton.js.map +0 -1
  242. package/dist/commonjs/features/chatbot/components/Alternatives/InputWithHintRow.js +0 -157
  243. package/dist/commonjs/features/chatbot/components/Alternatives/InputWithHintRow.js.map +0 -1
  244. package/dist/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +0 -1
  245. package/dist/commonjs/features/exampleSolution/assets/grid.png +0 -0
  246. package/dist/module/features/chatbot/components/Alternatives/Alternatives.js +0 -105
  247. package/dist/module/features/chatbot/components/Alternatives/Alternatives.js.map +0 -1
  248. package/dist/module/features/chatbot/components/Alternatives/HelpRequestOption.js +0 -200
  249. package/dist/module/features/chatbot/components/Alternatives/HelpRequestOption.js.map +0 -1
  250. package/dist/module/features/chatbot/components/Alternatives/InputButton.js.map +0 -1
  251. package/dist/module/features/chatbot/components/Alternatives/InputWithHintRow.js +0 -150
  252. package/dist/module/features/chatbot/components/Alternatives/InputWithHintRow.js.map +0 -1
  253. package/dist/module/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +0 -1
  254. package/dist/module/features/exampleSolution/assets/grid.png +0 -0
  255. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/Alternatives.d.ts +0 -11
  256. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/Alternatives.d.ts.map +0 -1
  257. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.d.ts +0 -13
  258. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.d.ts.map +0 -1
  259. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/InputButton.d.ts.map +0 -1
  260. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/InputWithHintRow.d.ts +0 -11
  261. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/InputWithHintRow.d.ts.map +0 -1
  262. package/dist/typescript/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts.map +0 -1
  263. package/dist/typescript/module/features/chatbot/components/Alternatives/Alternatives.d.ts +0 -11
  264. package/dist/typescript/module/features/chatbot/components/Alternatives/Alternatives.d.ts.map +0 -1
  265. package/dist/typescript/module/features/chatbot/components/Alternatives/HelpRequestOption.d.ts +0 -13
  266. package/dist/typescript/module/features/chatbot/components/Alternatives/HelpRequestOption.d.ts.map +0 -1
  267. package/dist/typescript/module/features/chatbot/components/Alternatives/InputButton.d.ts.map +0 -1
  268. package/dist/typescript/module/features/chatbot/components/Alternatives/InputWithHintRow.d.ts +0 -11
  269. package/dist/typescript/module/features/chatbot/components/Alternatives/InputWithHintRow.d.ts.map +0 -1
  270. package/dist/typescript/module/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts.map +0 -1
  271. package/src/features/chatbot/components/Alternatives/Alternatives.tsx +0 -135
  272. package/src/features/chatbot/components/Alternatives/HelpRequestOption.tsx +0 -214
  273. package/src/features/chatbot/components/Alternatives/InputWithHintRow.tsx +0 -160
  274. package/src/features/exampleSolution/assets/grid.png +0 -0
@@ -1,8 +1,9 @@
1
1
  import { ThreadItem } from './ThreadItem';
2
- import { ChatHintPayload, ChatHintResponse, PostMessagePayload, PostMessageResponse } from '../types/api.types';
2
+ import { ChatHintPayload, ChatHintResponse, PostMessagePayload, PostMessageResponse, SendMessagePayload, SendMessageResponse } from '../types/api.types';
3
3
  import { ChatbotMessages, IChatDrawBoardAdapter } from '../types/model.types';
4
4
  type ThreadManagerApi = {
5
5
  getHint: (props: ChatHintPayload) => Promise<ChatHintResponse>;
6
+ sendMessage: (props: SendMessagePayload) => Promise<SendMessageResponse>;
6
7
  };
7
8
  type ChatBotThreadManagerProps = {
8
9
  messagesLimit?: number;
@@ -20,7 +21,7 @@ export declare class ChatBotThreadManager {
20
21
  constructor({ drawBoardAdapter, api, messagesLimit, messages, }: ChatBotThreadManagerProps);
21
22
  private getThreadItem;
22
23
  setDrawBoardAdapter(adapter: IChatDrawBoardAdapter): void;
23
- readonly postMessage: ({ problemAnswer, problem, answer, language, imageAltText, }: PostMessagePayload) => Promise<PostMessageResponse>;
24
+ readonly postMessage: ({ problemAnswer, problemDescription, answer, answerOptions, language, imageAltText, imageCdnId, freeTextMessage, conversationId, }: PostMessagePayload) => Promise<PostMessageResponse>;
24
25
  get(key: string): ThreadItem | undefined;
25
26
  reset(key?: string): void;
26
27
  setMessagesLimit(limit: number): void;
@@ -1 +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,EACL,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAG7E,KAAK,gBAAgB,GAAG;IACtB,OAAO,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAA;CAC/D,CAAA;AAED,KAAK,yBAAyB,GAAG;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,gBAAgB,CAAC,EAAE,qBAAqB,CAAA;IACxC,QAAQ,EAAE,eAAe,CAAA;IACzB,GAAG,CAAC,EAAE,gBAAgB,CAAA;CACvB,CAAA;AAED,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,GAAG,CAAgC;IAC3C,OAAO,CAAC,gBAAgB,CAAqC;IAC7D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgC;IAExD,OAAO,CAAC,aAAa,CAAA;IACrB,OAAO,CAAC,UAAU,CAAK;IAEvB,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAA;gBAEb,EACjB,gBAAgB,EAChB,GAAG,EACH,aAA6D,EAC7D,QAAQ,GACT,EAAE,yBAAyB;YAOd,aAAa;IAkBpB,mBAAmB,CAAC,OAAO,EAAE,qBAAqB;IAIzD,SAAgB,WAAW,gEAMxB,kBAAkB,KAAG,OAAO,CAAC,mBAAmB,CAAC,CA2BnD;IAEM,GAAG,CAAC,GAAG,EAAE,MAAM;IAIf,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM;IAQlB,gBAAgB,CAAC,KAAK,EAAE,MAAM;IAI9B,MAAM,CAAC,GAAG,EAAE,gBAAgB;IAK5B,aAAa,CAAC,GAAG,EAAE,MAAM;CAGjC"}
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,EACL,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAG7E,KAAK,gBAAgB,GAAG;IACtB,OAAO,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAA;IAC9D,WAAW,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAA;CACzE,CAAA;AAED,KAAK,yBAAyB,GAAG;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,gBAAgB,CAAC,EAAE,qBAAqB,CAAA;IACxC,QAAQ,EAAE,eAAe,CAAA;IACzB,GAAG,CAAC,EAAE,gBAAgB,CAAA;CACvB,CAAA;AAED,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,GAAG,CAAgC;IAC3C,OAAO,CAAC,gBAAgB,CAAqC;IAC7D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgC;IAExD,OAAO,CAAC,aAAa,CAAA;IACrB,OAAO,CAAC,UAAU,CAAK;IAEvB,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAA;gBAEb,EACjB,gBAAgB,EAChB,GAAG,EACH,aAA6D,EAC7D,QAAQ,GACT,EAAE,yBAAyB;YAOd,aAAa;IAkBpB,mBAAmB,CAAC,OAAO,EAAE,qBAAqB;IAIzD,SAAgB,WAAW,uIAUxB,kBAAkB,KAAG,OAAO,CAAC,mBAAmB,CAAC,CA8CnD;IAEM,GAAG,CAAC,GAAG,EAAE,MAAM;IAIf,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM;IAQlB,gBAAgB,CAAC,KAAK,EAAE,MAAM;IAI9B,MAAM,CAAC,GAAG,EAAE,gBAAgB;IAK5B,aAAa,CAAC,GAAG,EAAE,MAAM;CAGjC"}
@@ -16,7 +16,7 @@ type ChatbotTranslationProps = {
16
16
  chats: ChatsCacheModel;
17
17
  };
18
18
  export declare class ChatbotTranslation {
19
- private readonly api;
19
+ readonly api: ChatbotAPI;
20
20
  private readonly $key;
21
21
  private readonly $context;
22
22
  private readonly defaultMessages;
@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C,QAAQ,CAAC,iBAAiB,CAAA;IAElC,QAAQ,CAAC,eAAe,yBAAyB;IACjD,QAAQ,CAAC,aAAa,4CAAuC;IAE7D,SAAgB,sBAAsB,gEAAA;IACtC,SAAgB,kBAAkB,iFAAA;gBAEtB,EACV,GAAG,EACH,IAAI,EACJ,eAAe,EACf,iBAAiB,EACjB,QAAQ,EACR,KAAK,GACN,EAAE,uBAAuB;YA0CZ,gBAAgB;IAmB9B,OAAO,CAAC,4BAA4B;IAIpC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAyDhC;IAED,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CA4BnC;IAEM,KAAK;CAGb"}
@@ -9,19 +9,39 @@ export type AlternativesOptions = {
9
9
  };
10
10
  export type GetAlternativesResponse = {
11
11
  chatAccess?: boolean;
12
+ isOpenChatEnabled?: boolean;
13
+ version: string;
12
14
  options: AlternativesOptions;
13
15
  };
16
+ export type SendMessagePayload = {
17
+ problemDescription?: string;
18
+ correctAnswer?: string | string[];
19
+ answerOptions?: string[];
20
+ altText?: string;
21
+ language?: string;
22
+ message: string;
23
+ conversationId?: string;
24
+ };
25
+ export type SendMessageResponse = {
26
+ message: string;
27
+ conversationId?: string | null;
28
+ };
14
29
  export type PostMessagePayload = {
15
30
  language: string;
16
31
  problemAnswer: string[];
32
+ problemDescription: string;
17
33
  answer?: string | string[];
18
- problem: string;
34
+ answerOptions?: string[];
19
35
  imageAltText?: string;
36
+ imageCdnId?: string;
37
+ freeTextMessage?: string;
38
+ conversationId?: string | null;
20
39
  };
21
40
  export type PostMessageResponse = {
22
41
  message: string;
23
42
  options: ChatAnswer[];
24
43
  endMessage?: boolean;
44
+ conversationId?: string | null;
25
45
  threadId: string;
26
46
  };
27
47
  export type GoogleTranslatePayload = {
@@ -61,10 +81,12 @@ export type ChatHintPayload = {
61
81
  previousHint?: string;
62
82
  language: string;
63
83
  imageAltText?: string;
84
+ imageCdnId?: string;
64
85
  drawBoardText?: string;
65
86
  };
66
87
  export type ChatHintResponse = {
67
88
  message: string;
89
+ conversationId?: string | null;
68
90
  };
69
91
  export type ErrorSpottingPayload = {
70
92
  strokes: FullStrokeData[];
@@ -1 +1 @@
1
- {"version":3,"file":"api.types.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/types/api.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAElE,MAAM,MAAM,sBAAsB,GAAG;IACnC,cAAc,EAAE,MAAM,CAAA;IACtB,oBAAoB,EAAE,MAAM,CAAA;CAC7B,GAAG,IAAI,CAAA;AAER,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,UAAU,EAAE,CAAA;IACrB,KAAK,EAAE,UAAU,EAAE,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,EAAE,mBAAmB,CAAA;CAC7B,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,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,UAAU,EAAE,CAAA;IACrB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;CACjB,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,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AM,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;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC/B,CAAA;AACD,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,cAAc,EAAE,CAAA;IACzB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC7B,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AACD,MAAM,MAAM,qBAAqB,GAAG;IAClC,oBAAoB,EAAE,MAAM,EAAE,CAAA;CAC/B,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import type { Store } from 'effector';
2
- import { ChatHintPayload, ChatHintResponse, ErrorSpottingPayload, ErrorSpottingResponse, GetAlternativesPayload, GetAlternativesResponse, GoogleText2SpeechPayload, GoogleText2SpeechResponse, GoogleTranslatePayload, GoogleTranslateResponse, PostMessagePayload, PostMessageResponse } from './api.types';
2
+ import { ChatHintPayload, ChatHintResponse, ErrorSpottingPayload, ErrorSpottingResponse, GetAlternativesPayload, GetAlternativesResponse, GoogleText2SpeechPayload, GoogleText2SpeechResponse, GoogleTranslatePayload, GoogleTranslateResponse, PostMessagePayload, PostMessageResponse, SendMessagePayload, SendMessageResponse } from './api.types';
3
3
  import { ExtendWithOptional } from '../../../lib/helpers/types';
4
- import { ChatAnswer, ConversationMessage, FullStrokeData } from './units.types';
4
+ import { ChatAnswer, ChatItem, ConversationMessage, FullStrokeData } from './units.types';
5
5
  export type ChatbotMessages = {
6
6
  error: ConversationMessage;
7
7
  start: ConversationMessage;
@@ -10,6 +10,7 @@ export type ChatbotMessages = {
10
10
  };
11
11
  export type ChatbotApiRequests = {
12
12
  getAlternatives: (props: GetAlternativesPayload) => Promise<GetAlternativesResponse>;
13
+ sendMessage: (props: SendMessagePayload) => Promise<SendMessageResponse>;
13
14
  postMessage: (props: PostMessagePayload) => Promise<PostMessageResponse>;
14
15
  postTranslateText: (props: GoogleTranslatePayload) => Promise<GoogleTranslateResponse>;
15
16
  postTextToSpeech: (props: GoogleText2SpeechPayload) => Promise<GoogleText2SpeechResponse>;
@@ -29,10 +30,13 @@ export type ChatbotModelProps = {
29
30
  export type SendHelpParams = {
30
31
  message: string;
31
32
  translatedMessage?: string;
33
+ isFreeText?: boolean;
32
34
  };
33
35
  export type SendHelpProps = SendHelpParams & {
34
36
  key: string;
35
37
  context: ChatbotContext | null;
38
+ cache: Record<string, ChatItem>;
39
+ isFreeText?: boolean;
36
40
  };
37
41
  export type SetHintMessageProps = {
38
42
  key: string;
@@ -74,8 +78,13 @@ export type ChatbotContext = {
74
78
  problem: string;
75
79
  problemAnswer: string[];
76
80
  answer?: string | string[];
81
+ answerOptions?: string[];
77
82
  translationTargetLanguage: string;
78
83
  imageDescription?: string;
84
+ imageCdnId?: string;
85
+ };
86
+ export type ReinitConversationProps = {
87
+ key: string;
79
88
  };
80
89
  export {};
81
90
  //# sourceMappingURL=model.types.d.ts.map
@@ -1 +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,EACL,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,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,uBAAuB,GAAG,IAAI,CAAC,CAAA;CACtD,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC1B,yBAAyB,EAAE,MAAM,CAAA;IACjC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA"}
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,EACL,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEzF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,mBAAmB,CAAA;IAC1B,KAAK,EAAE,mBAAmB,CAAA;IAC1B,UAAU,EAAE,mBAAmB,CAAA;IAC/B,iBAAiB,EAAE,UAAU,CAAA;CAC9B,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,eAAe,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAA;IACpF,WAAW,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAA;IACxE,WAAW,EAAE,CAAC,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,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/types/types.ts"],"names":[],"mappings":""}
@@ -30,5 +30,10 @@ export type ChatItem = {
30
30
  messages: ConversationMessage[];
31
31
  isAvailable: boolean;
32
32
  currentThread: IThreadItem | null;
33
+ conversationId?: string | null;
33
34
  };
35
+ export declare enum ChatInputMode {
36
+ FreeText = 1,
37
+ Option = 2
38
+ }
34
39
  //# sourceMappingURL=units.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"units.types.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/types/units.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG;IACnB,CAAC,EAAE,MAAM,EAAE,CAAA;IACX,CAAC,EAAE,MAAM,EAAE,CAAA;CACZ,CAAA;AACD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG;IACpC,EAAE,EAAE,MAAM,CAAA;CACX,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAA;IACnC,OAAO,EAAE,cAAc,EAAE,GAAG,IAAI,CAAA;IAChC,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB,CAAA;AAED,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,mBAAmB,GAAG;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,UAAU,EAAE,CAAA;IACrB,YAAY,EAAE,OAAO,CAAA;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,EAAE,mBAAmB,EAAE,CAAA;IAC/B,WAAW,EAAE,OAAO,CAAA;IACpB,aAAa,EAAE,WAAW,GAAG,IAAI,CAAA;CAClC,CAAA"}
1
+ {"version":3,"file":"units.types.d.ts","sourceRoot":"","sources":["../../../../../../src/features/chatbot/types/units.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG;IACnB,CAAC,EAAE,MAAM,EAAE,CAAA;IACX,CAAC,EAAE,MAAM,EAAE,CAAA;CACZ,CAAA;AACD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG;IACpC,EAAE,EAAE,MAAM,CAAA;CACX,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAA;IACnC,OAAO,EAAE,cAAc,EAAE,GAAG,IAAI,CAAA;IAChC,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB,CAAA;AAED,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,mBAAmB,GAAG;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,UAAU,EAAE,CAAA;IACrB,YAAY,EAAE,OAAO,CAAA;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,EAAE,mBAAmB,EAAE,CAAA;IAC/B,WAAW,EAAE,OAAO,CAAA;IACpB,aAAa,EAAE,WAAW,GAAG,IAAI,CAAA;IACjC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC/B,CAAA;AAED,oBAAY,aAAa;IACvB,QAAQ,IAAI;IACZ,MAAM,IAAI;CACX"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleSolutionModal.d.ts","sourceRoot":"","sources":["../../../../../src/features/exampleSolution/ExampleSolutionModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAA;AAEpD,KAAK,kCAAkC,GAAG;IACxC,KAAK,EAAE;QACL,UAAU,EAAE,MAAM,IAAI,CAAA;QACtB,MAAM,EAAE,0BAA0B,CAAA;KACnC,CAAA;CACF,CAAA;AAED,eAAO,MAAM,oBAAoB,uCAE9B,kCAAkC,sBAcpC,CAAA"}
1
+ {"version":3,"file":"ExampleSolutionModal.d.ts","sourceRoot":"","sources":["../../../../../src/features/exampleSolution/ExampleSolutionModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAA;AAEpD,KAAK,kCAAkC,GAAG;IACxC,KAAK,EAAE;QACL,UAAU,EAAE,MAAM,IAAI,CAAA;QACtB,MAAM,EAAE,0BAA0B,CAAA;KACnC,CAAA;CACF,CAAA;AAED,eAAO,MAAM,oBAAoB,uCAE9B,kCAAkC,sBAQpC,CAAA"}
@@ -1,4 +1,8 @@
1
1
  import React from 'react';
2
2
  import { ExampleSolutionModalParams } from '../types';
3
- export declare const ExampleSolutionModalContent: ({ model, payload, cacheKey, }: ExampleSolutionModalParams) => React.JSX.Element;
3
+ type ExampleSolutionModalContentProps = {
4
+ params: ExampleSolutionModalParams;
5
+ };
6
+ export declare const ExampleSolutionModalContent: ({ params: { model, payload, cacheKey }, }: ExampleSolutionModalContentProps) => React.JSX.Element;
7
+ export {};
4
8
  //# sourceMappingURL=ExampleSolutionModalContent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleSolutionModalContent.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/components/ExampleSolutionModalContent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAKrD,eAAO,MAAM,2BAA2B,kCAIrC,0BAA0B,sBAiB5B,CAAA"}
1
+ {"version":3,"file":"ExampleSolutionModalContent.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/components/ExampleSolutionModalContent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAKrD,KAAK,gCAAgC,GAAG;IACtC,MAAM,EAAE,0BAA0B,CAAA;CACnC,CAAA;AAID,eAAO,MAAM,2BAA2B,8CAErC,gCAAgC,sBA0BlC,CAAA"}
@@ -3,7 +3,8 @@ import { ExampleSolutionStatuses } from '../constants';
3
3
  type QuestionSectionProps = {
4
4
  question?: string;
5
5
  status: ExampleSolutionStatuses;
6
+ renderKatexComponent: (katexString: string) => React.ReactNode;
6
7
  };
7
- export declare const QuestionSection: ({ question, status }: QuestionSectionProps) => React.JSX.Element;
8
+ export declare const QuestionSection: ({ question, status, renderKatexComponent, }: QuestionSectionProps) => React.JSX.Element;
8
9
  export {};
9
10
  //# sourceMappingURL=QuestionSection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"QuestionSection.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/components/QuestionSection.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAEtD,KAAK,oBAAoB,GAAG;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,uBAAuB,CAAA;CAChC,CAAA;AAED,eAAO,MAAM,eAAe,yBAA0B,oBAAoB,sBAazE,CAAA"}
1
+ {"version":3,"file":"QuestionSection.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/components/QuestionSection.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAEtD,KAAK,oBAAoB,GAAG;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,uBAAuB,CAAA;IAC/B,oBAAoB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAA;CAC/D,CAAA;AAED,eAAO,MAAM,eAAe,gDAIzB,oBAAoB,sBAWtB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"SolutionSection.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/components/SolutionSection.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAGtD,KAAK,oBAAoB,GAAG;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,uBAAuB,CAAA;CAChC,CAAA;AAID,eAAO,MAAM,eAAe,uBAAwB,oBAAoB,sBAsBvE,CAAA"}
1
+ {"version":3,"file":"SolutionSection.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/components/SolutionSection.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAGtD,KAAK,oBAAoB,GAAG;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,uBAAuB,CAAA;CAChC,CAAA;AAWD,eAAO,MAAM,eAAe,uBAAwB,oBAAoB,sBAiDvE,CAAA"}
@@ -1,9 +1,10 @@
1
- import { GifCelebrationsModelProps } from '../types';
1
+ import { ExampleSolutionModelProps } from '../types';
2
2
  import { ExampleSolutionsApi } from './ExampleSolutionApi';
3
3
  import { ExampleSolutionCache } from './ExampleSolutionCache';
4
4
  export declare class ExampleSolutionModel {
5
5
  readonly api: ExampleSolutionsApi;
6
6
  readonly cache: ExampleSolutionCache;
7
- constructor({ api, errorHandler }: GifCelebrationsModelProps);
7
+ readonly renderKatexComponent: (katexString: string) => React.ReactNode;
8
+ constructor({ api, errorHandler, renderKatexComponent }: ExampleSolutionModelProps);
8
9
  }
9
10
  //# sourceMappingURL=ExampleSolution.model.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleSolution.model.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/model/ExampleSolution.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAE7D,qBAAa,oBAAoB;IAC/B,SAAgB,GAAG,sBAAA;IACnB,SAAgB,KAAK,uBAA6B;gBAEtC,EAAE,GAAG,EAAE,YAAY,EAAE,EAAE,yBAAyB;CAG7D"}
1
+ {"version":3,"file":"ExampleSolution.model.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/model/ExampleSolution.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAE7D,qBAAa,oBAAoB;IAC/B,SAAgB,GAAG,sBAAA;IACnB,SAAgB,KAAK,uBAA6B;IAElD,SAAgB,oBAAoB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAA;gBAElE,EAAE,GAAG,EAAE,YAAY,EAAE,oBAAoB,EAAE,EAAE,yBAAyB;CAInF"}
@@ -14,9 +14,10 @@ export type ExampleSolutionApiRequests = {
14
14
  generateExampleSolution: (body: ExampleSolutionPayload) => Promise<ExampleSolutionResponse>;
15
15
  };
16
16
  export type ExampleSolutionErrorHandler = (errorMessage: string) => void;
17
- export type GifCelebrationsModelProps = {
17
+ export type ExampleSolutionModelProps = {
18
18
  api: ExampleSolutionApiRequests;
19
19
  errorHandler?: ExampleSolutionErrorHandler;
20
+ renderKatexComponent: (katexString: string) => React.ReactNode;
20
21
  };
21
22
  export type ExampleSolutionModalParams = {
22
23
  cacheKey: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/exampleSolution/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAA;AAEpE,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AACD,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AACD,MAAM,MAAM,0BAA0B,GAAG;IACvC,uBAAuB,EAAE,CAAC,IAAI,EAAE,sBAAsB,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAA;CAC5F,CAAA;AACD,MAAM,MAAM,2BAA2B,GAAG,CAAC,YAAY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IAC/B,KAAK,EAAE,oBAAoB,CAAA;CAC5B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"FormulaSheet.d.ts","sourceRoot":"","sources":["../../../../../../src/features/formulaSheet/components/FormulaSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAc,SAAS,EAAa,MAAM,OAAO,CAAA;AAE/D,OAAO,EAEL,WAAW,EACX,UAAU,EAIV,SAAS,EACT,WAAW,EACX,WAAW,EACZ,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAGlD,KAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE,iBAAiB,CAAA;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,SAAS,CAAA;IACzC,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,WAAW,EAAE,WAAW,CAAA;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,KAAK,CAAC,EAAE,WAAW,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,YAAY,4FAkDxB,CAAA"}
1
+ {"version":3,"file":"FormulaSheet.d.ts","sourceRoot":"","sources":["../../../../../../src/features/formulaSheet/components/FormulaSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAc,SAAS,EAAa,MAAM,OAAO,CAAA;AAE/D,OAAO,EAEL,WAAW,EACX,UAAU,EAIV,SAAS,EACT,WAAW,EACX,WAAW,EACZ,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAGlD,KAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE,iBAAiB,CAAA;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,SAAS,CAAA;IACzC,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,WAAW,EAAE,WAAW,CAAA;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,KAAK,CAAC,EAAE,WAAW,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,YAAY,4FAoDxB,CAAA"}
@@ -1,3 +1,3 @@
1
1
  import { KeyboardKeys } from '../../lib/constants';
2
- export declare const useKeyDownListener: (callback: (event: KeyboardEvent) => void, overrideKeys?: KeyboardKeys[]) => void;
2
+ export declare const useKeyDownListener: (callback: (event: KeyboardEvent) => void, enabled?: boolean, overrideKeys?: KeyboardKeys[]) => void;
3
3
  //# sourceMappingURL=useKeyDownListener.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useKeyDownListener.d.ts","sourceRoot":"","sources":["../../../../../src/shared/hooks/useKeyDownListener.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD,eAAO,MAAM,kBAAkB,aACnB,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,wCAqBzC,CAAA"}
1
+ {"version":3,"file":"useKeyDownListener.d.ts","sourceRoot":"","sources":["../../../../../src/shared/hooks/useKeyDownListener.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD,eAAO,MAAM,kBAAkB,aACnB,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,2DAuBzC,CAAA"}
@@ -7,5 +7,5 @@
7
7
  * - On web (default), it returns the `useKeyDownListener` hook, which allows you
8
8
  * to register a callback that is triggered on keydown events.
9
9
  */
10
- export declare const useKeyBoard: (callback: (event: KeyboardEvent) => void, overrideKeys?: import("../../lib/constants").KeyboardKeys[]) => void;
10
+ export declare const useKeyBoard: (callback: (event: KeyboardEvent) => void, enabled?: boolean, overrideKeys?: import("../../lib/constants").KeyboardKeys[]) => void;
11
11
  //# sourceMappingURL=useKeyboard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useKeyboard.d.ts","sourceRoot":"","sources":["../../../../../src/shared/hooks/useKeyboard.ts"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,iHAGtB,CAAC"}
1
+ {"version":3,"file":"useKeyboard.d.ts","sourceRoot":"","sources":["../../../../../src/shared/hooks/useKeyboard.ts"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,oIAGtB,CAAC"}
@@ -19,6 +19,7 @@ export declare const LOCALIZATION_CONFIGS: {
19
19
  errorMessage: string;
20
20
  howCanIHelp: string;
21
21
  showError: string;
22
+ inputPlaceholder: string;
22
23
  };
23
24
  gifCelebrations: {
24
25
  greatStart: string;
@@ -52,6 +53,7 @@ export declare const LOCALIZATION_CONFIGS: {
52
53
  errorMessage: string;
53
54
  howCanIHelp: string;
54
55
  showError: string;
56
+ inputPlaceholder: string;
55
57
  };
56
58
  gifCelebrations: {
57
59
  greatStart: string;
@@ -85,6 +87,7 @@ export declare const LOCALIZATION_CONFIGS: {
85
87
  errorMessage: string;
86
88
  howCanIHelp: string;
87
89
  showError: string;
90
+ inputPlaceholder: string;
88
91
  };
89
92
  gifCelebrations: {
90
93
  greatStart: string;
@@ -118,6 +121,7 @@ export declare const LOCALIZATION_CONFIGS: {
118
121
  errorMessage: string;
119
122
  howCanIHelp: string;
120
123
  showError: string;
124
+ inputPlaceholder: string;
121
125
  };
122
126
  gifCelebrations: {
123
127
  greatStart: string;
@@ -151,6 +155,7 @@ export declare const LOCALIZATION_CONFIGS: {
151
155
  errorMessage: string;
152
156
  howCanIHelp: string;
153
157
  showError: string;
158
+ inputPlaceholder: string;
154
159
  };
155
160
  gifCelebrations: {
156
161
  greatStart: string;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/constants.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMhC,CAAA"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/constants.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMhC,CAAA"}
@@ -20,6 +20,7 @@ export declare const setLocalization: import("effector").EventCallable<{
20
20
  errorMessage: string;
21
21
  howCanIHelp: string;
22
22
  showError: string;
23
+ inputPlaceholder: string;
23
24
  };
24
25
  gifCelebrations: {
25
26
  greatStart: string;
@@ -53,6 +54,7 @@ export declare const $localization: import("effector").StoreWritable<{
53
54
  errorMessage: string;
54
55
  howCanIHelp: string;
55
56
  showError: string;
57
+ inputPlaceholder: string;
56
58
  };
57
59
  gifCelebrations: {
58
60
  greatStart: string;
@@ -1 +1 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/model.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,YAAY,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAElD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cACD,OAAO,oBAAoB,KAAK,YAAY,EACpE,CAAA;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMzB,CAAA"}
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/model.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,YAAY,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAElD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cACD,OAAO,oBAAoB,KAAK,YAAY,EACpE,CAAA;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMzB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magmamath/students-features",
3
- "version": "0.6.14-rc.2",
3
+ "version": "0.6.14-rc.21",
4
4
  "description": "Magmamath features library",
5
5
  "source": "src/index.ts",
6
6
  "main": "src/index.ts",
@@ -29,7 +29,7 @@
29
29
  "react-native-modalfy": "*"
30
30
  },
31
31
  "devDependencies": {
32
- "@magmamath/react-native-ui": "0.4.37",
32
+ "@magmamath/react-native-ui": "0.4.44",
33
33
  "effector": "^23.2.3",
34
34
  "effector-react": "^23.2.1",
35
35
  "@react-native/eslint-config": "^0.73.1",
@@ -5,29 +5,29 @@ import { useStoreMap, useUnit } from 'effector-react'
5
5
  import { ChatbotModel } from '../../model/ChatBotModel'
6
6
  import { ChatMessage } from '../ChatMessage/ChatMessage'
7
7
  import { MessageLoader } from '../ChatMessage/MessageLoader'
8
- import { Alternatives } from '../Alternatives/Alternatives'
8
+ import { ChatInput } from '../ChatInput/ChatInput'
9
9
  import { MessageVariant } from '../../types/model.types'
10
10
  import { ColorScheme } from '../../types/style.types'
11
11
 
12
- type ChatbotMessagesProps = {
13
- model: ChatbotModel
14
- isHintFeedback: boolean
15
- isTextToSpeechEnabled: boolean
16
- colorScheme?: ColorScheme
17
- }
18
-
19
12
  const TOOLBAR_HEIGHT = 140
20
13
  const BOTTOM_OFFSET = Platform.select({
21
14
  web: 265,
22
15
  default: 294,
23
16
  })
24
17
 
25
- export const ChatbotMessages = ({
18
+ type ChatbotProps = {
19
+ model: ChatbotModel
20
+ isHintFeedback: boolean
21
+ isTextToSpeechEnabled: boolean
22
+ colorScheme?: ColorScheme
23
+ }
24
+
25
+ export const Chat = ({
26
26
  model,
27
27
  isHintFeedback,
28
28
  isTextToSpeechEnabled,
29
29
  colorScheme = ColorScheme.Blue,
30
- }: ChatbotMessagesProps) => {
30
+ }: ChatbotProps) => {
31
31
  const dimensions = useWindowDimensions()
32
32
  const ref = useRef<ScrollView>(null)
33
33
  const isOpen = useUnit(model.$isOpen)
@@ -45,10 +45,6 @@ export const ChatbotMessages = ({
45
45
 
46
46
  const MAX_HEIGHT = dimensions.height - TOOLBAR_HEIGHT - BOTTOM_OFFSET
47
47
 
48
- const askChatForHelp = (message: string, translatedMessage?: string) => {
49
- void model.sendHelpRequestFx({ message, translatedMessage })
50
- }
51
-
52
48
  return (
53
49
  <View style={[styles.container, { maxHeight: MAX_HEIGHT }]}>
54
50
  <ScrollView
@@ -89,11 +85,10 @@ export const ChatbotMessages = ({
89
85
  )}
90
86
 
91
87
  {isOpen && (
92
- <Alternatives
93
- onPressAlternative={askChatForHelp}
94
- hasMessages={messages.length > 1}
88
+ <ChatInput
95
89
  isHintFeedback={isHintFeedback}
96
90
  colorScheme={colorScheme}
91
+ hasMessages={messages.length > 1}
97
92
  />
98
93
  )}
99
94
  </ScrollView>
@@ -0,0 +1,83 @@
1
+ import React, { useCallback } from 'react'
2
+ import { IS_WEB } from '@magmamath/react-native-ui'
3
+ import { StyleSheet, View } from 'react-native'
4
+ import { useStoreMap, useUnit } from 'effector-react'
5
+ import { useChatModel } from '../../context/ChatBotModelContext'
6
+ import { ColorScheme } from '../../types/style.types'
7
+ import { HintButtonVariant, RequestHintButton } from './RequestHintButton'
8
+ import { FreeTextInputBlock } from './freeText/FreeTextInputBlock'
9
+
10
+ export type ChatInputProps = {
11
+ hasMessages: boolean
12
+ isHintFeedback: boolean
13
+ colorScheme?: ColorScheme
14
+ }
15
+
16
+ export const ChatInput = ({
17
+ isHintFeedback,
18
+ hasMessages,
19
+ colorScheme = ColorScheme.Blue,
20
+ }: ChatInputProps) => {
21
+ const model = useChatModel()
22
+ const alternatives = useUnit(model.$alternatives)
23
+ const isTranslated = useUnit(model.translation.$isTranslated)
24
+ const isTranslationPending = useUnit(model.translation.translateAllMessagesFx.pending)
25
+ const isHelpRequestPending = useUnit(model.sendHelpRequestFx.pending)
26
+
27
+ const lastMessageOptions = useStoreMap(model.$currentChatData, ({ messages }) => {
28
+ const lastMessage = messages.at(-1)
29
+ return lastMessage?.options ?? []
30
+ })
31
+
32
+ const option = (() => {
33
+ if (hasMessages && lastMessageOptions.length) return lastMessageOptions[0]
34
+ if (isHintFeedback && alternatives?.options.hints) return alternatives?.options.hints[0]
35
+ return alternatives?.options.default[0] ?? null
36
+ })()
37
+
38
+ const optionLabel =
39
+ (isTranslated && !isTranslationPending ? option?.translatedText : option?.text) ?? ''
40
+
41
+ if (!option) return null
42
+
43
+ const sendMessage = useCallback(() => {
44
+ void model.sendHelpRequestFx({
45
+ message: option.text,
46
+ translatedMessage: option.translatedText,
47
+ })
48
+ }, [])
49
+
50
+ const shouldDisableInput =
51
+ isHelpRequestPending || (hasMessages && lastMessageOptions.length === 0)
52
+
53
+ return (
54
+ <View style={styles.container}>
55
+ {IS_WEB && alternatives?.isOpenChatEnabled ? (
56
+ <FreeTextInputBlock
57
+ optionLabel={optionLabel}
58
+ onOptionPress={sendMessage}
59
+ disabled={shouldDisableInput}
60
+ colorScheme={colorScheme}
61
+ />
62
+ ) : (
63
+ <RequestHintButton
64
+ onPress={sendMessage}
65
+ label={optionLabel}
66
+ disabled={shouldDisableInput}
67
+ colorScheme={colorScheme}
68
+ variant={HintButtonVariant.Default}
69
+ />
70
+ )}
71
+ </View>
72
+ )
73
+ }
74
+
75
+ const styles = StyleSheet.create({
76
+ container: {
77
+ flex: 1,
78
+ width: 305,
79
+ alignItems: 'center',
80
+ justifyContent: 'center',
81
+ marginVertical: 8,
82
+ },
83
+ })