@khanacademy/perseus 1.4.1 → 2.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.
Files changed (54) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/es/index.css +10 -246
  3. package/dist/es/index.js +143 -585
  4. package/dist/es/index.js.map +1 -1
  5. package/dist/index.css +10 -246
  6. package/dist/index.js +140 -582
  7. package/dist/index.js.map +1 -1
  8. package/package.json +1 -1
  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/articles.less +6 -1
  18. package/src/styles/constants.js +0 -21
  19. package/src/styles/global-constants.js +0 -6
  20. package/src/styles/khan-exercise.css +9 -1
  21. package/src/styles/perseus-renderer.less +0 -259
  22. package/src/styles/variables.less +0 -11
  23. package/src/styles/variables.shared.less +0 -10
  24. package/src/types.js +0 -16
  25. package/src/widget-container.jsx +4 -0
  26. package/src/widgets/__stories__/definition.stories.jsx +27 -1
  27. package/src/widgets/__stories__/input-number.stories.jsx +0 -14
  28. package/src/widgets/__stories__/radio.stories.jsx +0 -3
  29. package/src/widgets/__tests__/__snapshots__/definition_test.js.snap +20 -30
  30. package/src/widgets/__tests__/__snapshots__/group_test.jsx.snap +0 -9
  31. package/src/widgets/__tests__/__snapshots__/image_test.jsx.snap +0 -18
  32. package/src/widgets/__tests__/__snapshots__/numeric-input_test.jsx.snap +2 -440
  33. package/src/widgets/__tests__/__snapshots__/radio_test.jsx.snap +66 -3726
  34. package/src/widgets/__tests__/numeric-input_test.jsx +54 -118
  35. package/src/widgets/__tests__/radio/choice-icon_test.jsx +25 -75
  36. package/src/widgets/__tests__/radio_test.jsx +362 -394
  37. package/src/widgets/definition.jsx +27 -14
  38. package/src/widgets/input-number.jsx +2 -60
  39. package/src/widgets/numeric-input.jsx +17 -89
  40. package/src/widgets/radio/__stories__/base-radio.stories.jsx +1 -3
  41. package/src/widgets/radio/__stories__/choice-icon.stories.jsx +23 -105
  42. package/src/widgets/radio/__stories__/option-status.stories.jsx +0 -8
  43. package/src/widgets/radio/base-radio.jsx +13 -96
  44. package/src/widgets/radio/choice-icon/choice-icon.jsx +177 -50
  45. package/src/widgets/radio/choice-icon/cross-out-line.jsx +9 -13
  46. package/src/widgets/radio/choice-icon/shared-styles.js +2 -3
  47. package/src/widgets/radio/choice.jsx +5 -59
  48. package/src/widgets/radio/option-status.jsx +2 -14
  49. package/src/components/__stories__/possible-answers.stories.jsx +0 -22
  50. package/src/components/possible-answers.jsx +0 -36
  51. package/src/styles/widgets/definition.less +0 -86
  52. package/src/widgets/radio/__stories__/sat-styles.stories.jsx +0 -191
  53. package/src/widgets/radio/choice-icon/library-choice-icon.jsx +0 -225
  54. 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
@@ -19275,7 +19221,11 @@ class WidgetContainer extends React.Component {
19275
19221
  var className = classNames({
19276
19222
  "perseus-widget-container": true,
19277
19223
  "widget-highlight": this.props.shouldHighlight,
19278
- "widget-nohighlight": !this.props.shouldHighlight
19224
+ "widget-nohighlight": !this.props.shouldHighlight,
19225
+ // HACK(matthewc): perseus-widget-container is setting a font-size
19226
+ // but we want the definition prompt to match the surrounding font
19227
+ // I'm sorry, but there's a time crunch
19228
+ "perseus-widget__definition": this.props.type === "definition"
19279
19229
  });
19280
19230
  var type = this.props.type;
19281
19231
  var WidgetType = getWidget(type);
@@ -19979,7 +19929,7 @@ class Renderer extends React.Component {
19979
19929
  paddingRight: margin
19980
19930
  };
19981
19931
 
19982
- var mobileInnerStyle = _objectSpread2(_objectSpread2({}, innerStyle), styles$A.mobileZoomableParentFix);
19932
+ var mobileInnerStyle = _objectSpread2(_objectSpread2({}, innerStyle), styles$z.mobileZoomableParentFix);
19983
19933
 
19984
19934
  return /*#__PURE__*/React.createElement("div", {
19985
19935
  key: state.key,
@@ -20117,7 +20067,7 @@ class Renderer extends React.Component {
20117
20067
  paddingRight: 0
20118
20068
  };
20119
20069
 
20120
- var _mobileInnerStyle = _objectSpread2(_objectSpread2({}, _innerStyle), styles$A.mobileZoomableParentFix);
20070
+ var _mobileInnerStyle = _objectSpread2(_objectSpread2({}, _innerStyle), styles$z.mobileZoomableParentFix);
20121
20071
 
20122
20072
  var wrappedOutput = /*#__PURE__*/React.createElement("div", {
20123
20073
  style: _objectSpread2(_objectSpread2({}, _mobileInnerStyle), {}, {
@@ -20796,7 +20746,7 @@ _defineProperty(Renderer, "defaultProps", {
20796
20746
  linterContext: PerseusLinter.linterContextDefault
20797
20747
  });
20798
20748
 
20799
- var styles$A = {
20749
+ var styles$z = {
20800
20750
  mobileZoomableParentFix: {
20801
20751
  // NOTE(abdul): There is an issue where transform animations will
20802
20752
  // cause the Zoomable component to disappear when running on the
@@ -22941,31 +22891,6 @@ var Expression$1 = {
22941
22891
  isLintable: true
22942
22892
  };
22943
22893
 
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
22894
  var _excluded$3 = ["keypadElement", "onFocus", "value"];
22970
22895
  class SimpleKeypadInput extends React.Component {
22971
22896
  constructor() {
@@ -23210,7 +23135,7 @@ class InputNumber extends React.Component {
23210
23135
  render() {
23211
23136
  if (this.props.apiOptions.customKeypad) {
23212
23137
  // TODO(charlie): Support "Review Mode".
23213
- var _input = /*#__PURE__*/React.createElement(SimpleKeypadInput // eslint-disable-next-line react/no-string-refs
23138
+ var input = /*#__PURE__*/React.createElement(SimpleKeypadInput // eslint-disable-next-line react/no-string-refs
23214
23139
  , {
23215
23140
  ref: "input",
23216
23141
  value: this.props.currentValue,
@@ -23223,60 +23148,26 @@ class InputNumber extends React.Component {
23223
23148
  if (this.props.rightAlign) {
23224
23149
  return /*#__PURE__*/React.createElement("div", {
23225
23150
  className: "perseus-input-right-align"
23226
- }, _input);
23151
+ }, input);
23227
23152
  }
23228
23153
 
23229
- return _input;
23154
+ return input;
23230
23155
  } // HACK(johnsullivan): Create a function with shared logic between
23231
23156
  // this and NumericInput.
23157
+ // TODO(jeremy): Deprecate this widget and prefer numeric-input.
23232
23158
 
23233
23159
 
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
23160
+ var rubric = this.props.reviewModeRubric; // Note: This is _very_ similar to what `numeric-input.jsx` does. If
23259
23161
  // you modify this, double-check if you also need to modify that
23260
23162
  // component.
23261
23163
 
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
-
23164
+ var inputStyles = [styles$y.default, this.props.size === "small" ? styles$y.small : null, this.props.rightAlign ? styles$y.rightAlign : styles$y.leftAlign]; // Unanswered
23274
23165
 
23275
23166
  if (rubric && !this.props.currentValue) {
23276
- inputStyles.push(styles$z.answerStateUnanswered);
23167
+ inputStyles.push(styles$y.answerStateUnanswered);
23277
23168
  }
23278
23169
 
23279
- var input = /*#__PURE__*/React.createElement(InputWithExamples // eslint-disable-next-line react/no-string-refs
23170
+ return /*#__PURE__*/React.createElement(InputWithExamples // eslint-disable-next-line react/no-string-refs
23280
23171
  , {
23281
23172
  ref: "input",
23282
23173
  value: this.props.currentValue,
@@ -23290,17 +23181,7 @@ class InputNumber extends React.Component {
23290
23181
  id: this.props.widgetId,
23291
23182
  disabled: this.props.apiOptions.readOnly,
23292
23183
  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;
23184
+ });
23304
23185
  }
23305
23186
 
23306
23187
  static validate(state, rubric) {
@@ -23377,7 +23258,7 @@ _defineProperty(InputNumber, "defaultProps", {
23377
23258
  linterContext: linterContextDefault
23378
23259
  });
23379
23260
 
23380
- var styles$z = StyleSheet.create({
23261
+ var styles$y = StyleSheet.create({
23381
23262
  default: {
23382
23263
  width: 80,
23383
23264
  height: "auto"
@@ -23394,16 +23275,6 @@ var styles$z = StyleSheet.create({
23394
23275
  paddingLeft: 0,
23395
23276
  paddingRight: Spacing.xxxSmall_4
23396
23277
  },
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
23278
  answerStateUnanswered: {
23408
23279
  backgroundColor: "#eee",
23409
23280
  border: "solid 1px #999"
@@ -23481,49 +23352,6 @@ class NumericInput extends React.Component {
23481
23352
  previousValues: [""]
23482
23353
  });
23483
23354
 
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
23355
  _defineProperty(this, "examples", () => {
23528
23356
  var _this$props$answerFor;
23529
23357
 
@@ -23752,9 +23580,6 @@ class NumericInput extends React.Component {
23752
23580
  }
23753
23581
 
23754
23582
  render() {
23755
- var rubric = this.props.reviewModeRubric;
23756
- var answers = this.getAnswerBlurb(rubric);
23757
- var answerBlurb = answers[0];
23758
23583
  var labelText = this.props.labelText;
23759
23584
 
23760
23585
  if (labelText == null || labelText === "") {
@@ -23791,7 +23616,7 @@ class NumericInput extends React.Component {
23791
23616
  height: "auto"
23792
23617
  }
23793
23618
  });
23794
- var input = /*#__PURE__*/React.createElement(InputWithExamples, {
23619
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(InputWithExamples, {
23795
23620
  ref: _ref2 => this.inputRef = _ref2,
23796
23621
  value: this.props.currentValue,
23797
23622
  onChange: this.handleChange,
@@ -23804,30 +23629,7 @@ class NumericInput extends React.Component {
23804
23629
  id: this.props.widgetId,
23805
23630
  disabled: this.props.apiOptions.readOnly,
23806
23631
  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);
23632
+ }));
23831
23633
  }
23832
23634
 
23833
23635
  } // TODO(thomas): Currently we receive a list of lists of acceptable answer types
@@ -24619,7 +24421,7 @@ class HighlightRenderer extends React.PureComponent {
24619
24421
  var rects = this.state.cachedHighlightRects;
24620
24422
  return /*#__PURE__*/React.createElement("div", null, rects.map((rect, index) => /*#__PURE__*/React.createElement("div", {
24621
24423
  key: index,
24622
- className: css(styles$y.highlightRect),
24424
+ className: css(styles$x.highlightRect),
24623
24425
  style: {
24624
24426
  // NOTE(mdr): We apply `position: absolute` here
24625
24427
  // rather than in Aphrodite styles, because
@@ -24640,7 +24442,7 @@ class HighlightRenderer extends React.PureComponent {
24640
24442
 
24641
24443
  }
24642
24444
 
24643
- var styles$y = StyleSheet.create({
24445
+ var styles$x = StyleSheet.create({
24644
24446
  highlightRect: {
24645
24447
  background: "#fffabe" // highlighter yellow :)
24646
24448
 
@@ -24722,7 +24524,7 @@ class HighlightTooltip extends React.PureComponent {
24722
24524
 
24723
24525
 
24724
24526
  var content = /*#__PURE__*/React.createElement("div", {
24725
- className: css(styles$x.tooltipLabel),
24527
+ className: css(styles$w.tooltipLabel),
24726
24528
  onClick: this.props.onClick
24727
24529
  }, this.props.label);
24728
24530
  var style = {
@@ -24744,7 +24546,7 @@ class HighlightTooltip extends React.PureComponent {
24744
24546
 
24745
24547
  }
24746
24548
 
24747
- var styles$x = StyleSheet.create({
24549
+ var styles$w = StyleSheet.create({
24748
24550
  tooltipLabel: {
24749
24551
  // Unlike most tooltip contents, we don't want this label to be
24750
24552
  // selectable. Selecting it is not only unhelpful, but dangerous: if
@@ -25347,7 +25149,7 @@ class HighlightableContent extends React.PureComponent {
25347
25149
  var buildHighlight = r => this._buildHighlight(r);
25348
25150
 
25349
25151
  return /*#__PURE__*/React.createElement("div", {
25350
- className: css(styles$w.container),
25152
+ className: css(styles$v.container),
25351
25153
  ref: container => this._container = container
25352
25154
  }, /*#__PURE__*/React.createElement("div", null, this.props.enabled && this._container && this._content && /*#__PURE__*/React.createElement(HighlightingUI, {
25353
25155
  buildHighlight: buildHighlight,
@@ -25368,7 +25170,7 @@ class HighlightableContent extends React.PureComponent {
25368
25170
  onAddHighlight: this._handleAddHighlight,
25369
25171
  onRemoveHighlight: this._handleRemoveHighlight
25370
25172
  })), /*#__PURE__*/React.createElement("div", {
25371
- className: css(styles$w.content),
25173
+ className: css(styles$v.content),
25372
25174
  ref: content => this._content = content
25373
25175
  }, /*#__PURE__*/React.createElement(WordIndexer, {
25374
25176
  onWordsUpdate: this._handleWordsUpdate
@@ -25377,7 +25179,7 @@ class HighlightableContent extends React.PureComponent {
25377
25179
 
25378
25180
  }
25379
25181
 
25380
- var styles$w = StyleSheet.create({
25182
+ var styles$v = StyleSheet.create({
25381
25183
  // We render content with z-index 1, and highlights with z-index 0, so that
25382
25184
  // content will receive the browser's native pointer events. (Highlights
25383
25185
  // have their own magic code to manage hover detection, despite being
@@ -25794,7 +25596,7 @@ class LineHeightMeasurer extends React.Component {
25794
25596
 
25795
25597
  render() {
25796
25598
  return /*#__PURE__*/React.createElement("div", {
25797
- className: css(styles$v.measurer),
25599
+ className: css(styles$u.measurer),
25798
25600
  "aria-hidden": "true"
25799
25601
  }, /*#__PURE__*/React.createElement("div", {
25800
25602
  ref: _ref => this._line = _ref,
@@ -25803,7 +25605,7 @@ class LineHeightMeasurer extends React.Component {
25803
25605
  }
25804
25606
 
25805
25607
  }
25806
- var styles$v = StyleSheet.create({
25608
+ var styles$u = StyleSheet.create({
25807
25609
  measurer: {
25808
25610
  position: "absolute",
25809
25611
  top: 0,
@@ -26829,36 +26631,6 @@ function getA11yText(letter, checked, correct, crossedOut, showCorrectness) {
26829
26631
  });
26830
26632
  }
26831
26633
 
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
26634
  /**
26863
26635
  * Renders a circular selection ring around the child.
26864
26636
  */
@@ -26878,7 +26650,7 @@ function FocusRing(props) {
26878
26650
  };
26879
26651
  return /*#__PURE__*/React.createElement("span", {
26880
26652
  "data-test-id": "focus-ring",
26881
- className: css(styles$u.ring),
26653
+ className: css(styles$t.ring),
26882
26654
  style: style
26883
26655
  }, children);
26884
26656
  }
@@ -26888,7 +26660,7 @@ FocusRing.defaultProps = {
26888
26660
  color: kaGreen$1,
26889
26661
  multipleSelect: false
26890
26662
  };
26891
- var styles$u = StyleSheet.create({
26663
+ var styles$t = StyleSheet.create({
26892
26664
  ring: {
26893
26665
  margin: "auto",
26894
26666
  display: "inline-block",
@@ -26898,9 +26670,38 @@ var styles$u = StyleSheet.create({
26898
26670
  }
26899
26671
  });
26900
26672
 
26901
- var SAT_ICON_SIZE = 25;
26902
- var LIBRARY_ICON_SIZE = 24;
26903
- var styles$t = StyleSheet.create({
26673
+ /**
26674
+ * Given a choice's position in the radio widget, return the corresponding
26675
+ * "choice letter". (For example, in English, `getChoiceLetter(0)` is "A",
26676
+ * `getChoiceLetter(1)` is "B", etc.)
26677
+ */
26678
+
26679
+ function getChoiceLetter(pos) {
26680
+ /* I18N: This is a list of single-character labels that will appear in
26681
+ * front of multiple-choice options. For instance, a multiple-choice
26682
+ * question with three options would display
26683
+ * (A) first option
26684
+ * (B) second option
26685
+ * (C) third option
26686
+ * There must be spaces between each of the different characters. The
26687
+ * characters will show up next to options in the order that they are
26688
+ * listed here. Most multiple choice questions have 5 or fewer options.
26689
+ */
26690
+ 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");
26691
+
26692
+ var letters = lettersString.split(" ");
26693
+
26694
+ if (pos < letters.length) {
26695
+ // If the position we need is listed in the localized string, use that.
26696
+ return letters[pos];
26697
+ } // If we're out of letters, give up and return a space.
26698
+
26699
+
26700
+ return " ";
26701
+ }
26702
+
26703
+ var CHOICE_ICON_SIZE = 24;
26704
+ var styles$s = StyleSheet.create({
26904
26705
  iconWrapper: {
26905
26706
  display: "inline-block",
26906
26707
  position: "relative"
@@ -26911,28 +26712,26 @@ var styles$t = StyleSheet.create({
26911
26712
  // extra space for the cute rounded line cap.
26912
26713
 
26913
26714
  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;
26715
+ var CROSS_OUT_LINE_SIZE = CHOICE_ICON_SIZE + CROSS_OUT_LINE_PADDING * 2;
26916
26716
  /**
26917
26717
  * The "cross-out line" that appears over the icon when the choice has been
26918
26718
  * `crossedOut`.
26919
26719
  */
26920
26720
 
26921
26721
  function CrossOutLine(props) {
26922
- var crossOutLineSize = props.sat ? SAT_CROSS_OUT_LINE_SIZE : CROSS_OUT_LINE_SIZE;
26923
26722
  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),
26723
+ width: CROSS_OUT_LINE_SIZE,
26724
+ height: CROSS_OUT_LINE_SIZE,
26725
+ viewBox: "0 0 ".concat(CROSS_OUT_LINE_SIZE, " ").concat(CROSS_OUT_LINE_SIZE),
26726
+ className: css(styles$r.crossOutLine),
26928
26727
  "data-test-id": "choice-icon__cross-out-line"
26929
26728
  }, /*#__PURE__*/React.createElement("line", {
26930
26729
  // The line stretches from the bottom-left to top-right.
26931
26730
  // We don't quite go to the _very_ corner, because the cute
26932
26731
  // rounded line cap needs to bleed into our padding.
26933
26732
  x1: CROSS_OUT_LINE_PADDING,
26934
- x2: crossOutLineSize - CROSS_OUT_LINE_PADDING,
26935
- y1: crossOutLineSize - CROSS_OUT_LINE_PADDING,
26733
+ x2: CROSS_OUT_LINE_SIZE - CROSS_OUT_LINE_PADDING,
26734
+ y1: CROSS_OUT_LINE_SIZE - CROSS_OUT_LINE_PADDING,
26936
26735
  y2: CROSS_OUT_LINE_PADDING,
26937
26736
  stroke: props.color,
26938
26737
  strokeWidth: "2",
@@ -26940,7 +26739,7 @@ function CrossOutLine(props) {
26940
26739
  }));
26941
26740
  }
26942
26741
 
26943
- var styles$s = StyleSheet.create({
26742
+ var styles$r = StyleSheet.create({
26944
26743
  crossOutLine: {
26945
26744
  // Center the icon within the container.
26946
26745
  position: "absolute",
@@ -26951,10 +26750,11 @@ var styles$s = StyleSheet.create({
26951
26750
 
26952
26751
  function ChoiceInner(props) {
26953
26752
  var {
26954
- letter,
26753
+ pos,
26955
26754
  showCorrectness,
26956
26755
  correct
26957
26756
  } = props;
26757
+ var letter = getChoiceLetter(pos);
26958
26758
 
26959
26759
  if (!showCorrectness) {
26960
26760
  return letter;
@@ -26976,19 +26776,17 @@ function ChoiceInner(props) {
26976
26776
  // related to the selected state dynamically.
26977
26777
 
26978
26778
 
26979
- function getDynamicStyles(checked, showCorrectness, pressed, multipleSelect, primaryProductColor, correct, transparentBackground) {
26779
+ function getDynamicStyles(checked, showCorrectness, pressed, multipleSelect, correct) {
26980
26780
  var backgroundColor;
26981
26781
  var borderColor;
26982
26782
  var color;
26983
26783
 
26984
26784
  if (!showCorrectness && pressed) {
26985
- borderColor = primaryProductColor;
26986
- color = primaryProductColor;
26987
- backgroundColor = transparentBackground ? "transparent" : white$1;
26785
+ borderColor = Color.blue;
26786
+ color = Color.blue;
26787
+ backgroundColor = "transparent";
26988
26788
  } 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;
26789
+ var bg = showCorrectness && correct ? Color.green : Color.blue;
26992
26790
  color = white$1;
26993
26791
  backgroundColor = bg;
26994
26792
  borderColor = bg;
@@ -27003,7 +26801,7 @@ function getDynamicStyles(checked, showCorrectness, pressed, multipleSelect, pri
27003
26801
  if (multipleSelect) {
27004
26802
  borderRadius = 3;
27005
26803
  } else {
27006
- borderRadius = LIBRARY_ICON_SIZE;
26804
+ borderRadius = CHOICE_ICON_SIZE;
27007
26805
  }
27008
26806
 
27009
26807
  return {
@@ -27014,7 +26812,7 @@ function getDynamicStyles(checked, showCorrectness, pressed, multipleSelect, pri
27014
26812
  };
27015
26813
  }
27016
26814
 
27017
- function LibraryChoiceIcon(props) {
26815
+ function ChoiceIcon(props) {
27018
26816
  var {
27019
26817
  checked,
27020
26818
  crossedOut,
@@ -27023,30 +26821,28 @@ function LibraryChoiceIcon(props) {
27023
26821
  focused,
27024
26822
  hovered,
27025
26823
  multipleSelect,
27026
- primaryProductColor,
26824
+ pos,
27027
26825
  previouslyAnswered,
27028
- letter,
27029
- pressed,
27030
- transparentBackground
26826
+ pressed
27031
26827
  } = props;
27032
- var dynamicStyles = getDynamicStyles(checked, showCorrectness, pressed, multipleSelect, primaryProductColor, correct, transparentBackground);
26828
+ var dynamicStyles = getDynamicStyles(checked, showCorrectness, pressed, multipleSelect, correct);
27033
26829
  return /*#__PURE__*/React.createElement("div", {
27034
- className: css(styles$t.iconWrapper)
26830
+ className: css(styles$s.iconWrapper)
27035
26831
  }, /*#__PURE__*/React.createElement(FocusRing, {
27036
- color: primaryProductColor,
26832
+ color: Color.blue,
27037
26833
  visible: focused || hovered,
27038
26834
  multipleSelect: multipleSelect
27039
26835
  }, /*#__PURE__*/React.createElement("div", {
27040
26836
  style: dynamicStyles,
27041
26837
  "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
26838
+ 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
26839
  // if we actually clicked on the radio icon
27044
26840
  ,
27045
26841
  "data-is-radio-icon": true
27046
26842
  }, /*#__PURE__*/React.createElement("div", {
27047
- className: css(styles$r.innerWrapper)
26843
+ className: css(styles$q.innerWrapper)
27048
26844
  }, /*#__PURE__*/React.createElement(ChoiceInner, {
27049
- letter: letter,
26845
+ pos: pos,
27050
26846
  showCorrectness: showCorrectness,
27051
26847
  correct: correct
27052
26848
  })))), crossedOut && /*#__PURE__*/React.createElement(CrossOutLine, {
@@ -27054,10 +26850,10 @@ function LibraryChoiceIcon(props) {
27054
26850
  }));
27055
26851
  }
27056
26852
 
27057
- var styles$r = StyleSheet.create({
26853
+ var styles$q = StyleSheet.create({
27058
26854
  innerWrapper: {
27059
- width: LIBRARY_ICON_SIZE,
27060
- height: LIBRARY_ICON_SIZE,
26855
+ width: CHOICE_ICON_SIZE,
26856
+ height: CHOICE_ICON_SIZE,
27061
26857
  // Center the contents of the icon.
27062
26858
  display: "flex",
27063
26859
  alignItems: "center",
@@ -27065,8 +26861,8 @@ var styles$r = StyleSheet.create({
27065
26861
  },
27066
26862
  circle: {
27067
26863
  // Make the circle
27068
- width: LIBRARY_ICON_SIZE,
27069
- height: LIBRARY_ICON_SIZE,
26864
+ width: CHOICE_ICON_SIZE,
26865
+ height: CHOICE_ICON_SIZE,
27070
26866
  boxSizing: "border-box",
27071
26867
  borderStyle: "solid",
27072
26868
  borderWidth: 2,
@@ -27089,10 +26885,10 @@ var styles$r = StyleSheet.create({
27089
26885
  lineHeight: "1px"
27090
26886
  },
27091
26887
  circleCorrect: {
27092
- fontSize: LIBRARY_ICON_SIZE
26888
+ fontSize: CHOICE_ICON_SIZE
27093
26889
  },
27094
26890
  circleIncorrect: {
27095
- fontSize: LIBRARY_ICON_SIZE,
26891
+ fontSize: CHOICE_ICON_SIZE,
27096
26892
  borderColor: gray68,
27097
26893
  color: gray68
27098
26894
  },
@@ -27103,161 +26899,6 @@ var styles$r = StyleSheet.create({
27103
26899
  }
27104
26900
  });
27105
26901
 
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
26902
  /**
27262
26903
  * Renders text indicating whether the choice was correct or
27263
26904
  * not and whether the choice was selected or not.
@@ -27296,16 +26937,10 @@ function OptionStatus(props) {
27296
26937
  correct,
27297
26938
  crossedOut,
27298
26939
  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
26940
+ reviewMode
26941
+ } = props; // Option status is shown only in review mode, or for incorrectly
27306
26942
  // answered items.
27307
26943
 
27308
-
27309
26944
  if (!reviewMode && !previouslyAnswered) {
27310
26945
  return null;
27311
26946
  }
@@ -27403,21 +27038,14 @@ function Choice(props) {
27403
27038
  checked: updatedChecked,
27404
27039
  crossedOut: updatedCrossedOut
27405
27040
  });
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
-
27041
+ }
27411
27042
 
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
27043
+ var descriptionClassName = classNames("description", css(styles$o.description));
27044
+ 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.
27045
+ // However, we don't want to do this when we're in review mode in the
27418
27046
  // content library.
27419
27047
 
27420
- var showDimmed = !apiOptions.satStyling && !reviewMode && apiOptions.readOnly || crossedOut;
27048
+ var showDimmed = !reviewMode && apiOptions.readOnly || crossedOut;
27421
27049
  var letter = getChoiceLetter(pos);
27422
27050
  var a11yText = getA11yText(letter, checked, correct, crossedOut, showCorrectness);
27423
27051
  var choiceId = uniqueId();
@@ -27472,8 +27100,6 @@ function Choice(props) {
27472
27100
  ref: forwardedRef,
27473
27101
  "aria-hidden": "true"
27474
27102
  }, _ref => {
27475
- var _apiOptions$styling;
27476
-
27477
27103
  var {
27478
27104
  hovered,
27479
27105
  focused,
@@ -27500,8 +27126,6 @@ function Choice(props) {
27500
27126
  showCorrectness: showCorrectness,
27501
27127
  multipleSelect: multipleSelect,
27502
27128
  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
27129
  previouslyAnswered: previouslyAnswered
27506
27130
  }), /*#__PURE__*/React.createElement("span", {
27507
27131
  style: {
@@ -27515,8 +27139,7 @@ function Choice(props) {
27515
27139
  correct: correct,
27516
27140
  crossedOut: crossedOut,
27517
27141
  previouslyAnswered: previouslyAnswered,
27518
- reviewMode: reviewMode,
27519
- satStyling: apiOptions.satStyling
27142
+ reviewMode: reviewMode
27520
27143
  })), /*#__PURE__*/React.createElement("div", null, content)));
27521
27144
  }), apiOptions.crossOutEnabled && !reviewMode && /*#__PURE__*/React.createElement(Popover, {
27522
27145
  dismissEnabled: true,
@@ -27599,24 +27222,8 @@ var styles$o = StyleSheet.create({
27599
27222
  display: "inline-block",
27600
27223
  width: "100%"
27601
27224
  },
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
27225
  rationale: {
27617
- display: "block"
27618
- },
27619
- nonSatRationale: {
27226
+ display: "block",
27620
27227
  padding: intermediateCheckboxPadding,
27621
27228
  paddingTop: 0,
27622
27229
  marginLeft: 54,
@@ -27624,10 +27231,6 @@ var styles$o = StyleSheet.create({
27624
27231
  padding: intermediateCheckboxPaddingPhone,
27625
27232
  paddingTop: 0
27626
27233
  }
27627
- },
27628
- satReviewRationale: {
27629
- marginTop: 13,
27630
- marginLeft: 45
27631
27234
  }
27632
27235
  });
27633
27236
  var Choice$1 = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement(Choice, _extends({}, props, {
@@ -27804,22 +27407,18 @@ function BaseRadio(props) {
27804
27407
  }); // some commonly used shorthands
27805
27408
 
27806
27409
  var reviewMode = !!reviewModeRubric;
27807
- var sat = apiOptions.satStyling;
27808
27410
  var isMobile = apiOptions.isMobile;
27809
27411
  var firstChoiceHighlighted = choices[0].highlighted;
27810
27412
  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));
27413
+ 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
27414
  var instructionsClassName = classNames("instructions", css(styles$n.instructions, isMobile && styles$n.instructionsMobile));
27815
27415
  var instructions = getInstructionsText(multipleSelect, countChoices, numCorrect);
27816
- var shouldShowInstructions = !sat;
27817
27416
  var responsiveClassName = css(styles$n.responsiveFieldset);
27818
27417
  var fieldset = /*#__PURE__*/React.createElement("fieldset", {
27819
27418
  className: "perseus-widget-radio-fieldset ".concat(responsiveClassName)
27820
- }, shouldShowInstructions && /*#__PURE__*/React.createElement("legend", {
27419
+ }, /*#__PURE__*/React.createElement("legend", {
27821
27420
  className: "perseus-sr-only"
27822
- }, instructions), shouldShowInstructions && /*#__PURE__*/React.createElement("div", {
27421
+ }, instructions), /*#__PURE__*/React.createElement("div", {
27823
27422
  className: instructionsClassName,
27824
27423
  "aria-hidden": "true"
27825
27424
  }, instructions), /*#__PURE__*/React.createElement("ul", {
@@ -27870,9 +27469,7 @@ function BaseRadio(props) {
27870
27469
  var aphroditeClassName = checked => {
27871
27470
  // Whether or not to show correctness borders
27872
27471
  // 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);
27472
+ 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
27473
  }; // HACK(abdulrahman): Preloads the selection-state
27877
27474
  // css because of a bug that causes iOS to lag
27878
27475
  // when selecting the button for the first time.
@@ -27934,10 +27531,9 @@ function BaseRadio(props) {
27934
27531
  }, /*#__PURE__*/React.createElement(Element, elementProps));
27935
27532
  }))); // Allow for horizontal scrolling if content is too wide, which may be
27936
27533
  // an issue especially on phones.
27937
- // This is disabled in SAT, since it conflicts with their theming.
27938
27534
 
27939
27535
  return /*#__PURE__*/React.createElement("div", {
27940
- className: css(!sat && styles$n.responsiveContainer)
27536
+ className: css(styles$n.responsiveContainer)
27941
27537
  }, fieldset);
27942
27538
  }
27943
27539
 
@@ -27986,40 +27582,6 @@ var styles$n = StyleSheet.create({
27986
27582
  radioContainerLastHighlighted: {
27987
27583
  borderBottom: "1px solid rgba(0, 0, 0, 0)"
27988
27584
  },
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
27585
  item: {
28024
27586
  marginLeft: 20
28025
27587
  },
@@ -29120,16 +28682,24 @@ class Definition extends React.Component {
29120
28682
  opened: activeDefinitionId === this.props.widgetId,
29121
28683
  onClose: () => setActiveDefinitionId(null),
29122
28684
  placement: "top"
29123
- }, /*#__PURE__*/React.createElement("span", {
29124
- className: "perseus-widget-definition"
29125
- }, /*#__PURE__*/React.createElement(Button, {
29126
- size: "medium",
29127
- kind: "tertiary",
28685
+ }, /*#__PURE__*/React.createElement(Clickable, {
29128
28686
  onClick: () => {
29129
28687
  this.props.trackInteraction();
29130
28688
  setActiveDefinitionId(this.props.widgetId);
29131
28689
  }
29132
- }, this.props.togglePrompt)));
28690
+ }, _ref2 => {
28691
+ var {
28692
+ hovered,
28693
+ focused,
28694
+ pressed
28695
+ } = _ref2;
28696
+ return /*#__PURE__*/React.createElement("span", {
28697
+ style: {
28698
+ color: Color.blue,
28699
+ borderBottom: hovered || focused || pressed ? "2px solid ".concat(Color.blue) : "none"
28700
+ }
28701
+ }, this.props.togglePrompt);
28702
+ }));
29133
28703
  });
29134
28704
  }
29135
28705
 
@@ -35519,12 +35089,6 @@ var collegeCareersMoreTopicColor = "#329A86";
35519
35089
  var collegeCareersMoreHoverColor = "#218270";
35520
35090
  var collegeCareersMoreLinkColor = "#218270";
35521
35091
  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
35092
  var colorProficient = "#1C758A";
35529
35093
  var colorPracticed = "rgb(158, 221, 235)";
35530
35094
  var colorMastery1 = "rgb(90, 197, 221)";
@@ -35870,12 +35434,6 @@ var globalConstants = /*#__PURE__*/Object.freeze({
35870
35434
  collegeCareersMoreHoverColor: collegeCareersMoreHoverColor,
35871
35435
  collegeCareersMoreLinkColor: collegeCareersMoreLinkColor,
35872
35436
  collegeCareersMoreLinkHoverColor: collegeCareersMoreLinkHoverColor,
35873
- satDomainColor: satDomainColor,
35874
- satSubjectColor: satSubjectColor,
35875
- satTopicColor: satTopicColor,
35876
- satHoverColor: satHoverColor,
35877
- satLinkColor: satLinkColor,
35878
- satLinkHoverColor: satLinkHoverColor,
35879
35437
  colorProficient: colorProficient,
35880
35438
  colorPracticed: colorPracticed,
35881
35439
  colorMastery1: colorMastery1,
@@ -48727,7 +48285,7 @@ class HintRenderer extends React.Component {
48727
48285
  className: "perseus-sr-only"
48728
48286
  }, i18n._("Hint #%(pos)s", {
48729
48287
  pos: pos + 1
48730
- })), !apiOptions.isMobile && !apiOptions.satStyling && totalHints && pos != null && /*#__PURE__*/React.createElement("span", {
48288
+ })), !apiOptions.isMobile && totalHints != null && pos != null && /*#__PURE__*/React.createElement("span", {
48731
48289
  className: "perseus-hint-label",
48732
48290
  style: {
48733
48291
  display: "block",