@khanacademy/math-input 14.0.1 → 14.1.1

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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Khan Academy's new expression editor for the mobile web.",
4
4
  "author": "Khan Academy",
5
5
  "license": "MIT",
6
- "version": "14.0.1",
6
+ "version": "14.1.1",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -20,7 +20,7 @@
20
20
  "source": "src/index.ts",
21
21
  "scripts": {},
22
22
  "dependencies": {
23
- "@khanacademy/perseus-core": "1.1.1",
23
+ "@khanacademy/perseus-core": "1.1.2",
24
24
  "mathquill": "git+https://git@github.com/Khan/mathquill.git#32d9f351aaa68537170b3120a52e99b8def3a2c3",
25
25
  "performance-now": "^0.2.0"
26
26
  },
package/src/data/keys.ts CHANGED
@@ -1,120 +1,123 @@
1
- type Key =
2
- | "PLUS"
3
- | "MINUS"
4
- | "NEGATIVE"
5
- | "TIMES"
6
- | "DIVIDE"
7
- | "DECIMAL"
8
- | "PERIOD"
9
- | "PERCENT"
10
- | "CDOT"
11
- | "EQUAL"
12
- | "NEQ"
13
- | "GT"
14
- | "LT"
15
- | "GEQ"
16
- | "LEQ" // mobile native only
17
- | "FRAC_INCLUSIVE" // mobile native only
18
- | "FRAC_EXCLUSIVE" // mobile native only
19
- | "FRAC"
20
- | "EXP"
21
- | "EXP_2"
22
- | "EXP_3"
23
- | "SQRT"
24
- | "CUBE_ROOT"
25
- | "RADICAL"
26
- | "LEFT_PAREN"
27
- | "RIGHT_PAREN"
28
- | "LN"
29
- | "LOG"
30
- | "LOG_N"
31
- | "SIN"
32
- | "COS" // TODO(charlie): Add in additional Greek letters.
33
- | "TAN"
34
- | "PI"
35
- | "THETA"
36
- | "UP"
37
- | "RIGHT"
38
- | "DOWN"
39
- | "LEFT"
40
- | "BACKSPACE"
41
- | "DISMISS"
42
- | "JUMP_OUT_PARENTHESES"
43
- | "JUMP_OUT_EXPONENT"
44
- | "JUMP_OUT_BASE"
45
- | "JUMP_INTO_NUMERATOR"
46
- | "JUMP_OUT_NUMERATOR"
47
- | "JUMP_OUT_DENOMINATOR" // Multi-functional keys.
48
- | "NOOP" // mobile native only
49
- | "MANY" // A custom key that captures an arbitrary number of symbols but has no 'default' symbol or action.
50
- | "NUM_0"
51
- | "NUM_1"
52
- | "NUM_2"
53
- | "NUM_3"
54
- | "NUM_4"
55
- | "NUM_5"
56
- | "NUM_6"
57
- | "NUM_7"
58
- | "NUM_8"
59
- | "NUM_9"
60
- | "a"
61
- | "b"
62
- | "c"
63
- | "d"
64
- | "e"
65
- | "f"
66
- | "g"
67
- | "h"
68
- | "i"
69
- | "j"
70
- | "k"
71
- | "l"
72
- | "m"
73
- | "n"
74
- | "o"
75
- | "p"
76
- | "q"
77
- | "r"
78
- | "s"
79
- | "t"
80
- | "u"
81
- | "v"
82
- | "w"
83
- | "x"
84
- | "y"
85
- | "z"
86
- | "A"
87
- | "B"
88
- | "C"
89
- | "D"
90
- | "E"
91
- | "F"
92
- | "G"
93
- | "H"
94
- | "I"
95
- | "J"
96
- | "K"
97
- | "L"
98
- | "M"
99
- | "N"
100
- | "O"
101
- | "P"
102
- | "Q"
103
- | "R"
104
- | "S"
105
- | "T"
106
- | "U"
107
- | "V"
108
- | "W"
109
- | "X"
110
- | "Y"
111
- | "Z"
1
+ export const KeyArray = [
2
+ "PLUS",
3
+ "MINUS",
4
+ "NEGATIVE",
5
+ "TIMES",
6
+ "DIVIDE",
7
+ "DECIMAL",
8
+ "PERIOD",
9
+ "PERCENT",
10
+ "CDOT",
11
+ "EQUAL",
12
+ "NEQ",
13
+ "GT",
14
+ "LT",
15
+ "GEQ",
16
+ "LEQ", // mobile native only
17
+ "FRAC_INCLUSIVE", // mobile native only
18
+ "FRAC_EXCLUSIVE", // mobile native only
19
+ "FRAC",
20
+ "EXP",
21
+ "EXP_2",
22
+ "EXP_3",
23
+ "SQRT",
24
+ "CUBE_ROOT",
25
+ "RADICAL",
26
+ "LEFT_PAREN",
27
+ "RIGHT_PAREN",
28
+ "LN",
29
+ "LOG",
30
+ "LOG_N",
31
+ "SIN",
32
+ "COS", // TODO(charlie): Add in additional Greek letters.,
33
+ "TAN",
34
+ "PI",
35
+ "THETA",
36
+ "UP",
37
+ "RIGHT",
38
+ "DOWN",
39
+ "LEFT",
40
+ "BACKSPACE",
41
+ "DISMISS",
42
+ "JUMP_OUT_PARENTHESES",
43
+ "JUMP_OUT_EXPONENT",
44
+ "JUMP_OUT_BASE",
45
+ "JUMP_INTO_NUMERATOR",
46
+ "JUMP_OUT_NUMERATOR",
47
+ "JUMP_OUT_DENOMINATOR", // Multi-functional keys.
48
+ "NOOP", // mobile native only
49
+ "MANY", // A custom key that captures an arbitrary number of symbols but has no 'default' symbol or action.
50
+ "NUM_0",
51
+ "NUM_1",
52
+ "NUM_2",
53
+ "NUM_3",
54
+ "NUM_4",
55
+ "NUM_5",
56
+ "NUM_6",
57
+ "NUM_7",
58
+ "NUM_8",
59
+ "NUM_9",
60
+ "a",
61
+ "b",
62
+ "c",
63
+ "d",
64
+ "e",
65
+ "f",
66
+ "g",
67
+ "h",
68
+ "i",
69
+ "j",
70
+ "k",
71
+ "l",
72
+ "m",
73
+ "n",
74
+ "o",
75
+ "p",
76
+ "q",
77
+ "r",
78
+ "s",
79
+ "t",
80
+ "u",
81
+ "v",
82
+ "w",
83
+ "x",
84
+ "y",
85
+ "z",
86
+ "A",
87
+ "B",
88
+ "C",
89
+ "D",
90
+ "E",
91
+ "F",
92
+ "G",
93
+ "H",
94
+ "I",
95
+ "J",
96
+ "K",
97
+ "L",
98
+ "M",
99
+ "N",
100
+ "O",
101
+ "P",
102
+ "Q",
103
+ "R",
104
+ "S",
105
+ "T",
106
+ "U",
107
+ "V",
108
+ "W",
109
+ "X",
110
+ "Y",
111
+ "Z",
112
112
 
113
113
  // Currently only used by
114
114
  // Perseus' Expression MathInput
115
- | "PHI"
116
- | "NTHROOT3"
117
- | "POW"
118
- | "LOG_B";
115
+ "PHI",
116
+ "NTHROOT3",
117
+ "POW",
118
+ "LOG_B",
119
+ ] as const;
120
+
121
+ type Key = typeof KeyArray[number];
119
122
 
120
123
  export default Key;
package/src/index.ts CHANGED
@@ -43,6 +43,7 @@ export type {KeypadAPI, KeypadConfiguration} from "./types";
43
43
 
44
44
  // Key list, configuration map, and types
45
45
  export type {default as Keys} from "./data/keys";
46
+ export {KeyArray} from "./data/keys";
46
47
  export {default as KeyConfigs} from "./data/key-configs";
47
48
  export {type KeyType, KeypadType} from "./enums";
48
49