@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/index.js CHANGED
@@ -98,7 +98,7 @@ var arrowCounterClockwise__default = /*#__PURE__*/_interopDefaultLegacy(arrowCou
98
98
 
99
99
  // This file is processed by a Rollup plugin (replace) to inject the production
100
100
  const libName = "@khanacademy/perseus-editor";
101
- const libVersion = "14.10.3";
101
+ const libVersion = "14.11.1";
102
102
  perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
103
103
 
104
104
  function _extends() {
@@ -23657,7 +23657,7 @@ class StructuredItemDiff extends React__namespace.Component {
23657
23657
 
23658
23658
  /* eslint-disable @khanacademy/ts-no-error-suppressions */
23659
23659
  const {
23660
- InfoTip: InfoTip$n,
23660
+ InfoTip: InfoTip$o,
23661
23661
  InlineIcon: InlineIcon$7
23662
23662
  } = perseus.components;
23663
23663
  /* Renders a hint editor box
@@ -23725,7 +23725,7 @@ class HintEditor extends React__namespace.Component {
23725
23725
  type: "button",
23726
23726
  className: this.props.isFirst ? "hidden" : "",
23727
23727
  onClick: ___default["default"].partial(this.props.onMove, -1)
23728
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$7, iconCircleArrowUp)), " ", this.props.isLast && /*#__PURE__*/React__namespace.createElement(InfoTip$n, null, /*#__PURE__*/React__namespace.createElement("p", null, "The last hint is automatically bolded."))), /*#__PURE__*/React__namespace.createElement("input", {
23728
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$7, iconCircleArrowUp)), " ", this.props.isLast && /*#__PURE__*/React__namespace.createElement(InfoTip$o, null, /*#__PURE__*/React__namespace.createElement("p", null, "The last hint is automatically bolded."))), /*#__PURE__*/React__namespace.createElement("input", {
23729
23729
  type: "checkbox"
23730
23730
  // @ts-expect-error - TS2322 - Type 'boolean | null | undefined' is not assignable to type 'boolean | undefined'.
23731
23731
  ,
@@ -23953,7 +23953,7 @@ class CombinedHintsEditor extends React__namespace.Component {
23953
23953
  }
23954
23954
 
23955
23955
  const {
23956
- InfoTip: InfoTip$m
23956
+ InfoTip: InfoTip$n
23957
23957
  } = perseus.components;
23958
23958
  class ItemExtrasEditor extends React__namespace.Component {
23959
23959
  static defaultProps = {
@@ -24097,7 +24097,7 @@ const ItemExtraCheckbox = props => /*#__PURE__*/React__namespace.createElement(w
24097
24097
  style: {
24098
24098
  flexDirection: "row"
24099
24099
  }
24100
- }, props.label, " ", /*#__PURE__*/React__namespace.createElement(InfoTip$m, null, props.infoTip)),
24100
+ }, props.label, " ", /*#__PURE__*/React__namespace.createElement(InfoTip$n, null, props.infoTip)),
24101
24101
  checked: props.checked,
24102
24102
  onChange: newCheckedState => props.onChange(newCheckedState)
24103
24103
  }));
@@ -25780,7 +25780,7 @@ class BlurInput extends React__namespace.Component {
25780
25780
 
25781
25781
  /* eslint-disable no-useless-escape */
25782
25782
  const {
25783
- InfoTip: InfoTip$l
25783
+ InfoTip: InfoTip$m
25784
25784
  } = perseus.components;
25785
25785
  const DEFAULT_WIDTH = 400;
25786
25786
  const DEFAULT_HEIGHT = 400;
@@ -25971,7 +25971,7 @@ class CSProgramEditor extends React__namespace.Component {
25971
25971
  showEditor: value
25972
25972
  });
25973
25973
  }
25974
- }), /*#__PURE__*/React__namespace.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__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
25974
+ }), /*#__PURE__*/React__namespace.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__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
25975
25975
  label: "Show Buttons",
25976
25976
  checked: this.props.showButtons,
25977
25977
  onChange: value => {
@@ -25983,7 +25983,7 @@ class CSProgramEditor extends React__namespace.Component {
25983
25983
  name: "settings",
25984
25984
  pairs: this.props.settings,
25985
25985
  onChange: this._handleSettingsChange
25986
- }), /*#__PURE__*/React__namespace.createElement(InfoTip$l, null, "Settings that you add here are available to the program as an object returned by ", /*#__PURE__*/React__namespace.createElement("code", null, "Program.settings()"))));
25986
+ }), /*#__PURE__*/React__namespace.createElement(InfoTip$m, null, "Settings that you add here are available to the program as an object returned by ", /*#__PURE__*/React__namespace.createElement("code", null, "Program.settings()"))));
25987
25987
  }
25988
25988
  }
25989
25989
 
@@ -26060,7 +26060,7 @@ class DeprecatedStandinEditor extends React__namespace.Component {
26060
26060
 
26061
26061
  /* eslint-disable @khanacademy/ts-no-error-suppressions */
26062
26062
  const {
26063
- InfoTip: InfoTip$k,
26063
+ InfoTip: InfoTip$l,
26064
26064
  InlineIcon: InlineIcon$5
26065
26065
  } = perseus.components;
26066
26066
  class DropdownEditor extends React__namespace.Component {
@@ -26137,14 +26137,14 @@ class DropdownEditor extends React__namespace.Component {
26137
26137
  className: "perseus-widget-dropdown"
26138
26138
  }, /*#__PURE__*/React__namespace.createElement("div", {
26139
26139
  className: "dropdown-info"
26140
- }, "Dropdown", /*#__PURE__*/React__namespace.createElement(InfoTip$k, null, /*#__PURE__*/React__namespace.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__namespace.createElement("div", {
26140
+ }, "Dropdown", /*#__PURE__*/React__namespace.createElement(InfoTip$l, null, /*#__PURE__*/React__namespace.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__namespace.createElement("div", {
26141
26141
  className: "dropdown-placeholder"
26142
26142
  }, /*#__PURE__*/React__namespace.createElement("input", {
26143
26143
  type: "text",
26144
26144
  placeholder: "Placeholder value",
26145
26145
  value: this.props.placeholder,
26146
26146
  onChange: this.onPlaceholderChange
26147
- }), /*#__PURE__*/React__namespace.createElement(InfoTip$k, null, /*#__PURE__*/React__namespace.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__namespace.createElement("div", {
26147
+ }), /*#__PURE__*/React__namespace.createElement(InfoTip$l, null, /*#__PURE__*/React__namespace.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__namespace.createElement("div", {
26148
26148
  className: "clearfix"
26149
26149
  }), /*#__PURE__*/React__namespace.createElement("ul", {
26150
26150
  className: "dropdown-choices"
@@ -26462,7 +26462,7 @@ const styles$N = aphrodite.StyleSheet.create({
26462
26462
  });
26463
26463
 
26464
26464
  const {
26465
- InfoTip: InfoTip$j
26465
+ InfoTip: InfoTip$k
26466
26466
  } = perseus.components;
26467
26467
 
26468
26468
  // types for iterables
@@ -26594,14 +26594,15 @@ class ExpressionEditor extends React__namespace.Component {
26594
26594
  });
26595
26595
  };
26596
26596
 
26597
- // called when the options (including the expression itself) to an answer
26598
- // form change
26599
- updateForm = (i, props) => {
26597
+ // This function is designed to update the answerForm property
26598
+ // with new data. This function should not be used to update any
26599
+ // other properties within ExpressionEditor.
26600
+ updateAnswerForm(i, props) {
26600
26601
  const answerForms = lens(this.props.answerForms).merge([i], props).freeze();
26601
26602
  this.change({
26602
26603
  answerForms
26603
26604
  });
26604
- };
26605
+ }
26605
26606
  handleReorder = components => {
26606
26607
  const answerForms = components.map(component => {
26607
26608
  const form = ___default["default"](component.props).pick("considered", "form", "simplify", "value");
@@ -26661,6 +26662,43 @@ class ExpressionEditor extends React__namespace.Component {
26661
26662
  newProps.functions = value.split(/[ ,]+/).filter(wonderStuffCore.isTruthy);
26662
26663
  this.props.onChange(newProps);
26663
26664
  };
26665
+ changeSimplify(key, simplify) {
26666
+ const answerForm = {
26667
+ ...this.props.answerForms[key],
26668
+ key: `${key}`,
26669
+ simplify
26670
+ };
26671
+ this.updateAnswerForm(key, answerForm);
26672
+ }
26673
+ changeForm(key, form) {
26674
+ const answerForm = {
26675
+ ...this.props.answerForms[key],
26676
+ form,
26677
+ key: `${key}`
26678
+ };
26679
+ this.updateAnswerForm(key, answerForm);
26680
+ }
26681
+ changeConsidered(key, considered) {
26682
+ const answerForm = {
26683
+ ...this.props.answerForms[key],
26684
+ key: `${key}`,
26685
+ considered
26686
+ };
26687
+ this.updateAnswerForm(key, answerForm);
26688
+ }
26689
+ changeTimes(times) {
26690
+ this.change({
26691
+ times: times
26692
+ });
26693
+ }
26694
+ changeExpressionWidget = (key, props) => {
26695
+ const answerForm = {
26696
+ ...this.props.answerForms[key],
26697
+ key: `${key}`,
26698
+ value: props.value
26699
+ };
26700
+ this.updateAnswerForm(key, answerForm);
26701
+ };
26664
26702
  render() {
26665
26703
  const answerOptions = this.props.answerForms.map(ans => {
26666
26704
  const key = parseAnswerKey(ans);
@@ -26672,23 +26710,25 @@ class ExpressionEditor extends React__namespace.Component {
26672
26710
  functions: this.props.functions,
26673
26711
  buttonSets: this.props.buttonSets,
26674
26712
  buttonsVisible: "focused",
26675
- form: ans.form,
26676
- simplify: ans.simplify,
26677
26713
  value: ans.value,
26678
- onChange: props => this.updateForm(key, props),
26714
+ onChange: props => this.changeExpressionWidget(key, props),
26679
26715
  trackInteraction: () => {},
26680
- widgetId: this.props.widgetId + "-" + ans.key
26716
+ widgetId: this.props.widgetId + "-" + ans.key,
26717
+ visibleLabel: this.props.visibleLabel,
26718
+ ariaLabel: this.props.ariaLabel
26681
26719
  };
26682
- return lens(ans).merge([], {
26683
- key,
26720
+ return /*#__PURE__*/React__namespace.createElement(AnswerOption, {
26684
26721
  draggable: true,
26685
- onChange: props => this.updateForm(Number.parseInt(ans.key ?? ""), props),
26722
+ considered: ans.considered,
26723
+ expressionProps: expressionProps,
26724
+ form: ans.form,
26725
+ simplify: ans.simplify,
26686
26726
  onDelete: () => this.handleRemoveForm(key),
26687
- expressionProps: expressionProps
26688
- }).freeze();
26689
- }).map(obj => /*#__PURE__*/React__namespace.createElement(AnswerOption, _extends({
26690
- key: obj.key
26691
- }, obj)));
26727
+ onChangeSimplify: simplify => this.changeSimplify(key, simplify),
26728
+ onChangeForm: form => this.changeForm(key, form),
26729
+ onChangeConsidered: considered => this.changeConsidered(key, considered)
26730
+ });
26731
+ });
26692
26732
  const sortable = /*#__PURE__*/React__namespace.createElement(SortableArea, {
26693
26733
  components: answerOptions,
26694
26734
  onReorder: this.handleReorder
@@ -26720,13 +26760,13 @@ class ExpressionEditor extends React__namespace.Component {
26720
26760
  label: "Visible label",
26721
26761
  value: this.props.visibleLabel || "",
26722
26762
  onChange: this.change("visibleLabel")
26723
- }), /*#__PURE__*/React__namespace.createElement(InfoTip$j, null, /*#__PURE__*/React__namespace.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__namespace.createElement("div", {
26763
+ }), /*#__PURE__*/React__namespace.createElement(InfoTip$k, null, /*#__PURE__*/React__namespace.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__namespace.createElement("div", {
26724
26764
  className: aphrodite.css(styles$M.paddedY)
26725
26765
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.LabeledTextField, {
26726
26766
  label: "Aria label",
26727
26767
  value: this.props.ariaLabel || "",
26728
26768
  onChange: this.change("ariaLabel")
26729
- }), /*#__PURE__*/React__namespace.createElement(InfoTip$j, null, /*#__PURE__*/React__namespace.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__namespace.createElement("a", {
26769
+ }), /*#__PURE__*/React__namespace.createElement(InfoTip$k, null, /*#__PURE__*/React__namespace.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__namespace.createElement("a", {
26730
26770
  href: "https://www.w3.org/WAI/tips/designing/#ensure-that-form-elements-include-clearly-associated-labels",
26731
26771
  target: "_blank"
26732
26772
  }, "this article.")))), /*#__PURE__*/React__namespace.createElement("div", {
@@ -26735,17 +26775,15 @@ class ExpressionEditor extends React__namespace.Component {
26735
26775
  label: "Function variables",
26736
26776
  value: this.state.functionsInternal,
26737
26777
  onChange: this.handleFunctions
26738
- }), /*#__PURE__*/React__namespace.createElement(InfoTip$j, null, /*#__PURE__*/React__namespace.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__namespace.createElement("div", {
26778
+ }), /*#__PURE__*/React__namespace.createElement(InfoTip$k, null, /*#__PURE__*/React__namespace.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__namespace.createElement("div", {
26739
26779
  className: aphrodite.css(styles$M.paddedY)
26740
26780
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
26741
26781
  label: "Use \xD7 instead of \u22C5 for multiplication",
26742
26782
  checked: this.props.times,
26743
- onChange: value => {
26744
- this.props.onChange({
26745
- times: value
26746
- });
26783
+ onChange: newCheckedState => {
26784
+ this.changeTimes(newCheckedState);
26747
26785
  }
26748
- }), /*#__PURE__*/React__namespace.createElement(InfoTip$j, null, /*#__PURE__*/React__namespace.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__namespace.createElement("div", {
26786
+ }), /*#__PURE__*/React__namespace.createElement(InfoTip$k, null, /*#__PURE__*/React__namespace.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__namespace.createElement("div", {
26749
26787
  className: aphrodite.css(styles$M.paddedY)
26750
26788
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.HeadingXSmall, null, "Button Sets"), buttonSetChoices), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.HeadingSmall, null, "Answers"), /*#__PURE__*/React__namespace.createElement("p", {
26751
26789
  style: {
@@ -26791,10 +26829,9 @@ class AnswerOption extends React__namespace.Component {
26791
26829
  });
26792
26830
  };
26793
26831
  toggleConsidered = () => {
26832
+ // Update findNextIn to have stronger typing.
26794
26833
  const newVal = findNextIn(perseus.PerseusExpressionAnswerFormConsidered, this.props.considered);
26795
- this.change({
26796
- considered: newVal
26797
- });
26834
+ this.props.onChangeConsidered(newVal);
26798
26835
  };
26799
26836
  render() {
26800
26837
  const removeButton = this.state.deleteFocused ? /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
@@ -26828,22 +26865,14 @@ class AnswerOption extends React__namespace.Component {
26828
26865
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
26829
26866
  label: "Answer expression must have the same form.",
26830
26867
  checked: this.props.form,
26831
- onChange: value => {
26832
- this.props.onChange({
26833
- form: value
26834
- });
26835
- }
26836
- }), /*#__PURE__*/React__namespace.createElement(InfoTip$j, null, /*#__PURE__*/React__namespace.createElement("p", null, "The student's answer must be in the same form. Commutativity and excess negative signs are ignored."))), /*#__PURE__*/React__namespace.createElement("div", {
26868
+ onChange: this.props.onChangeForm
26869
+ }), /*#__PURE__*/React__namespace.createElement(InfoTip$k, null, /*#__PURE__*/React__namespace.createElement("p", null, "The student's answer must be in the same form. Commutativity and excess negative signs are ignored."))), /*#__PURE__*/React__namespace.createElement("div", {
26837
26870
  className: aphrodite.css(styles$M.paddedY, styles$M.paddedX)
26838
26871
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
26839
26872
  label: "Answer expression must be fully expanded and simplified.",
26840
26873
  checked: this.props.simplify,
26841
- onChange: value => {
26842
- this.props.onChange({
26843
- simplify: value
26844
- });
26845
- }
26846
- }), /*#__PURE__*/React__namespace.createElement(InfoTip$j, null, /*#__PURE__*/React__namespace.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__namespace.createElement("div", {
26874
+ onChange: this.props.onChangeSimplify
26875
+ }), /*#__PURE__*/React__namespace.createElement(InfoTip$k, null, /*#__PURE__*/React__namespace.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__namespace.createElement("div", {
26847
26876
  className: aphrodite.css(styles$M.buttonRow, styles$M.paddedY)
26848
26877
  }, removeButton)));
26849
26878
  }
@@ -27093,7 +27122,7 @@ const setArrayItem = (list, i, value) => [...list.slice(0, i), value, ...list.sl
27093
27122
  /* eslint-disable react/forbid-prop-types, react/no-unsafe */
27094
27123
  const {
27095
27124
  ButtonGroup: ButtonGroup$7,
27096
- InfoTip: InfoTip$i,
27125
+ InfoTip: InfoTip$j,
27097
27126
  RangeInput: RangeInput$6
27098
27127
  } = perseus.components;
27099
27128
  const defaultBackgroundImage$3 = {
@@ -27557,7 +27586,7 @@ const GraphSettings = createReactClass__default["default"]({
27557
27586
  },
27558
27587
  onKeyPress: this.changeBackgroundUrl,
27559
27588
  onBlur: this.changeBackgroundUrl
27560
- }), /*#__PURE__*/React__namespace.createElement(InfoTip$i, null, /*#__PURE__*/React__namespace.createElement("p", null, "Create an image in graphie, or use the \"Add image\" function to create a background.")))), ___default["default"].contains(this.props.editableSettings, "measure") && /*#__PURE__*/React__namespace.createElement("div", {
27589
+ }), /*#__PURE__*/React__namespace.createElement(InfoTip$j, null, /*#__PURE__*/React__namespace.createElement("p", null, "Create an image in graphie, or use the \"Add image\" function to create a background.")))), ___default["default"].contains(this.props.editableSettings, "measure") && /*#__PURE__*/React__namespace.createElement("div", {
27561
27590
  className: "misc-settings"
27562
27591
  }, /*#__PURE__*/React__namespace.createElement("div", {
27563
27592
  className: "perseus-widget-row"
@@ -27603,7 +27632,7 @@ const GraphSettings = createReactClass__default["default"]({
27603
27632
  });
27604
27633
 
27605
27634
  const {
27606
- InfoTip: InfoTip$h,
27635
+ InfoTip: InfoTip$i,
27607
27636
  MultiButtonGroup: MultiButtonGroup$1
27608
27637
  } = perseus.components;
27609
27638
  const Grapher = perseus.GrapherWidget.widget;
@@ -27693,7 +27722,7 @@ class GrapherEditor extends React__namespace.Component {
27693
27722
  className: "perseus-error"
27694
27723
  }, this.props.graph.valid);
27695
27724
  }
27696
- return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", null, "Correct answer", " ", /*#__PURE__*/React__namespace.createElement(InfoTip$h, null, /*#__PURE__*/React__namespace.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__namespace.createElement(GraphSettings, {
27725
+ return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", null, "Correct answer", " ", /*#__PURE__*/React__namespace.createElement(InfoTip$i, null, /*#__PURE__*/React__namespace.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__namespace.createElement(GraphSettings, {
27697
27726
  editableSettings: ["graph", "snap", "image"],
27698
27727
  box: perseus.getInteractiveBoxFromSizeClass(sizeClass),
27699
27728
  range: this.props.graph.range,
@@ -27953,7 +27982,7 @@ class IframeEditor extends React__namespace.Component {
27953
27982
 
27954
27983
  /* eslint-disable jsx-a11y/anchor-is-valid */
27955
27984
  const {
27956
- InfoTip: InfoTip$g,
27985
+ InfoTip: InfoTip$h,
27957
27986
  InlineIcon: InlineIcon$3,
27958
27987
  RangeInput: RangeInput$5
27959
27988
  } = perseus.components;
@@ -28154,7 +28183,7 @@ class ImageEditor extends React__namespace.Component {
28154
28183
  style: {
28155
28184
  width: "100%"
28156
28185
  }
28157
- }))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, /*#__PURE__*/React__namespace.createElement("div", null, "Dimensions:"), /*#__PURE__*/React__namespace.createElement("p", null, backgroundImage.width, "x", backgroundImage.height))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, /*#__PURE__*/React__namespace.createElement("div", null, "Alt text:", /*#__PURE__*/React__namespace.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__namespace.createElement(Editor, {
28186
+ }))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, /*#__PURE__*/React__namespace.createElement("div", null, "Dimensions:"), /*#__PURE__*/React__namespace.createElement("p", null, backgroundImage.width, "x", backgroundImage.height))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, /*#__PURE__*/React__namespace.createElement("div", null, "Alt text:", /*#__PURE__*/React__namespace.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__namespace.createElement(Editor, {
28158
28187
  apiOptions: this.props.apiOptions,
28159
28188
  content: this.props.alt,
28160
28189
  onChange: props => {
@@ -28178,7 +28207,7 @@ class ImageEditor extends React__namespace.Component {
28178
28207
  }, this.state.backgroundImageError);
28179
28208
  return /*#__PURE__*/React__namespace.createElement("div", {
28180
28209
  className: "perseus-image-editor"
28181
- }, /*#__PURE__*/React__namespace.createElement("label", null, "Image url:", /*#__PURE__*/React__namespace.createElement(InfoTip$g, null, "Paste an image or graphie image URL."), this.state.backgroundImageError && backgroundImageErrorText, /*#__PURE__*/React__namespace.createElement(BlurInput, {
28210
+ }, /*#__PURE__*/React__namespace.createElement("label", null, "Image url:", /*#__PURE__*/React__namespace.createElement(InfoTip$h, null, "Paste an image or graphie image URL."), this.state.backgroundImageError && backgroundImageErrorText, /*#__PURE__*/React__namespace.createElement(BlurInput, {
28182
28211
  value: backgroundImage.url || "",
28183
28212
  style: {
28184
28213
  width: 332
@@ -28189,7 +28218,7 @@ class ImageEditor extends React__namespace.Component {
28189
28218
  }
28190
28219
 
28191
28220
  const {
28192
- InfoTip: InfoTip$f
28221
+ InfoTip: InfoTip$g
28193
28222
  } = perseus.components;
28194
28223
  const answerTypes = {
28195
28224
  number: {
@@ -28282,7 +28311,7 @@ class InputNumberEditor extends React__namespace.Component {
28282
28311
  value: "optional"
28283
28312
  }, "will be accepted"), /*#__PURE__*/React__namespace.createElement("option", {
28284
28313
  value: "enforced"
28285
- }, "will be marked wrong"))), /*#__PURE__*/React__namespace.createElement(InfoTip$f, null, /*#__PURE__*/React__namespace.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__namespace.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__namespace.createElement("p", null, "Select \"will be marked wrong\" only if we are specifically assessing the ability to simplify."))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, /*#__PURE__*/React__namespace.createElement("input", {
28314
+ }, "will be marked wrong"))), /*#__PURE__*/React__namespace.createElement(InfoTip$g, null, /*#__PURE__*/React__namespace.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__namespace.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__namespace.createElement("p", null, "Select \"will be marked wrong\" only if we are specifically assessing the ability to simplify."))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, /*#__PURE__*/React__namespace.createElement("input", {
28286
28315
  type: "checkbox",
28287
28316
  checked: this.props.inexact,
28288
28317
  onChange: e => {
@@ -28318,7 +28347,7 @@ class InputNumberEditor extends React__namespace.Component {
28318
28347
  });
28319
28348
  },
28320
28349
  "aria-label": "Answer type"
28321
- }, answerTypeOptions), /*#__PURE__*/React__namespace.createElement(InfoTip$f, null, /*#__PURE__*/React__namespace.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__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Width", " ", /*#__PURE__*/React__namespace.createElement("select", {
28350
+ }, answerTypeOptions), /*#__PURE__*/React__namespace.createElement(InfoTip$g, null, /*#__PURE__*/React__namespace.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__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Width", " ", /*#__PURE__*/React__namespace.createElement("select", {
28322
28351
  value: this.props.size,
28323
28352
  onChange: e => {
28324
28353
  // @ts-expect-error - TS2322 - Type 'string' is not assignable to type '"small" | "normal" | undefined'.
@@ -28330,7 +28359,7 @@ class InputNumberEditor extends React__namespace.Component {
28330
28359
  value: "normal"
28331
28360
  }, "Normal (80px)"), /*#__PURE__*/React__namespace.createElement("option", {
28332
28361
  value: "small"
28333
- }, "Small (40px)"))), /*#__PURE__*/React__namespace.createElement(InfoTip$f, null, /*#__PURE__*/React__namespace.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__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, /*#__PURE__*/React__namespace.createElement("input", {
28362
+ }, "Small (40px)"))), /*#__PURE__*/React__namespace.createElement(InfoTip$g, null, /*#__PURE__*/React__namespace.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__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, /*#__PURE__*/React__namespace.createElement("input", {
28334
28363
  type: "checkbox",
28335
28364
  checked: this.props.rightAlign,
28336
28365
  onChange: e => {
@@ -29857,7 +29886,7 @@ const styles$F = aphrodite.StyleSheet.create({
29857
29886
  /* eslint-disable react/forbid-prop-types, react/no-unsafe */
29858
29887
  const {
29859
29888
  ButtonGroup: ButtonGroup$2,
29860
- InfoTip: InfoTip$e,
29889
+ InfoTip: InfoTip$f,
29861
29890
  RangeInput: RangeInput$4
29862
29891
  } = perseus.components;
29863
29892
  const defaultBackgroundImage$1 = {
@@ -30273,7 +30302,7 @@ class InteractiveGraphSettings extends React__namespace.Component {
30273
30302
  },
30274
30303
  onKeyPress: this.changeBackgroundUrl,
30275
30304
  onBlur: this.changeBackgroundUrl
30276
- }), /*#__PURE__*/React__namespace.createElement(InfoTip$e, null, /*#__PURE__*/React__namespace.createElement("p", null, "Create an image in graphie, or use the \"Add image\" function to create a background."))), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30305
+ }), /*#__PURE__*/React__namespace.createElement(InfoTip$f, null, /*#__PURE__*/React__namespace.createElement("p", null, "Create an image in graphie, or use the \"Add image\" function to create a background."))), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30277
30306
  style: styles$E.protractorSection
30278
30307
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30279
30308
  style: styles$E.checkboxRow
@@ -30775,7 +30804,7 @@ const styles$v = aphrodite.StyleSheet.create({
30775
30804
  });
30776
30805
 
30777
30806
  const {
30778
- InfoTip: InfoTip$d
30807
+ InfoTip: InfoTip$e
30779
30808
  } = perseus.components;
30780
30809
  function LockedFigureAria(props) {
30781
30810
  const {
@@ -30792,7 +30821,7 @@ function LockedFigureAria(props) {
30792
30821
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30793
30822
  tag: "label",
30794
30823
  htmlFor: ariaLabelId
30795
- }, "Aria label"), /*#__PURE__*/React__namespace.createElement(Spring, null), /*#__PURE__*/React__namespace.createElement(InfoTip$d, null, "Aria label is used by screen readers to describe content to users who may be visually impaired. ", /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.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__namespace.createElement("br", null), /*#__PURE__*/React__namespace.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__namespace.createElement(Strut, {
30824
+ }, "Aria label"), /*#__PURE__*/React__namespace.createElement(Spring, null), /*#__PURE__*/React__namespace.createElement(InfoTip$e, null, "Aria label is used by screen readers to describe content to users who may be visually impaired. ", /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.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__namespace.createElement("br", null), /*#__PURE__*/React__namespace.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__namespace.createElement(Strut, {
30796
30825
  size: wonderBlocksTokens.spacing.xxSmall_6
30797
30826
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelXSmall, {
30798
30827
  style: styles$u.caption
@@ -30904,6 +30933,9 @@ const styles$t = aphrodite.StyleSheet.create({
30904
30933
  *
30905
30934
  * Used in the interactive graph editor's locked figures section.
30906
30935
  */
30936
+ const {
30937
+ InfoTip: InfoTip$d
30938
+ } = perseus.components;
30907
30939
  function LockedLabelSettings(props) {
30908
30940
  const {
30909
30941
  type,
@@ -30940,10 +30972,14 @@ function LockedLabelSettings(props) {
30940
30972
  });
30941
30973
  },
30942
30974
  style: styles$s.spaceUnder
30943
- }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30975
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30976
+ style: styles$s.row
30977
+ }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30944
30978
  tag: "label",
30945
- style: [styles$s.row, styles$s.spaceUnder]
30946
- }, "TeX", /*#__PURE__*/React__namespace.createElement(Strut, {
30979
+ style: [styles$s.row, styles$s.spaceUnder, {
30980
+ flexGrow: 1
30981
+ }]
30982
+ }, "text", /*#__PURE__*/React__namespace.createElement(Strut, {
30947
30983
  size: wonderBlocksTokens.spacing.xSmall_8
30948
30984
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
30949
30985
  value: text,
@@ -30951,7 +30987,7 @@ function LockedLabelSettings(props) {
30951
30987
  onChange: newValue => onChangeProps({
30952
30988
  text: newValue
30953
30989
  })
30954
- })), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30990
+ })), /*#__PURE__*/React__namespace.createElement(InfoTip$d, null, "Surround your text with $ for TeX.", /*#__PURE__*/React__namespace.createElement("br", null), "Example: ", `This circle has radius $\\frac{1}{2}$ units.`, /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.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__namespace.createElement(wonderBlocksCore.View, {
30955
30991
  style: styles$s.row
30956
30992
  }, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
30957
30993
  selectedValue: color,
@@ -33987,8 +34023,7 @@ class InteractiveGraphEditor extends React__namespace.Component {
33987
34023
  // value for `match`; a value of undefined
33988
34024
  // means exact matching. The code happens
33989
34025
  // to work because "exact" falls through
33990
- // to the correct else branch in
33991
- // InteractiveGraph.validate()
34026
+ // to the correct else branch when scoring
33992
34027
  match: newValue
33993
34028
  };
33994
34029
  this.props.onChange({
@@ -34024,8 +34059,7 @@ class InteractiveGraphEditor extends React__namespace.Component {
34024
34059
  // value for `match`; a value of undefined
34025
34060
  // means exact matching. The code happens
34026
34061
  // to work because "exact" falls through
34027
- // to the correct else branch in
34028
- // InteractiveGraph.validate()
34062
+ // to the correct else branch when scoring
34029
34063
  match: newValue
34030
34064
  }
34031
34065
  });