@khanacademy/perseus 1.4.0 → 2.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/es/index.css +9 -245
  3. package/dist/es/index.js +138 -584
  4. package/dist/es/index.js.map +1 -1
  5. package/dist/index.css +9 -245
  6. package/dist/index.js +135 -581
  7. package/dist/index.js.map +1 -1
  8. package/package.json +36 -36
  9. package/src/__stories__/hints-renderer.stories.jsx +9 -1
  10. package/src/__testdata__/graphie_testdata.js +53 -0
  11. package/src/__tests__/__snapshots__/perseus-markdown_test.jsx.snap +0 -9
  12. package/src/__tests__/__snapshots__/renderer_test.jsx.snap +0 -9
  13. package/src/components/__stories__/graphie.stories.jsx +5 -1
  14. package/src/hint-renderer.jsx +11 -14
  15. package/src/perseus-api.jsx +0 -23
  16. package/src/perseus-markdown.jsx +0 -25
  17. package/src/styles/constants.js +0 -21
  18. package/src/styles/global-constants.js +0 -6
  19. package/src/styles/khan-exercise.css +9 -1
  20. package/src/styles/perseus-renderer.less +0 -259
  21. package/src/styles/variables.less +0 -11
  22. package/src/styles/variables.shared.less +0 -10
  23. package/src/types.js +0 -16
  24. package/src/widgets/__stories__/input-number.stories.jsx +0 -14
  25. package/src/widgets/__stories__/radio.stories.jsx +0 -3
  26. package/src/widgets/__tests__/__snapshots__/definition_test.js.snap +18 -28
  27. package/src/widgets/__tests__/__snapshots__/group_test.jsx.snap +0 -9
  28. package/src/widgets/__tests__/__snapshots__/image_test.jsx.snap +0 -18
  29. package/src/widgets/__tests__/__snapshots__/numeric-input_test.jsx.snap +2 -440
  30. package/src/widgets/__tests__/__snapshots__/radio_test.jsx.snap +66 -3726
  31. package/src/widgets/__tests__/numeric-input_test.jsx +54 -118
  32. package/src/widgets/__tests__/radio/choice-icon_test.jsx +25 -75
  33. package/src/widgets/__tests__/radio_test.jsx +362 -394
  34. package/src/widgets/definition.jsx +27 -14
  35. package/src/widgets/input-number.jsx +2 -60
  36. package/src/widgets/numeric-input.jsx +17 -89
  37. package/src/widgets/radio/__stories__/base-radio.stories.jsx +1 -3
  38. package/src/widgets/radio/__stories__/choice-icon.stories.jsx +23 -105
  39. package/src/widgets/radio/__stories__/option-status.stories.jsx +0 -8
  40. package/src/widgets/radio/base-radio.jsx +13 -96
  41. package/src/widgets/radio/choice-icon/choice-icon.jsx +177 -50
  42. package/src/widgets/radio/choice-icon/cross-out-line.jsx +9 -13
  43. package/src/widgets/radio/choice-icon/shared-styles.js +2 -3
  44. package/src/widgets/radio/choice.jsx +5 -59
  45. package/src/widgets/radio/option-status.jsx +2 -14
  46. package/src/components/__stories__/possible-answers.stories.jsx +0 -22
  47. package/src/components/possible-answers.jsx +0 -36
  48. package/src/styles/widgets/definition.less +0 -86
  49. package/src/widgets/radio/__stories__/sat-styles.stories.jsx +0 -191
  50. package/src/widgets/radio/choice-icon/library-choice-icon.jsx +0 -225
  51. package/src/widgets/radio/choice-icon/sat-choice-icon.jsx +0 -120
package/dist/es/index.js CHANGED
@@ -425,7 +425,6 @@ _defineProperty(StubTagEditor, "defaultProps", {
425
425
  var ApiOptions = {
426
426
  propTypes: PropTypes.shape({
427
427
  isArticle: PropTypes.bool.isRequired,
428
- satStyling: PropTypes.bool.isRequired,
429
428
  onInputError: PropTypes.func.isRequired,
430
429
  onFocusChange: PropTypes.func.isRequired,
431
430
  staticRender: PropTypes.bool.isRequired,
@@ -487,18 +486,6 @@ var ApiOptions = {
487
486
  setDrawingAreaAvailable: PropTypes.func,
488
487
  // Whether to use the Draft.js editor or the legacy textarea
489
488
  useDraftEditor: PropTypes.bool,
490
- // Styling options that control the visual behavior of Perseus
491
- // items.
492
- // TODO(mdr): If we adopt this pattern, we'll need to think about
493
- // how to make individual `styling` options be optional, and
494
- // how to set their default values without overwriting provided
495
- // values. For now, though, you must either specify all fields
496
- // of `styling`, or omit the `styling` option entirely.
497
- styling: PropTypes.shape({
498
- // TODO(Nicole): Remove this after landing wonderblock-ifying
499
- // the radio widget
500
- primaryProductColor: PropTypes.string
501
- }),
502
489
  // The color used for the hint progress indicator (eg. 1 / 3)
503
490
  hintProgressColor: PropTypes.string,
504
491
  // Whether this Renderer is allowed to auto-scroll the rest of the
@@ -531,7 +518,6 @@ var ApiOptions = {
531
518
  defaults: {
532
519
  isArticle: false,
533
520
  isMobile: false,
534
- satStyling: false,
535
521
  onInputError: function onInputError() {},
536
522
  onFocusChange: function onFocusChange() {},
537
523
  staticRender: false,
@@ -548,7 +534,6 @@ var ApiOptions = {
548
534
  },
549
535
  setDrawingAreaAvailable: function setDrawingAreaAvailable() {},
550
536
  useDraftEditor: false,
551
- styling: {},
552
537
  canScrollPage: false,
553
538
  inModal: false,
554
539
  crossOutEnabled: false,
@@ -3058,28 +3043,7 @@ var pureMdMax$2 = "1023px"; // @pure-lg-max: (@pure-xl-min - 1);
3058
3043
 
3059
3044
  var pureLgMax$2 = "1279px"; // @tableBackgroundAccent: #f9f9f9; // for striping
3060
3045
 
3061
- var tableBackgroundAccent$1 = "#F9F9F9";
3062
- var gtpBlue = "#4c00ff";
3063
- var gtpIncorrectColor = "#babec2";
3064
- var gtpCorrectColor = "#ffbe26"; // @satBlue: #0084ce;
3065
-
3066
- var satBlue = "#0084CE"; // @satSelectedBackgroundColor: #e4f3f9;
3067
-
3068
- var satSelectedBackgroundColor = "#E4F3F9"; // @satActiveBackgroundColor: #d0edf4;
3069
-
3070
- var satActiveBackgroundColor = "#D0EDF4"; // @satCorrectColor: #009900;
3071
-
3072
- var satCorrectColor = "#009900"; // @satCorrectBorderColor: #00cc00;
3073
-
3074
- var satCorrectBorderColor = "#00CC00"; // @satCorrectBackgroundColor: #e4f7e4;
3075
-
3076
- var satCorrectBackgroundColor = "#E4F7E4"; // @satIncorrectColor: #990000;
3077
-
3078
- var satIncorrectColor = "#990000"; // @satIncorrectBorderColor: #cc5252;
3079
-
3080
- var satIncorrectBorderColor = "#CC5252"; // @satIncorrectBackgroundColor: #f2ebeb;
3081
-
3082
- var satIncorrectBackgroundColor = "#F2EBEB"; // @zIndexScratchPad: 1;
3046
+ var tableBackgroundAccent$1 = "#F9F9F9"; // @zIndexScratchPad: 1;
3083
3047
 
3084
3048
  var zIndexScratchPad = 1; // @zIndexAboveScratchpad: @zIndexScratchPad + 1;
3085
3049
 
@@ -3147,18 +3111,6 @@ var constants$1 = /*#__PURE__*/Object.freeze({
3147
3111
  pureMdMax: pureMdMax$2,
3148
3112
  pureLgMax: pureLgMax$2,
3149
3113
  tableBackgroundAccent: tableBackgroundAccent$1,
3150
- gtpBlue: gtpBlue,
3151
- gtpIncorrectColor: gtpIncorrectColor,
3152
- gtpCorrectColor: gtpCorrectColor,
3153
- satBlue: satBlue,
3154
- satSelectedBackgroundColor: satSelectedBackgroundColor,
3155
- satActiveBackgroundColor: satActiveBackgroundColor,
3156
- satCorrectColor: satCorrectColor,
3157
- satCorrectBorderColor: satCorrectBorderColor,
3158
- satCorrectBackgroundColor: satCorrectBackgroundColor,
3159
- satIncorrectColor: satIncorrectColor,
3160
- satIncorrectBorderColor: satIncorrectBorderColor,
3161
- satIncorrectBackgroundColor: satIncorrectBackgroundColor,
3162
3114
  zIndexScratchPad: zIndexScratchPad,
3163
3115
  zIndexAboveScratchpad: zIndexAboveScratchpad$1,
3164
3116
  zIndexInteractiveComponent: zIndexInteractiveComponent$1,
@@ -17977,17 +17929,17 @@ class Lint extends React.Component {
17977
17929
  var warningTextStyle;
17978
17930
 
17979
17931
  if (this.props.severity === 1) {
17980
- severityStyle = styles$B.indicatorError;
17932
+ severityStyle = styles$A.indicatorError;
17981
17933
  warningText = "Error";
17982
- warningTextStyle = styles$B.publishBlockingError;
17934
+ warningTextStyle = styles$A.publishBlockingError;
17983
17935
  } else if (this.props.severity === 2) {
17984
- severityStyle = styles$B.indicatorWarning;
17936
+ severityStyle = styles$A.indicatorWarning;
17985
17937
  warningText = "Warning";
17986
- warningTextStyle = styles$B.warning;
17938
+ warningTextStyle = styles$A.warning;
17987
17939
  } else {
17988
- severityStyle = styles$B.indicatorGuideline;
17940
+ severityStyle = styles$A.indicatorGuideline;
17989
17941
  warningText = "Recommendation";
17990
- warningTextStyle = styles$B.warning;
17942
+ warningTextStyle = styles$A.warning;
17991
17943
  }
17992
17944
 
17993
17945
  return /*#__PURE__*/React.createElement("a", {
@@ -17995,16 +17947,16 @@ class Lint extends React.Component {
17995
17947
  target: "lint-help-window",
17996
17948
  className: css(style)
17997
17949
  }, /*#__PURE__*/React.createElement("span", {
17998
- className: css(styles$B.indicator, severityStyle)
17950
+ className: css(styles$A.indicator, severityStyle)
17999
17951
  }, this.props.severity === 1 && /*#__PURE__*/React.createElement(InlineIcon, exclamationIcon)), /*#__PURE__*/React.createElement("div", {
18000
- className: css(styles$B.tooltip, tooltipAbove && styles$B.tooltipAbove)
17952
+ className: css(styles$A.tooltip, tooltipAbove && styles$A.tooltipAbove)
18001
17953
  }, this.props.message.split("\n\n").map((m, i) => /*#__PURE__*/React.createElement("p", {
18002
17954
  key: i,
18003
- className: css(styles$B.tooltipParagraph)
17955
+ className: css(styles$A.tooltipParagraph)
18004
17956
  }, /*#__PURE__*/React.createElement("span", {
18005
17957
  className: css(warningTextStyle)
18006
17958
  }, warningText, ":", " "), m)), /*#__PURE__*/React.createElement("div", {
18007
- className: css(styles$B.tail, tooltipAbove && styles$B.tailAbove)
17959
+ className: css(styles$A.tail, tooltipAbove && styles$A.tailAbove)
18008
17960
  })));
18009
17961
  });
18010
17962
  }
@@ -18052,19 +18004,19 @@ class Lint extends React.Component {
18052
18004
 
18053
18005
  if (blockHighlight) {
18054
18006
  return /*#__PURE__*/React.createElement("span", {
18055
- className: css(styles$B.lintContainer, styles$B.lintContainerBlock)
18056
- }, this.renderLink(styles$B.radioWidgetHoverTarget), /*#__PURE__*/React.createElement("span", null, children));
18007
+ className: css(styles$A.lintContainer, styles$A.lintContainerBlock)
18008
+ }, this.renderLink(styles$A.radioWidgetHoverTarget), /*#__PURE__*/React.createElement("span", null, children));
18057
18009
  }
18058
18010
 
18059
18011
  if (inline) {
18060
18012
  return /*#__PURE__*/React.createElement("span", {
18061
- className: css(styles$B.lintContainer)
18062
- }, this.renderLink(styles$B.inlineHoverTarget), /*#__PURE__*/React.createElement("span", null, children));
18013
+ className: css(styles$A.lintContainer)
18014
+ }, this.renderLink(styles$A.inlineHoverTarget), /*#__PURE__*/React.createElement("span", null, children));
18063
18015
  }
18064
18016
 
18065
18017
  return /*#__PURE__*/React.createElement("div", {
18066
- className: css(styles$B.lintContainer)
18067
- }, this.renderLink(styles$B.hoverTarget), /*#__PURE__*/React.createElement("div", null, children));
18018
+ className: css(styles$A.lintContainer)
18019
+ }, this.renderLink(styles$A.hoverTarget), /*#__PURE__*/React.createElement("div", null, children));
18068
18020
  }
18069
18021
 
18070
18022
  } // $FlowFixMe[prop-missing]
@@ -18089,7 +18041,7 @@ _defineProperty(Lint, "propTypes", {
18089
18041
  severity: PropTypes.number
18090
18042
  });
18091
18043
 
18092
- var styles$B = StyleSheet.create({
18044
+ var styles$A = StyleSheet.create({
18093
18045
  // This is the class of the outermost element.
18094
18046
  // We use relative positioning so that the lint indicator can be
18095
18047
  // positioned absolutely relative to the position of the linty container.
@@ -18328,14 +18280,8 @@ var rules$1 = _objectSpread2(_objectSpread2({}, pureMarkdownRules), {}, {
18328
18280
  }, output(node.col1, state))), /*#__PURE__*/React.createElement("div", {
18329
18281
  className: "perseus-column"
18330
18282
  }, /*#__PURE__*/React.createElement("div", {
18331
- className: "sat-header-grafting-area"
18332
- }), /*#__PURE__*/React.createElement("div", {
18333
18283
  className: "perseus-column-content"
18334
- }, /*#__PURE__*/React.createElement("div", {
18335
- className: "sat-skill-subscore-grafting-area"
18336
- }), output(node.col2, state), /*#__PURE__*/React.createElement("div", {
18337
- className: "sat-grafting-area"
18338
- }))));
18284
+ }, output(node.col2, state))));
18339
18285
  }
18340
18286
  }),
18341
18287
  // Match paragraphs consisting solely of crowdin IDs
@@ -19979,7 +19925,7 @@ class Renderer extends React.Component {
19979
19925
  paddingRight: margin
19980
19926
  };
19981
19927
 
19982
- var mobileInnerStyle = _objectSpread2(_objectSpread2({}, innerStyle), styles$A.mobileZoomableParentFix);
19928
+ var mobileInnerStyle = _objectSpread2(_objectSpread2({}, innerStyle), styles$z.mobileZoomableParentFix);
19983
19929
 
19984
19930
  return /*#__PURE__*/React.createElement("div", {
19985
19931
  key: state.key,
@@ -20117,7 +20063,7 @@ class Renderer extends React.Component {
20117
20063
  paddingRight: 0
20118
20064
  };
20119
20065
 
20120
- var _mobileInnerStyle = _objectSpread2(_objectSpread2({}, _innerStyle), styles$A.mobileZoomableParentFix);
20066
+ var _mobileInnerStyle = _objectSpread2(_objectSpread2({}, _innerStyle), styles$z.mobileZoomableParentFix);
20121
20067
 
20122
20068
  var wrappedOutput = /*#__PURE__*/React.createElement("div", {
20123
20069
  style: _objectSpread2(_objectSpread2({}, _mobileInnerStyle), {}, {
@@ -20796,7 +20742,7 @@ _defineProperty(Renderer, "defaultProps", {
20796
20742
  linterContext: PerseusLinter.linterContextDefault
20797
20743
  });
20798
20744
 
20799
- var styles$A = {
20745
+ var styles$z = {
20800
20746
  mobileZoomableParentFix: {
20801
20747
  // NOTE(abdul): There is an issue where transform animations will
20802
20748
  // cause the Zoomable component to disappear when running on the
@@ -22941,31 +22887,6 @@ var Expression$1 = {
22941
22887
  isLintable: true
22942
22888
  };
22943
22889
 
22944
- class PossibleAnswers extends React.Component {
22945
- render() {
22946
- // It's redundant to show duplicate answers.
22947
- // So, remove duplicates from the given list of answer strings.
22948
- var answers = _.uniq(this.props.answers);
22949
-
22950
- var answerComponents = _.map(answers, answer => {
22951
- // Plus, now that our answers are distinct, we can safely use the
22952
- // answer string as a key.
22953
- return /*#__PURE__*/React.createElement("dd", {
22954
- key: answer
22955
- }, answer);
22956
- });
22957
-
22958
- return /*#__PURE__*/React.createElement("dl", {
22959
- className: "perseus-possible-answers"
22960
- }, /*#__PURE__*/React.createElement("dt", null, i18n.doNotTranslate("Correct Answer")), answerComponents);
22961
- }
22962
-
22963
- }
22964
-
22965
- _defineProperty(PossibleAnswers, "propTypes", {
22966
- answers: PropTypes.arrayOf(PropTypes.string)
22967
- });
22968
-
22969
22890
  var _excluded$3 = ["keypadElement", "onFocus", "value"];
22970
22891
  class SimpleKeypadInput extends React.Component {
22971
22892
  constructor() {
@@ -23210,7 +23131,7 @@ class InputNumber extends React.Component {
23210
23131
  render() {
23211
23132
  if (this.props.apiOptions.customKeypad) {
23212
23133
  // TODO(charlie): Support "Review Mode".
23213
- var _input = /*#__PURE__*/React.createElement(SimpleKeypadInput // eslint-disable-next-line react/no-string-refs
23134
+ var input = /*#__PURE__*/React.createElement(SimpleKeypadInput // eslint-disable-next-line react/no-string-refs
23214
23135
  , {
23215
23136
  ref: "input",
23216
23137
  value: this.props.currentValue,
@@ -23223,60 +23144,26 @@ class InputNumber extends React.Component {
23223
23144
  if (this.props.rightAlign) {
23224
23145
  return /*#__PURE__*/React.createElement("div", {
23225
23146
  className: "perseus-input-right-align"
23226
- }, _input);
23147
+ }, input);
23227
23148
  }
23228
23149
 
23229
- return _input;
23150
+ return input;
23230
23151
  } // HACK(johnsullivan): Create a function with shared logic between
23231
23152
  // this and NumericInput.
23153
+ // TODO(jeremy): Deprecate this widget and prefer numeric-input.
23232
23154
 
23233
23155
 
23234
- var rubric = this.props.reviewModeRubric;
23235
- var correct = null;
23236
- var answerBlurb = null; // SAT is deprecated and not testable
23237
-
23238
- /* c8 ignore if */
23239
-
23240
- if (this.props.apiOptions.satStyling && rubric) {
23241
- var score = this.simpleValidate(rubric);
23242
- correct = score.type === "points" && score.earned === score.total;
23243
-
23244
- if (!correct) {
23245
- // TODO(johnsullivan): Make this a little more
23246
- // human-friendly.
23247
- var answerString = String(rubric.value);
23248
-
23249
- if (rubric.inexact && rubric.maxError) {
23250
- answerString += " \u00B1 " + rubric.maxError;
23251
- }
23252
-
23253
- var answerStrings = [answerString];
23254
- answerBlurb = /*#__PURE__*/React.createElement(PossibleAnswers, {
23255
- answers: answerStrings
23256
- });
23257
- }
23258
- } // Note: This is _very_ similar to what `numeric-input.jsx` does. If
23156
+ var rubric = this.props.reviewModeRubric; // Note: This is _very_ similar to what `numeric-input.jsx` does. If
23259
23157
  // you modify this, double-check if you also need to modify that
23260
23158
  // component.
23261
23159
 
23262
-
23263
- var inputStyles = [styles$z.default, this.props.size === "small" ? styles$z.small : null, this.props.rightAlign ? styles$z.rightAlign : styles$z.leftAlign]; // Correct
23264
-
23265
- if (rubric && correct === true && this.props.currentValue) {
23266
- inputStyles.push(styles$z.answerStateCorrect);
23267
- } // Incorrect
23268
-
23269
-
23270
- if (rubric && correct === false && this.props.currentValue) {
23271
- inputStyles.push(styles$z.answerStateIncorrect);
23272
- } // Unanswered
23273
-
23160
+ var inputStyles = [styles$y.default, this.props.size === "small" ? styles$y.small : null, this.props.rightAlign ? styles$y.rightAlign : styles$y.leftAlign]; // Unanswered
23274
23161
 
23275
23162
  if (rubric && !this.props.currentValue) {
23276
- inputStyles.push(styles$z.answerStateUnanswered);
23163
+ inputStyles.push(styles$y.answerStateUnanswered);
23277
23164
  }
23278
23165
 
23279
- var input = /*#__PURE__*/React.createElement(InputWithExamples // eslint-disable-next-line react/no-string-refs
23166
+ return /*#__PURE__*/React.createElement(InputWithExamples // eslint-disable-next-line react/no-string-refs
23280
23167
  , {
23281
23168
  ref: "input",
23282
23169
  value: this.props.currentValue,
@@ -23290,17 +23177,7 @@ class InputNumber extends React.Component {
23290
23177
  id: this.props.widgetId,
23291
23178
  disabled: this.props.apiOptions.readOnly,
23292
23179
  linterContext: this.props.linterContext
23293
- }); // SAT is deprecated, answer blurb is an SAT feature
23294
-
23295
- /* c8 ignore if */
23296
-
23297
- if (answerBlurb) {
23298
- return /*#__PURE__*/React.createElement("span", {
23299
- className: "perseus-input-with-answer-blurb"
23300
- }, input, answerBlurb);
23301
- }
23302
-
23303
- return input;
23180
+ });
23304
23181
  }
23305
23182
 
23306
23183
  static validate(state, rubric) {
@@ -23377,7 +23254,7 @@ _defineProperty(InputNumber, "defaultProps", {
23377
23254
  linterContext: linterContextDefault
23378
23255
  });
23379
23256
 
23380
- var styles$z = StyleSheet.create({
23257
+ var styles$y = StyleSheet.create({
23381
23258
  default: {
23382
23259
  width: 80,
23383
23260
  height: "auto"
@@ -23394,16 +23271,6 @@ var styles$z = StyleSheet.create({
23394
23271
  paddingLeft: 0,
23395
23272
  paddingRight: Spacing.xxxSmall_4
23396
23273
  },
23397
- answerStateCorrect: {
23398
- color: satCorrectColor,
23399
- backgroundColor: satCorrectBackgroundColor,
23400
- border: "solid 1px ".concat(satCorrectBorderColor)
23401
- },
23402
- answerStateIncorrect: {
23403
- color: satIncorrectColor,
23404
- backgroundColor: satIncorrectBackgroundColor,
23405
- border: "solid 1px ".concat(satIncorrectBorderColor)
23406
- },
23407
23274
  answerStateUnanswered: {
23408
23275
  backgroundColor: "#eee",
23409
23276
  border: "solid 1px #999"
@@ -23481,49 +23348,6 @@ class NumericInput extends React.Component {
23481
23348
  previousValues: [""]
23482
23349
  });
23483
23350
 
23484
- _defineProperty(this, "getAnswerBlurb", rubric => {
23485
- var correct;
23486
- var answerBlurb;
23487
- /* Ignore this block because SAT is deprecated */
23488
-
23489
- /* c8 ignore next */
23490
-
23491
- if (this.props.apiOptions.satStyling && rubric) {
23492
- var score = this.simpleValidate(rubric);
23493
- correct = score.type === "points" && score.earned === score.total;
23494
-
23495
- if (!correct) {
23496
- var correctAnswers = rubric.answers.filter(answer => answer.status === "correct");
23497
- var answerStrings = correctAnswers.map(answer => {
23498
- // Figure out how this answer is supposed to be
23499
- // displayed
23500
- var format = "decimal";
23501
-
23502
- if (answer.answerForms && answer.answerForms[0]) {
23503
- // NOTE(johnsullivan): This isn't exactly ideal, but
23504
- // it does behave well for all the currently known
23505
- // problems. See D14742 for some discussion on
23506
- // alternate strategies.
23507
- format = answer.answerForms[0];
23508
- }
23509
-
23510
- var answerString = KhanMath.toNumericString(answer.value, format);
23511
-
23512
- if (answer.maxError) {
23513
- answerString += " \u00B1 " + KhanMath.toNumericString(answer.maxError, format);
23514
- }
23515
-
23516
- return answerString;
23517
- });
23518
- answerBlurb = /*#__PURE__*/React.createElement(PossibleAnswers, {
23519
- answers: answerStrings
23520
- });
23521
- }
23522
- }
23523
-
23524
- return [answerBlurb, !!correct];
23525
- });
23526
-
23527
23351
  _defineProperty(this, "examples", () => {
23528
23352
  var _this$props$answerFor;
23529
23353
 
@@ -23752,9 +23576,6 @@ class NumericInput extends React.Component {
23752
23576
  }
23753
23577
 
23754
23578
  render() {
23755
- var rubric = this.props.reviewModeRubric;
23756
- var answers = this.getAnswerBlurb(rubric);
23757
- var answerBlurb = answers[0];
23758
23579
  var labelText = this.props.labelText;
23759
23580
 
23760
23581
  if (labelText == null || labelText === "") {
@@ -23791,7 +23612,7 @@ class NumericInput extends React.Component {
23791
23612
  height: "auto"
23792
23613
  }
23793
23614
  });
23794
- var input = /*#__PURE__*/React.createElement(InputWithExamples, {
23615
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(InputWithExamples, {
23795
23616
  ref: _ref2 => this.inputRef = _ref2,
23796
23617
  value: this.props.currentValue,
23797
23618
  onChange: this.handleChange,
@@ -23804,30 +23625,7 @@ class NumericInput extends React.Component {
23804
23625
  id: this.props.widgetId,
23805
23626
  disabled: this.props.apiOptions.readOnly,
23806
23627
  style: styles.input
23807
- });
23808
- /* This only gets used with SAT Content */
23809
-
23810
- /* c8 ignore next if */
23811
-
23812
- if (answerBlurb) {
23813
- return /*#__PURE__*/React.createElement("span", {
23814
- className: "perseus-input-with-answer-blurb"
23815
- }, input, answerBlurb);
23816
- }
23817
-
23818
- if (this.props.apiOptions.satStyling) {
23819
- // NOTE(amy): the input widgets themselves already have
23820
- // a default aria label of "Your Answer", so we hide this
23821
- // redundant label from screen-readers.
23822
- return /*#__PURE__*/React.createElement("label", {
23823
- className: "perseus-input-with-label"
23824
- }, /*#__PURE__*/React.createElement("span", {
23825
- className: "perseus-input-label",
23826
- "aria-hidden": "true"
23827
- }, i18n.doNotTranslate("Answer:")), input);
23828
- }
23829
-
23830
- return /*#__PURE__*/React.createElement("div", null, input);
23628
+ }));
23831
23629
  }
23832
23630
 
23833
23631
  } // TODO(thomas): Currently we receive a list of lists of acceptable answer types
@@ -24619,7 +24417,7 @@ class HighlightRenderer extends React.PureComponent {
24619
24417
  var rects = this.state.cachedHighlightRects;
24620
24418
  return /*#__PURE__*/React.createElement("div", null, rects.map((rect, index) => /*#__PURE__*/React.createElement("div", {
24621
24419
  key: index,
24622
- className: css(styles$y.highlightRect),
24420
+ className: css(styles$x.highlightRect),
24623
24421
  style: {
24624
24422
  // NOTE(mdr): We apply `position: absolute` here
24625
24423
  // rather than in Aphrodite styles, because
@@ -24640,7 +24438,7 @@ class HighlightRenderer extends React.PureComponent {
24640
24438
 
24641
24439
  }
24642
24440
 
24643
- var styles$y = StyleSheet.create({
24441
+ var styles$x = StyleSheet.create({
24644
24442
  highlightRect: {
24645
24443
  background: "#fffabe" // highlighter yellow :)
24646
24444
 
@@ -24722,7 +24520,7 @@ class HighlightTooltip extends React.PureComponent {
24722
24520
 
24723
24521
 
24724
24522
  var content = /*#__PURE__*/React.createElement("div", {
24725
- className: css(styles$x.tooltipLabel),
24523
+ className: css(styles$w.tooltipLabel),
24726
24524
  onClick: this.props.onClick
24727
24525
  }, this.props.label);
24728
24526
  var style = {
@@ -24744,7 +24542,7 @@ class HighlightTooltip extends React.PureComponent {
24744
24542
 
24745
24543
  }
24746
24544
 
24747
- var styles$x = StyleSheet.create({
24545
+ var styles$w = StyleSheet.create({
24748
24546
  tooltipLabel: {
24749
24547
  // Unlike most tooltip contents, we don't want this label to be
24750
24548
  // selectable. Selecting it is not only unhelpful, but dangerous: if
@@ -25347,7 +25145,7 @@ class HighlightableContent extends React.PureComponent {
25347
25145
  var buildHighlight = r => this._buildHighlight(r);
25348
25146
 
25349
25147
  return /*#__PURE__*/React.createElement("div", {
25350
- className: css(styles$w.container),
25148
+ className: css(styles$v.container),
25351
25149
  ref: container => this._container = container
25352
25150
  }, /*#__PURE__*/React.createElement("div", null, this.props.enabled && this._container && this._content && /*#__PURE__*/React.createElement(HighlightingUI, {
25353
25151
  buildHighlight: buildHighlight,
@@ -25368,7 +25166,7 @@ class HighlightableContent extends React.PureComponent {
25368
25166
  onAddHighlight: this._handleAddHighlight,
25369
25167
  onRemoveHighlight: this._handleRemoveHighlight
25370
25168
  })), /*#__PURE__*/React.createElement("div", {
25371
- className: css(styles$w.content),
25169
+ className: css(styles$v.content),
25372
25170
  ref: content => this._content = content
25373
25171
  }, /*#__PURE__*/React.createElement(WordIndexer, {
25374
25172
  onWordsUpdate: this._handleWordsUpdate
@@ -25377,7 +25175,7 @@ class HighlightableContent extends React.PureComponent {
25377
25175
 
25378
25176
  }
25379
25177
 
25380
- var styles$w = StyleSheet.create({
25178
+ var styles$v = StyleSheet.create({
25381
25179
  // We render content with z-index 1, and highlights with z-index 0, so that
25382
25180
  // content will receive the browser's native pointer events. (Highlights
25383
25181
  // have their own magic code to manage hover detection, despite being
@@ -25794,7 +25592,7 @@ class LineHeightMeasurer extends React.Component {
25794
25592
 
25795
25593
  render() {
25796
25594
  return /*#__PURE__*/React.createElement("div", {
25797
- className: css(styles$v.measurer),
25595
+ className: css(styles$u.measurer),
25798
25596
  "aria-hidden": "true"
25799
25597
  }, /*#__PURE__*/React.createElement("div", {
25800
25598
  ref: _ref => this._line = _ref,
@@ -25803,7 +25601,7 @@ class LineHeightMeasurer extends React.Component {
25803
25601
  }
25804
25602
 
25805
25603
  }
25806
- var styles$v = StyleSheet.create({
25604
+ var styles$u = StyleSheet.create({
25807
25605
  measurer: {
25808
25606
  position: "absolute",
25809
25607
  top: 0,
@@ -26829,36 +26627,6 @@ function getA11yText(letter, checked, correct, crossedOut, showCorrectness) {
26829
26627
  });
26830
26628
  }
26831
26629
 
26832
- /**
26833
- * Given a choice's position in the radio widget, return the corresponding
26834
- * "choice letter". (For example, in English, `getChoiceLetter(0)` is "A",
26835
- * `getChoiceLetter(1)` is "B", etc.)
26836
- */
26837
-
26838
- function getChoiceLetter(pos) {
26839
- /* I18N: This is a list of single-character labels that will appear in
26840
- * front of multiple-choice options. For instance, a multiple-choice
26841
- * question with three options would display
26842
- * (A) first option
26843
- * (B) second option
26844
- * (C) third option
26845
- * There must be spaces between each of the different characters. The
26846
- * characters will show up next to options in the order that they are
26847
- * listed here. Most multiple choice questions have 5 or fewer options.
26848
- */
26849
- var lettersString = i18n._("A B C D E F G H I J K L M N O P Q R S T U V W X Y Z");
26850
-
26851
- var letters = lettersString.split(" ");
26852
-
26853
- if (pos < letters.length) {
26854
- // If the position we need is listed in the localized string, use that.
26855
- return letters[pos];
26856
- } // If we're out of letters, give up and return a space.
26857
-
26858
-
26859
- return " ";
26860
- }
26861
-
26862
26630
  /**
26863
26631
  * Renders a circular selection ring around the child.
26864
26632
  */
@@ -26878,7 +26646,7 @@ function FocusRing(props) {
26878
26646
  };
26879
26647
  return /*#__PURE__*/React.createElement("span", {
26880
26648
  "data-test-id": "focus-ring",
26881
- className: css(styles$u.ring),
26649
+ className: css(styles$t.ring),
26882
26650
  style: style
26883
26651
  }, children);
26884
26652
  }
@@ -26888,7 +26656,7 @@ FocusRing.defaultProps = {
26888
26656
  color: kaGreen$1,
26889
26657
  multipleSelect: false
26890
26658
  };
26891
- var styles$u = StyleSheet.create({
26659
+ var styles$t = StyleSheet.create({
26892
26660
  ring: {
26893
26661
  margin: "auto",
26894
26662
  display: "inline-block",
@@ -26898,9 +26666,38 @@ var styles$u = StyleSheet.create({
26898
26666
  }
26899
26667
  });
26900
26668
 
26901
- var SAT_ICON_SIZE = 25;
26902
- var LIBRARY_ICON_SIZE = 24;
26903
- var styles$t = StyleSheet.create({
26669
+ /**
26670
+ * Given a choice's position in the radio widget, return the corresponding
26671
+ * "choice letter". (For example, in English, `getChoiceLetter(0)` is "A",
26672
+ * `getChoiceLetter(1)` is "B", etc.)
26673
+ */
26674
+
26675
+ function getChoiceLetter(pos) {
26676
+ /* I18N: This is a list of single-character labels that will appear in
26677
+ * front of multiple-choice options. For instance, a multiple-choice
26678
+ * question with three options would display
26679
+ * (A) first option
26680
+ * (B) second option
26681
+ * (C) third option
26682
+ * There must be spaces between each of the different characters. The
26683
+ * characters will show up next to options in the order that they are
26684
+ * listed here. Most multiple choice questions have 5 or fewer options.
26685
+ */
26686
+ var lettersString = i18n._("A B C D E F G H I J K L M N O P Q R S T U V W X Y Z");
26687
+
26688
+ var letters = lettersString.split(" ");
26689
+
26690
+ if (pos < letters.length) {
26691
+ // If the position we need is listed in the localized string, use that.
26692
+ return letters[pos];
26693
+ } // If we're out of letters, give up and return a space.
26694
+
26695
+
26696
+ return " ";
26697
+ }
26698
+
26699
+ var CHOICE_ICON_SIZE = 24;
26700
+ var styles$s = StyleSheet.create({
26904
26701
  iconWrapper: {
26905
26702
  display: "inline-block",
26906
26703
  position: "relative"
@@ -26911,28 +26708,26 @@ var styles$t = StyleSheet.create({
26911
26708
  // extra space for the cute rounded line cap.
26912
26709
 
26913
26710
  var CROSS_OUT_LINE_PADDING = 2;
26914
- var CROSS_OUT_LINE_SIZE = LIBRARY_ICON_SIZE + CROSS_OUT_LINE_PADDING * 2;
26915
- var SAT_CROSS_OUT_LINE_SIZE = SAT_ICON_SIZE + CROSS_OUT_LINE_PADDING * 2;
26711
+ var CROSS_OUT_LINE_SIZE = CHOICE_ICON_SIZE + CROSS_OUT_LINE_PADDING * 2;
26916
26712
  /**
26917
26713
  * The "cross-out line" that appears over the icon when the choice has been
26918
26714
  * `crossedOut`.
26919
26715
  */
26920
26716
 
26921
26717
  function CrossOutLine(props) {
26922
- var crossOutLineSize = props.sat ? SAT_CROSS_OUT_LINE_SIZE : CROSS_OUT_LINE_SIZE;
26923
26718
  return /*#__PURE__*/React.createElement("svg", {
26924
- width: crossOutLineSize,
26925
- height: crossOutLineSize,
26926
- viewBox: "0 0 ".concat(crossOutLineSize, " ").concat(crossOutLineSize),
26927
- className: css(styles$s.crossOutLine),
26719
+ width: CROSS_OUT_LINE_SIZE,
26720
+ height: CROSS_OUT_LINE_SIZE,
26721
+ viewBox: "0 0 ".concat(CROSS_OUT_LINE_SIZE, " ").concat(CROSS_OUT_LINE_SIZE),
26722
+ className: css(styles$r.crossOutLine),
26928
26723
  "data-test-id": "choice-icon__cross-out-line"
26929
26724
  }, /*#__PURE__*/React.createElement("line", {
26930
26725
  // The line stretches from the bottom-left to top-right.
26931
26726
  // We don't quite go to the _very_ corner, because the cute
26932
26727
  // rounded line cap needs to bleed into our padding.
26933
26728
  x1: CROSS_OUT_LINE_PADDING,
26934
- x2: crossOutLineSize - CROSS_OUT_LINE_PADDING,
26935
- y1: crossOutLineSize - CROSS_OUT_LINE_PADDING,
26729
+ x2: CROSS_OUT_LINE_SIZE - CROSS_OUT_LINE_PADDING,
26730
+ y1: CROSS_OUT_LINE_SIZE - CROSS_OUT_LINE_PADDING,
26936
26731
  y2: CROSS_OUT_LINE_PADDING,
26937
26732
  stroke: props.color,
26938
26733
  strokeWidth: "2",
@@ -26940,7 +26735,7 @@ function CrossOutLine(props) {
26940
26735
  }));
26941
26736
  }
26942
26737
 
26943
- var styles$s = StyleSheet.create({
26738
+ var styles$r = StyleSheet.create({
26944
26739
  crossOutLine: {
26945
26740
  // Center the icon within the container.
26946
26741
  position: "absolute",
@@ -26951,10 +26746,11 @@ var styles$s = StyleSheet.create({
26951
26746
 
26952
26747
  function ChoiceInner(props) {
26953
26748
  var {
26954
- letter,
26749
+ pos,
26955
26750
  showCorrectness,
26956
26751
  correct
26957
26752
  } = props;
26753
+ var letter = getChoiceLetter(pos);
26958
26754
 
26959
26755
  if (!showCorrectness) {
26960
26756
  return letter;
@@ -26976,19 +26772,17 @@ function ChoiceInner(props) {
26976
26772
  // related to the selected state dynamically.
26977
26773
 
26978
26774
 
26979
- function getDynamicStyles(checked, showCorrectness, pressed, multipleSelect, primaryProductColor, correct, transparentBackground) {
26775
+ function getDynamicStyles(checked, showCorrectness, pressed, multipleSelect, correct) {
26980
26776
  var backgroundColor;
26981
26777
  var borderColor;
26982
26778
  var color;
26983
26779
 
26984
26780
  if (!showCorrectness && pressed) {
26985
- borderColor = primaryProductColor;
26986
- color = primaryProductColor;
26987
- backgroundColor = transparentBackground ? "transparent" : white$1;
26781
+ borderColor = Color.blue;
26782
+ color = Color.blue;
26783
+ backgroundColor = "transparent";
26988
26784
  } else if (checked) {
26989
- // Note: kaGreen is not only the default product color,
26990
- // but also the "correctness" color
26991
- var bg = showCorrectness && correct ? Color.green : primaryProductColor;
26785
+ var bg = showCorrectness && correct ? Color.green : Color.blue;
26992
26786
  color = white$1;
26993
26787
  backgroundColor = bg;
26994
26788
  borderColor = bg;
@@ -27003,7 +26797,7 @@ function getDynamicStyles(checked, showCorrectness, pressed, multipleSelect, pri
27003
26797
  if (multipleSelect) {
27004
26798
  borderRadius = 3;
27005
26799
  } else {
27006
- borderRadius = LIBRARY_ICON_SIZE;
26800
+ borderRadius = CHOICE_ICON_SIZE;
27007
26801
  }
27008
26802
 
27009
26803
  return {
@@ -27014,7 +26808,7 @@ function getDynamicStyles(checked, showCorrectness, pressed, multipleSelect, pri
27014
26808
  };
27015
26809
  }
27016
26810
 
27017
- function LibraryChoiceIcon(props) {
26811
+ function ChoiceIcon(props) {
27018
26812
  var {
27019
26813
  checked,
27020
26814
  crossedOut,
@@ -27023,30 +26817,28 @@ function LibraryChoiceIcon(props) {
27023
26817
  focused,
27024
26818
  hovered,
27025
26819
  multipleSelect,
27026
- primaryProductColor,
26820
+ pos,
27027
26821
  previouslyAnswered,
27028
- letter,
27029
- pressed,
27030
- transparentBackground
26822
+ pressed
27031
26823
  } = props;
27032
- var dynamicStyles = getDynamicStyles(checked, showCorrectness, pressed, multipleSelect, primaryProductColor, correct, transparentBackground);
26824
+ var dynamicStyles = getDynamicStyles(checked, showCorrectness, pressed, multipleSelect, correct);
27033
26825
  return /*#__PURE__*/React.createElement("div", {
27034
- className: css(styles$t.iconWrapper)
26826
+ className: css(styles$s.iconWrapper)
27035
26827
  }, /*#__PURE__*/React.createElement(FocusRing, {
27036
- color: primaryProductColor,
26828
+ color: Color.blue,
27037
26829
  visible: focused || hovered,
27038
26830
  multipleSelect: multipleSelect
27039
26831
  }, /*#__PURE__*/React.createElement("div", {
27040
26832
  style: dynamicStyles,
27041
26833
  "data-test-id": "choice-icon__library-choice-icon",
27042
- className: 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
26834
+ className: css(styles$q.circle, showCorrectness && correct && styles$q.circleCorrect, showCorrectness && !correct && styles$q.circleIncorrect, showCorrectness && !correct && (checked || previouslyAnswered) && styles$q.circleIncorrectAnswered) // used in BaseRadio editMode to check
27043
26835
  // if we actually clicked on the radio icon
27044
26836
  ,
27045
26837
  "data-is-radio-icon": true
27046
26838
  }, /*#__PURE__*/React.createElement("div", {
27047
- className: css(styles$r.innerWrapper)
26839
+ className: css(styles$q.innerWrapper)
27048
26840
  }, /*#__PURE__*/React.createElement(ChoiceInner, {
27049
- letter: letter,
26841
+ pos: pos,
27050
26842
  showCorrectness: showCorrectness,
27051
26843
  correct: correct
27052
26844
  })))), crossedOut && /*#__PURE__*/React.createElement(CrossOutLine, {
@@ -27054,10 +26846,10 @@ function LibraryChoiceIcon(props) {
27054
26846
  }));
27055
26847
  }
27056
26848
 
27057
- var styles$r = StyleSheet.create({
26849
+ var styles$q = StyleSheet.create({
27058
26850
  innerWrapper: {
27059
- width: LIBRARY_ICON_SIZE,
27060
- height: LIBRARY_ICON_SIZE,
26851
+ width: CHOICE_ICON_SIZE,
26852
+ height: CHOICE_ICON_SIZE,
27061
26853
  // Center the contents of the icon.
27062
26854
  display: "flex",
27063
26855
  alignItems: "center",
@@ -27065,8 +26857,8 @@ var styles$r = StyleSheet.create({
27065
26857
  },
27066
26858
  circle: {
27067
26859
  // Make the circle
27068
- width: LIBRARY_ICON_SIZE,
27069
- height: LIBRARY_ICON_SIZE,
26860
+ width: CHOICE_ICON_SIZE,
26861
+ height: CHOICE_ICON_SIZE,
27070
26862
  boxSizing: "border-box",
27071
26863
  borderStyle: "solid",
27072
26864
  borderWidth: 2,
@@ -27089,10 +26881,10 @@ var styles$r = StyleSheet.create({
27089
26881
  lineHeight: "1px"
27090
26882
  },
27091
26883
  circleCorrect: {
27092
- fontSize: LIBRARY_ICON_SIZE
26884
+ fontSize: CHOICE_ICON_SIZE
27093
26885
  },
27094
26886
  circleIncorrect: {
27095
- fontSize: LIBRARY_ICON_SIZE,
26887
+ fontSize: CHOICE_ICON_SIZE,
27096
26888
  borderColor: gray68,
27097
26889
  color: gray68
27098
26890
  },
@@ -27103,161 +26895,6 @@ var styles$r = StyleSheet.create({
27103
26895
  }
27104
26896
  });
27105
26897
 
27106
- /* Component for rendering a letter icon in a SAT radio choice */
27107
-
27108
- // TODO(amy): figure out a better scheme for specifying these
27109
- // styles that isn't such a pain to grok. See some neat ideas
27110
- // from MDR in https://phabricator.khanacademy.org/D35249.
27111
- function constructSATStyles(reviewMode, correct, checked, multipleSelect) {
27112
- var backgroundColor;
27113
- var borderColor = satBlue;
27114
- var color = satBlue;
27115
-
27116
- if (reviewMode) {
27117
- if (correct) {
27118
- borderColor = satCorrectColor;
27119
- color = checked ? white$1 : satCorrectColor;
27120
- backgroundColor = checked ? satCorrectColor : white$1;
27121
- } else if (checked) {
27122
- borderColor = satIncorrectColor;
27123
- color = white$1;
27124
- backgroundColor = satIncorrectColor;
27125
- }
27126
- } else if (checked) {
27127
- color = white$1;
27128
- backgroundColor = satBlue;
27129
- }
27130
-
27131
- var borderRadius;
27132
-
27133
- if (multipleSelect) {
27134
- borderRadius = 3;
27135
- } else {
27136
- borderRadius = SAT_ICON_SIZE;
27137
- }
27138
-
27139
- return {
27140
- color,
27141
- backgroundColor,
27142
- borderColor,
27143
- borderRadius
27144
- };
27145
- }
27146
-
27147
- function SATChoiceIcon(props) {
27148
- var {
27149
- letter,
27150
- crossedOut,
27151
- reviewMode,
27152
- correct,
27153
- checked,
27154
- multipleSelect
27155
- } = props;
27156
- var {
27157
- color,
27158
- backgroundColor,
27159
- borderColor,
27160
- borderRadius
27161
- } = constructSATStyles(reviewMode, correct, checked, multipleSelect);
27162
- return /*#__PURE__*/React.createElement("div", {
27163
- className: css(styles$t.iconWrapper)
27164
- }, /*#__PURE__*/React.createElement("div", {
27165
- className: css(styles$q.satCircle),
27166
- "data-test-id": "choice-icon__sat-choice-icon",
27167
- style: {
27168
- backgroundColor,
27169
- borderColor,
27170
- borderRadius
27171
- }
27172
- }), /*#__PURE__*/React.createElement("div", {
27173
- style: {
27174
- color
27175
- },
27176
- className: css(styles$q.letter)
27177
- }, /*#__PURE__*/React.createElement("span", null, letter)), crossedOut && /*#__PURE__*/React.createElement(CrossOutLine, {
27178
- color: borderColor,
27179
- sat: true
27180
- }));
27181
- }
27182
-
27183
- var styles$q = StyleSheet.create({
27184
- satCircle: {
27185
- display: "block",
27186
- borderStyle: "solid",
27187
- borderWidth: 2,
27188
- content: "''",
27189
- height: SAT_ICON_SIZE,
27190
- width: SAT_ICON_SIZE,
27191
- top: 1,
27192
- left: 1
27193
- },
27194
- letter: {
27195
- // These properties make sure that this element has the exact
27196
- // same size as `circle` so that we can center things
27197
- // inside of it.
27198
- border: "2px solid transparent",
27199
- width: SAT_ICON_SIZE,
27200
- height: SAT_ICON_SIZE,
27201
- position: "absolute",
27202
- top: 1,
27203
- // Center contained items.
27204
- display: "flex",
27205
- alignItems: "center",
27206
- justifyContent: "center",
27207
- fontFamily: boldFontFamily,
27208
- fontSize: 13
27209
- }
27210
- });
27211
-
27212
- /* Component for rendering a letter icon in radio choice */
27213
-
27214
- function ChoiceIcon(props) {
27215
- var {
27216
- pos,
27217
- reviewMode,
27218
- checked,
27219
- crossedOut,
27220
- correct,
27221
- product,
27222
- multipleSelect,
27223
- showCorrectness,
27224
- focused,
27225
- hovered,
27226
- pressed,
27227
- primaryProductColor = Color.blue,
27228
- previouslyAnswered,
27229
- transparentBackground
27230
- } = props;
27231
- var letter = getChoiceLetter(pos);
27232
-
27233
- if (product === "sat") {
27234
- return /*#__PURE__*/React.createElement(SATChoiceIcon, {
27235
- letter: letter,
27236
- reviewMode: reviewMode,
27237
- checked: checked,
27238
- correct: correct,
27239
- crossedOut: crossedOut,
27240
- multipleSelect: multipleSelect
27241
- });
27242
- }
27243
-
27244
- return /*#__PURE__*/React.createElement(LibraryChoiceIcon, {
27245
- letter: letter,
27246
- reviewMode: reviewMode,
27247
- checked: checked,
27248
- crossedOut: crossedOut,
27249
- focused: focused,
27250
- hovered: hovered,
27251
- pressed: pressed,
27252
- correct: correct,
27253
- showCorrectness: showCorrectness,
27254
- primaryProductColor: primaryProductColor,
27255
- previouslyAnswered: previouslyAnswered,
27256
- transparentBackground: transparentBackground,
27257
- multipleSelect: multipleSelect
27258
- });
27259
- }
27260
-
27261
26898
  /**
27262
26899
  * Renders text indicating whether the choice was correct or
27263
26900
  * not and whether the choice was selected or not.
@@ -27296,16 +26933,10 @@ function OptionStatus(props) {
27296
26933
  correct,
27297
26934
  crossedOut,
27298
26935
  previouslyAnswered,
27299
- reviewMode,
27300
- satStyling
27301
- } = props; // Option status is exclued for SAT
27302
-
27303
- if (satStyling) {
27304
- return null;
27305
- } // Option status is shown only in review mode, or for incorrectly
26936
+ reviewMode
26937
+ } = props; // Option status is shown only in review mode, or for incorrectly
27306
26938
  // answered items.
27307
26939
 
27308
-
27309
26940
  if (!reviewMode && !previouslyAnswered) {
27310
26941
  return null;
27311
26942
  }
@@ -27403,21 +27034,14 @@ function Choice(props) {
27403
27034
  checked: updatedChecked,
27404
27035
  crossedOut: updatedCrossedOut
27405
27036
  });
27406
- } // HACK: while most of the styling for rendering SAT items is handled
27407
- // via aphrodite, we also need to assign normal CSS classnames here to
27408
- // special-case the coloring of MathJax formulas (see .MathJax .math in
27409
- // stylesheets/task-package/tasks.less)
27410
-
27037
+ }
27411
27038
 
27412
- var satCorrectChoice = apiOptions.satStyling && reviewMode && correct;
27413
- var satIncorrectChecked = apiOptions.satStyling && reviewMode && !correct && checked;
27414
- var descriptionClassName = classNames("description", satCorrectChoice && "sat-correct", satIncorrectChecked && "sat-incorrect", css(!apiOptions.satStyling && styles$o.description, apiOptions.satStyling && styles$o.satDescription, satCorrectChoice && checked && styles$o.satDescriptionCorrectChecked, satIncorrectChecked && styles$o.satDescriptionIncorrectChecked));
27415
- var rationaleClassName = classNames("perseus-radio-rationale-content", css(styles$o.rationale, !apiOptions.satStyling && styles$o.nonSatRationale, apiOptions.satStyling && styles$o.satReviewRationale)); // We want to show the choices as dimmed out when the choices are
27416
- // disabled. However, we don't want to do this in the SAT product and
27417
- // we also don't want to do this when we're in review mode in the
27039
+ var descriptionClassName = classNames("description", css(styles$o.description));
27040
+ var rationaleClassName = classNames("perseus-radio-rationale-content", css(styles$o.rationale)); // We want to show the choices as dimmed out when the choices are disabled.
27041
+ // However, we don't want to do this when we're in review mode in the
27418
27042
  // content library.
27419
27043
 
27420
- var showDimmed = !apiOptions.satStyling && !reviewMode && apiOptions.readOnly || crossedOut;
27044
+ var showDimmed = !reviewMode && apiOptions.readOnly || crossedOut;
27421
27045
  var letter = getChoiceLetter(pos);
27422
27046
  var a11yText = getA11yText(letter, checked, correct, crossedOut, showCorrectness);
27423
27047
  var choiceId = uniqueId();
@@ -27472,8 +27096,6 @@ function Choice(props) {
27472
27096
  ref: forwardedRef,
27473
27097
  "aria-hidden": "true"
27474
27098
  }, _ref => {
27475
- var _apiOptions$styling;
27476
-
27477
27099
  var {
27478
27100
  hovered,
27479
27101
  focused,
@@ -27500,8 +27122,6 @@ function Choice(props) {
27500
27122
  showCorrectness: showCorrectness,
27501
27123
  multipleSelect: multipleSelect,
27502
27124
  reviewMode: reviewMode,
27503
- product: apiOptions.satStyling ? "sat" : "library",
27504
- primaryProductColor: (_apiOptions$styling = apiOptions.styling) === null || _apiOptions$styling === void 0 ? void 0 : _apiOptions$styling.primaryProductColor,
27505
27125
  previouslyAnswered: previouslyAnswered
27506
27126
  }), /*#__PURE__*/React.createElement("span", {
27507
27127
  style: {
@@ -27515,8 +27135,7 @@ function Choice(props) {
27515
27135
  correct: correct,
27516
27136
  crossedOut: crossedOut,
27517
27137
  previouslyAnswered: previouslyAnswered,
27518
- reviewMode: reviewMode,
27519
- satStyling: apiOptions.satStyling
27138
+ reviewMode: reviewMode
27520
27139
  })), /*#__PURE__*/React.createElement("div", null, content)));
27521
27140
  }), apiOptions.crossOutEnabled && !reviewMode && /*#__PURE__*/React.createElement(Popover, {
27522
27141
  dismissEnabled: true,
@@ -27599,24 +27218,8 @@ var styles$o = StyleSheet.create({
27599
27218
  display: "inline-block",
27600
27219
  width: "100%"
27601
27220
  },
27602
- satDescription: {
27603
- display: "block",
27604
- position: "relative",
27605
- boxSizing: "border-box",
27606
- cursor: "pointer",
27607
- marginLeft: 0,
27608
- padding: "17px 14px 17px 0"
27609
- },
27610
- satDescriptionCorrectChecked: {
27611
- backgroundColor: satCorrectBackgroundColor
27612
- },
27613
- satDescriptionIncorrectChecked: {
27614
- backgroundColor: satIncorrectBackgroundColor
27615
- },
27616
27221
  rationale: {
27617
- display: "block"
27618
- },
27619
- nonSatRationale: {
27222
+ display: "block",
27620
27223
  padding: intermediateCheckboxPadding,
27621
27224
  paddingTop: 0,
27622
27225
  marginLeft: 54,
@@ -27624,10 +27227,6 @@ var styles$o = StyleSheet.create({
27624
27227
  padding: intermediateCheckboxPaddingPhone,
27625
27228
  paddingTop: 0
27626
27229
  }
27627
- },
27628
- satReviewRationale: {
27629
- marginTop: 13,
27630
- marginLeft: 45
27631
27230
  }
27632
27231
  });
27633
27232
  var Choice$1 = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement(Choice, _extends({}, props, {
@@ -27804,22 +27403,18 @@ function BaseRadio(props) {
27804
27403
  }); // some commonly used shorthands
27805
27404
 
27806
27405
  var reviewMode = !!reviewModeRubric;
27807
- var sat = apiOptions.satStyling;
27808
27406
  var isMobile = apiOptions.isMobile;
27809
27407
  var firstChoiceHighlighted = choices[0].highlighted;
27810
27408
  var lastChoiceHighlighted = choices[choices.length - 1].highlighted;
27811
- var className = classNames("perseus-widget-radio", !editMode && "perseus-rendered-radio", css(styles$n.radio, // SAT doesn't use the "responsive styling" as it conflicts
27812
- // with their custom theming.
27813
- !sat && styles$n.responsiveRadioContainer, !sat && firstChoiceHighlighted && isMobile && styles$n.radioContainerFirstHighlighted, !sat && lastChoiceHighlighted && isMobile && styles$n.radioContainerLastHighlighted, sat && styles$n.satRadio));
27409
+ var className = classNames("perseus-widget-radio", !editMode && "perseus-rendered-radio", css(styles$n.radio, styles$n.responsiveRadioContainer, firstChoiceHighlighted && isMobile && styles$n.radioContainerFirstHighlighted, lastChoiceHighlighted && isMobile && styles$n.radioContainerLastHighlighted));
27814
27410
  var instructionsClassName = classNames("instructions", css(styles$n.instructions, isMobile && styles$n.instructionsMobile));
27815
27411
  var instructions = getInstructionsText(multipleSelect, countChoices, numCorrect);
27816
- var shouldShowInstructions = !sat;
27817
27412
  var responsiveClassName = css(styles$n.responsiveFieldset);
27818
27413
  var fieldset = /*#__PURE__*/React.createElement("fieldset", {
27819
27414
  className: "perseus-widget-radio-fieldset ".concat(responsiveClassName)
27820
- }, shouldShowInstructions && /*#__PURE__*/React.createElement("legend", {
27415
+ }, /*#__PURE__*/React.createElement("legend", {
27821
27416
  className: "perseus-sr-only"
27822
- }, instructions), shouldShowInstructions && /*#__PURE__*/React.createElement("div", {
27417
+ }, instructions), /*#__PURE__*/React.createElement("div", {
27823
27418
  className: instructionsClassName,
27824
27419
  "aria-hidden": "true"
27825
27420
  }, instructions), /*#__PURE__*/React.createElement("ul", {
@@ -27870,9 +27465,7 @@ function BaseRadio(props) {
27870
27465
  var aphroditeClassName = checked => {
27871
27466
  // Whether or not to show correctness borders
27872
27467
  // for this choice and the next choice.
27873
- var satShowCorrectness = sat && reviewMode && checked;
27874
- var satShowCorrectnessNext = sat && reviewMode && nextChoice && nextChoice.checked;
27875
- return css(sharedStyles.aboveScratchpad, styles$n.item, !sat && styles$n.responsiveItem, !sat && checked && styles$n.selectedItem, !sat && checked && choice.highlighted && styles$n.aboveBackdrop, !sat && checked && choice.highlighted && apiOptions.isMobile && styles$n.aboveBackdropMobile, !sat && nextChoiceHighlighted && apiOptions.isMobile && styles$n.nextHighlighted, sat && styles$n.satRadioOption, satShowCorrectness && !choice.correct && styles$n.satRadioOptionIncorrect, satShowCorrectness && choice.correct && styles$n.satRadioOptionCorrect, satShowCorrectnessNext && !nextChoice.correct && styles$n.satRadioOptionNextIncorrect, satShowCorrectnessNext && nextChoice.correct && styles$n.satRadioOptionNextCorrect, sat && reviewModeRubric && styles$n.satReviewRadioOption);
27468
+ return css(sharedStyles.aboveScratchpad, styles$n.item, styles$n.responsiveItem, checked && styles$n.selectedItem, checked && choice.highlighted && styles$n.aboveBackdrop, checked && choice.highlighted && apiOptions.isMobile && styles$n.aboveBackdropMobile, nextChoiceHighlighted && apiOptions.isMobile && styles$n.nextHighlighted);
27876
27469
  }; // HACK(abdulrahman): Preloads the selection-state
27877
27470
  // css because of a bug that causes iOS to lag
27878
27471
  // when selecting the button for the first time.
@@ -27934,10 +27527,9 @@ function BaseRadio(props) {
27934
27527
  }, /*#__PURE__*/React.createElement(Element, elementProps));
27935
27528
  }))); // Allow for horizontal scrolling if content is too wide, which may be
27936
27529
  // an issue especially on phones.
27937
- // This is disabled in SAT, since it conflicts with their theming.
27938
27530
 
27939
27531
  return /*#__PURE__*/React.createElement("div", {
27940
- className: css(!sat && styles$n.responsiveContainer)
27532
+ className: css(styles$n.responsiveContainer)
27941
27533
  }, fieldset);
27942
27534
  }
27943
27535
 
@@ -27986,40 +27578,6 @@ var styles$n = StyleSheet.create({
27986
27578
  radioContainerLastHighlighted: {
27987
27579
  borderBottom: "1px solid rgba(0, 0, 0, 0)"
27988
27580
  },
27989
- satRadio: {
27990
- background: "none",
27991
- marginLeft: 0,
27992
- userSelect: "none"
27993
- },
27994
- satRadioOption: {
27995
- margin: 0,
27996
- padding: 0,
27997
- borderBottom: "1px solid #ccc",
27998
- ":first-child": {
27999
- borderTop: "1px solid #ccc"
28000
- }
28001
- },
28002
- satRadioOptionCorrect: {
28003
- borderBottomColor: satCorrectBorderColor,
28004
- ":first-child": {
28005
- borderTopColor: satCorrectBorderColor
28006
- }
28007
- },
28008
- satRadioOptionIncorrect: {
28009
- borderBottomColor: satIncorrectBorderColor,
28010
- ":first-child": {
28011
- borderTopColor: satIncorrectBorderColor
28012
- }
28013
- },
28014
- satRadioOptionNextCorrect: {
28015
- borderBottomColor: satCorrectBorderColor
28016
- },
28017
- satRadioOptionNextIncorrect: {
28018
- borderBottomColor: satIncorrectBorderColor
28019
- },
28020
- satReviewRadioOption: {
28021
- pointerEvents: "none"
28022
- },
28023
27581
  item: {
28024
27582
  marginLeft: 20
28025
27583
  },
@@ -29120,16 +28678,24 @@ class Definition extends React.Component {
29120
28678
  opened: activeDefinitionId === this.props.widgetId,
29121
28679
  onClose: () => setActiveDefinitionId(null),
29122
28680
  placement: "top"
29123
- }, /*#__PURE__*/React.createElement("span", {
29124
- className: "perseus-widget-definition"
29125
- }, /*#__PURE__*/React.createElement(Button, {
29126
- size: "medium",
29127
- kind: "tertiary",
28681
+ }, /*#__PURE__*/React.createElement(Clickable, {
29128
28682
  onClick: () => {
29129
28683
  this.props.trackInteraction();
29130
28684
  setActiveDefinitionId(this.props.widgetId);
29131
28685
  }
29132
- }, this.props.togglePrompt)));
28686
+ }, _ref2 => {
28687
+ var {
28688
+ hovered,
28689
+ focused,
28690
+ pressed
28691
+ } = _ref2;
28692
+ return /*#__PURE__*/React.createElement("span", {
28693
+ style: {
28694
+ color: Color.blue,
28695
+ borderBottom: hovered || focused || pressed ? "2px solid ".concat(Color.blue) : "none"
28696
+ }
28697
+ }, this.props.togglePrompt);
28698
+ }));
29133
28699
  });
29134
28700
  }
29135
28701
 
@@ -35519,12 +35085,6 @@ var collegeCareersMoreTopicColor = "#329A86";
35519
35085
  var collegeCareersMoreHoverColor = "#218270";
35520
35086
  var collegeCareersMoreLinkColor = "#218270";
35521
35087
  var collegeCareersMoreLinkHoverColor = "#329A86";
35522
- var satDomainColor = "#0084CE";
35523
- var satSubjectColor = "#0084CE";
35524
- var satTopicColor = "#0084CE";
35525
- var satHoverColor = "#0084CE";
35526
- var satLinkColor = "#0084CE";
35527
- var satLinkHoverColor = "#0084CE";
35528
35088
  var colorProficient = "#1C758A";
35529
35089
  var colorPracticed = "rgb(158, 221, 235)";
35530
35090
  var colorMastery1 = "rgb(90, 197, 221)";
@@ -35870,12 +35430,6 @@ var globalConstants = /*#__PURE__*/Object.freeze({
35870
35430
  collegeCareersMoreHoverColor: collegeCareersMoreHoverColor,
35871
35431
  collegeCareersMoreLinkColor: collegeCareersMoreLinkColor,
35872
35432
  collegeCareersMoreLinkHoverColor: collegeCareersMoreLinkHoverColor,
35873
- satDomainColor: satDomainColor,
35874
- satSubjectColor: satSubjectColor,
35875
- satTopicColor: satTopicColor,
35876
- satHoverColor: satHoverColor,
35877
- satLinkColor: satLinkColor,
35878
- satLinkHoverColor: satLinkHoverColor,
35879
35433
  colorProficient: colorProficient,
35880
35434
  colorPracticed: colorPracticed,
35881
35435
  colorMastery1: colorMastery1,
@@ -48727,7 +48281,7 @@ class HintRenderer extends React.Component {
48727
48281
  className: "perseus-sr-only"
48728
48282
  }, i18n._("Hint #%(pos)s", {
48729
48283
  pos: pos + 1
48730
- })), !apiOptions.isMobile && !apiOptions.satStyling && totalHints && pos != null && /*#__PURE__*/React.createElement("span", {
48284
+ })), !apiOptions.isMobile && totalHints != null && pos != null && /*#__PURE__*/React.createElement("span", {
48731
48285
  className: "perseus-hint-label",
48732
48286
  style: {
48733
48287
  display: "block",