@magmamath/students-features 0.9.8-rc.2 → 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.
Files changed (114) hide show
  1. package/dist/commonjs/features/chatbot/model/t2s.js +3 -4
  2. package/dist/commonjs/features/chatbot/model/t2s.js.map +1 -1
  3. package/dist/commonjs/features/chatbot/types/model.types.js.map +1 -1
  4. package/dist/commonjs/features/keyboard/components/BasicLayout/BasicLayout.js +1 -3
  5. package/dist/commonjs/features/keyboard/components/BasicLayout/BasicLayout.js.map +1 -1
  6. package/dist/commonjs/features/keyboard/components/BasicLayout/TimeBasicLayout.js +1 -1
  7. package/dist/commonjs/features/keyboard/components/Keyboard.js +4 -21
  8. package/dist/commonjs/features/keyboard/components/Keyboard.js.map +1 -1
  9. package/dist/commonjs/features/keyboard/components/KeysList/KeysList.js +3 -4
  10. package/dist/commonjs/features/keyboard/components/KeysList/KeysList.js.map +1 -1
  11. package/dist/commonjs/features/keyboard/components/MainLayout.js +1 -2
  12. package/dist/commonjs/features/keyboard/components/MainLayout.js.map +1 -1
  13. package/dist/commonjs/features/keyboard/components/Numpad/Numpad.js +1 -14
  14. package/dist/commonjs/features/keyboard/components/Numpad/Numpad.js.map +1 -1
  15. package/dist/commonjs/features/keyboard/components/UnitsLayout/UnitTabs.js +25 -31
  16. package/dist/commonjs/features/keyboard/components/UnitsLayout/UnitTabs.js.map +1 -1
  17. package/dist/commonjs/features/keyboard/components/UnitsLayout/UnitsLayout.js.map +1 -1
  18. package/dist/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js +0 -15
  19. package/dist/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js.map +1 -1
  20. package/dist/commonjs/features/keyboard/components/constants.js +1 -11
  21. package/dist/commonjs/features/keyboard/components/constants.js.map +1 -1
  22. package/dist/commonjs/features/keyboard/types/MathKeysGroups/units.js +18 -18
  23. package/dist/commonjs/features/keyboard/types/MathKeysGroups/units.js.map +1 -1
  24. package/dist/module/features/chatbot/model/t2s.js +3 -4
  25. package/dist/module/features/chatbot/model/t2s.js.map +1 -1
  26. package/dist/module/features/chatbot/types/model.types.js.map +1 -1
  27. package/dist/module/features/keyboard/components/BasicLayout/BasicLayout.js +1 -3
  28. package/dist/module/features/keyboard/components/BasicLayout/BasicLayout.js.map +1 -1
  29. package/dist/module/features/keyboard/components/BasicLayout/TimeBasicLayout.js +1 -1
  30. package/dist/module/features/keyboard/components/Keyboard.js +6 -23
  31. package/dist/module/features/keyboard/components/Keyboard.js.map +1 -1
  32. package/dist/module/features/keyboard/components/KeysList/KeysList.js +3 -4
  33. package/dist/module/features/keyboard/components/KeysList/KeysList.js.map +1 -1
  34. package/dist/module/features/keyboard/components/MainLayout.js +1 -2
  35. package/dist/module/features/keyboard/components/MainLayout.js.map +1 -1
  36. package/dist/module/features/keyboard/components/Numpad/Numpad.js +1 -14
  37. package/dist/module/features/keyboard/components/Numpad/Numpad.js.map +1 -1
  38. package/dist/module/features/keyboard/components/UnitsLayout/UnitTabs.js +25 -31
  39. package/dist/module/features/keyboard/components/UnitsLayout/UnitTabs.js.map +1 -1
  40. package/dist/module/features/keyboard/components/UnitsLayout/UnitsLayout.js.map +1 -1
  41. package/dist/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js +0 -15
  42. package/dist/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js.map +1 -1
  43. package/dist/module/features/keyboard/components/constants.js +0 -10
  44. package/dist/module/features/keyboard/components/constants.js.map +1 -1
  45. package/dist/module/features/keyboard/types/MathKeysGroups/units.js +19 -19
  46. package/dist/module/features/keyboard/types/MathKeysGroups/units.js.map +1 -1
  47. package/dist/typescript/commonjs/features/chatbot/model/ChatbotApi.d.ts +2 -2
  48. package/dist/typescript/commonjs/features/chatbot/model/ChatbotApi.d.ts.map +1 -1
  49. package/dist/typescript/commonjs/features/chatbot/model/t2s.d.ts.map +1 -1
  50. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts +1 -7
  51. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts.map +1 -1
  52. package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts +4 -5
  53. package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts.map +1 -1
  54. package/dist/typescript/commonjs/features/keyboard/components/Keyboard.d.ts +1 -2
  55. package/dist/typescript/commonjs/features/keyboard/components/Keyboard.d.ts.map +1 -1
  56. package/dist/typescript/commonjs/features/keyboard/components/KeysList/KeysList.d.ts +1 -4
  57. package/dist/typescript/commonjs/features/keyboard/components/KeysList/KeysList.d.ts.map +1 -1
  58. package/dist/typescript/commonjs/features/keyboard/components/KeysList/helpers.d.ts +0 -2
  59. package/dist/typescript/commonjs/features/keyboard/components/KeysList/helpers.d.ts.map +1 -1
  60. package/dist/typescript/commonjs/features/keyboard/components/Numpad/Numpad.d.ts.map +1 -1
  61. package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/UnitTabs.d.ts.map +1 -1
  62. package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/UnitsLayout.d.ts.map +1 -1
  63. package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts +2 -26
  64. package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts.map +1 -1
  65. package/dist/typescript/commonjs/features/keyboard/components/constants.d.ts +0 -10
  66. package/dist/typescript/commonjs/features/keyboard/components/constants.d.ts.map +1 -1
  67. package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/units.d.ts +208 -208
  68. package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/units.d.ts.map +1 -1
  69. package/dist/typescript/module/features/chatbot/model/ChatbotApi.d.ts +2 -2
  70. package/dist/typescript/module/features/chatbot/model/ChatbotApi.d.ts.map +1 -1
  71. package/dist/typescript/module/features/chatbot/model/t2s.d.ts.map +1 -1
  72. package/dist/typescript/module/features/chatbot/types/api.types.d.ts +1 -7
  73. package/dist/typescript/module/features/chatbot/types/api.types.d.ts.map +1 -1
  74. package/dist/typescript/module/features/chatbot/types/model.types.d.ts +4 -5
  75. package/dist/typescript/module/features/chatbot/types/model.types.d.ts.map +1 -1
  76. package/dist/typescript/module/features/keyboard/components/Keyboard.d.ts +1 -2
  77. package/dist/typescript/module/features/keyboard/components/Keyboard.d.ts.map +1 -1
  78. package/dist/typescript/module/features/keyboard/components/KeysList/KeysList.d.ts +1 -4
  79. package/dist/typescript/module/features/keyboard/components/KeysList/KeysList.d.ts.map +1 -1
  80. package/dist/typescript/module/features/keyboard/components/KeysList/helpers.d.ts +0 -2
  81. package/dist/typescript/module/features/keyboard/components/KeysList/helpers.d.ts.map +1 -1
  82. package/dist/typescript/module/features/keyboard/components/Numpad/Numpad.d.ts.map +1 -1
  83. package/dist/typescript/module/features/keyboard/components/UnitsLayout/UnitTabs.d.ts.map +1 -1
  84. package/dist/typescript/module/features/keyboard/components/UnitsLayout/UnitsLayout.d.ts.map +1 -1
  85. package/dist/typescript/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts +2 -26
  86. package/dist/typescript/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts.map +1 -1
  87. package/dist/typescript/module/features/keyboard/components/constants.d.ts +0 -10
  88. package/dist/typescript/module/features/keyboard/components/constants.d.ts.map +1 -1
  89. package/dist/typescript/module/features/keyboard/types/MathKeysGroups/units.d.ts +208 -208
  90. package/dist/typescript/module/features/keyboard/types/MathKeysGroups/units.d.ts.map +1 -1
  91. package/package.json +1 -1
  92. package/src/features/chatbot/model/t2s.ts +2 -3
  93. package/src/features/chatbot/types/api.types.ts +1 -10
  94. package/src/features/chatbot/types/model.types.ts +4 -9
  95. package/src/features/keyboard/components/BasicLayout/BasicLayout.tsx +1 -3
  96. package/src/features/keyboard/components/BasicLayout/TimeBasicLayout.tsx +1 -1
  97. package/src/features/keyboard/components/Keyboard.tsx +7 -35
  98. package/src/features/keyboard/components/KeysList/KeysList.tsx +2 -4
  99. package/src/features/keyboard/components/MainLayout.tsx +1 -2
  100. package/src/features/keyboard/components/Numpad/Numpad.tsx +1 -18
  101. package/src/features/keyboard/components/UnitsLayout/UnitTabs.tsx +24 -29
  102. package/src/features/keyboard/components/UnitsLayout/UnitsLayout.tsx +1 -0
  103. package/src/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.ts +0 -4
  104. package/src/features/keyboard/components/constants.ts +0 -12
  105. package/src/features/keyboard/types/MathKeysGroups/units.tsx +14 -13
  106. package/dist/commonjs/lib/types/requests.js +0 -2
  107. package/dist/commonjs/lib/types/requests.js.map +0 -1
  108. package/dist/module/lib/types/requests.js +0 -2
  109. package/dist/module/lib/types/requests.js.map +0 -1
  110. package/dist/typescript/commonjs/lib/types/requests.d.ts +0 -4
  111. package/dist/typescript/commonjs/lib/types/requests.d.ts.map +0 -1
  112. package/dist/typescript/module/lib/types/requests.d.ts +0 -4
  113. package/dist/typescript/module/lib/types/requests.d.ts.map +0 -1
  114. 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;AAgCzB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqC9B,CAAA;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0E5B,CAAA;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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A;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkE1B,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magmamath/students-features",
3
- "version": "0.9.8-rc.2",
3
+ "version": "0.9.9",
4
4
  "description": "Magmamath features library",
5
5
  "source": "src/index.ts",
6
6
  "main": "src/index.ts",
@@ -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.audioContent === 'string') {
94
- audioPath = `data:audio/mpeg;base64,${response.audioContent}`
92
+ if (typeof response === 'string') {
93
+ audioPath = `data:audio/mpeg;base64,${response}`
95
94
  } else {
96
95
  audioPath = response?.audioContent ?? ''
97
96
  }
@@ -77,18 +77,9 @@ export type GoogleText2SpeechPayload = {
77
77
  pitch: number
78
78
  speakingRate: number
79
79
  }
80
- enableTimePointing?: string[]
81
80
  }
82
81
 
83
- export type Timepoint = {
84
- markName: string
85
- timeSeconds: number
86
- }
87
-
88
- export type GoogleText2SpeechResponse = {
89
- audioContent?: string
90
- timepoints?: Timepoint[]
91
- }
82
+ export type GoogleText2SpeechResponse = string | undefined | { audioContent?: string }
92
83
 
93
84
  export type ChatHintPayload = {
94
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: WithAbortSignal<SendMessagePayload>) => Promise<SendMessageResponse>
32
- postMessage: (props: WithAbortSignal<PostMessagePayload>) => Promise<PostMessageResponse>
33
- postTranslateText: (
34
- props: WithAbortSignal<GoogleTranslatePayload>,
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
- display: 'flex',
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
  })
@@ -31,7 +31,7 @@ export const TimeBasicLayout = (props: KeyboardLayoutProps) => {
31
31
 
32
32
  const styles = StyleSheet.create({
33
33
  button: {
34
- width: IS_MOBILE ? 50 : 45,
34
+ width: IS_MOBILE ? 51 : 45,
35
35
  },
36
36
  container: {
37
37
  flexBasis: IS_MOBILE ? 55 : 'auto',
@@ -1,31 +1,24 @@
1
- import React, { useEffect, useMemo, useRef } from 'react'
2
- import { Animated, StyleProp, StyleSheet, useWindowDimensions, ViewStyle } from 'react-native'
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, isVisible = true, ...props }: KeyboardProps) => {
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
- styles.container,
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: [styles.container, style?.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: {
@@ -74,7 +74,6 @@ export const MainLayout = ({
74
74
  const styles = StyleSheet.create({
75
75
  container: {
76
76
  flexDirection: 'row',
77
- alignItems: 'flex-start',
78
- justifyContent: 'space-between',
77
+ flex: 1,
79
78
  },
80
79
  })
@@ -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
- <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>
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,
@@ -46,6 +46,7 @@ export const UnitsLayout = ({ onLayoutChange, ...props }: KeyboardLayoutProps) =
46
46
  ]}
47
47
  />
48
48
  )}
49
+
49
50
  {selectedLayout === SelectedLayout.UNITS ? (
50
51
  <UnitTabs tabs={tabs} activeTab={activeTab} onTabChange={setActiveTab} {...props} />
51
52
  ) : (
@@ -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 as const,
16
- }
15
+ fontWeight: 700,
16
+ } as const
17
17
 
18
18
  const STYLE_PRESETS = {
19
19
  SMALL: {
20
- button: { width: IS_MOBILE ? 44 : 40 },
21
- container: { flexBasis: IS_MOBILE ? 48 : undefined },
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: IS_MOBILE ? 50 : 45 },
26
- container: { flexBasis: IS_MOBILE ? 54 : undefined },
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: IS_MOBILE ? 54 : 48 },
31
- container: { flexBasis: IS_MOBILE ? 58 : undefined },
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: IS_MOBILE ? 56 : 52 },
36
- container: { flexBasis: IS_MOBILE ? 60 : undefined },
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.SMALL,
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.MEDIUM,
328
+ style: STYLE_PRESETS.LARGE,
328
329
  },
329
330
  GAL: {
330
331
  label: 'gal',
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=requests.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["lib/types/requests.ts"],"mappings":"","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=requests.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["lib/types/requests.ts"],"mappings":"","ignoreList":[]}
@@ -1,4 +0,0 @@
1
- export type WithAbortSignal<T> = T & {
2
- signal?: AbortSignal;
3
- };
4
- //# sourceMappingURL=requests.d.ts.map
@@ -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,4 +0,0 @@
1
- export type WithAbortSignal<T> = T & {
2
- signal?: AbortSignal;
3
- };
4
- //# sourceMappingURL=requests.d.ts.map
@@ -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 }