@khanacademy/perseus 1.3.3 → 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/es/index.js +119 -66
  3. package/dist/es/index.js.map +1 -1
  4. package/dist/index.js +119 -66
  5. package/dist/index.js.map +1 -1
  6. package/package.json +1 -1
  7. package/src/__tests__/__snapshots__/item-renderer_test.jsx.snap +1 -1
  8. package/src/__tests__/__snapshots__/perseus-markdown_test.jsx.snap +111 -111
  9. package/src/__tests__/__snapshots__/server-item-renderer_test.jsx.snap +1 -1
  10. package/src/__tests__/item-renderer_test.jsx +9 -9
  11. package/src/__tests__/jipt-paragraphs_test.js +3 -3
  12. package/src/__tests__/renderer_test.jsx +22 -22
  13. package/src/__tests__/server-item-renderer_test.jsx +7 -7
  14. package/src/components/__tests__/sortable_test.jsx +7 -7
  15. package/src/components/input-with-examples.jsx +12 -13
  16. package/src/index.js +1 -0
  17. package/src/multi-items/__tests__/__snapshots__/multi-renderer_test.js.snap +6 -6
  18. package/src/multi-items/__tests__/multi-renderer_test.js +90 -90
  19. package/src/perseus-types.js +5 -4
  20. package/src/renderer.jsx +2 -2
  21. package/src/util.js +1 -1
  22. package/src/widgets/__stories__/input-number.stories.jsx +29 -3
  23. package/src/widgets/__tests__/__snapshots__/grapher_test.jsx.snap +68 -68
  24. package/src/widgets/__tests__/__snapshots__/group_test.jsx.snap +5 -5
  25. package/src/widgets/__tests__/__snapshots__/input-number_test.jsx.snap +1 -1
  26. package/src/widgets/__tests__/__snapshots__/interaction_test.jsx.snap +5 -5
  27. package/src/widgets/__tests__/__snapshots__/interactive-graph_test.jsx.snap +2 -2
  28. package/src/widgets/__tests__/__snapshots__/passage_test.jsx.snap +2 -2
  29. package/src/widgets/__tests__/__snapshots__/radio_test.jsx.snap +52 -52
  30. package/src/widgets/__tests__/categorizer_test.jsx +5 -5
  31. package/src/widgets/__tests__/explanation_test.js +5 -5
  32. package/src/widgets/__tests__/graded-group-set_test.jsx +2 -2
  33. package/src/widgets/__tests__/group_test.jsx +49 -49
  34. package/src/widgets/__tests__/numeric-input_test.jsx +5 -5
  35. package/src/widgets/__tests__/passage_test.jsx +1 -1
  36. package/src/widgets/__tests__/radio/base-radio_test.jsx +28 -1
  37. package/src/widgets/categorizer.jsx +1 -1
  38. package/src/widgets/expression.jsx +6 -6
  39. package/src/widgets/input-number.jsx +69 -15
  40. package/src/widgets/numeric-input.jsx +8 -5
  41. package/src/widgets/radio/base-radio.jsx +8 -3
  42. package/src/widgets/radio/choice-icon/library-choice-icon.jsx +2 -2
  43. package/src/widgets/radio/choice.jsx +1 -1
  44. package/src/widgets/radio/widget.jsx +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @khanacademy/perseus
2
2
 
3
+ ## 1.3.5
4
+
5
+ ### Patch Changes
6
+
7
+ - c4feda94: allow users to select text in radio choice
8
+ - 6f79dc58: Fix regression in input-number widget to respect `size` and `rightAlign` options again.
9
+
10
+ ## 1.3.4
11
+
12
+ ### Patch Changes
13
+
14
+ - 5a565227: bugfix for Radio editor selection and deletion
15
+
3
16
  ## 1.3.3
4
17
 
5
18
  ### Patch Changes
package/dist/es/index.js CHANGED
@@ -17959,17 +17959,17 @@ class Lint extends React.Component {
17959
17959
  var warningTextStyle;
17960
17960
 
17961
17961
  if (this.props.severity === 1) {
17962
- severityStyle = styles$A.indicatorError;
17962
+ severityStyle = styles$B.indicatorError;
17963
17963
  warningText = "Error";
17964
- warningTextStyle = styles$A.publishBlockingError;
17964
+ warningTextStyle = styles$B.publishBlockingError;
17965
17965
  } else if (this.props.severity === 2) {
17966
- severityStyle = styles$A.indicatorWarning;
17966
+ severityStyle = styles$B.indicatorWarning;
17967
17967
  warningText = "Warning";
17968
- warningTextStyle = styles$A.warning;
17968
+ warningTextStyle = styles$B.warning;
17969
17969
  } else {
17970
- severityStyle = styles$A.indicatorGuideline;
17970
+ severityStyle = styles$B.indicatorGuideline;
17971
17971
  warningText = "Recommendation";
17972
- warningTextStyle = styles$A.warning;
17972
+ warningTextStyle = styles$B.warning;
17973
17973
  }
17974
17974
 
17975
17975
  return /*#__PURE__*/React.createElement("a", {
@@ -17977,16 +17977,16 @@ class Lint extends React.Component {
17977
17977
  target: "lint-help-window",
17978
17978
  className: css(style)
17979
17979
  }, /*#__PURE__*/React.createElement("span", {
17980
- className: css(styles$A.indicator, severityStyle)
17980
+ className: css(styles$B.indicator, severityStyle)
17981
17981
  }, this.props.severity === 1 && /*#__PURE__*/React.createElement(InlineIcon, exclamationIcon)), /*#__PURE__*/React.createElement("div", {
17982
- className: css(styles$A.tooltip, tooltipAbove && styles$A.tooltipAbove)
17982
+ className: css(styles$B.tooltip, tooltipAbove && styles$B.tooltipAbove)
17983
17983
  }, this.props.message.split("\n\n").map((m, i) => /*#__PURE__*/React.createElement("p", {
17984
17984
  key: i,
17985
- className: css(styles$A.tooltipParagraph)
17985
+ className: css(styles$B.tooltipParagraph)
17986
17986
  }, /*#__PURE__*/React.createElement("span", {
17987
17987
  className: css(warningTextStyle)
17988
17988
  }, warningText, ":", " "), m)), /*#__PURE__*/React.createElement("div", {
17989
- className: css(styles$A.tail, tooltipAbove && styles$A.tailAbove)
17989
+ className: css(styles$B.tail, tooltipAbove && styles$B.tailAbove)
17990
17990
  })));
17991
17991
  });
17992
17992
  }
@@ -18034,19 +18034,19 @@ class Lint extends React.Component {
18034
18034
 
18035
18035
  if (blockHighlight) {
18036
18036
  return /*#__PURE__*/React.createElement("span", {
18037
- className: css(styles$A.lintContainer, styles$A.lintContainerBlock)
18038
- }, this.renderLink(styles$A.radioWidgetHoverTarget), /*#__PURE__*/React.createElement("span", null, children));
18037
+ className: css(styles$B.lintContainer, styles$B.lintContainerBlock)
18038
+ }, this.renderLink(styles$B.radioWidgetHoverTarget), /*#__PURE__*/React.createElement("span", null, children));
18039
18039
  }
18040
18040
 
18041
18041
  if (inline) {
18042
18042
  return /*#__PURE__*/React.createElement("span", {
18043
- className: css(styles$A.lintContainer)
18044
- }, this.renderLink(styles$A.inlineHoverTarget), /*#__PURE__*/React.createElement("span", null, children));
18043
+ className: css(styles$B.lintContainer)
18044
+ }, this.renderLink(styles$B.inlineHoverTarget), /*#__PURE__*/React.createElement("span", null, children));
18045
18045
  }
18046
18046
 
18047
18047
  return /*#__PURE__*/React.createElement("div", {
18048
- className: css(styles$A.lintContainer)
18049
- }, this.renderLink(styles$A.hoverTarget), /*#__PURE__*/React.createElement("div", null, children));
18048
+ className: css(styles$B.lintContainer)
18049
+ }, this.renderLink(styles$B.hoverTarget), /*#__PURE__*/React.createElement("div", null, children));
18050
18050
  }
18051
18051
 
18052
18052
  } // $FlowFixMe[prop-missing]
@@ -18071,7 +18071,7 @@ _defineProperty(Lint, "propTypes", {
18071
18071
  severity: PropTypes.number
18072
18072
  });
18073
18073
 
18074
- var styles$A = StyleSheet.create({
18074
+ var styles$B = StyleSheet.create({
18075
18075
  // This is the class of the outermost element.
18076
18076
  // We use relative positioning so that the lint indicator can be
18077
18077
  // positioned absolutely relative to the position of the linty container.
@@ -19447,7 +19447,7 @@ class Renderer extends React.Component {
19447
19447
  // look like a widget ID (ie. `widget-type \d+`). I can't figure
19448
19448
  // out how to trigger this line of code though.
19449
19449
 
19450
- /* istanbul ignore next line */
19450
+ /* c8 ignore next line */
19451
19451
  return {};
19452
19452
  }
19453
19453
 
@@ -19786,7 +19786,7 @@ class Renderer extends React.Component {
19786
19786
  // reached. As noted above, these are always QuestionParagraphs
19787
19787
  // now.
19788
19788
 
19789
- /* istanbul ignore if */
19789
+ /* c8 ignore if */
19790
19790
 
19791
19791
  if (typeof nodeOut === "string" && lastWasString) {
19792
19792
  /**
@@ -19961,7 +19961,7 @@ class Renderer extends React.Component {
19961
19961
  paddingRight: margin
19962
19962
  };
19963
19963
 
19964
- var mobileInnerStyle = _objectSpread2(_objectSpread2({}, innerStyle), styles$z.mobileZoomableParentFix);
19964
+ var mobileInnerStyle = _objectSpread2(_objectSpread2({}, innerStyle), styles$A.mobileZoomableParentFix);
19965
19965
 
19966
19966
  return /*#__PURE__*/React.createElement("div", {
19967
19967
  key: state.key,
@@ -20099,7 +20099,7 @@ class Renderer extends React.Component {
20099
20099
  paddingRight: 0
20100
20100
  };
20101
20101
 
20102
- var _mobileInnerStyle = _objectSpread2(_objectSpread2({}, _innerStyle), styles$z.mobileZoomableParentFix);
20102
+ var _mobileInnerStyle = _objectSpread2(_objectSpread2({}, _innerStyle), styles$A.mobileZoomableParentFix);
20103
20103
 
20104
20104
  var wrappedOutput = /*#__PURE__*/React.createElement("div", {
20105
20105
  style: _objectSpread2(_objectSpread2({}, _mobileInnerStyle), {}, {
@@ -20778,7 +20778,7 @@ _defineProperty(Renderer, "defaultProps", {
20778
20778
  linterContext: PerseusLinter.linterContextDefault
20779
20779
  });
20780
20780
 
20781
- var styles$z = {
20781
+ var styles$A = {
20782
20782
  mobileZoomableParentFix: {
20783
20783
  // NOTE(abdul): There is an issue where transform animations will
20784
20784
  // cause the Zoomable component to disappear when running on the
@@ -22054,9 +22054,6 @@ var Tooltip = createReactClass({
22054
22054
  var {
22055
22055
  captureScratchpadTouchStart: captureScratchpadTouchStart$3
22056
22056
  } = Util;
22057
- var MATH = "math";
22058
- var TEXT = "text";
22059
- var TEX = "tex";
22060
22057
 
22061
22058
  class InputWithExamples extends React.Component {
22062
22059
  constructor() {
@@ -22074,7 +22071,7 @@ class InputWithExamples extends React.Component {
22074
22071
  _defineProperty(this, "_getInputClassName", () => {
22075
22072
  // <MathOutput> is a special component that manages its own class and
22076
22073
  // state, as it's a <span> that wants to act like an <input>.
22077
- if (this.props.type === TEX) {
22074
+ if (this.props.type === "tex") {
22078
22075
  return this.props.className;
22079
22076
  } // Otherwise, we need to add these INPUT and FOCUSED tags here.
22080
22077
 
@@ -22109,7 +22106,7 @@ class InputWithExamples extends React.Component {
22109
22106
  style: this.props.style
22110
22107
  };
22111
22108
 
22112
- if (this.props.type === TEX) {
22109
+ if (this.props.type === "tex") {
22113
22110
  return inputProps;
22114
22111
  } // Add useful props required for MATH and TEXT modes
22115
22112
 
@@ -22120,7 +22117,7 @@ class InputWithExamples extends React.Component {
22120
22117
  }); // And add final props that are MATH- and TEXT-specific
22121
22118
 
22122
22119
 
22123
- if (this.props.type === MATH) {
22120
+ if (this.props.type === "math") {
22124
22121
  return _.extend({
22125
22122
  buttonSet: this.props.buttonSet,
22126
22123
  buttonsVisible: this.props.buttonsVisible,
@@ -22128,7 +22125,7 @@ class InputWithExamples extends React.Component {
22128
22125
  }, inputProps);
22129
22126
  }
22130
22127
 
22131
- if (this.props.type === TEXT) {
22128
+ if (this.props.type === "text") {
22132
22129
  return _.extend({
22133
22130
  autoCapitalize: "off",
22134
22131
  autoComplete: "off",
@@ -22140,16 +22137,17 @@ class InputWithExamples extends React.Component {
22140
22137
 
22141
22138
  _defineProperty(this, "_getComponentForInputType", () => {
22142
22139
  switch (this.props.type) {
22143
- case TEX:
22140
+ case "tex":
22144
22141
  return MathOutput;
22145
22142
 
22146
- case MATH:
22143
+ case "math":
22147
22144
  return MathInput;
22148
22145
 
22149
- case TEXT:
22146
+ case "text":
22150
22147
  return TextInput;
22151
22148
 
22152
22149
  default:
22150
+ this.props.type;
22153
22151
  return null;
22154
22152
  }
22155
22153
  });
@@ -22210,7 +22208,7 @@ class InputWithExamples extends React.Component {
22210
22208
  // other types require, and is hence handled separately.
22211
22209
 
22212
22210
 
22213
- if (this.props.type === TEX) {
22211
+ if (this.props.type === "tex") {
22214
22212
  return input;
22215
22213
  } // Else, we need to be able to show examples
22216
22214
 
@@ -22241,7 +22239,7 @@ class InputWithExamples extends React.Component {
22241
22239
  }
22242
22240
 
22243
22241
  _defineProperty(InputWithExamples, "defaultProps", {
22244
- type: TEXT,
22242
+ type: "text",
22245
22243
  shouldShowExamples: true,
22246
22244
  onFocus: function onFocus() {},
22247
22245
  onBlur: function onBlur() {},
@@ -22484,12 +22482,12 @@ class Expression extends React.Component {
22484
22482
  });
22485
22483
 
22486
22484
  _defineProperty(this, "_handleFocus", () => {
22487
- /* istanbul ignore next */
22485
+ /* c8 ignore next */
22488
22486
  this.props.onFocus([]);
22489
22487
  });
22490
22488
 
22491
22489
  _defineProperty(this, "_handleBlur", () => {
22492
- /* istanbul ignore next */
22490
+ /* c8 ignore next */
22493
22491
  this.props.onBlur([]);
22494
22492
  });
22495
22493
 
@@ -22523,12 +22521,12 @@ class Expression extends React.Component {
22523
22521
  // The widget itself is an input, so we return a single empty list to
22524
22522
  // indicate this.
22525
22523
 
22526
- /* istanbul ignore next */
22524
+ /* c8 ignore next */
22527
22525
  return [[]];
22528
22526
  });
22529
22527
 
22530
22528
  _defineProperty(this, "getGrammarTypeForPath", inputPath => {
22531
- /* istanbul ignore next */
22529
+ /* c8 ignore next */
22532
22530
  return "expression";
22533
22531
  });
22534
22532
 
@@ -22578,7 +22576,7 @@ class Expression extends React.Component {
22578
22576
  // in the function variables list for the expression.
22579
22577
 
22580
22578
  if (!expression.parsed) {
22581
- /* istanbul ignore next */
22579
+ /* c8 ignore next */
22582
22580
  Log.error("Unable to parse solution answer for expression", Errors.InvalidInput, {
22583
22581
  loggedMetadata: {
22584
22582
  rubric: JSON.stringify(rubric)
@@ -22884,7 +22882,7 @@ var keypadConfigurationForProps = widgetOptions => {
22884
22882
  };
22885
22883
 
22886
22884
  var propUpgrades$2 = {
22887
- /* istanbul ignore next */
22885
+ /* c8 ignore next */
22888
22886
  "1": v0props => ({
22889
22887
  times: v0props.times,
22890
22888
  buttonSets: v0props.buttonSets,
@@ -23155,12 +23153,12 @@ class InputNumber extends React.Component {
23155
23153
  // The widget itself is an input, so we return a single empty list to
23156
23154
  // indicate this.
23157
23155
 
23158
- /* istanbul ignore next */
23156
+ /* c8 ignore next */
23159
23157
  return [[]];
23160
23158
  });
23161
23159
 
23162
23160
  _defineProperty(this, "getGrammarTypeForPath", path => {
23163
- /* istanbul ignore next */
23161
+ /* c8 ignore next */
23164
23162
  return "number";
23165
23163
  });
23166
23164
 
@@ -23221,7 +23219,7 @@ class InputNumber extends React.Component {
23221
23219
  var correct = null;
23222
23220
  var answerBlurb = null; // SAT is deprecated and not testable
23223
23221
 
23224
- /* istanbul ignore if */
23222
+ /* c8 ignore if */
23225
23223
 
23226
23224
  if (this.props.apiOptions.satStyling && rubric) {
23227
23225
  var score = this.simpleValidate(rubric);
@@ -23241,20 +23239,33 @@ class InputNumber extends React.Component {
23241
23239
  answers: answerStrings
23242
23240
  });
23243
23241
  }
23242
+ } // Note: This is _very_ similar to what `numeric-input.jsx` does. If
23243
+ // you modify this, double-check if you also need to modify that
23244
+ // component.
23245
+
23246
+
23247
+ var inputStyles = [styles$z.default, this.props.size === "small" ? styles$z.small : null, this.props.rightAlign ? styles$z.rightAlign : styles$z.leftAlign]; // Correct
23248
+
23249
+ if (rubric && correct && this.props.currentValue) {
23250
+ inputStyles.push(styles$z.answerStateCorrect);
23251
+ } // Incorrect
23252
+
23253
+
23254
+ if (rubric && !correct && this.props.currentValue) {
23255
+ inputStyles.push(styles$z.answerStateIncorrect);
23256
+ } // Unanswered
23257
+
23258
+
23259
+ if (rubric && !this.props.currentValue) {
23260
+ inputStyles.push(styles$z.answerStateUnanswered);
23244
23261
  }
23245
23262
 
23246
- var classes = {};
23247
- classes["perseus-input-size-" + this.props.size] = true;
23248
- classes["perseus-input-right-align"] = this.props.rightAlign;
23249
- classes[ClassNames.CORRECT] = rubric && correct && this.props.currentValue;
23250
- classes[ClassNames.INCORRECT] = rubric && !correct && this.props.currentValue;
23251
- classes[ClassNames.UNANSWERED] = rubric && !this.props.currentValue;
23252
23263
  var input = /*#__PURE__*/React.createElement(InputWithExamples // eslint-disable-next-line react/no-string-refs
23253
23264
  , {
23254
23265
  ref: "input",
23255
23266
  value: this.props.currentValue,
23256
23267
  onChange: this.handleChange,
23257
- className: classNames(classes),
23268
+ style: inputStyles,
23258
23269
  type: this._getInputType(),
23259
23270
  examples: this.examples(),
23260
23271
  shouldShowExamples: this.shouldShowExamples(),
@@ -23265,7 +23276,7 @@ class InputNumber extends React.Component {
23265
23276
  linterContext: this.props.linterContext
23266
23277
  }); // SAT is deprecated, answer blurb is an SAT feature
23267
23278
 
23268
- /* istanbul ignore if */
23279
+ /* c8 ignore if */
23269
23280
 
23270
23281
  if (answerBlurb) {
23271
23282
  return /*#__PURE__*/React.createElement("span", {
@@ -23350,6 +23361,39 @@ _defineProperty(InputNumber, "defaultProps", {
23350
23361
  linterContext: linterContextDefault
23351
23362
  });
23352
23363
 
23364
+ var styles$z = StyleSheet.create({
23365
+ default: {
23366
+ width: 80,
23367
+ height: "auto"
23368
+ },
23369
+ small: {
23370
+ width: 40
23371
+ },
23372
+ leftAlign: {
23373
+ paddingLeft: Spacing.xxxSmall_4,
23374
+ paddingRight: 0
23375
+ },
23376
+ rightAlign: {
23377
+ textAlign: "right",
23378
+ paddingLeft: 0,
23379
+ paddingRight: Spacing.xxxSmall_4
23380
+ },
23381
+ answerStateCorrect: {
23382
+ color: satCorrectColor,
23383
+ backgroundColor: satCorrectBackgroundColor,
23384
+ border: "solid 1px ".concat(satCorrectBorderColor)
23385
+ },
23386
+ answerStateIncorrect: {
23387
+ color: satIncorrectColor,
23388
+ backgroundColor: satIncorrectBackgroundColor,
23389
+ border: "solid 1px ".concat(satIncorrectBorderColor)
23390
+ },
23391
+ answerStateUnanswered: {
23392
+ backgroundColor: "#eee",
23393
+ border: "solid 1px #999"
23394
+ }
23395
+ });
23396
+
23353
23397
  var propTransform$4 = widgetOptions => {
23354
23398
  var {
23355
23399
  simplify,
@@ -23426,7 +23470,7 @@ class NumericInput extends React.Component {
23426
23470
  var answerBlurb;
23427
23471
  /* Ignore this block because SAT is deprecated */
23428
23472
 
23429
- /* istanbul ignore next */
23473
+ /* c8 ignore next */
23430
23474
 
23431
23475
  if (this.props.apiOptions.satStyling && rubric) {
23432
23476
  var score = this.simpleValidate(rubric);
@@ -23525,17 +23569,17 @@ class NumericInput extends React.Component {
23525
23569
  // The widget itself is an input, so we return a single empty list to
23526
23570
  // indicate this.
23527
23571
 
23528
- /* istanbul ignore next */
23572
+ /* c8 ignore next */
23529
23573
  return [[]];
23530
23574
  });
23531
23575
 
23532
23576
  _defineProperty(this, "getGrammarTypeForPath", inputPath => {
23533
- /* istanbul ignore next */
23577
+ /* c8 ignore next */
23534
23578
  return "number";
23535
23579
  });
23536
23580
 
23537
23581
  _defineProperty(this, "setInputValue", (path, newValue, cb) => {
23538
- /* istanbul ignore next */
23582
+ /* c8 ignore next */
23539
23583
  this.props.onChange({
23540
23584
  currentValue: newValue
23541
23585
  }, cb);
@@ -23718,7 +23762,10 @@ class NumericInput extends React.Component {
23718
23762
  onFocus: this._handleFocus,
23719
23763
  onBlur: this._handleBlur
23720
23764
  }));
23721
- }
23765
+ } // Note: This is _very_ similar to what `input-number.jsx` does. If
23766
+ // you modify this, double-check if you also need to modify that
23767
+ // component.
23768
+
23722
23769
 
23723
23770
  var styles = StyleSheet.create({
23724
23771
  input: {
@@ -23744,7 +23791,7 @@ class NumericInput extends React.Component {
23744
23791
  });
23745
23792
  /* This only gets used with SAT Content */
23746
23793
 
23747
- /* istanbul ignore next if */
23794
+ /* c8 ignore next if */
23748
23795
 
23749
23796
  if (answerBlurb) {
23750
23797
  return /*#__PURE__*/React.createElement("span", {
@@ -26976,8 +27023,8 @@ function LibraryChoiceIcon(props) {
26976
27023
  }, /*#__PURE__*/React.createElement("div", {
26977
27024
  style: dynamicStyles,
26978
27025
  "data-test-id": "choice-icon__library-choice-icon",
26979
- 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 to check if we actually clicked on the
26980
- // radio icon
27026
+ 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
27027
+ // if we actually clicked on the radio icon
26981
27028
  ,
26982
27029
  "data-is-radio-icon": true
26983
27030
  }, /*#__PURE__*/React.createElement("div", {
@@ -27403,7 +27450,8 @@ function Choice(props) {
27403
27450
  disabled: disabled || apiOptions.staticRender || apiOptions.readOnly,
27404
27451
  style: {
27405
27452
  flex: 1,
27406
- color: Color.offBlack
27453
+ color: Color.offBlack,
27454
+ userSelect: "text"
27407
27455
  },
27408
27456
  ref: forwardedRef,
27409
27457
  "aria-hidden": "true"
@@ -27763,7 +27811,7 @@ function BaseRadio(props) {
27763
27811
  style: {
27764
27812
  listStyle: "none"
27765
27813
  }
27766
- }, choices.map(function (choice, i) {
27814
+ }, choices.map((choice, i) => {
27767
27815
  var Element = Choice$1;
27768
27816
  var ref = /*#__PURE__*/React.createRef();
27769
27817
  choiceRefs.current[i] = ref;
@@ -27782,6 +27830,11 @@ function BaseRadio(props) {
27782
27830
  showRationale: choice.hasRationale && (reviewMode || choice.showRationale),
27783
27831
  pos: i,
27784
27832
  onChange: newValues => {
27833
+ // editMode selection is handled in clickHandler
27834
+ if (editMode) {
27835
+ return;
27836
+ }
27837
+
27785
27838
  updateChoice(i, newValues);
27786
27839
  },
27787
27840
  ref
@@ -27839,7 +27892,7 @@ function BaseRadio(props) {
27839
27892
  // radio icon, then we want to trigger the
27840
27893
  // check by flipping the choice of the icon.
27841
27894
  if (elem.getAttribute("data-is-radio-icon")) {
27842
- this.updateChoice(i, {
27895
+ updateChoice(i, {
27843
27896
  checked: !choice.checked,
27844
27897
  crossedOut: choice.crossedOut
27845
27898
  });
@@ -27863,7 +27916,7 @@ function BaseRadio(props) {
27863
27916
  onClick: clickHandler,
27864
27917
  onTouchStart: !labelWrap ? null : captureScratchpadTouchStart$2
27865
27918
  }, /*#__PURE__*/React.createElement(Element, elementProps));
27866
- }, this))); // Allow for horizontal scrolling if content is too wide, which may be
27919
+ }))); // Allow for horizontal scrolling if content is too wide, which may be
27867
27920
  // an issue especially on phones.
27868
27921
  // This is disabled in SAT, since it conflicts with their theming.
27869
27922
 
@@ -28209,7 +28262,7 @@ class Radio$1 extends React.Component {
28209
28262
  noneOfTheAboveSelected
28210
28263
  }; // Support legacy choiceState implementation
28211
28264
  }
28212
- /* istanbul ignore if - props.values is deprecated */
28265
+ /* c8 ignore if - props.values is deprecated */
28213
28266
 
28214
28267
 
28215
28268
  var {
@@ -28304,7 +28357,7 @@ class Radio$1 extends React.Component {
28304
28357
  } else if (this.props.values) {
28305
28358
  // Support legacy choiceStates implementation
28306
28359
 
28307
- /* istanbul ignore next - props.values is deprecated */
28360
+ /* c8 ignore next - props.values is deprecated */
28308
28361
  choiceStates = this.props.values.map(val => ({
28309
28362
  selected: val,
28310
28363
  crossedOut: false,
@@ -28687,7 +28740,7 @@ _defineProperty(Categorizer, "defaultProps", {
28687
28740
 
28688
28741
  var pageMargin = 16; // Stylesheets aren't directly testable
28689
28742
 
28690
- /* istanbul ignore next */
28743
+ /* c8 ignore next */
28691
28744
 
28692
28745
  var styles$m = StyleSheet.create({
28693
28746
  mobileTable: {