@khanacademy/math-input 20.1.0 → 20.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/dist/components/keypad/utils.d.ts +1 -1
- package/dist/data/key-configs.d.ts +0 -6
- package/dist/data/keys.d.ts +1 -1
- package/dist/es/index.js +2 -82
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +2 -94
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +2 -7
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -44,7 +44,7 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
44
44
|
|
|
45
45
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
46
46
|
const libName = "@khanacademy/math-input";
|
|
47
|
-
const libVersion = "20.1.
|
|
47
|
+
const libVersion = "20.1.1";
|
|
48
48
|
perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
49
49
|
|
|
50
50
|
function _extends() {
|
|
@@ -1327,7 +1327,6 @@ const getKeyTranslator = locale => ({
|
|
|
1327
1327
|
LEFT_PAREN: buildGenericCallback("(", ActionType.CMD),
|
|
1328
1328
|
RIGHT_PAREN: buildGenericCallback(")", ActionType.CMD),
|
|
1329
1329
|
SQRT: buildGenericCallback("sqrt", ActionType.CMD),
|
|
1330
|
-
PHI: buildGenericCallback("\\phi", ActionType.CMD),
|
|
1331
1330
|
PI: buildGenericCallback("pi", ActionType.CMD),
|
|
1332
1331
|
THETA: buildGenericCallback("theta", ActionType.CMD),
|
|
1333
1332
|
RADICAL: buildGenericCallback("nthroot", ActionType.CMD),
|
|
@@ -1349,13 +1348,6 @@ const getKeyTranslator = locale => ({
|
|
|
1349
1348
|
mathQuill.keystroke("Left");
|
|
1350
1349
|
}
|
|
1351
1350
|
},
|
|
1352
|
-
LOG_B: mathQuill => {
|
|
1353
|
-
mathQuill.typedText("log_");
|
|
1354
|
-
mathQuill.keystroke("Right");
|
|
1355
|
-
mathQuill.typedText("(");
|
|
1356
|
-
mathQuill.keystroke("Left");
|
|
1357
|
-
mathQuill.keystroke("Left");
|
|
1358
|
-
},
|
|
1359
1351
|
LOG_N: mathQuill => {
|
|
1360
1352
|
mathQuill.write("log_{ }\\left(\\right)");
|
|
1361
1353
|
mathQuill.keystroke("Left"); // into parentheses
|
|
@@ -1363,26 +1355,9 @@ const getKeyTranslator = locale => ({
|
|
|
1363
1355
|
mathQuill.keystroke("Left"); // into index
|
|
1364
1356
|
},
|
|
1365
1357
|
|
|
1366
|
-
NTHROOT3: mathQuill => {
|
|
1367
|
-
mathQuill.typedText("nthroot3");
|
|
1368
|
-
mathQuill.keystroke("Right");
|
|
1369
|
-
},
|
|
1370
|
-
POW: mathQuill => {
|
|
1371
|
-
const contents = mathQuill.latex();
|
|
1372
|
-
mathQuill.typedText("^");
|
|
1373
|
-
|
|
1374
|
-
// If the input hasn't changed (for example, if we're
|
|
1375
|
-
// attempting to add an exponent on an empty input or an empty
|
|
1376
|
-
// denominator), insert our own "a^b"
|
|
1377
|
-
if (mathQuill.latex() === contents) {
|
|
1378
|
-
mathQuill.typedText("a^b");
|
|
1379
|
-
}
|
|
1380
|
-
},
|
|
1381
1358
|
// These need to be overwritten by the consumer
|
|
1382
1359
|
// if they're going to be used
|
|
1383
1360
|
DISMISS: () => {},
|
|
1384
|
-
NOOP: () => {},
|
|
1385
|
-
MANY: () => {},
|
|
1386
1361
|
NUM_0: buildGenericCallback("0"),
|
|
1387
1362
|
NUM_1: buildGenericCallback("1"),
|
|
1388
1363
|
NUM_2: buildGenericCallback("2"),
|
|
@@ -3049,12 +3024,6 @@ const KeyConfigs = strings => ({
|
|
|
3049
3024
|
ariaLabel: strings.theta
|
|
3050
3025
|
})
|
|
3051
3026
|
},
|
|
3052
|
-
NOOP: {
|
|
3053
|
-
...getDefaultOperatorFields({
|
|
3054
|
-
key: "NOOP",
|
|
3055
|
-
keyType: "EMPTY"
|
|
3056
|
-
})
|
|
3057
|
-
},
|
|
3058
3027
|
// Input navigation
|
|
3059
3028
|
UP: {
|
|
3060
3029
|
...getDefaultOperatorFields({
|
|
@@ -3141,13 +3110,6 @@ const KeyConfigs = strings => ({
|
|
|
3141
3110
|
ariaLabel: strings.dismiss
|
|
3142
3111
|
})
|
|
3143
3112
|
},
|
|
3144
|
-
// TODO(charlie): Use the numeral color for the 'Many' key.
|
|
3145
|
-
MANY: {
|
|
3146
|
-
...getDefaultOperatorFields({
|
|
3147
|
-
key: "MANY",
|
|
3148
|
-
keyType: "MANY"
|
|
3149
|
-
})
|
|
3150
|
-
},
|
|
3151
3113
|
// NUMBERS
|
|
3152
3114
|
NUM_0: {
|
|
3153
3115
|
...getDefaultNumberFields({
|
|
@@ -3459,26 +3421,6 @@ const KeyConfigs = strings => ({
|
|
|
3459
3421
|
...getDefaultValueFields({
|
|
3460
3422
|
key: "z"
|
|
3461
3423
|
})
|
|
3462
|
-
},
|
|
3463
|
-
PHI: {
|
|
3464
|
-
...getDefaultValueFields({
|
|
3465
|
-
key: "PHI"
|
|
3466
|
-
})
|
|
3467
|
-
},
|
|
3468
|
-
NTHROOT3: {
|
|
3469
|
-
...getDefaultValueFields({
|
|
3470
|
-
key: "NTHROOT3"
|
|
3471
|
-
})
|
|
3472
|
-
},
|
|
3473
|
-
POW: {
|
|
3474
|
-
...getDefaultValueFields({
|
|
3475
|
-
key: "POW"
|
|
3476
|
-
})
|
|
3477
|
-
},
|
|
3478
|
-
LOG_B: {
|
|
3479
|
-
...getDefaultValueFields({
|
|
3480
|
-
key: "LOG_B"
|
|
3481
|
-
})
|
|
3482
3424
|
}
|
|
3483
3425
|
});
|
|
3484
3426
|
|
|
@@ -4892,33 +4834,6 @@ function ButtonAsset(_ref) {
|
|
|
4892
4834
|
strokeLinejoin: "round",
|
|
4893
4835
|
d: "M22 18l-6 6 6 6M16 24h16"
|
|
4894
4836
|
})));
|
|
4895
|
-
|
|
4896
|
-
/**
|
|
4897
|
-
* ANYTHING BELOW IS NOT YET HANDLED
|
|
4898
|
-
*/
|
|
4899
|
-
case "MANY":
|
|
4900
|
-
case "NOOP":
|
|
4901
|
-
case "PHI":
|
|
4902
|
-
case "NTHROOT3":
|
|
4903
|
-
case "POW":
|
|
4904
|
-
case "LOG_B":
|
|
4905
|
-
// placeholder
|
|
4906
|
-
return /*#__PURE__*/React__namespace.createElement("svg", {
|
|
4907
|
-
width: "40",
|
|
4908
|
-
height: "40",
|
|
4909
|
-
viewBox: "0 0 40 40",
|
|
4910
|
-
fill: "black",
|
|
4911
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
4912
|
-
}, /*#__PURE__*/React__namespace.createElement("text", {
|
|
4913
|
-
y: "20",
|
|
4914
|
-
textLength: "100%",
|
|
4915
|
-
lengthAdjust: "spacingAndGlyphs"
|
|
4916
|
-
}, id), /*#__PURE__*/React__namespace.createElement("text", {
|
|
4917
|
-
y: "35",
|
|
4918
|
-
textLength: "100%",
|
|
4919
|
-
lengthAdjust: "spacingAndGlyphs",
|
|
4920
|
-
fill: "red"
|
|
4921
|
-
}, "placeholder"));
|
|
4922
4837
|
default:
|
|
4923
4838
|
// this line forces an exhaustive check of all keys;
|
|
4924
4839
|
// if a key is not handled, the compiler will complain.
|
|
@@ -6183,14 +6098,7 @@ const KeyArray = ["PLUS", "MINUS", "NEGATIVE", "TIMES", "DIVIDE", "DECIMAL", "PE
|
|
|
6183
6098
|
// TODO(charlie): Add in additional Greek letters.,
|
|
6184
6099
|
"TAN", "PI", "THETA", "UP", "RIGHT", "DOWN", "LEFT", "BACKSPACE", "DISMISS", "JUMP_OUT_PARENTHESES", "JUMP_OUT_EXPONENT", "JUMP_OUT_BASE", "JUMP_INTO_NUMERATOR", "JUMP_OUT_NUMERATOR", "JUMP_OUT_DENOMINATOR",
|
|
6185
6100
|
// Multi-functional keys.
|
|
6186
|
-
"
|
|
6187
|
-
// mobile native only
|
|
6188
|
-
"MANY",
|
|
6189
|
-
// A custom key that captures an arbitrary number of symbols but has no 'default' symbol or action.
|
|
6190
|
-
"NUM_0", "NUM_1", "NUM_2", "NUM_3", "NUM_4", "NUM_5", "NUM_6", "NUM_7", "NUM_8", "NUM_9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
|
|
6191
|
-
// Currently only used by
|
|
6192
|
-
// Perseus' Expression MathInput
|
|
6193
|
-
"PHI", "NTHROOT3", "POW", "LOG_B"];
|
|
6101
|
+
"NUM_0", "NUM_1", "NUM_2", "NUM_3", "NUM_4", "NUM_5", "NUM_6", "NUM_7", "NUM_8", "NUM_9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"];
|
|
6194
6102
|
|
|
6195
6103
|
/**
|
|
6196
6104
|
* Constants that are shared between multiple files.
|