@magmamath/students-features 0.9.7 → 0.9.8-rc.1
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.
- package/dist/commonjs/features/chatbot/model/t2s.js +4 -3
- package/dist/commonjs/features/chatbot/model/t2s.js.map +1 -1
- package/dist/commonjs/features/chatbot/types/model.types.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.js +44 -0
- package/dist/commonjs/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js +10 -3
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/EOAModal.js +2 -4
- package/dist/commonjs/features/endOfAssignment/components/EOAModal.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.js +5 -3
- package/dist/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js +2 -1
- package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.js +9 -2
- package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/helpers.js +10 -3
- package/dist/commonjs/features/endOfAssignment/helpers.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/model/model.js +7 -0
- package/dist/commonjs/features/endOfAssignment/model/model.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.js +2 -2
- package/dist/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/BasicLayout/BasicLayout.js +3 -1
- package/dist/commonjs/features/keyboard/components/BasicLayout/BasicLayout.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/BasicLayout/TimeBasicLayout.js +1 -1
- package/dist/commonjs/features/keyboard/components/Keyboard.js +2 -0
- package/dist/commonjs/features/keyboard/components/Keyboard.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/KeysList/KeysList.js +4 -3
- package/dist/commonjs/features/keyboard/components/KeysList/KeysList.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/MainLayout.js +2 -1
- package/dist/commonjs/features/keyboard/components/MainLayout.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/Numpad/Numpad.js +14 -1
- package/dist/commonjs/features/keyboard/components/Numpad/Numpad.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/UnitsLayout/UnitTabs.js +31 -25
- package/dist/commonjs/features/keyboard/components/UnitsLayout/UnitTabs.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/UnitsLayout/UnitsLayout.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js +15 -0
- package/dist/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js.map +1 -1
- package/dist/commonjs/features/keyboard/types/MathKeysGroups/units.js +18 -18
- package/dist/commonjs/features/keyboard/types/MathKeysGroups/units.js.map +1 -1
- package/dist/commonjs/lib/types/requests.js +2 -0
- package/dist/commonjs/lib/types/requests.js.map +1 -0
- package/dist/module/features/chatbot/model/t2s.js +4 -3
- package/dist/module/features/chatbot/model/t2s.js.map +1 -1
- package/dist/module/features/chatbot/types/model.types.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.js +38 -0
- package/dist/module/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js +10 -3
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/EOAModal.js +2 -4
- package/dist/module/features/endOfAssignment/components/EOAModal.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/ExamPaused/ExamPaused.js +6 -4
- package/dist/module/features/endOfAssignment/components/ExamPaused/ExamPaused.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js +3 -2
- package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswer.js +9 -2
- package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswer.js.map +1 -1
- package/dist/module/features/endOfAssignment/helpers.js +8 -2
- package/dist/module/features/endOfAssignment/helpers.js.map +1 -1
- package/dist/module/features/endOfAssignment/model/model.js +7 -0
- package/dist/module/features/endOfAssignment/model/model.js.map +1 -1
- package/dist/module/features/endOfAssignment/ui/PracticeButtonGroup.js +2 -2
- package/dist/module/features/endOfAssignment/ui/PracticeButtonGroup.js.map +1 -1
- package/dist/module/features/keyboard/components/BasicLayout/BasicLayout.js +3 -1
- package/dist/module/features/keyboard/components/BasicLayout/BasicLayout.js.map +1 -1
- package/dist/module/features/keyboard/components/BasicLayout/TimeBasicLayout.js +1 -1
- package/dist/module/features/keyboard/components/Keyboard.js +2 -0
- package/dist/module/features/keyboard/components/Keyboard.js.map +1 -1
- package/dist/module/features/keyboard/components/KeysList/KeysList.js +4 -3
- package/dist/module/features/keyboard/components/KeysList/KeysList.js.map +1 -1
- package/dist/module/features/keyboard/components/MainLayout.js +2 -1
- package/dist/module/features/keyboard/components/MainLayout.js.map +1 -1
- package/dist/module/features/keyboard/components/Numpad/Numpad.js +14 -1
- package/dist/module/features/keyboard/components/Numpad/Numpad.js.map +1 -1
- package/dist/module/features/keyboard/components/UnitsLayout/UnitTabs.js +31 -25
- package/dist/module/features/keyboard/components/UnitsLayout/UnitTabs.js.map +1 -1
- package/dist/module/features/keyboard/components/UnitsLayout/UnitsLayout.js.map +1 -1
- package/dist/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js +15 -0
- package/dist/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js.map +1 -1
- package/dist/module/features/keyboard/types/MathKeysGroups/units.js +19 -19
- package/dist/module/features/keyboard/types/MathKeysGroups/units.js.map +1 -1
- package/dist/module/lib/types/requests.js +2 -0
- package/dist/module/lib/types/requests.js.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/model/ChatbotApi.d.ts +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatbotApi.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/t2s.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts +7 -1
- package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts +2 -1
- package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.d.ts +10 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/EOAModal.d.ts +1 -3
- package/dist/typescript/commonjs/features/endOfAssignment/components/EOAModal.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/helpers.d.ts +3 -1
- package/dist/typescript/commonjs/features/endOfAssignment/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/model/model.d.ts +5 -0
- package/dist/typescript/commonjs/features/endOfAssignment/model/model.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/types.d.ts +2 -2
- package/dist/typescript/commonjs/features/endOfAssignment/types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.d.ts +3 -2
- package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/KeysList/KeysList.d.ts +4 -1
- package/dist/typescript/commonjs/features/keyboard/components/KeysList/KeysList.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/KeysList/helpers.d.ts +2 -0
- package/dist/typescript/commonjs/features/keyboard/components/KeysList/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/Numpad/Numpad.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/UnitTabs.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/UnitsLayout.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts +26 -2
- package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/units.d.ts +208 -208
- package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/units.d.ts.map +1 -1
- package/dist/typescript/commonjs/lib/types/requests.d.ts +4 -0
- package/dist/typescript/commonjs/lib/types/requests.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/model/ChatbotApi.d.ts +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatbotApi.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/t2s.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/types/api.types.d.ts +7 -1
- package/dist/typescript/module/features/chatbot/types/api.types.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/types/model.types.d.ts +2 -1
- package/dist/typescript/module/features/chatbot/types/model.types.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.d.ts +10 -0
- package/dist/typescript/module/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/EOAModal.d.ts +1 -3
- package/dist/typescript/module/features/endOfAssignment/components/EOAModal.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/helpers.d.ts +3 -1
- package/dist/typescript/module/features/endOfAssignment/helpers.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/model/model.d.ts +5 -0
- package/dist/typescript/module/features/endOfAssignment/model/model.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/types.d.ts +2 -2
- package/dist/typescript/module/features/endOfAssignment/types.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/ui/PracticeButtonGroup.d.ts +3 -2
- package/dist/typescript/module/features/endOfAssignment/ui/PracticeButtonGroup.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/KeysList/KeysList.d.ts +4 -1
- package/dist/typescript/module/features/keyboard/components/KeysList/KeysList.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/KeysList/helpers.d.ts +2 -0
- package/dist/typescript/module/features/keyboard/components/KeysList/helpers.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/Numpad/Numpad.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/UnitsLayout/UnitTabs.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/UnitsLayout/UnitsLayout.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts +26 -2
- package/dist/typescript/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/types/MathKeysGroups/units.d.ts +208 -208
- package/dist/typescript/module/features/keyboard/types/MathKeysGroups/units.d.ts.map +1 -1
- package/dist/typescript/module/lib/types/requests.d.ts +4 -0
- package/dist/typescript/module/lib/types/requests.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/features/chatbot/model/t2s.ts +3 -2
- package/src/features/chatbot/types/api.types.ts +10 -1
- package/src/features/chatbot/types/model.types.ts +2 -1
- package/src/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.tsx +43 -0
- package/src/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.tsx +20 -10
- package/src/features/endOfAssignment/components/EOAModal.tsx +2 -9
- package/src/features/endOfAssignment/components/ExamPaused/ExamPaused.tsx +6 -6
- package/src/features/endOfAssignment/components/ExamSubmit/ExamSubmit.tsx +2 -2
- package/src/features/endOfAssignment/components/NoAnswer/NoAnswer.tsx +17 -6
- package/src/features/endOfAssignment/helpers.ts +10 -3
- package/src/features/endOfAssignment/model/model.ts +5 -1
- package/src/features/endOfAssignment/types.ts +2 -1
- package/src/features/endOfAssignment/ui/PracticeButtonGroup.tsx +4 -3
- package/src/features/keyboard/components/BasicLayout/BasicLayout.tsx +3 -1
- package/src/features/keyboard/components/BasicLayout/TimeBasicLayout.tsx +1 -1
- package/src/features/keyboard/components/Keyboard.tsx +2 -0
- package/src/features/keyboard/components/KeysList/KeysList.tsx +4 -2
- package/src/features/keyboard/components/MainLayout.tsx +2 -1
- package/src/features/keyboard/components/Numpad/Numpad.tsx +18 -1
- package/src/features/keyboard/components/UnitsLayout/UnitTabs.tsx +29 -24
- package/src/features/keyboard/components/UnitsLayout/UnitsLayout.tsx +0 -1
- package/src/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.ts +4 -0
- package/src/features/keyboard/types/MathKeysGroups/units.tsx +13 -14
- package/src/lib/types/requests.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"units.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/keyboard/types/MathKeysGroups/units.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"units.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/keyboard/types/MathKeysGroups/units.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAA;AAgCzB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqC9B,CAAA;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0E5B,CAAA;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsE1B,CAAA;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmI5B,CAAA;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6D5B,CAAA;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkE1B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../../../src/lib/types/requests.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magmamath/students-features",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.8-rc.1",
|
|
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-svg": "^15.10.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@magmamath/react-native-ui": "0.4.
|
|
32
|
+
"@magmamath/react-native-ui": "0.4.61",
|
|
33
33
|
"@react-native/eslint-config": "^0.73.1",
|
|
34
34
|
"@release-it/conventional-changelog": "^9.0.2",
|
|
35
35
|
"@types/jest": "^29.5.5",
|
|
@@ -86,11 +86,12 @@ export class ChatTextToSpeechModel {
|
|
|
86
86
|
input: { text },
|
|
87
87
|
voice: config?.voice ?? DEFAULT_VOICE,
|
|
88
88
|
audioConfig: config?.audioConfig ?? AUDIO_CONFIG,
|
|
89
|
+
enableTimePointing: [],
|
|
89
90
|
})
|
|
90
91
|
|
|
91
92
|
// Response might be different type based on provided AUDIO_CONFIG
|
|
92
|
-
if (typeof response === 'string') {
|
|
93
|
-
audioPath = `data:audio/mpeg;base64,${response}`
|
|
93
|
+
if (typeof response.audioContent === 'string') {
|
|
94
|
+
audioPath = `data:audio/mpeg;base64,${response.audioContent}`
|
|
94
95
|
} else {
|
|
95
96
|
audioPath = response?.audioContent ?? ''
|
|
96
97
|
}
|
|
@@ -77,9 +77,18 @@ export type GoogleText2SpeechPayload = {
|
|
|
77
77
|
pitch: number
|
|
78
78
|
speakingRate: number
|
|
79
79
|
}
|
|
80
|
+
enableTimePointing?: string[]
|
|
80
81
|
}
|
|
81
82
|
|
|
82
|
-
export type
|
|
83
|
+
export type Timepoint = {
|
|
84
|
+
markName: string
|
|
85
|
+
timeSeconds: number
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export type GoogleText2SpeechResponse = {
|
|
89
|
+
audioContent?: string
|
|
90
|
+
timepoints?: Timepoint[]
|
|
91
|
+
}
|
|
83
92
|
|
|
84
93
|
export type ChatHintPayload = {
|
|
85
94
|
problemDescription: string
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
} from './api.types'
|
|
18
18
|
import { ExtendWithOptional } from '../../../lib/helpers/types'
|
|
19
19
|
import { ChatAnswer, ChatItem, ConversationMessage, FullStrokeData } from './units.types'
|
|
20
|
+
import { WithAbortSignal } from '../../../lib/types/requests'
|
|
20
21
|
|
|
21
22
|
export type ChatbotMessages = {
|
|
22
23
|
error: ConversationMessage
|
|
@@ -28,7 +29,7 @@ export type ChatbotMessages = {
|
|
|
28
29
|
export type ChatbotApiRequests = {
|
|
29
30
|
getAlternatives: (props: GetAlternativesPayload) => Promise<GetAlternativesResponse>
|
|
30
31
|
sendMessage: (props: SendMessagePayload) => Promise<SendMessageResponse>
|
|
31
|
-
postMessage: (props: PostMessagePayload) => Promise<PostMessageResponse>
|
|
32
|
+
postMessage: (props: WithAbortSignal<PostMessagePayload>) => Promise<PostMessageResponse>
|
|
32
33
|
postTranslateText: (props: GoogleTranslatePayload) => Promise<GoogleTranslateResponse>
|
|
33
34
|
postTextToSpeech: (props: GoogleText2SpeechPayload) => Promise<GoogleText2SpeechResponse>
|
|
34
35
|
/**
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { StyleSheet, Text, View } from 'react-native'
|
|
3
|
+
import { BORDER_RADIUS, COLORS, SHADOWS, SPACING } from '@magmamath/react-native-ui'
|
|
4
|
+
import { EOAModalText } from '@magmamath/students-features'
|
|
5
|
+
|
|
6
|
+
type AssessmentScoreCardProps = {
|
|
7
|
+
textContent: EOAModalText
|
|
8
|
+
solvedAmount?: number
|
|
9
|
+
problemsAmount?: number
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const AssessmentScoreCard = ({
|
|
13
|
+
textContent,
|
|
14
|
+
solvedAmount = 0,
|
|
15
|
+
problemsAmount = 0,
|
|
16
|
+
}: AssessmentScoreCardProps) => {
|
|
17
|
+
return (
|
|
18
|
+
<View style={styles.container}>
|
|
19
|
+
<Text style={styles.text}>
|
|
20
|
+
{solvedAmount} / {problemsAmount} {textContent.stats?.score ?? 'pt'}
|
|
21
|
+
</Text>
|
|
22
|
+
</View>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const styles = StyleSheet.create({
|
|
27
|
+
container: {
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
justifyContent: 'center',
|
|
30
|
+
minHeight: 130,
|
|
31
|
+
minWidth: 410,
|
|
32
|
+
padding: SPACING['400'],
|
|
33
|
+
borderRadius: BORDER_RADIUS['400'],
|
|
34
|
+
backgroundColor: COLORS.NEUTRAL_1,
|
|
35
|
+
...SHADOWS['1'],
|
|
36
|
+
},
|
|
37
|
+
text: {
|
|
38
|
+
fontSize: 96,
|
|
39
|
+
fontWeight: '700',
|
|
40
|
+
color: COLORS.NEUTRAL_9,
|
|
41
|
+
fontFamily: 'Buenos Aires',
|
|
42
|
+
},
|
|
43
|
+
})
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useState } from 'react'
|
|
2
2
|
import { View, StyleSheet } from 'react-native'
|
|
3
|
-
|
|
4
3
|
import { useUnit } from 'effector-react'
|
|
5
4
|
import { SPACING, Typography, COLORS, FONT_FAMILY } from '@magmamath/react-native-ui'
|
|
6
5
|
|
|
@@ -11,6 +10,8 @@ import { GOOD_DRAWING_CARD_APPEARENCE_DELAY } from '../../constants'
|
|
|
11
10
|
import { AnimatedCardVariant, EOAModalContentProps, EOAModalVariant } from '../../types'
|
|
12
11
|
import { useKeyBoard } from '../../../../shared/hooks/useKeyboard'
|
|
13
12
|
import { KeyboardKeys } from '../../../../lib/constants'
|
|
13
|
+
import { getEoaButtonColor } from '../../helpers'
|
|
14
|
+
import { AssessmentScoreCard } from '../AssessmentScoreCard/AssessmentScoreCard'
|
|
14
15
|
|
|
15
16
|
export const CorrectAnswer = ({ textContent, model, onPracticePress }: EOAModalContentProps) => {
|
|
16
17
|
const popUpData = useUnit(model.$popUpData)
|
|
@@ -22,6 +23,7 @@ export const CorrectAnswer = ({ textContent, model, onPracticePress }: EOAModalC
|
|
|
22
23
|
stats,
|
|
23
24
|
hasRecommendations,
|
|
24
25
|
isExam = false,
|
|
26
|
+
isAssessment = false,
|
|
25
27
|
newerAssignmentAvailable,
|
|
26
28
|
} = popUpData ?? {}
|
|
27
29
|
|
|
@@ -72,14 +74,22 @@ export const CorrectAnswer = ({ textContent, model, onPracticePress }: EOAModalC
|
|
|
72
74
|
</View>
|
|
73
75
|
|
|
74
76
|
<View style={styles.animationContainer}>
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
{isAssessment ? (
|
|
78
|
+
<AssessmentScoreCard
|
|
79
|
+
textContent={textContent}
|
|
80
|
+
solvedAmount={stats?.solvedAmount}
|
|
81
|
+
problemsAmount={stats?.problemsAmount}
|
|
82
|
+
/>
|
|
83
|
+
) : (
|
|
84
|
+
<AnimatedCard
|
|
85
|
+
variant={AnimatedCardVariant.CORRECT_ANSWER}
|
|
86
|
+
textContent={textContent}
|
|
87
|
+
solvedAmount={stats?.solvedAmount}
|
|
88
|
+
problemsAmount={stats?.problemsAmount}
|
|
89
|
+
shouldTriggerSparkles={cardsAnimationCompleted}
|
|
90
|
+
onAnimationEnd={onCorrectAnswerAnimationEnd}
|
|
91
|
+
/>
|
|
92
|
+
)}
|
|
83
93
|
|
|
84
94
|
{modalVariant === EOAModalVariant.HAS_GOOD_DRAWING && (
|
|
85
95
|
<AnimatedCard
|
|
@@ -96,9 +106,9 @@ export const CorrectAnswer = ({ textContent, model, onPracticePress }: EOAModalC
|
|
|
96
106
|
<PracticeButtonGroup
|
|
97
107
|
textContent={textContent}
|
|
98
108
|
isPracticeButtonVisible={isPracticeButtonVisible}
|
|
99
|
-
isExam={isExam}
|
|
100
109
|
onLeftButtonPress={model.hidePopUpAndLeave}
|
|
101
110
|
onRightButtonPress={handlePracticeButtonPress}
|
|
111
|
+
buttonColor={getEoaButtonColor(popUpData)}
|
|
102
112
|
/>
|
|
103
113
|
</View>
|
|
104
114
|
)
|
|
@@ -14,7 +14,6 @@ import { ExamPaused } from './ExamPaused/ExamPaused'
|
|
|
14
14
|
import { ExamSubmit } from './ExamSubmit/ExamSubmit'
|
|
15
15
|
|
|
16
16
|
import { getModalContainerSize, shouldDisplayModalBackground } from '../helpers'
|
|
17
|
-
import { ButtonColor } from '@magmamath/react-native-ui'
|
|
18
17
|
|
|
19
18
|
const MODAL_CONTENT_VARIANTS_MAP = new Map([
|
|
20
19
|
[EOAModalVariant.NO_CORRECT_ANSWERS, NoAnswer],
|
|
@@ -33,7 +32,6 @@ type EOAModalProps = {
|
|
|
33
32
|
model: EOAModel
|
|
34
33
|
textContent: EOAModalText
|
|
35
34
|
onPracticePress: () => void
|
|
36
|
-
buttonColor?: ButtonColor
|
|
37
35
|
}
|
|
38
36
|
|
|
39
37
|
/**
|
|
@@ -42,7 +40,7 @@ type EOAModalProps = {
|
|
|
42
40
|
* Dynamically renders a modal UI after an assignment ends, using the current `modalVariant`
|
|
43
41
|
* to determine which specific view to display (e.g., `NoAnswer`, `CorrectAnswer`, `CheatDetected`).
|
|
44
42
|
*/
|
|
45
|
-
export const EOAModal = ({ model, textContent, onPracticePress
|
|
43
|
+
export const EOAModal = ({ model, textContent, onPracticePress }: EOAModalProps) => {
|
|
46
44
|
const popUpData = useUnit(model.$popUpData)
|
|
47
45
|
const modalVariant = useUnit(model.$modalVariant)
|
|
48
46
|
|
|
@@ -64,12 +62,7 @@ export const EOAModal = ({ model, textContent, onPracticePress, buttonColor }: E
|
|
|
64
62
|
style={getModalContainerSize(modalVariant)}
|
|
65
63
|
onClose={model.hidePopUp}
|
|
66
64
|
content={
|
|
67
|
-
<ModalContent
|
|
68
|
-
model={model}
|
|
69
|
-
textContent={textContent}
|
|
70
|
-
onPracticePress={onPracticePress}
|
|
71
|
-
buttonColor={buttonColor}
|
|
72
|
-
/>
|
|
65
|
+
<ModalContent model={model} textContent={textContent} onPracticePress={onPracticePress} />
|
|
73
66
|
}
|
|
74
67
|
withBackground={withBackground}
|
|
75
68
|
/>
|
|
@@ -13,12 +13,12 @@ import {
|
|
|
13
13
|
import { EOAModalContentProps } from '../../types'
|
|
14
14
|
import { useKeyBoard } from '../../../../shared/hooks/useKeyboard'
|
|
15
15
|
import { KeyboardKeys } from '../../../../lib/constants'
|
|
16
|
+
import { getEoaButtonColor } from '../../helpers'
|
|
17
|
+
import { useUnit } from 'effector-react'
|
|
18
|
+
|
|
19
|
+
export const ExamPaused = ({ textContent, model }: EOAModalContentProps) => {
|
|
20
|
+
const popUpData = useUnit(model.$popUpData)
|
|
16
21
|
|
|
17
|
-
export const ExamPaused = ({
|
|
18
|
-
textContent,
|
|
19
|
-
model,
|
|
20
|
-
buttonColor = ButtonColor.PURPLE,
|
|
21
|
-
}: EOAModalContentProps) => {
|
|
22
22
|
useKeyBoard({
|
|
23
23
|
callback: (event) => {
|
|
24
24
|
if (event.key === KeyboardKeys.ENTER) {
|
|
@@ -39,7 +39,7 @@ export const ExamPaused = ({
|
|
|
39
39
|
|
|
40
40
|
<Button
|
|
41
41
|
variant={ButtonVariant.PRIMARY}
|
|
42
|
-
colorScheme={
|
|
42
|
+
colorScheme={getEoaButtonColor(popUpData)}
|
|
43
43
|
size={ButtonSize.LARGE}
|
|
44
44
|
style={{ text: styles.buttonText }}
|
|
45
45
|
onPress={model.hidePopUpAndLeave}
|
|
@@ -4,7 +4,6 @@ import { View, StyleSheet, Platform, Image } from 'react-native'
|
|
|
4
4
|
import { useUnit } from 'effector-react'
|
|
5
5
|
import {
|
|
6
6
|
Button,
|
|
7
|
-
ButtonColor,
|
|
8
7
|
ButtonSize,
|
|
9
8
|
ButtonVariant,
|
|
10
9
|
COLORS,
|
|
@@ -18,6 +17,7 @@ import { EOAModalContentProps } from '../../types'
|
|
|
18
17
|
import { PracticeButton } from '../../ui/PracticeButton'
|
|
19
18
|
import { useKeyBoard } from '../../../../shared/hooks/useKeyboard'
|
|
20
19
|
import { KeyboardKeys } from '../../../../lib/constants'
|
|
20
|
+
import { getEoaButtonColor } from '../../helpers'
|
|
21
21
|
|
|
22
22
|
export const ExamSubmit = ({ textContent, model, onPracticePress }: EOAModalContentProps) => {
|
|
23
23
|
const popUpData = useUnit(model.$popUpData)
|
|
@@ -60,7 +60,7 @@ export const ExamSubmit = ({ textContent, model, onPracticePress }: EOAModalCont
|
|
|
60
60
|
<Button
|
|
61
61
|
variant={isPracticeButtonVisible ? ButtonVariant.TERTIARY : ButtonVariant.PRIMARY}
|
|
62
62
|
size={ButtonSize.LARGE}
|
|
63
|
-
colorScheme={popUpData
|
|
63
|
+
colorScheme={getEoaButtonColor(popUpData)}
|
|
64
64
|
style={{ text: { textTransform: 'uppercase' } }}
|
|
65
65
|
onPress={model.hidePopUpAndLeave}
|
|
66
66
|
>
|
|
@@ -16,17 +16,19 @@ import { EOAModalContentProps } from '../../types'
|
|
|
16
16
|
import { NoAnswerContent } from './NoAnswerContent'
|
|
17
17
|
import { useKeyBoard } from '../../../../shared/hooks/useKeyboard'
|
|
18
18
|
import { KeyboardKeys } from '../../../../lib/constants'
|
|
19
|
+
import { getEoaButtonColor } from '../../helpers'
|
|
20
|
+
import { AssessmentScoreCard } from '../AssessmentScoreCard/AssessmentScoreCard'
|
|
19
21
|
|
|
20
22
|
export const NoAnswer = ({ model, textContent, onPracticePress }: EOAModalContentProps) => {
|
|
21
23
|
const popUpData = useUnit(model.$popUpData)
|
|
22
24
|
|
|
23
|
-
const { stats, isExam, user } = popUpData ?? {}
|
|
25
|
+
const { stats, isExam, isAssessment, user } = popUpData ?? {}
|
|
24
26
|
|
|
25
27
|
function getButtons() {
|
|
26
28
|
const buttons = [
|
|
27
29
|
{
|
|
28
30
|
text: textContent.leftButtonText ?? '',
|
|
29
|
-
colorScheme:
|
|
31
|
+
colorScheme: getEoaButtonColor(popUpData),
|
|
30
32
|
onPress: () => model.hidePopUpAndLeave(),
|
|
31
33
|
},
|
|
32
34
|
]
|
|
@@ -84,10 +86,19 @@ export const NoAnswer = ({ model, textContent, onPracticePress }: EOAModalConten
|
|
|
84
86
|
</Typography>
|
|
85
87
|
)}
|
|
86
88
|
</View>
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
{isAssessment ? (
|
|
90
|
+
<AssessmentScoreCard
|
|
91
|
+
textContent={textContent}
|
|
92
|
+
solvedAmount={stats?.solvedAmount}
|
|
93
|
+
problemsAmount={stats?.problemsAmount}
|
|
94
|
+
/>
|
|
95
|
+
) : (
|
|
96
|
+
<NoAnswerContent
|
|
97
|
+
solvedAmount={stats?.solvedAmount ?? 0}
|
|
98
|
+
problemsAmount={stats?.problemsAmount ?? 0}
|
|
99
|
+
/>
|
|
100
|
+
)}
|
|
101
|
+
|
|
91
102
|
<View style={styles.buttonsContainer}>
|
|
92
103
|
{buttons.map((button, index) => (
|
|
93
104
|
<Button
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { MODALS_WITH_BACKGROUND } from './constants'
|
|
2
|
-
import { EOAModalVariant } from './types'
|
|
2
|
+
import { EOAModalData, EOAModalVariant } from './types'
|
|
3
|
+
import { ButtonColor } from '@magmamath/react-native-ui'
|
|
3
4
|
|
|
4
5
|
export const getModalContainerSize = (modalVariant: EOAModalVariant) => {
|
|
5
6
|
switch (modalVariant) {
|
|
6
7
|
case EOAModalVariant.EXAM_SUBMIT:
|
|
7
8
|
case EOAModalVariant.EXAM_SAFE_MODE_SUBMIT:
|
|
8
|
-
return { container: { width:
|
|
9
|
+
return { container: { width: 620, height: 384 } }
|
|
9
10
|
case EOAModalVariant.EXAM_PAUSED:
|
|
10
11
|
case EOAModalVariant.EXAM_SAFE_MODE_CHEAT_DETECTED:
|
|
11
12
|
return { container: { width: 560, height: 338 } }
|
|
12
13
|
case EOAModalVariant.EXAM_SAFE_MODE_LEAVE:
|
|
13
|
-
return { container: { width: 550, height:
|
|
14
|
+
return { container: { width: 550, height: 325 } }
|
|
14
15
|
case EOAModalVariant.HAS_GOOD_DRAWING:
|
|
15
16
|
return { container: { width: 957, height: 550 } }
|
|
16
17
|
case EOAModalVariant.HAS_CORRECT_ANSWERS:
|
|
@@ -26,3 +27,9 @@ export const shouldDisplayModalBackground = (modalVariant: EOAModalVariant | nul
|
|
|
26
27
|
|
|
27
28
|
return MODALS_WITH_BACKGROUND.includes(modalVariant)
|
|
28
29
|
}
|
|
30
|
+
|
|
31
|
+
export const getEoaButtonColor = (popupData: EOAModalData | null): ButtonColor => {
|
|
32
|
+
if (popupData?.isAssessment) return ButtonColor.SUNSET
|
|
33
|
+
if (popupData?.isExam) return ButtonColor.PURPLE
|
|
34
|
+
return ButtonColor.BLUE
|
|
35
|
+
}
|
|
@@ -9,6 +9,7 @@ export class EOAModel {
|
|
|
9
9
|
public readonly leavePressed = createEvent()
|
|
10
10
|
public readonly goToFirstProblemPressed = createEvent()
|
|
11
11
|
public readonly recommendationsUpdated = createEvent<boolean>()
|
|
12
|
+
public readonly popUpStatsUpdated = createEvent<Partial<EOAModalData['stats']>>()
|
|
12
13
|
public readonly popUpTriggered = createEvent<EOAEventType>()
|
|
13
14
|
|
|
14
15
|
public readonly $popUpData = createStore<EOAModalData | null>(null)
|
|
@@ -16,6 +17,9 @@ export class EOAModel {
|
|
|
16
17
|
.on(this.recommendationsUpdated, (state, hasRecommendations) =>
|
|
17
18
|
state ? { ...state, hasRecommendations } : state,
|
|
18
19
|
)
|
|
20
|
+
.on(this.popUpStatsUpdated, (state, payload) =>
|
|
21
|
+
state ? { ...state, stats: { ...state.stats, ...payload } } : state,
|
|
22
|
+
)
|
|
19
23
|
.reset(this.hidePopUp)
|
|
20
24
|
|
|
21
25
|
public readonly $modalVariant = createStore<EOAModalVariant | null>(null)
|
|
@@ -33,7 +37,7 @@ export class EOAModel {
|
|
|
33
37
|
}
|
|
34
38
|
|
|
35
39
|
if (eventType === EOAEventType.EXAM_PAUSED) return EOAModalVariant.EXAM_PAUSED
|
|
36
|
-
|
|
40
|
+
|
|
37
41
|
if (eventType === EOAEventType.CHEAT_DETECTED) {
|
|
38
42
|
return EOAModalVariant.EXAM_SAFE_MODE_CHEAT_DETECTED
|
|
39
43
|
}
|
|
@@ -34,11 +34,11 @@ export type EOAModalContentProps = {
|
|
|
34
34
|
textContent: EOAModalText
|
|
35
35
|
model: EOAModel
|
|
36
36
|
onPracticePress?: () => void
|
|
37
|
-
buttonColor?: ButtonColor
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
export type EOAModalData = {
|
|
41
40
|
isExam: boolean
|
|
41
|
+
isAssessment: boolean
|
|
42
42
|
newerAssignmentAvailable?: boolean
|
|
43
43
|
examFinished?: boolean
|
|
44
44
|
cheatDetection?: boolean
|
|
@@ -63,5 +63,6 @@ export type EOAModalText = {
|
|
|
63
63
|
correctAnswersPlural?: string
|
|
64
64
|
goodCalculations?: string
|
|
65
65
|
goodCalculationsPlural?: string
|
|
66
|
+
score?: string
|
|
66
67
|
}
|
|
67
68
|
}
|
|
@@ -11,13 +11,14 @@ import Animated, {
|
|
|
11
11
|
import { ButtonVariant, SPACING, Button, ButtonSize, ButtonColor } from '@magmamath/react-native-ui'
|
|
12
12
|
|
|
13
13
|
import { PracticeButton } from './PracticeButton'
|
|
14
|
+
import { getEoaButtonColor } from '../helpers'
|
|
14
15
|
|
|
15
16
|
type PracticeButtonGroupProps = {
|
|
16
17
|
textContent: { leftButtonText?: string; rightButtonText?: string }
|
|
17
18
|
isPracticeButtonVisible: boolean
|
|
18
19
|
onLeftButtonPress: () => void
|
|
19
20
|
onRightButtonPress: () => void
|
|
20
|
-
|
|
21
|
+
buttonColor?: ButtonColor
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
export const PracticeButtonGroup = ({
|
|
@@ -25,7 +26,7 @@ export const PracticeButtonGroup = ({
|
|
|
25
26
|
isPracticeButtonVisible,
|
|
26
27
|
onLeftButtonPress,
|
|
27
28
|
onRightButtonPress,
|
|
28
|
-
|
|
29
|
+
buttonColor = ButtonColor.BLUE,
|
|
29
30
|
}: PracticeButtonGroupProps) => {
|
|
30
31
|
const buttonsContainerOpacity = useSharedValue(0)
|
|
31
32
|
|
|
@@ -45,7 +46,7 @@ export const PracticeButtonGroup = ({
|
|
|
45
46
|
<Button
|
|
46
47
|
variant={isPracticeButtonVisible ? ButtonVariant.TERTIARY : ButtonVariant.PRIMARY}
|
|
47
48
|
size={ButtonSize.LARGE}
|
|
48
|
-
colorScheme={
|
|
49
|
+
colorScheme={buttonColor}
|
|
49
50
|
style={{ text: { textTransform: 'uppercase' } }}
|
|
50
51
|
onPress={onLeftButtonPress}
|
|
51
52
|
>
|
|
@@ -28,10 +28,12 @@ export const BasicLayout = (props: KeyboardLayoutProps & PropsWithChildren) => {
|
|
|
28
28
|
|
|
29
29
|
const styles = StyleSheet.create({
|
|
30
30
|
container: {
|
|
31
|
-
|
|
31
|
+
display: 'flex',
|
|
32
32
|
flexDirection: 'row',
|
|
33
|
+
justifyContent: 'space-between',
|
|
33
34
|
flexWrap: 'nowrap',
|
|
34
35
|
gap: 16,
|
|
36
|
+
height: '100%',
|
|
35
37
|
paddingRight: 16,
|
|
36
38
|
},
|
|
37
39
|
})
|
|
@@ -66,6 +66,7 @@ export const Keyboard = ({ style, characterType, isVisible = true, ...props }: K
|
|
|
66
66
|
const styles = StyleSheet.create({
|
|
67
67
|
container: {
|
|
68
68
|
flexDirection: 'row',
|
|
69
|
+
alignItems: 'flex-start',
|
|
69
70
|
justifyContent: 'space-between',
|
|
70
71
|
backgroundColor: COLORS.NEUTRAL_2,
|
|
71
72
|
borderRadius: 12,
|
|
@@ -74,6 +75,7 @@ const styles = StyleSheet.create({
|
|
|
74
75
|
paddingBottom: 13,
|
|
75
76
|
borderColor: COLORS.NEUTRAL_5,
|
|
76
77
|
borderWidth: 1,
|
|
78
|
+
width: 'auto',
|
|
77
79
|
height: 155,
|
|
78
80
|
...SHADOWS[2],
|
|
79
81
|
},
|
|
@@ -16,6 +16,7 @@ type KeysListProps = {
|
|
|
16
16
|
disabledKeys?: KeyboardKey[]
|
|
17
17
|
color?: SelectOptionColor
|
|
18
18
|
style?: {
|
|
19
|
+
container?: StyleProp<ViewStyle>
|
|
19
20
|
option?: ButtonStyle
|
|
20
21
|
}
|
|
21
22
|
} & KeyboardLayoutProps
|
|
@@ -45,7 +46,7 @@ export const KeysList = ({
|
|
|
45
46
|
return (
|
|
46
47
|
<SelectGroup
|
|
47
48
|
style={{
|
|
48
|
-
container: styles.container,
|
|
49
|
+
container: [styles.container, style?.container],
|
|
49
50
|
row: styles.row,
|
|
50
51
|
}}
|
|
51
52
|
numOfRows={numOfRows}
|
|
@@ -59,14 +60,15 @@ export const KeysList = ({
|
|
|
59
60
|
|
|
60
61
|
export const styles = StyleSheet.create({
|
|
61
62
|
container: {
|
|
62
|
-
gap: 9,
|
|
63
63
|
width: 'auto',
|
|
64
|
+
gap: 9,
|
|
64
65
|
},
|
|
65
66
|
row: {
|
|
66
67
|
gap: 3,
|
|
67
68
|
},
|
|
68
69
|
optionContainer: {
|
|
69
70
|
flexGrow: 0,
|
|
71
|
+
flexShrink: 0,
|
|
70
72
|
flexBasis: IS_MOBILE ? 45 : 'auto',
|
|
71
73
|
},
|
|
72
74
|
optionButton: {
|
|
@@ -16,7 +16,14 @@ export const Numpad = ({ style, ...props }: NumpadProps) => {
|
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
18
|
<View style={[styles.container, style]}>
|
|
19
|
-
<KeysList
|
|
19
|
+
<KeysList
|
|
20
|
+
keys={keyboardGroup.keys}
|
|
21
|
+
numOfRows={3}
|
|
22
|
+
style={{
|
|
23
|
+
container: styles.keysContainer,
|
|
24
|
+
}}
|
|
25
|
+
{...props}
|
|
26
|
+
/>
|
|
20
27
|
</View>
|
|
21
28
|
)
|
|
22
29
|
}
|
|
@@ -24,6 +31,16 @@ export const Numpad = ({ style, ...props }: NumpadProps) => {
|
|
|
24
31
|
const styles = StyleSheet.create({
|
|
25
32
|
container: {
|
|
26
33
|
borderLeftWidth: 1,
|
|
34
|
+
borderColor: 'transparent',
|
|
27
35
|
paddingLeft: SPACING[800],
|
|
36
|
+
marginLeft: 'auto',
|
|
37
|
+
},
|
|
38
|
+
keysContainer: {
|
|
39
|
+
display: 'flex',
|
|
40
|
+
width: 'auto',
|
|
41
|
+
flexGrow: 0,
|
|
42
|
+
flexShrink: 0,
|
|
43
|
+
flexBasis: 'auto',
|
|
44
|
+
gap: 9,
|
|
28
45
|
},
|
|
29
46
|
})
|
|
@@ -24,29 +24,31 @@ export const UnitTabs = ({ activeTab, tabs, onTabChange, ...props }: UnitTabsPro
|
|
|
24
24
|
|
|
25
25
|
return (
|
|
26
26
|
<View style={styles.container}>
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
{
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
27
|
+
<View style={styles.tabsContainer}>
|
|
28
|
+
<TabGroup
|
|
29
|
+
activeTab={activeTab}
|
|
30
|
+
tabs={tabs}
|
|
31
|
+
onTabChange={onTabChange}
|
|
32
|
+
style={styles.tabs}
|
|
33
|
+
variant={TabVariant.SMALL}
|
|
34
|
+
/>
|
|
35
|
+
<View style={styles.keyGroupContainer}>
|
|
36
|
+
{keyboardGroups.map((keyGroup, index) => (
|
|
37
|
+
<KeysList
|
|
38
|
+
key={index}
|
|
39
|
+
keys={keyGroup}
|
|
40
|
+
numOfRows={1}
|
|
41
|
+
{...props}
|
|
42
|
+
style={{
|
|
43
|
+
option: {
|
|
44
|
+
text: styles.keysText,
|
|
45
|
+
container: styles.keyContainer,
|
|
46
|
+
button: styles.keyButton,
|
|
47
|
+
},
|
|
48
|
+
}}
|
|
49
|
+
/>
|
|
50
|
+
))}
|
|
51
|
+
</View>
|
|
50
52
|
</View>
|
|
51
53
|
</View>
|
|
52
54
|
)
|
|
@@ -54,14 +56,17 @@ export const UnitTabs = ({ activeTab, tabs, onTabChange, ...props }: UnitTabsPro
|
|
|
54
56
|
|
|
55
57
|
const styles = StyleSheet.create({
|
|
56
58
|
container: {
|
|
59
|
+
width: 283,
|
|
57
60
|
flex: 1,
|
|
61
|
+
},
|
|
62
|
+
tabsContainer: {
|
|
58
63
|
gap: 16,
|
|
64
|
+
flex: 1,
|
|
59
65
|
},
|
|
60
66
|
tabs: {
|
|
61
67
|
borderBottomWidth: 1,
|
|
62
68
|
borderBottomColor: COLORS.NEUTRAL_3,
|
|
63
69
|
paddingTop: 0,
|
|
64
|
-
gap: 24,
|
|
65
70
|
},
|
|
66
71
|
keyGroupContainer: {
|
|
67
72
|
gap: 8,
|