@khanacademy/perseus-editor 20.0.0 → 20.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { addLibraryVersionToPerseusDebug } from '@khanacademy/perseus-utils';
|
|
2
2
|
import _extends from '@babel/runtime/helpers/extends';
|
|
3
|
-
import { components, Widgets, iconChevronDown, iconTrash, WIDGET_PROP_DENYLIST, Util, Log, PerseusMarkdown, preprocessTex, ApiOptions, itemDataVersion, ClassNames, usePerseusI18n, Renderer, Categorizer as Categorizer$1, Changeable, EditorJsonify, Dependencies, Expression, interactiveSizes, GrapherWidget, GrapherUtil, containerSizeClass, getInteractiveBoxFromSizeClass,
|
|
3
|
+
import { components, Widgets, iconChevronDown, iconTrash, WIDGET_PROP_DENYLIST, Util, Log, PerseusMarkdown, preprocessTex, ApiOptions, itemDataVersion, ClassNames, usePerseusI18n, Renderer, Categorizer as Categorizer$1, Changeable, EditorJsonify, Dependencies, Expression, interactiveSizes, GrapherWidget, GrapherUtil, containerSizeClass, getInteractiveBoxFromSizeClass, KhanColors, mathOnlyParser, getAngleCoords, getPolygonCoords, getPointCoords, getQuadraticCoords, getSinusoidCoords, getCircleCoords, getLinearSystemCoords, getSegmentCoords, getLineCoords, InteractiveGraphWidget, bodyXsmallBold, MatrixWidget, makeSafeUrl, PlotterWidget, BaseRadio, TableWidget, widgets } from '@khanacademy/perseus';
|
|
4
4
|
export { widgets } from '@khanacademy/perseus';
|
|
5
5
|
import { CoreWidgetRegistry, upgradeWidgetInfoToLatestVersion, PerseusError, Errors, ItemExtras, categorizerLogic, csProgramLogic, definitionLogic, dropdownLogic, explanationLogic, expressionLogic, deriveExtraKeys, PerseusExpressionAnswerFormConsidered, gradedGroupLogic, gradedGroupSetLogic, grapherLogic, GrapherUtil as GrapherUtil$1, groupLogic, iframeLogic, imageLogic, inputNumberLogic, interactionLogic, lockedFigureColors, lockedFigureFillStyles, interactiveGraphLogic, labelImageLogic, matcherLogic, matrixLogic, getMatrixSize, measurerLogic, numberLineLogic, numericInputLogic, ordererLogic, passageLogic, passageRefLogic, passageRefTargetLogic, phetSimulationLogic, plotterLogic, plotterPlotTypes, pythonProgramLogic, radioLogic, deriveNumCorrect, sorterLogic, tableLogic, videoLogic } from '@khanacademy/perseus-core';
|
|
6
6
|
import * as React from 'react';
|
|
@@ -57,7 +57,7 @@ import arrowCounterClockwise from '@phosphor-icons/core/bold/arrow-counter-clock
|
|
|
57
57
|
// In dev, you'll never see the version number.
|
|
58
58
|
|
|
59
59
|
const libName = "@khanacademy/perseus-editor";
|
|
60
|
-
const libVersion = "20.0.
|
|
60
|
+
const libVersion = "20.0.1";
|
|
61
61
|
addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
62
62
|
|
|
63
63
|
const devices = {
|
|
@@ -9387,7 +9387,7 @@ class InputNumberEditor extends React.Component {
|
|
|
9387
9387
|
super(...args);
|
|
9388
9388
|
this.input = /*#__PURE__*/React.createRef();
|
|
9389
9389
|
this.handleAnswerChange = str => {
|
|
9390
|
-
const value = Util.firstNumericalParse(str
|
|
9390
|
+
const value = Util.firstNumericalParse(str) || 0;
|
|
9391
9391
|
this.props.onChange({
|
|
9392
9392
|
value: value
|
|
9393
9393
|
});
|
|
@@ -9453,7 +9453,7 @@ class InputNumberEditor extends React.Component {
|
|
|
9453
9453
|
defaultValue: this.props.maxError,
|
|
9454
9454
|
"aria-label": "Max error",
|
|
9455
9455
|
onBlur: e => {
|
|
9456
|
-
const ans = "" + (Util.firstNumericalParse(e.target.value
|
|
9456
|
+
const ans = "" + (Util.firstNumericalParse(e.target.value) || 0);
|
|
9457
9457
|
e.target.value = ans;
|
|
9458
9458
|
this.props.onChange({
|
|
9459
9459
|
maxError: ans
|
|
@@ -9491,7 +9491,6 @@ class InputNumberEditor extends React.Component {
|
|
|
9491
9491
|
}), " ", "Right alignment")));
|
|
9492
9492
|
}
|
|
9493
9493
|
}
|
|
9494
|
-
InputNumberEditor.contextType = PerseusI18nContext;
|
|
9495
9494
|
InputNumberEditor.widgetName = "input-number";
|
|
9496
9495
|
InputNumberEditor.defaultProps = inputNumberLogic.defaultWidgetOptions;
|
|
9497
9496
|
|
|
@@ -17984,7 +17983,7 @@ class NumericInputEditor extends React.Component {
|
|
|
17984
17983
|
header: /*#__PURE__*/React.createElement(LabelLarge, null, answerHeading)
|
|
17985
17984
|
}, /*#__PURE__*/React.createElement("div", {
|
|
17986
17985
|
className: "input-answer-editor-value-container" + (answer.maxError ? " with-max-error" : "")
|
|
17987
|
-
}, /*#__PURE__*/React.createElement("label", null, "User input:"
|
|
17986
|
+
}, /*#__PURE__*/React.createElement("label", null, "User input:", /*#__PURE__*/React.createElement(NumberInput$4, {
|
|
17988
17987
|
value: answer.value,
|
|
17989
17988
|
className: "numeric-input-value",
|
|
17990
17989
|
placeholder: "answer",
|
|
@@ -18012,16 +18011,16 @@ class NumericInputEditor extends React.Component {
|
|
|
18012
18011
|
forms = ["proper", "improper"];
|
|
18013
18012
|
}
|
|
18014
18013
|
this.updateAnswer(i, {
|
|
18015
|
-
value: firstNumericalParse(newValue
|
|
18014
|
+
value: firstNumericalParse(newValue),
|
|
18016
18015
|
answerForms: forms
|
|
18017
18016
|
});
|
|
18018
18017
|
},
|
|
18019
18018
|
onChange: newValue => {
|
|
18020
18019
|
this.updateAnswer(i, {
|
|
18021
|
-
value: firstNumericalParse(newValue
|
|
18020
|
+
value: firstNumericalParse(newValue)
|
|
18022
18021
|
});
|
|
18023
18022
|
}
|
|
18024
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
18023
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
18025
18024
|
className: "max-error-plusmn"
|
|
18026
18025
|
}, "\xB1"), /*#__PURE__*/React.createElement(NumberInput$4, {
|
|
18027
18026
|
className: "max-error-input-value",
|
|
@@ -18092,7 +18091,6 @@ class NumericInputEditor extends React.Component {
|
|
|
18092
18091
|
}, "Add new answer"))));
|
|
18093
18092
|
}
|
|
18094
18093
|
}
|
|
18095
|
-
NumericInputEditor.contextType = PerseusI18nContext;
|
|
18096
18094
|
NumericInputEditor.widgetName = "numeric-input";
|
|
18097
18095
|
NumericInputEditor.displayName = "NumericInputEditor";
|
|
18098
18096
|
NumericInputEditor.defaultProps = numericInputLogic.defaultWidgetOptions;
|