@magmamath/students-features 1.3.26-rc.13 → 1.3.26-rc.14

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 (82) hide show
  1. package/dist/commonjs/features/chatbot/helpers.js +3 -0
  2. package/dist/commonjs/features/chatbot/helpers.js.map +1 -1
  3. package/dist/commonjs/features/keyboard/components/AlgebraLayout/AlgebraLayout.js +3 -1
  4. package/dist/commonjs/features/keyboard/components/AlgebraLayout/AlgebraLayout.js.map +1 -1
  5. package/dist/commonjs/features/keyboard/components/GeometryLayout/GeometryLayout.js +3 -1
  6. package/dist/commonjs/features/keyboard/components/GeometryLayout/GeometryLayout.js.map +1 -1
  7. package/dist/commonjs/features/keyboard/components/SwitchableLayout/SwitchableLayout.js +10 -4
  8. package/dist/commonjs/features/keyboard/components/SwitchableLayout/SwitchableLayout.js.map +1 -1
  9. package/dist/commonjs/features/keyboard/components/SwitchableLayout/helpers.js +5 -2
  10. package/dist/commonjs/features/keyboard/components/SwitchableLayout/helpers.js.map +1 -1
  11. package/dist/commonjs/features/keyboard/constants/groups/currency.constants.js +3 -0
  12. package/dist/commonjs/features/keyboard/constants/groups/currency.constants.js.map +1 -1
  13. package/dist/commonjs/features/keyboard/constants/keyboard.helpers.js +2 -1
  14. package/dist/commonjs/features/keyboard/constants/keyboard.helpers.js.map +1 -1
  15. package/dist/commonjs/features/keyboard/constants/keys/units.constants.js +16 -0
  16. package/dist/commonjs/features/keyboard/constants/keys/units.constants.js.map +1 -1
  17. package/dist/commonjs/shared/icons/keyboard/FrancIcon.js +34 -0
  18. package/dist/commonjs/shared/icons/keyboard/FrancIcon.js.map +1 -0
  19. package/dist/commonjs/shared/icons/keyboard/RappenIcon.js +34 -0
  20. package/dist/commonjs/shared/icons/keyboard/RappenIcon.js.map +1 -0
  21. package/dist/module/features/chatbot/helpers.js +3 -0
  22. package/dist/module/features/chatbot/helpers.js.map +1 -1
  23. package/dist/module/features/keyboard/components/AlgebraLayout/AlgebraLayout.js +3 -1
  24. package/dist/module/features/keyboard/components/AlgebraLayout/AlgebraLayout.js.map +1 -1
  25. package/dist/module/features/keyboard/components/GeometryLayout/GeometryLayout.js +3 -1
  26. package/dist/module/features/keyboard/components/GeometryLayout/GeometryLayout.js.map +1 -1
  27. package/dist/module/features/keyboard/components/SwitchableLayout/SwitchableLayout.js +10 -4
  28. package/dist/module/features/keyboard/components/SwitchableLayout/SwitchableLayout.js.map +1 -1
  29. package/dist/module/features/keyboard/components/SwitchableLayout/helpers.js +5 -2
  30. package/dist/module/features/keyboard/components/SwitchableLayout/helpers.js.map +1 -1
  31. package/dist/module/features/keyboard/constants/groups/currency.constants.js +3 -0
  32. package/dist/module/features/keyboard/constants/groups/currency.constants.js.map +1 -1
  33. package/dist/module/features/keyboard/constants/keyboard.helpers.js +2 -1
  34. package/dist/module/features/keyboard/constants/keyboard.helpers.js.map +1 -1
  35. package/dist/module/features/keyboard/constants/keys/units.constants.js +16 -0
  36. package/dist/module/features/keyboard/constants/keys/units.constants.js.map +1 -1
  37. package/dist/module/shared/icons/keyboard/FrancIcon.js +26 -0
  38. package/dist/module/shared/icons/keyboard/FrancIcon.js.map +1 -0
  39. package/dist/module/shared/icons/keyboard/RappenIcon.js +26 -0
  40. package/dist/module/shared/icons/keyboard/RappenIcon.js.map +1 -0
  41. package/dist/typescript/commonjs/features/chatbot/helpers.d.ts.map +1 -1
  42. package/dist/typescript/commonjs/features/keyboard/components/AlgebraLayout/AlgebraLayout.d.ts.map +1 -1
  43. package/dist/typescript/commonjs/features/keyboard/components/GeometryLayout/GeometryLayout.d.ts.map +1 -1
  44. package/dist/typescript/commonjs/features/keyboard/components/SwitchableLayout/SwitchableLayout.d.ts +1 -1
  45. package/dist/typescript/commonjs/features/keyboard/components/SwitchableLayout/SwitchableLayout.d.ts.map +1 -1
  46. package/dist/typescript/commonjs/features/keyboard/components/SwitchableLayout/helpers.d.ts.map +1 -1
  47. package/dist/typescript/commonjs/features/keyboard/components/SwitchableLayout/types.d.ts +2 -0
  48. package/dist/typescript/commonjs/features/keyboard/components/SwitchableLayout/types.d.ts.map +1 -1
  49. package/dist/typescript/commonjs/features/keyboard/constants/groups/currency.constants.d.ts.map +1 -1
  50. package/dist/typescript/commonjs/features/keyboard/constants/keyboard.helpers.d.ts.map +1 -1
  51. package/dist/typescript/commonjs/features/keyboard/constants/keys/units.constants.d.ts.map +1 -1
  52. package/dist/typescript/commonjs/shared/icons/keyboard/FrancIcon.d.ts +4 -0
  53. package/dist/typescript/commonjs/shared/icons/keyboard/FrancIcon.d.ts.map +1 -0
  54. package/dist/typescript/commonjs/shared/icons/keyboard/RappenIcon.d.ts +4 -0
  55. package/dist/typescript/commonjs/shared/icons/keyboard/RappenIcon.d.ts.map +1 -0
  56. package/dist/typescript/module/features/chatbot/helpers.d.ts.map +1 -1
  57. package/dist/typescript/module/features/keyboard/components/AlgebraLayout/AlgebraLayout.d.ts.map +1 -1
  58. package/dist/typescript/module/features/keyboard/components/GeometryLayout/GeometryLayout.d.ts.map +1 -1
  59. package/dist/typescript/module/features/keyboard/components/SwitchableLayout/SwitchableLayout.d.ts +1 -1
  60. package/dist/typescript/module/features/keyboard/components/SwitchableLayout/SwitchableLayout.d.ts.map +1 -1
  61. package/dist/typescript/module/features/keyboard/components/SwitchableLayout/helpers.d.ts.map +1 -1
  62. package/dist/typescript/module/features/keyboard/components/SwitchableLayout/types.d.ts +2 -0
  63. package/dist/typescript/module/features/keyboard/components/SwitchableLayout/types.d.ts.map +1 -1
  64. package/dist/typescript/module/features/keyboard/constants/groups/currency.constants.d.ts.map +1 -1
  65. package/dist/typescript/module/features/keyboard/constants/keyboard.helpers.d.ts.map +1 -1
  66. package/dist/typescript/module/features/keyboard/constants/keys/units.constants.d.ts.map +1 -1
  67. package/dist/typescript/module/shared/icons/keyboard/FrancIcon.d.ts +4 -0
  68. package/dist/typescript/module/shared/icons/keyboard/FrancIcon.d.ts.map +1 -0
  69. package/dist/typescript/module/shared/icons/keyboard/RappenIcon.d.ts +4 -0
  70. package/dist/typescript/module/shared/icons/keyboard/RappenIcon.d.ts.map +1 -0
  71. package/package.json +4 -4
  72. package/src/features/chatbot/helpers.ts +1 -0
  73. package/src/features/keyboard/components/AlgebraLayout/AlgebraLayout.tsx +8 -1
  74. package/src/features/keyboard/components/GeometryLayout/GeometryLayout.tsx +8 -1
  75. package/src/features/keyboard/components/SwitchableLayout/SwitchableLayout.tsx +12 -2
  76. package/src/features/keyboard/components/SwitchableLayout/helpers.tsx +3 -0
  77. package/src/features/keyboard/components/SwitchableLayout/types.ts +2 -0
  78. package/src/features/keyboard/constants/groups/currency.constants.ts +3 -0
  79. package/src/features/keyboard/constants/keyboard.helpers.ts +1 -0
  80. package/src/features/keyboard/constants/keys/units.constants.tsx +12 -0
  81. package/src/shared/icons/keyboard/FrancIcon.tsx +20 -0
  82. package/src/shared/icons/keyboard/RappenIcon.tsx +20 -0
@@ -8,6 +8,7 @@ import {
8
8
  SelectOptionSize,
9
9
  SPACING,
10
10
  } from '@magmamath/react-native-ui'
11
+ import { TEST_IDS } from '@magmamath/students-qa'
11
12
  import { KeyboardType } from '../../types/types'
12
13
  import { SelectedLayout, SwitchableLayoutProps } from './types'
13
14
  import { getMainKeyboardGroup } from '../../helpers'
@@ -18,6 +19,7 @@ export const SwitchableLayout = ({
18
19
  onLayoutChange,
19
20
  keys,
20
21
  config,
22
+ testID,
21
23
  ...props
22
24
  }: SwitchableLayoutProps) => {
23
25
  const [selectedLayout, setSelectedLayout] = useState<SelectedLayout>(SelectedLayout.BASIC)
@@ -63,7 +65,7 @@ export const SwitchableLayout = ({
63
65
  const currentKeys = keyboardGroups.get(selectedLayout)?.keys ?? []
64
66
 
65
67
  return (
66
- <View style={styles.container}>
68
+ <View style={styles.container} testID={testID}>
67
69
  {isDesktop && (
68
70
  <SelectGroup
69
71
  numOfRows={2}
@@ -79,7 +81,15 @@ export const SwitchableLayout = ({
79
81
  ]}
80
82
  />
81
83
  )}
82
- <KeysList keys={currentKeys} numOfRows={3} {...props} />
84
+ <View
85
+ testID={
86
+ selectedLayout === SelectedLayout.BASIC
87
+ ? TEST_IDS.KEYBOARD_KEYS_BASIC
88
+ : TEST_IDS.KEYBOARD_KEYS_SECONDARY
89
+ }
90
+ >
91
+ <KeysList keys={currentKeys} numOfRows={3} {...props} />
92
+ </View>
83
93
  </View>
84
94
  )
85
95
  }
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react'
2
+ import { TEST_IDS } from '@magmamath/students-qa'
2
3
  import { SelectedLayout, LayoutOption } from './types'
3
4
 
4
5
  type GetSelectOptionsProps = {
@@ -21,11 +22,13 @@ export function getSelectOptions({
21
22
  key: SelectedLayout.BASIC,
22
23
  title: BasicIcon(selectedLayout === SelectedLayout.BASIC),
23
24
  onPressIn: onBasicPressIn,
25
+ testID: TEST_IDS.KEYBOARD_LAYOUT_SWITCH_BASIC,
24
26
  },
25
27
  {
26
28
  key: SelectedLayout.SECONDARY,
27
29
  title: SecondaryIcon(selectedLayout === SelectedLayout.SECONDARY),
28
30
  onPressIn: onSecondaryPressIn,
31
+ testID: TEST_IDS.KEYBOARD_LAYOUT_SWITCH_SECONDARY,
29
32
  },
30
33
  ]
31
34
  }
@@ -11,6 +11,7 @@ export type LayoutOption = {
11
11
  key: SelectedLayout
12
12
  title: ReactNode
13
13
  onPressIn: () => void
14
+ testID?: string
14
15
  }
15
16
 
16
17
  export type SwitchableLayoutConfig = {
@@ -21,4 +22,5 @@ export type SwitchableLayoutConfig = {
21
22
 
22
23
  export type SwitchableLayoutProps = KeyboardLayoutProps & {
23
24
  config: SwitchableLayoutConfig
25
+ testID?: string
24
26
  }
@@ -17,4 +17,7 @@ export const KEYBOARD_CURRENCY: Record<string, KeyboardGroup> = {
17
17
  ZLOTY_GROSZ: {
18
18
  keys: [MATH_CURRENCY_UNITS.ZLOTY, MATH_CURRENCY_UNITS.GROSZ],
19
19
  },
20
+ FRANC_RAPPEN: {
21
+ keys: [MATH_CURRENCY_UNITS.FRANC, MATH_CURRENCY_UNITS.RAPPEN],
22
+ },
20
23
  }
@@ -100,6 +100,7 @@ const CURRENCY_MAP: Record<KeyboardCurrencyVariant, KeyboardGroup> = {
100
100
  [KeyboardCurrencyVariant.KRONE_EURO_POUND]: KEYBOARD_CURRENCY.KRONE_EURO_POUND,
101
101
  [KeyboardCurrencyVariant.EURO_DOLLAR_POUND]: KEYBOARD_CURRENCY.EURO_DOLLAR_POUND,
102
102
  [KeyboardCurrencyVariant.ZLOTY_GROSZ]: KEYBOARD_CURRENCY.ZLOTY_GROSZ,
103
+ [KeyboardCurrencyVariant.FRANC_RAPPEN]: KEYBOARD_CURRENCY.FRANC_RAPPEN,
103
104
  }
104
105
 
105
106
  const TIME_MAP: Record<KeyboardTimeVariant, KeyboardGroup> = {
@@ -10,6 +10,8 @@ import { PesoIcon } from '../../../../shared/icons/keyboard/PesoIcon'
10
10
  import { CentIcon } from '../../../../shared/icons/keyboard/CentIcon'
11
11
  import { ZlotyIcon } from '../../../../shared/icons/keyboard/ZlotyIcon'
12
12
  import { GroszIcon } from '../../../../shared/icons/keyboard/GroszIcon'
13
+ import { FrancIcon } from '../../../../shared/icons/keyboard/FrancIcon'
14
+ import { RappenIcon } from '../../../../shared/icons/keyboard/RappenIcon'
13
15
 
14
16
  export const MATH_CURRENCY_UNITS: MathOperatorsGroup = {
15
17
  KRONE: {
@@ -58,6 +60,16 @@ export const MATH_CURRENCY_UNITS: MathOperatorsGroup = {
58
60
  mathliveValue: '\\mathrm{gr}',
59
61
  katexValue: 'gr',
60
62
  },
63
+ FRANC: {
64
+ icon: <FrancIcon {...DEFAULT_KEY_ICON_PROPS} />,
65
+ mathliveValue: '\\mathrm{Fr}',
66
+ katexValue: 'Fr',
67
+ },
68
+ RAPPEN: {
69
+ icon: <RappenIcon {...DEFAULT_KEY_ICON_PROPS} />,
70
+ mathliveValue: '\\mathrm{Rp}',
71
+ katexValue: 'Rp',
72
+ },
61
73
  } as const
62
74
 
63
75
  export const MATH_LENGTH_UNITS: MathOperatorsGroup = {
@@ -0,0 +1,20 @@
1
+ import React from 'react'
2
+ import { IconProps } from './icon.types'
3
+ import Svg, { Text as SvgText } from 'react-native-svg'
4
+
5
+ export const FrancIcon = ({ size = 20, color }: IconProps) => {
6
+ return (
7
+ <Svg width={size} height={size} viewBox="0 0 16 16" fill="none">
8
+ <SvgText
9
+ x="8"
10
+ y="12"
11
+ fill={color}
12
+ fontSize="10"
13
+ fontWeight="600"
14
+ textAnchor="middle"
15
+ >
16
+ Fr
17
+ </SvgText>
18
+ </Svg>
19
+ )
20
+ }
@@ -0,0 +1,20 @@
1
+ import React from 'react'
2
+ import { IconProps } from './icon.types'
3
+ import Svg, { Text as SvgText } from 'react-native-svg'
4
+
5
+ export const RappenIcon = ({ size = 20, color }: IconProps) => {
6
+ return (
7
+ <Svg width={size} height={size} viewBox="0 0 16 16" fill="none">
8
+ <SvgText
9
+ x="8"
10
+ y="12"
11
+ fill={color}
12
+ fontSize="8"
13
+ fontWeight="600"
14
+ textAnchor="middle"
15
+ >
16
+ Rp
17
+ </SvgText>
18
+ </Svg>
19
+ )
20
+ }