@khanacademy/math-input 3.0.0 → 4.0.0
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/CHANGELOG.md +35 -0
- package/dist/components/input/__tests__/test-math-wrapper.d.ts +1 -1
- package/dist/components/input/__tests__/test-math-wrapper.js.flow +1 -1
- package/dist/components/input/key-handlers/handle-arrow.d.ts +3 -0
- package/dist/components/input/key-handlers/handle-arrow.js.flow +12 -0
- package/dist/components/input/key-handlers/handle-backspace.d.ts +7 -0
- package/dist/components/input/key-handlers/handle-backspace.js.flow +14 -0
- package/dist/components/input/key-handlers/handle-exponent.d.ts +3 -0
- package/dist/components/input/key-handlers/handle-exponent.js.flow +12 -0
- package/dist/components/input/key-handlers/handle-jump-out.d.ts +7 -0
- package/dist/components/input/key-handlers/handle-jump-out.js.flow +14 -0
- package/dist/components/input/math-wrapper.d.ts +7 -78
- package/dist/components/input/math-wrapper.js.flow +16 -78
- package/dist/components/input/mathquill-helpers.d.ts +46 -0
- package/dist/components/input/mathquill-helpers.js.flow +56 -0
- package/dist/components/input/mathquill-instance.d.ts +3 -0
- package/dist/components/input/mathquill-instance.js.flow +9 -0
- package/dist/components/input/mathquill-types.d.ts +25 -0
- package/dist/components/input/mathquill-types.js.flow +34 -0
- package/dist/components/key-translator.d.ts +4 -0
- package/dist/components/key-translator.js.flow +10 -0
- package/dist/components/keypad/button-assets.d.ts +2 -2
- package/dist/components/keypad/button-assets.js.flow +2 -2
- package/dist/components/keypad/keypad-page-items.d.ts +1 -1
- package/dist/components/keypad/keypad-page-items.js.flow +1 -1
- package/dist/components/keypad-legacy/gesture-manager.d.ts +21 -9
- package/dist/components/keypad-legacy/gesture-manager.js.flow +27 -12
- package/dist/components/keypad-legacy/gesture-state-machine.d.ts +9 -9
- package/dist/components/keypad-legacy/gesture-state-machine.js.flow +10 -10
- package/dist/components/keypad-legacy/keypad-button.d.ts +2 -2
- package/dist/components/keypad-legacy/keypad-button.js.flow +3 -3
- package/dist/components/keypad-legacy/store/actions.d.ts +4 -14
- package/dist/components/keypad-legacy/store/actions.js.flow +3 -15
- package/dist/components/keypad-legacy/store/types.d.ts +2 -2
- package/dist/components/keypad-legacy/store/types.js.flow +2 -2
- package/dist/components/keypad-legacy/touchable-keypad-button.d.ts +6 -6
- package/dist/components/keypad-legacy/touchable-keypad-button.js.flow +9 -14
- package/dist/data/key-configs.d.ts +3 -6
- package/dist/data/key-configs.js.flow +3 -8
- package/dist/data/keys.d.ts +2 -54
- package/dist/data/keys.js.flow +116 -55
- package/dist/enums.d.ts +2 -9
- package/dist/enums.js.flow +2 -11
- package/dist/es/index.js +1781 -1196
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2069 -1242
- package/dist/index.js.flow +4 -2
- package/dist/index.js.map +1 -1
- package/dist/strings.js +26 -10
- package/dist/types.d.ts +10 -12
- package/dist/types.js.flow +13 -12
- package/package.json +1 -1
- package/src/components/input/__tests__/context-tracking.test.ts +43 -44
- package/src/components/input/__tests__/mathquill.test.ts +133 -135
- package/src/components/input/key-handlers/handle-arrow.ts +70 -0
- package/src/components/input/key-handlers/handle-backspace.ts +275 -0
- package/src/components/input/key-handlers/handle-exponent.ts +52 -0
- package/src/components/input/key-handlers/handle-jump-out.ts +103 -0
- package/src/components/input/math-input.tsx +11 -12
- package/src/components/input/math-wrapper.ts +88 -837
- package/src/components/input/mathquill-helpers.ts +268 -0
- package/src/components/input/mathquill-instance.ts +5 -0
- package/src/components/input/mathquill-types.ts +55 -0
- package/src/components/key-translator.ts +209 -0
- package/src/components/keypad/button-assets.tsx +411 -100
- package/src/components/keypad/geometry-page/index.tsx +1 -1
- package/src/components/keypad/keypad-mathquill.stories.tsx +69 -0
- package/src/components/keypad/keypad-page-items.tsx +2 -1
- package/src/components/keypad/operators-page/index.tsx +1 -1
- package/src/components/keypad-legacy/echo-manager.tsx +4 -4
- package/src/components/keypad-legacy/empty-keypad-button.tsx +6 -4
- package/src/components/keypad-legacy/gesture-manager.ts +32 -9
- package/src/components/keypad-legacy/gesture-state-machine.ts +14 -14
- package/src/components/keypad-legacy/keypad-button.tsx +15 -18
- package/src/components/keypad-legacy/many-keypad-button.tsx +9 -2
- package/src/components/keypad-legacy/store/actions.ts +3 -29
- package/src/components/keypad-legacy/store/echo-reducer.ts +2 -5
- package/src/components/keypad-legacy/store/index.ts +4 -10
- package/src/components/keypad-legacy/store/input-reducer.ts +1 -2
- package/src/components/keypad-legacy/store/keypad-reducer.ts +2 -3
- package/src/components/keypad-legacy/store/types.ts +2 -2
- package/src/components/keypad-legacy/touchable-keypad-button.tsx +8 -13
- package/src/components/tabbar/icons.tsx +0 -2
- package/src/data/key-configs.ts +751 -304
- package/src/data/keys.ts +118 -65
- package/src/enums.ts +10 -9
- package/src/index.ts +3 -2
- package/src/math-input.stories.tsx +1 -1
- package/src/types.ts +10 -12
- package/tsconfig-build.tsbuildinfo +1 -1
package/dist/data/keys.js.flow
CHANGED
|
@@ -4,58 +4,119 @@
|
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
|
61
|
-
|
|
7
|
+
declare type Key =
|
|
8
|
+
| "PLUS"
|
|
9
|
+
| "MINUS"
|
|
10
|
+
| "NEGATIVE"
|
|
11
|
+
| "TIMES"
|
|
12
|
+
| "DIVIDE"
|
|
13
|
+
| "DECIMAL"
|
|
14
|
+
| "PERIOD"
|
|
15
|
+
| "PERCENT"
|
|
16
|
+
| "CDOT"
|
|
17
|
+
| "EQUAL"
|
|
18
|
+
| "NEQ"
|
|
19
|
+
| "GT"
|
|
20
|
+
| "LT"
|
|
21
|
+
| "GEQ"
|
|
22
|
+
| "LEQ"
|
|
23
|
+
| "FRAC_INCLUSIVE"
|
|
24
|
+
| "FRAC_EXCLUSIVE"
|
|
25
|
+
| "FRAC"
|
|
26
|
+
| "EXP"
|
|
27
|
+
| "EXP_2"
|
|
28
|
+
| "EXP_3"
|
|
29
|
+
| "SQRT"
|
|
30
|
+
| "CUBE_ROOT"
|
|
31
|
+
| "RADICAL"
|
|
32
|
+
| "LEFT_PAREN"
|
|
33
|
+
| "RIGHT_PAREN"
|
|
34
|
+
| "LN"
|
|
35
|
+
| "LOG"
|
|
36
|
+
| "LOG_N"
|
|
37
|
+
| "SIN"
|
|
38
|
+
| "COS"
|
|
39
|
+
| "TAN"
|
|
40
|
+
| "PI"
|
|
41
|
+
| "THETA"
|
|
42
|
+
| "UP"
|
|
43
|
+
| "RIGHT"
|
|
44
|
+
| "DOWN"
|
|
45
|
+
| "LEFT"
|
|
46
|
+
| "BACKSPACE"
|
|
47
|
+
| "DISMISS"
|
|
48
|
+
| "JUMP_OUT_PARENTHESES"
|
|
49
|
+
| "JUMP_OUT_EXPONENT"
|
|
50
|
+
| "JUMP_OUT_BASE"
|
|
51
|
+
| "JUMP_INTO_NUMERATOR"
|
|
52
|
+
| "JUMP_OUT_NUMERATOR"
|
|
53
|
+
| "JUMP_OUT_DENOMINATOR"
|
|
54
|
+
| "NOOP"
|
|
55
|
+
| "MANY"
|
|
56
|
+
| "NUM_0"
|
|
57
|
+
| "NUM_1"
|
|
58
|
+
| "NUM_2"
|
|
59
|
+
| "NUM_3"
|
|
60
|
+
| "NUM_4"
|
|
61
|
+
| "NUM_5"
|
|
62
|
+
| "NUM_6"
|
|
63
|
+
| "NUM_7"
|
|
64
|
+
| "NUM_8"
|
|
65
|
+
| "NUM_9"
|
|
66
|
+
| "a"
|
|
67
|
+
| "b"
|
|
68
|
+
| "c"
|
|
69
|
+
| "d"
|
|
70
|
+
| "e"
|
|
71
|
+
| "f"
|
|
72
|
+
| "g"
|
|
73
|
+
| "h"
|
|
74
|
+
| "i"
|
|
75
|
+
| "j"
|
|
76
|
+
| "k"
|
|
77
|
+
| "l"
|
|
78
|
+
| "m"
|
|
79
|
+
| "n"
|
|
80
|
+
| "o"
|
|
81
|
+
| "p"
|
|
82
|
+
| "q"
|
|
83
|
+
| "r"
|
|
84
|
+
| "s"
|
|
85
|
+
| "t"
|
|
86
|
+
| "u"
|
|
87
|
+
| "v"
|
|
88
|
+
| "w"
|
|
89
|
+
| "x"
|
|
90
|
+
| "y"
|
|
91
|
+
| "z"
|
|
92
|
+
| "A"
|
|
93
|
+
| "B"
|
|
94
|
+
| "C"
|
|
95
|
+
| "D"
|
|
96
|
+
| "E"
|
|
97
|
+
| "F"
|
|
98
|
+
| "G"
|
|
99
|
+
| "H"
|
|
100
|
+
| "I"
|
|
101
|
+
| "J"
|
|
102
|
+
| "K"
|
|
103
|
+
| "L"
|
|
104
|
+
| "M"
|
|
105
|
+
| "N"
|
|
106
|
+
| "O"
|
|
107
|
+
| "P"
|
|
108
|
+
| "Q"
|
|
109
|
+
| "R"
|
|
110
|
+
| "S"
|
|
111
|
+
| "T"
|
|
112
|
+
| "U"
|
|
113
|
+
| "V"
|
|
114
|
+
| "W"
|
|
115
|
+
| "X"
|
|
116
|
+
| "Y"
|
|
117
|
+
| "Z"
|
|
118
|
+
| "PHI"
|
|
119
|
+
| "NTHROOT3"
|
|
120
|
+
| "POW"
|
|
121
|
+
| "LOG_B";
|
|
122
|
+
declare export default typeof Key;
|
package/dist/enums.d.ts
CHANGED
|
@@ -5,15 +5,8 @@ export declare enum KeypadType {
|
|
|
5
5
|
FRACTION = "FRACTION",
|
|
6
6
|
EXPRESSION = "EXPRESSION"
|
|
7
7
|
}
|
|
8
|
-
export declare
|
|
9
|
-
|
|
10
|
-
VALUE = "VALUE",
|
|
11
|
-
OPERATOR = "OPERATOR",
|
|
12
|
-
INPUT_NAVIGATION = "INPUT_NAVIGATION",
|
|
13
|
-
KEYPAD_NAVIGATION = "KEYPAD_NAVIGATION",
|
|
14
|
-
MANY = "MANY",
|
|
15
|
-
ECHO = "ECHO"
|
|
16
|
-
}
|
|
8
|
+
export declare const KeyTypes: string[];
|
|
9
|
+
export type KeyType = typeof KeyTypes[number];
|
|
17
10
|
export declare enum DeviceOrientation {
|
|
18
11
|
LANDSCAPE = "LANDSCAPE",
|
|
19
12
|
PORTRAIT = "PORTRAIT"
|
package/dist/enums.js.flow
CHANGED
|
@@ -12,17 +12,8 @@ declare export var KeypadType: {|
|
|
|
12
12
|
+FRACTION: "FRACTION", // "FRACTION"
|
|
13
13
|
+EXPRESSION: "EXPRESSION", // "EXPRESSION"
|
|
14
14
|
|};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
+EMPTY: "EMPTY", // "EMPTY"
|
|
18
|
-
+VALUE: "VALUE", // "VALUE"
|
|
19
|
-
+OPERATOR: "OPERATOR", // "OPERATOR"
|
|
20
|
-
+INPUT_NAVIGATION: "INPUT_NAVIGATION", // "INPUT_NAVIGATION"
|
|
21
|
-
+KEYPAD_NAVIGATION: "KEYPAD_NAVIGATION", // "KEYPAD_NAVIGATION"
|
|
22
|
-
+MANY: "MANY", // "MANY"
|
|
23
|
-
+ECHO: "ECHO", // "ECHO"
|
|
24
|
-
|};
|
|
25
|
-
|
|
15
|
+
declare export var KeyTypes: string[];
|
|
16
|
+
export type KeyType = $ElementType<typeof KeyTypes, number>;
|
|
26
17
|
declare export var DeviceOrientation: {|
|
|
27
18
|
+LANDSCAPE: "LANDSCAPE", // "LANDSCAPE"
|
|
28
19
|
+PORTRAIT: "PORTRAIT", // "PORTRAIT"
|