@khanacademy/math-input 20.0.3 → 20.1.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
@@ -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.0.3";
47
+ const libVersion = "20.1.0";
48
48
  perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
49
49
 
50
50
  function _extends() {
@@ -1457,9 +1457,9 @@ class MathWrapper {
1457
1457
  mathField; // MathQuill MathField input
1458
1458
  callbacks;
1459
1459
  mobileKeyTranslator;
1460
- constructor(element, strings, locale) {
1461
- let callbacks = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
1462
- this.mathField = createMathField(element, locale, strings, () => {
1460
+ constructor(mathFieldMount, ariaLabel, strings, locale) {
1461
+ let callbacks = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
1462
+ this.mathField = createMathField(mathFieldMount, locale, strings, () => {
1463
1463
  return {
1464
1464
  // use a span instead of a textarea so that we don't bring up the
1465
1465
  // native keyboard on mobile when selecting the input
@@ -1468,6 +1468,7 @@ class MathWrapper {
1468
1468
  }
1469
1469
  };
1470
1470
  });
1471
+ this.mathField?.setAriaLabel(ariaLabel);
1471
1472
  this.callbacks = callbacks;
1472
1473
  this.mobileKeyTranslator = {
1473
1474
  ...getKeyTranslator(locale),
@@ -1689,7 +1690,7 @@ class MathInput extends React__namespace.Component {
1689
1690
  };
1690
1691
  componentDidMount() {
1691
1692
  this._isMounted = true;
1692
- this.mathField = new MathWrapper(this._mathContainer, this.context.strings, this.context.locale, {
1693
+ this.mathField = new MathWrapper(this._mathContainer, this.props.ariaLabel, this.context.strings, this.context.locale, {
1693
1694
  onCursorMove: cursor => {
1694
1695
  // TODO(charlie): It's not great that there is so much coupling
1695
1696
  // between this keypad and the input behavior. We should wrap