@khanacademy/math-input 18.0.1 → 19.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.
@@ -12,4 +12,4 @@ export declare const mathQuillInstance: MathQuillInterface;
12
12
  * This allows callers to do minimal configuration as only configs
13
13
  * that vary from the default need to be provided.
14
14
  */
15
- export declare function createMathField(container: HTMLDivElement | HTMLSpanElement, strings: MathInputStrings, configCallback?: (baseConfig: MathFieldConfig) => MathFieldConfig): MathFieldInterface;
15
+ export declare function createMathField(container: HTMLDivElement | HTMLSpanElement, locale: string, strings: MathInputStrings, configCallback?: (baseConfig: MathFieldConfig) => MathFieldConfig): MathFieldInterface;
package/dist/es/index.js CHANGED
@@ -15,7 +15,7 @@ import PropTypes from 'prop-types';
15
15
 
16
16
  // This file is processed by a Rollup plugin (replace) to inject the production
17
17
  const libName = "@khanacademy/math-input";
18
- const libVersion = "18.0.1";
18
+ const libVersion = "19.0.0";
19
19
  addLibraryVersionToPerseusDebug(libName, libVersion);
20
20
 
21
21
  function _extends() {
@@ -557,7 +557,7 @@ const createBaseConfig = () => ({
557
557
  * This allows callers to do minimal configuration as only configs
558
558
  * that vary from the default need to be provided.
559
559
  */
560
- function createMathField(container, strings, configCallback) {
560
+ function createMathField(container, locale, strings, configCallback) {
561
561
  const baseConfig = createBaseConfig();
562
562
  const config = configCallback ? configCallback(baseConfig) : baseConfig;
563
563
  const mathField = mathQuillInstance.MathField(container, config).setAriaLabel(strings.mathInputBox).setAriaStringsOverrideMap({
@@ -594,7 +594,7 @@ function createMathField(container, 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
- !inJest && SpeechRuleEngine.setup().then(SRE => mathField.setMathspeakOverride(SRE.texToSpeech));
597
+ !inJest && SpeechRuleEngine.setup(locale).then(SRE => mathField.setMathspeakOverride(SRE.texToSpeech));
598
598
  return mathField;
599
599
  }
600
600
 
@@ -1407,7 +1407,7 @@ class MathWrapper {
1407
1407
  // MathQuill MathField input
1408
1408
  this.callbacks = void 0;
1409
1409
  this.mobileKeyTranslator = void 0;
1410
- this.mathField = createMathField(element, strings, () => {
1410
+ this.mathField = createMathField(element, locale, strings, () => {
1411
1411
  return {
1412
1412
  // use a span instead of a textarea so that we don't bring up the
1413
1413
  // native keyboard on mobile when selecting the input