@khanacademy/perseus 59.0.0 → 59.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/components/number-input.d.ts +0 -3
- package/dist/es/index.js +4 -5
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +4 -5
- package/dist/index.js.map +1 -1
- package/dist/util.d.ts +1 -2
- package/package.json +2 -2
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { PerseusI18nContext } from "./i18n-context";
|
|
3
2
|
import type { MathFormat } from "@khanacademy/perseus-core";
|
|
4
3
|
/**
|
|
5
4
|
* An input box that accepts only numeric strings
|
|
@@ -21,8 +20,6 @@ import type { MathFormat } from "@khanacademy/perseus-core";
|
|
|
21
20
|
* Optionally takes a `size` (`"mini"`, `"small"`,` `"normal"`)
|
|
22
21
|
*/
|
|
23
22
|
declare class NumberInput extends React.Component<any, any> {
|
|
24
|
-
static contextType: React.Context<import("./i18n-context").I18nContextType>;
|
|
25
|
-
context: React.ContextType<typeof PerseusI18nContext>;
|
|
26
23
|
inputRef: React.RefObject<HTMLInputElement>;
|
|
27
24
|
static propTypes: {
|
|
28
25
|
value: any;
|
package/dist/es/index.js
CHANGED
|
@@ -2124,7 +2124,7 @@ const split = "x".split(/(.)/g).length ? function (str, r) {
|
|
|
2124
2124
|
* Return the first valid interpretation of 'text' as a number, in the form
|
|
2125
2125
|
* {value: 2.3, exact: true}.
|
|
2126
2126
|
*/
|
|
2127
|
-
function firstNumericalParse$1(text
|
|
2127
|
+
function firstNumericalParse$1(text) {
|
|
2128
2128
|
// TODO(alpert): This is sort of hacky...
|
|
2129
2129
|
let first;
|
|
2130
2130
|
const val = KhanAnswerTypes.predicate.createValidatorFunctional(function (ans) {
|
|
@@ -28816,7 +28816,7 @@ class NumberInput extends React.Component {
|
|
|
28816
28816
|
const placeholder = this.props.placeholder;
|
|
28817
28817
|
return _.isFinite(placeholder) ? +placeholder : null;
|
|
28818
28818
|
}
|
|
28819
|
-
const result = firstNumericalParse(value
|
|
28819
|
+
const result = firstNumericalParse(value);
|
|
28820
28820
|
return _.isFinite(result) ? result : this.props.value;
|
|
28821
28821
|
};
|
|
28822
28822
|
/* Set text input focus to this input */
|
|
@@ -28841,7 +28841,7 @@ class NumberInput extends React.Component {
|
|
|
28841
28841
|
if (value == null) {
|
|
28842
28842
|
return true;
|
|
28843
28843
|
}
|
|
28844
|
-
const val = firstNumericalParse(value
|
|
28844
|
+
const val = firstNumericalParse(value);
|
|
28845
28845
|
const checkValidity = this.props.checkValidity;
|
|
28846
28846
|
return _.isFinite(val) && checkValidity(val);
|
|
28847
28847
|
};
|
|
@@ -28943,7 +28943,6 @@ class NumberInput extends React.Component {
|
|
|
28943
28943
|
}));
|
|
28944
28944
|
}
|
|
28945
28945
|
}
|
|
28946
|
-
NumberInput.contextType = PerseusI18nContext;
|
|
28947
28946
|
NumberInput.propTypes = {
|
|
28948
28947
|
value: PropTypes.number,
|
|
28949
28948
|
format: PropTypes.string,
|
|
@@ -41707,7 +41706,7 @@ const init = function init() {
|
|
|
41707
41706
|
// In dev, you'll never see the version number.
|
|
41708
41707
|
|
|
41709
41708
|
const libName = "@khanacademy/perseus";
|
|
41710
|
-
const libVersion = "59.0.
|
|
41709
|
+
const libVersion = "59.0.1";
|
|
41711
41710
|
addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
41712
41711
|
|
|
41713
41712
|
const apiVersion = {
|