@magmamath/students-features 0.9.8-rc.3 → 0.9.9
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 +3 -4
- 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/keyboard/components/BasicLayout/BasicLayout.js +1 -3
- 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 +4 -21
- package/dist/commonjs/features/keyboard/components/Keyboard.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/KeysList/KeysList.js +3 -4
- package/dist/commonjs/features/keyboard/components/KeysList/KeysList.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/MainLayout.js +1 -2
- package/dist/commonjs/features/keyboard/components/MainLayout.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/Numpad/Numpad.js +1 -14
- package/dist/commonjs/features/keyboard/components/Numpad/Numpad.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/UnitsLayout/UnitTabs.js +25 -31
- 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 +0 -15
- package/dist/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/constants.js +1 -11
- package/dist/commonjs/features/keyboard/components/constants.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/module/features/chatbot/model/t2s.js +3 -4
- 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/keyboard/components/BasicLayout/BasicLayout.js +1 -3
- 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 +6 -23
- package/dist/module/features/keyboard/components/Keyboard.js.map +1 -1
- package/dist/module/features/keyboard/components/KeysList/KeysList.js +3 -4
- package/dist/module/features/keyboard/components/KeysList/KeysList.js.map +1 -1
- package/dist/module/features/keyboard/components/MainLayout.js +1 -2
- package/dist/module/features/keyboard/components/MainLayout.js.map +1 -1
- package/dist/module/features/keyboard/components/Numpad/Numpad.js +1 -14
- package/dist/module/features/keyboard/components/Numpad/Numpad.js.map +1 -1
- package/dist/module/features/keyboard/components/UnitsLayout/UnitTabs.js +25 -31
- 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 +0 -15
- package/dist/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js.map +1 -1
- package/dist/module/features/keyboard/components/constants.js +0 -10
- package/dist/module/features/keyboard/components/constants.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/typescript/commonjs/features/chatbot/model/ChatbotApi.d.ts +2 -2
- 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 +1 -8
- 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 +4 -5
- package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/Keyboard.d.ts +1 -2
- package/dist/typescript/commonjs/features/keyboard/components/Keyboard.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/KeysList/KeysList.d.ts +1 -4
- 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 +0 -2
- 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 +2 -26
- package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/constants.d.ts +0 -10
- package/dist/typescript/commonjs/features/keyboard/components/constants.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/module/features/chatbot/model/ChatbotApi.d.ts +2 -2
- 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 +1 -8
- 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 +4 -5
- package/dist/typescript/module/features/chatbot/types/model.types.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/Keyboard.d.ts +1 -2
- package/dist/typescript/module/features/keyboard/components/Keyboard.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/KeysList/KeysList.d.ts +1 -4
- 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 +0 -2
- 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 +2 -26
- package/dist/typescript/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/constants.d.ts +0 -10
- package/dist/typescript/module/features/keyboard/components/constants.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/package.json +1 -1
- package/src/features/chatbot/model/t2s.ts +2 -3
- package/src/features/chatbot/types/api.types.ts +1 -11
- package/src/features/chatbot/types/model.types.ts +4 -9
- package/src/features/keyboard/components/BasicLayout/BasicLayout.tsx +1 -3
- package/src/features/keyboard/components/BasicLayout/TimeBasicLayout.tsx +1 -1
- package/src/features/keyboard/components/Keyboard.tsx +7 -35
- package/src/features/keyboard/components/KeysList/KeysList.tsx +2 -4
- package/src/features/keyboard/components/MainLayout.tsx +1 -2
- package/src/features/keyboard/components/Numpad/Numpad.tsx +1 -18
- package/src/features/keyboard/components/UnitsLayout/UnitTabs.tsx +24 -29
- package/src/features/keyboard/components/UnitsLayout/UnitsLayout.tsx +1 -0
- package/src/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.ts +0 -4
- package/src/features/keyboard/components/constants.ts +0 -12
- package/src/features/keyboard/types/MathKeysGroups/units.tsx +14 -13
- package/dist/commonjs/lib/types/requests.js +0 -2
- package/dist/commonjs/lib/types/requests.js.map +0 -1
- package/dist/module/lib/types/requests.js +0 -2
- package/dist/module/lib/types/requests.js.map +0 -1
- package/dist/typescript/commonjs/lib/types/requests.d.ts +0 -4
- package/dist/typescript/commonjs/lib/types/requests.d.ts.map +0 -1
- package/dist/typescript/module/lib/types/requests.d.ts +0 -4
- package/dist/typescript/module/lib/types/requests.d.ts.map +0 -1
- package/src/lib/types/requests.ts +0 -1
|
@@ -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;AAiCzB,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"}
|
package/package.json
CHANGED
|
@@ -86,12 +86,11 @@ export class ChatTextToSpeechModel {
|
|
|
86
86
|
input: { text },
|
|
87
87
|
voice: config?.voice ?? DEFAULT_VOICE,
|
|
88
88
|
audioConfig: config?.audioConfig ?? AUDIO_CONFIG,
|
|
89
|
-
enableTimePointing: [],
|
|
90
89
|
})
|
|
91
90
|
|
|
92
91
|
// Response might be different type based on provided AUDIO_CONFIG
|
|
93
|
-
if (typeof response
|
|
94
|
-
audioPath = `data:audio/mpeg;base64,${response
|
|
92
|
+
if (typeof response === 'string') {
|
|
93
|
+
audioPath = `data:audio/mpeg;base64,${response}`
|
|
95
94
|
} else {
|
|
96
95
|
audioPath = response?.audioContent ?? ''
|
|
97
96
|
}
|
|
@@ -56,7 +56,6 @@ export type PostMessageResponse = {
|
|
|
56
56
|
export type GoogleTranslatePayload = {
|
|
57
57
|
text: string[]
|
|
58
58
|
targetLanguage: string
|
|
59
|
-
sourceLanguage?: string
|
|
60
59
|
}
|
|
61
60
|
|
|
62
61
|
export type GoogleTranslateResponse = {
|
|
@@ -78,18 +77,9 @@ export type GoogleText2SpeechPayload = {
|
|
|
78
77
|
pitch: number
|
|
79
78
|
speakingRate: number
|
|
80
79
|
}
|
|
81
|
-
enableTimePointing?: string[]
|
|
82
80
|
}
|
|
83
81
|
|
|
84
|
-
export type
|
|
85
|
-
markName: string
|
|
86
|
-
timeSeconds: number
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export type GoogleText2SpeechResponse = {
|
|
90
|
-
audioContent?: string
|
|
91
|
-
timepoints?: Timepoint[]
|
|
92
|
-
}
|
|
82
|
+
export type GoogleText2SpeechResponse = string | undefined | { audioContent?: string }
|
|
93
83
|
|
|
94
84
|
export type ChatHintPayload = {
|
|
95
85
|
problemDescription: string
|
|
@@ -17,7 +17,6 @@ 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'
|
|
21
20
|
|
|
22
21
|
export type ChatbotMessages = {
|
|
23
22
|
error: ConversationMessage
|
|
@@ -28,14 +27,10 @@ export type ChatbotMessages = {
|
|
|
28
27
|
|
|
29
28
|
export type ChatbotApiRequests = {
|
|
30
29
|
getAlternatives: (props: GetAlternativesPayload) => Promise<GetAlternativesResponse>
|
|
31
|
-
sendMessage: (props:
|
|
32
|
-
postMessage: (props:
|
|
33
|
-
postTranslateText: (
|
|
34
|
-
|
|
35
|
-
) => Promise<GoogleTranslateResponse>
|
|
36
|
-
postTextToSpeech: (
|
|
37
|
-
props: WithAbortSignal<GoogleText2SpeechPayload>,
|
|
38
|
-
) => Promise<GoogleText2SpeechResponse>
|
|
30
|
+
sendMessage: (props: SendMessagePayload) => Promise<SendMessageResponse>
|
|
31
|
+
postMessage: (props: PostMessagePayload) => Promise<PostMessageResponse>
|
|
32
|
+
postTranslateText: (props: GoogleTranslatePayload) => Promise<GoogleTranslateResponse>
|
|
33
|
+
postTextToSpeech: (props: GoogleText2SpeechPayload) => Promise<GoogleText2SpeechResponse>
|
|
39
34
|
/**
|
|
40
35
|
* @deprecated merged with hint
|
|
41
36
|
*/
|
|
@@ -28,12 +28,10 @@ export const BasicLayout = (props: KeyboardLayoutProps & PropsWithChildren) => {
|
|
|
28
28
|
|
|
29
29
|
const styles = StyleSheet.create({
|
|
30
30
|
container: {
|
|
31
|
-
|
|
31
|
+
flex: 1,
|
|
32
32
|
flexDirection: 'row',
|
|
33
|
-
justifyContent: 'space-between',
|
|
34
33
|
flexWrap: 'nowrap',
|
|
35
34
|
gap: 16,
|
|
36
|
-
height: '100%',
|
|
37
35
|
paddingRight: 16,
|
|
38
36
|
},
|
|
39
37
|
})
|
|
@@ -1,31 +1,24 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import {
|
|
1
|
+
import React, { useMemo } from 'react'
|
|
2
|
+
import { StyleProp, StyleSheet, useWindowDimensions, ViewStyle } from 'react-native'
|
|
3
3
|
import { COLORS, IS_MOBILE, SelectOptionColor, SHADOWS } from '@magmamath/react-native-ui'
|
|
4
4
|
import { KeyboardKey, KeyboardKeyValue } from '../types/types'
|
|
5
5
|
import { Numpad } from './Numpad/Numpad'
|
|
6
6
|
import { MOBILE_LAYOUT_WIDTH } from '../constants/constants'
|
|
7
|
-
import {
|
|
8
|
-
getLayoutConfigStyles,
|
|
9
|
-
KEYBOARD_SLIDE_DISTANCE,
|
|
10
|
-
slideInAnimationSettings,
|
|
11
|
-
slideOutAnimationSettings,
|
|
12
|
-
} from './constants'
|
|
7
|
+
import { getLayoutConfigStyles } from './constants'
|
|
13
8
|
import { MainLayout } from './MainLayout'
|
|
9
|
+
import Animated, { SlideInDown } from 'react-native-reanimated'
|
|
14
10
|
|
|
15
11
|
type KeyboardProps = {
|
|
16
12
|
onKeyPress: (key: KeyboardKeyValue) => void
|
|
17
13
|
characterType?: number
|
|
18
14
|
style?: StyleProp<ViewStyle>
|
|
19
15
|
color?: SelectOptionColor
|
|
20
|
-
isVisible?: boolean
|
|
21
16
|
isDisabled?: boolean
|
|
22
17
|
showUnderlinedKeys?: boolean
|
|
23
18
|
disabledKeys?: KeyboardKey[]
|
|
24
19
|
}
|
|
25
20
|
|
|
26
|
-
export const Keyboard = ({ style, characterType,
|
|
27
|
-
const slideAnim = useRef(new Animated.Value(isVisible ? 0 : KEYBOARD_SLIDE_DISTANCE)).current
|
|
28
|
-
|
|
21
|
+
export const Keyboard = ({ style, characterType, ...props }: KeyboardProps) => {
|
|
29
22
|
const { width } = useWindowDimensions()
|
|
30
23
|
const isMobile = width <= MOBILE_LAYOUT_WIDTH || IS_MOBILE
|
|
31
24
|
const mobileStyles = useMemo(
|
|
@@ -33,29 +26,10 @@ export const Keyboard = ({ style, characterType, isVisible = true, ...props }: K
|
|
|
33
26
|
[characterType, isMobile],
|
|
34
27
|
)
|
|
35
28
|
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
const animationConfig = isVisible ? slideOutAnimationSettings : slideInAnimationSettings
|
|
38
|
-
const anim = Animated.spring(slideAnim, {
|
|
39
|
-
...animationConfig,
|
|
40
|
-
mass: 1,
|
|
41
|
-
velocity: 0,
|
|
42
|
-
useNativeDriver: true,
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
anim.start()
|
|
46
|
-
|
|
47
|
-
return () => anim.stop()
|
|
48
|
-
}, [isVisible])
|
|
49
|
-
|
|
50
29
|
return (
|
|
51
30
|
<Animated.View
|
|
52
|
-
style={[
|
|
53
|
-
|
|
54
|
-
style,
|
|
55
|
-
{
|
|
56
|
-
transform: [{ translateY: slideAnim }],
|
|
57
|
-
},
|
|
58
|
-
]}
|
|
31
|
+
style={[styles.container, style]}
|
|
32
|
+
entering={SlideInDown.damping(40).stiffness(320)}
|
|
59
33
|
>
|
|
60
34
|
<MainLayout {...props} characterType={characterType} />
|
|
61
35
|
<Numpad {...props} style={mobileStyles} />
|
|
@@ -66,7 +40,6 @@ export const Keyboard = ({ style, characterType, isVisible = true, ...props }: K
|
|
|
66
40
|
const styles = StyleSheet.create({
|
|
67
41
|
container: {
|
|
68
42
|
flexDirection: 'row',
|
|
69
|
-
alignItems: 'flex-start',
|
|
70
43
|
justifyContent: 'space-between',
|
|
71
44
|
backgroundColor: COLORS.NEUTRAL_2,
|
|
72
45
|
borderRadius: 12,
|
|
@@ -75,7 +48,6 @@ const styles = StyleSheet.create({
|
|
|
75
48
|
paddingBottom: 13,
|
|
76
49
|
borderColor: COLORS.NEUTRAL_5,
|
|
77
50
|
borderWidth: 1,
|
|
78
|
-
width: 'auto',
|
|
79
51
|
height: 155,
|
|
80
52
|
...SHADOWS[2],
|
|
81
53
|
},
|
|
@@ -16,7 +16,6 @@ type KeysListProps = {
|
|
|
16
16
|
disabledKeys?: KeyboardKey[]
|
|
17
17
|
color?: SelectOptionColor
|
|
18
18
|
style?: {
|
|
19
|
-
container?: StyleProp<ViewStyle>
|
|
20
19
|
option?: ButtonStyle
|
|
21
20
|
}
|
|
22
21
|
} & KeyboardLayoutProps
|
|
@@ -46,7 +45,7 @@ export const KeysList = ({
|
|
|
46
45
|
return (
|
|
47
46
|
<SelectGroup
|
|
48
47
|
style={{
|
|
49
|
-
container:
|
|
48
|
+
container: styles.container,
|
|
50
49
|
row: styles.row,
|
|
51
50
|
}}
|
|
52
51
|
numOfRows={numOfRows}
|
|
@@ -60,15 +59,14 @@ export const KeysList = ({
|
|
|
60
59
|
|
|
61
60
|
export const styles = StyleSheet.create({
|
|
62
61
|
container: {
|
|
63
|
-
width: 'auto',
|
|
64
62
|
gap: 9,
|
|
63
|
+
width: 'auto',
|
|
65
64
|
},
|
|
66
65
|
row: {
|
|
67
66
|
gap: 3,
|
|
68
67
|
},
|
|
69
68
|
optionContainer: {
|
|
70
69
|
flexGrow: 0,
|
|
71
|
-
flexShrink: 0,
|
|
72
70
|
flexBasis: IS_MOBILE ? 45 : 'auto',
|
|
73
71
|
},
|
|
74
72
|
optionButton: {
|
|
@@ -16,14 +16,7 @@ export const Numpad = ({ style, ...props }: NumpadProps) => {
|
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
18
|
<View style={[styles.container, style]}>
|
|
19
|
-
<KeysList
|
|
20
|
-
keys={keyboardGroup.keys}
|
|
21
|
-
numOfRows={3}
|
|
22
|
-
style={{
|
|
23
|
-
container: styles.keysContainer,
|
|
24
|
-
}}
|
|
25
|
-
{...props}
|
|
26
|
-
/>
|
|
19
|
+
<KeysList keys={keyboardGroup.keys} numOfRows={3} {...props} />
|
|
27
20
|
</View>
|
|
28
21
|
)
|
|
29
22
|
}
|
|
@@ -31,16 +24,6 @@ export const Numpad = ({ style, ...props }: NumpadProps) => {
|
|
|
31
24
|
const styles = StyleSheet.create({
|
|
32
25
|
container: {
|
|
33
26
|
borderLeftWidth: 1,
|
|
34
|
-
borderColor: 'transparent',
|
|
35
27
|
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,
|
|
45
28
|
},
|
|
46
29
|
})
|
|
@@ -24,31 +24,29 @@ 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
|
-
|
|
50
|
-
))}
|
|
51
|
-
</View>
|
|
27
|
+
<TabGroup
|
|
28
|
+
activeTab={activeTab}
|
|
29
|
+
tabs={tabs}
|
|
30
|
+
onTabChange={onTabChange}
|
|
31
|
+
style={styles.tabs}
|
|
32
|
+
variant={TabVariant.SMALL}
|
|
33
|
+
/>
|
|
34
|
+
<View style={styles.keyGroupContainer}>
|
|
35
|
+
{keyboardGroups.map((keyGroup, index) => (
|
|
36
|
+
<KeysList
|
|
37
|
+
key={index}
|
|
38
|
+
keys={keyGroup}
|
|
39
|
+
numOfRows={1}
|
|
40
|
+
{...props}
|
|
41
|
+
style={{
|
|
42
|
+
option: {
|
|
43
|
+
text: styles.keysText,
|
|
44
|
+
container: styles.keyContainer,
|
|
45
|
+
button: styles.keyButton,
|
|
46
|
+
},
|
|
47
|
+
}}
|
|
48
|
+
/>
|
|
49
|
+
))}
|
|
52
50
|
</View>
|
|
53
51
|
</View>
|
|
54
52
|
)
|
|
@@ -56,17 +54,14 @@ export const UnitTabs = ({ activeTab, tabs, onTabChange, ...props }: UnitTabsPro
|
|
|
56
54
|
|
|
57
55
|
const styles = StyleSheet.create({
|
|
58
56
|
container: {
|
|
59
|
-
width: 283,
|
|
60
57
|
flex: 1,
|
|
61
|
-
},
|
|
62
|
-
tabsContainer: {
|
|
63
58
|
gap: 16,
|
|
64
|
-
flex: 1,
|
|
65
59
|
},
|
|
66
60
|
tabs: {
|
|
67
61
|
borderBottomWidth: 1,
|
|
68
62
|
borderBottomColor: COLORS.NEUTRAL_3,
|
|
69
63
|
paddingTop: 0,
|
|
64
|
+
gap: 24,
|
|
70
65
|
},
|
|
71
66
|
keyGroupContainer: {
|
|
72
67
|
gap: 8,
|
|
@@ -10,22 +10,18 @@ export const useUnitTabs = () => {
|
|
|
10
10
|
() => [
|
|
11
11
|
{
|
|
12
12
|
title: t('keyboard.length'),
|
|
13
|
-
style: { paddingLeft: 0, paddingRight: 32, marginRight: -16 },
|
|
14
13
|
key: KeyboardUnitsGroupType.LENGTH,
|
|
15
14
|
},
|
|
16
15
|
{
|
|
17
16
|
title: t('keyboard.area'),
|
|
18
|
-
style: { paddingHorizontal: 10 },
|
|
19
17
|
key: KeyboardUnitsGroupType.AREA,
|
|
20
18
|
},
|
|
21
19
|
{
|
|
22
20
|
title: t('keyboard.volume'),
|
|
23
|
-
style: { paddingHorizontal: 10 },
|
|
24
21
|
key: KeyboardUnitsGroupType.VOLUME,
|
|
25
22
|
},
|
|
26
23
|
{
|
|
27
24
|
title: t('keyboard.weight'),
|
|
28
|
-
style: { paddingHorizontal: 10, paddingRight: 0 },
|
|
29
25
|
key: KeyboardUnitsGroupType.WEIGHT,
|
|
30
26
|
},
|
|
31
27
|
],
|
|
@@ -20,15 +20,3 @@ export const getLayoutConfigStyles = (characterType?: number, isMobile?: boolean
|
|
|
20
20
|
|
|
21
21
|
return LAYOUT_STYLES_CONFIG.DEFAULT
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
export const slideInAnimationSettings = {
|
|
25
|
-
toValue: KEYBOARD_SLIDE_DISTANCE,
|
|
26
|
-
stiffness: 720,
|
|
27
|
-
damping: 60,
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export const slideOutAnimationSettings = {
|
|
31
|
-
toValue: 0,
|
|
32
|
-
stiffness: 320,
|
|
33
|
-
damping: 40,
|
|
34
|
-
}
|
|
@@ -7,33 +7,34 @@ import { YenIcon } from '../../../../shared/icons/keyboard/YenIcon/YenIcon'
|
|
|
7
7
|
import { CentIcon } from '../../../../shared/icons/keyboard/CentIcon/CentIcon'
|
|
8
8
|
import { DEFAULT_KEY_ICON_PROPS } from '../../constants/constants'
|
|
9
9
|
import React from 'react'
|
|
10
|
-
import { IS_MOBILE } from '@magmamath/react-native-ui'
|
|
10
|
+
import { IS_MOBILE, IS_WEB } from '@magmamath/react-native-ui'
|
|
11
11
|
import { createMathKeysGroup } from './helpers'
|
|
12
12
|
|
|
13
13
|
const BASE_TEXT_STYLE = {
|
|
14
14
|
fontSize: 14,
|
|
15
|
-
fontWeight: 700
|
|
16
|
-
}
|
|
15
|
+
fontWeight: 700,
|
|
16
|
+
} as const
|
|
17
17
|
|
|
18
18
|
const STYLE_PRESETS = {
|
|
19
19
|
SMALL: {
|
|
20
|
-
button: { width:
|
|
21
|
-
container: { flexBasis:
|
|
20
|
+
button: { width: IS_WEB ? 40 : 44 },
|
|
21
|
+
container: IS_MOBILE ? { flexBasis: 48 } : undefined,
|
|
22
22
|
text: BASE_TEXT_STYLE,
|
|
23
23
|
},
|
|
24
24
|
MEDIUM: {
|
|
25
|
-
button: { width:
|
|
26
|
-
container: { flexBasis:
|
|
25
|
+
button: { width: IS_WEB ? 45 : 51 },
|
|
26
|
+
container: IS_MOBILE ? { flexBasis: 55 } : undefined,
|
|
27
27
|
text: BASE_TEXT_STYLE,
|
|
28
28
|
},
|
|
29
29
|
LARGE: {
|
|
30
|
-
button: { width:
|
|
31
|
-
container: { flexBasis:
|
|
30
|
+
button: { width: IS_WEB ? 48 : 55 },
|
|
31
|
+
container: IS_MOBILE ? { flexBasis: 59 } : undefined,
|
|
32
|
+
|
|
32
33
|
text: BASE_TEXT_STYLE,
|
|
33
34
|
},
|
|
34
35
|
XL: {
|
|
35
|
-
button: { width:
|
|
36
|
-
container: { flexBasis:
|
|
36
|
+
button: { width: IS_WEB ? 52 : 54 },
|
|
37
|
+
container: IS_MOBILE ? { flexBasis: 60 } : undefined,
|
|
37
38
|
text: BASE_TEXT_STYLE,
|
|
38
39
|
},
|
|
39
40
|
}
|
|
@@ -208,7 +209,7 @@ export const MATH_AREA_UNITS = createMathKeysGroup({
|
|
|
208
209
|
mathliveValue: '\\mathrm{mi}^2',
|
|
209
210
|
katexValue: 'mi^2',
|
|
210
211
|
mathQuillValue: 'mi^{2}',
|
|
211
|
-
style: STYLE_PRESETS.
|
|
212
|
+
style: STYLE_PRESETS.MEDIUM,
|
|
212
213
|
},
|
|
213
214
|
SQUARE_YARD: {
|
|
214
215
|
label: 'yd²',
|
|
@@ -324,7 +325,7 @@ export const MATH_VOLUME_UNITS = createMathKeysGroup({
|
|
|
324
325
|
mathliveValue: '\\mathrm{cup}',
|
|
325
326
|
katexValue: 'cup',
|
|
326
327
|
mathQuillValue: '\\cup',
|
|
327
|
-
style: STYLE_PRESETS.
|
|
328
|
+
style: STYLE_PRESETS.LARGE,
|
|
328
329
|
},
|
|
329
330
|
GAL: {
|
|
330
331
|
label: 'gal',
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["lib/types/requests.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["lib/types/requests.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type WithAbortSignal<T> = T & { signal?: AbortSignal }
|