@khanacademy/perseus-editor 14.10.3 → 14.11.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.
package/dist/es/index.js CHANGED
@@ -46,7 +46,7 @@ import arrowCounterClockwise from '@phosphor-icons/core/bold/arrow-counter-clock
46
46
 
47
47
  // This file is processed by a Rollup plugin (replace) to inject the production
48
48
  const libName = "@khanacademy/perseus-editor";
49
- const libVersion = "14.10.3";
49
+ const libVersion = "14.11.1";
50
50
  addLibraryVersionToPerseusDebug(libName, libVersion);
51
51
 
52
52
  function _extends() {
@@ -23628,7 +23628,7 @@ class StructuredItemDiff extends React.Component {
23628
23628
 
23629
23629
  /* eslint-disable @khanacademy/ts-no-error-suppressions */
23630
23630
  const {
23631
- InfoTip: InfoTip$n,
23631
+ InfoTip: InfoTip$o,
23632
23632
  InlineIcon: InlineIcon$7
23633
23633
  } = components;
23634
23634
  /* Renders a hint editor box
@@ -23694,7 +23694,7 @@ class HintEditor extends React.Component {
23694
23694
  type: "button",
23695
23695
  className: this.props.isFirst ? "hidden" : "",
23696
23696
  onClick: _.partial(this.props.onMove, -1)
23697
- }, /*#__PURE__*/React.createElement(InlineIcon$7, iconCircleArrowUp)), " ", this.props.isLast && /*#__PURE__*/React.createElement(InfoTip$n, null, /*#__PURE__*/React.createElement("p", null, "The last hint is automatically bolded."))), /*#__PURE__*/React.createElement("input", {
23697
+ }, /*#__PURE__*/React.createElement(InlineIcon$7, iconCircleArrowUp)), " ", this.props.isLast && /*#__PURE__*/React.createElement(InfoTip$o, null, /*#__PURE__*/React.createElement("p", null, "The last hint is automatically bolded."))), /*#__PURE__*/React.createElement("input", {
23698
23698
  type: "checkbox"
23699
23699
  // @ts-expect-error - TS2322 - Type 'boolean | null | undefined' is not assignable to type 'boolean | undefined'.
23700
23700
  ,
@@ -23940,7 +23940,7 @@ CombinedHintsEditor.defaultProps = {
23940
23940
  };
23941
23941
 
23942
23942
  const {
23943
- InfoTip: InfoTip$m
23943
+ InfoTip: InfoTip$n
23944
23944
  } = components;
23945
23945
  class ItemExtrasEditor extends React.Component {
23946
23946
  constructor(...args) {
@@ -24085,7 +24085,7 @@ const ItemExtraCheckbox = props => /*#__PURE__*/React.createElement(View, {
24085
24085
  style: {
24086
24086
  flexDirection: "row"
24087
24087
  }
24088
- }, props.label, " ", /*#__PURE__*/React.createElement(InfoTip$m, null, props.infoTip)),
24088
+ }, props.label, " ", /*#__PURE__*/React.createElement(InfoTip$n, null, props.infoTip)),
24089
24089
  checked: props.checked,
24090
24090
  onChange: newCheckedState => props.onChange(newCheckedState)
24091
24091
  }));
@@ -25776,7 +25776,7 @@ class BlurInput extends React.Component {
25776
25776
  }
25777
25777
 
25778
25778
  const {
25779
- InfoTip: InfoTip$l
25779
+ InfoTip: InfoTip$m
25780
25780
  } = components;
25781
25781
  const DEFAULT_WIDTH = 400;
25782
25782
  const DEFAULT_HEIGHT = 400;
@@ -25940,7 +25940,7 @@ class CSProgramEditor extends React.Component {
25940
25940
  showEditor: value
25941
25941
  });
25942
25942
  }
25943
- }), /*#__PURE__*/React.createElement(InfoTip$l, null, "If you show the editor, you should use the \"full-width\" alignment to make room for the width of the editor."), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Checkbox$1, {
25943
+ }), /*#__PURE__*/React.createElement(InfoTip$m, null, "If you show the editor, you should use the \"full-width\" alignment to make room for the width of the editor."), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Checkbox$1, {
25944
25944
  label: "Show Buttons",
25945
25945
  checked: this.props.showButtons,
25946
25946
  onChange: value => {
@@ -25952,7 +25952,7 @@ class CSProgramEditor extends React.Component {
25952
25952
  name: "settings",
25953
25953
  pairs: this.props.settings,
25954
25954
  onChange: this._handleSettingsChange
25955
- }), /*#__PURE__*/React.createElement(InfoTip$l, null, "Settings that you add here are available to the program as an object returned by ", /*#__PURE__*/React.createElement("code", null, "Program.settings()"))));
25955
+ }), /*#__PURE__*/React.createElement(InfoTip$m, null, "Settings that you add here are available to the program as an object returned by ", /*#__PURE__*/React.createElement("code", null, "Program.settings()"))));
25956
25956
  }
25957
25957
  }
25958
25958
  CSProgramEditor.propTypes = _extends({}, Changeable.propTypes);
@@ -26038,7 +26038,7 @@ DeprecatedStandinEditor.widgetName = "deprecated-standin";
26038
26038
 
26039
26039
  /* eslint-disable @khanacademy/ts-no-error-suppressions */
26040
26040
  const {
26041
- InfoTip: InfoTip$k,
26041
+ InfoTip: InfoTip$l,
26042
26042
  InlineIcon: InlineIcon$5
26043
26043
  } = components;
26044
26044
  class DropdownEditor extends React.Component {
@@ -26103,14 +26103,14 @@ class DropdownEditor extends React.Component {
26103
26103
  className: "perseus-widget-dropdown"
26104
26104
  }, /*#__PURE__*/React.createElement("div", {
26105
26105
  className: "dropdown-info"
26106
- }, "Dropdown", /*#__PURE__*/React.createElement(InfoTip$k, null, /*#__PURE__*/React.createElement("p", null, "The drop down is useful for making inequalities in a custom format. We normally use the symbols ", "<", ",", " ", ">", ", \u2264, \u2265 (in that order) which you can copy into the choices. When possible, use the \"multiple choice\" answer type instead."))), /*#__PURE__*/React.createElement("div", {
26106
+ }, "Dropdown", /*#__PURE__*/React.createElement(InfoTip$l, null, /*#__PURE__*/React.createElement("p", null, "The drop down is useful for making inequalities in a custom format. We normally use the symbols ", "<", ",", " ", ">", ", \u2264, \u2265 (in that order) which you can copy into the choices. When possible, use the \"multiple choice\" answer type instead."))), /*#__PURE__*/React.createElement("div", {
26107
26107
  className: "dropdown-placeholder"
26108
26108
  }, /*#__PURE__*/React.createElement("input", {
26109
26109
  type: "text",
26110
26110
  placeholder: "Placeholder value",
26111
26111
  value: this.props.placeholder,
26112
26112
  onChange: this.onPlaceholderChange
26113
- }), /*#__PURE__*/React.createElement(InfoTip$k, null, /*#__PURE__*/React.createElement("p", null, "This value will appear as the drop down default. It should give the user some indication of the values available in the drop down itself, e.g., Yes/No/Maybe."))), /*#__PURE__*/React.createElement("div", {
26113
+ }), /*#__PURE__*/React.createElement(InfoTip$l, null, /*#__PURE__*/React.createElement("p", null, "This value will appear as the drop down default. It should give the user some indication of the values available in the drop down itself, e.g., Yes/No/Maybe."))), /*#__PURE__*/React.createElement("div", {
26114
26114
  className: "clearfix"
26115
26115
  }), /*#__PURE__*/React.createElement("ul", {
26116
26116
  className: "dropdown-choices"
@@ -26438,7 +26438,7 @@ const styles$N = StyleSheet.create({
26438
26438
  });
26439
26439
 
26440
26440
  const {
26441
- InfoTip: InfoTip$j
26441
+ InfoTip: InfoTip$k
26442
26442
  } = components;
26443
26443
 
26444
26444
  // types for iterables
@@ -26551,14 +26551,6 @@ class ExpressionEditor extends React.Component {
26551
26551
  answerForms
26552
26552
  });
26553
26553
  };
26554
- // called when the options (including the expression itself) to an answer
26555
- // form change
26556
- this.updateForm = (i, props) => {
26557
- const answerForms = lens(this.props.answerForms).merge([i], props).freeze();
26558
- this.change({
26559
- answerForms
26560
- });
26561
- };
26562
26554
  this.handleReorder = components => {
26563
26555
  const answerForms = components.map(component => {
26564
26556
  const form = _(component.props).pick("considered", "form", "simplify", "value");
@@ -26615,6 +26607,13 @@ class ExpressionEditor extends React.Component {
26615
26607
  newProps.functions = value.split(/[ ,]+/).filter(isTruthy);
26616
26608
  this.props.onChange(newProps);
26617
26609
  };
26610
+ this.changeExpressionWidget = (key, props) => {
26611
+ const answerForm = _extends({}, this.props.answerForms[key], {
26612
+ key: `${key}`,
26613
+ value: props.value
26614
+ });
26615
+ this.updateAnswerForm(key, answerForm);
26616
+ };
26618
26617
  this.state = {
26619
26618
  functionsInternal: this.props.functions.join(" ")
26620
26619
  };
@@ -26622,6 +26621,41 @@ class ExpressionEditor extends React.Component {
26622
26621
  change(...args) {
26623
26622
  return Changeable.change.apply(this, args);
26624
26623
  }
26624
+ // This function is designed to update the answerForm property
26625
+ // with new data. This function should not be used to update any
26626
+ // other properties within ExpressionEditor.
26627
+ updateAnswerForm(i, props) {
26628
+ const answerForms = lens(this.props.answerForms).merge([i], props).freeze();
26629
+ this.change({
26630
+ answerForms
26631
+ });
26632
+ }
26633
+ changeSimplify(key, simplify) {
26634
+ const answerForm = _extends({}, this.props.answerForms[key], {
26635
+ key: `${key}`,
26636
+ simplify
26637
+ });
26638
+ this.updateAnswerForm(key, answerForm);
26639
+ }
26640
+ changeForm(key, form) {
26641
+ const answerForm = _extends({}, this.props.answerForms[key], {
26642
+ form,
26643
+ key: `${key}`
26644
+ });
26645
+ this.updateAnswerForm(key, answerForm);
26646
+ }
26647
+ changeConsidered(key, considered) {
26648
+ const answerForm = _extends({}, this.props.answerForms[key], {
26649
+ key: `${key}`,
26650
+ considered
26651
+ });
26652
+ this.updateAnswerForm(key, answerForm);
26653
+ }
26654
+ changeTimes(times) {
26655
+ this.change({
26656
+ times: times
26657
+ });
26658
+ }
26625
26659
  render() {
26626
26660
  const answerOptions = this.props.answerForms.map(ans => {
26627
26661
  const key = parseAnswerKey(ans);
@@ -26633,26 +26667,25 @@ class ExpressionEditor extends React.Component {
26633
26667
  functions: this.props.functions,
26634
26668
  buttonSets: this.props.buttonSets,
26635
26669
  buttonsVisible: "focused",
26636
- form: ans.form,
26637
- simplify: ans.simplify,
26638
26670
  value: ans.value,
26639
- onChange: props => this.updateForm(key, props),
26671
+ onChange: props => this.changeExpressionWidget(key, props),
26640
26672
  trackInteraction: () => {},
26641
- widgetId: this.props.widgetId + "-" + ans.key
26673
+ widgetId: this.props.widgetId + "-" + ans.key,
26674
+ visibleLabel: this.props.visibleLabel,
26675
+ ariaLabel: this.props.ariaLabel
26642
26676
  };
26643
- return lens(ans).merge([], {
26644
- key,
26677
+ return /*#__PURE__*/React.createElement(AnswerOption, {
26645
26678
  draggable: true,
26646
- onChange: props => {
26647
- var _ans$key;
26648
- return this.updateForm(Number.parseInt((_ans$key = ans.key) != null ? _ans$key : ""), props);
26649
- },
26679
+ considered: ans.considered,
26680
+ expressionProps: expressionProps,
26681
+ form: ans.form,
26682
+ simplify: ans.simplify,
26650
26683
  onDelete: () => this.handleRemoveForm(key),
26651
- expressionProps: expressionProps
26652
- }).freeze();
26653
- }).map(obj => /*#__PURE__*/React.createElement(AnswerOption, _extends({
26654
- key: obj.key
26655
- }, obj)));
26684
+ onChangeSimplify: simplify => this.changeSimplify(key, simplify),
26685
+ onChangeForm: form => this.changeForm(key, form),
26686
+ onChangeConsidered: considered => this.changeConsidered(key, considered)
26687
+ });
26688
+ });
26656
26689
  const sortable = /*#__PURE__*/React.createElement(SortableArea, {
26657
26690
  components: answerOptions,
26658
26691
  onReorder: this.handleReorder
@@ -26684,13 +26717,13 @@ class ExpressionEditor extends React.Component {
26684
26717
  label: "Visible label",
26685
26718
  value: this.props.visibleLabel || "",
26686
26719
  onChange: this.change("visibleLabel")
26687
- }), /*#__PURE__*/React.createElement(InfoTip$j, null, /*#__PURE__*/React.createElement("p", null, "Optional visible text; strongly encouraged to help learners using dictation software, but can be omitted if the surrounding content provides enough context."))), /*#__PURE__*/React.createElement("div", {
26720
+ }), /*#__PURE__*/React.createElement(InfoTip$k, null, /*#__PURE__*/React.createElement("p", null, "Optional visible text; strongly encouraged to help learners using dictation software, but can be omitted if the surrounding content provides enough context."))), /*#__PURE__*/React.createElement("div", {
26688
26721
  className: css(styles$M.paddedY)
26689
26722
  }, /*#__PURE__*/React.createElement(LabeledTextField, {
26690
26723
  label: "Aria label",
26691
26724
  value: this.props.ariaLabel || "",
26692
26725
  onChange: this.change("ariaLabel")
26693
- }), /*#__PURE__*/React.createElement(InfoTip$j, null, /*#__PURE__*/React.createElement("p", null, "Label text that's read by screen readers. Highly recommend adding a label here to ensure your exercise is accessible. For more information on writting accessible labels, please see", " ", /*#__PURE__*/React.createElement("a", {
26726
+ }), /*#__PURE__*/React.createElement(InfoTip$k, null, /*#__PURE__*/React.createElement("p", null, "Label text that's read by screen readers. Highly recommend adding a label here to ensure your exercise is accessible. For more information on writting accessible labels, please see", " ", /*#__PURE__*/React.createElement("a", {
26694
26727
  href: "https://www.w3.org/WAI/tips/designing/#ensure-that-form-elements-include-clearly-associated-labels",
26695
26728
  target: "_blank"
26696
26729
  }, "this article.")))), /*#__PURE__*/React.createElement("div", {
@@ -26699,17 +26732,15 @@ class ExpressionEditor extends React.Component {
26699
26732
  label: "Function variables",
26700
26733
  value: this.state.functionsInternal,
26701
26734
  onChange: this.handleFunctions
26702
- }), /*#__PURE__*/React.createElement(InfoTip$j, null, /*#__PURE__*/React.createElement("p", null, "Single-letter variables listed here will be interpreted as functions. This let us know that f(x) means \"f of x\" and not \"f times x\"."))), /*#__PURE__*/React.createElement("div", {
26735
+ }), /*#__PURE__*/React.createElement(InfoTip$k, null, /*#__PURE__*/React.createElement("p", null, "Single-letter variables listed here will be interpreted as functions. This let us know that f(x) means \"f of x\" and not \"f times x\"."))), /*#__PURE__*/React.createElement("div", {
26703
26736
  className: css(styles$M.paddedY)
26704
26737
  }, /*#__PURE__*/React.createElement(Checkbox$1, {
26705
26738
  label: "Use \xD7 instead of \u22C5 for multiplication",
26706
26739
  checked: this.props.times,
26707
- onChange: value => {
26708
- this.props.onChange({
26709
- times: value
26710
- });
26740
+ onChange: newCheckedState => {
26741
+ this.changeTimes(newCheckedState);
26711
26742
  }
26712
- }), /*#__PURE__*/React.createElement(InfoTip$j, null, /*#__PURE__*/React.createElement("p", null, "For pre-algebra problems this option displays multiplication as \\times instead of \\cdot in both the rendered output and the acceptable formats examples."))), /*#__PURE__*/React.createElement("div", {
26743
+ }), /*#__PURE__*/React.createElement(InfoTip$k, null, /*#__PURE__*/React.createElement("p", null, "For pre-algebra problems this option displays multiplication as \\times instead of \\cdot in both the rendered output and the acceptable formats examples."))), /*#__PURE__*/React.createElement("div", {
26713
26744
  className: css(styles$M.paddedY)
26714
26745
  }, /*#__PURE__*/React.createElement(HeadingXSmall, null, "Button Sets"), buttonSetChoices), /*#__PURE__*/React.createElement(HeadingSmall, null, "Answers"), /*#__PURE__*/React.createElement("p", {
26715
26746
  style: {
@@ -26758,10 +26789,9 @@ class AnswerOption extends React.Component {
26758
26789
  });
26759
26790
  };
26760
26791
  this.toggleConsidered = () => {
26792
+ // Update findNextIn to have stronger typing.
26761
26793
  const newVal = findNextIn(PerseusExpressionAnswerFormConsidered, this.props.considered);
26762
- this.change({
26763
- considered: newVal
26764
- });
26794
+ this.props.onChangeConsidered(newVal);
26765
26795
  };
26766
26796
  }
26767
26797
  render() {
@@ -26796,22 +26826,14 @@ class AnswerOption extends React.Component {
26796
26826
  }, /*#__PURE__*/React.createElement(Checkbox$1, {
26797
26827
  label: "Answer expression must have the same form.",
26798
26828
  checked: this.props.form,
26799
- onChange: value => {
26800
- this.props.onChange({
26801
- form: value
26802
- });
26803
- }
26804
- }), /*#__PURE__*/React.createElement(InfoTip$j, null, /*#__PURE__*/React.createElement("p", null, "The student's answer must be in the same form. Commutativity and excess negative signs are ignored."))), /*#__PURE__*/React.createElement("div", {
26829
+ onChange: this.props.onChangeForm
26830
+ }), /*#__PURE__*/React.createElement(InfoTip$k, null, /*#__PURE__*/React.createElement("p", null, "The student's answer must be in the same form. Commutativity and excess negative signs are ignored."))), /*#__PURE__*/React.createElement("div", {
26805
26831
  className: css(styles$M.paddedY, styles$M.paddedX)
26806
26832
  }, /*#__PURE__*/React.createElement(Checkbox$1, {
26807
26833
  label: "Answer expression must be fully expanded and simplified.",
26808
26834
  checked: this.props.simplify,
26809
- onChange: value => {
26810
- this.props.onChange({
26811
- simplify: value
26812
- });
26813
- }
26814
- }), /*#__PURE__*/React.createElement(InfoTip$j, null, /*#__PURE__*/React.createElement("p", null, "The student's answer must be fully expanded and simplified. Answering this equation (x^2+2x+1) with this factored equation (x+1)^2 will render this response \"Your answer is not fully expanded and simplified.\""))), /*#__PURE__*/React.createElement("div", {
26835
+ onChange: this.props.onChangeSimplify
26836
+ }), /*#__PURE__*/React.createElement(InfoTip$k, null, /*#__PURE__*/React.createElement("p", null, "The student's answer must be fully expanded and simplified. Answering this equation (x^2+2x+1) with this factored equation (x+1)^2 will render this response \"Your answer is not fully expanded and simplified.\""))), /*#__PURE__*/React.createElement("div", {
26815
26837
  className: css(styles$M.buttonRow, styles$M.paddedY)
26816
26838
  }, removeButton)));
26817
26839
  }
@@ -27050,7 +27072,7 @@ const setArrayItem = (list, i, value) => [...list.slice(0, i), value, ...list.sl
27050
27072
 
27051
27073
  const {
27052
27074
  ButtonGroup: ButtonGroup$7,
27053
- InfoTip: InfoTip$i,
27075
+ InfoTip: InfoTip$j,
27054
27076
  RangeInput: RangeInput$6
27055
27077
  } = components;
27056
27078
  const defaultBackgroundImage$3 = {
@@ -27509,7 +27531,7 @@ const GraphSettings = createReactClass({
27509
27531
  },
27510
27532
  onKeyPress: this.changeBackgroundUrl,
27511
27533
  onBlur: this.changeBackgroundUrl
27512
- }), /*#__PURE__*/React.createElement(InfoTip$i, null, /*#__PURE__*/React.createElement("p", null, "Create an image in graphie, or use the \"Add image\" function to create a background.")))), _.contains(this.props.editableSettings, "measure") && /*#__PURE__*/React.createElement("div", {
27534
+ }), /*#__PURE__*/React.createElement(InfoTip$j, null, /*#__PURE__*/React.createElement("p", null, "Create an image in graphie, or use the \"Add image\" function to create a background.")))), _.contains(this.props.editableSettings, "measure") && /*#__PURE__*/React.createElement("div", {
27513
27535
  className: "misc-settings"
27514
27536
  }, /*#__PURE__*/React.createElement("div", {
27515
27537
  className: "perseus-widget-row"
@@ -27555,7 +27577,7 @@ const GraphSettings = createReactClass({
27555
27577
  });
27556
27578
 
27557
27579
  const {
27558
- InfoTip: InfoTip$h,
27580
+ InfoTip: InfoTip$i,
27559
27581
  MultiButtonGroup: MultiButtonGroup$1
27560
27582
  } = components;
27561
27583
  const Grapher = GrapherWidget.widget;
@@ -27634,7 +27656,7 @@ class GrapherEditor extends React.Component {
27634
27656
  className: "perseus-error"
27635
27657
  }, this.props.graph.valid);
27636
27658
  }
27637
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, "Correct answer", " ", /*#__PURE__*/React.createElement(InfoTip$h, null, /*#__PURE__*/React.createElement("p", null, "Graph the correct answer in the graph below and ensure the equation or point coordinates displayed represent the correct answer.")), " ", ": ", equationString), /*#__PURE__*/React.createElement(GraphSettings, {
27659
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, "Correct answer", " ", /*#__PURE__*/React.createElement(InfoTip$i, null, /*#__PURE__*/React.createElement("p", null, "Graph the correct answer in the graph below and ensure the equation or point coordinates displayed represent the correct answer.")), " ", ": ", equationString), /*#__PURE__*/React.createElement(GraphSettings, {
27638
27660
  editableSettings: ["graph", "snap", "image"],
27639
27661
  box: getInteractiveBoxFromSizeClass(sizeClass),
27640
27662
  range: this.props.graph.range,
@@ -27884,7 +27906,7 @@ IframeEditor.defaultProps = {
27884
27906
 
27885
27907
  /* eslint-disable jsx-a11y/anchor-is-valid */
27886
27908
  const {
27887
- InfoTip: InfoTip$g,
27909
+ InfoTip: InfoTip$h,
27888
27910
  InlineIcon: InlineIcon$3,
27889
27911
  RangeInput: RangeInput$5
27890
27912
  } = components;
@@ -28074,7 +28096,7 @@ class ImageEditor extends React.Component {
28074
28096
  style: {
28075
28097
  width: "100%"
28076
28098
  }
28077
- }))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("div", null, "Dimensions:"), /*#__PURE__*/React.createElement("p", null, backgroundImage.width, "x", backgroundImage.height))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("div", null, "Alt text:", /*#__PURE__*/React.createElement(InfoTip$g, null, "This is important for screenreaders. The content of this alt text will be formatted as markdown (tables, emphasis, etc. are supported).")), /*#__PURE__*/React.createElement(Editor, {
28099
+ }))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("div", null, "Dimensions:"), /*#__PURE__*/React.createElement("p", null, backgroundImage.width, "x", backgroundImage.height))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("div", null, "Alt text:", /*#__PURE__*/React.createElement(InfoTip$h, null, "This is important for screenreaders. The content of this alt text will be formatted as markdown (tables, emphasis, etc. are supported).")), /*#__PURE__*/React.createElement(Editor, {
28078
28100
  apiOptions: this.props.apiOptions,
28079
28101
  content: this.props.alt,
28080
28102
  onChange: props => {
@@ -28098,7 +28120,7 @@ class ImageEditor extends React.Component {
28098
28120
  }, this.state.backgroundImageError);
28099
28121
  return /*#__PURE__*/React.createElement("div", {
28100
28122
  className: "perseus-image-editor"
28101
- }, /*#__PURE__*/React.createElement("label", null, "Image url:", /*#__PURE__*/React.createElement(InfoTip$g, null, "Paste an image or graphie image URL."), this.state.backgroundImageError && backgroundImageErrorText, /*#__PURE__*/React.createElement(BlurInput, {
28123
+ }, /*#__PURE__*/React.createElement("label", null, "Image url:", /*#__PURE__*/React.createElement(InfoTip$h, null, "Paste an image or graphie image URL."), this.state.backgroundImageError && backgroundImageErrorText, /*#__PURE__*/React.createElement(BlurInput, {
28102
28124
  value: backgroundImage.url || "",
28103
28125
  style: {
28104
28126
  width: 332
@@ -28120,7 +28142,7 @@ ImageEditor.defaultProps = {
28120
28142
  };
28121
28143
 
28122
28144
  const {
28123
- InfoTip: InfoTip$f
28145
+ InfoTip: InfoTip$g
28124
28146
  } = components;
28125
28147
  const answerTypes = {
28126
28148
  number: {
@@ -28206,7 +28228,7 @@ class InputNumberEditor extends React.Component {
28206
28228
  value: "optional"
28207
28229
  }, "will be accepted"), /*#__PURE__*/React.createElement("option", {
28208
28230
  value: "enforced"
28209
- }, "will be marked wrong"))), /*#__PURE__*/React.createElement(InfoTip$f, null, /*#__PURE__*/React.createElement("p", null, "Normally select \"will not be graded\". This will give the user a message saying the answer is correct but not simplified. The user will then have to simplify it and re-enter, but will not be penalized. (5th grade and anything after)"), /*#__PURE__*/React.createElement("p", null, "Select \"will be accepted\" only if the user is not expected to know how to simplify fractions yet. (Anything prior to 5th grade)"), /*#__PURE__*/React.createElement("p", null, "Select \"will be marked wrong\" only if we are specifically assessing the ability to simplify."))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("input", {
28231
+ }, "will be marked wrong"))), /*#__PURE__*/React.createElement(InfoTip$g, null, /*#__PURE__*/React.createElement("p", null, "Normally select \"will not be graded\". This will give the user a message saying the answer is correct but not simplified. The user will then have to simplify it and re-enter, but will not be penalized. (5th grade and anything after)"), /*#__PURE__*/React.createElement("p", null, "Select \"will be accepted\" only if the user is not expected to know how to simplify fractions yet. (Anything prior to 5th grade)"), /*#__PURE__*/React.createElement("p", null, "Select \"will be marked wrong\" only if we are specifically assessing the ability to simplify."))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("input", {
28210
28232
  type: "checkbox",
28211
28233
  checked: this.props.inexact,
28212
28234
  onChange: e => {
@@ -28242,7 +28264,7 @@ class InputNumberEditor extends React.Component {
28242
28264
  });
28243
28265
  },
28244
28266
  "aria-label": "Answer type"
28245
- }, answerTypeOptions), /*#__PURE__*/React.createElement(InfoTip$f, null, /*#__PURE__*/React.createElement("p", null, "Use the default \"Numbers\" unless the answer must be in a specific form (e.g., question is about converting decimals to fractions)."))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Width", " ", /*#__PURE__*/React.createElement("select", {
28267
+ }, answerTypeOptions), /*#__PURE__*/React.createElement(InfoTip$g, null, /*#__PURE__*/React.createElement("p", null, "Use the default \"Numbers\" unless the answer must be in a specific form (e.g., question is about converting decimals to fractions)."))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Width", " ", /*#__PURE__*/React.createElement("select", {
28246
28268
  value: this.props.size,
28247
28269
  onChange: e => {
28248
28270
  // @ts-expect-error - TS2322 - Type 'string' is not assignable to type '"small" | "normal" | undefined'.
@@ -28254,7 +28276,7 @@ class InputNumberEditor extends React.Component {
28254
28276
  value: "normal"
28255
28277
  }, "Normal (80px)"), /*#__PURE__*/React.createElement("option", {
28256
28278
  value: "small"
28257
- }, "Small (40px)"))), /*#__PURE__*/React.createElement(InfoTip$f, null, /*#__PURE__*/React.createElement("p", null, "Use size \"Normal\" for all text boxes, unless there are multiple text boxes in one line and the answer area is too narrow to fit them."))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("input", {
28279
+ }, "Small (40px)"))), /*#__PURE__*/React.createElement(InfoTip$g, null, /*#__PURE__*/React.createElement("p", null, "Use size \"Normal\" for all text boxes, unless there are multiple text boxes in one line and the answer area is too narrow to fit them."))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("input", {
28258
28280
  type: "checkbox",
28259
28281
  checked: this.props.rightAlign,
28260
28282
  onChange: e => {
@@ -29764,7 +29786,7 @@ const styles$F = StyleSheet.create({
29764
29786
 
29765
29787
  const {
29766
29788
  ButtonGroup: ButtonGroup$2,
29767
- InfoTip: InfoTip$e,
29789
+ InfoTip: InfoTip$f,
29768
29790
  RangeInput: RangeInput$4
29769
29791
  } = components;
29770
29792
  const defaultBackgroundImage$1 = {
@@ -30154,7 +30176,7 @@ class InteractiveGraphSettings extends React.Component {
30154
30176
  },
30155
30177
  onKeyPress: this.changeBackgroundUrl,
30156
30178
  onBlur: this.changeBackgroundUrl
30157
- }), /*#__PURE__*/React.createElement(InfoTip$e, null, /*#__PURE__*/React.createElement("p", null, "Create an image in graphie, or use the \"Add image\" function to create a background."))), /*#__PURE__*/React.createElement(View, {
30179
+ }), /*#__PURE__*/React.createElement(InfoTip$f, null, /*#__PURE__*/React.createElement("p", null, "Create an image in graphie, or use the \"Add image\" function to create a background."))), /*#__PURE__*/React.createElement(View, {
30158
30180
  style: styles$E.protractorSection
30159
30181
  }, /*#__PURE__*/React.createElement(View, {
30160
30182
  style: styles$E.checkboxRow
@@ -30666,7 +30688,7 @@ const styles$v = StyleSheet.create({
30666
30688
  });
30667
30689
 
30668
30690
  const {
30669
- InfoTip: InfoTip$d
30691
+ InfoTip: InfoTip$e
30670
30692
  } = components;
30671
30693
  function LockedFigureAria(props) {
30672
30694
  const {
@@ -30683,7 +30705,7 @@ function LockedFigureAria(props) {
30683
30705
  }, /*#__PURE__*/React.createElement(LabelMedium, {
30684
30706
  tag: "label",
30685
30707
  htmlFor: ariaLabelId
30686
- }, "Aria label"), /*#__PURE__*/React.createElement(Spring, null), /*#__PURE__*/React.createElement(InfoTip$d, null, "Aria label is used by screen readers to describe content to users who may be visually impaired. ", /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), "Populating this field will make it so that users can use a screen reader to navigate to this point and hear the description.", /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), "If you leave this field blank, the point will be hidden from screen readers. Users will not be able to navigate to this point using a screen reader.")), /*#__PURE__*/React.createElement(Strut, {
30708
+ }, "Aria label"), /*#__PURE__*/React.createElement(Spring, null), /*#__PURE__*/React.createElement(InfoTip$e, null, "Aria label is used by screen readers to describe content to users who may be visually impaired. ", /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), "Populating this field will make it so that users can use a screen reader to navigate to this point and hear the description.", /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), "If you leave this field blank, the point will be hidden from screen readers. Users will not be able to navigate to this point using a screen reader.")), /*#__PURE__*/React.createElement(Strut, {
30687
30709
  size: spacing.xxSmall_6
30688
30710
  }), /*#__PURE__*/React.createElement(LabelXSmall, {
30689
30711
  style: styles$u.caption
@@ -30795,6 +30817,9 @@ const styles$t = StyleSheet.create({
30795
30817
  *
30796
30818
  * Used in the interactive graph editor's locked figures section.
30797
30819
  */
30820
+ const {
30821
+ InfoTip: InfoTip$d
30822
+ } = components;
30798
30823
  function LockedLabelSettings(props) {
30799
30824
  const {
30800
30825
  type,
@@ -30831,10 +30856,14 @@ function LockedLabelSettings(props) {
30831
30856
  });
30832
30857
  },
30833
30858
  style: styles$s.spaceUnder
30834
- }), /*#__PURE__*/React.createElement(LabelMedium, {
30859
+ }), /*#__PURE__*/React.createElement(View, {
30860
+ style: styles$s.row
30861
+ }, /*#__PURE__*/React.createElement(LabelMedium, {
30835
30862
  tag: "label",
30836
- style: [styles$s.row, styles$s.spaceUnder]
30837
- }, "TeX", /*#__PURE__*/React.createElement(Strut, {
30863
+ style: [styles$s.row, styles$s.spaceUnder, {
30864
+ flexGrow: 1
30865
+ }]
30866
+ }, "text", /*#__PURE__*/React.createElement(Strut, {
30838
30867
  size: spacing.xSmall_8
30839
30868
  }), /*#__PURE__*/React.createElement(TextField, {
30840
30869
  value: text,
@@ -30842,7 +30871,7 @@ function LockedLabelSettings(props) {
30842
30871
  onChange: newValue => onChangeProps({
30843
30872
  text: newValue
30844
30873
  })
30845
- })), /*#__PURE__*/React.createElement(View, {
30874
+ })), /*#__PURE__*/React.createElement(InfoTip$d, null, "Surround your text with $ for TeX.", /*#__PURE__*/React.createElement("br", null), "Example: ", `This circle has radius $\\frac{1}{2}$ units.`, /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), "It is important to use TeX when appropriate for accessibility. The above example would be read as \"This circle has radius one-half units\" by screen readers.")), /*#__PURE__*/React.createElement(View, {
30846
30875
  style: styles$s.row
30847
30876
  }, /*#__PURE__*/React.createElement(ColorSelect, {
30848
30877
  selectedValue: color$1,
@@ -33788,8 +33817,7 @@ class InteractiveGraphEditor extends React.Component {
33788
33817
  // value for `match`; a value of undefined
33789
33818
  // means exact matching. The code happens
33790
33819
  // to work because "exact" falls through
33791
- // to the correct else branch in
33792
- // InteractiveGraph.validate()
33820
+ // to the correct else branch when scoring
33793
33821
  match: newValue
33794
33822
  });
33795
33823
  this.props.onChange({
@@ -33824,8 +33852,7 @@ class InteractiveGraphEditor extends React.Component {
33824
33852
  // value for `match`; a value of undefined
33825
33853
  // means exact matching. The code happens
33826
33854
  // to work because "exact" falls through
33827
- // to the correct else branch in
33828
- // InteractiveGraph.validate()
33855
+ // to the correct else branch when scoring
33829
33856
  match: newValue
33830
33857
  })
33831
33858
  });