@magmamath/students-features 0.9.0-rc4 → 0.9.0-rc6

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 (115) hide show
  1. package/dist/commonjs/features/keyboard/components/AlgebraLayout/AlgebraLayout.js +8 -2
  2. package/dist/commonjs/features/keyboard/components/AlgebraLayout/AlgebraLayout.js.map +1 -1
  3. package/dist/commonjs/features/keyboard/components/BasicExtendedLayout/BasicExtendedLayout.js +14 -5
  4. package/dist/commonjs/features/keyboard/components/BasicExtendedLayout/BasicExtendedLayout.js.map +1 -1
  5. package/dist/commonjs/features/keyboard/components/BasicExtendedPlusLayout/BasicExtendedPlusLayout.js +14 -3
  6. package/dist/commonjs/features/keyboard/components/BasicExtendedPlusLayout/BasicExtendedPlusLayout.js.map +1 -1
  7. package/dist/commonjs/features/keyboard/components/BasicLayout/BasicLayout.js +8 -1
  8. package/dist/commonjs/features/keyboard/components/BasicLayout/BasicLayout.js.map +1 -1
  9. package/dist/commonjs/features/keyboard/components/BasicLayout/CurrencyBasicLayout.js +8 -1
  10. package/dist/commonjs/features/keyboard/components/BasicLayout/CurrencyBasicLayout.js.map +1 -1
  11. package/dist/commonjs/features/keyboard/components/BasicLayout/TimeBasicLayout.js +8 -2
  12. package/dist/commonjs/features/keyboard/components/BasicLayout/TimeBasicLayout.js.map +1 -1
  13. package/dist/commonjs/features/keyboard/components/BasicLayout/keyboardGroup.js +1 -1
  14. package/dist/commonjs/features/keyboard/components/BasicLayout/keyboardGroup.js.map +1 -1
  15. package/dist/commonjs/features/keyboard/components/Keyboard.js +2 -1
  16. package/dist/commonjs/features/keyboard/components/Keyboard.js.map +1 -1
  17. package/dist/commonjs/features/keyboard/components/KeysList/KeysList.js +2 -15
  18. package/dist/commonjs/features/keyboard/components/KeysList/KeysList.js.map +1 -1
  19. package/dist/commonjs/features/keyboard/components/Numpad/Numpad.js +6 -1
  20. package/dist/commonjs/features/keyboard/components/Numpad/Numpad.js.map +1 -1
  21. package/dist/commonjs/features/keyboard/components/UnitsLayout/UnitTabs.js +7 -1
  22. package/dist/commonjs/features/keyboard/components/UnitsLayout/UnitTabs.js.map +1 -1
  23. package/dist/commonjs/features/keyboard/components/UnitsLayout/UnitsLayout.js +16 -2
  24. package/dist/commonjs/features/keyboard/components/UnitsLayout/UnitsLayout.js.map +1 -1
  25. package/dist/commonjs/features/keyboard/constants/keysValues.js +1 -1
  26. package/dist/commonjs/features/keyboard/constants/keysValues.js.map +1 -1
  27. package/dist/commonjs/features/keyboard/types/MathKeysGroups/calculusOperators.js +3 -3
  28. package/dist/commonjs/features/keyboard/types/MathKeysGroups/calculusOperators.js.map +1 -1
  29. package/dist/commonjs/features/keyboard/types/MathKeysGroups/specialOperators.js +2 -1
  30. package/dist/commonjs/features/keyboard/types/MathKeysGroups/specialOperators.js.map +1 -1
  31. package/dist/commonjs/features/keyboard/types/MathKeysGroups/trigonometric.js +7 -7
  32. package/dist/commonjs/features/keyboard/types/MathKeysGroups/units.js +5 -5
  33. package/dist/module/features/keyboard/components/AlgebraLayout/AlgebraLayout.js +9 -3
  34. package/dist/module/features/keyboard/components/AlgebraLayout/AlgebraLayout.js.map +1 -1
  35. package/dist/module/features/keyboard/components/BasicExtendedLayout/BasicExtendedLayout.js +14 -5
  36. package/dist/module/features/keyboard/components/BasicExtendedLayout/BasicExtendedLayout.js.map +1 -1
  37. package/dist/module/features/keyboard/components/BasicExtendedPlusLayout/BasicExtendedPlusLayout.js +14 -3
  38. package/dist/module/features/keyboard/components/BasicExtendedPlusLayout/BasicExtendedPlusLayout.js.map +1 -1
  39. package/dist/module/features/keyboard/components/BasicLayout/BasicLayout.js +8 -1
  40. package/dist/module/features/keyboard/components/BasicLayout/BasicLayout.js.map +1 -1
  41. package/dist/module/features/keyboard/components/BasicLayout/CurrencyBasicLayout.js +8 -1
  42. package/dist/module/features/keyboard/components/BasicLayout/CurrencyBasicLayout.js.map +1 -1
  43. package/dist/module/features/keyboard/components/BasicLayout/TimeBasicLayout.js +8 -2
  44. package/dist/module/features/keyboard/components/BasicLayout/TimeBasicLayout.js.map +1 -1
  45. package/dist/module/features/keyboard/components/BasicLayout/keyboardGroup.js +1 -1
  46. package/dist/module/features/keyboard/components/BasicLayout/keyboardGroup.js.map +1 -1
  47. package/dist/module/features/keyboard/components/Keyboard.js +2 -1
  48. package/dist/module/features/keyboard/components/Keyboard.js.map +1 -1
  49. package/dist/module/features/keyboard/components/KeysList/KeysList.js +2 -15
  50. package/dist/module/features/keyboard/components/KeysList/KeysList.js.map +1 -1
  51. package/dist/module/features/keyboard/components/Numpad/Numpad.js +7 -1
  52. package/dist/module/features/keyboard/components/Numpad/Numpad.js.map +1 -1
  53. package/dist/module/features/keyboard/components/UnitsLayout/UnitTabs.js +8 -2
  54. package/dist/module/features/keyboard/components/UnitsLayout/UnitTabs.js.map +1 -1
  55. package/dist/module/features/keyboard/components/UnitsLayout/UnitsLayout.js +17 -3
  56. package/dist/module/features/keyboard/components/UnitsLayout/UnitsLayout.js.map +1 -1
  57. package/dist/module/features/keyboard/constants/keysValues.js +2 -2
  58. package/dist/module/features/keyboard/constants/keysValues.js.map +1 -1
  59. package/dist/module/features/keyboard/types/MathKeysGroups/calculusOperators.js +3 -3
  60. package/dist/module/features/keyboard/types/MathKeysGroups/calculusOperators.js.map +1 -1
  61. package/dist/module/features/keyboard/types/MathKeysGroups/specialOperators.js +2 -1
  62. package/dist/module/features/keyboard/types/MathKeysGroups/specialOperators.js.map +1 -1
  63. package/dist/module/features/keyboard/types/MathKeysGroups/trigonometric.js +7 -7
  64. package/dist/module/features/keyboard/types/MathKeysGroups/units.js +5 -5
  65. package/dist/typescript/commonjs/features/keyboard/components/AlgebraLayout/AlgebraLayout.d.ts.map +1 -1
  66. package/dist/typescript/commonjs/features/keyboard/components/BasicExtendedLayout/BasicExtendedLayout.d.ts.map +1 -1
  67. package/dist/typescript/commonjs/features/keyboard/components/BasicExtendedPlusLayout/BasicExtendedPlusLayout.d.ts.map +1 -1
  68. package/dist/typescript/commonjs/features/keyboard/components/BasicLayout/BasicLayout.d.ts.map +1 -1
  69. package/dist/typescript/commonjs/features/keyboard/components/BasicLayout/CurrencyBasicLayout.d.ts.map +1 -1
  70. package/dist/typescript/commonjs/features/keyboard/components/BasicLayout/TimeBasicLayout.d.ts.map +1 -1
  71. package/dist/typescript/commonjs/features/keyboard/components/Keyboard.d.ts +2 -4
  72. package/dist/typescript/commonjs/features/keyboard/components/Keyboard.d.ts.map +1 -1
  73. package/dist/typescript/commonjs/features/keyboard/components/KeysList/KeysList.d.ts +1 -1
  74. package/dist/typescript/commonjs/features/keyboard/components/KeysList/KeysList.d.ts.map +1 -1
  75. package/dist/typescript/commonjs/features/keyboard/components/Numpad/Numpad.d.ts.map +1 -1
  76. package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/UnitTabs.d.ts.map +1 -1
  77. package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/UnitsLayout.d.ts.map +1 -1
  78. package/dist/typescript/commonjs/features/keyboard/constants/keysValues.d.ts.map +1 -1
  79. package/dist/typescript/commonjs/features/keyboard/types.d.ts +1 -2
  80. package/dist/typescript/commonjs/features/keyboard/types.d.ts.map +1 -1
  81. package/dist/typescript/module/features/keyboard/components/AlgebraLayout/AlgebraLayout.d.ts.map +1 -1
  82. package/dist/typescript/module/features/keyboard/components/BasicExtendedLayout/BasicExtendedLayout.d.ts.map +1 -1
  83. package/dist/typescript/module/features/keyboard/components/BasicExtendedPlusLayout/BasicExtendedPlusLayout.d.ts.map +1 -1
  84. package/dist/typescript/module/features/keyboard/components/BasicLayout/BasicLayout.d.ts.map +1 -1
  85. package/dist/typescript/module/features/keyboard/components/BasicLayout/CurrencyBasicLayout.d.ts.map +1 -1
  86. package/dist/typescript/module/features/keyboard/components/BasicLayout/TimeBasicLayout.d.ts.map +1 -1
  87. package/dist/typescript/module/features/keyboard/components/Keyboard.d.ts +2 -4
  88. package/dist/typescript/module/features/keyboard/components/Keyboard.d.ts.map +1 -1
  89. package/dist/typescript/module/features/keyboard/components/KeysList/KeysList.d.ts +1 -1
  90. package/dist/typescript/module/features/keyboard/components/KeysList/KeysList.d.ts.map +1 -1
  91. package/dist/typescript/module/features/keyboard/components/Numpad/Numpad.d.ts.map +1 -1
  92. package/dist/typescript/module/features/keyboard/components/UnitsLayout/UnitTabs.d.ts.map +1 -1
  93. package/dist/typescript/module/features/keyboard/components/UnitsLayout/UnitsLayout.d.ts.map +1 -1
  94. package/dist/typescript/module/features/keyboard/constants/keysValues.d.ts.map +1 -1
  95. package/dist/typescript/module/features/keyboard/types.d.ts +1 -2
  96. package/dist/typescript/module/features/keyboard/types.d.ts.map +1 -1
  97. package/package.json +1 -1
  98. package/src/features/keyboard/components/AlgebraLayout/AlgebraLayout.tsx +3 -2
  99. package/src/features/keyboard/components/BasicExtendedLayout/BasicExtendedLayout.tsx +14 -5
  100. package/src/features/keyboard/components/BasicExtendedPlusLayout/BasicExtendedPlusLayout.tsx +14 -4
  101. package/src/features/keyboard/components/BasicLayout/BasicLayout.tsx +8 -1
  102. package/src/features/keyboard/components/BasicLayout/CurrencyBasicLayout.tsx +8 -1
  103. package/src/features/keyboard/components/BasicLayout/TimeBasicLayout.tsx +5 -1
  104. package/src/features/keyboard/components/BasicLayout/keyboardGroup.ts +1 -1
  105. package/src/features/keyboard/components/Keyboard.tsx +3 -4
  106. package/src/features/keyboard/components/KeysList/KeysList.tsx +5 -15
  107. package/src/features/keyboard/components/Numpad/Numpad.tsx +6 -1
  108. package/src/features/keyboard/components/UnitsLayout/UnitTabs.tsx +6 -2
  109. package/src/features/keyboard/components/UnitsLayout/UnitsLayout.tsx +11 -1
  110. package/src/features/keyboard/constants/keysValues.ts +2 -1
  111. package/src/features/keyboard/types/MathKeysGroups/calculusOperators.tsx +3 -3
  112. package/src/features/keyboard/types/MathKeysGroups/specialOperators.tsx +1 -1
  113. package/src/features/keyboard/types/MathKeysGroups/trigonometric.tsx +7 -7
  114. package/src/features/keyboard/types/MathKeysGroups/units.tsx +5 -5
  115. package/src/features/keyboard/types.ts +1 -2
@@ -1,18 +1,28 @@
1
1
  import React from 'react'
2
2
  import { KeysList } from '../KeysList/KeysList'
3
3
  import { StyleSheet, View } from 'react-native'
4
- import { KeyboardLayoutProps } from '../../types'
5
- import { MATH_ENTRY_BASIC_US_EXTENDED } from './keyboardGroups'
4
+ import { KeyboardLayoutProps, KeyboardType } from '../../types'
5
+ import { IS_MOBILE } from '@magmamath/react-native-ui'
6
+ import { useText } from '../../../../shared/translation'
7
+ import { KEYBOARD_GROUPS_BY_LOCALE } from '../../constants/keysValues'
8
+ import { Locale } from '@magmamath/students-features'
6
9
 
7
10
  export const BasicExtendedLayout = (props: KeyboardLayoutProps) => {
11
+ const t = useText()
12
+ const keysGroup = KEYBOARD_GROUPS_BY_LOCALE[t('locale') as Locale][KeyboardType.BasicExtended]
13
+
8
14
  return (
9
15
  <View style={styles.container}>
10
16
  <KeysList
11
- keys={MATH_ENTRY_BASIC_US_EXTENDED.keys}
17
+ keys={keysGroup.keys}
12
18
  numOfRows={3}
13
19
  style={{
14
20
  container: styles.keysContainer,
15
- option: { button: styles.option, text: styles.text },
21
+ option: {
22
+ button: styles.option,
23
+ text: styles.text,
24
+ ...(IS_MOBILE && { container: IS_MOBILE && { flexBasis: 50 } }),
25
+ },
16
26
  }}
17
27
  {...props}
18
28
  />
@@ -36,5 +46,4 @@ const styles = StyleSheet.create({
36
46
  text: {
37
47
  fontStyle: 'italic',
38
48
  },
39
- optionContainer: {},
40
49
  })
@@ -1,18 +1,28 @@
1
1
  import React from 'react'
2
2
  import { StyleSheet, View } from 'react-native'
3
3
  import { KeysList } from '../KeysList/KeysList'
4
- import { MATH_ENTRY_BASIC_EXTENDED_PLUS } from './keyboardGroups'
5
- import { KeyboardLayoutProps } from '../../types'
4
+ import { KeyboardLayoutProps, KeyboardType } from '../../types'
5
+ import { IS_MOBILE } from '@magmamath/react-native-ui'
6
+ import { useText } from '../../../../shared/translation'
7
+ import { KEYBOARD_GROUPS_BY_LOCALE } from '../../constants/keysValues'
8
+ import { Locale } from '@magmamath/students-features'
6
9
 
7
10
  export const BasicExtendedPlusLayout = (props: KeyboardLayoutProps) => {
11
+ const t = useText()
12
+ const keysGroup = KEYBOARD_GROUPS_BY_LOCALE[t('locale') as Locale][KeyboardType.BasicExtendedPlus]
13
+
8
14
  return (
9
15
  <View style={styles.container}>
10
16
  <KeysList
11
- keys={MATH_ENTRY_BASIC_EXTENDED_PLUS.keys}
17
+ keys={keysGroup.keys}
12
18
  numOfRows={3}
13
19
  style={{
14
20
  container: styles.keysContainer,
15
- option: { button: styles.option, text: styles.text },
21
+ option: {
22
+ button: styles.option,
23
+ text: styles.text,
24
+ ...(IS_MOBILE && { container: { flexBasis: 50, maxWidth: 50 } }),
25
+ },
16
26
  }}
17
27
  {...props}
18
28
  />
@@ -3,6 +3,7 @@ import { KeysList } from '../KeysList/KeysList'
3
3
  import { StyleSheet, View } from 'react-native'
4
4
  import { KeyboardLayoutProps } from '../../types'
5
5
  import { MATH_ENTRY_BASIC_KEYBOARD_GROUP } from './keyboardGroup'
6
+ import { IS_MOBILE } from '@magmamath/react-native-ui'
6
7
 
7
8
  export const BasicLayout = (props: KeyboardLayoutProps & PropsWithChildren) => {
8
9
  const keys = props.children
@@ -14,7 +15,13 @@ export const BasicLayout = (props: KeyboardLayoutProps & PropsWithChildren) => {
14
15
  keys={keys}
15
16
  numOfRows={2}
16
17
  {...props}
17
- style={{ container: styles.keysContainer, option: { button: styles.keyOption } }}
18
+ style={{
19
+ container: styles.keysContainer,
20
+ option: {
21
+ button: styles.keyOption,
22
+ ...(IS_MOBILE && { container: { flexBasis: 45, maxWidth: 45 } }),
23
+ },
24
+ }}
18
25
  />
19
26
  {props.children || null}
20
27
  </View>
@@ -5,6 +5,7 @@ import { BasicLayout } from './BasicLayout'
5
5
  import { KeyboardLayoutProps, KeyboardType } from '../../types'
6
6
  import { Locale, useText } from '../../../../shared/translation'
7
7
  import { KEYBOARD_GROUPS_BY_LOCALE } from '../../constants/keysValues'
8
+ import { IS_MOBILE } from '@magmamath/react-native-ui'
8
9
 
9
10
  export const CurrencyBasicLayout = (props: KeyboardLayoutProps) => {
10
11
  const t = useText()
@@ -15,7 +16,13 @@ export const CurrencyBasicLayout = (props: KeyboardLayoutProps) => {
15
16
  <KeysList
16
17
  keys={keysGroup.keys}
17
18
  numOfRows={keysGroup.keys.length}
18
- style={{ container: styles.keysContainer, option: { text: styles.optionText } }}
19
+ style={{
20
+ container: styles.keysContainer,
21
+ option: {
22
+ text: styles.optionText,
23
+ ...(IS_MOBILE && { container: { flexBasis: 45, maxWidth: 45 } }),
24
+ },
25
+ }}
19
26
  {...props}
20
27
  />
21
28
  </BasicLayout>
@@ -5,6 +5,7 @@ import { BasicLayout } from './BasicLayout'
5
5
  import { KeyboardLayoutProps, KeyboardType } from '../../types'
6
6
  import { useText, Locale } from '../../../../shared/translation'
7
7
  import { KEYBOARD_GROUPS_BY_LOCALE } from '../../constants/keysValues'
8
+ import { IS_MOBILE } from '@magmamath/react-native-ui'
8
9
 
9
10
  export const TimeBasicLayout = (props: KeyboardLayoutProps) => {
10
11
  const t = useText()
@@ -16,7 +17,10 @@ export const TimeBasicLayout = (props: KeyboardLayoutProps) => {
16
17
  keys={keysGroup.keys}
17
18
  numOfRows={keysGroup.numOfRows || keysGroup.keys.length}
18
19
  style={{
19
- option: { container: styles.optionContainer, text: styles.keysText },
20
+ option: {
21
+ text: styles.keysText,
22
+ ...(IS_MOBILE && { container: { flexBasis: 45, maxWidth: 45 } }),
23
+ },
20
24
  container: styles.keysContainer,
21
25
  }}
22
26
  {...props}
@@ -35,7 +35,7 @@ export const MATH_TIME_US_KEYBOARD_GROUP: KeyboardGroup = {
35
35
 
36
36
  export const MATH_CURRENCY_SW_KEYBOARD_GROUP: KeyboardGroup = {
37
37
  id: 'math-entry-currency-sw',
38
- keys: [MATH_CURRENCY_UNITS.KRONE, MATH_CURRENCY_UNITS.KRONE, MATH_TIME_UNITS.H],
38
+ keys: [MATH_CURRENCY_UNITS.KRONE, MATH_CURRENCY_UNITS.EURO, MATH_CURRENCY_UNITS.POUND],
39
39
  }
40
40
  export const MATH_CURRENCY_UK_KEYBOARD_GROUP: KeyboardGroup = {
41
41
  id: 'math-entry-currency-uk',
@@ -10,15 +10,13 @@ import {
10
10
  import { COLORS, SelectOptionColor } from '@magmamath/react-native-ui'
11
11
  import { Numpad } from './Numpad/Numpad'
12
12
  import { getLayoutByCharType } from '../constants/keyboardLayouts'
13
- import { KeyboardKey, KeyboardKeyValue } from '../types'
13
+ import { KeyboardKeyValue } from '../types'
14
14
 
15
15
  type KeyboardProps = {
16
- onKeyPress: ({ katexValue, mathliveValue }: KeyboardKeyValue) => void
16
+ onKeyPress: ({ katexValue, mathliveValue, isSpecialSymbol }: KeyboardKeyValue) => void
17
17
  characterType?: number
18
18
  style?: StyleProp<ViewStyle>
19
19
  color?: SelectOptionColor
20
- onBackspacePress?: () => void
21
- onSpecialKeyPress?: (value: KeyboardKey) => void
22
20
  visible?: boolean
23
21
  isSpecialButtonsDisabled?: boolean
24
22
  isDisabled?: boolean
@@ -73,5 +71,6 @@ const styles = StyleSheet.create({
73
71
  borderWidth: 1,
74
72
  width: 'auto',
75
73
  overflow: 'hidden',
74
+ minHeight: 155,
76
75
  },
77
76
  })
@@ -7,7 +7,6 @@ import {
7
7
  SelectOptionSize,
8
8
  } from '@magmamath/react-native-ui'
9
9
  import { KeyboardKey, KeyboardLayoutProps } from '../../types'
10
- import { MathSpecialOperator } from '../../types/MathKeysGroups/specialOperators'
11
10
  import { DISABLED_KEYS } from '../../constants/keysValues'
12
11
 
13
12
  type KeysListProps = {
@@ -25,8 +24,6 @@ export const KeysList = ({
25
24
  numOfRows,
26
25
  style,
27
26
  onKeyPress,
28
- onSpecialKeyPress,
29
- onBackspacePress,
30
27
  isSpecialButtonsDisabled,
31
28
  isDisabled,
32
29
  }: KeysListProps) => {
@@ -56,18 +53,11 @@ export const KeysList = ({
56
53
  onOptionChange={(option) => {
57
54
  const key = keys.find((k) => k.katexValue === option.key)
58
55
  if (!key) return
59
- if (key.katexValue === MathSpecialOperator.BACKSPACE.toLowerCase()) {
60
- onBackspacePress?.()
61
- return
62
- }
63
- if (key.isSpecialSymbol) {
64
- onSpecialKeyPress?.({
65
- katexValue: key.katexValue,
66
- mathliveValue: key.mathliveValue,
67
- })
68
- return
69
- }
70
- onKeyPress?.({ katexValue: key.katexValue, mathliveValue: key.mathliveValue })
56
+ onKeyPress?.({
57
+ katexValue: key.katexValue,
58
+ mathliveValue: key.mathliveValue,
59
+ isSpecialSymbol: key.isSpecialSymbol,
60
+ })
71
61
  }}
72
62
  />
73
63
  )
@@ -5,6 +5,7 @@ import { COLORS, SPACING } from '@magmamath/react-native-ui'
5
5
  import { KeyboardLayoutProps, KeyboardType } from '../../types'
6
6
  import { Locale, useText } from '../../../../shared/translation'
7
7
  import { getKeyboardGroup } from '../../helpers'
8
+ import { IS_MOBILE } from '@magmamath/react-native-ui'
8
9
 
9
10
  export const Numpad = (props: KeyboardLayoutProps) => {
10
11
  const t = useText()
@@ -17,7 +18,11 @@ export const Numpad = (props: KeyboardLayoutProps) => {
17
18
  numOfRows={3}
18
19
  style={{
19
20
  container: styles.keysContainer,
20
- option: { text: styles.keyText, button: styles.keyButton },
21
+ option: {
22
+ text: styles.keyText,
23
+ button: styles.keyButton,
24
+ ...(IS_MOBILE && { container: { flexBasis: 45 } }),
25
+ },
21
26
  }}
22
27
  {...props}
23
28
  />
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import { KeysList } from '../KeysList/KeysList'
3
3
  import { StyleSheet, View } from 'react-native'
4
- import { COLORS, TabGroup, TabOptionProps, TabVariant } from '@magmamath/react-native-ui'
4
+ import { COLORS, TabGroup, TabOptionProps, TabVariant, IS_MOBILE } from '@magmamath/react-native-ui'
5
5
  import {
6
6
  KEYBOARD_UNITS_GROUPS_BY_LOCALE,
7
7
  KeyboardUnitsGroupType,
@@ -38,7 +38,11 @@ export const UnitTabs = ({ activeTab, tabs, onTabChange, ...props }: UnitTabsPro
38
38
  numOfRows={1}
39
39
  style={{
40
40
  container: styles.keysContainer,
41
- option: { button: styles.option, text: styles.text },
41
+ option: {
42
+ button: styles.option,
43
+ text: styles.text,
44
+ ...(IS_MOBILE && { container: { flexBasis: 58, maxWidth: 58 } }),
45
+ },
42
46
  }}
43
47
  {...props}
44
48
  />
@@ -4,6 +4,7 @@ import { StyleSheet, View } from 'react-native'
4
4
  import {
5
5
  COLORS,
6
6
  FONT_FAMILY,
7
+ IS_MOBILE,
7
8
  RulerIcon,
8
9
  SelectGroup,
9
10
  SelectOptionSize,
@@ -112,6 +113,8 @@ export const UnitsLayout = (props: KeyboardLayoutProps) => {
112
113
  ]
113
114
  }, [activeTab, selectedLayout])
114
115
 
116
+ console.log('IS_MOBILE', IS_MOBILE)
117
+
115
118
  return (
116
119
  <View style={styles.container}>
117
120
  <SelectGroup
@@ -120,6 +123,7 @@ export const UnitsLayout = (props: KeyboardLayoutProps) => {
120
123
  size={SelectOptionSize.SMALL}
121
124
  style={{
122
125
  container: styles.optionContainer,
126
+ option: { ...(IS_MOBILE && { container: { flexBasis: 45 } }) },
123
127
  }}
124
128
  color={props.color}
125
129
  selectedOptions={[
@@ -143,7 +147,13 @@ export const UnitsLayout = (props: KeyboardLayoutProps) => {
143
147
  keys={basicExtendedKeys.keys}
144
148
  numOfRows={3}
145
149
  {...props}
146
- style={{ container: styles.basicExtendedContainer, option: { button: styles.key } }}
150
+ style={{
151
+ container: styles.basicExtendedContainer,
152
+ option: {
153
+ button: styles.key,
154
+ ...(IS_MOBILE && { container: { flexBasis: 45, maxWidth: 45 } }),
155
+ },
156
+ }}
147
157
  />
148
158
  )}
149
159
  </View>
@@ -1,6 +1,7 @@
1
1
  import { KeyboardGroup, KeyboardKey, KeyboardType } from '../types'
2
2
  import {
3
3
  MATH_CURRENCY_SW_KEYBOARD_GROUP,
4
+ MATH_CURRENCY_UK_KEYBOARD_GROUP,
4
5
  MATH_CURRENCY_US_KEYBOARD_GROUP,
5
6
  MATH_ENTRY_BASIC_KEYBOARD_GROUP,
6
7
  MATH_TIME_SW_KEYBOARD_GROUP,
@@ -60,7 +61,7 @@ export const KEYBOARD_GROUPS_BY_LOCALE: Record<Locale, Record<KeyboardType, Keyb
60
61
  ...MATH_ENTRY_LENGTH_UNITS_US_KEYBOARD_GROUPS,
61
62
  keys: MATH_ENTRY_LENGTH_UNITS_US_KEYBOARD_GROUPS.keys[0],
62
63
  },
63
- [KeyboardType.BasicCurrency]: MATH_CURRENCY_SW_KEYBOARD_GROUP,
64
+ [KeyboardType.BasicCurrency]: MATH_CURRENCY_UK_KEYBOARD_GROUP,
64
65
  [KeyboardType.BasicTime]: MATH_TIME_SW_KEYBOARD_GROUP,
65
66
  [KeyboardType.AlgebraAdvanced]: MATH_ENTRY_ALGEBRA_KEYBOARD_GROUP,
66
67
  [KeyboardType.Numpad]: MATH_ENTRY_NUMBERS_US_KEYBOARD_GROUP,
@@ -19,7 +19,7 @@ export const MATH_INTEGRALS_AND_DERIVATIVES: MathKeysGroup<
19
19
  > = {
20
20
  [MathIntegralsAndDerivativesOperator.INTEGRAL]: {
21
21
  icon: <IntegralIcon {...DEFAULT_KEY_ICON_PROPS} />,
22
- mathliveValue: '\\int',
22
+ mathliveValue: 'test',
23
23
  katexValue: '∫',
24
24
  },
25
25
  [MathIntegralsAndDerivativesOperator.DOUBLE_INTEGRAL]: {
@@ -31,8 +31,8 @@ export const MATH_INTEGRALS_AND_DERIVATIVES: MathKeysGroup<
31
31
  icon: (
32
32
  <DefiniteIntegralIcon {...DEFAULT_KEY_ICON_PROPS} size={20} extraColor={COLORS.NEUTRAL_6} />
33
33
  ),
34
- mathliveValue: '$\\int_{#@}^{\\placeholder{}}$',
35
- katexValue: '',
34
+ mathliveValue: '\\int_{\\placeholder{lower}}^{\\placeholder{upper}}',
35
+ katexValue: '\\int_{a}^{b}',
36
36
  },
37
37
  [MathIntegralsAndDerivativesOperator.DERIVATIVE]: {
38
38
  icon: <DerivativeIcon {...DEFAULT_KEY_ICON_PROPS} size={20} />,
@@ -33,7 +33,7 @@ export const MATH_SPECIAL_OPERATORS: MathKeysGroup<typeof MathSpecialOperator> =
33
33
  katexValue: 'log₁₀',
34
34
  },
35
35
  [MathSpecialOperator.BACKSPACE]: {
36
- icon: <BackspaceIcon {...DEFAULT_KEY_ICON_PROPS} />,
36
+ icon: <BackspaceIcon {...DEFAULT_KEY_ICON_PROPS} size={20} />,
37
37
  mathliveValue: 'backspace',
38
38
  katexValue: 'backspace',
39
39
  },
@@ -24,17 +24,17 @@ export const MATH_BASIC_TRIGONOMETRIC_FUNCTIONS: MathKeysGroup<
24
24
  [MathBasicTrigonometricFunction.SIN]: {
25
25
  label: 'sin',
26
26
  mathliveValue: '$\\sin(\\placeholder{})$',
27
- katexValue: 'sin',
27
+ katexValue: 'sin()',
28
28
  },
29
29
  [MathBasicTrigonometricFunction.COS]: {
30
30
  label: 'cos',
31
31
  mathliveValue: '$\\cos(\\placeholder{})$',
32
- katexValue: 'cos',
32
+ katexValue: 'cos()',
33
33
  },
34
34
  [MathBasicTrigonometricFunction.TAN]: {
35
35
  label: 'tan',
36
36
  mathliveValue: '$\\tan(\\placeholder{})$',
37
- katexValue: 'tan',
37
+ katexValue: 'tan()',
38
38
  },
39
39
  [MathBasicTrigonometricFunction.COT]: {
40
40
  label: 'cot',
@@ -59,22 +59,22 @@ export const MATH_INVERSE_TRIGONOMETRIC_FUNCTIONS: MathKeysGroup<
59
59
  [MathInverseTrigonometricFunction.ARCSIN]: {
60
60
  label: 'arcsin',
61
61
  mathliveValue: '$\\arcsin(\\placeholder{})$',
62
- katexValue: 'arcsin',
62
+ katexValue: 'arcsin()',
63
63
  },
64
64
  [MathInverseTrigonometricFunction.ARCCOS]: {
65
65
  label: 'arccos',
66
66
  mathliveValue: '$\\arccos(\\placeholder{})$',
67
- katexValue: 'arccos',
67
+ katexValue: 'arccos()',
68
68
  },
69
69
  [MathInverseTrigonometricFunction.ARCTAN]: {
70
70
  label: 'arctan',
71
71
  mathliveValue: '$\\arctan(\\placeholder{})$',
72
- katexValue: 'arctan',
72
+ katexValue: 'arctan()',
73
73
  },
74
74
  [MathInverseTrigonometricFunction.ARCCOT]: {
75
75
  label: 'arccot',
76
76
  mathliveValue: '$\\operatorname{arccot}(\\placeholder{})$',
77
- katexValue: 'arccot',
77
+ katexValue: 'arccot()',
78
78
  },
79
79
  [MathInverseTrigonometricFunction.ARCSEC]: {
80
80
  label: 'arcsec',
@@ -108,7 +108,7 @@ export const MATH_CURRENCY_UNITS: MathKeysGroup<typeof MathCurrencyUnit> = {
108
108
  [MathCurrencyUnit.DOLLAR]: {
109
109
  icon: <DollarIcon {...DEFAULT_KEY_ICON_PROPS} />,
110
110
  mathliveValue: '\\$',
111
- katexValue: '\\$',
111
+ katexValue: '\$',
112
112
  },
113
113
  [MathCurrencyUnit.EURO]: {
114
114
  icon: <EuroIcon {...DEFAULT_KEY_ICON_PROPS} />,
@@ -132,8 +132,8 @@ export const MATH_CURRENCY_UNITS: MathKeysGroup<typeof MathCurrencyUnit> = {
132
132
  },
133
133
  [MathCurrencyUnit.CENT]: {
134
134
  icon: <CentIcon {...DEFAULT_KEY_ICON_PROPS} />,
135
- mathliveValue: 'c',
136
- katexValue: 'c',
135
+ mathliveValue: '¢',
136
+ katexValue: '¢',
137
137
  },
138
138
  }
139
139
 
@@ -300,9 +300,9 @@ export const MATH_VOLUME_UNITS: MathKeysGroup<typeof MathVolumeUnit> = {
300
300
  katexValue: 'yd^3',
301
301
  },
302
302
  [MathVolumeUnit.MILLILITER]: {
303
- label: 'mL',
303
+ label: 'ml',
304
304
  mathliveValue: '\\mathrm{mL}',
305
- katexValue: 'mL',
305
+ katexValue: 'ml',
306
306
  },
307
307
  [MathVolumeUnit.LITER]: {
308
308
  label: 'L',
@@ -23,6 +23,7 @@ export type KeyboardKey = {
23
23
  export type KeyboardKeyValue = {
24
24
  katexValue: string
25
25
  mathliveValue?: string
26
+ isSpecialSymbol?: boolean
26
27
  }
27
28
 
28
29
  export type KeyboardGroup = {
@@ -34,8 +35,6 @@ export type KeyboardGroup = {
34
35
 
35
36
  export type KeyboardLayoutProps = {
36
37
  onKeyPress: (key: KeyboardKeyValue) => void
37
- onSpecialKeyPress?: (key: KeyboardKeyValue) => void
38
- onBackspacePress?: () => void
39
38
  color?: SelectOptionColor
40
39
  isSpecialButtonsDisabled?: boolean
41
40
  isDisabled?: boolean