@khanacademy/math-input 23.0.0 → 23.0.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/es/index.js +1 -34
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +1 -34
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -88,7 +88,7 @@ const addLibraryVersionToPerseusDebug = (libraryName, libraryVersion) => {
|
|
|
88
88
|
|
|
89
89
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
90
90
|
const libName = "@khanacademy/math-input";
|
|
91
|
-
const libVersion = "23.0.
|
|
91
|
+
const libVersion = "23.0.1";
|
|
92
92
|
addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
93
93
|
|
|
94
94
|
class View extends React__namespace.Component {
|
|
@@ -872,37 +872,6 @@ function handleBackspaceInLogIndex(mathField, cursor) {
|
|
|
872
872
|
mathField.keystroke("Backspace");
|
|
873
873
|
}
|
|
874
874
|
}
|
|
875
|
-
function handleBackspaceOutsideParens(cursor) {
|
|
876
|
-
// In this case the node with '\\left(' for its ctrlSeq
|
|
877
|
-
// is the parent of the expression contained within the
|
|
878
|
-
// parentheses.
|
|
879
|
-
//
|
|
880
|
-
// Handle selecting an expression before deleting:
|
|
881
|
-
// (x+1)| => |(x+1)|
|
|
882
|
-
// \log(x+1)| => |\log(x+1)|
|
|
883
|
-
|
|
884
|
-
const leftNode = cursor[mathQuillInstance.L];
|
|
885
|
-
const rightNode = cursor[mathQuillInstance.R];
|
|
886
|
-
const command = maybeFindCommandBeforeParens(leftNode);
|
|
887
|
-
if (command && command.startNode) {
|
|
888
|
-
// There's a command before the parens so we select it as well as
|
|
889
|
-
// the parens.
|
|
890
|
-
cursor.insLeftOf(command.startNode);
|
|
891
|
-
cursor.startSelection();
|
|
892
|
-
if (rightNode === MathFieldActionType.MQ_END) {
|
|
893
|
-
cursor.insAtRightEnd(cursor.parent);
|
|
894
|
-
} else {
|
|
895
|
-
cursor.insLeftOf(rightNode);
|
|
896
|
-
}
|
|
897
|
-
cursor.select();
|
|
898
|
-
cursor.endSelection();
|
|
899
|
-
} else {
|
|
900
|
-
cursor.startSelection();
|
|
901
|
-
cursor.insLeftOf(leftNode); // left of \\left(
|
|
902
|
-
cursor.select();
|
|
903
|
-
cursor.endSelection();
|
|
904
|
-
}
|
|
905
|
-
}
|
|
906
875
|
function handleBackspaceInsideParens(mathField, cursor) {
|
|
907
876
|
// Handle situations when the cursor is inside parens or a
|
|
908
877
|
// command that uses parens, e.g. \log() or \tan()
|
|
@@ -993,8 +962,6 @@ function handleBackspace(mathField) {
|
|
|
993
962
|
selectNode(leftNode, cursor);
|
|
994
963
|
} else if (isNthRootIndex(parent)) {
|
|
995
964
|
handleBackspaceInRootIndex(mathField, cursor);
|
|
996
|
-
} else if (leftNode.ctrlSeq === "\\left(") {
|
|
997
|
-
handleBackspaceOutsideParens(cursor);
|
|
998
965
|
} else if (grandparent.ctrlSeq === "\\left(") {
|
|
999
966
|
handleBackspaceInsideParens(mathField, cursor);
|
|
1000
967
|
} else if (isInsideLogIndex(cursor)) {
|