@khanacademy/perseus 10.0.1 → 10.1.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.
package/dist/index.js CHANGED
@@ -17631,7 +17631,8 @@ class Zoomable extends React__namespace.Component {
17631
17631
  zoomed
17632
17632
  } = this.state;
17633
17633
  const {
17634
- animateHeight
17634
+ animateHeight,
17635
+ disableEntranceAnimation
17635
17636
  } = this.props;
17636
17637
  const property = animateHeight ? "opacity transform height" : "opacity transform";
17637
17638
 
@@ -17643,7 +17644,9 @@ class Zoomable extends React__namespace.Component {
17643
17644
  } : {};
17644
17645
 
17645
17646
  // Do a fancy little slide as we fade the contents in the first time.
17646
- const translateOffset = visible ? "" : " translate(0, 8px)";
17647
+ const shouldSlide = !disableEntranceAnimation && !visible;
17648
+ const translateOffset = shouldSlide ? " translate(0, 8px)" : "";
17649
+ const opacity = shouldSlide ? 0 : 1;
17647
17650
  const scaleString = (scale !== null && scale !== void 0 ? scale : 1).toString();
17648
17651
  const transform = zoomed ? "scale(1, 1) ".concat(translateOffset) : "scale(".concat(scaleString, ", ").concat(scaleString, ") ").concat(translateOffset);
17649
17652
  const style = {
@@ -17652,7 +17655,7 @@ class Zoomable extends React__namespace.Component {
17652
17655
  height: zoomed ? expandedHeight : compactHeight,
17653
17656
  transform: transform,
17654
17657
  transformOrigin: "0 0",
17655
- opacity: visible ? 1 : 0,
17658
+ opacity: opacity,
17656
17659
  WebkitTapHighlightColor: "transparent",
17657
17660
  ...transitionStyle
17658
17661
  };
@@ -17671,6 +17674,7 @@ class Zoomable extends React__namespace.Component {
17671
17674
  _defineProperty(Zoomable, "defaultProps", {
17672
17675
  animateHeight: false,
17673
17676
  readyToMeasure: true,
17677
+ disableEntranceAnimation: false,
17674
17678
  computeChildBounds: parentNode => {
17675
17679
  const firstChild = parentNode.firstElementChild;
17676
17680
  return {
@@ -17716,7 +17720,9 @@ class ZoomableTeX extends React__namespace.Component {
17716
17720
  render() {
17717
17721
  return /*#__PURE__*/React__namespace.createElement(Zoomable, {
17718
17722
  readyToMeasure: this.state.isRendered,
17719
- computeChildBounds: computeMathBounds
17723
+ computeChildBounds: computeMathBounds,
17724
+ animateHeight: false,
17725
+ disableEntranceAnimation: true
17720
17726
  }, /*#__PURE__*/React__namespace.createElement(context$1.Consumer, null, _ref => {
17721
17727
  let {
17722
17728
  setAssetStatus
@@ -17961,33 +17967,33 @@ class Lint extends React__namespace.Component {
17961
17967
  let warningText;
17962
17968
  let warningTextStyle;
17963
17969
  if (this.props.severity === Severity.Error) {
17964
- severityStyle = styles$A.indicatorError;
17970
+ severityStyle = styles$z.indicatorError;
17965
17971
  warningText = "Error";
17966
- warningTextStyle = styles$A.publishBlockingError;
17972
+ warningTextStyle = styles$z.publishBlockingError;
17967
17973
  } else if (this.props.severity === Severity.Warning) {
17968
- severityStyle = styles$A.indicatorWarning;
17974
+ severityStyle = styles$z.indicatorWarning;
17969
17975
  warningText = "Warning";
17970
- warningTextStyle = styles$A.warning;
17976
+ warningTextStyle = styles$z.warning;
17971
17977
  } else {
17972
- severityStyle = styles$A.indicatorGuideline;
17978
+ severityStyle = styles$z.indicatorGuideline;
17973
17979
  warningText = "Recommendation";
17974
- warningTextStyle = styles$A.warning;
17980
+ warningTextStyle = styles$z.warning;
17975
17981
  }
17976
17982
  return /*#__PURE__*/React__namespace.createElement("a", {
17977
17983
  href: "https://khanacademy.org/r/linter-rules#".concat(this.props.ruleName),
17978
17984
  target: "lint-help-window",
17979
17985
  className: aphrodite.css(style)
17980
17986
  }, /*#__PURE__*/React__namespace.createElement("span", {
17981
- className: aphrodite.css(styles$A.indicator, severityStyle)
17987
+ className: aphrodite.css(styles$z.indicator, severityStyle)
17982
17988
  }, this.props.severity === 1 && /*#__PURE__*/React__namespace.createElement(InlineIcon, exclamationIcon)), /*#__PURE__*/React__namespace.createElement("div", {
17983
- className: aphrodite.css(styles$A.tooltip, tooltipAbove && styles$A.tooltipAbove)
17989
+ className: aphrodite.css(styles$z.tooltip, tooltipAbove && styles$z.tooltipAbove)
17984
17990
  }, this.props.message.split("\n\n").map((m, i) => /*#__PURE__*/React__namespace.createElement("p", {
17985
17991
  key: i,
17986
- className: aphrodite.css(styles$A.tooltipParagraph)
17992
+ className: aphrodite.css(styles$z.tooltipParagraph)
17987
17993
  }, /*#__PURE__*/React__namespace.createElement("span", {
17988
17994
  className: aphrodite.css(warningTextStyle)
17989
17995
  }, warningText, ":", " "), m)), /*#__PURE__*/React__namespace.createElement("div", {
17990
- className: aphrodite.css(styles$A.tail, tooltipAbove && styles$A.tailAbove)
17996
+ className: aphrodite.css(styles$z.tail, tooltipAbove && styles$z.tailAbove)
17991
17997
  })));
17992
17998
  });
17993
17999
  }
@@ -18031,20 +18037,20 @@ class Lint extends React__namespace.Component {
18031
18037
  }
18032
18038
  if (blockHighlight) {
18033
18039
  return /*#__PURE__*/React__namespace.createElement("span", {
18034
- className: aphrodite.css(styles$A.lintContainer, styles$A.lintContainerBlock)
18035
- }, this.renderLink(styles$A.radioWidgetHoverTarget), /*#__PURE__*/React__namespace.createElement("span", null, children));
18040
+ className: aphrodite.css(styles$z.lintContainer, styles$z.lintContainerBlock)
18041
+ }, this.renderLink(styles$z.radioWidgetHoverTarget), /*#__PURE__*/React__namespace.createElement("span", null, children));
18036
18042
  }
18037
18043
  if (inline) {
18038
18044
  return /*#__PURE__*/React__namespace.createElement("span", {
18039
- className: aphrodite.css(styles$A.lintContainer)
18040
- }, this.renderLink(styles$A.inlineHoverTarget), /*#__PURE__*/React__namespace.createElement("span", null, children));
18045
+ className: aphrodite.css(styles$z.lintContainer)
18046
+ }, this.renderLink(styles$z.inlineHoverTarget), /*#__PURE__*/React__namespace.createElement("span", null, children));
18041
18047
  }
18042
18048
  return /*#__PURE__*/React__namespace.createElement("div", {
18043
- className: aphrodite.css(styles$A.lintContainer)
18044
- }, this.renderLink(styles$A.hoverTarget), /*#__PURE__*/React__namespace.createElement("div", null, children));
18049
+ className: aphrodite.css(styles$z.lintContainer)
18050
+ }, this.renderLink(styles$z.hoverTarget), /*#__PURE__*/React__namespace.createElement("div", null, children));
18045
18051
  }
18046
18052
  }
18047
- const styles$A = aphrodite.StyleSheet.create({
18053
+ const styles$z = aphrodite.StyleSheet.create({
18048
18054
  // This is the class of the outermost element.
18049
18055
  // We use relative positioning so that the lint indicator can be
18050
18056
  // positioned absolutely relative to the position of the linty container.
@@ -19825,7 +19831,7 @@ class Renderer extends React__namespace.Component {
19825
19831
  };
19826
19832
  const mobileInnerStyle = {
19827
19833
  ...innerStyle,
19828
- ...styles$z.mobileZoomableParentFix
19834
+ ...styles$y.mobileZoomableParentFix
19829
19835
  };
19830
19836
  return /*#__PURE__*/React__namespace.createElement("div", {
19831
19837
  key: state.key,
@@ -19962,7 +19968,7 @@ class Renderer extends React__namespace.Component {
19962
19968
  };
19963
19969
  const mobileInnerStyle = {
19964
19970
  ...innerStyle,
19965
- ...styles$z.mobileZoomableParentFix
19971
+ ...styles$y.mobileZoomableParentFix
19966
19972
  };
19967
19973
  const wrappedOutput = /*#__PURE__*/React__namespace.createElement("div", {
19968
19974
  style: {
@@ -20587,7 +20593,7 @@ _defineProperty(Renderer, "defaultProps", {
20587
20593
  onSerializedStateUpdated: () => {},
20588
20594
  linterContext: PerseusLinter__namespace.linterContextDefault
20589
20595
  });
20590
- const styles$z = {
20596
+ const styles$y = {
20591
20597
  mobileZoomableParentFix: {
20592
20598
  // NOTE(abdul): There is an issue where transform animations will
20593
20599
  // cause the Zoomable component to disappear when running on the
@@ -21345,10 +21351,10 @@ class InputNumber extends React__namespace.Component {
21345
21351
  // Note: This is _very_ similar to what `numeric-input.jsx` does. If
21346
21352
  // you modify this, double-check if you also need to modify that
21347
21353
  // component.
21348
- const inputStyles = [styles$y.default, this.props.size === "small" ? styles$y.small : null, this.props.rightAlign ? styles$y.rightAlign : styles$y.leftAlign];
21354
+ const inputStyles = [styles$x.default, this.props.size === "small" ? styles$x.small : null, this.props.rightAlign ? styles$x.rightAlign : styles$x.leftAlign];
21349
21355
  // Unanswered
21350
21356
  if (rubric && !this.props.currentValue) {
21351
- inputStyles.push(styles$y.answerStateUnanswered);
21357
+ inputStyles.push(styles$x.answerStateUnanswered);
21352
21358
  }
21353
21359
  return /*#__PURE__*/React__namespace.createElement(InputWithExamples
21354
21360
  // eslint-disable-next-line react/no-string-refs
@@ -21434,7 +21440,7 @@ _defineProperty(InputNumber, "defaultProps", {
21434
21440
  apiOptions: ApiOptions.defaults,
21435
21441
  linterContext: PerseusLinter.linterContextDefault
21436
21442
  });
21437
- const styles$y = aphrodite.StyleSheet.create({
21443
+ const styles$x = aphrodite.StyleSheet.create({
21438
21444
  default: {
21439
21445
  width: 80,
21440
21446
  height: "auto"
@@ -22428,7 +22434,7 @@ const FocusRing = function (props) {
22428
22434
  };
22429
22435
  return /*#__PURE__*/React__namespace.createElement("span", {
22430
22436
  "data-test-id": "focus-ring",
22431
- className: aphrodite.css(styles$x.ring),
22437
+ className: aphrodite.css(styles$w.ring),
22432
22438
  style: style
22433
22439
  }, children);
22434
22440
  };
@@ -22437,7 +22443,7 @@ FocusRing.defaultProps = {
22437
22443
  color: kaGreen$1,
22438
22444
  multipleSelect: false
22439
22445
  };
22440
- const styles$x = aphrodite.StyleSheet.create({
22446
+ const styles$w = aphrodite.StyleSheet.create({
22441
22447
  ring: {
22442
22448
  margin: "auto",
22443
22449
  display: "inline-block",
@@ -22474,7 +22480,7 @@ function getChoiceLetter(pos) {
22474
22480
  }
22475
22481
 
22476
22482
  const CHOICE_ICON_SIZE = 24;
22477
- const styles$w = aphrodite.StyleSheet.create({
22483
+ const styles$v = aphrodite.StyleSheet.create({
22478
22484
  iconWrapper: {
22479
22485
  display: "inline-block",
22480
22486
  position: "relative"
@@ -22497,7 +22503,7 @@ const CrossOutLine = function (props) {
22497
22503
  width: CROSS_OUT_LINE_SIZE,
22498
22504
  height: CROSS_OUT_LINE_SIZE,
22499
22505
  viewBox: "0 0 ".concat(CROSS_OUT_LINE_SIZE, " ").concat(CROSS_OUT_LINE_SIZE),
22500
- className: aphrodite.css(styles$v.crossOutLine),
22506
+ className: aphrodite.css(styles$u.crossOutLine),
22501
22507
  "data-test-id": "choice-icon__cross-out-line"
22502
22508
  }, /*#__PURE__*/React__namespace.createElement("line", {
22503
22509
  // The line stretches from the bottom-left to top-right.
@@ -22512,7 +22518,7 @@ const CrossOutLine = function (props) {
22512
22518
  strokeLinecap: "round"
22513
22519
  }));
22514
22520
  };
22515
- const styles$v = aphrodite.StyleSheet.create({
22521
+ const styles$u = aphrodite.StyleSheet.create({
22516
22522
  crossOutLine: {
22517
22523
  // Center the icon within the container.
22518
22524
  position: "absolute",
@@ -22593,7 +22599,7 @@ const ChoiceIcon = function (props) {
22593
22599
  } = props;
22594
22600
  const dynamicStyles = getDynamicStyles(checked, showCorrectness, pressed, multipleSelect, correct);
22595
22601
  return /*#__PURE__*/React__namespace.createElement("div", {
22596
- className: aphrodite.css(styles$w.iconWrapper)
22602
+ className: aphrodite.css(styles$v.iconWrapper)
22597
22603
  }, /*#__PURE__*/React__namespace.createElement(FocusRing, {
22598
22604
  color: Color__default["default"].blue,
22599
22605
  visible: focused || hovered,
@@ -22602,13 +22608,13 @@ const ChoiceIcon = function (props) {
22602
22608
  // @ts-expect-error - TS2322 - Type '{ backgroundColor: string | null | undefined; borderColor: string; color: string; borderRadius: number; }' is not assignable to type 'Properties<string | number, string & {}>'.
22603
22609
  style: dynamicStyles,
22604
22610
  "data-test-id": "choice-icon__library-choice-icon",
22605
- className: aphrodite.css(styles$u.circle, showCorrectness && correct && styles$u.circleCorrect, showCorrectness && !correct && styles$u.circleIncorrect, showCorrectness && !correct && (checked || previouslyAnswered) && styles$u.circleIncorrectAnswered)
22611
+ className: aphrodite.css(styles$t.circle, showCorrectness && correct && styles$t.circleCorrect, showCorrectness && !correct && styles$t.circleIncorrect, showCorrectness && !correct && (checked || previouslyAnswered) && styles$t.circleIncorrectAnswered)
22606
22612
  // used in BaseRadio editMode to check
22607
22613
  // if we actually clicked on the radio icon
22608
22614
  ,
22609
22615
  "data-is-radio-icon": true
22610
22616
  }, /*#__PURE__*/React__namespace.createElement("div", {
22611
- className: aphrodite.css(styles$u.innerWrapper)
22617
+ className: aphrodite.css(styles$t.innerWrapper)
22612
22618
  }, /*#__PURE__*/React__namespace.createElement(ChoiceInner, {
22613
22619
  pos: pos,
22614
22620
  showCorrectness: showCorrectness,
@@ -22617,7 +22623,7 @@ const ChoiceIcon = function (props) {
22617
22623
  color: dynamicStyles.borderColor
22618
22624
  }));
22619
22625
  };
22620
- const styles$u = aphrodite.StyleSheet.create({
22626
+ const styles$t = aphrodite.StyleSheet.create({
22621
22627
  innerWrapper: {
22622
22628
  width: CHOICE_ICON_SIZE,
22623
22629
  height: CHOICE_ICON_SIZE,
@@ -22709,19 +22715,19 @@ const OptionStatus = function (props) {
22709
22715
  }
22710
22716
  let textStyle;
22711
22717
  if (correct) {
22712
- textStyle = styles$t.correct;
22718
+ textStyle = styles$s.correct;
22713
22719
  } else {
22714
22720
  if (checked || previouslyAnswered) {
22715
- textStyle = styles$t.incorrectAnswered;
22721
+ textStyle = styles$s.incorrectAnswered;
22716
22722
  } else {
22717
- textStyle = styles$t.incorrect;
22723
+ textStyle = styles$s.incorrect;
22718
22724
  }
22719
22725
  }
22720
22726
  return /*#__PURE__*/React__namespace.createElement("div", {
22721
- className: aphrodite.css(styles$t.text, textStyle)
22727
+ className: aphrodite.css(styles$s.text, textStyle)
22722
22728
  }, renderText(checked, correct, crossedOut));
22723
22729
  };
22724
- const styles$t = aphrodite.StyleSheet.create({
22730
+ const styles$s = aphrodite.StyleSheet.create({
22725
22731
  text: {
22726
22732
  alignItems: "center",
22727
22733
  display: "flex",
@@ -22796,8 +22802,8 @@ const Choice = function (props) {
22796
22802
  crossedOut: updatedCrossedOut
22797
22803
  });
22798
22804
  }
22799
- const descriptionClassName = classNames__default["default"]("description", aphrodite.css(styles$s.description));
22800
- const rationaleClassName = classNames__default["default"]("perseus-radio-rationale-content", aphrodite.css(styles$s.rationale));
22805
+ const descriptionClassName = classNames__default["default"]("description", aphrodite.css(styles$r.description));
22806
+ const rationaleClassName = classNames__default["default"]("perseus-radio-rationale-content", aphrodite.css(styles$r.rationale));
22801
22807
 
22802
22808
  // We want to show the choices as dimmed out when the choices are disabled.
22803
22809
  // However, we don't want to do this when we're in review mode in the
@@ -22963,7 +22969,7 @@ const Choice = function (props) {
22963
22969
  "data-test-id": "perseus-radio-rationale-content-".concat(pos)
22964
22970
  }, rationale));
22965
22971
  };
22966
- const styles$s = aphrodite.StyleSheet.create({
22972
+ const styles$r = aphrodite.StyleSheet.create({
22967
22973
  description: {
22968
22974
  display: "inline-block",
22969
22975
  width: "100%"
@@ -23154,10 +23160,10 @@ const BaseRadio = function (props) {
23154
23160
  const isMobile = apiOptions.isMobile;
23155
23161
  const firstChoiceHighlighted = choices[0].highlighted;
23156
23162
  const lastChoiceHighlighted = choices[choices.length - 1].highlighted;
23157
- const className = classNames__default["default"]("perseus-widget-radio", !editMode && "perseus-rendered-radio", aphrodite.css(styles$r.radio, styles$r.responsiveRadioContainer, firstChoiceHighlighted && isMobile && styles$r.radioContainerFirstHighlighted, lastChoiceHighlighted && isMobile && styles$r.radioContainerLastHighlighted));
23158
- const instructionsClassName = classNames__default["default"]("instructions", aphrodite.css(styles$r.instructions, isMobile && styles$r.instructionsMobile));
23163
+ const className = classNames__default["default"]("perseus-widget-radio", !editMode && "perseus-rendered-radio", aphrodite.css(styles$q.radio, styles$q.responsiveRadioContainer, firstChoiceHighlighted && isMobile && styles$q.radioContainerFirstHighlighted, lastChoiceHighlighted && isMobile && styles$q.radioContainerLastHighlighted));
23164
+ const instructionsClassName = classNames__default["default"]("instructions", aphrodite.css(styles$q.instructions, isMobile && styles$q.instructionsMobile));
23159
23165
  const instructions = getInstructionsText(multipleSelect, countChoices, numCorrect);
23160
- const responsiveClassName = aphrodite.css(styles$r.responsiveFieldset);
23166
+ const responsiveClassName = aphrodite.css(styles$q.responsiveFieldset);
23161
23167
  const fieldset = /*#__PURE__*/React__namespace.createElement("fieldset", {
23162
23168
  className: "perseus-widget-radio-fieldset ".concat(responsiveClassName)
23163
23169
  }, /*#__PURE__*/React__namespace.createElement("legend", {
@@ -23208,7 +23214,7 @@ const BaseRadio = function (props) {
23208
23214
  const aphroditeClassName = checked => {
23209
23215
  // Whether or not to show correctness borders
23210
23216
  // for this choice and the next choice.
23211
- return aphrodite.css(sharedStyles.aboveScratchpad, styles$r.item, styles$r.responsiveItem, checked && styles$r.selectedItem, checked && choice.highlighted && styles$r.aboveBackdrop, checked && choice.highlighted && apiOptions.isMobile && styles$r.aboveBackdropMobile, nextChoiceHighlighted && apiOptions.isMobile && styles$r.nextHighlighted);
23217
+ return aphrodite.css(sharedStyles.aboveScratchpad, styles$q.item, styles$q.responsiveItem, checked && styles$q.selectedItem, checked && choice.highlighted && styles$q.aboveBackdrop, checked && choice.highlighted && apiOptions.isMobile && styles$q.aboveBackdropMobile, nextChoiceHighlighted && apiOptions.isMobile && styles$q.nextHighlighted);
23212
23218
  };
23213
23219
 
23214
23220
  // HACK(abdulrahman): Preloads the selection-state
@@ -23282,14 +23288,14 @@ const BaseRadio = function (props) {
23282
23288
  // Allow for horizontal scrolling if content is too wide, which may be
23283
23289
  // an issue especially on phones.
23284
23290
  return /*#__PURE__*/React__namespace.createElement("div", {
23285
- className: aphrodite.css(styles$r.responsiveContainer)
23291
+ className: aphrodite.css(styles$q.responsiveContainer)
23286
23292
  }, fieldset);
23287
23293
  };
23288
23294
  BaseRadio.defaultProps = {
23289
23295
  editMode: false,
23290
23296
  multipleSelect: false
23291
23297
  };
23292
- const styles$r = aphrodite.StyleSheet.create({
23298
+ const styles$q = aphrodite.StyleSheet.create({
23293
23299
  instructions: {
23294
23300
  display: "block",
23295
23301
  color: gray17,
@@ -23941,9 +23947,9 @@ class Categorizer extends React__namespace.Component {
23941
23947
  indexedItems = Util.shuffle(indexedItems, this.props.problemNum);
23942
23948
  }
23943
23949
  const table = /*#__PURE__*/React__namespace.createElement("table", {
23944
- className: "categorizer-table " + aphrodite.css(styles$q.mobileTable)
23950
+ className: "categorizer-table " + aphrodite.css(styles$p.mobileTable)
23945
23951
  }, /*#__PURE__*/React__namespace.createElement("thead", null, /*#__PURE__*/React__namespace.createElement("tr", null, /*#__PURE__*/React__namespace.createElement("td", {
23946
- className: aphrodite.css(styles$q.emptyHeaderCell)
23952
+ className: aphrodite.css(styles$p.emptyHeaderCell)
23947
23953
  }), this.props.categories.map((category, i) => {
23948
23954
  // Array index is the correct key here, as that's
23949
23955
  // how category grading actually works -- no way
@@ -23951,7 +23957,7 @@ class Categorizer extends React__namespace.Component {
23951
23957
  // middle. (If we later add that, this should be
23952
23958
  // fixed.)
23953
23959
  return /*#__PURE__*/React__namespace.createElement("th", {
23954
- className: aphrodite.css(styles$q.header),
23960
+ className: aphrodite.css(styles$p.header),
23955
23961
  key: i
23956
23962
  }, /*#__PURE__*/React__namespace.createElement(Renderer, {
23957
23963
  content: category,
@@ -23971,7 +23977,7 @@ class Categorizer extends React__namespace.Component {
23971
23977
  })), self.props.categories.map((catName, catNum) => {
23972
23978
  const selected = self.props.values[itemNum] === catNum;
23973
23979
  return /*#__PURE__*/React__namespace.createElement("td", {
23974
- className: "category " + aphrodite.css(styles$q.cell),
23980
+ className: "category " + aphrodite.css(styles$p.cell),
23975
23981
  key: catNum
23976
23982
  }, /*#__PURE__*/React__namespace.createElement("div", {
23977
23983
  className: ClassNames.INTERACTIVE,
@@ -23990,7 +23996,7 @@ class Categorizer extends React__namespace.Component {
23990
23996
  onChange: this.onChange.bind(this, itemNum, catNum),
23991
23997
  onClick: e => e.stopPropagation()
23992
23998
  }), !isMobile && /*#__PURE__*/React__namespace.createElement("span", {
23993
- className: aphrodite.css(styles$q.radioSpan, selected && styles$q.checkedRadioSpan, this.props.static && selected && styles$q.staticCheckedRadioSpan)
23999
+ className: aphrodite.css(styles$p.radioSpan, selected && styles$p.checkedRadioSpan, this.props.static && selected && styles$p.staticCheckedRadioSpan)
23994
24000
  }, selected ? /*#__PURE__*/React__namespace.createElement(InlineIcon, iconCircle) : /*#__PURE__*/React__namespace.createElement(InlineIcon, iconCircleThin))));
23995
24001
  }));
23996
24002
  /* eslint-enable max-len */
@@ -24002,7 +24008,7 @@ class Categorizer extends React__namespace.Component {
24002
24008
  "categorizer-container": true,
24003
24009
  "static-mode": this.props.static
24004
24010
  });
24005
- const inlineStyles = this.props.apiOptions.isMobile ? [styles$q.fullBleedContainer] : [];
24011
+ const inlineStyles = this.props.apiOptions.isMobile ? [styles$p.fullBleedContainer] : [];
24006
24012
  return /*#__PURE__*/React__namespace.createElement("div", {
24007
24013
  className: extraClassNames + " " + aphrodite.css(...inlineStyles)
24008
24014
  }, table);
@@ -24047,7 +24053,7 @@ const pageMargin = 16;
24047
24053
 
24048
24054
  // Stylesheets aren't directly testable
24049
24055
  /* c8 ignore next */
24050
- const styles$q = aphrodite.StyleSheet.create({
24056
+ const styles$p = aphrodite.StyleSheet.create({
24051
24057
  mobileTable: {
24052
24058
  [mediaQueries.smOrSmaller]: {
24053
24059
  minWidth: "auto"
@@ -24288,7 +24294,7 @@ class CSProgram extends React__namespace.Component {
24288
24294
  // creator "went wild".
24289
24295
  // http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/
24290
24296
  return /*#__PURE__*/React__namespace.createElement("div", {
24291
- className: aphrodite.css(styles$p.widthOverride, styleContainer && styles$p.container)
24297
+ className: aphrodite.css(styles$o.widthOverride, styleContainer && styles$o.container)
24292
24298
  }, /*#__PURE__*/React__namespace.createElement("iframe", {
24293
24299
  sandbox: sandboxOptions,
24294
24300
  src: url,
@@ -24318,7 +24324,7 @@ _defineProperty(CSProgram, "defaultProps", {
24318
24324
  // optional message
24319
24325
  message: null
24320
24326
  });
24321
- const styles$p = aphrodite.StyleSheet.create({
24327
+ const styles$o = aphrodite.StyleSheet.create({
24322
24328
  // Override the inherited width from the perseus paragraph class
24323
24329
  // 820 is minimum width for 420px editor and 400px canvas
24324
24330
  widthOverride: {
@@ -24363,7 +24369,7 @@ class Definition extends React__namespace.Component {
24363
24369
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksPopover.Popover, {
24364
24370
  content: /*#__PURE__*/React__namespace.createElement(wonderBlocksPopover.PopoverContentCore, {
24365
24371
  color: "white",
24366
- style: styles$o.tooltipBody,
24372
+ style: styles$n.tooltipBody,
24367
24373
  closeButtonVisible: true
24368
24374
  }, /*#__PURE__*/React__namespace.createElement(Renderer, {
24369
24375
  apiOptions: this.props.apiOptions,
@@ -24398,7 +24404,7 @@ _defineProperty(Definition, "defaultProps", {
24398
24404
  togglePrompt: "define me",
24399
24405
  definition: "definition goes here"
24400
24406
  });
24401
- const styles$o = {
24407
+ const styles$n = {
24402
24408
  tooltipBody: {
24403
24409
  color: Color__default["default"].offBlack,
24404
24410
  fontSize: 20,
@@ -24561,15 +24567,15 @@ class Explanation extends React__namespace.Component {
24561
24567
  const onClick = this._onClick;
24562
24568
  if (isMobile) {
24563
24569
  linkContainer = /*#__PURE__*/React__namespace.createElement("div", {
24564
- className: aphrodite.css(styles$n.linkContainer)
24570
+ className: aphrodite.css(styles$m.linkContainer)
24565
24571
  }, /*#__PURE__*/React__namespace.createElement("a", {
24566
- className: aphrodite.css(styles$n.mobileExplanationLink),
24572
+ className: aphrodite.css(styles$m.mobileExplanationLink),
24567
24573
  href: href,
24568
24574
  onClick: onClick,
24569
24575
  role: "button",
24570
24576
  "aria-expanded": this.state.expanded
24571
24577
  }, linkAnchor), this.state.expanded && /*#__PURE__*/React__namespace.createElement("svg", {
24572
- className: aphrodite.css(styles$n.disclosureArrow)
24578
+ className: aphrodite.css(styles$m.disclosureArrow)
24573
24579
  }, /*#__PURE__*/React__namespace.createElement("polygon", {
24574
24580
  style: {
24575
24581
  fill: backgroundColor
@@ -24582,13 +24588,13 @@ class Explanation extends React__namespace.Component {
24582
24588
  // an anchor tag (if rendered in a modal) or a Wonder Blocks
24583
24589
  // link component in lesson page, see: `article-page.jsx`.
24584
24590
  linkContainer = /*#__PURE__*/React__namespace.createElement("div", {
24585
- className: aphrodite.css(styles$n.linkContainer, styles$n.articleLink)
24591
+ className: aphrodite.css(styles$m.linkContainer, styles$m.articleLink)
24586
24592
  }, /*#__PURE__*/React__namespace.createElement(Link, {
24587
- className: aphrodite.css(styles$n.explanationLink)
24593
+ className: aphrodite.css(styles$m.explanationLink)
24588
24594
  // HACK(michaelpolyak): WB Link doesn't passthrough
24589
24595
  // class name.
24590
24596
  ,
24591
- style: styles$n.explanationLink,
24597
+ style: styles$m.explanationLink,
24592
24598
  href: href,
24593
24599
  onClick: onClick,
24594
24600
  role: "button",
@@ -24598,9 +24604,9 @@ class Explanation extends React__namespace.Component {
24598
24604
  // NOTE: For exercises, the baseElements `Link` is an
24599
24605
  // anchor tag, see: `perseus-api.jsx`.
24600
24606
  linkContainer = /*#__PURE__*/React__namespace.createElement("div", {
24601
- className: aphrodite.css(styles$n.linkContainer, styles$n.exerciseLink)
24607
+ className: aphrodite.css(styles$m.linkContainer, styles$m.exerciseLink)
24602
24608
  }, /*#__PURE__*/React__namespace.createElement(Link, {
24603
- className: aphrodite.css(styles$n.explanationLink),
24609
+ className: aphrodite.css(styles$m.explanationLink),
24604
24610
  href: href,
24605
24611
  onClick: onClick,
24606
24612
  role: "button",
@@ -24608,11 +24614,11 @@ class Explanation extends React__namespace.Component {
24608
24614
  }, "[".concat(linkAnchor, "]")));
24609
24615
  }
24610
24616
  }
24611
- const expandedStyle = isMobile ? styles$n.contentExpandedMobile : styles$n.contentExpanded;
24617
+ const expandedStyle = isMobile ? styles$m.contentExpandedMobile : styles$m.contentExpanded;
24612
24618
  return /*#__PURE__*/React__namespace.createElement("div", {
24613
- className: aphrodite.css(styles$n.container)
24619
+ className: aphrodite.css(styles$m.container)
24614
24620
  }, linkContainer, this.state.expanded && /*#__PURE__*/React__namespace.createElement("div", {
24615
- className: aphrodite.css(styles$n.content, isMobile && styles$n.contentMobile, this.state.expanded && expandedStyle)
24621
+ className: aphrodite.css(styles$m.content, isMobile && styles$m.contentMobile, this.state.expanded && expandedStyle)
24616
24622
  // eslint-disable-next-line react/no-string-refs
24617
24623
  ,
24618
24624
  ref: "content"
@@ -24636,7 +24642,7 @@ const verticalContentPadding = 10;
24636
24642
  const arrowWidth = 30;
24637
24643
  const arrowHeight = 14;
24638
24644
  const backgroundColor = gray95;
24639
- const styles$n = aphrodite.StyleSheet.create({
24645
+ const styles$m = aphrodite.StyleSheet.create({
24640
24646
  container: {
24641
24647
  display: "inline",
24642
24648
  position: "relative"
@@ -24762,15 +24768,15 @@ class GradedGroupAnswerBar extends React__namespace.Component {
24762
24768
  onNextQuestion
24763
24769
  } = this.props;
24764
24770
  const answerBarStyle = {
24765
- ...styles$m.answerBar,
24771
+ ...styles$l.answerBar,
24766
24772
  backgroundColor: answerBarState === "CORRECT" ? Color__default["default"].offWhite : "white",
24767
24773
  // Center the "Correct!" message only when there's no next question
24768
24774
  justifyContent: answerBarState === "CORRECT" && !onNextQuestion ? "center" : "space-between"
24769
24775
  };
24770
24776
  const message = answerBarState === "INCORRECT" ? /*#__PURE__*/React__namespace.createElement("span", {
24771
- style: styles$m.text
24777
+ style: styles$l.text
24772
24778
  }, /*#__PURE__*/React__namespace.createElement("span", {
24773
- style: styles$m.tryAgainIcon
24779
+ style: styles$l.tryAgainIcon
24774
24780
  }, /*#__PURE__*/React__namespace.createElement(InlineIcon, iconTryAgain)), /*#__PURE__*/React__namespace.createElement("span", {
24775
24781
  style: {
24776
24782
  marginLeft: 8
@@ -24789,7 +24795,7 @@ class GradedGroupAnswerBar extends React__namespace.Component {
24789
24795
  return /*#__PURE__*/React__namespace.createElement("div", {
24790
24796
  style: answerBarStyle
24791
24797
  }, /*#__PURE__*/React__namespace.createElement("span", {
24792
- style: styles$m.text
24798
+ style: styles$l.text
24793
24799
  }, /*#__PURE__*/React__namespace.createElement("span", {
24794
24800
  style: {
24795
24801
  fontSize: 28,
@@ -24811,7 +24817,7 @@ class GradedGroupAnswerBar extends React__namespace.Component {
24811
24817
  }
24812
24818
  }
24813
24819
  const fontSize = 17;
24814
- const styles$m = {
24820
+ const styles$l = {
24815
24821
  answerBar: {
24816
24822
  display: "flex",
24817
24823
  alignItems: "center",
@@ -24993,7 +24999,7 @@ class GradedGroup extends React__namespace.Component {
24993
24999
  // @ts-expect-error - TS2322 - Type 'string' is not assignable to type 'null'.
24994
25000
  gradeStatus = i18n__namespace._("Incorrect");
24995
25001
  }
24996
- const mobileClass = this.props.inGradedGroupSet ? aphrodite.css(styles$l.gradedGroupInSet) : aphrodite.css(styles$l.gradedGroup);
25002
+ const mobileClass = this.props.inGradedGroupSet ? aphrodite.css(styles$k.gradedGroupInSet) : aphrodite.css(styles$k.gradedGroup);
24997
25003
  const classes = classNames__default["default"]({
24998
25004
  [mobileClass]: apiOptions.isMobile,
24999
25005
  "perseus-graded-group": true,
@@ -25012,7 +25018,7 @@ class GradedGroup extends React__namespace.Component {
25012
25018
  return /*#__PURE__*/React__namespace.createElement("div", {
25013
25019
  className: classes
25014
25020
  }, !!this.props.title && /*#__PURE__*/React__namespace.createElement("div", {
25015
- className: aphrodite.css(styles$l.title)
25021
+ className: aphrodite.css(styles$k.title)
25016
25022
  }, this.props.title), /*#__PURE__*/React__namespace.createElement(Renderer, _extends({}, this.props, {
25017
25023
  // eslint-disable-next-line react/no-string-refs
25018
25024
  ref: "renderer",
@@ -25045,7 +25051,7 @@ class GradedGroup extends React__namespace.Component {
25045
25051
  }, i18n__namespace._("Next question")), this.props.hint && this.props.hint.content && (this.state.showHint ? /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("button", {
25046
25052
  // @ts-expect-error - TS2322 - Type 'string' is not assignable to type 'number | undefined'.
25047
25053
  tabIndex: "0",
25048
- className: aphrodite.css(styles$l.explanationTitle),
25054
+ className: aphrodite.css(styles$k.explanationTitle),
25049
25055
  onClick: () => this.setState({
25050
25056
  showHint: false
25051
25057
  }),
@@ -25077,7 +25083,7 @@ class GradedGroup extends React__namespace.Component {
25077
25083
  showHint: true
25078
25084
  });
25079
25085
  },
25080
- className: aphrodite.css(styles$l.showHintLink)
25086
+ className: aphrodite.css(styles$k.showHintLink)
25081
25087
  }, i18n__namespace._("Explain"))), apiOptions.isMobile && answerBarState !== "HIDDEN" && /*#__PURE__*/React__namespace.createElement(GradedGroupAnswerBar, {
25082
25088
  apiOptions: apiOptions,
25083
25089
  answerBarState: answerBarState,
@@ -25098,7 +25104,7 @@ _defineProperty(GradedGroup, "defaultProps", {
25098
25104
  const traverseChildWidgets$3 = function (props, traverseRenderer) {
25099
25105
  return ___default["default"].extend({}, props, traverseRenderer(props));
25100
25106
  };
25101
- const styles$l = aphrodite.StyleSheet.create({
25107
+ const styles$k = aphrodite.StyleSheet.create({
25102
25108
  gradedGroupInSet: {
25103
25109
  // Reset a few desktop-only styles that come from graded-group.less
25104
25110
  marginLeft: 0,
@@ -25169,7 +25175,7 @@ class Indicators extends React__namespace.Component {
25169
25175
  }
25170
25176
  render() {
25171
25177
  return /*#__PURE__*/React__namespace.createElement("ul", {
25172
- className: aphrodite.css(styles$k.indicatorContainer)
25178
+ className: aphrodite.css(styles$j.indicatorContainer)
25173
25179
  }, this.props.gradedGroups.map((_ref, i) => {
25174
25180
  let {
25175
25181
  title
@@ -25180,7 +25186,7 @@ class Indicators extends React__namespace.Component {
25180
25186
  title
25181
25187
  }),
25182
25188
  key: title,
25183
- className: aphrodite.css(styles$k.indicator, i === this.props.currentGroup && styles$k.selectedIndicator),
25189
+ className: aphrodite.css(styles$j.indicator, i === this.props.currentGroup && styles$j.selectedIndicator),
25184
25190
  tabIndex: 0,
25185
25191
  onClick: () => this.props.onChangeCurrentGroup(i),
25186
25192
  onKeyDown: e => this.handleKeyDown(e, i)
@@ -25250,7 +25256,7 @@ class GradedGroupSet extends React__namespace.Component {
25250
25256
  } = getDependencies();
25251
25257
  if (JIPT.useJIPT && this.props.gradedGroups.length > 1) {
25252
25258
  return /*#__PURE__*/React__namespace.createElement("div", {
25253
- className: aphrodite.css(styles$k.container)
25259
+ className: aphrodite.css(styles$j.container)
25254
25260
  }, this.props.gradedGroups.map((gradedGroup, i) => {
25255
25261
  return (
25256
25262
  /*#__PURE__*/
@@ -25273,13 +25279,13 @@ class GradedGroupSet extends React__namespace.Component {
25273
25279
  const numGroups = this.props.gradedGroups.length;
25274
25280
  const handleNextQuestion = this.state.currentGroup < numGroups - 1 ? this.handleNextQuestion : null;
25275
25281
  return /*#__PURE__*/React__namespace.createElement("div", {
25276
- className: aphrodite.css(styles$k.container)
25282
+ className: aphrodite.css(styles$j.container)
25277
25283
  }, /*#__PURE__*/React__namespace.createElement("div", {
25278
- className: aphrodite.css(styles$k.top)
25284
+ className: aphrodite.css(styles$j.top)
25279
25285
  }, /*#__PURE__*/React__namespace.createElement("div", {
25280
- className: aphrodite.css(styles$k.title)
25286
+ className: aphrodite.css(styles$j.title)
25281
25287
  }, currentGroup.title), /*#__PURE__*/React__namespace.createElement("div", {
25282
- className: aphrodite.css(styles$k.spacer)
25288
+ className: aphrodite.css(styles$j.spacer)
25283
25289
  }), /*#__PURE__*/React__namespace.createElement(Indicators, {
25284
25290
  currentGroup: this.state.currentGroup,
25285
25291
  gradedGroups: this.props.gradedGroups,
@@ -25321,7 +25327,7 @@ var GradedGroupSet$1 = {
25321
25327
  tracking: "all",
25322
25328
  isLintable: true
25323
25329
  };
25324
- const styles$k = aphrodite.StyleSheet.create({
25330
+ const styles$j = aphrodite.StyleSheet.create({
25325
25331
  top: {
25326
25332
  display: "flex",
25327
25333
  flexDirection: "row"
@@ -25403,7 +25409,7 @@ class ButtonGroup extends React__namespace.Component {
25403
25409
  id: "" + i,
25404
25410
  ref: "button" + i,
25405
25411
  key: "" + i,
25406
- className: aphrodite.css(styles$j.buttonStyle, button.value === value && styles$j.selectedStyle),
25412
+ className: aphrodite.css(styles$i.buttonStyle, button.value === value && styles$i.selectedStyle),
25407
25413
  onClick: () => this.toggleSelect(button.value)
25408
25414
  }, button.content || "" + button.value);
25409
25415
  });
@@ -25420,7 +25426,7 @@ _defineProperty(ButtonGroup, "defaultProps", {
25420
25426
  value: null,
25421
25427
  allowEmpty: true
25422
25428
  });
25423
- const styles$j = aphrodite.StyleSheet.create({
25429
+ const styles$i = aphrodite.StyleSheet.create({
25424
25430
  buttonStyle: {
25425
25431
  backgroundColor: "white",
25426
25432
  border: "1px solid #ccc",
@@ -26887,10 +26893,9 @@ class ImageWidget extends React__namespace.Component {
26887
26893
  // This minWidth takes precedence over minWidth applied via
26888
26894
  // Aphrodite.
26889
26895
  const minWidth = isImageFullWidth ? null : "0 !important";
26890
- titleAndCaption = /*#__PURE__*/React__namespace.createElement("div", {
26896
+ titleAndCaption = /*#__PURE__*/React__namespace.createElement("figcaption", {
26891
26897
  className: className
26892
26898
  }, /*#__PURE__*/React__namespace.createElement("div", {
26893
- className: aphrodite.css(styles$i.caption),
26894
26899
  style: {
26895
26900
  // @ts-expect-error - TS2322 - Type 'string | null' is not assignable to type 'MinWidth<string | number> | undefined'.
26896
26901
  minWidth: minWidth
@@ -26901,7 +26906,7 @@ class ImageWidget extends React__namespace.Component {
26901
26906
  linterContext: this.props.linterContext
26902
26907
  })));
26903
26908
  }
26904
- return /*#__PURE__*/React__namespace.createElement("div", {
26909
+ return /*#__PURE__*/React__namespace.createElement("figure", {
26905
26910
  className: "perseus-image-widget"
26906
26911
  }, image, alt, titleAndCaption);
26907
26912
  }
@@ -26917,7 +26922,7 @@ class ImageWidget extends React__namespace.Component {
26917
26922
  }));
26918
26923
  }
26919
26924
  if (this.props.caption) {
26920
- caption = /*#__PURE__*/React__namespace.createElement("div", {
26925
+ caption = /*#__PURE__*/React__namespace.createElement("figcaption", {
26921
26926
  className: "perseus-image-caption"
26922
26927
  }, /*#__PURE__*/React__namespace.createElement(Renderer, {
26923
26928
  content: this.props.caption,
@@ -26925,7 +26930,7 @@ class ImageWidget extends React__namespace.Component {
26925
26930
  linterContext: this.props.linterContext
26926
26931
  }));
26927
26932
  }
26928
- return /*#__PURE__*/React__namespace.createElement("div", {
26933
+ return /*#__PURE__*/React__namespace.createElement("figure", {
26929
26934
  className: "perseus-image-widget"
26930
26935
  }, title, image, alt, caption);
26931
26936
  }
@@ -26949,22 +26954,6 @@ _defineProperty(ImageWidget, "defaultProps", {
26949
26954
  caption: "",
26950
26955
  linterContext: PerseusLinter.linterContextDefault
26951
26956
  });
26952
- const styles$i = aphrodite.StyleSheet.create({
26953
- caption: {
26954
- display: "inline-block",
26955
- marginTop: baseUnitPx,
26956
- maxWidth: 640,
26957
- [mediaQueries.lgOrSmaller]: {
26958
- // TODO(david): This maxWidth is not being used because
26959
- // it's overriden by the 512px max-width we have on
26960
- // paragraphs.
26961
- maxWidth: 540
26962
- },
26963
- [mediaQueries.smOrSmaller]: {
26964
- maxWidth: 450
26965
- }
26966
- }
26967
- });
26968
26957
  var Image$1 = {
26969
26958
  name: "image",
26970
26959
  // This widget's accessibility depends on its contents: if the image has