@khanacademy/math-input 21.1.6 → 22.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/dist/index.js CHANGED
@@ -45,7 +45,7 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
45
45
 
46
46
  // This file is processed by a Rollup plugin (replace) to inject the production
47
47
  const libName = "@khanacademy/math-input";
48
- const libVersion = "21.1.6";
48
+ const libVersion = "22.0.0";
49
49
  perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
50
50
 
51
51
  function _extends() {
@@ -594,6 +594,7 @@ function createMathField(container, locale, strings, configCallback) {
594
594
  // HTTP request to fetch non-english speech rules, and cannot be easily
595
595
  // mocked in consuming packages now that we do not bundle source code.
596
596
  // When it eventually times out, it will cause arbitrary test failures.
597
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions
597
598
  !inJest && mathjaxRenderer.SpeechRuleEngine.setup(locale).then(SRE => mathField.setMathspeakOverride(SRE.texToSpeech));
598
599
  return mathField;
599
600
  }
@@ -1610,7 +1611,7 @@ class MathInput extends React__namespace.Component {
1610
1611
  // this `MathInput` component in an intermediary component
1611
1612
  // that translates accesses on the keypad into vanilla props,
1612
1613
  // to make this input keypad-agnostic.
1613
- this.props.keypadElement && this.props.keypadElement.setCursor(cursor);
1614
+ this.props.keypadElement?.setCursor(cursor);
1614
1615
  }
1615
1616
  });
1616
1617
  this.mathField.setContent(this.props.value);
@@ -1702,7 +1703,7 @@ class MathInput extends React__namespace.Component {
1702
1703
  // in which case we don't want to dismiss the keypad on check.
1703
1704
  if (!isWithinKeypadBounds(x, y)) {
1704
1705
  this.blur();
1705
- this.props.onBlur && this.props.onBlur();
1706
+ this.props.onBlur?.();
1706
1707
  }
1707
1708
  }
1708
1709
  }
@@ -2017,7 +2018,7 @@ class MathInput extends React__namespace.Component {
2017
2018
  cursor.insAtLeftEnd(this.mathField.mathField.controller().root);
2018
2019
  }
2019
2020
  // In that event, we need to update the cursor context ourselves.
2020
- this.props.keypadElement && this.props.keypadElement.setCursor({
2021
+ this.props.keypadElement?.setCursor({
2021
2022
  context: this.mathField.contextForCursor()
2022
2023
  });
2023
2024
  };