@khanacademy/perseus 1.3.3 → 1.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 +119 -66
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +119 -66
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/__snapshots__/item-renderer_test.jsx.snap +1 -1
- package/src/__tests__/__snapshots__/perseus-markdown_test.jsx.snap +111 -111
- package/src/__tests__/__snapshots__/server-item-renderer_test.jsx.snap +1 -1
- package/src/__tests__/item-renderer_test.jsx +9 -9
- package/src/__tests__/jipt-paragraphs_test.js +3 -3
- package/src/__tests__/renderer_test.jsx +22 -22
- package/src/__tests__/server-item-renderer_test.jsx +7 -7
- package/src/components/__tests__/sortable_test.jsx +7 -7
- package/src/components/input-with-examples.jsx +12 -13
- package/src/index.js +1 -0
- package/src/multi-items/__tests__/__snapshots__/multi-renderer_test.js.snap +6 -6
- package/src/multi-items/__tests__/multi-renderer_test.js +90 -90
- package/src/perseus-types.js +5 -4
- package/src/renderer.jsx +2 -2
- package/src/util.js +1 -1
- package/src/widgets/__stories__/input-number.stories.jsx +29 -3
- package/src/widgets/__tests__/__snapshots__/grapher_test.jsx.snap +68 -68
- package/src/widgets/__tests__/__snapshots__/group_test.jsx.snap +5 -5
- package/src/widgets/__tests__/__snapshots__/input-number_test.jsx.snap +1 -1
- package/src/widgets/__tests__/__snapshots__/interaction_test.jsx.snap +5 -5
- package/src/widgets/__tests__/__snapshots__/interactive-graph_test.jsx.snap +2 -2
- package/src/widgets/__tests__/__snapshots__/passage_test.jsx.snap +2 -2
- package/src/widgets/__tests__/__snapshots__/radio_test.jsx.snap +52 -52
- package/src/widgets/__tests__/categorizer_test.jsx +5 -5
- package/src/widgets/__tests__/explanation_test.js +5 -5
- package/src/widgets/__tests__/graded-group-set_test.jsx +2 -2
- package/src/widgets/__tests__/group_test.jsx +49 -49
- package/src/widgets/__tests__/numeric-input_test.jsx +5 -5
- package/src/widgets/__tests__/passage_test.jsx +1 -1
- package/src/widgets/__tests__/radio/base-radio_test.jsx +28 -1
- package/src/widgets/categorizer.jsx +1 -1
- package/src/widgets/expression.jsx +6 -6
- package/src/widgets/input-number.jsx +69 -15
- package/src/widgets/numeric-input.jsx +8 -5
- package/src/widgets/radio/base-radio.jsx +8 -3
- package/src/widgets/radio/choice-icon/library-choice-icon.jsx +2 -2
- package/src/widgets/radio/choice.jsx +1 -1
- package/src/widgets/radio/widget.jsx +2 -2
package/dist/index.js
CHANGED
|
@@ -17851,17 +17851,17 @@ class Lint extends React__namespace.Component {
|
|
|
17851
17851
|
let warningTextStyle;
|
|
17852
17852
|
|
|
17853
17853
|
if (this.props.severity === 1) {
|
|
17854
|
-
severityStyle = styles$
|
|
17854
|
+
severityStyle = styles$B.indicatorError;
|
|
17855
17855
|
warningText = "Error";
|
|
17856
|
-
warningTextStyle = styles$
|
|
17856
|
+
warningTextStyle = styles$B.publishBlockingError;
|
|
17857
17857
|
} else if (this.props.severity === 2) {
|
|
17858
|
-
severityStyle = styles$
|
|
17858
|
+
severityStyle = styles$B.indicatorWarning;
|
|
17859
17859
|
warningText = "Warning";
|
|
17860
|
-
warningTextStyle = styles$
|
|
17860
|
+
warningTextStyle = styles$B.warning;
|
|
17861
17861
|
} else {
|
|
17862
|
-
severityStyle = styles$
|
|
17862
|
+
severityStyle = styles$B.indicatorGuideline;
|
|
17863
17863
|
warningText = "Recommendation";
|
|
17864
|
-
warningTextStyle = styles$
|
|
17864
|
+
warningTextStyle = styles$B.warning;
|
|
17865
17865
|
}
|
|
17866
17866
|
|
|
17867
17867
|
return /*#__PURE__*/React__namespace.createElement("a", {
|
|
@@ -17869,16 +17869,16 @@ class Lint extends React__namespace.Component {
|
|
|
17869
17869
|
target: "lint-help-window",
|
|
17870
17870
|
className: aphrodite.css(style)
|
|
17871
17871
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
17872
|
-
className: aphrodite.css(styles$
|
|
17872
|
+
className: aphrodite.css(styles$B.indicator, severityStyle)
|
|
17873
17873
|
}, this.props.severity === 1 && /*#__PURE__*/React__namespace.createElement(InlineIcon, exclamationIcon)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
17874
|
-
className: aphrodite.css(styles$
|
|
17874
|
+
className: aphrodite.css(styles$B.tooltip, tooltipAbove && styles$B.tooltipAbove)
|
|
17875
17875
|
}, this.props.message.split("\n\n").map((m, i) => /*#__PURE__*/React__namespace.createElement("p", {
|
|
17876
17876
|
key: i,
|
|
17877
|
-
className: aphrodite.css(styles$
|
|
17877
|
+
className: aphrodite.css(styles$B.tooltipParagraph)
|
|
17878
17878
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
17879
17879
|
className: aphrodite.css(warningTextStyle)
|
|
17880
17880
|
}, warningText, ":", " "), m)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
17881
|
-
className: aphrodite.css(styles$
|
|
17881
|
+
className: aphrodite.css(styles$B.tail, tooltipAbove && styles$B.tailAbove)
|
|
17882
17882
|
})));
|
|
17883
17883
|
});
|
|
17884
17884
|
}
|
|
@@ -17926,19 +17926,19 @@ class Lint extends React__namespace.Component {
|
|
|
17926
17926
|
|
|
17927
17927
|
if (blockHighlight) {
|
|
17928
17928
|
return /*#__PURE__*/React__namespace.createElement("span", {
|
|
17929
|
-
className: aphrodite.css(styles$
|
|
17930
|
-
}, this.renderLink(styles$
|
|
17929
|
+
className: aphrodite.css(styles$B.lintContainer, styles$B.lintContainerBlock)
|
|
17930
|
+
}, this.renderLink(styles$B.radioWidgetHoverTarget), /*#__PURE__*/React__namespace.createElement("span", null, children));
|
|
17931
17931
|
}
|
|
17932
17932
|
|
|
17933
17933
|
if (inline) {
|
|
17934
17934
|
return /*#__PURE__*/React__namespace.createElement("span", {
|
|
17935
|
-
className: aphrodite.css(styles$
|
|
17936
|
-
}, this.renderLink(styles$
|
|
17935
|
+
className: aphrodite.css(styles$B.lintContainer)
|
|
17936
|
+
}, this.renderLink(styles$B.inlineHoverTarget), /*#__PURE__*/React__namespace.createElement("span", null, children));
|
|
17937
17937
|
}
|
|
17938
17938
|
|
|
17939
17939
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
17940
|
-
className: aphrodite.css(styles$
|
|
17941
|
-
}, this.renderLink(styles$
|
|
17940
|
+
className: aphrodite.css(styles$B.lintContainer)
|
|
17941
|
+
}, this.renderLink(styles$B.hoverTarget), /*#__PURE__*/React__namespace.createElement("div", null, children));
|
|
17942
17942
|
}
|
|
17943
17943
|
|
|
17944
17944
|
} // $FlowFixMe[prop-missing]
|
|
@@ -17963,7 +17963,7 @@ _defineProperty(Lint, "propTypes", {
|
|
|
17963
17963
|
severity: PropTypes__default["default"].number
|
|
17964
17964
|
});
|
|
17965
17965
|
|
|
17966
|
-
const styles$
|
|
17966
|
+
const styles$B = aphrodite.StyleSheet.create({
|
|
17967
17967
|
// This is the class of the outermost element.
|
|
17968
17968
|
// We use relative positioning so that the lint indicator can be
|
|
17969
17969
|
// positioned absolutely relative to the position of the linty container.
|
|
@@ -19343,7 +19343,7 @@ class Renderer extends React__namespace.Component {
|
|
|
19343
19343
|
// look like a widget ID (ie. `widget-type \d+`). I can't figure
|
|
19344
19344
|
// out how to trigger this line of code though.
|
|
19345
19345
|
|
|
19346
|
-
/*
|
|
19346
|
+
/* c8 ignore next line */
|
|
19347
19347
|
return {};
|
|
19348
19348
|
}
|
|
19349
19349
|
|
|
@@ -19682,7 +19682,7 @@ class Renderer extends React__namespace.Component {
|
|
|
19682
19682
|
// reached. As noted above, these are always QuestionParagraphs
|
|
19683
19683
|
// now.
|
|
19684
19684
|
|
|
19685
|
-
/*
|
|
19685
|
+
/* c8 ignore if */
|
|
19686
19686
|
|
|
19687
19687
|
if (typeof nodeOut === "string" && lastWasString) {
|
|
19688
19688
|
/**
|
|
@@ -19856,7 +19856,7 @@ class Renderer extends React__namespace.Component {
|
|
|
19856
19856
|
paddingRight: margin
|
|
19857
19857
|
};
|
|
19858
19858
|
const mobileInnerStyle = { ...innerStyle,
|
|
19859
|
-
...styles$
|
|
19859
|
+
...styles$A.mobileZoomableParentFix
|
|
19860
19860
|
};
|
|
19861
19861
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
19862
19862
|
key: state.key,
|
|
@@ -19996,7 +19996,7 @@ class Renderer extends React__namespace.Component {
|
|
|
19996
19996
|
paddingRight: 0
|
|
19997
19997
|
};
|
|
19998
19998
|
const mobileInnerStyle = { ...innerStyle,
|
|
19999
|
-
...styles$
|
|
19999
|
+
...styles$A.mobileZoomableParentFix
|
|
20000
20000
|
};
|
|
20001
20001
|
const wrappedOutput = /*#__PURE__*/React__namespace.createElement("div", {
|
|
20002
20002
|
style: { ...mobileInnerStyle,
|
|
@@ -20677,7 +20677,7 @@ _defineProperty(Renderer, "defaultProps", {
|
|
|
20677
20677
|
linterContext: PerseusLinter__namespace.linterContextDefault
|
|
20678
20678
|
});
|
|
20679
20679
|
|
|
20680
|
-
const styles$
|
|
20680
|
+
const styles$A = {
|
|
20681
20681
|
mobileZoomableParentFix: {
|
|
20682
20682
|
// NOTE(abdul): There is an issue where transform animations will
|
|
20683
20683
|
// cause the Zoomable component to disappear when running on the
|
|
@@ -21953,9 +21953,6 @@ const Tooltip = createReactClass__default["default"]({
|
|
|
21953
21953
|
const {
|
|
21954
21954
|
captureScratchpadTouchStart: captureScratchpadTouchStart$3
|
|
21955
21955
|
} = Util;
|
|
21956
|
-
const MATH = "math";
|
|
21957
|
-
const TEXT = "text";
|
|
21958
|
-
const TEX = "tex";
|
|
21959
21956
|
|
|
21960
21957
|
class InputWithExamples extends React__namespace.Component {
|
|
21961
21958
|
constructor() {
|
|
@@ -21973,7 +21970,7 @@ class InputWithExamples extends React__namespace.Component {
|
|
|
21973
21970
|
_defineProperty(this, "_getInputClassName", () => {
|
|
21974
21971
|
// <MathOutput> is a special component that manages its own class and
|
|
21975
21972
|
// state, as it's a <span> that wants to act like an <input>.
|
|
21976
|
-
if (this.props.type ===
|
|
21973
|
+
if (this.props.type === "tex") {
|
|
21977
21974
|
return this.props.className;
|
|
21978
21975
|
} // Otherwise, we need to add these INPUT and FOCUSED tags here.
|
|
21979
21976
|
|
|
@@ -22008,7 +22005,7 @@ class InputWithExamples extends React__namespace.Component {
|
|
|
22008
22005
|
style: this.props.style
|
|
22009
22006
|
};
|
|
22010
22007
|
|
|
22011
|
-
if (this.props.type ===
|
|
22008
|
+
if (this.props.type === "tex") {
|
|
22012
22009
|
return inputProps;
|
|
22013
22010
|
} // Add useful props required for MATH and TEXT modes
|
|
22014
22011
|
|
|
@@ -22019,7 +22016,7 @@ class InputWithExamples extends React__namespace.Component {
|
|
|
22019
22016
|
}); // And add final props that are MATH- and TEXT-specific
|
|
22020
22017
|
|
|
22021
22018
|
|
|
22022
|
-
if (this.props.type ===
|
|
22019
|
+
if (this.props.type === "math") {
|
|
22023
22020
|
return ___default["default"].extend({
|
|
22024
22021
|
buttonSet: this.props.buttonSet,
|
|
22025
22022
|
buttonsVisible: this.props.buttonsVisible,
|
|
@@ -22027,7 +22024,7 @@ class InputWithExamples extends React__namespace.Component {
|
|
|
22027
22024
|
}, inputProps);
|
|
22028
22025
|
}
|
|
22029
22026
|
|
|
22030
|
-
if (this.props.type ===
|
|
22027
|
+
if (this.props.type === "text") {
|
|
22031
22028
|
return ___default["default"].extend({
|
|
22032
22029
|
autoCapitalize: "off",
|
|
22033
22030
|
autoComplete: "off",
|
|
@@ -22039,16 +22036,17 @@ class InputWithExamples extends React__namespace.Component {
|
|
|
22039
22036
|
|
|
22040
22037
|
_defineProperty(this, "_getComponentForInputType", () => {
|
|
22041
22038
|
switch (this.props.type) {
|
|
22042
|
-
case
|
|
22039
|
+
case "tex":
|
|
22043
22040
|
return MathOutput;
|
|
22044
22041
|
|
|
22045
|
-
case
|
|
22042
|
+
case "math":
|
|
22046
22043
|
return MathInput;
|
|
22047
22044
|
|
|
22048
|
-
case
|
|
22045
|
+
case "text":
|
|
22049
22046
|
return TextInput;
|
|
22050
22047
|
|
|
22051
22048
|
default:
|
|
22049
|
+
this.props.type;
|
|
22052
22050
|
return null;
|
|
22053
22051
|
}
|
|
22054
22052
|
});
|
|
@@ -22109,7 +22107,7 @@ class InputWithExamples extends React__namespace.Component {
|
|
|
22109
22107
|
// other types require, and is hence handled separately.
|
|
22110
22108
|
|
|
22111
22109
|
|
|
22112
|
-
if (this.props.type ===
|
|
22110
|
+
if (this.props.type === "tex") {
|
|
22113
22111
|
return input;
|
|
22114
22112
|
} // Else, we need to be able to show examples
|
|
22115
22113
|
|
|
@@ -22140,7 +22138,7 @@ class InputWithExamples extends React__namespace.Component {
|
|
|
22140
22138
|
}
|
|
22141
22139
|
|
|
22142
22140
|
_defineProperty(InputWithExamples, "defaultProps", {
|
|
22143
|
-
type:
|
|
22141
|
+
type: "text",
|
|
22144
22142
|
shouldShowExamples: true,
|
|
22145
22143
|
onFocus: function () {},
|
|
22146
22144
|
onBlur: function () {},
|
|
@@ -22384,12 +22382,12 @@ class Expression extends React__namespace.Component {
|
|
|
22384
22382
|
});
|
|
22385
22383
|
|
|
22386
22384
|
_defineProperty(this, "_handleFocus", () => {
|
|
22387
|
-
/*
|
|
22385
|
+
/* c8 ignore next */
|
|
22388
22386
|
this.props.onFocus([]);
|
|
22389
22387
|
});
|
|
22390
22388
|
|
|
22391
22389
|
_defineProperty(this, "_handleBlur", () => {
|
|
22392
|
-
/*
|
|
22390
|
+
/* c8 ignore next */
|
|
22393
22391
|
this.props.onBlur([]);
|
|
22394
22392
|
});
|
|
22395
22393
|
|
|
@@ -22423,12 +22421,12 @@ class Expression extends React__namespace.Component {
|
|
|
22423
22421
|
// The widget itself is an input, so we return a single empty list to
|
|
22424
22422
|
// indicate this.
|
|
22425
22423
|
|
|
22426
|
-
/*
|
|
22424
|
+
/* c8 ignore next */
|
|
22427
22425
|
return [[]];
|
|
22428
22426
|
});
|
|
22429
22427
|
|
|
22430
22428
|
_defineProperty(this, "getGrammarTypeForPath", inputPath => {
|
|
22431
|
-
/*
|
|
22429
|
+
/* c8 ignore next */
|
|
22432
22430
|
return "expression";
|
|
22433
22431
|
});
|
|
22434
22432
|
|
|
@@ -22478,7 +22476,7 @@ class Expression extends React__namespace.Component {
|
|
|
22478
22476
|
// in the function variables list for the expression.
|
|
22479
22477
|
|
|
22480
22478
|
if (!expression.parsed) {
|
|
22481
|
-
/*
|
|
22479
|
+
/* c8 ignore next */
|
|
22482
22480
|
Log.error("Unable to parse solution answer for expression", Errors.InvalidInput, {
|
|
22483
22481
|
loggedMetadata: {
|
|
22484
22482
|
rubric: JSON.stringify(rubric)
|
|
@@ -22782,7 +22780,7 @@ const keypadConfigurationForProps = widgetOptions => {
|
|
|
22782
22780
|
};
|
|
22783
22781
|
|
|
22784
22782
|
const propUpgrades$2 = {
|
|
22785
|
-
/*
|
|
22783
|
+
/* c8 ignore next */
|
|
22786
22784
|
"1": v0props => ({
|
|
22787
22785
|
times: v0props.times,
|
|
22788
22786
|
buttonSets: v0props.buttonSets,
|
|
@@ -23050,12 +23048,12 @@ class InputNumber extends React__namespace.Component {
|
|
|
23050
23048
|
// The widget itself is an input, so we return a single empty list to
|
|
23051
23049
|
// indicate this.
|
|
23052
23050
|
|
|
23053
|
-
/*
|
|
23051
|
+
/* c8 ignore next */
|
|
23054
23052
|
return [[]];
|
|
23055
23053
|
});
|
|
23056
23054
|
|
|
23057
23055
|
_defineProperty(this, "getGrammarTypeForPath", path => {
|
|
23058
|
-
/*
|
|
23056
|
+
/* c8 ignore next */
|
|
23059
23057
|
return "number";
|
|
23060
23058
|
});
|
|
23061
23059
|
|
|
@@ -23116,7 +23114,7 @@ class InputNumber extends React__namespace.Component {
|
|
|
23116
23114
|
let correct = null;
|
|
23117
23115
|
let answerBlurb = null; // SAT is deprecated and not testable
|
|
23118
23116
|
|
|
23119
|
-
/*
|
|
23117
|
+
/* c8 ignore if */
|
|
23120
23118
|
|
|
23121
23119
|
if (this.props.apiOptions.satStyling && rubric) {
|
|
23122
23120
|
const score = this.simpleValidate(rubric);
|
|
@@ -23136,20 +23134,33 @@ class InputNumber extends React__namespace.Component {
|
|
|
23136
23134
|
answers: answerStrings
|
|
23137
23135
|
});
|
|
23138
23136
|
}
|
|
23137
|
+
} // Note: This is _very_ similar to what `numeric-input.jsx` does. If
|
|
23138
|
+
// you modify this, double-check if you also need to modify that
|
|
23139
|
+
// component.
|
|
23140
|
+
|
|
23141
|
+
|
|
23142
|
+
const inputStyles = [styles$z.default, this.props.size === "small" ? styles$z.small : null, this.props.rightAlign ? styles$z.rightAlign : styles$z.leftAlign]; // Correct
|
|
23143
|
+
|
|
23144
|
+
if (rubric && correct && this.props.currentValue) {
|
|
23145
|
+
inputStyles.push(styles$z.answerStateCorrect);
|
|
23146
|
+
} // Incorrect
|
|
23147
|
+
|
|
23148
|
+
|
|
23149
|
+
if (rubric && !correct && this.props.currentValue) {
|
|
23150
|
+
inputStyles.push(styles$z.answerStateIncorrect);
|
|
23151
|
+
} // Unanswered
|
|
23152
|
+
|
|
23153
|
+
|
|
23154
|
+
if (rubric && !this.props.currentValue) {
|
|
23155
|
+
inputStyles.push(styles$z.answerStateUnanswered);
|
|
23139
23156
|
}
|
|
23140
23157
|
|
|
23141
|
-
const classes = {};
|
|
23142
|
-
classes["perseus-input-size-" + this.props.size] = true;
|
|
23143
|
-
classes["perseus-input-right-align"] = this.props.rightAlign;
|
|
23144
|
-
classes[ClassNames.CORRECT] = rubric && correct && this.props.currentValue;
|
|
23145
|
-
classes[ClassNames.INCORRECT] = rubric && !correct && this.props.currentValue;
|
|
23146
|
-
classes[ClassNames.UNANSWERED] = rubric && !this.props.currentValue;
|
|
23147
23158
|
const input = /*#__PURE__*/React__namespace.createElement(InputWithExamples // eslint-disable-next-line react/no-string-refs
|
|
23148
23159
|
, {
|
|
23149
23160
|
ref: "input",
|
|
23150
23161
|
value: this.props.currentValue,
|
|
23151
23162
|
onChange: this.handleChange,
|
|
23152
|
-
|
|
23163
|
+
style: inputStyles,
|
|
23153
23164
|
type: this._getInputType(),
|
|
23154
23165
|
examples: this.examples(),
|
|
23155
23166
|
shouldShowExamples: this.shouldShowExamples(),
|
|
@@ -23160,7 +23171,7 @@ class InputNumber extends React__namespace.Component {
|
|
|
23160
23171
|
linterContext: this.props.linterContext
|
|
23161
23172
|
}); // SAT is deprecated, answer blurb is an SAT feature
|
|
23162
23173
|
|
|
23163
|
-
/*
|
|
23174
|
+
/* c8 ignore if */
|
|
23164
23175
|
|
|
23165
23176
|
if (answerBlurb) {
|
|
23166
23177
|
return /*#__PURE__*/React__namespace.createElement("span", {
|
|
@@ -23245,6 +23256,39 @@ _defineProperty(InputNumber, "defaultProps", {
|
|
|
23245
23256
|
linterContext: PerseusLinter.linterContextDefault
|
|
23246
23257
|
});
|
|
23247
23258
|
|
|
23259
|
+
const styles$z = aphrodite.StyleSheet.create({
|
|
23260
|
+
default: {
|
|
23261
|
+
width: 80,
|
|
23262
|
+
height: "auto"
|
|
23263
|
+
},
|
|
23264
|
+
small: {
|
|
23265
|
+
width: 40
|
|
23266
|
+
},
|
|
23267
|
+
leftAlign: {
|
|
23268
|
+
paddingLeft: Spacing__default["default"].xxxSmall_4,
|
|
23269
|
+
paddingRight: 0
|
|
23270
|
+
},
|
|
23271
|
+
rightAlign: {
|
|
23272
|
+
textAlign: "right",
|
|
23273
|
+
paddingLeft: 0,
|
|
23274
|
+
paddingRight: Spacing__default["default"].xxxSmall_4
|
|
23275
|
+
},
|
|
23276
|
+
answerStateCorrect: {
|
|
23277
|
+
color: satCorrectColor,
|
|
23278
|
+
backgroundColor: satCorrectBackgroundColor,
|
|
23279
|
+
border: "solid 1px ".concat(satCorrectBorderColor)
|
|
23280
|
+
},
|
|
23281
|
+
answerStateIncorrect: {
|
|
23282
|
+
color: satIncorrectColor,
|
|
23283
|
+
backgroundColor: satIncorrectBackgroundColor,
|
|
23284
|
+
border: "solid 1px ".concat(satIncorrectBorderColor)
|
|
23285
|
+
},
|
|
23286
|
+
answerStateUnanswered: {
|
|
23287
|
+
backgroundColor: "#eee",
|
|
23288
|
+
border: "solid 1px #999"
|
|
23289
|
+
}
|
|
23290
|
+
});
|
|
23291
|
+
|
|
23248
23292
|
const propTransform$4 = widgetOptions => {
|
|
23249
23293
|
const {
|
|
23250
23294
|
simplify,
|
|
@@ -23321,7 +23365,7 @@ class NumericInput extends React__namespace.Component {
|
|
|
23321
23365
|
let answerBlurb;
|
|
23322
23366
|
/* Ignore this block because SAT is deprecated */
|
|
23323
23367
|
|
|
23324
|
-
/*
|
|
23368
|
+
/* c8 ignore next */
|
|
23325
23369
|
|
|
23326
23370
|
if (this.props.apiOptions.satStyling && rubric) {
|
|
23327
23371
|
const score = this.simpleValidate(rubric);
|
|
@@ -23420,17 +23464,17 @@ class NumericInput extends React__namespace.Component {
|
|
|
23420
23464
|
// The widget itself is an input, so we return a single empty list to
|
|
23421
23465
|
// indicate this.
|
|
23422
23466
|
|
|
23423
|
-
/*
|
|
23467
|
+
/* c8 ignore next */
|
|
23424
23468
|
return [[]];
|
|
23425
23469
|
});
|
|
23426
23470
|
|
|
23427
23471
|
_defineProperty(this, "getGrammarTypeForPath", inputPath => {
|
|
23428
|
-
/*
|
|
23472
|
+
/* c8 ignore next */
|
|
23429
23473
|
return "number";
|
|
23430
23474
|
});
|
|
23431
23475
|
|
|
23432
23476
|
_defineProperty(this, "setInputValue", (path, newValue, cb) => {
|
|
23433
|
-
/*
|
|
23477
|
+
/* c8 ignore next */
|
|
23434
23478
|
this.props.onChange({
|
|
23435
23479
|
currentValue: newValue
|
|
23436
23480
|
}, cb);
|
|
@@ -23613,7 +23657,10 @@ class NumericInput extends React__namespace.Component {
|
|
|
23613
23657
|
onFocus: this._handleFocus,
|
|
23614
23658
|
onBlur: this._handleBlur
|
|
23615
23659
|
}));
|
|
23616
|
-
}
|
|
23660
|
+
} // Note: This is _very_ similar to what `input-number.jsx` does. If
|
|
23661
|
+
// you modify this, double-check if you also need to modify that
|
|
23662
|
+
// component.
|
|
23663
|
+
|
|
23617
23664
|
|
|
23618
23665
|
const styles = aphrodite.StyleSheet.create({
|
|
23619
23666
|
input: {
|
|
@@ -23639,7 +23686,7 @@ class NumericInput extends React__namespace.Component {
|
|
|
23639
23686
|
});
|
|
23640
23687
|
/* This only gets used with SAT Content */
|
|
23641
23688
|
|
|
23642
|
-
/*
|
|
23689
|
+
/* c8 ignore next if */
|
|
23643
23690
|
|
|
23644
23691
|
if (answerBlurb) {
|
|
23645
23692
|
return /*#__PURE__*/React__namespace.createElement("span", {
|
|
@@ -26872,8 +26919,8 @@ function LibraryChoiceIcon(props) {
|
|
|
26872
26919
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
26873
26920
|
style: dynamicStyles,
|
|
26874
26921
|
"data-test-id": "choice-icon__library-choice-icon",
|
|
26875
|
-
className: aphrodite.css(styles$r.circle, showCorrectness && correct && styles$r.circleCorrect, showCorrectness && !correct && styles$r.circleIncorrect, showCorrectness && !correct && (checked || previouslyAnswered) && styles$r.circleIncorrectAnswered) // used in BaseRadio to check
|
|
26876
|
-
// radio icon
|
|
26922
|
+
className: aphrodite.css(styles$r.circle, showCorrectness && correct && styles$r.circleCorrect, showCorrectness && !correct && styles$r.circleIncorrect, showCorrectness && !correct && (checked || previouslyAnswered) && styles$r.circleIncorrectAnswered) // used in BaseRadio editMode to check
|
|
26923
|
+
// if we actually clicked on the radio icon
|
|
26877
26924
|
,
|
|
26878
26925
|
"data-is-radio-icon": true
|
|
26879
26926
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
@@ -27299,7 +27346,8 @@ function Choice(props) {
|
|
|
27299
27346
|
disabled: disabled || apiOptions.staticRender || apiOptions.readOnly,
|
|
27300
27347
|
style: {
|
|
27301
27348
|
flex: 1,
|
|
27302
|
-
color: Color__default["default"].offBlack
|
|
27349
|
+
color: Color__default["default"].offBlack,
|
|
27350
|
+
userSelect: "text"
|
|
27303
27351
|
},
|
|
27304
27352
|
ref: forwardedRef,
|
|
27305
27353
|
"aria-hidden": "true"
|
|
@@ -27655,7 +27703,7 @@ function BaseRadio(props) {
|
|
|
27655
27703
|
style: {
|
|
27656
27704
|
listStyle: "none"
|
|
27657
27705
|
}
|
|
27658
|
-
}, choices.map(
|
|
27706
|
+
}, choices.map((choice, i) => {
|
|
27659
27707
|
let Element = Choice$1;
|
|
27660
27708
|
const ref = /*#__PURE__*/React__namespace.createRef();
|
|
27661
27709
|
choiceRefs.current[i] = ref;
|
|
@@ -27674,6 +27722,11 @@ function BaseRadio(props) {
|
|
|
27674
27722
|
showRationale: choice.hasRationale && (reviewMode || choice.showRationale),
|
|
27675
27723
|
pos: i,
|
|
27676
27724
|
onChange: newValues => {
|
|
27725
|
+
// editMode selection is handled in clickHandler
|
|
27726
|
+
if (editMode) {
|
|
27727
|
+
return;
|
|
27728
|
+
}
|
|
27729
|
+
|
|
27677
27730
|
updateChoice(i, newValues);
|
|
27678
27731
|
},
|
|
27679
27732
|
ref
|
|
@@ -27731,7 +27784,7 @@ function BaseRadio(props) {
|
|
|
27731
27784
|
// radio icon, then we want to trigger the
|
|
27732
27785
|
// check by flipping the choice of the icon.
|
|
27733
27786
|
if (elem.getAttribute("data-is-radio-icon")) {
|
|
27734
|
-
|
|
27787
|
+
updateChoice(i, {
|
|
27735
27788
|
checked: !choice.checked,
|
|
27736
27789
|
crossedOut: choice.crossedOut
|
|
27737
27790
|
});
|
|
@@ -27755,7 +27808,7 @@ function BaseRadio(props) {
|
|
|
27755
27808
|
onClick: clickHandler,
|
|
27756
27809
|
onTouchStart: !labelWrap ? null : captureScratchpadTouchStart$2
|
|
27757
27810
|
}, /*#__PURE__*/React__namespace.createElement(Element, elementProps));
|
|
27758
|
-
}
|
|
27811
|
+
}))); // Allow for horizontal scrolling if content is too wide, which may be
|
|
27759
27812
|
// an issue especially on phones.
|
|
27760
27813
|
// This is disabled in SAT, since it conflicts with their theming.
|
|
27761
27814
|
|
|
@@ -28102,7 +28155,7 @@ class Radio$1 extends React__namespace.Component {
|
|
|
28102
28155
|
noneOfTheAboveSelected
|
|
28103
28156
|
}; // Support legacy choiceState implementation
|
|
28104
28157
|
}
|
|
28105
|
-
/*
|
|
28158
|
+
/* c8 ignore if - props.values is deprecated */
|
|
28106
28159
|
|
|
28107
28160
|
|
|
28108
28161
|
const {
|
|
@@ -28197,7 +28250,7 @@ class Radio$1 extends React__namespace.Component {
|
|
|
28197
28250
|
} else if (this.props.values) {
|
|
28198
28251
|
// Support legacy choiceStates implementation
|
|
28199
28252
|
|
|
28200
|
-
/*
|
|
28253
|
+
/* c8 ignore next - props.values is deprecated */
|
|
28201
28254
|
choiceStates = this.props.values.map(val => ({
|
|
28202
28255
|
selected: val,
|
|
28203
28256
|
crossedOut: false,
|
|
@@ -28580,7 +28633,7 @@ _defineProperty(Categorizer, "defaultProps", {
|
|
|
28580
28633
|
|
|
28581
28634
|
const pageMargin = 16; // Stylesheets aren't directly testable
|
|
28582
28635
|
|
|
28583
|
-
/*
|
|
28636
|
+
/* c8 ignore next */
|
|
28584
28637
|
|
|
28585
28638
|
const styles$m = aphrodite.StyleSheet.create({
|
|
28586
28639
|
mobileTable: {
|