@magmamath/students-features 0.8.0-rc.2 → 0.8.0-rc.4

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 (168) hide show
  1. package/dist/commonjs/features/chatbot/components/ChatInput/ChatInput.js +1 -1
  2. package/dist/commonjs/features/chatbot/components/ChatInput/ChatInput.js.map +1 -1
  3. package/dist/commonjs/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js +10 -5
  4. package/dist/commonjs/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js.map +1 -1
  5. package/dist/commonjs/features/chatbot/components/ChatInput/FreeText/FreeTextInputBlock.js +1 -1
  6. package/dist/commonjs/features/chatbot/components/ChatInput/FreeText/FreeTextInputBlock.js.map +1 -1
  7. package/dist/commonjs/features/chatbot/components/ChatInput/RequestHintButton.js +7 -7
  8. package/dist/commonjs/features/chatbot/components/ChatInput/RequestHintButton.js.map +1 -1
  9. package/dist/commonjs/features/chatbot/components/Chatbot.js.map +1 -1
  10. package/dist/commonjs/features/chatbot/helpers.js +9 -5
  11. package/dist/commonjs/features/chatbot/helpers.js.map +1 -1
  12. package/dist/commonjs/features/chatbot/model/ChatBotModel.js +9 -9
  13. package/dist/commonjs/features/chatbot/model/ChatBotModel.js.map +1 -1
  14. package/dist/commonjs/features/chatbot/model/ChatBotThreadManager.js +1 -1
  15. package/dist/commonjs/features/chatbot/model/ChatBotThreadManager.js.map +1 -1
  16. package/dist/commonjs/features/chatbot/types/model.types.js +2 -2
  17. package/dist/commonjs/features/chatbot/types/units.types.js +0 -10
  18. package/dist/commonjs/features/chatbot/types/units.types.js.map +1 -1
  19. package/dist/commonjs/features/endOfAssignment/components/CheatDetected/CheatDetected.js +5 -3
  20. package/dist/commonjs/features/endOfAssignment/components/CheatDetected/CheatDetected.js.map +1 -1
  21. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js +5 -3
  22. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js.map +1 -1
  23. package/dist/commonjs/features/endOfAssignment/components/ExamLeave/ExamLeave.js +5 -3
  24. package/dist/commonjs/features/endOfAssignment/components/ExamLeave/ExamLeave.js.map +1 -1
  25. package/dist/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.js +5 -3
  26. package/dist/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.js.map +1 -1
  27. package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js +5 -3
  28. package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js.map +1 -1
  29. package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.js +6 -4
  30. package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.js.map +1 -1
  31. package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js +0 -8
  32. package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -1
  33. package/dist/commonjs/shared/hooks/useKeyDownListener.js +5 -1
  34. package/dist/commonjs/shared/hooks/useKeyDownListener.js.map +1 -1
  35. package/dist/commonjs/shared/translation/localization/ca.json +1 -0
  36. package/dist/commonjs/shared/translation/localization/en.json +1 -0
  37. package/dist/commonjs/shared/translation/localization/gb.json +1 -0
  38. package/dist/commonjs/shared/translation/localization/sct.json +1 -0
  39. package/dist/commonjs/shared/translation/localization/sw.json +3 -2
  40. package/dist/module/features/chatbot/components/ChatInput/ChatInput.js +1 -1
  41. package/dist/module/features/chatbot/components/ChatInput/ChatInput.js.map +1 -1
  42. package/dist/module/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js +10 -5
  43. package/dist/module/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js.map +1 -1
  44. package/dist/module/features/chatbot/components/ChatInput/FreeText/FreeTextInputBlock.js +1 -1
  45. package/dist/module/features/chatbot/components/ChatInput/FreeText/FreeTextInputBlock.js.map +1 -1
  46. package/dist/module/features/chatbot/components/ChatInput/RequestHintButton.js +7 -7
  47. package/dist/module/features/chatbot/components/ChatInput/RequestHintButton.js.map +1 -1
  48. package/dist/module/features/chatbot/components/Chatbot.js.map +1 -1
  49. package/dist/module/features/chatbot/helpers.js +9 -5
  50. package/dist/module/features/chatbot/helpers.js.map +1 -1
  51. package/dist/module/features/chatbot/model/ChatBotModel.js +9 -9
  52. package/dist/module/features/chatbot/model/ChatBotModel.js.map +1 -1
  53. package/dist/module/features/chatbot/model/ChatBotThreadManager.js +1 -1
  54. package/dist/module/features/chatbot/model/ChatBotThreadManager.js.map +1 -1
  55. package/dist/module/features/chatbot/types/model.types.js +2 -2
  56. package/dist/module/features/chatbot/types/units.types.js +0 -6
  57. package/dist/module/features/chatbot/types/units.types.js.map +1 -1
  58. package/dist/module/features/endOfAssignment/components/CheatDetected/CheatDetected.js +5 -3
  59. package/dist/module/features/endOfAssignment/components/CheatDetected/CheatDetected.js.map +1 -1
  60. package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js +5 -3
  61. package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js.map +1 -1
  62. package/dist/module/features/endOfAssignment/components/ExamLeave/ExamLeave.js +5 -3
  63. package/dist/module/features/endOfAssignment/components/ExamLeave/ExamLeave.js.map +1 -1
  64. package/dist/module/features/endOfAssignment/components/ExamPaused/ExamPaused.js +5 -3
  65. package/dist/module/features/endOfAssignment/components/ExamPaused/ExamPaused.js.map +1 -1
  66. package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js +5 -3
  67. package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js.map +1 -1
  68. package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswer.js +6 -4
  69. package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswer.js.map +1 -1
  70. package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js +0 -8
  71. package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -1
  72. package/dist/module/shared/hooks/useKeyDownListener.js +5 -1
  73. package/dist/module/shared/hooks/useKeyDownListener.js.map +1 -1
  74. package/dist/module/shared/translation/localization/ca.json +1 -0
  75. package/dist/module/shared/translation/localization/en.json +1 -0
  76. package/dist/module/shared/translation/localization/gb.json +1 -0
  77. package/dist/module/shared/translation/localization/sct.json +1 -0
  78. package/dist/module/shared/translation/localization/sw.json +3 -2
  79. package/dist/typescript/commonjs/features/chatbot/components/ChatInput/FreeText/ChatTextInput.d.ts.map +1 -1
  80. package/dist/typescript/commonjs/features/chatbot/components/ChatInput/RequestHintButton.d.ts +2 -2
  81. package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts +0 -2
  82. package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts.map +1 -1
  83. package/dist/typescript/commonjs/features/chatbot/helpers.d.ts.map +1 -1
  84. package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
  85. package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts +5 -5
  86. package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts +0 -4
  87. package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts.map +1 -1
  88. package/dist/typescript/commonjs/features/endOfAssignment/components/CheatDetected/CheatDetected.d.ts.map +1 -1
  89. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts.map +1 -1
  90. package/dist/typescript/commonjs/features/endOfAssignment/components/ExamLeave/ExamLeave.d.ts.map +1 -1
  91. package/dist/typescript/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts.map +1 -1
  92. package/dist/typescript/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts.map +1 -1
  93. package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts.map +1 -1
  94. package/dist/typescript/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -1
  95. package/dist/typescript/commonjs/shared/hooks/useKeyDownListener.d.ts +7 -1
  96. package/dist/typescript/commonjs/shared/hooks/useKeyDownListener.d.ts.map +1 -1
  97. package/dist/typescript/commonjs/shared/hooks/useKeyboard.d.ts +5 -1
  98. package/dist/typescript/commonjs/shared/hooks/useKeyboard.d.ts.map +1 -1
  99. package/dist/typescript/commonjs/shared/translation/constants.d.ts +5 -0
  100. package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
  101. package/dist/typescript/commonjs/shared/translation/model.d.ts +2 -0
  102. package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
  103. package/dist/typescript/module/features/chatbot/components/ChatInput/FreeText/ChatTextInput.d.ts.map +1 -1
  104. package/dist/typescript/module/features/chatbot/components/ChatInput/RequestHintButton.d.ts +2 -2
  105. package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts +0 -2
  106. package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts.map +1 -1
  107. package/dist/typescript/module/features/chatbot/helpers.d.ts.map +1 -1
  108. package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
  109. package/dist/typescript/module/features/chatbot/types/model.types.d.ts +5 -5
  110. package/dist/typescript/module/features/chatbot/types/units.types.d.ts +0 -4
  111. package/dist/typescript/module/features/chatbot/types/units.types.d.ts.map +1 -1
  112. package/dist/typescript/module/features/endOfAssignment/components/CheatDetected/CheatDetected.d.ts.map +1 -1
  113. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts.map +1 -1
  114. package/dist/typescript/module/features/endOfAssignment/components/ExamLeave/ExamLeave.d.ts.map +1 -1
  115. package/dist/typescript/module/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts.map +1 -1
  116. package/dist/typescript/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts.map +1 -1
  117. package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts.map +1 -1
  118. package/dist/typescript/module/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -1
  119. package/dist/typescript/module/shared/hooks/useKeyDownListener.d.ts +7 -1
  120. package/dist/typescript/module/shared/hooks/useKeyDownListener.d.ts.map +1 -1
  121. package/dist/typescript/module/shared/hooks/useKeyboard.d.ts +5 -1
  122. package/dist/typescript/module/shared/hooks/useKeyboard.d.ts.map +1 -1
  123. package/dist/typescript/module/shared/translation/constants.d.ts +5 -0
  124. package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
  125. package/dist/typescript/module/shared/translation/model.d.ts +2 -0
  126. package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
  127. package/package.json +1 -1
  128. package/src/features/chatbot/components/ChatInput/ChatInput.tsx +1 -1
  129. package/src/features/chatbot/components/ChatInput/FreeText/ChatTextInput.tsx +13 -8
  130. package/src/features/chatbot/components/ChatInput/FreeText/FreeTextInputBlock.tsx +1 -1
  131. package/src/features/chatbot/components/ChatInput/RequestHintButton.tsx +7 -7
  132. package/src/features/chatbot/components/Chatbot.tsx +0 -2
  133. package/src/features/chatbot/helpers.ts +15 -5
  134. package/src/features/chatbot/model/ChatBotModel.ts +5 -9
  135. package/src/features/chatbot/model/ChatBotThreadManager.ts +1 -1
  136. package/src/features/chatbot/types/model.types.ts +5 -5
  137. package/src/features/chatbot/types/units.types.ts +0 -5
  138. package/src/features/endOfAssignment/components/CheatDetected/CheatDetected.tsx +6 -4
  139. package/src/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.tsx +6 -4
  140. package/src/features/endOfAssignment/components/ExamLeave/ExamLeave.tsx +6 -4
  141. package/src/features/endOfAssignment/components/ExamPaused/ExamPaused.tsx +6 -4
  142. package/src/features/endOfAssignment/components/ExamSubmit/ExamSubmit.tsx +6 -4
  143. package/src/features/endOfAssignment/components/NoAnswer/NoAnswer.tsx +7 -5
  144. package/src/features/exampleSolution/components/ExampleSolutionModalContent.tsx +0 -4
  145. package/src/shared/hooks/useKeyDownListener.ts +9 -4
  146. package/src/shared/translation/localization/ca.json +1 -0
  147. package/src/shared/translation/localization/en.json +1 -0
  148. package/src/shared/translation/localization/gb.json +1 -0
  149. package/src/shared/translation/localization/sct.json +1 -0
  150. package/src/shared/translation/localization/sw.json +3 -2
  151. package/dist/commonjs/features/exampleSolution/components/LavaIcon.js +0 -44
  152. package/dist/commonjs/features/exampleSolution/components/LavaIcon.js.map +0 -1
  153. package/dist/commonjs/features/exampleSolution/components/MessageBlock.js +0 -61
  154. package/dist/commonjs/features/exampleSolution/components/MessageBlock.js.map +0 -1
  155. package/dist/module/features/exampleSolution/components/LavaIcon.js +0 -36
  156. package/dist/module/features/exampleSolution/components/LavaIcon.js.map +0 -1
  157. package/dist/module/features/exampleSolution/components/MessageBlock.js +0 -53
  158. package/dist/module/features/exampleSolution/components/MessageBlock.js.map +0 -1
  159. package/dist/typescript/commonjs/features/exampleSolution/components/LavaIcon.d.ts +0 -10
  160. package/dist/typescript/commonjs/features/exampleSolution/components/LavaIcon.d.ts.map +0 -1
  161. package/dist/typescript/commonjs/features/exampleSolution/components/MessageBlock.d.ts +0 -10
  162. package/dist/typescript/commonjs/features/exampleSolution/components/MessageBlock.d.ts.map +0 -1
  163. package/dist/typescript/module/features/exampleSolution/components/LavaIcon.d.ts +0 -10
  164. package/dist/typescript/module/features/exampleSolution/components/LavaIcon.d.ts.map +0 -1
  165. package/dist/typescript/module/features/exampleSolution/components/MessageBlock.d.ts +0 -10
  166. package/dist/typescript/module/features/exampleSolution/components/MessageBlock.d.ts.map +0 -1
  167. package/src/features/exampleSolution/components/LavaIcon.tsx +0 -35
  168. package/src/features/exampleSolution/components/MessageBlock.tsx +0 -67
@@ -173,7 +173,7 @@ export class ChatbotModel {
173
173
  // Use short text for another hint option if openChatEnabled
174
174
  if (alternatives?.chatAccess && alternatives?.isOpenChatEnabled && IS_WEB) {
175
175
  this.textManager.update((creator) => ({
176
- anotherHintOption: creator.createOption('chat.giveHint'),
176
+ anotherHintOption: creator.createOption('chat.giveHintOpenChat'),
177
177
  }))
178
178
  }
179
179
  })
@@ -181,14 +181,10 @@ export class ChatbotModel {
181
181
 
182
182
  private createSendHelpRequestFx() {
183
183
  const effect = attach({
184
- source: [this.$currentKey, this.$context, this.cache.$data],
185
- mapParams: (params: SendHelpParams, [key, context, cache]) => ({
186
- message: params.message,
187
- translatedMessage: params.translatedMessage,
188
- isFreeText: params.isFreeText,
189
- cache,
190
- context,
191
- key,
184
+ source: { key: this.$currentKey, context: this.$context, cache: this.cache.$data },
185
+ mapParams: (params: SendHelpParams, source) => ({
186
+ ...params,
187
+ ...source,
192
188
  }),
193
189
  effect: createEffect(
194
190
  async ({ message, translatedMessage, key, context, isFreeText, cache }: SendHelpProps) => {
@@ -79,7 +79,7 @@ export class ChatBotThreadManager {
79
79
  const { type, data } = prepareChatRequestPayload(payload, threadItem)
80
80
 
81
81
  const result: SendMessageResponse | ChatHintResponse =
82
- type === ChatRequestType.Freetext
82
+ type === ChatRequestType.FREETEXT
83
83
  ? await this.api.sendMessage(data)
84
84
  : await this.api.getHint(data)
85
85
 
@@ -125,22 +125,22 @@ export type ReinitConversationProps = {
125
125
  }
126
126
 
127
127
  export enum ChatRequestType {
128
- Freetext = 'sendMessage',
129
- Hint = 'getHint',
128
+ FREETEXT = 'sendMessage',
129
+ HINT = 'getHint',
130
130
  }
131
131
 
132
132
  type FreeTextWithConversationId = {
133
- type: ChatRequestType.Freetext
133
+ type: ChatRequestType.FREETEXT
134
134
  data: Pick<SendMessagePayload, 'message' | 'conversationId'>
135
135
  }
136
136
 
137
137
  type FreeTextNewConversation = {
138
- type: ChatRequestType.Freetext
138
+ type: ChatRequestType.FREETEXT
139
139
  data: SendMessagePayload
140
140
  }
141
141
 
142
142
  export type HintRequest = {
143
- type: ChatRequestType.Hint
143
+ type: ChatRequestType.HINT
144
144
  data: ChatHintPayload
145
145
  }
146
146
 
@@ -37,8 +37,3 @@ export type ChatItem = {
37
37
  currentThread: IThreadItem | null
38
38
  conversationId?: string | null
39
39
  }
40
-
41
- export enum ChatInputMode {
42
- FreeText = 1,
43
- Option = 2,
44
- }
@@ -15,10 +15,12 @@ import { useKeyBoard } from '../../../../shared/hooks/useKeyboard'
15
15
  import { KeyboardKeys } from '../../../../lib/constants'
16
16
 
17
17
  export const CheatDetected = ({ textContent, model }: EOAModalContentProps) => {
18
- useKeyBoard((event) => {
19
- if (event.key === KeyboardKeys.ENTER) {
20
- model.hidePopUpAndLeave()
21
- }
18
+ useKeyBoard({
19
+ callback: (event) => {
20
+ if (event.key === KeyboardKeys.ENTER) {
21
+ model.hidePopUpAndLeave()
22
+ }
23
+ },
22
24
  })
23
25
 
24
26
  return (
@@ -47,10 +47,12 @@ export const CorrectAnswer = ({ textContent, model, onPracticePress }: EOAModalC
47
47
  setCardsAnimationCompleted(true)
48
48
  }, [])
49
49
 
50
- useKeyBoard((event) => {
51
- if (event.key === KeyboardKeys.ENTER) {
52
- isPracticeButtonVisible ? handlePracticeButtonPress() : model.hidePopUpAndLeave()
53
- }
50
+ useKeyBoard({
51
+ callback: (event) => {
52
+ if (event.key === KeyboardKeys.ENTER) {
53
+ isPracticeButtonVisible ? handlePracticeButtonPress() : model.hidePopUpAndLeave()
54
+ }
55
+ },
54
56
  })
55
57
 
56
58
  return (
@@ -17,10 +17,12 @@ import { KeyboardKeys } from '../../../../lib/constants'
17
17
  export const ExamLeave = ({ textContent, model }: EOAModalContentProps) => {
18
18
  const handleDismiss = () => model.hidePopUp()
19
19
 
20
- useKeyBoard((event) => {
21
- if (event.key === KeyboardKeys.ENTER) {
22
- model.hidePopUpAndLeave()
23
- }
20
+ useKeyBoard({
21
+ callback: (event) => {
22
+ if (event.key === KeyboardKeys.ENTER) {
23
+ model.hidePopUpAndLeave()
24
+ }
25
+ },
24
26
  })
25
27
 
26
28
  return (
@@ -15,10 +15,12 @@ import { useKeyBoard } from '../../../../shared/hooks/useKeyboard'
15
15
  import { KeyboardKeys } from '../../../../lib/constants'
16
16
 
17
17
  export const ExamPaused = ({ textContent, model }: EOAModalContentProps) => {
18
- useKeyBoard((event) => {
19
- if (event.key === KeyboardKeys.ENTER) {
20
- model.hidePopUpAndLeave()
21
- }
18
+ useKeyBoard({
19
+ callback: (event) => {
20
+ if (event.key === KeyboardKeys.ENTER) {
21
+ model.hidePopUpAndLeave()
22
+ }
23
+ },
22
24
  })
23
25
 
24
26
  return (
@@ -32,10 +32,12 @@ export const ExamSubmit = ({ textContent, model, onPracticePress }: EOAModalCont
32
32
  model.hidePopUp()
33
33
  }
34
34
 
35
- useKeyBoard((event) => {
36
- if (event.key === KeyboardKeys.ENTER) {
37
- isPracticeButtonVisible ? handlePracticePress() : model.hidePopUpAndLeave()
38
- }
35
+ useKeyBoard({
36
+ callback: (event) => {
37
+ if (event.key === KeyboardKeys.ENTER) {
38
+ isPracticeButtonVisible ? handlePracticePress() : model.hidePopUpAndLeave()
39
+ }
40
+ },
39
41
  })
40
42
 
41
43
  return (
@@ -61,11 +61,13 @@ export const NoAnswer = ({ model, textContent, onPracticePress }: EOAModalConten
61
61
 
62
62
  const buttons = getButtons()
63
63
 
64
- useKeyBoard((event) => {
65
- if (event.key === KeyboardKeys.ENTER) {
66
- const primaryButton = buttons.at(-1)
67
- primaryButton?.onPress()
68
- }
64
+ useKeyBoard({
65
+ callback: (event) => {
66
+ if (event.key === KeyboardKeys.ENTER) {
67
+ const primaryButton = buttons.at(-1)
68
+ primaryButton?.onPress()
69
+ }
70
+ },
69
71
  })
70
72
 
71
73
  return (
@@ -3,8 +3,6 @@ import React from 'react'
3
3
  import { COLORS, HeadingVariants, IS_WEB, SPACING, Typography } from '@magmamath/react-native-ui'
4
4
  import { useUnit } from 'effector-react'
5
5
  import { $localization } from '../../../shared/translation'
6
- import { MessageBlock } from './MessageBlock'
7
- import { LavaIcon } from './LavaIcon'
8
6
  import { ExampleSolutionModalParams } from '../types'
9
7
  import { QuestionSection } from './QuestionSection'
10
8
  import { SolutionSection } from './SolutionSection'
@@ -40,8 +38,6 @@ export const ExampleSolutionModalContent = ({
40
38
  />
41
39
  <SolutionSection status={status} answer={result?.answer} />
42
40
  </View>
43
- <MessageBlock status={status} style={styles.messageBlock} />
44
- <LavaIcon status={status} style={styles.lavaIconContainer} />
45
41
  </View>
46
42
  )
47
43
  }
@@ -2,11 +2,16 @@ import { useEffect, useRef } from 'react'
2
2
 
3
3
  import { KeyboardKeys } from '../../lib/constants'
4
4
 
5
- export const useKeyDownListener = (
6
- callback: (event: KeyboardEvent) => void,
7
- enabled = true,
5
+ type UseKeyDownListenerParams = {
6
+ callback: (event: KeyboardEvent) => void
7
+ enabled?: boolean
8
+ overrideKeys?: KeyboardKeys[]
9
+ }
10
+ export const useKeyDownListener = ({
11
+ callback,
8
12
  overrideKeys = [KeyboardKeys.ENTER],
9
- ) => {
13
+ enabled,
14
+ }: UseKeyDownListenerParams) => {
10
15
  const callbackRef = useRef(callback)
11
16
  callbackRef.current = callback
12
17
 
@@ -14,6 +14,7 @@
14
14
  "chat": {
15
15
  "anotherHint": "Give me another hint",
16
16
  "giveHint": "I need a hint",
17
+ "giveHintOpenChat": "I need a hint",
17
18
  "answerAgain": "Answer again to get another hint!",
18
19
  "errorMessage": "Something went wrong! Try again",
19
20
  "howCanIHelp": "Hi! Do you want help?",
@@ -14,6 +14,7 @@
14
14
  "chat": {
15
15
  "anotherHint": "Give me another hint",
16
16
  "giveHint": "I need a hint",
17
+ "giveHintOpenChat": "I need a hint",
17
18
  "answerAgain": "Answer again to get another hint!",
18
19
  "errorMessage": "Something went wrong! Try again",
19
20
  "howCanIHelp": "Hi! Do you want help?",
@@ -14,6 +14,7 @@
14
14
  "chat": {
15
15
  "anotherHint": "Give me another hint",
16
16
  "giveHint": "I need a hint",
17
+ "giveHintOpenChat": "I need a hint",
17
18
  "answerAgain": "Answer again to get another hint!",
18
19
  "errorMessage": "Something went wrong! Try again",
19
20
  "howCanIHelp": "Hi! Do you want help?",
@@ -14,6 +14,7 @@
14
14
  "chat": {
15
15
  "anotherHint": "Give me another hint",
16
16
  "giveHint": "I need a hint",
17
+ "giveHintOpenChat": "I need a hint",
17
18
  "answerAgain": "Answer again to get another hint!",
18
19
  "errorMessage": "Something went wrong! Try again",
19
20
  "howCanIHelp": "Hi! Do you want help?",
@@ -12,8 +12,9 @@
12
12
  "time.yearAgo": "år sedan",
13
13
  "time.yearsAgo": "år sedan",
14
14
  "chat": {
15
- "anotherHint": "Ge mig en ledtråd",
16
- "giveHint": "Ge ledtråd",
15
+ "anotherHint": "Ge mig en till ledtråd",
16
+ "giveHint": "Ge mig en ledtråd",
17
+ "giveHintOpenChat": "Ge ledtråd",
17
18
  "answerAgain": "Svara igen för att få en till ledtråd!",
18
19
  "errorMessage": "Något gick snett! Försök igen",
19
20
  "howCanIHelp": "Hej! Hur kan jag hjälpa dig?",
@@ -1,44 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.LavaIcon = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _ExcitedLavaIcon = require("../../../shared/icons/ExcitedLavaIcon.js");
9
- var _index = require("../../../shared/icons/index.js");
10
- var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
11
- var _constants = require("../constants.js");
12
- var _jsxRuntime = require("react/jsx-runtime");
13
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
- const LAVA_ICON_HEIGHT = 112;
17
- const LavaIcon = ({
18
- status,
19
- style
20
- }) => {
21
- const opacityAnimation = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
22
- return {
23
- opacity: (0, _reactNativeReanimated.withTiming)(status === _constants.ExampleSolutionStatuses.LOADING ? 1 : 0, {
24
- duration: 500
25
- })
26
- };
27
- }, [status]);
28
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
29
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
30
- style: [style, opacityAnimation],
31
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.LavaIconInGlasses, {
32
- height: 112
33
- })
34
- }), status !== _constants.ExampleSolutionStatuses.LOADING && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
35
- style: style,
36
- entering: _reactNativeReanimated.FadeIn,
37
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExcitedLavaIcon.ExcitedLavaIcon, {
38
- height: LAVA_ICON_HEIGHT
39
- })
40
- })]
41
- });
42
- };
43
- exports.LavaIcon = LavaIcon;
44
- //# sourceMappingURL=LavaIcon.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_ExcitedLavaIcon","_index","_reactNativeReanimated","_interopRequireWildcard","_constants","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","LAVA_ICON_HEIGHT","LavaIcon","status","style","opacityAnimation","useAnimatedStyle","opacity","withTiming","ExampleSolutionStatuses","LOADING","duration","jsxs","Fragment","children","jsx","View","LavaIconInGlasses","height","entering","FadeIn","ExcitedLavaIcon","exports"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/components/LavaIcon.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;A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- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.MessageBlock = void 0;
7
- var _reactNative = require("react-native");
8
- var _react = _interopRequireDefault(require("react"));
9
- var _reactNativeUi = require("@magmamath/react-native-ui");
10
- var _effectorReact = require("effector-react");
11
- var _index = require("../../../shared/translation/index.js");
12
- var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
13
- var _constants = require("../constants.js");
14
- var _jsxRuntime = require("react/jsx-runtime");
15
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
16
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
- const MessageBlock = ({
19
- status,
20
- style
21
- }) => {
22
- const localization = (0, _effectorReact.useUnit)(_index.$localization);
23
- const opacityAnimation = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
24
- return {
25
- opacity: (0, _reactNativeReanimated.withDelay)(2000, (0, _reactNativeReanimated.withTiming)(status === _constants.ExampleSolutionStatuses.LOADING ? 1 : 0, {
26
- duration: 350
27
- }))
28
- };
29
- }, [status]);
30
- if (status === _constants.ExampleSolutionStatuses.CACHE) return null;
31
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
32
- layout: _reactNativeReanimated.LinearTransition.duration(250),
33
- style: [styles.container, opacityAnimation, style],
34
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Typography, {
35
- variant: 'small',
36
- numberOfLines: 1,
37
- children: status === _constants.ExampleSolutionStatuses.LOADING ? localization.exampleSolution.letMeThink : localization.exampleSolution.aha
38
- })
39
- });
40
- };
41
- exports.MessageBlock = MessageBlock;
42
- const styles = _reactNative.StyleSheet.create({
43
- container: {
44
- padding: _reactNativeUi.SPACING[200],
45
- backgroundColor: _reactNativeUi.COLORS.NEUTRAL_3,
46
- height: 44,
47
- borderRadius: 12,
48
- borderBottomRightRadius: 2,
49
- borderWidth: _reactNative.StyleSheet.hairlineWidth,
50
- borderColor: _reactNativeUi.COLORS.NEUTRAL_5,
51
- shadowColor: _reactNativeUi.COLORS.NEUTRAL_10,
52
- shadowOffset: {
53
- width: 0,
54
- height: 1
55
- },
56
- shadowOpacity: 0.2,
57
- shadowRadius: 1,
58
- elevation: 3
59
- }
60
- });
61
- //# sourceMappingURL=MessageBlock.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_reactNative","require","_react","_interopRequireDefault","_reactNativeUi","_effectorReact","_index","_reactNativeReanimated","_interopRequireWildcard","_constants","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","MessageBlock","status","style","localization","useUnit","$localization","opacityAnimation","useAnimatedStyle","opacity","withDelay","withTiming","ExampleSolutionStatuses","LOADING","duration","CACHE","jsx","View","layout","LinearTransition","styles","container","children","Typography","variant","numberOfLines","exampleSolution","letMeThink","aha","exports","StyleSheet","create","padding","SPACING","backgroundColor","COLORS","NEUTRAL_3","height","borderRadius","borderBottomRightRadius","borderWidth","hairlineWidth","borderColor","NEUTRAL_5","shadowColor","NEUTRAL_10","shadowOffset","width","shadowOpacity","shadowRadius","elevation"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/components/MessageBlock.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAA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,CAAA5B,YAAA,GAAAA,YAAA;AAED,MAAMmB,MAAM,GAAGU,uBAAU,CAACC,MAAM,CAAC;EAC/BV,SAAS,EAAE;IACTW,OAAO,EAAEC,sBAAO,CAAC,GAAG,CAAC;IACrBC,eAAe,EAAEC,qBAAM,CAACC,SAAS;IACjCC,MAAM,EAAE,EAAE;IACVC,YAAY,EAAE,EAAE;IAChBC,uBAAuB,EAAE,CAAC;IAC1BC,WAAW,EAAEV,uBAAU,CAACW,aAAa;IACrCC,WAAW,EAAEP,qBAAM,CAACQ,SAAS;IAE7BC,WAAW,EAAET,qBAAM,CAACU,UAAU;IAC9BC,YAAY,EAAE;MACZC,KAAK,EAAE,CAAC;MACRV,MAAM,EAAE;IACV,CAAC;IACDW,aAAa,EAAE,GAAG;IAClBC,YAAY,EAAE,CAAC;IAEfC,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1,36 +0,0 @@
1
- "use strict";
2
-
3
- import React from 'react';
4
- import { ExcitedLavaIcon } from "../../../shared/icons/ExcitedLavaIcon.js";
5
- import { LavaIconInGlasses } from "../../../shared/icons/index.js";
6
- import Animated, { FadeIn, useAnimatedStyle, withTiming } from 'react-native-reanimated';
7
- import { ExampleSolutionStatuses } from "../constants.js";
8
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
9
- const LAVA_ICON_HEIGHT = 112;
10
- export const LavaIcon = ({
11
- status,
12
- style
13
- }) => {
14
- const opacityAnimation = useAnimatedStyle(() => {
15
- return {
16
- opacity: withTiming(status === ExampleSolutionStatuses.LOADING ? 1 : 0, {
17
- duration: 500
18
- })
19
- };
20
- }, [status]);
21
- return /*#__PURE__*/_jsxs(_Fragment, {
22
- children: [/*#__PURE__*/_jsx(Animated.View, {
23
- style: [style, opacityAnimation],
24
- children: /*#__PURE__*/_jsx(LavaIconInGlasses, {
25
- height: 112
26
- })
27
- }), status !== ExampleSolutionStatuses.LOADING && /*#__PURE__*/_jsx(Animated.View, {
28
- style: style,
29
- entering: FadeIn,
30
- children: /*#__PURE__*/_jsx(ExcitedLavaIcon, {
31
- height: LAVA_ICON_HEIGHT
32
- })
33
- })]
34
- });
35
- };
36
- //# sourceMappingURL=LavaIcon.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","ExcitedLavaIcon","LavaIconInGlasses","Animated","FadeIn","useAnimatedStyle","withTiming","ExampleSolutionStatuses","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","LAVA_ICON_HEIGHT","LavaIcon","status","style","opacityAnimation","opacity","LOADING","duration","children","View","height","entering"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/components/LavaIcon.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,eAAe,QAAQ,0CAAuC;AACvE,SAASC,iBAAiB,QAAQ,gCAAuB;AACzD,OAAOC,QAAQ,IAAIC,MAAM,EAAEC,gBAAgB,EAAEC,UAAU,QAAQ,yBAAyB;AAExF,SAASC,uBAAuB,QAAQ,iBAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAEtD,MAAMC,gBAAgB,GAAG,GAAG;AAO5B,OAAO,MAAMC,QAAQ,GAAGA,CAAC;EAAEC,MAAM;EAAEC;AAAqB,CAAC,KAAK;EAC5D,MAAMC,gBAAgB,GAAGb,gBAAgB,CAAC,MAAM;IAC9C,OAAO;MACLc,OAAO,EAAEb,UAAU,CAACU,MAAM,KAAKT,uBAAuB,CAACa,OAAO,GAAG,CAAC,GAAG,CAAC,EAAE;QAAEC,QAAQ,EAAE;MAAI,CAAC;IAC3F,CAAC;EACH,CAAC,EAAE,CAACL,MAAM,CAAC,CAAC;EAEZ,oBACEH,KAAA,CAAAF,SAAA;IAAAW,QAAA,gBACEb,IAAA,CAACN,QAAQ,CAACoB,IAAI;MAACN,KAAK,EAAE,CAACA,KAAK,EAAEC,gBAAgB,CAAE;MAAAI,QAAA,eAC9Cb,IAAA,CAACP,iBAAiB;QAACsB,MAAM,EAAE;MAAI,CAAE;IAAC,CACrB,CAAC,EAEfR,MAAM,KAAKT,uBAAuB,CAACa,OAAO,iBACzCX,IAAA,CAACN,QAAQ,CAACoB,IAAI;MAACN,KAAK,EAAEA,KAAM;MAACQ,QAAQ,EAAErB,MAAO;MAAAkB,QAAA,eAC5Cb,IAAA,CAACR,eAAe;QAACuB,MAAM,EAAEV;MAAiB,CAAE;IAAC,CAChC,CAChB;EAAA,CACD,CAAC;AAEP,CAAC","ignoreList":[]}
@@ -1,53 +0,0 @@
1
- "use strict";
2
-
3
- import { StyleSheet } from 'react-native';
4
- import React from 'react';
5
- import { COLORS, SPACING, Typography } from '@magmamath/react-native-ui';
6
- import { useUnit } from 'effector-react';
7
- import { $localization } from "../../../shared/translation/index.js";
8
- import Animated, { LinearTransition, useAnimatedStyle, withDelay, withTiming } from 'react-native-reanimated';
9
- import { ExampleSolutionStatuses } from "../constants.js";
10
- import { jsx as _jsx } from "react/jsx-runtime";
11
- export const MessageBlock = ({
12
- status,
13
- style
14
- }) => {
15
- const localization = useUnit($localization);
16
- const opacityAnimation = useAnimatedStyle(() => {
17
- return {
18
- opacity: withDelay(2000, withTiming(status === ExampleSolutionStatuses.LOADING ? 1 : 0, {
19
- duration: 350
20
- }))
21
- };
22
- }, [status]);
23
- if (status === ExampleSolutionStatuses.CACHE) return null;
24
- return /*#__PURE__*/_jsx(Animated.View, {
25
- layout: LinearTransition.duration(250),
26
- style: [styles.container, opacityAnimation, style],
27
- children: /*#__PURE__*/_jsx(Typography, {
28
- variant: 'small',
29
- numberOfLines: 1,
30
- children: status === ExampleSolutionStatuses.LOADING ? localization.exampleSolution.letMeThink : localization.exampleSolution.aha
31
- })
32
- });
33
- };
34
- const styles = StyleSheet.create({
35
- container: {
36
- padding: SPACING[200],
37
- backgroundColor: COLORS.NEUTRAL_3,
38
- height: 44,
39
- borderRadius: 12,
40
- borderBottomRightRadius: 2,
41
- borderWidth: StyleSheet.hairlineWidth,
42
- borderColor: COLORS.NEUTRAL_5,
43
- shadowColor: COLORS.NEUTRAL_10,
44
- shadowOffset: {
45
- width: 0,
46
- height: 1
47
- },
48
- shadowOpacity: 0.2,
49
- shadowRadius: 1,
50
- elevation: 3
51
- }
52
- });
53
- //# sourceMappingURL=MessageBlock.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["StyleSheet","React","COLORS","SPACING","Typography","useUnit","$localization","Animated","LinearTransition","useAnimatedStyle","withDelay","withTiming","ExampleSolutionStatuses","jsx","_jsx","MessageBlock","status","style","localization","opacityAnimation","opacity","LOADING","duration","CACHE","View","layout","styles","container","children","variant","numberOfLines","exampleSolution","letMeThink","aha","create","padding","backgroundColor","NEUTRAL_3","height","borderRadius","borderBottomRightRadius","borderWidth","hairlineWidth","borderColor","NEUTRAL_5","shadowColor","NEUTRAL_10","shadowOffset","width","shadowOpacity","shadowRadius","elevation"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/components/MessageBlock.tsx"],"mappings":";;AAAA,SAAoBA,UAAU,QAAmB,cAAc;AAC/D,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,EAAEC,OAAO,EAAEC,UAAU,QAAQ,4BAA4B;AACxE,SAASC,OAAO,QAAQ,gBAAgB;AACxC,SAASC,aAAa,QAAQ,sCAA6B;AAC3D,OAAOC,QAAQ,IACbC,gBAAgB,EAChBC,gBAAgB,EAChBC,SAAS,EACTC,UAAU,QACL,yBAAyB;AAChC,SAASC,uBAAuB,QAAQ,iBAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAOtD,OAAO,MAAMC,YAAY,GAAGA,CAAC;EAAEC,MAAM;EAAEC;AAAyB,CAAC,KAAK;EACpE,MAAMC,YAAY,GAAGb,OAAO,CAACC,aAAa,CAAC;EAE3C,MAAMa,gBAAgB,GAAGV,gBAAgB,CAAC,MAAM;IAC9C,OAAO;MACLW,OAAO,EAAEV,SAAS,CAChB,IAAI,EACJC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0 @@
1
- import React from 'react';
2
- import { StyleProp, ViewStyle } from 'react-native';
3
- import { ExampleSolutionStatuses } from '../constants';
4
- type LavaIconProps = {
5
- status: ExampleSolutionStatuses;
6
- style?: StyleProp<ViewStyle>;
7
- };
8
- export declare const LavaIcon: ({ status, style }: LavaIconProps) => React.JSX.Element;
9
- export {};
10
- //# sourceMappingURL=LavaIcon.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LavaIcon.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/components/LavaIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAItD,KAAK,aAAa,GAAG;IACnB,MAAM,EAAE,uBAAuB,CAAA;IAC/B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAC7B,CAAA;AAED,eAAO,MAAM,QAAQ,sBAAuB,aAAa,sBAoBxD,CAAA"}
@@ -1,10 +0,0 @@
1
- import { StyleProp, ViewStyle } from 'react-native';
2
- import React from 'react';
3
- import { ExampleSolutionStatuses } from '../constants';
4
- type MessageBlockProps = {
5
- status: ExampleSolutionStatuses;
6
- style?: StyleProp<ViewStyle>;
7
- };
8
- export declare const MessageBlock: ({ status, style }: MessageBlockProps) => React.JSX.Element | null;
9
- export {};
10
- //# sourceMappingURL=MessageBlock.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MessageBlock.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/components/MessageBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAc,SAAS,EAAE,MAAM,cAAc,CAAA;AAC/D,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAEtD,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,uBAAuB,CAAA;IAC/B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAC7B,CAAA;AAED,eAAO,MAAM,YAAY,sBAAuB,iBAAiB,6BA0BhE,CAAA"}
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { StyleProp, ViewStyle } from 'react-native';
3
- import { ExampleSolutionStatuses } from '../constants';
4
- type LavaIconProps = {
5
- status: ExampleSolutionStatuses;
6
- style?: StyleProp<ViewStyle>;
7
- };
8
- export declare const LavaIcon: ({ status, style }: LavaIconProps) => React.JSX.Element;
9
- export {};
10
- //# sourceMappingURL=LavaIcon.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LavaIcon.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/components/LavaIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAItD,KAAK,aAAa,GAAG;IACnB,MAAM,EAAE,uBAAuB,CAAA;IAC/B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAC7B,CAAA;AAED,eAAO,MAAM,QAAQ,sBAAuB,aAAa,sBAoBxD,CAAA"}
@@ -1,10 +0,0 @@
1
- import { StyleProp, ViewStyle } from 'react-native';
2
- import React from 'react';
3
- import { ExampleSolutionStatuses } from '../constants';
4
- type MessageBlockProps = {
5
- status: ExampleSolutionStatuses;
6
- style?: StyleProp<ViewStyle>;
7
- };
8
- export declare const MessageBlock: ({ status, style }: MessageBlockProps) => React.JSX.Element | null;
9
- export {};
10
- //# sourceMappingURL=MessageBlock.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MessageBlock.d.ts","sourceRoot":"","sources":["../../../../../../src/features/exampleSolution/components/MessageBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAc,SAAS,EAAE,MAAM,cAAc,CAAA;AAC/D,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAEtD,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,uBAAuB,CAAA;IAC/B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAC7B,CAAA;AAED,eAAO,MAAM,YAAY,sBAAuB,iBAAiB,6BA0BhE,CAAA"}
@@ -1,35 +0,0 @@
1
- import React from 'react'
2
- import { ExcitedLavaIcon } from '../../../shared/icons/ExcitedLavaIcon'
3
- import { LavaIconInGlasses } from '../../../shared/icons'
4
- import Animated, { FadeIn, useAnimatedStyle, withTiming } from 'react-native-reanimated'
5
- import { StyleProp, ViewStyle } from 'react-native'
6
- import { ExampleSolutionStatuses } from '../constants'
7
-
8
- const LAVA_ICON_HEIGHT = 112
9
-
10
- type LavaIconProps = {
11
- status: ExampleSolutionStatuses
12
- style?: StyleProp<ViewStyle>
13
- }
14
-
15
- export const LavaIcon = ({ status, style }: LavaIconProps) => {
16
- const opacityAnimation = useAnimatedStyle(() => {
17
- return {
18
- opacity: withTiming(status === ExampleSolutionStatuses.LOADING ? 1 : 0, { duration: 500 }),
19
- }
20
- }, [status])
21
-
22
- return (
23
- <>
24
- <Animated.View style={[style, opacityAnimation]}>
25
- <LavaIconInGlasses height={112} />
26
- </Animated.View>
27
-
28
- {status !== ExampleSolutionStatuses.LOADING && (
29
- <Animated.View style={style} entering={FadeIn}>
30
- <ExcitedLavaIcon height={LAVA_ICON_HEIGHT} />
31
- </Animated.View>
32
- )}
33
- </>
34
- )
35
- }