@khanacademy/perseus-editor 10.0.0 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { addLibraryVersionToPerseusDebug, PerseusError, Errors } from '@khanacademy/perseus-core';
2
- import { constants, components, Widgets, icons, WIDGET_PROP_DENYLIST, Util, Log, PerseusMarkdown, preprocessTex, ApiOptions, buildMapper, itemToTree, buildEmptyItemTreeForShape, shapes, ItemExtras, itemDataVersion, ClassNames, MultiItems, traverse, Categorizer as Categorizer$1, Changeable, EditorJsonify, Dependencies, WidgetJsonifyDeprecated, PerseusExpressionAnswerFormConsidered, Expression, interactiveSizes, KhanMath, GrapherWidget, GrapherUtil, SizingUtils, PerseusI18nContext, KhanColors, ColorPicker, DashPicker, ArrowPicker, ElementContainer, lockedFigureColors, lockedFigureFillStyles, getLineCoords, InteractiveGraphWidget, globalStyles, globalConstants, MatrixWidget, PlotterWidget, plotterPlotTypes, BaseRadio, TableWidget, displaySigFigs, widgets } from '@khanacademy/perseus';
2
+ import { constants, components, Widgets, icons, WIDGET_PROP_DENYLIST, Util, Log, PerseusMarkdown, preprocessTex, ApiOptions, buildMapper, itemToTree, buildEmptyItemTreeForShape, shapes, ItemExtras, itemDataVersion, ClassNames, MultiItems, traverse, Categorizer as Categorizer$1, Changeable, EditorJsonify, Dependencies, WidgetJsonifyDeprecated, PerseusExpressionAnswerFormConsidered, Expression, interactiveSizes, KhanMath, GrapherWidget, GrapherUtil, SizingUtils, PerseusI18nContext, KhanColors, ColorPicker, DashPicker, ArrowPicker, ElementContainer, getLinearSystemCoords, getSegmentCoords, getLineCoords, lockedFigureColors, lockedFigureFillStyles, InteractiveGraphWidget, globalStyles, globalConstants, MatrixWidget, PlotterWidget, plotterPlotTypes, BaseRadio, TableWidget, widgets } from '@khanacademy/perseus';
3
3
  import * as React from 'react';
4
4
  import { useRef, useEffect } from 'react';
5
5
  import _ from 'underscore';
@@ -37,7 +37,7 @@ import arrowCounterClockwise from '@phosphor-icons/core/bold/arrow-counter-clock
37
37
 
38
38
  // This file is processed by a Rollup plugin (replace) to inject the production
39
39
  const libName = "@khanacademy/perseus-editor";
40
- const libVersion = "10.0.0";
40
+ const libVersion = "11.0.0";
41
41
  addLibraryVersionToPerseusDebug(libName, libVersion);
42
42
 
43
43
  function _extends() {
@@ -209,7 +209,7 @@ const JsonEditor = createReactClass({
209
209
  });
210
210
 
211
211
  const {
212
- InlineIcon: InlineIcon$b
212
+ InlineIcon: InlineIcon$a
213
213
  } = components;
214
214
  class SectionControlButton extends React.Component {
215
215
  render() {
@@ -227,15 +227,15 @@ class SectionControlButton extends React.Component {
227
227
  role: "button",
228
228
  hideDefaultFocusRing: true,
229
229
  "aria-label": title,
230
- style: styles$G.button
230
+ style: styles$I.button
231
231
  }, ({
232
232
  hovered,
233
233
  focused,
234
234
  pressed
235
- }) => /*#__PURE__*/React.createElement(InlineIcon$b, icon));
235
+ }) => /*#__PURE__*/React.createElement(InlineIcon$a, icon));
236
236
  }
237
237
  }
238
- const styles$G = StyleSheet.create({
238
+ const styles$I = StyleSheet.create({
239
239
  button: {
240
240
  backgroundColor: color.gold,
241
241
  margin: 2,
@@ -20558,7 +20558,7 @@ const DragTarget = createReactClass({
20558
20558
  });
20559
20559
 
20560
20560
  const {
20561
- InlineIcon: InlineIcon$a
20561
+ InlineIcon: InlineIcon$9
20562
20562
  } = components;
20563
20563
  const {
20564
20564
  iconChevronDown: iconChevronDown$1,
@@ -20665,7 +20665,7 @@ class WidgetEditor extends React.Component {
20665
20665
  className: "perseus-widget-editor-title-id",
20666
20666
  href: "#",
20667
20667
  onClick: this._toggleWidget
20668
- }, this.props.id, this.state.showWidget ? /*#__PURE__*/React.createElement(InlineIcon$a, iconChevronDown$1) : /*#__PURE__*/React.createElement(InlineIcon$a, iconChevronRight)), supportsStaticMode && /*#__PURE__*/React.createElement("input", {
20668
+ }, this.props.id, this.state.showWidget ? /*#__PURE__*/React.createElement(InlineIcon$9, iconChevronDown$1) : /*#__PURE__*/React.createElement(InlineIcon$9, iconChevronRight)), supportsStaticMode && /*#__PURE__*/React.createElement("input", {
20669
20669
  type: "button"
20670
20670
  // @ts-expect-error - TS2322 - Type '(e: Event) => void' is not assignable to type 'MouseEventHandler<HTMLInputElement>'.
20671
20671
  ,
@@ -20740,13 +20740,13 @@ class WidgetSelect extends React.Component {
20740
20740
  * that collapse a region.
20741
20741
  */
20742
20742
  function ToggleableCaret(props) {
20743
- const iconStyle = props.isExpanded ? styles$F.expanded : styles$F.collapsed;
20743
+ const iconStyle = props.isExpanded ? styles$H.expanded : styles$H.collapsed;
20744
20744
  return /*#__PURE__*/React.createElement(PhosphorIcon, {
20745
20745
  icon: caretRight,
20746
20746
  style: iconStyle
20747
20747
  });
20748
20748
  }
20749
- const styles$F = StyleSheet.create({
20749
+ const styles$H = StyleSheet.create({
20750
20750
  collapsed: {
20751
20751
  transition: ".15s"
20752
20752
  },
@@ -20779,16 +20779,16 @@ class TexErrorView extends React.Component {
20779
20779
  showErrors
20780
20780
  } = this.state;
20781
20781
  return /*#__PURE__*/React.createElement(View, {
20782
- style: styles$E.errorContainer
20782
+ style: styles$G.errorContainer
20783
20783
  }, /*#__PURE__*/React.createElement(View, {
20784
- style: styles$E.title,
20784
+ style: styles$G.title,
20785
20785
  onClick: this.handleToggleTexErrors
20786
20786
  }, /*#__PURE__*/React.createElement(ToggleableCaret, {
20787
20787
  isExpanded: showErrors
20788
20788
  }), "\xA0 TeX Errors (", errorList.length, ")"), showErrors && /*#__PURE__*/React.createElement(View, {
20789
- style: styles$E.errorExplanation
20789
+ style: styles$G.errorExplanation
20790
20790
  }, "If your math doesn't display correctly, these errors might help you troubleshoot. Message #content-kitchen for help."), showErrors && errorList.map((e, index) => /*#__PURE__*/React.createElement(View, {
20791
- style: styles$E.error,
20791
+ style: styles$G.error,
20792
20792
  key: index
20793
20793
  }, /*#__PURE__*/React.createElement(View, {
20794
20794
  style: {
@@ -20797,7 +20797,7 @@ class TexErrorView extends React.Component {
20797
20797
  }, e.math), /*#__PURE__*/React.createElement(View, null, e.message))));
20798
20798
  }
20799
20799
  }
20800
- const styles$E = StyleSheet.create({
20800
+ const styles$G = StyleSheet.create({
20801
20801
  title: {
20802
20802
  backgroundColor: "#eee",
20803
20803
  fontSize: "1.25em",
@@ -21786,7 +21786,7 @@ class IframeContentRenderer extends React.Component {
21786
21786
 
21787
21787
  const {
21788
21788
  HUD: HUD$1,
21789
- InlineIcon: InlineIcon$9
21789
+ InlineIcon: InlineIcon$8
21790
21790
  } = components;
21791
21791
  const {
21792
21792
  iconCircleArrowDown: iconCircleArrowDown$1,
@@ -21945,7 +21945,7 @@ class ArticleEditor extends React.Component {
21945
21945
  onClick: () => {
21946
21946
  this._handleAddSectionAfter(this._sections().length - 1);
21947
21947
  }
21948
- }, /*#__PURE__*/React.createElement(InlineIcon$9, iconPlus$4), " Add a section")));
21948
+ }, /*#__PURE__*/React.createElement(InlineIcon$8, iconPlus$4), " Add a section")));
21949
21949
  }
21950
21950
  _renderLinterHUD() {
21951
21951
  return /*#__PURE__*/React.createElement(HUD$1, {
@@ -22093,7 +22093,7 @@ ArticleEditor.defaultProps = {
22093
22093
  */
22094
22094
  const {
22095
22095
  ButtonGroup: ButtonGroup$5,
22096
- InlineIcon: InlineIcon$8
22096
+ InlineIcon: InlineIcon$7
22097
22097
  } = components;
22098
22098
  const {
22099
22099
  devices
@@ -22104,9 +22104,9 @@ const {
22104
22104
  iconTablet
22105
22105
  } = icons;
22106
22106
  const ViewportResizer = props => {
22107
- const phoneButtonContents = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(InlineIcon$8, iconMobilePhone), " Phone");
22108
- const tabletButtonContents = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(InlineIcon$8, iconTablet), " Tablet");
22109
- const desktopButtonContents = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(InlineIcon$8, iconDesktop), " Desktop");
22107
+ const phoneButtonContents = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(InlineIcon$7, iconMobilePhone), " Phone");
22108
+ const tabletButtonContents = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(InlineIcon$7, iconTablet), " Tablet");
22109
+ const desktopButtonContents = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(InlineIcon$7, iconDesktop), " Desktop");
22110
22110
 
22111
22111
  // TODO(david): Allow input of custom viewport sizes.
22112
22112
  return /*#__PURE__*/React.createElement("span", {
@@ -23454,7 +23454,7 @@ class StructuredItemDiff extends React.Component {
23454
23454
  /* eslint-disable @khanacademy/ts-no-error-suppressions */
23455
23455
  const {
23456
23456
  InfoTip: InfoTip$m,
23457
- InlineIcon: InlineIcon$7
23457
+ InlineIcon: InlineIcon$6
23458
23458
  } = components;
23459
23459
  const {
23460
23460
  iconCircleArrowDown,
@@ -23521,11 +23521,11 @@ class HintEditor extends React.Component {
23521
23521
  type: "button",
23522
23522
  className: this.props.isLast ? "hidden" : "",
23523
23523
  onClick: _.partial(this.props.onMove, 1)
23524
- }, /*#__PURE__*/React.createElement(InlineIcon$7, iconCircleArrowDown)), " ", /*#__PURE__*/React.createElement("button", {
23524
+ }, /*#__PURE__*/React.createElement(InlineIcon$6, iconCircleArrowDown)), " ", /*#__PURE__*/React.createElement("button", {
23525
23525
  type: "button",
23526
23526
  className: this.props.isFirst ? "hidden" : "",
23527
23527
  onClick: _.partial(this.props.onMove, -1)
23528
- }, /*#__PURE__*/React.createElement(InlineIcon$7, iconCircleArrowUp)), " ", this.props.isLast && /*#__PURE__*/React.createElement(InfoTip$m, null, /*#__PURE__*/React.createElement("p", null, "The last hint is automatically bolded."))), /*#__PURE__*/React.createElement("input", {
23528
+ }, /*#__PURE__*/React.createElement(InlineIcon$6, iconCircleArrowUp)), " ", this.props.isLast && /*#__PURE__*/React.createElement(InfoTip$m, null, /*#__PURE__*/React.createElement("p", null, "The last hint is automatically bolded."))), /*#__PURE__*/React.createElement("input", {
23529
23529
  type: "checkbox"
23530
23530
  // @ts-expect-error - TS2322 - Type 'boolean | null | undefined' is not assignable to type 'boolean | undefined'.
23531
23531
  ,
@@ -23535,7 +23535,7 @@ class HintEditor extends React.Component {
23535
23535
  type: "button",
23536
23536
  className: "remove-hint simple-button orange",
23537
23537
  onClick: this.props.onRemove
23538
- }, /*#__PURE__*/React.createElement(InlineIcon$7, iconTrash$5), "Remove this hint", " ")));
23538
+ }, /*#__PURE__*/React.createElement(InlineIcon$6, iconTrash$5), "Remove this hint", " ")));
23539
23539
  }
23540
23540
  }
23541
23541
  HintEditor.defaultProps = {
@@ -23766,7 +23766,7 @@ class CombinedHintsEditor extends React.Component {
23766
23766
  type: "button",
23767
23767
  className: "add-hint simple-button orange",
23768
23768
  onClick: this.addHint
23769
- }, /*#__PURE__*/React.createElement(InlineIcon$7, iconPlus$3), " Add a hint"))));
23769
+ }, /*#__PURE__*/React.createElement(InlineIcon$6, iconPlus$3), " Add a hint"))));
23770
23770
  /* eslint-enable max-len */
23771
23771
  }
23772
23772
  }
@@ -24591,7 +24591,7 @@ class SimpleButton extends React.Component {
24591
24591
  } = _this$props,
24592
24592
  otherProps = _objectWithoutPropertiesLoose(_this$props, _excluded$3);
24593
24593
  return /*#__PURE__*/React.createElement("div", _extends({
24594
- className: css(styles$D.baseButton, color === "green" && styles$D.green, color === "orange" && styles$D.orange),
24594
+ className: css(styles$F.baseButton, color === "green" && styles$F.green, color === "orange" && styles$F.orange),
24595
24595
  onClick: onClick
24596
24596
  }, otherProps), children);
24597
24597
  }
@@ -24606,7 +24606,7 @@ SimpleButton.defaultProps = {
24606
24606
  color: "green",
24607
24607
  onClick: () => {}
24608
24608
  };
24609
- const styles$D = StyleSheet.create({
24609
+ const styles$F = StyleSheet.create({
24610
24610
  baseButton: {
24611
24611
  top: "0",
24612
24612
  fontSize: "11px",
@@ -24656,7 +24656,7 @@ const _excluded$2 = ["depth"],
24656
24656
  _excluded4 = ["shape", "data", "path", "actions"],
24657
24657
  _excluded5 = ["shape", "data", "path"];
24658
24658
  const {
24659
- InlineIcon: InlineIcon$6
24659
+ InlineIcon: InlineIcon$5
24660
24660
  } = components;
24661
24661
  const {
24662
24662
  iconChevronDown,
@@ -24826,23 +24826,23 @@ const LeafContainer = ({
24826
24826
  }) => {
24827
24827
  const hasPreviewHeading = shape.type === "content" || shape.type === "hint";
24828
24828
  const previewHeading = hasPreviewHeading && /*#__PURE__*/React.createElement("div", {
24829
- className: css(styles$C.containerHeader)
24829
+ className: css(styles$E.containerHeader)
24830
24830
  }, /*#__PURE__*/React.createElement(Header, {
24831
24831
  depth: path.length,
24832
- className: css(styles$C.containerTitle)
24832
+ className: css(styles$E.containerTitle)
24833
24833
  }, capitalize(name)));
24834
24834
  return /*#__PURE__*/React.createElement("div", {
24835
- className: css(styles$C.container)
24835
+ className: css(styles$E.container)
24836
24836
  }, /*#__PURE__*/React.createElement("span", {
24837
- className: css(styles$C.row, styles$C.rowHeading)
24837
+ className: css(styles$E.row, styles$E.rowHeading)
24838
24838
  }, /*#__PURE__*/React.createElement("div", {
24839
- className: css(styles$C.columnLeft)
24839
+ className: css(styles$E.columnLeft)
24840
24840
  }, /*#__PURE__*/React.createElement("div", {
24841
- className: "pod-title " + css(styles$C.containerHeader)
24841
+ className: "pod-title " + css(styles$E.containerHeader)
24842
24842
  }, /*#__PURE__*/React.createElement("div", {
24843
- className: css(styles$C.containerTitle)
24843
+ className: css(styles$E.containerTitle)
24844
24844
  }, capitalize(name)), controls)), /*#__PURE__*/React.createElement("div", {
24845
- className: css(styles$C.columnRight)
24845
+ className: css(styles$E.columnRight)
24846
24846
  }, previewHeading)), children);
24847
24847
  };
24848
24848
  const ArrayContainer = props => {
@@ -24855,11 +24855,11 @@ const ArrayContainer = props => {
24855
24855
  actions
24856
24856
  } = props;
24857
24857
  return /*#__PURE__*/React.createElement("div", {
24858
- className: css(styles$C.container)
24858
+ className: css(styles$E.container)
24859
24859
  }, controls && /*#__PURE__*/React.createElement("div", {
24860
- className: css(styles$C.columnLeft, styles$C.containerHeader)
24860
+ className: css(styles$E.columnLeft, styles$E.containerHeader)
24861
24861
  }, controls), /*#__PURE__*/React.createElement("div", null, children), /*#__PURE__*/React.createElement("div", {
24862
- className: css(styles$C.columnLeft)
24862
+ className: css(styles$E.columnLeft)
24863
24863
  }, /*#__PURE__*/React.createElement("a", {
24864
24864
  href: "javascript:void 0",
24865
24865
  onClick: () => actions.addArrayElement(path, shape.elementShape)
@@ -24872,28 +24872,28 @@ const ObjectContainer = ({
24872
24872
  path
24873
24873
  }) => {
24874
24874
  const headingEditor = /*#__PURE__*/React.createElement("div", {
24875
- className: css(styles$C.containerHeader)
24875
+ className: css(styles$E.containerHeader)
24876
24876
  }, /*#__PURE__*/React.createElement(Header, {
24877
24877
  depth: path.length,
24878
- className: css(styles$C.containerTitle)
24878
+ className: css(styles$E.containerTitle)
24879
24879
  }, capitalize(name)), controls);
24880
24880
  const headingPreview = (name || controls) && /*#__PURE__*/React.createElement("div", {
24881
- className: css(styles$C.containerHeader, styles$C.previewCollectionHeader)
24881
+ className: css(styles$E.containerHeader, styles$E.previewCollectionHeader)
24882
24882
  }, /*#__PURE__*/React.createElement(Header, {
24883
24883
  depth: path.length,
24884
- className: css(styles$C.containerTitle)
24884
+ className: css(styles$E.containerTitle)
24885
24885
  }, capitalize(name)));
24886
24886
  const hasBothHeadings = headingEditor && headingPreview;
24887
24887
  return /*#__PURE__*/React.createElement("div", {
24888
- className: css(styles$C.container)
24888
+ className: css(styles$E.container)
24889
24889
  }, hasBothHeadings && /*#__PURE__*/React.createElement("span", {
24890
- className: css(styles$C.row)
24890
+ className: css(styles$E.row)
24891
24891
  }, /*#__PURE__*/React.createElement("div", {
24892
- className: css(styles$C.columnLeft)
24892
+ className: css(styles$E.columnLeft)
24893
24893
  }, headingEditor), /*#__PURE__*/React.createElement("div", {
24894
- className: css(styles$C.columnRight)
24894
+ className: css(styles$E.columnRight)
24895
24895
  }, headingPreview)), /*#__PURE__*/React.createElement("div", {
24896
- className: css(path.length > 0 && styles$C.contentIndent)
24896
+ className: css(path.length > 0 && styles$E.contentIndent)
24897
24897
  }, children));
24898
24898
  };
24899
24899
 
@@ -25016,11 +25016,11 @@ const ItemNodeContent = withStickiness(props => {
25016
25016
  className: "framework-perseus"
25017
25017
  }, lens(renderers).get(path));
25018
25018
  return /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("div", {
25019
- className: css(styles$C.row)
25019
+ className: css(styles$E.row)
25020
25020
  }, /*#__PURE__*/React.createElement("div", {
25021
- className: css(styles$C.columnLeft)
25021
+ className: css(styles$E.columnLeft)
25022
25022
  }, /*#__PURE__*/React.createElement("div", {
25023
- className: css(sticky && styles$C.sticky)
25023
+ className: css(sticky && styles$E.sticky)
25024
25024
  },
25025
25025
  /*#__PURE__*/
25026
25026
  // @ts-expect-error - TS2769 - No overload matches this call.
@@ -25028,9 +25028,9 @@ const ItemNodeContent = withStickiness(props => {
25028
25028
  onChange: newVal => actions.mergeValueAtPath(path, newVal),
25029
25029
  apiOptions: apiOptions
25030
25030
  })))), /*#__PURE__*/React.createElement("div", {
25031
- className: css(styles$C.columnRight)
25031
+ className: css(styles$E.columnRight)
25032
25032
  }, /*#__PURE__*/React.createElement("div", {
25033
- className: css(sticky && styles$C.sticky)
25033
+ className: css(sticky && styles$E.sticky)
25034
25034
  }, preview))));
25035
25035
  });
25036
25036
  const HintNodeContent = withStickiness(props => {
@@ -25046,13 +25046,13 @@ const HintNodeContent = withStickiness(props => {
25046
25046
  className: "framework-perseus"
25047
25047
  }, lens(renderers).get(path));
25048
25048
  return /*#__PURE__*/React.createElement("div", {
25049
- className: css(styles$C.row)
25049
+ className: css(styles$E.row)
25050
25050
  }, /*#__PURE__*/React.createElement("div", {
25051
- className: css(styles$C.columnLeft)
25051
+ className: css(styles$E.columnLeft)
25052
25052
  }, /*#__PURE__*/React.createElement("div", {
25053
- className: css(sticky && styles$C.sticky)
25053
+ className: css(sticky && styles$E.sticky)
25054
25054
  }, /*#__PURE__*/React.createElement(HintEditor, _extends({}, data, {
25055
- className: css(styles$C.hintEditor),
25055
+ className: css(styles$E.hintEditor),
25056
25056
  onChange: newVal => actions.mergeValueAtPath(path, newVal),
25057
25057
  apiOptions: apiOptions,
25058
25058
  showTitle: false,
@@ -25067,9 +25067,9 @@ const HintNodeContent = withStickiness(props => {
25067
25067
  isFirst: true,
25068
25068
  isLast: true
25069
25069
  })))), /*#__PURE__*/React.createElement("div", {
25070
- className: css(styles$C.columnRight)
25070
+ className: css(styles$E.columnRight)
25071
25071
  }, /*#__PURE__*/React.createElement("div", {
25072
- className: css(sticky && styles$C.sticky)
25072
+ className: css(sticky && styles$E.sticky)
25073
25073
  }, preview)));
25074
25074
  });
25075
25075
  const TagsNodeContent = props => {
@@ -25086,9 +25086,9 @@ const TagsNodeContent = props => {
25086
25086
  return null;
25087
25087
  }
25088
25088
  return /*#__PURE__*/React.createElement("div", {
25089
- className: css(styles$C.columnLeft)
25089
+ className: css(styles$E.columnLeft)
25090
25090
  }, /*#__PURE__*/React.createElement("div", {
25091
- className: css(styles$C.tagsEditor)
25091
+ className: css(styles$E.tagsEditor)
25092
25092
  }, /*#__PURE__*/React.createElement(GroupMetadataEditor, {
25093
25093
  value: data,
25094
25094
  onChange: newVal => actions.setValueAtPath(path, newVal),
@@ -25119,31 +25119,31 @@ const ArrayNodeContent = props => {
25119
25119
  const subpath = path.concat(i);
25120
25120
  const controls = [i > 0 && /*#__PURE__*/React.createElement("div", {
25121
25121
  key: "moveArrayElementUp",
25122
- className: css(styles$C.control)
25122
+ className: css(styles$E.control)
25123
25123
  }, /*#__PURE__*/React.createElement(SimpleButton, {
25124
25124
  color: "orange",
25125
25125
  title: "Move up",
25126
25126
  onClick: () => actions.moveArrayElementUp(subpath)
25127
25127
  }, /*#__PURE__*/React.createElement("div", {
25128
- className: css(styles$C.verticalFlip)
25129
- }, /*#__PURE__*/React.createElement(InlineIcon$6, iconChevronDown)))), i < data.length - 1 && /*#__PURE__*/React.createElement("div", {
25128
+ className: css(styles$E.verticalFlip)
25129
+ }, /*#__PURE__*/React.createElement(InlineIcon$5, iconChevronDown)))), i < data.length - 1 && /*#__PURE__*/React.createElement("div", {
25130
25130
  key: "moveArrayElementDown",
25131
- className: css(styles$C.control)
25131
+ className: css(styles$E.control)
25132
25132
  }, /*#__PURE__*/React.createElement(SimpleButton, {
25133
25133
  color: "orange",
25134
25134
  title: "Move down",
25135
25135
  onClick: () => actions.moveArrayElementDown(subpath)
25136
- }, /*#__PURE__*/React.createElement(InlineIcon$6, iconChevronDown))), /*#__PURE__*/React.createElement("div", {
25136
+ }, /*#__PURE__*/React.createElement(InlineIcon$5, iconChevronDown))), /*#__PURE__*/React.createElement("div", {
25137
25137
  key: "removeArrayElement",
25138
- className: css(styles$C.control)
25138
+ className: css(styles$E.control)
25139
25139
  }, /*#__PURE__*/React.createElement(SimpleButton, {
25140
25140
  color: "orange",
25141
25141
  title: "Delete",
25142
25142
  onClick: () => actions.removeArrayElement(subpath)
25143
- }, /*#__PURE__*/React.createElement(InlineIcon$6, iconTrash$4)))];
25143
+ }, /*#__PURE__*/React.createElement(InlineIcon$5, iconTrash$4)))];
25144
25144
  return /*#__PURE__*/React.createElement("div", {
25145
25145
  key: i,
25146
- className: css(styles$C.arrayElement, !elementIsLeaf && styles$C.arrayElementAndNotLeaf)
25146
+ className: css(styles$E.arrayElement, !elementIsLeaf && styles$E.arrayElementAndNotLeaf)
25147
25147
  }, /*#__PURE__*/React.createElement(NodeContainer, _extends({}, otherProps, {
25148
25148
  key: i,
25149
25149
  shape: shape.elementShape,
@@ -25169,7 +25169,7 @@ const ObjectNodeContent = props => {
25169
25169
  // made sense to the shape's author is the order in which we'll iterate :)
25170
25170
  const children = Object.keys(shape.shape).map(subkey => /*#__PURE__*/React.createElement("div", {
25171
25171
  key: subkey,
25172
- className: css(styles$C.objectElement)
25172
+ className: css(styles$E.objectElement)
25173
25173
  }, /*#__PURE__*/React.createElement(NodeContainer, _extends({}, otherProps, {
25174
25174
  shape: shape.shape[subkey],
25175
25175
  data: data[subkey],
@@ -25336,7 +25336,7 @@ class MultiRendererEditor extends React.Component {
25336
25336
  }, this._renderContent());
25337
25337
  }
25338
25338
  }
25339
- const styles$C = StyleSheet.create({
25339
+ const styles$E = StyleSheet.create({
25340
25340
  // This is used in a number of places throughout this file.
25341
25341
  container: {},
25342
25342
  // eslint-disable-next-line react-native/no-unused-styles
@@ -25885,7 +25885,7 @@ DeprecatedStandinEditor.widgetName = "deprecated-standin";
25885
25885
  /* eslint-disable @khanacademy/ts-no-error-suppressions */
25886
25886
  const {
25887
25887
  InfoTip: InfoTip$j,
25888
- InlineIcon: InlineIcon$5
25888
+ InlineIcon: InlineIcon$4
25889
25889
  } = components;
25890
25890
  const {
25891
25891
  iconPlus: iconPlus$2,
@@ -26005,14 +26005,14 @@ class DropdownEditor extends React.Component {
26005
26005
  this, i)
26006
26006
  }, /*#__PURE__*/React.createElement("span", {
26007
26007
  className: "remove-choice"
26008
- }, /*#__PURE__*/React.createElement(InlineIcon$5, iconTrash$3)))));
26008
+ }, /*#__PURE__*/React.createElement(InlineIcon$4, iconTrash$3)))));
26009
26009
  }, this)), /*#__PURE__*/React.createElement("div", {
26010
26010
  className: "add-choice-container"
26011
26011
  }, /*#__PURE__*/React.createElement("a", {
26012
26012
  href: "#",
26013
26013
  className: "simple-button orange",
26014
26014
  onClick: this.addChoice
26015
- }, /*#__PURE__*/React.createElement(InlineIcon$5, iconPlus$2), " Add a choice", " ")));
26015
+ }, /*#__PURE__*/React.createElement(InlineIcon$4, iconPlus$2), " Add a choice", " ")));
26016
26016
  }
26017
26017
  }
26018
26018
  DropdownEditor.propTypes = {
@@ -26858,7 +26858,7 @@ class AnswerOption extends React.Component {
26858
26858
  }
26859
26859
 
26860
26860
  const {
26861
- InlineIcon: InlineIcon$4,
26861
+ InlineIcon: InlineIcon$3,
26862
26862
  TextInput: TextInput$6
26863
26863
  } = components;
26864
26864
  const {
@@ -26908,10 +26908,10 @@ class GradedGroupEditor extends React.Component {
26908
26908
  }, /*#__PURE__*/React.createElement("div", {
26909
26909
  className: "perseus-widget-row"
26910
26910
  }, /*#__PURE__*/React.createElement("label", {
26911
- className: css(styles$B.title)
26911
+ className: css(styles$D.title)
26912
26912
  }, "Title:", " ", /*#__PURE__*/React.createElement(TextInput$6, {
26913
26913
  value: this.props.title,
26914
- className: css(styles$B.input)
26914
+ className: css(styles$D.input)
26915
26915
  // @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
26916
26916
  ,
26917
26917
  onChange: this.change("title")
@@ -26933,10 +26933,10 @@ class GradedGroupEditor extends React.Component {
26933
26933
  },
26934
26934
  className: "add-hint simple-button orange",
26935
26935
  onClick: this.handleAddHint
26936
- }, /*#__PURE__*/React.createElement(InlineIcon$4, iconPlus$1), " Add a hint"), this.props.hint && /*#__PURE__*/React.createElement("div", {
26936
+ }, /*#__PURE__*/React.createElement(InlineIcon$3, iconPlus$1), " Add a hint"), this.props.hint && /*#__PURE__*/React.createElement("div", {
26937
26937
  className: "perseus-hint-editor"
26938
26938
  }, /*#__PURE__*/React.createElement("div", {
26939
- className: css(styles$B.hintsTitle)
26939
+ className: css(styles$D.hintsTitle)
26940
26940
  }, "Hint"), /*#__PURE__*/React.createElement(Editor, {
26941
26941
  ref: this.hintEditor,
26942
26942
  content: this.props.hint ? this.props.hint.content : "",
@@ -26955,7 +26955,7 @@ class GradedGroupEditor extends React.Component {
26955
26955
  type: "button",
26956
26956
  className: "remove-hint simple-button orange",
26957
26957
  onClick: this.handleRemoveHint
26958
- }, /*#__PURE__*/React.createElement(InlineIcon$4, iconTrash$2), " Remove this hint")));
26958
+ }, /*#__PURE__*/React.createElement(InlineIcon$3, iconTrash$2), " Remove this hint")));
26959
26959
  }
26960
26960
  }
26961
26961
  GradedGroupEditor.propTypes = _extends({}, Changeable.propTypes, {
@@ -26973,7 +26973,7 @@ GradedGroupEditor.defaultProps = {
26973
26973
  images: {},
26974
26974
  hint: null
26975
26975
  };
26976
- const styles$B = StyleSheet.create({
26976
+ const styles$D = StyleSheet.create({
26977
26977
  title: {
26978
26978
  fontSize: 18,
26979
26979
  fontWeight: "bold"
@@ -27874,7 +27874,7 @@ IframeEditor.defaultProps = {
27874
27874
  /* eslint-disable jsx-a11y/anchor-is-valid, react/sort-comp */
27875
27875
  const {
27876
27876
  InfoTip: InfoTip$f,
27877
- InlineIcon: InlineIcon$3,
27877
+ InlineIcon: InlineIcon$2,
27878
27878
  RangeInput: RangeInput$5
27879
27879
  } = components;
27880
27880
  const defaultBoxSize = 400;
@@ -27992,7 +27992,7 @@ class ImageEditor extends React.Component {
27992
27992
  // eslint-disable-next-line react/jsx-no-bind
27993
27993
  ,
27994
27994
  onClick: this.removeLabel.bind(this, i)
27995
- }, /*#__PURE__*/React.createElement(InlineIcon$3, icons.iconTrash))));
27995
+ }, /*#__PURE__*/React.createElement(InlineIcon$2, icons.iconTrash))));
27996
27996
  }
27997
27997
  change(...args) {
27998
27998
  return Changeable.change.apply(this, args);
@@ -28312,13 +28312,13 @@ function MathquillInput(props) {
28312
28312
  }
28313
28313
  });
28314
28314
  return /*#__PURE__*/React.createElement(View, {
28315
- style: styles$A.outerWrapper
28315
+ style: styles$C.outerWrapper
28316
28316
  }, /*#__PURE__*/React.createElement("span", {
28317
28317
  ref: mathFieldWrapperRef,
28318
28318
  className: "perseus-math-input mq-editable-field mq-math-mode"
28319
28319
  }));
28320
28320
  }
28321
- const styles$A = StyleSheet.create({
28321
+ const styles$C = StyleSheet.create({
28322
28322
  outerWrapper: {
28323
28323
  display: "inline-block",
28324
28324
  borderStyle: "solid",
@@ -28330,7 +28330,7 @@ const styles$A = StyleSheet.create({
28330
28330
  });
28331
28331
 
28332
28332
  const {
28333
- NumberInput: NumberInput$e
28333
+ NumberInput: NumberInput$d
28334
28334
  } = components;
28335
28335
  const {
28336
28336
  getDependencies: getDependencies$8
@@ -28379,7 +28379,7 @@ class FunctionEditor extends React.Component {
28379
28379
  className: "perseus-widget-row"
28380
28380
  }, /*#__PURE__*/React.createElement("div", {
28381
28381
  className: "perseus-widget-left-col"
28382
- }, "Width:", " ", /*#__PURE__*/React.createElement(NumberInput$e, {
28382
+ }, "Width:", " ", /*#__PURE__*/React.createElement(NumberInput$d, {
28383
28383
  value: this.props.strokeWidth,
28384
28384
  placeholder: 2,
28385
28385
  onChange: this.change("strokeWidth")
@@ -28451,7 +28451,7 @@ LabelEditor.defaultProps = {
28451
28451
  };
28452
28452
 
28453
28453
  const {
28454
- NumberInput: NumberInput$d
28454
+ NumberInput: NumberInput$c
28455
28455
  } = components;
28456
28456
  const {
28457
28457
  getDependencies: getDependencies$6
@@ -28506,7 +28506,7 @@ class LineEditor extends React.Component {
28506
28506
  className: "perseus-widget-row"
28507
28507
  }, /*#__PURE__*/React.createElement("div", {
28508
28508
  className: "perseus-widget-left-col"
28509
- }, "Width:", " ", /*#__PURE__*/React.createElement(NumberInput$d, {
28509
+ }, "Width:", " ", /*#__PURE__*/React.createElement(NumberInput$c, {
28510
28510
  value: this.props.strokeWidth,
28511
28511
  placeholder: 2,
28512
28512
  onChange: this.change("strokeWidth")
@@ -28526,7 +28526,7 @@ LineEditor.defaultProps = {
28526
28526
 
28527
28527
  const {
28528
28528
  ButtonGroup: ButtonGroup$3,
28529
- NumberInput: NumberInput$c
28529
+ NumberInput: NumberInput$b
28530
28530
  } = components;
28531
28531
  class ConstraintEditor extends React.Component {
28532
28532
  constructor(...args) {
@@ -28560,7 +28560,7 @@ class ConstraintEditor extends React.Component {
28560
28560
  onChange: this.change("constraint")
28561
28561
  })), this.props.constraint === "snap" && /*#__PURE__*/React.createElement("div", {
28562
28562
  className: "perseus-widget-row"
28563
- }, "Snap:", " ", /*#__PURE__*/React.createElement(NumberInput$c, {
28563
+ }, "Snap:", " ", /*#__PURE__*/React.createElement(NumberInput$b, {
28564
28564
  value: this.props.snap,
28565
28565
  placeholder: 0,
28566
28566
  onChange: this.change("snap")
@@ -28612,7 +28612,7 @@ ConstraintEditor.defaultProps = {
28612
28612
  };
28613
28613
 
28614
28614
  const {
28615
- NumberInput: NumberInput$b
28615
+ NumberInput: NumberInput$a
28616
28616
  } = components;
28617
28617
  const {
28618
28618
  getDependencies: getDependencies$5
@@ -28653,13 +28653,13 @@ class MovableLineEditor extends React.Component {
28653
28653
  onChange: this.change("endY")
28654
28654
  }), /*#__PURE__*/React.createElement(TeX, null, "\\Large)")), /*#__PURE__*/React.createElement("div", {
28655
28655
  className: "perseus-widget-row"
28656
- }, "Start updates ", /*#__PURE__*/React.createElement(TeX, null, "(x_n, y_n)"), " for ", /*#__PURE__*/React.createElement(TeX, null, "n ="), /*#__PURE__*/React.createElement(NumberInput$b, {
28656
+ }, "Start updates ", /*#__PURE__*/React.createElement(TeX, null, "(x_n, y_n)"), " for ", /*#__PURE__*/React.createElement(TeX, null, "n ="), /*#__PURE__*/React.createElement(NumberInput$a, {
28657
28657
  value: this.props.startSubscript,
28658
28658
  placeholder: 0,
28659
28659
  onChange: this.change("startSubscript")
28660
28660
  })), /*#__PURE__*/React.createElement("div", {
28661
28661
  className: "perseus-widget-row"
28662
- }, "End updates ", /*#__PURE__*/React.createElement(TeX, null, "(x_m, y_m)"), " for ", /*#__PURE__*/React.createElement(TeX, null, "m ="), /*#__PURE__*/React.createElement(NumberInput$b, {
28662
+ }, "End updates ", /*#__PURE__*/React.createElement(TeX, null, "(x_m, y_m)"), " for ", /*#__PURE__*/React.createElement(TeX, null, "m ="), /*#__PURE__*/React.createElement(NumberInput$a, {
28663
28663
  value: this.props.endSubscript,
28664
28664
  placeholder: 0,
28665
28665
  onChange: this.change("endSubscript")
@@ -28684,7 +28684,7 @@ MovableLineEditor.defaultProps = {
28684
28684
  };
28685
28685
 
28686
28686
  const {
28687
- NumberInput: NumberInput$a
28687
+ NumberInput: NumberInput$9
28688
28688
  } = components;
28689
28689
  const {
28690
28690
  getDependencies: getDependencies$4
@@ -28717,7 +28717,7 @@ class MovablePointEditor extends React.Component {
28717
28717
  onChange: this.change("startY")
28718
28718
  }), /*#__PURE__*/React.createElement(TeX, null, "\\Large)")), /*#__PURE__*/React.createElement("div", {
28719
28719
  className: "perseus-widget-row"
28720
- }, "Update ", /*#__PURE__*/React.createElement(TeX, null, "(x_n, y_n)"), " for ", /*#__PURE__*/React.createElement(TeX, null, "n ="), " ", /*#__PURE__*/React.createElement(NumberInput$a, {
28720
+ }, "Update ", /*#__PURE__*/React.createElement(TeX, null, "(x_n, y_n)"), " for ", /*#__PURE__*/React.createElement(TeX, null, "n ="), " ", /*#__PURE__*/React.createElement(NumberInput$9, {
28721
28721
  value: this.props.varSubscript,
28722
28722
  placeholder: 0,
28723
28723
  onChange: this.change("varSubscript")
@@ -28738,7 +28738,7 @@ MovablePointEditor.defaultProps = {
28738
28738
  };
28739
28739
 
28740
28740
  const {
28741
- NumberInput: NumberInput$9
28741
+ NumberInput: NumberInput$8
28742
28742
  } = components;
28743
28743
  const {
28744
28744
  getDependencies: getDependencies$3
@@ -28792,7 +28792,7 @@ class ParametricEditor extends React.Component {
28792
28792
  className: "perseus-widget-row"
28793
28793
  }, /*#__PURE__*/React.createElement("div", {
28794
28794
  className: "perseus-widget-left-col"
28795
- }, "Width:", " ", /*#__PURE__*/React.createElement(NumberInput$9, {
28795
+ }, "Width:", " ", /*#__PURE__*/React.createElement(NumberInput$8, {
28796
28796
  value: this.props.strokeWidth,
28797
28797
  placeholder: 2,
28798
28798
  onChange: this.change("strokeWidth")
@@ -29364,16 +29364,16 @@ const LabeledRow = props => {
29364
29364
  style
29365
29365
  } = props;
29366
29366
  return /*#__PURE__*/React.createElement("label", {
29367
- className: css(styles$z.label)
29367
+ className: css(styles$B.label)
29368
29368
  }, /*#__PURE__*/React.createElement(View, {
29369
- style: [styles$z.row, style]
29369
+ style: [styles$B.row, style]
29370
29370
  }, labelSide === "start" || /*#__PURE__*/React.createElement(LabelSmall, {
29371
- style: styles$z.spaceEnd
29371
+ style: styles$B.spaceEnd
29372
29372
  }, label), children, labelSide === "end" && /*#__PURE__*/React.createElement(LabelSmall, {
29373
- style: styles$z.spaceStart
29373
+ style: styles$B.spaceStart
29374
29374
  }, label)));
29375
29375
  };
29376
- const styles$z = StyleSheet.create({
29376
+ const styles$B = StyleSheet.create({
29377
29377
  label: {
29378
29378
  width: "fit-content"
29379
29379
  },
@@ -29450,11 +29450,11 @@ class Spring extends React.Component {
29450
29450
  } = this.props;
29451
29451
  return React.createElement(View, {
29452
29452
  "aria-hidden": "true",
29453
- style: [styles$y.grow, style]
29453
+ style: [styles$A.grow, style]
29454
29454
  });
29455
29455
  }
29456
29456
  }
29457
- const styles$y = StyleSheet.create({
29457
+ const styles$A = StyleSheet.create({
29458
29458
  grow: {
29459
29459
  flexGrow: 1
29460
29460
  }
@@ -29489,22 +29489,12 @@ function Heading({
29489
29489
  isCollapsible,
29490
29490
  onToggle
29491
29491
  }) {
29492
- return /*#__PURE__*/React.createElement(View, {
29493
- style: {
29494
- flexDirection: "row",
29495
- justifyContent: "space-between",
29496
- backgroundColor: color.offBlack8,
29497
- padding: spacing.xSmall_8,
29498
- marginTop: spacing.small_12,
29499
- // NOTE(jeremy): This is the inverse of the @editorPadding CSS
29500
- // variable found in perseus-editor.less. For now, it must
29501
- // match otherwise there's a gap from this header to the edge
29502
- // of the editor borders.
29503
- marginInline: -10,
29504
- cursor: isCollapsible ? "pointer" : "default",
29505
- userSelect: "none"
29506
- },
29492
+ return /*#__PURE__*/React.createElement(Clickable, {
29493
+ style: [styles$z.container, !isCollapsible && styles$z.notClickable],
29494
+ disabled: !isCollapsible,
29507
29495
  onClick: () => isCollapsible && (onToggle == null ? void 0 : onToggle(!isOpen))
29496
+ }, () => /*#__PURE__*/React.createElement(View, {
29497
+ style: styles$z.heading
29508
29498
  }, /*#__PURE__*/React.createElement(LabelLarge, {
29509
29499
  style: {
29510
29500
  fontSize: 14,
@@ -29512,8 +29502,31 @@ function Heading({
29512
29502
  }
29513
29503
  }, title), isCollapsible && /*#__PURE__*/React.createElement(ToggleableCaret, {
29514
29504
  isExpanded: isOpen
29515
- }));
29505
+ })));
29516
29506
  }
29507
+ const styles$z = StyleSheet.create({
29508
+ container: {
29509
+ marginTop: spacing.small_12,
29510
+ // NOTE(jeremy): This is the inverse of the @editorPadding CSS
29511
+ // variable found in perseus-editor.less. For now, it must
29512
+ // match otherwise there's a gap from this header to the edge
29513
+ // of the editor borders.
29514
+ marginInline: -10,
29515
+ backgroundColor: color.offBlack8,
29516
+ padding: spacing.xSmall_8
29517
+ },
29518
+ heading: {
29519
+ flexDirection: "row",
29520
+ justifyContent: "space-between",
29521
+ userSelect: "none"
29522
+ },
29523
+ notClickable: {
29524
+ // We don't need the text to be grayed out.
29525
+ color: "inherit",
29526
+ // We don't need the pointer to show the "not allowed" symbol.
29527
+ cursor: "default"
29528
+ }
29529
+ });
29517
29530
 
29518
29531
  function focusWithChromeStickyFocusBugWorkaround(element) {
29519
29532
  // NOTE(marksandstrom) Chrome sticky focus bug.
@@ -29620,6 +29633,25 @@ function degreeToRadian(degrees) {
29620
29633
  function radianToDegree(radians) {
29621
29634
  return radians / Math.PI * 180;
29622
29635
  }
29636
+ function getDefaultGraphStartCoords(graph, range, step) {
29637
+ switch (graph.type) {
29638
+ case "linear":
29639
+ case "ray":
29640
+ return getLineCoords(_extends({}, graph, {
29641
+ startCoords: undefined
29642
+ }), range, step);
29643
+ case "segment":
29644
+ return getSegmentCoords(_extends({}, graph, {
29645
+ startCoords: undefined
29646
+ }), range, step);
29647
+ case "linear-system":
29648
+ return getLinearSystemCoords(_extends({}, graph, {
29649
+ startCoords: undefined
29650
+ }), range, step);
29651
+ default:
29652
+ return undefined;
29653
+ }
29654
+ }
29623
29655
 
29624
29656
  /**
29625
29657
  * Dropdown for selecting a locked figure to add to an interactive graph.
@@ -29635,17 +29667,17 @@ const LockedFigureSelect = props => {
29635
29667
  } = props;
29636
29668
  const figureTypes = props.showM2Features ? ["point", "line", "vector", "ellipse", "polygon"] : ["point", "line"];
29637
29669
  return /*#__PURE__*/React.createElement(View, {
29638
- style: styles$x.container
29670
+ style: styles$y.container
29639
29671
  }, /*#__PURE__*/React.createElement(ActionMenu, {
29640
29672
  menuText: "Add locked figure",
29641
- style: styles$x.addElementSelect
29673
+ style: styles$y.addElementSelect
29642
29674
  }, figureTypes.map(figureType => /*#__PURE__*/React.createElement(ActionItem, {
29643
29675
  key: `${id}-${figureType}`,
29644
29676
  label: figureType,
29645
29677
  onClick: () => onChange(figureType)
29646
29678
  }))));
29647
29679
  };
29648
- const styles$x = StyleSheet.create({
29680
+ const styles$y = StyleSheet.create({
29649
29681
  container: {
29650
29682
  marginTop: spacing.xSmall_8
29651
29683
  },
@@ -29676,19 +29708,19 @@ const AngleInput = props => {
29676
29708
  }
29677
29709
  return /*#__PURE__*/React.createElement(LabelMedium, {
29678
29710
  tag: "label",
29679
- style: styles$w.row
29711
+ style: styles$x.row
29680
29712
  }, "angle (degrees)", /*#__PURE__*/React.createElement(Strut, {
29681
29713
  size: spacing.xxSmall_6
29682
29714
  }), /*#__PURE__*/React.createElement(TextField, {
29683
29715
  type: "number",
29684
29716
  value: angleInput,
29685
29717
  onChange: handleAngleChange,
29686
- style: styles$w.textField
29718
+ style: styles$x.textField
29687
29719
  }), /*#__PURE__*/React.createElement(Strut, {
29688
29720
  size: spacing.xxSmall_6
29689
29721
  }));
29690
29722
  };
29691
- const styles$w = StyleSheet.create({
29723
+ const styles$x = StyleSheet.create({
29692
29724
  row: {
29693
29725
  display: "flex",
29694
29726
  flexDirection: "row",
@@ -29737,32 +29769,32 @@ const CoordinatePairInput = props => {
29737
29769
  onChange(newCoords);
29738
29770
  }
29739
29771
  return /*#__PURE__*/React.createElement(View, {
29740
- style: [styles$v.row, style]
29772
+ style: [styles$w.row, style]
29741
29773
  }, /*#__PURE__*/React.createElement(LabelMedium, {
29742
29774
  tag: "label",
29743
- style: styles$v.row
29775
+ style: styles$w.row
29744
29776
  }, labels ? labels[0] : "x coord", /*#__PURE__*/React.createElement(Strut, {
29745
29777
  size: spacing.xxSmall_6
29746
29778
  }), /*#__PURE__*/React.createElement(TextField, {
29747
29779
  type: "number",
29748
29780
  value: coordState[0],
29749
29781
  onChange: newValue => handleCoordChange(newValue, 0),
29750
- style: [styles$v.textField, error ? styles$v.errorField : undefined]
29782
+ style: [styles$w.textField, error ? styles$w.errorField : undefined]
29751
29783
  })), /*#__PURE__*/React.createElement(Strut, {
29752
29784
  size: spacing.medium_16
29753
29785
  }), /*#__PURE__*/React.createElement(LabelMedium, {
29754
29786
  tag: "label",
29755
- style: styles$v.row
29787
+ style: styles$w.row
29756
29788
  }, labels ? labels[1] : "y coord", /*#__PURE__*/React.createElement(Strut, {
29757
29789
  size: spacing.xxSmall_6
29758
29790
  }), /*#__PURE__*/React.createElement(TextField, {
29759
29791
  type: "number",
29760
29792
  value: coordState[1],
29761
29793
  onChange: newValue => handleCoordChange(newValue, 1),
29762
- style: [styles$v.textField, error ? styles$v.errorField : undefined]
29794
+ style: [styles$w.textField, error ? styles$w.errorField : undefined]
29763
29795
  })));
29764
29796
  };
29765
- const styles$v = StyleSheet.create({
29797
+ const styles$w = StyleSheet.create({
29766
29798
  row: {
29767
29799
  display: "flex",
29768
29800
  flexDirection: "row",
@@ -29795,14 +29827,14 @@ const PerseusEditorAccordion = props => {
29795
29827
  }, /*#__PURE__*/React.createElement(AccordionSection, {
29796
29828
  expanded: expanded,
29797
29829
  onToggle: onToggle,
29798
- style: [styles$u.container, containerStyle],
29799
- headerStyle: styles$u.accordionHeader,
29830
+ style: [styles$v.container, containerStyle],
29831
+ headerStyle: styles$v.accordionHeader,
29800
29832
  header: header
29801
29833
  }, /*#__PURE__*/React.createElement(View, {
29802
- style: [styles$u.accordionPanel, panelStyle]
29834
+ style: [styles$v.accordionPanel, panelStyle]
29803
29835
  }, children)));
29804
29836
  };
29805
- const styles$u = StyleSheet.create({
29837
+ const styles$v = StyleSheet.create({
29806
29838
  container: {
29807
29839
  backgroundColor: color.fadedBlue8,
29808
29840
  marginTop: spacing.xSmall_8
@@ -29833,13 +29865,13 @@ const ColorSwatch = props => {
29833
29865
  "aria-label":
29834
29866
  // Don't include an aria label for decorative circles.
29835
29867
  !decorative ? `${color$1}, ${filled ? "filled" : "open"}` : undefined,
29836
- style: [styles$t.colorSwatch, {
29868
+ style: [styles$u.colorSwatch, {
29837
29869
  border: `4px solid ${lockedFigureColors[color$1]}`,
29838
29870
  backgroundColor: filled ? lockedFigureColors[color$1] : color.white
29839
29871
  }]
29840
29872
  });
29841
29873
  };
29842
- const styles$t = StyleSheet.create({
29874
+ const styles$u = StyleSheet.create({
29843
29875
  colorSwatch: {
29844
29876
  // Add a white outline so that the color swatch is visible when
29845
29877
  // the dropdown option is highlighted with its blue background.
@@ -29858,10 +29890,10 @@ const ColorSelect = props => {
29858
29890
  onChange
29859
29891
  } = props;
29860
29892
  return /*#__PURE__*/React.createElement(View, {
29861
- style: [styles$s.row, style]
29893
+ style: [styles$t.row, style]
29862
29894
  }, /*#__PURE__*/React.createElement(LabelMedium, {
29863
29895
  tag: "label",
29864
- style: styles$s.row
29896
+ style: styles$t.row
29865
29897
  }, "color", /*#__PURE__*/React.createElement(Strut, {
29866
29898
  size: spacing.xxSmall_6
29867
29899
  }), /*#__PURE__*/React.createElement(SingleSelect, {
@@ -29880,7 +29912,7 @@ const ColorSelect = props => {
29880
29912
  })
29881
29913
  })))));
29882
29914
  };
29883
- const styles$s = StyleSheet.create({
29915
+ const styles$t = StyleSheet.create({
29884
29916
  row: {
29885
29917
  display: "flex",
29886
29918
  flexDirection: "row",
@@ -29896,17 +29928,17 @@ const EllipseSwatch = props => {
29896
29928
  } = props;
29897
29929
  return /*#__PURE__*/React.createElement(View, {
29898
29930
  "aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
29899
- style: [styles$r.container, {
29931
+ style: [styles$s.container, {
29900
29932
  border: `4px ${strokeStyle} ${lockedFigureColors[color]}`
29901
29933
  }]
29902
29934
  }, /*#__PURE__*/React.createElement(View, {
29903
- style: [styles$r.innerCircle, {
29935
+ style: [styles$s.innerCircle, {
29904
29936
  backgroundColor: lockedFigureColors[color],
29905
29937
  opacity: lockedFigureFillStyles[fillStyle]
29906
29938
  }]
29907
29939
  }));
29908
29940
  };
29909
- const styles$r = StyleSheet.create({
29941
+ const styles$s = StyleSheet.create({
29910
29942
  container: {
29911
29943
  // Add a white outline so that the color swatch is visible when
29912
29944
  // the dropdown option is highlighted with its blue background.
@@ -29937,40 +29969,40 @@ const LockedFigureSettingsActions = props => {
29937
29969
  onRemove
29938
29970
  } = props;
29939
29971
  return /*#__PURE__*/React.createElement(View, {
29940
- style: styles$q.container
29972
+ style: styles$r.container
29941
29973
  }, /*#__PURE__*/React.createElement(Button, {
29942
29974
  startIcon: trashIcon,
29943
29975
  "aria-label": `Delete locked ${figureType}`,
29944
29976
  onClick: onRemove,
29945
29977
  kind: "tertiary",
29946
- style: styles$q.deleteButton
29978
+ style: styles$r.deleteButton
29947
29979
  }, "Delete"), /*#__PURE__*/React.createElement(Spring, null), props.showM2Features && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconButton, {
29948
29980
  icon: caretDoubleUpIcon,
29949
29981
  size: "small",
29950
29982
  "aria-label": `Move locked ${figureType} to the back`,
29951
29983
  onClick: () => onMove("back"),
29952
- style: styles$q.iconButton
29984
+ style: styles$r.iconButton
29953
29985
  }), /*#__PURE__*/React.createElement(IconButton, {
29954
29986
  icon: caretUpIcon,
29955
29987
  size: "small",
29956
29988
  "aria-label": `Move locked ${figureType} backward`,
29957
29989
  onClick: () => onMove("backward"),
29958
- style: styles$q.iconButton
29990
+ style: styles$r.iconButton
29959
29991
  }), /*#__PURE__*/React.createElement(IconButton, {
29960
29992
  icon: caretDownIcon,
29961
29993
  size: "small",
29962
29994
  "aria-label": `Move locked ${figureType} forward`,
29963
29995
  onClick: () => onMove("forward"),
29964
- style: styles$q.iconButton
29996
+ style: styles$r.iconButton
29965
29997
  }), /*#__PURE__*/React.createElement(IconButton, {
29966
29998
  icon: caretDoubleDownIcon,
29967
29999
  size: "small",
29968
30000
  "aria-label": `Move locked ${figureType} to the front`,
29969
30001
  onClick: () => onMove("front"),
29970
- style: styles$q.iconButton
30002
+ style: styles$r.iconButton
29971
30003
  })));
29972
30004
  };
29973
- const styles$q = StyleSheet.create({
30005
+ const styles$r = StyleSheet.create({
29974
30006
  container: {
29975
30007
  width: "100%",
29976
30008
  flexDirection: "row",
@@ -30017,7 +30049,7 @@ const LockedEllipseSettings = props => {
30017
30049
  /*#__PURE__*/
30018
30050
  // Summary: Ellipse, center, radius, color (opacity, dashed)
30019
30051
  React.createElement(View, {
30020
- style: styles$p.row
30052
+ style: styles$q.row
30021
30053
  }, /*#__PURE__*/React.createElement(LabelLarge, null, `Ellipse (${center[0]}, ${center[1]}), radius ${radius[0]}, ${radius[1]}`), /*#__PURE__*/React.createElement(Strut, {
30022
30054
  size: spacing.xSmall_8
30023
30055
  }), /*#__PURE__*/React.createElement(EllipseSwatch, {
@@ -30026,19 +30058,19 @@ const LockedEllipseSettings = props => {
30026
30058
  strokeStyle: strokeStyle
30027
30059
  }))
30028
30060
  }, /*#__PURE__*/React.createElement(View, {
30029
- style: styles$p.row
30061
+ style: styles$q.row
30030
30062
  }, /*#__PURE__*/React.createElement(CoordinatePairInput, {
30031
30063
  coord: center,
30032
- style: styles$p.spaceUnder,
30064
+ style: styles$q.spaceUnder,
30033
30065
  onChange: newCoords => onChangeProps({
30034
30066
  center: newCoords
30035
30067
  })
30036
30068
  }), /*#__PURE__*/React.createElement(View, {
30037
- style: styles$p.spaceUnder
30069
+ style: styles$q.spaceUnder
30038
30070
  }, /*#__PURE__*/React.createElement(InfoTip$d, null, "The coordinates for the center of the ellipse."))), /*#__PURE__*/React.createElement(CoordinatePairInput, {
30039
30071
  coord: radius,
30040
30072
  labels: ["x radius", "y radius"],
30041
- style: styles$p.spaceUnder,
30073
+ style: styles$q.spaceUnder,
30042
30074
  onChange: newCoords => onChangeProps({
30043
30075
  radius: newCoords
30044
30076
  })
@@ -30050,7 +30082,7 @@ const LockedEllipseSettings = props => {
30050
30082
  }), /*#__PURE__*/React.createElement(Strut, {
30051
30083
  size: spacing.xSmall_8
30052
30084
  }), /*#__PURE__*/React.createElement(View, {
30053
- style: [styles$p.row, styles$p.spaceUnder]
30085
+ style: [styles$q.row, styles$q.spaceUnder]
30054
30086
  }, /*#__PURE__*/React.createElement(ColorSelect, {
30055
30087
  selectedValue: color,
30056
30088
  onChange: handleColorChange
@@ -30058,7 +30090,7 @@ const LockedEllipseSettings = props => {
30058
30090
  size: spacing.medium_16
30059
30091
  }), /*#__PURE__*/React.createElement(LabelMedium, {
30060
30092
  tag: "label",
30061
- style: styles$p.row
30093
+ style: styles$q.row
30062
30094
  }, "fill", /*#__PURE__*/React.createElement(Strut, {
30063
30095
  size: spacing.xxSmall_6
30064
30096
  }), /*#__PURE__*/React.createElement(SingleSelect, {
@@ -30075,7 +30107,7 @@ const LockedEllipseSettings = props => {
30075
30107
  label: option
30076
30108
  }))))), /*#__PURE__*/React.createElement(LabelMedium, {
30077
30109
  tag: "label",
30078
- style: styles$p.row
30110
+ style: styles$q.row
30079
30111
  }, "stroke", /*#__PURE__*/React.createElement(Strut, {
30080
30112
  size: spacing.xxSmall_6
30081
30113
  }), /*#__PURE__*/React.createElement(SingleSelect, {
@@ -30099,7 +30131,7 @@ const LockedEllipseSettings = props => {
30099
30131
  onRemove: onRemove
30100
30132
  }));
30101
30133
  };
30102
- const styles$p = StyleSheet.create({
30134
+ const styles$q = StyleSheet.create({
30103
30135
  row: {
30104
30136
  display: "flex",
30105
30137
  flexDirection: "row",
@@ -30120,7 +30152,7 @@ const LabeledSwitch = props => {
30120
30152
  const ids = useUniqueIdWithMock();
30121
30153
  const switchId = ids.get("switch");
30122
30154
  return /*#__PURE__*/React.createElement(View, {
30123
- style: [styles$o.row, style]
30155
+ style: [styles$p.row, style]
30124
30156
  }, /*#__PURE__*/React.createElement(Switch, {
30125
30157
  id: switchId,
30126
30158
  checked: checked,
@@ -30132,7 +30164,7 @@ const LabeledSwitch = props => {
30132
30164
  htmlFor: switchId
30133
30165
  }, label));
30134
30166
  };
30135
- const styles$o = StyleSheet.create({
30167
+ const styles$p = StyleSheet.create({
30136
30168
  row: {
30137
30169
  flexDirection: "row",
30138
30170
  alignItems: "center"
@@ -30166,13 +30198,13 @@ const DefiningPointSettings = props => {
30166
30198
  return /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
30167
30199
  expanded: expanded,
30168
30200
  onToggle: onToggle,
30169
- containerStyle: styles$n.container,
30170
- panelStyle: styles$n.accordionPanel,
30201
+ containerStyle: styles$o.container,
30202
+ panelStyle: styles$o.accordionPanel,
30171
30203
  header:
30172
30204
  /*#__PURE__*/
30173
30205
  // Summary: Point, coords, color (filled/open)
30174
30206
  React.createElement(View, {
30175
- style: styles$n.row
30207
+ style: styles$o.row
30176
30208
  }, /*#__PURE__*/React.createElement(LabelLarge, null, `${label || "Point"} (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React.createElement(Strut, {
30177
30209
  size: spacing.xSmall_8
30178
30210
  }), showPoint && /*#__PURE__*/React.createElement(ColorSwatch, {
@@ -30182,7 +30214,7 @@ const DefiningPointSettings = props => {
30182
30214
  }, /*#__PURE__*/React.createElement(CoordinatePairInput, {
30183
30215
  coord: coord,
30184
30216
  error: !!error,
30185
- style: styles$n.spaceUnder,
30217
+ style: styles$o.spaceUnder,
30186
30218
  onChange: newCoords => {
30187
30219
  onChangeProps({
30188
30220
  coord: newCoords
@@ -30191,12 +30223,12 @@ const DefiningPointSettings = props => {
30191
30223
  }), onTogglePoint && /*#__PURE__*/React.createElement(LabeledSwitch, {
30192
30224
  label: "show point on graph",
30193
30225
  checked: !!showPoint,
30194
- style: showPoint && styles$n.spaceUnder,
30226
+ style: showPoint && styles$o.spaceUnder,
30195
30227
  onChange: onTogglePoint
30196
30228
  }), showPoint && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ColorSelect, {
30197
30229
  selectedValue: pointColor,
30198
30230
  onChange: handleColorChange,
30199
- style: styles$n.spaceUnder
30231
+ style: styles$o.spaceUnder
30200
30232
  }), /*#__PURE__*/React.createElement(LabeledSwitch, {
30201
30233
  label: "open point",
30202
30234
  checked: !filled,
@@ -30207,7 +30239,7 @@ const DefiningPointSettings = props => {
30207
30239
  }
30208
30240
  })));
30209
30241
  };
30210
- const styles$n = StyleSheet.create({
30242
+ const styles$o = StyleSheet.create({
30211
30243
  container: {
30212
30244
  marginTop: spacing.xSmall_8,
30213
30245
  marginBottom: 0,
@@ -30234,15 +30266,15 @@ const LineSwatch = props => {
30234
30266
  lineStyle
30235
30267
  } = props;
30236
30268
  return /*#__PURE__*/React.createElement(View, {
30237
- style: styles$m.container
30269
+ style: styles$n.container
30238
30270
  }, /*#__PURE__*/React.createElement(View, {
30239
30271
  "aria-label": `${color}, ${lineStyle}`,
30240
- style: [styles$m.lineSwatch, {
30272
+ style: [styles$n.lineSwatch, {
30241
30273
  border: `5px ${lineStyle} ${lockedFigureColors[color]}`
30242
30274
  }]
30243
30275
  }));
30244
30276
  };
30245
- const styles$m = StyleSheet.create({
30277
+ const styles$n = StyleSheet.create({
30246
30278
  container: {
30247
30279
  backgroundColor: color.white,
30248
30280
  justifyContent: "center",
@@ -30296,7 +30328,7 @@ const LockedLineSettings = props => {
30296
30328
  expanded: props.expanded,
30297
30329
  onToggle: props.onToggle,
30298
30330
  header: /*#__PURE__*/React.createElement(View, {
30299
- style: styles$l.row
30331
+ style: styles$m.row
30300
30332
  }, /*#__PURE__*/React.createElement(LabelLarge, null, lineLabel), /*#__PURE__*/React.createElement(Strut, {
30301
30333
  size: spacing.xSmall_8
30302
30334
  }), /*#__PURE__*/React.createElement(LineSwatch, {
@@ -30305,7 +30337,7 @@ const LockedLineSettings = props => {
30305
30337
  }))
30306
30338
  }, /*#__PURE__*/React.createElement(LabelMedium, {
30307
30339
  tag: "label",
30308
- style: [styles$l.row, styles$l.spaceUnder]
30340
+ style: [styles$m.row, styles$m.spaceUnder]
30309
30341
  }, "kind", /*#__PURE__*/React.createElement(Strut, {
30310
30342
  size: spacing.xxxSmall_4
30311
30343
  }), /*#__PURE__*/React.createElement(SingleSelect, {
@@ -30326,7 +30358,7 @@ const LockedLineSettings = props => {
30326
30358
  value: "segment",
30327
30359
  label: "segment"
30328
30360
  }))), /*#__PURE__*/React.createElement(View, {
30329
- style: styles$l.row
30361
+ style: styles$m.row
30330
30362
  }, /*#__PURE__*/React.createElement(ColorSelect, {
30331
30363
  selectedValue: lineColor,
30332
30364
  onChange: handleColorChange
@@ -30334,7 +30366,7 @@ const LockedLineSettings = props => {
30334
30366
  size: spacing.small_12
30335
30367
  }), /*#__PURE__*/React.createElement(LabelMedium, {
30336
30368
  tag: "label",
30337
- style: styles$l.row
30369
+ style: styles$m.row
30338
30370
  }, "style", /*#__PURE__*/React.createElement(Strut, {
30339
30371
  size: spacing.xxxSmall_4
30340
30372
  }), /*#__PURE__*/React.createElement(SingleSelect, {
@@ -30345,7 +30377,7 @@ const LockedLineSettings = props => {
30345
30377
  // Placeholder is required, but never gets used.
30346
30378
  ,
30347
30379
  placeholder: "",
30348
- style: styles$l.selectMarginOffset
30380
+ style: styles$m.selectMarginOffset
30349
30381
  }, /*#__PURE__*/React.createElement(OptionItem, {
30350
30382
  value: "solid",
30351
30383
  label: "solid"
@@ -30353,7 +30385,7 @@ const LockedLineSettings = props => {
30353
30385
  value: "dashed",
30354
30386
  label: "dashed"
30355
30387
  })))), isInvalid && /*#__PURE__*/React.createElement(LabelMedium, {
30356
- style: styles$l.errorText
30388
+ style: styles$m.errorText
30357
30389
  }, lengthZeroStr), /*#__PURE__*/React.createElement(DefiningPointSettings, _extends({
30358
30390
  label: "Point 1",
30359
30391
  showPoint: showPoint1,
@@ -30379,7 +30411,7 @@ const LockedLineSettings = props => {
30379
30411
  onRemove: onRemove
30380
30412
  }));
30381
30413
  };
30382
- const styles$l = StyleSheet.create({
30414
+ const styles$m = StyleSheet.create({
30383
30415
  row: {
30384
30416
  display: "flex",
30385
30417
  flexDirection: "row",
@@ -30424,7 +30456,7 @@ const LockedPointSettings = props => {
30424
30456
  /*#__PURE__*/
30425
30457
  // Summary: Point, coords, color (filled/open)
30426
30458
  React.createElement(View, {
30427
- style: styles$k.row
30459
+ style: styles$l.row
30428
30460
  }, /*#__PURE__*/React.createElement(LabelLarge, null, `Point (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React.createElement(Strut, {
30429
30461
  size: spacing.xSmall_8
30430
30462
  }), /*#__PURE__*/React.createElement(ColorSwatch, {
@@ -30433,7 +30465,7 @@ const LockedPointSettings = props => {
30433
30465
  }))
30434
30466
  }, /*#__PURE__*/React.createElement(CoordinatePairInput, {
30435
30467
  coord: coord,
30436
- style: styles$k.spaceUnder,
30468
+ style: styles$l.spaceUnder,
30437
30469
  onChange: newCoord => {
30438
30470
  onChangeProps({
30439
30471
  coord: newCoord
@@ -30442,7 +30474,7 @@ const LockedPointSettings = props => {
30442
30474
  }), /*#__PURE__*/React.createElement(ColorSelect, {
30443
30475
  selectedValue: pointColor,
30444
30476
  onChange: handleColorChange,
30445
- style: styles$k.spaceUnder
30477
+ style: styles$l.spaceUnder
30446
30478
  }), /*#__PURE__*/React.createElement(LabeledSwitch, {
30447
30479
  label: "open point",
30448
30480
  checked: !filled,
@@ -30458,7 +30490,7 @@ const LockedPointSettings = props => {
30458
30490
  onRemove: onRemove
30459
30491
  }));
30460
30492
  };
30461
- const styles$k = StyleSheet.create({
30493
+ const styles$l = StyleSheet.create({
30462
30494
  row: {
30463
30495
  flexDirection: "row",
30464
30496
  alignItems: "center"
@@ -30476,17 +30508,17 @@ const PolygonSwatch = props => {
30476
30508
  } = props;
30477
30509
  return /*#__PURE__*/React.createElement(View, {
30478
30510
  "aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
30479
- style: [styles$j.container, {
30511
+ style: [styles$k.container, {
30480
30512
  border: `4px ${strokeStyle} ${lockedFigureColors[color]}`
30481
30513
  }]
30482
30514
  }, /*#__PURE__*/React.createElement(View, {
30483
- style: [styles$j.innerSquare, {
30515
+ style: [styles$k.innerSquare, {
30484
30516
  backgroundColor: lockedFigureColors[color],
30485
30517
  opacity: lockedFigureFillStyles[fillStyle]
30486
30518
  }]
30487
30519
  }));
30488
30520
  };
30489
- const styles$j = StyleSheet.create({
30521
+ const styles$k = StyleSheet.create({
30490
30522
  container: {
30491
30523
  // Add a white outline so that the color swatch is visible when
30492
30524
  // the dropdown option is highlighted with its blue background.
@@ -30528,7 +30560,7 @@ const LockedPolygonSettings = props => {
30528
30560
  /*#__PURE__*/
30529
30561
  // Summary: Polygon, number of sides, style swatch
30530
30562
  React.createElement(View, {
30531
- style: styles$i.row
30563
+ style: styles$j.row
30532
30564
  }, /*#__PURE__*/React.createElement(LabelLarge, null, `Polygon, ${points.length} sides`), /*#__PURE__*/React.createElement(Strut, {
30533
30565
  size: spacing.xSmall_8
30534
30566
  }), /*#__PURE__*/React.createElement(PolygonSwatch, {
@@ -30537,7 +30569,7 @@ const LockedPolygonSettings = props => {
30537
30569
  strokeStyle: strokeStyle
30538
30570
  }))
30539
30571
  }, /*#__PURE__*/React.createElement(View, {
30540
- style: [styles$i.row, styles$i.spaceUnder]
30572
+ style: [styles$j.row, styles$j.spaceUnder]
30541
30573
  }, /*#__PURE__*/React.createElement(ColorSelect, {
30542
30574
  selectedValue: color,
30543
30575
  onChange: handleColorChange
@@ -30545,7 +30577,7 @@ const LockedPolygonSettings = props => {
30545
30577
  size: spacing.medium_16
30546
30578
  }), /*#__PURE__*/React.createElement(LabelMedium, {
30547
30579
  tag: "label",
30548
- style: styles$i.row
30580
+ style: styles$j.row
30549
30581
  }, "fill", /*#__PURE__*/React.createElement(Strut, {
30550
30582
  size: spacing.xxSmall_6
30551
30583
  }), /*#__PURE__*/React.createElement(SingleSelect, {
@@ -30562,7 +30594,7 @@ const LockedPolygonSettings = props => {
30562
30594
  label: option
30563
30595
  }))))), /*#__PURE__*/React.createElement(LabelMedium, {
30564
30596
  tag: "label",
30565
- style: [styles$i.row, styles$i.spaceUnder]
30597
+ style: [styles$j.row, styles$j.spaceUnder]
30566
30598
  }, "stroke", /*#__PURE__*/React.createElement(Strut, {
30567
30599
  size: spacing.xxSmall_6
30568
30600
  }), /*#__PURE__*/React.createElement(SingleSelect, {
@@ -30585,17 +30617,17 @@ const LockedPolygonSettings = props => {
30585
30617
  onChange: newValue => onChangeProps({
30586
30618
  showVertices: newValue
30587
30619
  }),
30588
- style: styles$i.spaceUnder
30620
+ style: styles$j.spaceUnder
30589
30621
  }), /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
30590
30622
  header: /*#__PURE__*/React.createElement(LabelLarge, null, "Points"),
30591
30623
  expanded: true,
30592
- containerStyle: styles$i.pointAccordionContainer,
30593
- panelStyle: styles$i.pointAccordionPanel
30624
+ containerStyle: styles$j.pointAccordionContainer,
30625
+ panelStyle: styles$j.pointAccordionPanel
30594
30626
  }, points.map((point, index) => {
30595
30627
  const pointLabel = String.fromCharCode(65 + index);
30596
30628
  return /*#__PURE__*/React.createElement(View, {
30597
30629
  key: `locked-polygon-point-${point[0]}-${point[1]}-index-${index}`,
30598
- style: [styles$i.row, styles$i.spaceUnder]
30630
+ style: [styles$j.row, styles$j.spaceUnder]
30599
30631
  }, /*#__PURE__*/React.createElement(LabelLarge, null, `${pointLabel}:`), /*#__PURE__*/React.createElement(Strut, {
30600
30632
  size: spacing.medium_16
30601
30633
  }), /*#__PURE__*/React.createElement(CoordinatePairInput, {
@@ -30623,7 +30655,7 @@ const LockedPolygonSettings = props => {
30623
30655
  points: newPoints
30624
30656
  });
30625
30657
  },
30626
- style: styles$i.icon
30658
+ style: styles$j.icon
30627
30659
  }));
30628
30660
  }), /*#__PURE__*/React.createElement(Button, {
30629
30661
  kind: "tertiary",
@@ -30640,7 +30672,7 @@ const LockedPolygonSettings = props => {
30640
30672
  onRemove: onRemove
30641
30673
  }));
30642
30674
  };
30643
- const styles$i = StyleSheet.create({
30675
+ const styles$j = StyleSheet.create({
30644
30676
  row: {
30645
30677
  display: "flex",
30646
30678
  flexDirection: "row",
@@ -30698,7 +30730,7 @@ const LockedVectorSettings = props => {
30698
30730
  expanded: props.expanded,
30699
30731
  onToggle: props.onToggle,
30700
30732
  header: /*#__PURE__*/React.createElement(View, {
30701
- style: styles$h.row
30733
+ style: styles$i.row
30702
30734
  }, /*#__PURE__*/React.createElement(LabelLarge, null, lineLabel), /*#__PURE__*/React.createElement(Strut, {
30703
30735
  size: spacing.xSmall_8
30704
30736
  }), /*#__PURE__*/React.createElement(LineSwatch, {
@@ -30706,19 +30738,19 @@ const LockedVectorSettings = props => {
30706
30738
  lineStyle: "solid"
30707
30739
  }))
30708
30740
  }, /*#__PURE__*/React.createElement(View, {
30709
- style: [styles$h.row, styles$h.spaceUnder]
30741
+ style: [styles$i.row, styles$i.spaceUnder]
30710
30742
  }, /*#__PURE__*/React.createElement(ColorSelect, {
30711
30743
  selectedValue: lineColor,
30712
30744
  onChange: handleColorChange
30713
30745
  })), isInvalid && /*#__PURE__*/React.createElement(LabelMedium, {
30714
- style: styles$h.errorText
30746
+ style: styles$i.errorText
30715
30747
  }, lengthErrorMessage), /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
30716
30748
  expanded: true // Initial state is expanded
30717
30749
  ,
30718
- containerStyle: styles$h.container,
30719
- panelStyle: styles$h.accordionPanel,
30750
+ containerStyle: styles$i.container,
30751
+ panelStyle: styles$i.accordionPanel,
30720
30752
  header: /*#__PURE__*/React.createElement(View, {
30721
- style: styles$h.row
30753
+ style: styles$i.row
30722
30754
  }, /*#__PURE__*/React.createElement(LabelLarge, null, `Tail (${tail[0]}, ${tail[1]})`))
30723
30755
  }, /*#__PURE__*/React.createElement(CoordinatePairInput, {
30724
30756
  coord: tail,
@@ -30729,10 +30761,10 @@ const LockedVectorSettings = props => {
30729
30761
  })), /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
30730
30762
  expanded: true // Initial state is expanded
30731
30763
  ,
30732
- containerStyle: styles$h.container,
30733
- panelStyle: styles$h.accordionPanel,
30764
+ containerStyle: styles$i.container,
30765
+ panelStyle: styles$i.accordionPanel,
30734
30766
  header: /*#__PURE__*/React.createElement(View, {
30735
- style: styles$h.row
30767
+ style: styles$i.row
30736
30768
  }, /*#__PURE__*/React.createElement(LabelLarge, null, `Tip (${tip[0]}, ${tip[1]})`))
30737
30769
  }, /*#__PURE__*/React.createElement(CoordinatePairInput, {
30738
30770
  coord: tip,
@@ -30747,7 +30779,7 @@ const LockedVectorSettings = props => {
30747
30779
  onRemove: onRemove
30748
30780
  }));
30749
30781
  };
30750
- const styles$h = StyleSheet.create({
30782
+ const styles$i = StyleSheet.create({
30751
30783
  accordionPanel: {
30752
30784
  paddingBottom: spacing.medium_16
30753
30785
  },
@@ -30922,7 +30954,7 @@ const LockedFiguresSection = props => {
30922
30954
  onRemove: () => removeLockedFigure(index)
30923
30955
  }));
30924
30956
  }), /*#__PURE__*/React.createElement(View, {
30925
- style: styles$g.buttonContainer
30957
+ style: styles$h.buttonContainer
30926
30958
  }, /*#__PURE__*/React.createElement(LockedFigureSelect, {
30927
30959
  showM2Features: props.showM2Features,
30928
30960
  showM2bFeatures: props.showM2bFeatures,
@@ -30933,10 +30965,10 @@ const LockedFiguresSection = props => {
30933
30965
  }), showExpandButton && /*#__PURE__*/React.createElement(Button, {
30934
30966
  kind: "secondary",
30935
30967
  onClick: () => toggleExpanded(allCollapsed),
30936
- style: styles$g.button
30968
+ style: styles$h.button
30937
30969
  }, buttonLabel))));
30938
30970
  };
30939
- const styles$g = StyleSheet.create({
30971
+ const styles$h = StyleSheet.create({
30940
30972
  buttonContainer: {
30941
30973
  flexDirection: "row",
30942
30974
  alignItems: "center"
@@ -30971,7 +31003,7 @@ const GraphPointsCountSelector = ({
30971
31003
  // Never uses placeholder, always has value
30972
31004
  ,
30973
31005
  placeholder: "",
30974
- style: styles$f.singleSelectShort
31006
+ style: styles$g.singleSelectShort
30975
31007
  }, [...[...Array(7).keys()].map(n => /*#__PURE__*/React.createElement(OptionItem, {
30976
31008
  key: n,
30977
31009
  value: `${n}`,
@@ -30982,7 +31014,7 @@ const GraphPointsCountSelector = ({
30982
31014
  label: "unlimited"
30983
31015
  })]);
30984
31016
  };
30985
- const styles$f = StyleSheet.create({
31017
+ const styles$g = StyleSheet.create({
30986
31018
  singleSelectShort: {
30987
31019
  // Non-standard spacing, but it's the smallest we can go
30988
31020
  // without running into styling issues with the dropdown.
@@ -30995,7 +31027,7 @@ const GraphTypeSelector = props => {
30995
31027
  selectedValue: props.graphType,
30996
31028
  onChange: props.onChange,
30997
31029
  placeholder: "Select a graph type",
30998
- style: styles$e.singleSelectShort
31030
+ style: styles$f.singleSelectShort
30999
31031
  }, /*#__PURE__*/React.createElement(OptionItem, {
31000
31032
  value: "linear",
31001
31033
  label: "Linear function"
@@ -31028,7 +31060,7 @@ const GraphTypeSelector = props => {
31028
31060
  label: "Angle"
31029
31061
  }));
31030
31062
  };
31031
- const styles$e = StyleSheet.create({
31063
+ const styles$f = StyleSheet.create({
31032
31064
  singleSelectShort: {
31033
31065
  // Non-standard spacing, but it's the smallest we can go
31034
31066
  // without running into styling issues with the dropdown.
@@ -31094,18 +31126,6 @@ class InteractiveGraphSettings extends React.Component {
31094
31126
  this.change = (...args) => {
31095
31127
  return Changeable.change.apply(this, args);
31096
31128
  };
31097
- // TODO(aria): Make either a wrapper for standard events to work
31098
- // with this.change, or make these use some TextInput/NumberInput box
31099
- this.changeRulerLabel = e => {
31100
- this.change({
31101
- rulerLabel: e.target.value
31102
- });
31103
- };
31104
- this.changeRulerTicks = e => {
31105
- this.change({
31106
- rulerTicks: +e.target.value
31107
- });
31108
- };
31109
31129
  this.changeBackgroundUrl = e => {
31110
31130
  var _this$bgUrlRef$curren;
31111
31131
  // Only continue on blur or "enter"
@@ -31444,10 +31464,10 @@ class InteractiveGraphSettings extends React.Component {
31444
31464
  onChange: this.change
31445
31465
  }))), /*#__PURE__*/React.createElement(LabeledRow, {
31446
31466
  label: "Background image URL:",
31447
- style: styles$d.resetSpaceTop
31467
+ style: styles$e.resetSpaceTop
31448
31468
  }, /*#__PURE__*/React.createElement("input", {
31449
31469
  type: "text",
31450
- className: css(styles$d.backgroundUrlInput),
31470
+ className: css(styles$e.backgroundUrlInput),
31451
31471
  ref: this.bgUrlRef,
31452
31472
  value: this.state.backgroundImage.url || "",
31453
31473
  onChange: e => {
@@ -31461,84 +31481,19 @@ class InteractiveGraphSettings extends React.Component {
31461
31481
  onKeyPress: this.changeBackgroundUrl,
31462
31482
  onBlur: this.changeBackgroundUrl
31463
31483
  }), /*#__PURE__*/React.createElement(InfoTip$c, 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, {
31464
- style: styles$d.rulerSection
31484
+ style: styles$e.protractorSection
31465
31485
  }, /*#__PURE__*/React.createElement(View, {
31466
- style: styles$d.checkboxRow
31486
+ style: styles$e.checkboxRow
31467
31487
  }, /*#__PURE__*/React.createElement(PropCheckBox$7, {
31468
- label: "Show ruler",
31469
- showRuler: this.props.showRuler,
31470
- onChange: this.change,
31471
- style: styles$d.resetSpaceTop
31472
- }), /*#__PURE__*/React.createElement(PropCheckBox$7, {
31473
31488
  label: "Show protractor",
31474
31489
  showProtractor: this.props.showProtractor,
31475
31490
  onChange: this.change,
31476
- style: styles$d.resetSpaceTop
31477
- })), (this.props.showRuler || this.props.showProtractor) && /*#__PURE__*/React.createElement(Banner, {
31491
+ style: styles$e.resetSpaceTop
31492
+ })), this.props.showProtractor && /*#__PURE__*/React.createElement(Banner, {
31478
31493
  layout: "floating",
31479
- text: "The ruler and protractor are not accessible. Please consider an alternate approach.",
31494
+ text: "The protractor is not accessible. Please consider an alternate approach.",
31480
31495
  kind: "warning"
31481
- }), this.props.showRuler && /*#__PURE__*/React.createElement(View, {
31482
- style: styles$d.spaceTop
31483
- }, /*#__PURE__*/React.createElement(LabeledRow, {
31484
- label: "Ruler label:",
31485
- style: styles$d.resetSpaceTop
31486
- }, /*#__PURE__*/React.createElement(SingleSelect, {
31487
- id: "ruler-label-select",
31488
- selectedValue: this.props.rulerLabel,
31489
- onChange: newValue => {
31490
- this.change({
31491
- rulerLabel: newValue
31492
- });
31493
- },
31494
- placeholder: "None",
31495
- style: styles$d.singleSelectShort
31496
- }, /*#__PURE__*/React.createElement(OptionItem, {
31497
- value: "",
31498
- label: "None",
31499
- horizontalRule: "full-width"
31500
- }), /*#__PURE__*/React.createElement(OptionItem, {
31501
- value: "mm",
31502
- label: "Milimeters"
31503
- }), /*#__PURE__*/React.createElement(OptionItem, {
31504
- value: "cm",
31505
- label: "Centimeters"
31506
- }), /*#__PURE__*/React.createElement(OptionItem, {
31507
- value: "m",
31508
- label: "Meters"
31509
- }), /*#__PURE__*/React.createElement(OptionItem, {
31510
- value: "km",
31511
- label: "Kilometers",
31512
- horizontalRule: "full-width"
31513
- }), /*#__PURE__*/React.createElement(OptionItem, {
31514
- value: "in",
31515
- label: "Inches"
31516
- }), /*#__PURE__*/React.createElement(OptionItem, {
31517
- value: "ft",
31518
- label: "Feet"
31519
- }), /*#__PURE__*/React.createElement(OptionItem, {
31520
- value: "yd",
31521
- label: "Yards"
31522
- }), /*#__PURE__*/React.createElement(OptionItem, {
31523
- value: "mi",
31524
- label: "Miles"
31525
- }))), /*#__PURE__*/React.createElement(LabeledRow, {
31526
- label: "Ruler ticks:"
31527
- }, /*#__PURE__*/React.createElement(SingleSelect, {
31528
- id: "ruler-ticks-select",
31529
- selectedValue: `${this.props.rulerTicks}`,
31530
- onChange: newValue => {
31531
- this.change({
31532
- rulerTicks: newValue
31533
- });
31534
- },
31535
- placeholder: "10",
31536
- style: styles$d.singleSelectShort
31537
- }, [1, 2, 4, 8, 10, 16].map(value => /*#__PURE__*/React.createElement(OptionItem, {
31538
- key: value,
31539
- value: `${value}`,
31540
- label: `${value}`
31541
- }))))))));
31496
+ }))));
31542
31497
  }
31543
31498
  }
31544
31499
  InteractiveGraphSettings.defaultProps = {
@@ -31552,23 +31507,12 @@ InteractiveGraphSettings.defaultProps = {
31552
31507
  backgroundImage: defaultBackgroundImage$1,
31553
31508
  markings: "graph",
31554
31509
  showProtractor: false,
31555
- showRuler: false,
31556
- showTooltips: false,
31557
- rulerLabel: "",
31558
- rulerTicks: 10
31510
+ showTooltips: false
31559
31511
  };
31560
- const styles$d = StyleSheet.create({
31512
+ const styles$e = StyleSheet.create({
31561
31513
  resetSpaceTop: {
31562
31514
  marginTop: 0
31563
31515
  },
31564
- spaceTop: {
31565
- marginTop: spacing.xSmall_8
31566
- },
31567
- singleSelectShort: {
31568
- // Non-standard spacing, but it's the smallest we can go
31569
- // without running into styling issues with the dropdown.
31570
- height: 26
31571
- },
31572
31516
  backgroundUrlInput: {
31573
31517
  border: `1px solid ${color.offBlack32}`,
31574
31518
  borderRadius: spacing.xxxSmall_4,
@@ -31580,7 +31524,7 @@ const styles$d = StyleSheet.create({
31580
31524
  justifyContent: "space-between",
31581
31525
  marginBottom: spacing.xSmall_8
31582
31526
  },
31583
- rulerSection: {
31527
+ protractorSection: {
31584
31528
  marginTop: spacing.xSmall_8,
31585
31529
  borderTop: `1px solid ${color.offBlack16}`,
31586
31530
  paddingTop: spacing.xSmall_8,
@@ -31602,13 +31546,13 @@ const SegmentCountSelector = ({
31602
31546
  const num = +newValue;
31603
31547
  onChange(num);
31604
31548
  },
31605
- style: styles$c.singleSelectShort
31549
+ style: styles$d.singleSelectShort
31606
31550
  }, _.range(1, 7).map(n => /*#__PURE__*/React.createElement(OptionItem, {
31607
31551
  key: n,
31608
31552
  value: `${n}`,
31609
31553
  label: `${n} segment${n > 1 ? "s" : ""}`
31610
31554
  })));
31611
- const styles$c = StyleSheet.create({
31555
+ const styles$d = StyleSheet.create({
31612
31556
  singleSelectShort: {
31613
31557
  // Non-standard spacing, but it's the smallest we can go
31614
31558
  // without running into styling issues with the dropdown.
@@ -31616,77 +31560,142 @@ const styles$c = StyleSheet.create({
31616
31560
  }
31617
31561
  });
31618
31562
 
31619
- const StartCoordSettingsInner = props => {
31563
+ const StartCoordsLine = props => {
31564
+ const {
31565
+ startCoords,
31566
+ onChange
31567
+ } = props;
31568
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
31569
+ style: styles$c.tile
31570
+ }, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 1:"), /*#__PURE__*/React.createElement(Strut, {
31571
+ size: spacing.small_12
31572
+ }), /*#__PURE__*/React.createElement(CoordinatePairInput, {
31573
+ coord: startCoords[0],
31574
+ labels: ["x", "y"],
31575
+ onChange: value => onChange([value, startCoords[1]])
31576
+ })), /*#__PURE__*/React.createElement(View, {
31577
+ style: styles$c.tile
31578
+ }, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 2:"), /*#__PURE__*/React.createElement(Strut, {
31579
+ size: spacing.small_12
31580
+ }), /*#__PURE__*/React.createElement(CoordinatePairInput, {
31581
+ coord: startCoords[1],
31582
+ labels: ["x", "y"],
31583
+ onChange: value => onChange([startCoords[0], value])
31584
+ })));
31585
+ };
31586
+ const styles$c = StyleSheet.create({
31587
+ tile: {
31588
+ backgroundColor: color.fadedBlue8,
31589
+ marginTop: spacing.xSmall_8,
31590
+ padding: spacing.small_12,
31591
+ borderRadius: spacing.xSmall_8,
31592
+ flexDirection: "row",
31593
+ alignItems: "center"
31594
+ }
31595
+ });
31596
+
31597
+ const StartCoordsMultiline = props => {
31620
31598
  const {
31621
- type,
31622
31599
  startCoords,
31600
+ type,
31623
31601
  onChange
31624
31602
  } = props;
31603
+ const graphName = type === "segment" ? "Segment" : "Line";
31604
+ return /*#__PURE__*/React.createElement(React.Fragment, null, startCoords.map((coordPair, i) => /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
31605
+ key: `segment-${i}-start-coords`,
31606
+ header: /*#__PURE__*/React.createElement(LabelLarge, null, `${graphName} ${i + 1}`),
31607
+ expanded: true
31608
+ }, /*#__PURE__*/React.createElement(View, {
31609
+ style: styles$b.nestedTile
31610
+ }, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 1:"), /*#__PURE__*/React.createElement(Strut, {
31611
+ size: spacing.small_12
31612
+ }), /*#__PURE__*/React.createElement(CoordinatePairInput, {
31613
+ coord: coordPair[0],
31614
+ labels: ["x", "y"],
31615
+ onChange: value => {
31616
+ const newCoords = [...startCoords];
31617
+ newCoords[i] = [value, coordPair[1]];
31618
+ onChange(newCoords);
31619
+ }
31620
+ })), /*#__PURE__*/React.createElement(View, {
31621
+ style: styles$b.nestedTile
31622
+ }, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 2:"), /*#__PURE__*/React.createElement(Strut, {
31623
+ size: spacing.small_12
31624
+ }), /*#__PURE__*/React.createElement(CoordinatePairInput, {
31625
+ coord: coordPair[1],
31626
+ labels: ["x", "y"],
31627
+ onChange: value => {
31628
+ const newCoords = [...startCoords];
31629
+ newCoords[i] = [coordPair[0], value];
31630
+ onChange(newCoords);
31631
+ }
31632
+ })))));
31633
+ };
31634
+ const styles$b = StyleSheet.create({
31635
+ nestedTile: {
31636
+ paddingBottom: spacing.small_12,
31637
+ flexDirection: "row",
31638
+ alignItems: "center"
31639
+ }
31640
+ });
31625
31641
 
31626
- // Check if coords is of type CollinearTuple
31642
+ const StartCoordsSettingsInner = props => {
31643
+ const {
31644
+ type,
31645
+ range,
31646
+ step,
31647
+ onChange
31648
+ } = props;
31627
31649
  switch (type) {
31650
+ // Graphs with startCoords of type CollinearTuple
31628
31651
  case "linear":
31629
31652
  case "ray":
31630
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
31631
- style: styles$b.tile
31632
- }, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 1"), /*#__PURE__*/React.createElement(CoordinatePairInput, {
31633
- coord: startCoords[0],
31634
- onChange: value => onChange([value, startCoords[1]])
31635
- })), /*#__PURE__*/React.createElement(View, {
31636
- style: styles$b.tile
31637
- }, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 2"), /*#__PURE__*/React.createElement(CoordinatePairInput, {
31638
- coord: startCoords[1],
31639
- onChange: value => onChange([startCoords[0], value])
31640
- })));
31653
+ // Gets the startCoords from props if they're passed in,
31654
+ // otherwise calculates the default startCoords.
31655
+ const linearCoords = getLineCoords(props, range, step);
31656
+ return /*#__PURE__*/React.createElement(StartCoordsLine, {
31657
+ startCoords: linearCoords,
31658
+ onChange: onChange
31659
+ });
31660
+ // Graphs with startCoords of type CollinearTuple[]
31661
+ case "linear-system":
31662
+ case "segment":
31663
+ const multiLineCoords =
31664
+ // Gets the startCoords from props if they're passed in,
31665
+ // otherwise calculates the default startCoords.
31666
+ type === "segment" ? getSegmentCoords(props, range, step) : getLinearSystemCoords(props, range, step);
31667
+ return /*#__PURE__*/React.createElement(StartCoordsMultiline, {
31668
+ type: type,
31669
+ startCoords: multiLineCoords,
31670
+ onChange: onChange
31671
+ });
31641
31672
  default:
31642
31673
  return null;
31643
31674
  }
31644
31675
  };
31645
- const StartCoordSettings = props => {
31646
- var _props$startCoords;
31676
+ const StartCoordsSettings = props => {
31647
31677
  const {
31648
- type,
31649
31678
  range,
31650
31679
  step,
31651
31680
  onChange
31652
31681
  } = props;
31653
31682
  const [isOpen, setIsOpen] = React.useState(true);
31654
- if (type !== "linear" && type !== "ray") {
31655
- return null;
31656
- }
31657
- const defaultStartCoords = getLineCoords({
31658
- type: type
31659
- }, range, step);
31660
- return /*#__PURE__*/React.createElement(View, {
31661
- style: styles$b.container
31662
- }, /*#__PURE__*/React.createElement(Heading, {
31683
+ return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Heading, {
31663
31684
  isCollapsible: true,
31664
31685
  title: "Start coordinates",
31665
31686
  isOpen: isOpen,
31666
31687
  onToggle: () => setIsOpen(!isOpen)
31667
- }), isOpen && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StartCoordSettingsInner, {
31668
- type: type,
31669
- startCoords: (_props$startCoords = props.startCoords) != null ? _props$startCoords : defaultStartCoords,
31670
- onChange: onChange
31671
- }), /*#__PURE__*/React.createElement(Strut, {
31688
+ }), isOpen && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StartCoordsSettingsInner, props), /*#__PURE__*/React.createElement(Strut, {
31672
31689
  size: spacing.small_12
31673
31690
  }), /*#__PURE__*/React.createElement(Button, {
31674
31691
  startIcon: arrowCounterClockwise,
31675
31692
  kind: "tertiary",
31676
31693
  size: "small",
31677
31694
  onClick: () => {
31678
- onChange(defaultStartCoords);
31695
+ onChange(getDefaultGraphStartCoords(props, range, step));
31679
31696
  }
31680
- }, "Use default start coords")));
31697
+ }, "Use default start coordinates")));
31681
31698
  };
31682
- const styles$b = StyleSheet.create({
31683
- tile: {
31684
- backgroundColor: color.fadedBlue8,
31685
- marginTop: spacing.xSmall_8,
31686
- padding: spacing.small_12,
31687
- borderRadius: spacing.xSmall_8
31688
- }
31689
- });
31690
31699
 
31691
31700
  const {
31692
31701
  InfoTip: InfoTip$b
@@ -31736,8 +31745,8 @@ class InteractiveGraphEditor extends React.Component {
31736
31745
  });
31737
31746
  };
31738
31747
  this.changeStartCoords = coords => {
31739
- var _this$props$graph, _this$props$graph2;
31740
- if (((_this$props$graph = this.props.graph) == null ? void 0 : _this$props$graph.type) !== "linear" && ((_this$props$graph2 = this.props.graph) == null ? void 0 : _this$props$graph2.type) !== "ray") {
31748
+ var _this$props$graph;
31749
+ if (!((_this$props$graph = this.props.graph) != null && _this$props$graph.type)) {
31741
31750
  return;
31742
31751
  }
31743
31752
  const graph = _extends({}, this.props.graph, {
@@ -31765,7 +31774,7 @@ class InteractiveGraphEditor extends React.Component {
31765
31774
  DeprecationMixin.UNSAFE_componentWillMount.call(this);
31766
31775
  }
31767
31776
  render() {
31768
- var _this$props$graph$typ, _this$props$graph3, _this$props$correct, _this$props$correct2, _this$props$correct3, _this$props$correct4, _this$props$correct5, _this$props$correct6, _this$props$correct7, _this$props$correct8, _this$props$correct9, _this$props$correct10, _this$props$correct11, _this$props$graph6, _this$props$graph7, _this$props$apiOption, _this$props$apiOption2, _this$props$apiOption3, _this$props$apiOption4;
31777
+ var _this$props$graph$typ, _this$props$graph2, _this$props$correct, _this$props$correct2, _this$props$correct3, _this$props$correct4, _this$props$correct5, _this$props$correct6, _this$props$correct7, _this$props$correct8, _this$props$correct9, _this$props$correct10, _this$props$correct11, _this$props$graph5, _this$props$apiOption, _this$props$apiOption2, _this$props$apiOption3, _this$props$apiOption4;
31769
31778
  let graph;
31770
31779
  let equationString;
31771
31780
  const gridStep = this.props.gridStep || Util.getGridStep(this.props.range, this.props.step, interactiveSizes.defaultBoxSize);
@@ -31787,10 +31796,7 @@ class InteractiveGraphEditor extends React.Component {
31787
31796
  backgroundImage: this.props.backgroundImage,
31788
31797
  markings: this.props.markings,
31789
31798
  showProtractor: this.props.showProtractor,
31790
- showRuler: this.props.showRuler,
31791
31799
  showTooltips: this.props.showTooltips,
31792
- rulerLabel: this.props.rulerLabel,
31793
- rulerTicks: this.props.rulerTicks,
31794
31800
  lockedFigures: this.props.lockedFigures,
31795
31801
  trackInteraction: function () {},
31796
31802
  onChange: newProps => {
@@ -31832,7 +31838,7 @@ class InteractiveGraphEditor extends React.Component {
31832
31838
  return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(LabeledRow, {
31833
31839
  label: "Type of Graph:"
31834
31840
  }, /*#__PURE__*/React.createElement(GraphTypeSelector, {
31835
- graphType: (_this$props$graph$typ = (_this$props$graph3 = this.props.graph) == null ? void 0 : _this$props$graph3.type) != null ? _this$props$graph$typ : InteractiveGraph.defaultProps.graph.type,
31841
+ graphType: (_this$props$graph$typ = (_this$props$graph2 = this.props.graph) == null ? void 0 : _this$props$graph2.type) != null ? _this$props$graph$typ : InteractiveGraph.defaultProps.graph.type,
31836
31842
  onChange: type => {
31837
31843
  this.props.onChange({
31838
31844
  graph: {
@@ -31920,8 +31926,8 @@ class InteractiveGraphEditor extends React.Component {
31920
31926
  // Don't show indeterminate checkbox state
31921
31927
  !!((_this$props$correct8 = this.props.correct) != null && _this$props$correct8.showAngles),
31922
31928
  onChange: () => {
31923
- var _this$props$graph4;
31924
- if (((_this$props$graph4 = this.props.graph) == null ? void 0 : _this$props$graph4.type) === "polygon") {
31929
+ var _this$props$graph3;
31930
+ if (((_this$props$graph3 = this.props.graph) == null ? void 0 : _this$props$graph3.type) === "polygon") {
31925
31931
  this.props.onChange({
31926
31932
  correct: _extends({}, this.props.correct, {
31927
31933
  showAngles: !this.props.correct.showAngles
@@ -31940,8 +31946,8 @@ class InteractiveGraphEditor extends React.Component {
31940
31946
  // Don't show indeterminate checkbox state
31941
31947
  !!((_this$props$correct9 = this.props.correct) != null && _this$props$correct9.showSides),
31942
31948
  onChange: () => {
31943
- var _this$props$graph5;
31944
- if (((_this$props$graph5 = this.props.graph) == null ? void 0 : _this$props$graph5.type) === "polygon") {
31949
+ var _this$props$graph4;
31950
+ if (((_this$props$graph4 = this.props.graph) == null ? void 0 : _this$props$graph4.type) === "polygon") {
31945
31951
  this.props.onChange({
31946
31952
  correct: _extends({}, this.props.correct, {
31947
31953
  showSides: !this.props.correct.showSides
@@ -31969,7 +31975,7 @@ class InteractiveGraphEditor extends React.Component {
31969
31975
  }
31970
31976
  });
31971
31977
  }
31972
- })), (((_this$props$graph6 = this.props.graph) == null ? void 0 : _this$props$graph6.type) === "linear" || ((_this$props$graph7 = this.props.graph) == null ? void 0 : _this$props$graph7.type) === "ray") && ((_this$props$apiOption = this.props.apiOptions.flags) == null || (_this$props$apiOption = _this$props$apiOption.mafs) == null ? void 0 : _this$props$apiOption["start-coords-ui"]) && /*#__PURE__*/React.createElement(StartCoordSettings, _extends({}, this.props.graph, {
31978
+ })), ((_this$props$graph5 = this.props.graph) == null ? void 0 : _this$props$graph5.type) && ((_this$props$apiOption = this.props.apiOptions.flags) == null || (_this$props$apiOption = _this$props$apiOption.mafs) == null ? void 0 : _this$props$apiOption["start-coords-ui"]) && /*#__PURE__*/React.createElement(StartCoordsSettings, _extends({}, this.props.graph, {
31973
31979
  range: this.props.range,
31974
31980
  step: this.props.step,
31975
31981
  onChange: this.changeStartCoords
@@ -31984,10 +31990,7 @@ class InteractiveGraphEditor extends React.Component {
31984
31990
  backgroundImage: this.props.backgroundImage,
31985
31991
  markings: this.props.markings,
31986
31992
  showProtractor: this.props.showProtractor,
31987
- showRuler: this.props.showRuler,
31988
31993
  showTooltips: this.props.showTooltips,
31989
- rulerLabel: this.props.rulerLabel,
31990
- rulerTicks: this.props.rulerTicks,
31991
31994
  onChange: this.props.onChange
31992
31995
  }), this.props.correct.type === "polygon" && /*#__PURE__*/React.createElement(LabeledRow, {
31993
31996
  label: "Student answer must"
@@ -32040,24 +32043,24 @@ class InteractiveGraphEditor extends React.Component {
32040
32043
  // is copied from the question editor and pasted into the hint editor
32041
32044
  // (double brackets in the markdown).
32042
32045
  serialize() {
32043
- const json = _.pick(this.props, "step", "backgroundImage", "markings", "labels", "showProtractor", "showRuler", "showTooltips", "rulerLabel", "rulerTicks", "range", "gridStep", "snapStep", "lockedFigures");
32046
+ const json = _.pick(this.props, "step", "backgroundImage", "markings", "labels", "showProtractor", "showTooltips", "range", "gridStep", "snapStep", "lockedFigures");
32044
32047
 
32045
32048
  // eslint-disable-next-line react/no-string-refs
32046
32049
  const graph = this.refs.graph;
32047
32050
  if (graph) {
32048
- var _this$props$graph8;
32051
+ var _this$props$graph6;
32049
32052
  // @ts-expect-error TS2339 Property 'getUserInput' does not exist on type 'ReactInstance'. Property 'getUserInput' does not exist on type 'Component<any, {}, any>'.
32050
32053
  const correct = graph && graph.getUserInput();
32051
32054
  _.extend(json, {
32052
32055
  graph: {
32053
32056
  type: correct.type,
32054
- startCoords: (_this$props$graph8 = this.props.graph) == null ? void 0 : _this$props$graph8.startCoords
32057
+ startCoords: (_this$props$graph6 = this.props.graph) == null ? void 0 : _this$props$graph6.startCoords
32055
32058
  },
32056
32059
  correct: correct
32057
32060
  });
32058
32061
  _.each(["allowReflexAngles", "angleOffsetDeg", "numPoints", "numSides", "numSegments", "showAngles", "showSides", "snapTo", "snapDegrees"], function (key) {
32059
32062
  if (_.has(correct, key)) {
32060
- // @ts-expect-error - TS2339 - Property 'graph' does not exist on type 'Pick<any, "step" | "range" | "backgroundImage" | "snapStep" | "labels" | "showTooltips" | "markings" | "gridStep" | "showProtractor" | "showRuler" | "rulerLabel" | "rulerTicks">'.
32063
+ // @ts-expect-error - TS2339 - Property 'graph' does not exist on type 'Pick<any, "step" | "range" | "backgroundImage" | "snapStep" | "labels" | "showTooltips" | "markings" | "gridStep" | "showProtractor">'.
32061
32064
  json.graph[key] = correct[key];
32062
32065
  }
32063
32066
  });
@@ -33757,7 +33760,7 @@ MatrixEditor.defaultProps = {
33757
33760
 
33758
33761
  const {
33759
33762
  InfoTip: InfoTip$9,
33760
- NumberInput: NumberInput$8,
33763
+ NumberInput: NumberInput$7,
33761
33764
  PropCheckBox: PropCheckBox$5,
33762
33765
  RangeInput: RangeInput$2
33763
33766
  } = components;
@@ -33817,14 +33820,14 @@ class MeasurerEditor extends React.Component {
33817
33820
  className: "perseus-widget-row"
33818
33821
  }, /*#__PURE__*/React.createElement("label", {
33819
33822
  className: "perseus-widget-left-col"
33820
- }, "Pixels from top:", " ", /*#__PURE__*/React.createElement(NumberInput$8, {
33823
+ }, "Pixels from top:", " ", /*#__PURE__*/React.createElement(NumberInput$7, {
33821
33824
  placeholder: 0,
33822
33825
  onChange: this._changeTop,
33823
33826
  value: image.top,
33824
33827
  useArrowKeys: true
33825
33828
  })), /*#__PURE__*/React.createElement("label", {
33826
33829
  className: "perseus-widget-right-col"
33827
- }, "Pixels from left:", " ", /*#__PURE__*/React.createElement(NumberInput$8, {
33830
+ }, "Pixels from left:", " ", /*#__PURE__*/React.createElement(NumberInput$7, {
33828
33831
  placeholder: 0,
33829
33832
  onChange: this._changeLeft,
33830
33833
  value: image.left,
@@ -33870,14 +33873,14 @@ class MeasurerEditor extends React.Component {
33870
33873
  key: n,
33871
33874
  value: n
33872
33875
  }, n);
33873
- })))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Ruler pixels per unit:", " ", /*#__PURE__*/React.createElement(NumberInput$8, {
33876
+ })))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Ruler pixels per unit:", " ", /*#__PURE__*/React.createElement(NumberInput$7, {
33874
33877
  placeholder: 40
33875
33878
  // @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
33876
33879
  ,
33877
33880
  onChange: this.change("rulerPixels"),
33878
33881
  value: this.props.rulerPixels,
33879
33882
  useArrowKeys: true
33880
- }))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Ruler length in units:", " ", /*#__PURE__*/React.createElement(NumberInput$8, {
33883
+ }))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Ruler length in units:", " ", /*#__PURE__*/React.createElement(NumberInput$7, {
33881
33884
  placeholder: 10
33882
33885
  // @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
33883
33886
  ,
@@ -33914,7 +33917,7 @@ MeasurerEditor.defaultProps = {
33914
33917
  };
33915
33918
 
33916
33919
  const {
33917
- NumberInput: NumberInput$7,
33920
+ NumberInput: NumberInput$6,
33918
33921
  TextInput: TextInput$4
33919
33922
  } = components;
33920
33923
  class MoleculeWidgetEditor extends React.Component {
@@ -33943,7 +33946,7 @@ class MoleculeWidgetEditor extends React.Component {
33943
33946
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "SMILES:\xA0", /*#__PURE__*/React.createElement(TextInput$4, {
33944
33947
  onChange: this.updateMolecule,
33945
33948
  value: this.props.smiles
33946
- }))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Rotation (deg):\xA0", /*#__PURE__*/React.createElement(NumberInput$7, {
33949
+ }))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Rotation (deg):\xA0", /*#__PURE__*/React.createElement(NumberInput$6, {
33947
33950
  onChange: this.updateRotation,
33948
33951
  value: this.props.rotationAngle
33949
33952
  }))));
@@ -33959,7 +33962,7 @@ MoleculeWidgetEditor.widgetName = "molecule-renderer";
33959
33962
  const {
33960
33963
  ButtonGroup: ButtonGroup$1,
33961
33964
  InfoTip: InfoTip$8,
33962
- NumberInput: NumberInput$6,
33965
+ NumberInput: NumberInput$5,
33963
33966
  PropCheckBox: PropCheckBox$4,
33964
33967
  RangeInput: RangeInput$1
33965
33968
  } = components;
@@ -34110,7 +34113,7 @@ class NumberLineEditor extends React.Component {
34110
34113
  }, "\u2264"), /*#__PURE__*/React.createElement("option", {
34111
34114
  value: "ge",
34112
34115
  "aria-label": "Greater than or equal"
34113
- }, "\u2265")), " ", /*#__PURE__*/React.createElement(NumberInput$6, {
34116
+ }, "\u2265")), " ", /*#__PURE__*/React.createElement(NumberInput$5, {
34114
34117
  value: this.props.correctX,
34115
34118
  format: this.props.labelStyle
34116
34119
  // eslint-disable-next-line react/jsx-no-bind
@@ -34122,7 +34125,7 @@ class NumberLineEditor extends React.Component {
34122
34125
  useArrowKeys: true
34123
34126
  }), /*#__PURE__*/React.createElement(InfoTip$8, null, /*#__PURE__*/React.createElement("p", null, "This is the correct answer. The answer is validated (as right or wrong) by using only the end position of the point and the relation (=, <, >, \u2264, \u2265)."))), /*#__PURE__*/React.createElement("div", {
34124
34127
  className: "perseus-widget-row"
34125
- }, this.props.static ? /*#__PURE__*/React.createElement("label", null, "Range:") : /*#__PURE__*/React.createElement("label", null, "Position:", " ", /*#__PURE__*/React.createElement(NumberInput$6, {
34128
+ }, this.props.static ? /*#__PURE__*/React.createElement("label", null, "Range:") : /*#__PURE__*/React.createElement("label", null, "Position:", " ", /*#__PURE__*/React.createElement(NumberInput$5, {
34126
34129
  value: this.props.initialX,
34127
34130
  format: this.props.labelStyle
34128
34131
  // eslint-disable-next-line react/jsx-no-bind
@@ -34142,7 +34145,7 @@ class NumberLineEditor extends React.Component {
34142
34145
  className: "perseus-widget-row"
34143
34146
  }, /*#__PURE__*/React.createElement("div", {
34144
34147
  className: "perseus-widget-left-col"
34145
- }, "Labels:", " ", /*#__PURE__*/React.createElement(NumberInput$6, {
34148
+ }, "Labels:", " ", /*#__PURE__*/React.createElement(NumberInput$5, {
34146
34149
  value: labelRange[0],
34147
34150
  placeholder: range[0],
34148
34151
  format: this.props.labelStyle,
@@ -34151,7 +34154,7 @@ class NumberLineEditor extends React.Component {
34151
34154
  ,
34152
34155
  onChange: this.onLabelRangeChange.bind(this, 0),
34153
34156
  useArrowKeys: true
34154
- }), /*#__PURE__*/React.createElement("span", null, " & "), /*#__PURE__*/React.createElement(NumberInput$6, {
34157
+ }), /*#__PURE__*/React.createElement("span", null, " & "), /*#__PURE__*/React.createElement(NumberInput$5, {
34155
34158
  value: labelRange[1],
34156
34159
  placeholder: range[1],
34157
34160
  format: this.props.labelStyle,
@@ -34189,7 +34192,7 @@ class NumberLineEditor extends React.Component {
34189
34192
  onChange: this.props.onChange
34190
34193
  })), /*#__PURE__*/React.createElement("div", {
34191
34194
  className: "perseus-widget-row"
34192
- }, isTickCtrl && /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("label", null, "Start num divisions at", " ", /*#__PURE__*/React.createElement(NumberInput$6, {
34195
+ }, isTickCtrl && /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("label", null, "Start num divisions at", " ", /*#__PURE__*/React.createElement(NumberInput$5, {
34193
34196
  value: this.props.numDivisions || null,
34194
34197
  format: "decimal",
34195
34198
  onChange: this.onNumDivisionsChange,
@@ -34198,7 +34201,7 @@ class NumberLineEditor extends React.Component {
34198
34201
  },
34199
34202
  placeholder: width / this.props.tickStep,
34200
34203
  useArrowKeys: true
34201
- })), /*#__PURE__*/React.createElement(InfoTip$8, null, /*#__PURE__*/React.createElement("p", null, "This controls the number (and position) of the tick marks. The number of divisions is constrained to", " " + divisionRange[0] + EN_DASH + divisionRange[1], ".", /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("strong", null, "Note:"), " The user will be able to specify the number of divisions in a number input."))), !isTickCtrl && /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("label", null, "Num divisions:", " ", /*#__PURE__*/React.createElement(NumberInput$6, {
34204
+ })), /*#__PURE__*/React.createElement(InfoTip$8, null, /*#__PURE__*/React.createElement("p", null, "This controls the number (and position) of the tick marks. The number of divisions is constrained to", " " + divisionRange[0] + EN_DASH + divisionRange[1], ".", /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("strong", null, "Note:"), " The user will be able to specify the number of divisions in a number input."))), !isTickCtrl && /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("label", null, "Num divisions:", " ", /*#__PURE__*/React.createElement(NumberInput$5, {
34202
34205
  value: this.props.numDivisions || null,
34203
34206
  format: "decimal",
34204
34207
  onChange: this.onNumDivisionsChange,
@@ -34207,7 +34210,7 @@ class NumberLineEditor extends React.Component {
34207
34210
  },
34208
34211
  placeholder: width / this.props.tickStep,
34209
34212
  useArrowKeys: true
34210
- })), " ", /*#__PURE__*/React.createElement("label", null, "or tick step:", " ", /*#__PURE__*/React.createElement(NumberInput$6, {
34213
+ })), " ", /*#__PURE__*/React.createElement("label", null, "or tick step:", " ", /*#__PURE__*/React.createElement(NumberInput$5, {
34211
34214
  value: this.props.tickStep || null,
34212
34215
  format: this.props.labelStyle,
34213
34216
  onChange: this.onTickStepChange,
@@ -34218,7 +34221,7 @@ class NumberLineEditor extends React.Component {
34218
34221
  useArrowKeys: true
34219
34222
  })), /*#__PURE__*/React.createElement(InfoTip$8, null, /*#__PURE__*/React.createElement("p", null, "This controls the number (and position) of the tick marks; you can either set the number of divisions (2 divisions would split the entire range in two halves), or the tick step (the distance between ticks) and the other value will be updated accordingly.", " ", /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("strong", null, "Note:"), " There is no check to see if labels coordinate with the tick marks, which may be confusing for users if the blue labels and black ticks are off-step.")))), /*#__PURE__*/React.createElement("div", {
34220
34223
  className: "perseus-widget-row"
34221
- }, /*#__PURE__*/React.createElement("label", null, "Snap increments per tick:", " ", /*#__PURE__*/React.createElement(NumberInput$6, {
34224
+ }, /*#__PURE__*/React.createElement("label", null, "Snap increments per tick:", " ", /*#__PURE__*/React.createElement(NumberInput$5, {
34222
34225
  value: snapDivisions,
34223
34226
  checkValidity: val => val > 0,
34224
34227
  format: this.props.labelStyle
@@ -34266,9 +34269,9 @@ NumberLineEditor.defaultProps = {
34266
34269
  const {
34267
34270
  ButtonGroup,
34268
34271
  InfoTip: InfoTip$7,
34269
- InlineIcon: InlineIcon$2,
34272
+ InlineIcon: InlineIcon$1,
34270
34273
  MultiButtonGroup,
34271
- NumberInput: NumberInput$5,
34274
+ NumberInput: NumberInput$4,
34272
34275
  PropCheckBox: PropCheckBox$3,
34273
34276
  TextInput: TextInput$3
34274
34277
  } = components;
@@ -34450,7 +34453,7 @@ class NumericInputEditor extends React.Component {
34450
34453
  })));
34451
34454
  const maxError = i => /*#__PURE__*/React.createElement("div", {
34452
34455
  className: "perseus-widget-row"
34453
- }, /*#__PURE__*/React.createElement("label", null, "Max error", " ", /*#__PURE__*/React.createElement(NumberInput$5, {
34456
+ }, /*#__PURE__*/React.createElement("label", null, "Max error", " ", /*#__PURE__*/React.createElement(NumberInput$4, {
34454
34457
  className: "max-error",
34455
34458
  value: answers[i]["maxError"],
34456
34459
  onChange: this.updateAnswer(i, "maxError"),
@@ -34525,7 +34528,7 @@ class NumericInputEditor extends React.Component {
34525
34528
  key: i
34526
34529
  }, /*#__PURE__*/React.createElement("div", {
34527
34530
  className: "input-answer-editor-value-container" + (answer.maxError ? " with-max-error" : "")
34528
- }, /*#__PURE__*/React.createElement(NumberInput$5, {
34531
+ }, /*#__PURE__*/React.createElement(NumberInput$4, {
34529
34532
  value: answer.value,
34530
34533
  className: "numeric-input-value",
34531
34534
  placeholder: "answer",
@@ -34572,7 +34575,7 @@ class NumericInputEditor extends React.Component {
34572
34575
  className: "max-error-container"
34573
34576
  }, /*#__PURE__*/React.createElement("div", {
34574
34577
  className: "max-error-plusmn"
34575
- }, "\xB1"), /*#__PURE__*/React.createElement(NumberInput$5, {
34578
+ }, "\xB1"), /*#__PURE__*/React.createElement(NumberInput$4, {
34576
34579
  placeholder: 0,
34577
34580
  value: answers[i]["maxError"],
34578
34581
  format: _.last(answer.answerForms || []),
@@ -34600,7 +34603,7 @@ class NumericInputEditor extends React.Component {
34600
34603
  this.onTrashAnswer(i);
34601
34604
  },
34602
34605
  onKeyDown: e => this.onSpace(e, this.onTrashAnswer)
34603
- }, /*#__PURE__*/React.createElement(InlineIcon$2, iconTrash$1)), /*#__PURE__*/React.createElement("a", {
34606
+ }, /*#__PURE__*/React.createElement(InlineIcon$1, iconTrash$1)), /*#__PURE__*/React.createElement("a", {
34604
34607
  href: "#",
34605
34608
  className: "options-toggle",
34606
34609
  "aria-label": "Toggle options",
@@ -34611,7 +34614,7 @@ class NumericInputEditor extends React.Component {
34611
34614
  this.onToggleOptions(i);
34612
34615
  },
34613
34616
  onKeyDown: e => this.onSpace(e, this.onToggleOptions)
34614
- }, /*#__PURE__*/React.createElement(InlineIcon$2, iconGear))), /*#__PURE__*/React.createElement("div", {
34617
+ }, /*#__PURE__*/React.createElement(InlineIcon$1, iconGear))), /*#__PURE__*/React.createElement("div", {
34615
34618
  className: "input-answer-editor-message"
34616
34619
  }, editor), this.state.showOptions[i] && /*#__PURE__*/React.createElement("div", {
34617
34620
  className: "options-container"
@@ -34834,7 +34837,7 @@ PassageEditor.defaultProps = {
34834
34837
 
34835
34838
  const {
34836
34839
  InfoTip: InfoTip$4,
34837
- NumberInput: NumberInput$4,
34840
+ NumberInput: NumberInput$3,
34838
34841
  TextInput: TextInput$2
34839
34842
  } = components;
34840
34843
  class PassageRefEditor extends React.Component {
@@ -34848,12 +34851,12 @@ class PassageRefEditor extends React.Component {
34848
34851
  };
34849
34852
  }
34850
34853
  render() {
34851
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Passage Number: ", /*#__PURE__*/React.createElement(NumberInput$4, {
34854
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Passage Number: ", /*#__PURE__*/React.createElement(NumberInput$3, {
34852
34855
  value: this.props.passageNumber
34853
34856
  // @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
34854
34857
  ,
34855
34858
  onChange: this.change("passageNumber")
34856
- }))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Reference Number: ", /*#__PURE__*/React.createElement(NumberInput$4, {
34859
+ }))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Reference Number: ", /*#__PURE__*/React.createElement(NumberInput$3, {
34857
34860
  value: this.props.referenceNumber
34858
34861
  // @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
34859
34862
  ,
@@ -34912,7 +34915,7 @@ PassageRefTargetEditor.defaultProps = {
34912
34915
 
34913
34916
  const {
34914
34917
  InfoTip: InfoTip$3,
34915
- NumberInput: NumberInput$3,
34918
+ NumberInput: NumberInput$2,
34916
34919
  RangeInput,
34917
34920
  TextListEditor: TextListEditor$1
34918
34921
  } = components;
@@ -35141,7 +35144,7 @@ class PlotterEditor extends React.Component {
35141
35144
  className: "set-from-scale-box"
35142
35145
  }, /*#__PURE__*/React.createElement("span", {
35143
35146
  className: "categories-title"
35144
- }, "Set Categories From Scale"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Tick Step:", " ", /*#__PURE__*/React.createElement(NumberInput$3, {
35147
+ }, "Set Categories From Scale"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Tick Step:", " ", /*#__PURE__*/React.createElement(NumberInput$2, {
35145
35148
  placeholder: 1,
35146
35149
  useArrowKeys: true,
35147
35150
  value: this.state.tickStep,
@@ -35153,7 +35156,7 @@ class PlotterEditor extends React.Component {
35153
35156
  onChange: this.handleChangeRange
35154
35157
  }))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", {
35155
35158
  onClick: this.setCategoriesFromScale
35156
- }, "Set Categories", " "))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Label Interval:", " ", /*#__PURE__*/React.createElement(NumberInput$3, {
35159
+ }, "Set Categories", " "))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, "Label Interval:", " ", /*#__PURE__*/React.createElement(NumberInput$2, {
35157
35160
  useArrowKeys: true,
35158
35161
  value: this.props.labelInterval,
35159
35162
  onChange: this.changeLabelInterval
@@ -35223,7 +35226,7 @@ PlotterEditor.defaultProps = _extends({}, editorDefaults, {
35223
35226
  * This editor is for embedding Khan Academy Python programs.
35224
35227
  */
35225
35228
  const {
35226
- NumberInput: NumberInput$2,
35229
+ NumberInput: NumberInput$1,
35227
35230
  TextInput: TextInput$1
35228
35231
  } = components;
35229
35232
  function validateOptions(height, programID) {
@@ -35262,7 +35265,7 @@ class PythonProgramEditor extends React.Component {
35262
35265
  value: this.props.programID,
35263
35266
  onChange: this.change("programID"),
35264
35267
  placeholder: "123"
35265
- })), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("label", null, "Height:", " ", /*#__PURE__*/React.createElement(NumberInput$2, {
35268
+ })), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("label", null, "Height:", " ", /*#__PURE__*/React.createElement(NumberInput$1, {
35266
35269
  value: this.props.height,
35267
35270
  onChange: this.change("height"),
35268
35271
  placeholder: "400"
@@ -35276,7 +35279,7 @@ PythonProgramEditor.defaultProps = {
35276
35279
  };
35277
35280
 
35278
35281
  const {
35279
- InlineIcon: InlineIcon$1,
35282
+ InlineIcon,
35280
35283
  PropCheckBox: PropCheckBox$1
35281
35284
  } = components;
35282
35285
  const {
@@ -35320,7 +35323,7 @@ class ChoiceEditor extends React.Component {
35320
35323
  this.props.onDelete();
35321
35324
  },
35322
35325
  title: "Remove this choice"
35323
- }, /*#__PURE__*/React.createElement(InlineIcon$1, iconTrash));
35326
+ }, /*#__PURE__*/React.createElement(InlineIcon, iconTrash));
35324
35327
  return /*#__PURE__*/React.createElement("div", {
35325
35328
  className: "choice-clue-editors"
35326
35329
  }, /*#__PURE__*/React.createElement("div", {
@@ -35524,13 +35527,13 @@ class RadioEditor extends React.Component {
35524
35527
  // eslint-disable-next-line react/jsx-no-bind
35525
35528
  ,
35526
35529
  onClick: this.addChoice.bind(this, false)
35527
- }, /*#__PURE__*/React.createElement(InlineIcon$1, iconPlus), " Add a choice", " "), !this.props.hasNoneOfTheAbove && /*#__PURE__*/React.createElement("a", {
35530
+ }, /*#__PURE__*/React.createElement(InlineIcon, iconPlus), " Add a choice", " "), !this.props.hasNoneOfTheAbove && /*#__PURE__*/React.createElement("a", {
35528
35531
  className: "simple-button",
35529
35532
  href: "#"
35530
35533
  // eslint-disable-next-line react/jsx-no-bind
35531
35534
  ,
35532
35535
  onClick: this.addChoice.bind(this, true)
35533
- }, /*#__PURE__*/React.createElement(InlineIcon$1, iconPlus), " None of the above", " ")));
35536
+ }, /*#__PURE__*/React.createElement(InlineIcon, iconPlus), " None of the above", " ")));
35534
35537
  }
35535
35538
  }
35536
35539
  RadioEditor.propTypes = _extends({}, Changeable.propTypes, {
@@ -35681,7 +35684,7 @@ SorterEditor.defaultProps = {
35681
35684
  /* eslint-disable react/sort-comp */
35682
35685
  const {
35683
35686
  InfoTip: InfoTip$1,
35684
- NumberInput: NumberInput$1
35687
+ NumberInput
35685
35688
  } = components;
35686
35689
  const Table = TableWidget.widget;
35687
35690
  class TableEditor extends React.Component {
@@ -35746,7 +35749,7 @@ class TableEditor extends React.Component {
35746
35749
  });
35747
35750
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
35748
35751
  className: "perseus-widget-row"
35749
- }, /*#__PURE__*/React.createElement("label", null, "Number of columns:", " ", /*#__PURE__*/React.createElement(NumberInput$1, {
35752
+ }, /*#__PURE__*/React.createElement("label", null, "Number of columns:", " ", /*#__PURE__*/React.createElement(NumberInput, {
35750
35753
  ref: this.numberOfColumns,
35751
35754
  value: this.props.columns,
35752
35755
  onChange: val => {
@@ -35757,7 +35760,7 @@ class TableEditor extends React.Component {
35757
35760
  useArrowKeys: true
35758
35761
  }))), /*#__PURE__*/React.createElement("div", {
35759
35762
  className: "perseus-widget-row"
35760
- }, /*#__PURE__*/React.createElement("label", null, "Number of rows:", " ", /*#__PURE__*/React.createElement(NumberInput$1
35763
+ }, /*#__PURE__*/React.createElement("label", null, "Number of rows:", " ", /*#__PURE__*/React.createElement(NumberInput
35761
35764
  // eslint-disable-next-line react/no-string-refs
35762
35765
  , {
35763
35766
  ref: "numberOfRows",
@@ -35792,234 +35795,6 @@ TableEditor.defaultProps = function () {
35792
35795
  };
35793
35796
  }();
35794
35797
 
35795
- const {
35796
- InlineIcon,
35797
- NumberInput
35798
- } = components;
35799
- const {
35800
- iconOk,
35801
- iconRemove
35802
- } = icons;
35803
-
35804
- // TODO(joel): teach KAS how to accept an answer only if it's expressed in
35805
- // terms of a certain type.
35806
- // TODO(joel): Allow sigfigs within a range rather than an exact expected
35807
- // value?
35808
-
35809
- const ALL = "all";
35810
- const SOME = "some";
35811
- const MAX_SIGFIGS = 10;
35812
- const sigfigPrint = function sigfigPrint(num, sigfigs) {
35813
- return displaySigFigs(num, sigfigs, -MAX_SIGFIGS, false);
35814
- };
35815
-
35816
- // Extract the primitive units from a unit expression. This first simplifies
35817
- // `expr` to a `Mul` like "5 kg m / s^2" then removes the first term.
35818
- const primUnits = function primUnits(expr) {
35819
- return expr.simplify().asMul().partition()[1].flatten().simplify();
35820
- };
35821
- // Show the name of a unit and whether it's recognized by KAS.
35822
- //
35823
- // In the future I plan for this to show an example of a thing that would be
35824
- // accepted in that unit.
35825
- class UnitExample extends React.Component {
35826
- constructor(...args) {
35827
- super(...args);
35828
- this._checkValidity = ({
35829
- name,
35830
- original,
35831
- sigfigs
35832
- }) => {
35833
- const parseResult = KAS.unitParse(name);
35834
- let solvedExample = "";
35835
-
35836
- // A unit is valid if it parses and is equivalent to the original.
35837
- let valid = true;
35838
- if (parseResult.parsed && original) {
35839
- const x = new KAS.Var("x");
35840
- const {
35841
- unit
35842
- } = parseResult;
35843
- const equality = new KAS.Eq(original, "=", new KAS.Mul(x, unit));
35844
- try {
35845
- const answer = equality.solveLinearEquationForVariable(x);
35846
-
35847
- // The third parameter is the least significant decimal place.
35848
- // I.e. the index of the last place you care about
35849
- // (543210.(-1)(-2)(-3) etc). We use -10 because that should
35850
- // always be safe since we only care up to maximum 10 decimal
35851
- // places.
35852
- solvedExample = sigfigPrint(answer.eval(), sigfigs);
35853
- valid = KAS.compare(primUnits(original), primUnits(unit)).equal;
35854
- } catch (e) {
35855
- valid = false;
35856
- }
35857
- } else {
35858
- valid = false;
35859
- }
35860
- this.setState({
35861
- valid,
35862
- solvedExample
35863
- });
35864
- };
35865
- }
35866
- // TODO(jangmi, CP-3288): Remove usage of `UNSAFE_componentWillMount`
35867
- UNSAFE_componentWillMount() {
35868
- // @ts-expect-error - TS2345 - Argument of type 'Readonly<any> & Readonly<{ children?: ReactNode; }>' is not assignable to parameter of type '{ name: any; original: any; sigfigs: any; }'.
35869
- this._checkValidity(this.props);
35870
- }
35871
- UNSAFE_componentWillReceiveProps(nextProps) {
35872
- this._checkValidity(nextProps);
35873
- }
35874
- render() {
35875
- let icon;
35876
- if (this.state.valid) {
35877
- icon = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", {
35878
- className: "unit-example-okay"
35879
- }, /*#__PURE__*/React.createElement(InlineIcon, iconOk)), this.state.solvedExample);
35880
- } else {
35881
- icon = /*#__PURE__*/React.createElement("span", {
35882
- className: "unit-example-not-okay"
35883
- }, /*#__PURE__*/React.createElement(InlineIcon, iconRemove));
35884
- }
35885
- return /*#__PURE__*/React.createElement("div", null, icon, " ", this.props.name);
35886
- }
35887
- }
35888
- class UnitInputEditor extends React.Component {
35889
- constructor(_props) {
35890
- super(_props);
35891
- this.parsed = void 0;
35892
- this.groupId = void 0;
35893
- this.original = void 0;
35894
- this.change = (...args) => {
35895
- return Changeable.change.apply(this, args);
35896
- };
35897
- this.handleAcceptingUnitsChange = event => {
35898
- const acceptingUnits = event.target.value.split(",").map(str => str.trim()).filter(str => str !== "");
35899
- // @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
35900
- this.change({
35901
- acceptingUnits
35902
- });
35903
- };
35904
- this.handleSigfigChange = sigfigs => {
35905
- // @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
35906
- this.change({
35907
- sigfigs
35908
- });
35909
- };
35910
- this._checkSigfigValidity = sigfigs => {
35911
- return sigfigs > 0 && sigfigs <= MAX_SIGFIGS;
35912
- };
35913
- this._setAccepting = val => {
35914
- // @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
35915
- this.change({
35916
- accepting: val
35917
- });
35918
- };
35919
- this._doOriginal = props => {
35920
- const tryParse = KAS.unitParse(props.value);
35921
- this.parsed = false;
35922
-
35923
- // Only update this state if the unit parsed *and* it has a magnitude
35924
- // attached to it. KAS can also parse units without magnitudes ("1.2
35925
- // g" vs "g").
35926
- if (tryParse.parsed && tryParse.type === "unitMagnitude") {
35927
- this.original = tryParse.expr;
35928
- this.parsed = true;
35929
- }
35930
- };
35931
- this.onChange = event => {
35932
- this.props.onChange({
35933
- value: event.target.value
35934
- });
35935
- };
35936
- this.getSaveWarnings = () => {
35937
- const {
35938
- value,
35939
- accepting,
35940
- acceptingUnits
35941
- } = this.props;
35942
- const warnings = [];
35943
- const tryParse = KAS.unitParse(value);
35944
- if (!tryParse.parsed) {
35945
- warnings.push("Answer did not parse");
35946
- }
35947
- if (accepting === SOME && acceptingUnits.length === 0) {
35948
- warnings.push("There are no accepted units");
35949
- }
35950
- return warnings;
35951
- };
35952
- this.serialize = () => {
35953
- return EditorJsonify.serialize.call(this);
35954
- };
35955
- this.groupId = _.uniqueId("accepting");
35956
- this._doOriginal(_props);
35957
- }
35958
- UNSAFE_componentWillReceiveProps(nextProps) {
35959
- this._doOriginal(nextProps);
35960
- }
35961
- render() {
35962
- const {
35963
- acceptingUnits = [],
35964
- accepting
35965
- } = this.props;
35966
- let acceptingElem = null;
35967
- if (accepting === SOME) {
35968
- const unitsArr = acceptingUnits.map((name, i) => /*#__PURE__*/React.createElement(UnitExample, {
35969
- name: name,
35970
- original: this.original || null,
35971
- sigfigs: this.props.sigfigs,
35972
- key: i
35973
- }));
35974
-
35975
- // @ts-expect-error - TS2322 - Type 'Element' is not assignable to type 'null'.
35976
- acceptingElem = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("input", {
35977
- type: "text",
35978
- defaultValue: acceptingUnits.join(", "),
35979
- onChange: this.handleAcceptingUnitsChange
35980
- }), " ", "(comma-separated)", unitsArr);
35981
- }
35982
- return /*#__PURE__*/React.createElement("div", {
35983
- className: "unit-editor"
35984
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("input", {
35985
- value: this.props.value,
35986
- className: "unit-editor-canonical",
35987
- onChange: this.onChange
35988
- }), " ", this.parsed ? /*#__PURE__*/React.createElement("span", {
35989
- className: "unit-example-okay"
35990
- }, /*#__PURE__*/React.createElement(InlineIcon, iconOk)) : /*#__PURE__*/React.createElement("span", {
35991
- className: "unit-example-not-okay"
35992
- }, /*#__PURE__*/React.createElement(InlineIcon, iconRemove))), /*#__PURE__*/React.createElement("div", null, "Significant Figures:", " ", /*#__PURE__*/React.createElement(NumberInput, {
35993
- value: this.props.sigfigs,
35994
- onChange: this.handleSigfigChange,
35995
- checkValidity: this._checkSigfigValidity,
35996
- useArrowKeys: true
35997
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("input", {
35998
- type: "radio",
35999
- name: this.groupId,
36000
- onChange: () => this._setAccepting(ALL),
36001
- checked: this.props.accepting === ALL
36002
- }), " Any equivalent unit "), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("input", {
36003
- type: "radio",
36004
- name: this.groupId,
36005
- onChange: () => this._setAccepting(SOME),
36006
- checked: this.props.accepting === SOME
36007
- }), " Only these units ")), acceptingElem);
36008
- }
36009
- }
36010
- UnitInputEditor.propTypes = _extends({}, Changeable.propTypes, {
36011
- value: PropTypes.string,
36012
- acceptingUnits: PropTypes.arrayOf(PropTypes.string),
36013
- accepting: PropTypes.oneOf([ALL, SOME]),
36014
- sigfigs: PropTypes.number
36015
- });
36016
- UnitInputEditor.widgetName = "unit-input";
36017
- UnitInputEditor.defaultProps = {
36018
- value: "5x10^5 kg m / s^2",
36019
- accepting: ALL,
36020
- sigfigs: 3
36021
- };
36022
-
36023
35798
  const {
36024
35799
  InfoTip
36025
35800
  } = components;
@@ -36073,7 +35848,7 @@ VideoEditor.defaultProps = {
36073
35848
  location: ""
36074
35849
  };
36075
35850
 
36076
- var AllEditors = [CategorizerEditor, CSProgramEditor, DefinitionEditor, DropdownEditor, ExampleGraphieWidgetEditor, ExampleWidgetEditor, ExplanationEditor, ExpressionEditor, GradedGroupEditor, GradedGroupSetEditor, GrapherEditor, GroupEditor, IframeEditor, ImageEditor, InputNumberEditor, InteractionEditor, InteractiveGraphEditor, LabelImageEditor, MatcherEditor, MatrixEditor, MeasurerEditor, MoleculeWidgetEditor, NumberLineEditor, NumericInputEditor, OrdererEditor, PassageEditor, PassageRefEditor, PassageRefTargetEditor, PlotterEditor, PythonProgramEditor, SimpleMarkdownTesterEditor, SorterEditor, TableEditor, UnitInputEditor, VideoEditor, RadioEditor, DeprecatedStandinEditor];
35851
+ var AllEditors = [CategorizerEditor, CSProgramEditor, DefinitionEditor, DropdownEditor, ExampleGraphieWidgetEditor, ExampleWidgetEditor, ExplanationEditor, ExpressionEditor, GradedGroupEditor, GradedGroupSetEditor, GrapherEditor, GroupEditor, IframeEditor, ImageEditor, InputNumberEditor, InteractionEditor, InteractiveGraphEditor, LabelImageEditor, MatcherEditor, MatrixEditor, MeasurerEditor, MoleculeWidgetEditor, NumberLineEditor, NumericInputEditor, OrdererEditor, PassageEditor, PassageRefEditor, PassageRefTargetEditor, PlotterEditor, PythonProgramEditor, SimpleMarkdownTesterEditor, SorterEditor, TableEditor, VideoEditor, RadioEditor, DeprecatedStandinEditor];
36077
35852
 
36078
35853
  /* eslint-disable @khanacademy/ts-no-error-suppressions */
36079
35854
  class TextInput extends React.Component {