@khanacademy/perseus-editor 2.3.3 → 2.3.5
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/CHANGELOG.md +13 -0
- package/dist/es/index.js +5 -8
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +4 -7
- package/dist/index.js.map +1 -1
- package/dist/widgets/expression-editor.d.ts +1 -1
- package/dist/widgets/expression-editor.js.flow +3 -1
- package/package.json +2 -2
- package/src/widgets/expression-editor.tsx +11 -8
- package/tsconfig-build.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @khanacademy/perseus-editor
|
|
2
2
|
|
|
3
|
+
## 2.3.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @khanacademy/perseus@6.4.1
|
|
8
|
+
|
|
9
|
+
## 2.3.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [1f3fdc6c]
|
|
14
|
+
- @khanacademy/perseus@6.4.0
|
|
15
|
+
|
|
3
16
|
## 2.3.3
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/es/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { constants, components, Widgets, icons, WIDGET_PROP_DENYLIST, Util, Log, PerseusError, Errors, PerseusMarkdown, preprocessTex, ApiOptions, buildMapper, itemToTree, buildEmptyItemTreeForShape, shapes, itemDataVersion, ClassNames, MultiItems, traverse, Categorizer as Categorizer$1, Changeable, EditorJsonify, Dependencies, WidgetJsonifyDeprecated, Expression, interactiveSizes, KhanMath, GrapherWidget, GrapherUtil, SizingUtils, KhanColors, ColorPicker, DashPicker, ArrowPicker, ElementContainer, InteractiveGraphWidget, globalStyles, globalConstants, MatrixWidget, PlotterWidget, BaseRadio, TableWidget, TransformerWidget, displaySigFigs, widgets } from '@khanacademy/perseus';
|
|
1
|
+
import { constants, components, Widgets, icons, WIDGET_PROP_DENYLIST, Util, Log, PerseusError, Errors, PerseusMarkdown, preprocessTex, ApiOptions, buildMapper, itemToTree, buildEmptyItemTreeForShape, shapes, itemDataVersion, ClassNames, MultiItems, traverse, Categorizer as Categorizer$1, Changeable, EditorJsonify, Dependencies, WidgetJsonifyDeprecated, PerseusExpressionAnswerFormConsidered, Expression, interactiveSizes, KhanMath, GrapherWidget, GrapherUtil, SizingUtils, KhanColors, ColorPicker, DashPicker, ArrowPicker, ElementContainer, InteractiveGraphWidget, globalStyles, globalConstants, MatrixWidget, PlotterWidget, BaseRadio, TableWidget, TransformerWidget, displaySigFigs, widgets } from '@khanacademy/perseus';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import _ from 'underscore';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
@@ -23907,11 +23907,8 @@ const {
|
|
|
23907
23907
|
const {
|
|
23908
23908
|
getDependencies: getDependencies$2
|
|
23909
23909
|
} = Dependencies;
|
|
23910
|
-
|
|
23911
|
-
// An answer can be considered correct, wrong, or ungraded.
|
|
23912
|
-
const CONSIDERED = ["correct", "wrong", "ungraded"];
|
|
23913
23910
|
const answerFormType = PropTypes.shape({
|
|
23914
|
-
considered: PropTypes.oneOf(
|
|
23911
|
+
considered: PropTypes.oneOf(PerseusExpressionAnswerFormConsidered).isRequired,
|
|
23915
23912
|
value: PropTypes.string.isRequired,
|
|
23916
23913
|
form: PropTypes.bool.isRequired,
|
|
23917
23914
|
simplify: PropTypes.bool.isRequired
|
|
@@ -24212,7 +24209,7 @@ ExpressionEditor.defaultProps = {
|
|
|
24212
24209
|
functions: ["f", "g", "h"]
|
|
24213
24210
|
};
|
|
24214
24211
|
const findNextIn = function findNextIn(arr, val) {
|
|
24215
|
-
let ix =
|
|
24212
|
+
let ix = arr.indexOf(val);
|
|
24216
24213
|
ix = (ix + 1) % arr.length;
|
|
24217
24214
|
return arr[ix];
|
|
24218
24215
|
};
|
|
@@ -24239,7 +24236,7 @@ class AnswerOption extends React.Component {
|
|
|
24239
24236
|
});
|
|
24240
24237
|
};
|
|
24241
24238
|
this.toggleConsidered = () => {
|
|
24242
|
-
const newVal = findNextIn(
|
|
24239
|
+
const newVal = findNextIn(PerseusExpressionAnswerFormConsidered, this.props.considered);
|
|
24243
24240
|
this.change({
|
|
24244
24241
|
considered: newVal
|
|
24245
24242
|
});
|
|
@@ -24296,7 +24293,7 @@ class AnswerOption extends React.Component {
|
|
|
24296
24293
|
}
|
|
24297
24294
|
}
|
|
24298
24295
|
AnswerOption.propTypes = _extends({}, Changeable.propTypes, {
|
|
24299
|
-
considered: PropTypes.oneOf(
|
|
24296
|
+
considered: PropTypes.oneOf(PerseusExpressionAnswerFormConsidered).isRequired,
|
|
24300
24297
|
expressionProps: PropTypes.object.isRequired,
|
|
24301
24298
|
// Must the answer have the same form as this answer.
|
|
24302
24299
|
form: PropTypes.bool.isRequired,
|