@khanacademy/perseus-editor 11.1.0 → 11.2.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,11 +1,11 @@
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, getCircleCoords, getLinearSystemCoords, getSegmentCoords, getLineCoords, lockedFigureColors, lockedFigureFillStyles, InteractiveGraphWidget, globalStyles, globalConstants, MatrixWidget, PlotterWidget, plotterPlotTypes, BaseRadio, TableWidget, 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, getQuadraticCoords, getSinusoidCoords, getCircleCoords, 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';
6
6
  import createReactClass from 'create-react-class';
7
7
  import Clickable from '@khanacademy/wonder-blocks-clickable';
8
- import { color, spacing } from '@khanacademy/wonder-blocks-tokens';
8
+ import { color, spacing, font } from '@khanacademy/wonder-blocks-tokens';
9
9
  import { StyleSheet, css } from 'aphrodite';
10
10
  import $ from 'jquery';
11
11
  import PropTypes from 'prop-types';
@@ -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 = "11.1.0";
40
+ const libVersion = "11.2.0";
41
41
  addLibraryVersionToPerseusDebug(libName, libVersion);
42
42
 
43
43
  function _extends() {
@@ -227,7 +227,7 @@ class SectionControlButton extends React.Component {
227
227
  role: "button",
228
228
  hideDefaultFocusRing: true,
229
229
  "aria-label": title,
230
- style: styles$J.button
230
+ style: styles$L.button
231
231
  }, ({
232
232
  hovered,
233
233
  focused,
@@ -235,7 +235,7 @@ class SectionControlButton extends React.Component {
235
235
  }) => /*#__PURE__*/React.createElement(InlineIcon$a, icon));
236
236
  }
237
237
  }
238
- const styles$J = StyleSheet.create({
238
+ const styles$L = StyleSheet.create({
239
239
  button: {
240
240
  backgroundColor: color.gold,
241
241
  margin: 2,
@@ -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$I.expanded : styles$I.collapsed;
20743
+ const iconStyle = props.isExpanded ? styles$K.expanded : styles$K.collapsed;
20744
20744
  return /*#__PURE__*/React.createElement(PhosphorIcon, {
20745
20745
  icon: caretRight,
20746
20746
  style: iconStyle
20747
20747
  });
20748
20748
  }
20749
- const styles$I = StyleSheet.create({
20749
+ const styles$K = 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$H.errorContainer
20782
+ style: styles$J.errorContainer
20783
20783
  }, /*#__PURE__*/React.createElement(View, {
20784
- style: styles$H.title,
20784
+ style: styles$J.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$H.errorExplanation
20789
+ style: styles$J.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$H.error,
20791
+ style: styles$J.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$H = StyleSheet.create({
20800
+ const styles$J = StyleSheet.create({
20801
20801
  title: {
20802
20802
  backgroundColor: "#eee",
20803
20803
  fontSize: "1.25em",
@@ -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$G.baseButton, color === "green" && styles$G.green, color === "orange" && styles$G.orange),
24594
+ className: css(styles$I.baseButton, color === "green" && styles$I.green, color === "orange" && styles$I.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$G = StyleSheet.create({
24609
+ const styles$I = StyleSheet.create({
24610
24610
  baseButton: {
24611
24611
  top: "0",
24612
24612
  fontSize: "11px",
@@ -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$F.containerHeader)
24829
+ className: css(styles$H.containerHeader)
24830
24830
  }, /*#__PURE__*/React.createElement(Header, {
24831
24831
  depth: path.length,
24832
- className: css(styles$F.containerTitle)
24832
+ className: css(styles$H.containerTitle)
24833
24833
  }, capitalize(name)));
24834
24834
  return /*#__PURE__*/React.createElement("div", {
24835
- className: css(styles$F.container)
24835
+ className: css(styles$H.container)
24836
24836
  }, /*#__PURE__*/React.createElement("span", {
24837
- className: css(styles$F.row, styles$F.rowHeading)
24837
+ className: css(styles$H.row, styles$H.rowHeading)
24838
24838
  }, /*#__PURE__*/React.createElement("div", {
24839
- className: css(styles$F.columnLeft)
24839
+ className: css(styles$H.columnLeft)
24840
24840
  }, /*#__PURE__*/React.createElement("div", {
24841
- className: "pod-title " + css(styles$F.containerHeader)
24841
+ className: "pod-title " + css(styles$H.containerHeader)
24842
24842
  }, /*#__PURE__*/React.createElement("div", {
24843
- className: css(styles$F.containerTitle)
24843
+ className: css(styles$H.containerTitle)
24844
24844
  }, capitalize(name)), controls)), /*#__PURE__*/React.createElement("div", {
24845
- className: css(styles$F.columnRight)
24845
+ className: css(styles$H.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$F.container)
24858
+ className: css(styles$H.container)
24859
24859
  }, controls && /*#__PURE__*/React.createElement("div", {
24860
- className: css(styles$F.columnLeft, styles$F.containerHeader)
24860
+ className: css(styles$H.columnLeft, styles$H.containerHeader)
24861
24861
  }, controls), /*#__PURE__*/React.createElement("div", null, children), /*#__PURE__*/React.createElement("div", {
24862
- className: css(styles$F.columnLeft)
24862
+ className: css(styles$H.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$F.containerHeader)
24875
+ className: css(styles$H.containerHeader)
24876
24876
  }, /*#__PURE__*/React.createElement(Header, {
24877
24877
  depth: path.length,
24878
- className: css(styles$F.containerTitle)
24878
+ className: css(styles$H.containerTitle)
24879
24879
  }, capitalize(name)), controls);
24880
24880
  const headingPreview = (name || controls) && /*#__PURE__*/React.createElement("div", {
24881
- className: css(styles$F.containerHeader, styles$F.previewCollectionHeader)
24881
+ className: css(styles$H.containerHeader, styles$H.previewCollectionHeader)
24882
24882
  }, /*#__PURE__*/React.createElement(Header, {
24883
24883
  depth: path.length,
24884
- className: css(styles$F.containerTitle)
24884
+ className: css(styles$H.containerTitle)
24885
24885
  }, capitalize(name)));
24886
24886
  const hasBothHeadings = headingEditor && headingPreview;
24887
24887
  return /*#__PURE__*/React.createElement("div", {
24888
- className: css(styles$F.container)
24888
+ className: css(styles$H.container)
24889
24889
  }, hasBothHeadings && /*#__PURE__*/React.createElement("span", {
24890
- className: css(styles$F.row)
24890
+ className: css(styles$H.row)
24891
24891
  }, /*#__PURE__*/React.createElement("div", {
24892
- className: css(styles$F.columnLeft)
24892
+ className: css(styles$H.columnLeft)
24893
24893
  }, headingEditor), /*#__PURE__*/React.createElement("div", {
24894
- className: css(styles$F.columnRight)
24894
+ className: css(styles$H.columnRight)
24895
24895
  }, headingPreview)), /*#__PURE__*/React.createElement("div", {
24896
- className: css(path.length > 0 && styles$F.contentIndent)
24896
+ className: css(path.length > 0 && styles$H.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$F.row)
25019
+ className: css(styles$H.row)
25020
25020
  }, /*#__PURE__*/React.createElement("div", {
25021
- className: css(styles$F.columnLeft)
25021
+ className: css(styles$H.columnLeft)
25022
25022
  }, /*#__PURE__*/React.createElement("div", {
25023
- className: css(sticky && styles$F.sticky)
25023
+ className: css(sticky && styles$H.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$F.columnRight)
25031
+ className: css(styles$H.columnRight)
25032
25032
  }, /*#__PURE__*/React.createElement("div", {
25033
- className: css(sticky && styles$F.sticky)
25033
+ className: css(sticky && styles$H.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$F.row)
25049
+ className: css(styles$H.row)
25050
25050
  }, /*#__PURE__*/React.createElement("div", {
25051
- className: css(styles$F.columnLeft)
25051
+ className: css(styles$H.columnLeft)
25052
25052
  }, /*#__PURE__*/React.createElement("div", {
25053
- className: css(sticky && styles$F.sticky)
25053
+ className: css(sticky && styles$H.sticky)
25054
25054
  }, /*#__PURE__*/React.createElement(HintEditor, _extends({}, data, {
25055
- className: css(styles$F.hintEditor),
25055
+ className: css(styles$H.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$F.columnRight)
25070
+ className: css(styles$H.columnRight)
25071
25071
  }, /*#__PURE__*/React.createElement("div", {
25072
- className: css(sticky && styles$F.sticky)
25072
+ className: css(sticky && styles$H.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$F.columnLeft)
25089
+ className: css(styles$H.columnLeft)
25090
25090
  }, /*#__PURE__*/React.createElement("div", {
25091
- className: css(styles$F.tagsEditor)
25091
+ className: css(styles$H.tagsEditor)
25092
25092
  }, /*#__PURE__*/React.createElement(GroupMetadataEditor, {
25093
25093
  value: data,
25094
25094
  onChange: newVal => actions.setValueAtPath(path, newVal),
@@ -25119,23 +25119,23 @@ 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$F.control)
25122
+ className: css(styles$H.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$F.verticalFlip)
25128
+ className: css(styles$H.verticalFlip)
25129
25129
  }, /*#__PURE__*/React.createElement(InlineIcon$5, iconChevronDown)))), i < data.length - 1 && /*#__PURE__*/React.createElement("div", {
25130
25130
  key: "moveArrayElementDown",
25131
- className: css(styles$F.control)
25131
+ className: css(styles$H.control)
25132
25132
  }, /*#__PURE__*/React.createElement(SimpleButton, {
25133
25133
  color: "orange",
25134
25134
  title: "Move down",
25135
25135
  onClick: () => actions.moveArrayElementDown(subpath)
25136
25136
  }, /*#__PURE__*/React.createElement(InlineIcon$5, iconChevronDown))), /*#__PURE__*/React.createElement("div", {
25137
25137
  key: "removeArrayElement",
25138
- className: css(styles$F.control)
25138
+ className: css(styles$H.control)
25139
25139
  }, /*#__PURE__*/React.createElement(SimpleButton, {
25140
25140
  color: "orange",
25141
25141
  title: "Delete",
@@ -25143,7 +25143,7 @@ const ArrayNodeContent = props => {
25143
25143
  }, /*#__PURE__*/React.createElement(InlineIcon$5, iconTrash$4)))];
25144
25144
  return /*#__PURE__*/React.createElement("div", {
25145
25145
  key: i,
25146
- className: css(styles$F.arrayElement, !elementIsLeaf && styles$F.arrayElementAndNotLeaf)
25146
+ className: css(styles$H.arrayElement, !elementIsLeaf && styles$H.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$F.objectElement)
25172
+ className: css(styles$H.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$F = StyleSheet.create({
25339
+ const styles$H = 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
@@ -26922,10 +26922,10 @@ class GradedGroupEditor extends React.Component {
26922
26922
  }, /*#__PURE__*/React.createElement("div", {
26923
26923
  className: "perseus-widget-row"
26924
26924
  }, /*#__PURE__*/React.createElement("label", {
26925
- className: css(styles$E.title)
26925
+ className: css(styles$G.title)
26926
26926
  }, "Title:", " ", /*#__PURE__*/React.createElement(TextInput$6, {
26927
26927
  value: this.props.title,
26928
- className: css(styles$E.input)
26928
+ className: css(styles$G.input)
26929
26929
  // @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
26930
26930
  ,
26931
26931
  onChange: this.change("title")
@@ -26950,7 +26950,7 @@ class GradedGroupEditor extends React.Component {
26950
26950
  }, /*#__PURE__*/React.createElement(InlineIcon$3, iconPlus$1), " Add a hint"), this.props.hint && /*#__PURE__*/React.createElement("div", {
26951
26951
  className: "perseus-hint-editor"
26952
26952
  }, /*#__PURE__*/React.createElement("div", {
26953
- className: css(styles$E.hintsTitle)
26953
+ className: css(styles$G.hintsTitle)
26954
26954
  }, "Hint"), /*#__PURE__*/React.createElement(Editor, {
26955
26955
  ref: this.hintEditor,
26956
26956
  content: this.props.hint ? this.props.hint.content : "",
@@ -26987,7 +26987,7 @@ GradedGroupEditor.defaultProps = {
26987
26987
  images: {},
26988
26988
  hint: null
26989
26989
  };
26990
- const styles$E = StyleSheet.create({
26990
+ const styles$G = StyleSheet.create({
26991
26991
  title: {
26992
26992
  fontSize: 18,
26993
26993
  fontWeight: "bold"
@@ -28326,13 +28326,13 @@ function MathquillInput(props) {
28326
28326
  }
28327
28327
  });
28328
28328
  return /*#__PURE__*/React.createElement(View, {
28329
- style: styles$D.outerWrapper
28329
+ style: styles$F.outerWrapper
28330
28330
  }, /*#__PURE__*/React.createElement("span", {
28331
28331
  ref: mathFieldWrapperRef,
28332
28332
  className: "perseus-math-input mq-editable-field mq-math-mode"
28333
28333
  }));
28334
28334
  }
28335
- const styles$D = StyleSheet.create({
28335
+ const styles$F = StyleSheet.create({
28336
28336
  outerWrapper: {
28337
28337
  display: "inline-block",
28338
28338
  borderStyle: "solid",
@@ -29378,16 +29378,16 @@ const LabeledRow = props => {
29378
29378
  style
29379
29379
  } = props;
29380
29380
  return /*#__PURE__*/React.createElement("label", {
29381
- className: css(styles$C.label)
29381
+ className: css(styles$E.label)
29382
29382
  }, /*#__PURE__*/React.createElement(View, {
29383
- style: [styles$C.row, style]
29383
+ style: [styles$E.row, style]
29384
29384
  }, labelSide === "start" || /*#__PURE__*/React.createElement(LabelSmall, {
29385
- style: styles$C.spaceEnd
29385
+ style: styles$E.spaceEnd
29386
29386
  }, label), children, labelSide === "end" && /*#__PURE__*/React.createElement(LabelSmall, {
29387
- style: styles$C.spaceStart
29387
+ style: styles$E.spaceStart
29388
29388
  }, label)));
29389
29389
  };
29390
- const styles$C = StyleSheet.create({
29390
+ const styles$E = StyleSheet.create({
29391
29391
  label: {
29392
29392
  width: "fit-content"
29393
29393
  },
@@ -29464,11 +29464,11 @@ class Spring extends React.Component {
29464
29464
  } = this.props;
29465
29465
  return React.createElement(View, {
29466
29466
  "aria-hidden": "true",
29467
- style: [styles$B.grow, style]
29467
+ style: [styles$D.grow, style]
29468
29468
  });
29469
29469
  }
29470
29470
  }
29471
- const styles$B = StyleSheet.create({
29471
+ const styles$D = StyleSheet.create({
29472
29472
  grow: {
29473
29473
  flexGrow: 1
29474
29474
  }
@@ -29504,11 +29504,11 @@ function Heading({
29504
29504
  onToggle
29505
29505
  }) {
29506
29506
  return /*#__PURE__*/React.createElement(Clickable, {
29507
- style: [styles$A.container, !isCollapsible && styles$A.notClickable],
29507
+ style: [styles$C.container, !isCollapsible && styles$C.notClickable],
29508
29508
  disabled: !isCollapsible,
29509
29509
  onClick: () => isCollapsible && (onToggle == null ? void 0 : onToggle(!isOpen))
29510
29510
  }, () => /*#__PURE__*/React.createElement(View, {
29511
- style: styles$A.heading
29511
+ style: styles$C.heading
29512
29512
  }, /*#__PURE__*/React.createElement(LabelLarge, {
29513
29513
  style: {
29514
29514
  fontSize: 14,
@@ -29518,7 +29518,7 @@ function Heading({
29518
29518
  isExpanded: isOpen
29519
29519
  })));
29520
29520
  }
29521
- const styles$A = StyleSheet.create({
29521
+ const styles$C = StyleSheet.create({
29522
29522
  container: {
29523
29523
  marginTop: spacing.small_12,
29524
29524
  // NOTE(jeremy): This is the inverse of the @editorPadding CSS
@@ -29671,10 +29671,45 @@ function getDefaultGraphStartCoords(graph, range, step) {
29671
29671
  center: startCoords.center,
29672
29672
  radius
29673
29673
  };
29674
+ case "sinusoid":
29675
+ return getSinusoidCoords(_extends({}, graph, {
29676
+ startCoords: undefined
29677
+ }), range, step);
29678
+ case "quadratic":
29679
+ return getQuadraticCoords(_extends({}, graph, {
29680
+ startCoords: undefined
29681
+ }), range, step);
29674
29682
  default:
29675
29683
  return undefined;
29676
29684
  }
29677
29685
  }
29686
+ const getSinusoidEquation = startCoords => {
29687
+ // Get coefficients
29688
+ // It's assumed that p1 is the root and p2 is the first peak
29689
+ const p1 = startCoords[0];
29690
+ const p2 = startCoords[1];
29691
+
29692
+ // Resulting coefficients are canonical for this sine curve
29693
+ const amplitude = p2[1] - p1[1];
29694
+ const angularFrequency = Math.PI / (2 * (p2[0] - p1[0]));
29695
+ const phase = p1[0] * angularFrequency;
29696
+ const verticalOffset = p1[1];
29697
+ return "y = " + amplitude.toFixed(3) + "sin(" + angularFrequency.toFixed(3) + "x - " + phase.toFixed(3) + ") + " + verticalOffset.toFixed(3);
29698
+ };
29699
+ const getQuadraticEquation = startCoords => {
29700
+ const p1 = startCoords[0];
29701
+ const p2 = startCoords[1];
29702
+ const p3 = startCoords[2];
29703
+ const denom = (p1[0] - p2[0]) * (p1[0] - p3[0]) * (p2[0] - p3[0]);
29704
+ if (denom === 0) {
29705
+ // Many of the callers assume that the return value is always defined.
29706
+ return "Division by zero error";
29707
+ }
29708
+ const a = (p3[0] * (p2[1] - p1[1]) + p2[0] * (p1[1] - p3[1]) + p1[0] * (p3[1] - p2[1])) / denom;
29709
+ const b = (p3[0] * p3[0] * (p1[1] - p2[1]) + p2[0] * p2[0] * (p3[1] - p1[1]) + p1[0] * p1[0] * (p2[1] - p3[1])) / denom;
29710
+ const c = (p2[0] * p3[0] * (p2[0] - p3[0]) * p1[1] + p3[0] * p1[0] * (p3[0] - p1[0]) * p2[1] + p1[0] * p2[0] * (p1[0] - p2[0]) * p3[1]) / denom;
29711
+ return "y = " + a.toFixed(3) + "x^2 + " + b.toFixed(3) + "x + " + c.toFixed(3);
29712
+ };
29678
29713
 
29679
29714
  /**
29680
29715
  * Dropdown for selecting a locked figure to add to an interactive graph.
@@ -29688,19 +29723,20 @@ const LockedFigureSelect = props => {
29688
29723
  id,
29689
29724
  onChange
29690
29725
  } = props;
29691
- const figureTypes = props.showM2Features ? ["point", "line", "vector", "ellipse", "polygon"] : ["point", "line"];
29726
+ const figureTypes = ["point", "line", "vector", "ellipse", "polygon"];
29727
+ const figureTypesCurrent = props.showM2bFeatures ? [...figureTypes, "function"] : figureTypes;
29692
29728
  return /*#__PURE__*/React.createElement(View, {
29693
- style: styles$z.container
29729
+ style: styles$B.container
29694
29730
  }, /*#__PURE__*/React.createElement(ActionMenu, {
29695
29731
  menuText: "Add locked figure",
29696
- style: styles$z.addElementSelect
29697
- }, figureTypes.map(figureType => /*#__PURE__*/React.createElement(ActionItem, {
29732
+ style: styles$B.addElementSelect
29733
+ }, figureTypesCurrent.map(figureType => /*#__PURE__*/React.createElement(ActionItem, {
29698
29734
  key: `${id}-${figureType}`,
29699
29735
  label: figureType,
29700
29736
  onClick: () => onChange(figureType)
29701
29737
  }))));
29702
29738
  };
29703
- const styles$z = StyleSheet.create({
29739
+ const styles$B = StyleSheet.create({
29704
29740
  container: {
29705
29741
  marginTop: spacing.xSmall_8
29706
29742
  },
@@ -29731,19 +29767,19 @@ const AngleInput = props => {
29731
29767
  }
29732
29768
  return /*#__PURE__*/React.createElement(LabelMedium, {
29733
29769
  tag: "label",
29734
- style: styles$y.row
29770
+ style: styles$A.row
29735
29771
  }, "angle (degrees)", /*#__PURE__*/React.createElement(Strut, {
29736
29772
  size: spacing.xxSmall_6
29737
29773
  }), /*#__PURE__*/React.createElement(TextField, {
29738
29774
  type: "number",
29739
29775
  value: angleInput,
29740
29776
  onChange: handleAngleChange,
29741
- style: styles$y.textField
29777
+ style: styles$A.textField
29742
29778
  }), /*#__PURE__*/React.createElement(Strut, {
29743
29779
  size: spacing.xxSmall_6
29744
29780
  }));
29745
29781
  };
29746
- const styles$y = StyleSheet.create({
29782
+ const styles$A = StyleSheet.create({
29747
29783
  row: {
29748
29784
  display: "flex",
29749
29785
  flexDirection: "row",
@@ -29792,32 +29828,32 @@ const CoordinatePairInput = props => {
29792
29828
  onChange(newCoords);
29793
29829
  }
29794
29830
  return /*#__PURE__*/React.createElement(View, {
29795
- style: [styles$x.row, style]
29831
+ style: [styles$z.row, style]
29796
29832
  }, /*#__PURE__*/React.createElement(LabelMedium, {
29797
29833
  tag: "label",
29798
- style: styles$x.row
29834
+ style: styles$z.row
29799
29835
  }, labels ? labels[0] : "x coord", /*#__PURE__*/React.createElement(Strut, {
29800
29836
  size: spacing.xxSmall_6
29801
29837
  }), /*#__PURE__*/React.createElement(TextField, {
29802
29838
  type: "number",
29803
29839
  value: coordState[0],
29804
29840
  onChange: newValue => handleCoordChange(newValue, 0),
29805
- style: [styles$x.textField, error ? styles$x.errorField : undefined]
29841
+ style: [styles$z.textField, error ? styles$z.errorField : undefined]
29806
29842
  })), /*#__PURE__*/React.createElement(Strut, {
29807
29843
  size: spacing.medium_16
29808
29844
  }), /*#__PURE__*/React.createElement(LabelMedium, {
29809
29845
  tag: "label",
29810
- style: styles$x.row
29846
+ style: styles$z.row
29811
29847
  }, labels ? labels[1] : "y coord", /*#__PURE__*/React.createElement(Strut, {
29812
29848
  size: spacing.xxSmall_6
29813
29849
  }), /*#__PURE__*/React.createElement(TextField, {
29814
29850
  type: "number",
29815
29851
  value: coordState[1],
29816
29852
  onChange: newValue => handleCoordChange(newValue, 1),
29817
- style: [styles$x.textField, error ? styles$x.errorField : undefined]
29853
+ style: [styles$z.textField, error ? styles$z.errorField : undefined]
29818
29854
  })));
29819
29855
  };
29820
- const styles$x = StyleSheet.create({
29856
+ const styles$z = StyleSheet.create({
29821
29857
  row: {
29822
29858
  display: "flex",
29823
29859
  flexDirection: "row",
@@ -29850,14 +29886,14 @@ const PerseusEditorAccordion = props => {
29850
29886
  }, /*#__PURE__*/React.createElement(AccordionSection, {
29851
29887
  expanded: expanded,
29852
29888
  onToggle: onToggle,
29853
- style: [styles$w.container, containerStyle],
29854
- headerStyle: styles$w.accordionHeader,
29889
+ style: [styles$y.container, containerStyle],
29890
+ headerStyle: styles$y.accordionHeader,
29855
29891
  header: header
29856
29892
  }, /*#__PURE__*/React.createElement(View, {
29857
- style: [styles$w.accordionPanel, panelStyle]
29893
+ style: [styles$y.accordionPanel, panelStyle]
29858
29894
  }, children)));
29859
29895
  };
29860
- const styles$w = StyleSheet.create({
29896
+ const styles$y = StyleSheet.create({
29861
29897
  container: {
29862
29898
  backgroundColor: color.fadedBlue8,
29863
29899
  marginTop: spacing.xSmall_8
@@ -29888,13 +29924,13 @@ const ColorSwatch = props => {
29888
29924
  "aria-label":
29889
29925
  // Don't include an aria label for decorative circles.
29890
29926
  !decorative ? `${color$1}, ${filled ? "filled" : "open"}` : undefined,
29891
- style: [styles$v.colorSwatch, {
29927
+ style: [styles$x.colorSwatch, {
29892
29928
  border: `4px solid ${lockedFigureColors[color$1]}`,
29893
29929
  backgroundColor: filled ? lockedFigureColors[color$1] : color.white
29894
29930
  }]
29895
29931
  });
29896
29932
  };
29897
- const styles$v = StyleSheet.create({
29933
+ const styles$x = StyleSheet.create({
29898
29934
  colorSwatch: {
29899
29935
  // Add a white outline so that the color swatch is visible when
29900
29936
  // the dropdown option is highlighted with its blue background.
@@ -29913,10 +29949,10 @@ const ColorSelect = props => {
29913
29949
  onChange
29914
29950
  } = props;
29915
29951
  return /*#__PURE__*/React.createElement(View, {
29916
- style: [styles$u.row, style]
29952
+ style: [styles$w.row, style]
29917
29953
  }, /*#__PURE__*/React.createElement(LabelMedium, {
29918
29954
  tag: "label",
29919
- style: styles$u.row
29955
+ style: styles$w.row
29920
29956
  }, "color", /*#__PURE__*/React.createElement(Strut, {
29921
29957
  size: spacing.xxSmall_6
29922
29958
  }), /*#__PURE__*/React.createElement(SingleSelect, {
@@ -29935,7 +29971,7 @@ const ColorSelect = props => {
29935
29971
  })
29936
29972
  })))));
29937
29973
  };
29938
- const styles$u = StyleSheet.create({
29974
+ const styles$w = StyleSheet.create({
29939
29975
  row: {
29940
29976
  display: "flex",
29941
29977
  flexDirection: "row",
@@ -29951,17 +29987,17 @@ const EllipseSwatch = props => {
29951
29987
  } = props;
29952
29988
  return /*#__PURE__*/React.createElement(View, {
29953
29989
  "aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
29954
- style: [styles$t.container, {
29990
+ style: [styles$v.container, {
29955
29991
  border: `4px ${strokeStyle} ${lockedFigureColors[color]}`
29956
29992
  }]
29957
29993
  }, /*#__PURE__*/React.createElement(View, {
29958
- style: [styles$t.innerCircle, {
29994
+ style: [styles$v.innerCircle, {
29959
29995
  backgroundColor: lockedFigureColors[color],
29960
29996
  opacity: lockedFigureFillStyles[fillStyle]
29961
29997
  }]
29962
29998
  }));
29963
29999
  };
29964
- const styles$t = StyleSheet.create({
30000
+ const styles$v = StyleSheet.create({
29965
30001
  container: {
29966
30002
  // Add a white outline so that the color swatch is visible when
29967
30003
  // the dropdown option is highlighted with its blue background.
@@ -29992,40 +30028,40 @@ const LockedFigureSettingsActions = props => {
29992
30028
  onRemove
29993
30029
  } = props;
29994
30030
  return /*#__PURE__*/React.createElement(View, {
29995
- style: styles$s.container
30031
+ style: styles$u.container
29996
30032
  }, /*#__PURE__*/React.createElement(Button, {
29997
30033
  startIcon: trashIcon,
29998
30034
  "aria-label": `Delete locked ${figureType}`,
29999
30035
  onClick: onRemove,
30000
30036
  kind: "tertiary",
30001
- style: styles$s.deleteButton
30002
- }, "Delete"), /*#__PURE__*/React.createElement(Spring, null), props.showM2Features && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconButton, {
30037
+ style: styles$u.deleteButton
30038
+ }, "Delete"), /*#__PURE__*/React.createElement(Spring, null), /*#__PURE__*/React.createElement(IconButton, {
30003
30039
  icon: caretDoubleUpIcon,
30004
30040
  size: "small",
30005
30041
  "aria-label": `Move locked ${figureType} to the back`,
30006
30042
  onClick: () => onMove("back"),
30007
- style: styles$s.iconButton
30043
+ style: styles$u.iconButton
30008
30044
  }), /*#__PURE__*/React.createElement(IconButton, {
30009
30045
  icon: caretUpIcon,
30010
30046
  size: "small",
30011
30047
  "aria-label": `Move locked ${figureType} backward`,
30012
30048
  onClick: () => onMove("backward"),
30013
- style: styles$s.iconButton
30049
+ style: styles$u.iconButton
30014
30050
  }), /*#__PURE__*/React.createElement(IconButton, {
30015
30051
  icon: caretDownIcon,
30016
30052
  size: "small",
30017
30053
  "aria-label": `Move locked ${figureType} forward`,
30018
30054
  onClick: () => onMove("forward"),
30019
- style: styles$s.iconButton
30055
+ style: styles$u.iconButton
30020
30056
  }), /*#__PURE__*/React.createElement(IconButton, {
30021
30057
  icon: caretDoubleDownIcon,
30022
30058
  size: "small",
30023
30059
  "aria-label": `Move locked ${figureType} to the front`,
30024
30060
  onClick: () => onMove("front"),
30025
- style: styles$s.iconButton
30026
- })));
30061
+ style: styles$u.iconButton
30062
+ }));
30027
30063
  };
30028
- const styles$s = StyleSheet.create({
30064
+ const styles$u = StyleSheet.create({
30029
30065
  container: {
30030
30066
  width: "100%",
30031
30067
  flexDirection: "row",
@@ -30072,7 +30108,7 @@ const LockedEllipseSettings = props => {
30072
30108
  /*#__PURE__*/
30073
30109
  // Summary: Ellipse, center, radius, color (opacity, dashed)
30074
30110
  React.createElement(View, {
30075
- style: styles$r.row
30111
+ style: styles$t.row
30076
30112
  }, /*#__PURE__*/React.createElement(LabelLarge, null, `Ellipse (${center[0]}, ${center[1]}), radius ${radius[0]}, ${radius[1]}`), /*#__PURE__*/React.createElement(Strut, {
30077
30113
  size: spacing.xSmall_8
30078
30114
  }), /*#__PURE__*/React.createElement(EllipseSwatch, {
@@ -30081,19 +30117,19 @@ const LockedEllipseSettings = props => {
30081
30117
  strokeStyle: strokeStyle
30082
30118
  }))
30083
30119
  }, /*#__PURE__*/React.createElement(View, {
30084
- style: styles$r.row
30120
+ style: styles$t.row
30085
30121
  }, /*#__PURE__*/React.createElement(CoordinatePairInput, {
30086
30122
  coord: center,
30087
- style: styles$r.spaceUnder,
30123
+ style: styles$t.spaceUnder,
30088
30124
  onChange: newCoords => onChangeProps({
30089
30125
  center: newCoords
30090
30126
  })
30091
30127
  }), /*#__PURE__*/React.createElement(View, {
30092
- style: styles$r.spaceUnder
30128
+ style: styles$t.spaceUnder
30093
30129
  }, /*#__PURE__*/React.createElement(InfoTip$d, null, "The coordinates for the center of the ellipse."))), /*#__PURE__*/React.createElement(CoordinatePairInput, {
30094
30130
  coord: radius,
30095
30131
  labels: ["x radius", "y radius"],
30096
- style: styles$r.spaceUnder,
30132
+ style: styles$t.spaceUnder,
30097
30133
  onChange: newCoords => onChangeProps({
30098
30134
  radius: newCoords
30099
30135
  })
@@ -30105,7 +30141,7 @@ const LockedEllipseSettings = props => {
30105
30141
  }), /*#__PURE__*/React.createElement(Strut, {
30106
30142
  size: spacing.xSmall_8
30107
30143
  }), /*#__PURE__*/React.createElement(View, {
30108
- style: [styles$r.row, styles$r.spaceUnder]
30144
+ style: [styles$t.row, styles$t.spaceUnder]
30109
30145
  }, /*#__PURE__*/React.createElement(ColorSelect, {
30110
30146
  selectedValue: color,
30111
30147
  onChange: handleColorChange
@@ -30113,7 +30149,7 @@ const LockedEllipseSettings = props => {
30113
30149
  size: spacing.medium_16
30114
30150
  }), /*#__PURE__*/React.createElement(LabelMedium, {
30115
30151
  tag: "label",
30116
- style: styles$r.row
30152
+ style: styles$t.row
30117
30153
  }, "fill", /*#__PURE__*/React.createElement(Strut, {
30118
30154
  size: spacing.xxSmall_6
30119
30155
  }), /*#__PURE__*/React.createElement(SingleSelect, {
@@ -30130,7 +30166,7 @@ const LockedEllipseSettings = props => {
30130
30166
  label: option
30131
30167
  }))))), /*#__PURE__*/React.createElement(LabelMedium, {
30132
30168
  tag: "label",
30133
- style: styles$r.row
30169
+ style: styles$t.row
30134
30170
  }, "stroke", /*#__PURE__*/React.createElement(Strut, {
30135
30171
  size: spacing.xxSmall_6
30136
30172
  }), /*#__PURE__*/React.createElement(SingleSelect, {
@@ -30148,13 +30184,12 @@ const LockedEllipseSettings = props => {
30148
30184
  value: "dashed",
30149
30185
  label: "dashed"
30150
30186
  }))), /*#__PURE__*/React.createElement(LockedFigureSettingsActions, {
30151
- showM2Features: props.showM2Features,
30152
30187
  figureType: props.type,
30153
30188
  onMove: onMove,
30154
30189
  onRemove: onRemove
30155
30190
  }));
30156
30191
  };
30157
- const styles$r = StyleSheet.create({
30192
+ const styles$t = StyleSheet.create({
30158
30193
  row: {
30159
30194
  display: "flex",
30160
30195
  flexDirection: "row",
@@ -30175,7 +30210,7 @@ const LabeledSwitch = props => {
30175
30210
  const ids = useUniqueIdWithMock();
30176
30211
  const switchId = ids.get("switch");
30177
30212
  return /*#__PURE__*/React.createElement(View, {
30178
- style: [styles$q.row, style]
30213
+ style: [styles$s.row, style]
30179
30214
  }, /*#__PURE__*/React.createElement(Switch, {
30180
30215
  id: switchId,
30181
30216
  checked: checked,
@@ -30187,7 +30222,7 @@ const LabeledSwitch = props => {
30187
30222
  htmlFor: switchId
30188
30223
  }, label));
30189
30224
  };
30190
- const styles$q = StyleSheet.create({
30225
+ const styles$s = StyleSheet.create({
30191
30226
  row: {
30192
30227
  flexDirection: "row",
30193
30228
  alignItems: "center"
@@ -30221,13 +30256,13 @@ const DefiningPointSettings = props => {
30221
30256
  return /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
30222
30257
  expanded: expanded,
30223
30258
  onToggle: onToggle,
30224
- containerStyle: styles$p.container,
30225
- panelStyle: styles$p.accordionPanel,
30259
+ containerStyle: styles$r.container,
30260
+ panelStyle: styles$r.accordionPanel,
30226
30261
  header:
30227
30262
  /*#__PURE__*/
30228
30263
  // Summary: Point, coords, color (filled/open)
30229
30264
  React.createElement(View, {
30230
- style: styles$p.row
30265
+ style: styles$r.row
30231
30266
  }, /*#__PURE__*/React.createElement(LabelLarge, null, `${label || "Point"} (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React.createElement(Strut, {
30232
30267
  size: spacing.xSmall_8
30233
30268
  }), showPoint && /*#__PURE__*/React.createElement(ColorSwatch, {
@@ -30237,7 +30272,7 @@ const DefiningPointSettings = props => {
30237
30272
  }, /*#__PURE__*/React.createElement(CoordinatePairInput, {
30238
30273
  coord: coord,
30239
30274
  error: !!error,
30240
- style: styles$p.spaceUnder,
30275
+ style: styles$r.spaceUnder,
30241
30276
  onChange: newCoords => {
30242
30277
  onChangeProps({
30243
30278
  coord: newCoords
@@ -30246,12 +30281,12 @@ const DefiningPointSettings = props => {
30246
30281
  }), onTogglePoint && /*#__PURE__*/React.createElement(LabeledSwitch, {
30247
30282
  label: "show point on graph",
30248
30283
  checked: !!showPoint,
30249
- style: showPoint && styles$p.spaceUnder,
30284
+ style: showPoint && styles$r.spaceUnder,
30250
30285
  onChange: onTogglePoint
30251
30286
  }), showPoint && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ColorSelect, {
30252
30287
  selectedValue: pointColor,
30253
30288
  onChange: handleColorChange,
30254
- style: styles$p.spaceUnder
30289
+ style: styles$r.spaceUnder
30255
30290
  }), /*#__PURE__*/React.createElement(LabeledSwitch, {
30256
30291
  label: "open point",
30257
30292
  checked: !filled,
@@ -30262,7 +30297,7 @@ const DefiningPointSettings = props => {
30262
30297
  }
30263
30298
  })));
30264
30299
  };
30265
- const styles$p = StyleSheet.create({
30300
+ const styles$r = StyleSheet.create({
30266
30301
  container: {
30267
30302
  marginTop: spacing.xSmall_8,
30268
30303
  marginBottom: 0,
@@ -30289,15 +30324,15 @@ const LineSwatch = props => {
30289
30324
  lineStyle
30290
30325
  } = props;
30291
30326
  return /*#__PURE__*/React.createElement(View, {
30292
- style: styles$o.container
30327
+ style: styles$q.container
30293
30328
  }, /*#__PURE__*/React.createElement(View, {
30294
30329
  "aria-label": `${color}, ${lineStyle}`,
30295
- style: [styles$o.lineSwatch, {
30330
+ style: [styles$q.lineSwatch, {
30296
30331
  border: `5px ${lineStyle} ${lockedFigureColors[color]}`
30297
30332
  }]
30298
30333
  }));
30299
30334
  };
30300
- const styles$o = StyleSheet.create({
30335
+ const styles$q = StyleSheet.create({
30301
30336
  container: {
30302
30337
  backgroundColor: color.white,
30303
30338
  justifyContent: "center",
@@ -30351,7 +30386,7 @@ const LockedLineSettings = props => {
30351
30386
  expanded: props.expanded,
30352
30387
  onToggle: props.onToggle,
30353
30388
  header: /*#__PURE__*/React.createElement(View, {
30354
- style: styles$n.row
30389
+ style: styles$p.row
30355
30390
  }, /*#__PURE__*/React.createElement(LabelLarge, null, lineLabel), /*#__PURE__*/React.createElement(Strut, {
30356
30391
  size: spacing.xSmall_8
30357
30392
  }), /*#__PURE__*/React.createElement(LineSwatch, {
@@ -30360,7 +30395,7 @@ const LockedLineSettings = props => {
30360
30395
  }))
30361
30396
  }, /*#__PURE__*/React.createElement(LabelMedium, {
30362
30397
  tag: "label",
30363
- style: [styles$n.row, styles$n.spaceUnder]
30398
+ style: [styles$p.row, styles$p.spaceUnder]
30364
30399
  }, "kind", /*#__PURE__*/React.createElement(Strut, {
30365
30400
  size: spacing.xxxSmall_4
30366
30401
  }), /*#__PURE__*/React.createElement(SingleSelect, {
@@ -30381,7 +30416,7 @@ const LockedLineSettings = props => {
30381
30416
  value: "segment",
30382
30417
  label: "segment"
30383
30418
  }))), /*#__PURE__*/React.createElement(View, {
30384
- style: styles$n.row
30419
+ style: styles$p.row
30385
30420
  }, /*#__PURE__*/React.createElement(ColorSelect, {
30386
30421
  selectedValue: lineColor,
30387
30422
  onChange: handleColorChange
@@ -30389,7 +30424,7 @@ const LockedLineSettings = props => {
30389
30424
  size: spacing.small_12
30390
30425
  }), /*#__PURE__*/React.createElement(LabelMedium, {
30391
30426
  tag: "label",
30392
- style: styles$n.row
30427
+ style: styles$p.row
30393
30428
  }, "style", /*#__PURE__*/React.createElement(Strut, {
30394
30429
  size: spacing.xxxSmall_4
30395
30430
  }), /*#__PURE__*/React.createElement(SingleSelect, {
@@ -30400,7 +30435,7 @@ const LockedLineSettings = props => {
30400
30435
  // Placeholder is required, but never gets used.
30401
30436
  ,
30402
30437
  placeholder: "",
30403
- style: styles$n.selectMarginOffset
30438
+ style: styles$p.selectMarginOffset
30404
30439
  }, /*#__PURE__*/React.createElement(OptionItem, {
30405
30440
  value: "solid",
30406
30441
  label: "solid"
@@ -30408,7 +30443,7 @@ const LockedLineSettings = props => {
30408
30443
  value: "dashed",
30409
30444
  label: "dashed"
30410
30445
  })))), isInvalid && /*#__PURE__*/React.createElement(LabelMedium, {
30411
- style: styles$n.errorText
30446
+ style: styles$p.errorText
30412
30447
  }, lengthZeroStr), /*#__PURE__*/React.createElement(DefiningPointSettings, _extends({
30413
30448
  label: "Point 1",
30414
30449
  showPoint: showPoint1,
@@ -30428,13 +30463,12 @@ const LockedLineSettings = props => {
30428
30463
  }),
30429
30464
  onChangeProps: newProps => handleChangePoint(newProps, 1)
30430
30465
  })), /*#__PURE__*/React.createElement(LockedFigureSettingsActions, {
30431
- showM2Features: props.showM2Features,
30432
30466
  figureType: props.type,
30433
30467
  onMove: onMove,
30434
30468
  onRemove: onRemove
30435
30469
  }));
30436
30470
  };
30437
- const styles$n = StyleSheet.create({
30471
+ const styles$p = StyleSheet.create({
30438
30472
  row: {
30439
30473
  display: "flex",
30440
30474
  flexDirection: "row",
@@ -30479,7 +30513,7 @@ const LockedPointSettings = props => {
30479
30513
  /*#__PURE__*/
30480
30514
  // Summary: Point, coords, color (filled/open)
30481
30515
  React.createElement(View, {
30482
- style: styles$m.row
30516
+ style: styles$o.row
30483
30517
  }, /*#__PURE__*/React.createElement(LabelLarge, null, `Point (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React.createElement(Strut, {
30484
30518
  size: spacing.xSmall_8
30485
30519
  }), /*#__PURE__*/React.createElement(ColorSwatch, {
@@ -30488,7 +30522,7 @@ const LockedPointSettings = props => {
30488
30522
  }))
30489
30523
  }, /*#__PURE__*/React.createElement(CoordinatePairInput, {
30490
30524
  coord: coord,
30491
- style: styles$m.spaceUnder,
30525
+ style: styles$o.spaceUnder,
30492
30526
  onChange: newCoord => {
30493
30527
  onChangeProps({
30494
30528
  coord: newCoord
@@ -30497,7 +30531,7 @@ const LockedPointSettings = props => {
30497
30531
  }), /*#__PURE__*/React.createElement(ColorSelect, {
30498
30532
  selectedValue: pointColor,
30499
30533
  onChange: handleColorChange,
30500
- style: styles$m.spaceUnder
30534
+ style: styles$o.spaceUnder
30501
30535
  }), /*#__PURE__*/React.createElement(LabeledSwitch, {
30502
30536
  label: "open point",
30503
30537
  checked: !filled,
@@ -30507,13 +30541,12 @@ const LockedPointSettings = props => {
30507
30541
  });
30508
30542
  }
30509
30543
  }), /*#__PURE__*/React.createElement(LockedFigureSettingsActions, {
30510
- showM2Features: props.showM2Features,
30511
30544
  figureType: props.type,
30512
30545
  onMove: onMove,
30513
30546
  onRemove: onRemove
30514
30547
  }));
30515
30548
  };
30516
- const styles$m = StyleSheet.create({
30549
+ const styles$o = StyleSheet.create({
30517
30550
  row: {
30518
30551
  flexDirection: "row",
30519
30552
  alignItems: "center"
@@ -30531,17 +30564,17 @@ const PolygonSwatch = props => {
30531
30564
  } = props;
30532
30565
  return /*#__PURE__*/React.createElement(View, {
30533
30566
  "aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
30534
- style: [styles$l.container, {
30567
+ style: [styles$n.container, {
30535
30568
  border: `4px ${strokeStyle} ${lockedFigureColors[color]}`
30536
30569
  }]
30537
30570
  }, /*#__PURE__*/React.createElement(View, {
30538
- style: [styles$l.innerSquare, {
30571
+ style: [styles$n.innerSquare, {
30539
30572
  backgroundColor: lockedFigureColors[color],
30540
30573
  opacity: lockedFigureFillStyles[fillStyle]
30541
30574
  }]
30542
30575
  }));
30543
30576
  };
30544
- const styles$l = StyleSheet.create({
30577
+ const styles$n = StyleSheet.create({
30545
30578
  container: {
30546
30579
  // Add a white outline so that the color swatch is visible when
30547
30580
  // the dropdown option is highlighted with its blue background.
@@ -30583,7 +30616,7 @@ const LockedPolygonSettings = props => {
30583
30616
  /*#__PURE__*/
30584
30617
  // Summary: Polygon, number of sides, style swatch
30585
30618
  React.createElement(View, {
30586
- style: styles$k.row
30619
+ style: styles$m.row
30587
30620
  }, /*#__PURE__*/React.createElement(LabelLarge, null, `Polygon, ${points.length} sides`), /*#__PURE__*/React.createElement(Strut, {
30588
30621
  size: spacing.xSmall_8
30589
30622
  }), /*#__PURE__*/React.createElement(PolygonSwatch, {
@@ -30592,7 +30625,7 @@ const LockedPolygonSettings = props => {
30592
30625
  strokeStyle: strokeStyle
30593
30626
  }))
30594
30627
  }, /*#__PURE__*/React.createElement(View, {
30595
- style: [styles$k.row, styles$k.spaceUnder]
30628
+ style: [styles$m.row, styles$m.spaceUnder]
30596
30629
  }, /*#__PURE__*/React.createElement(ColorSelect, {
30597
30630
  selectedValue: color,
30598
30631
  onChange: handleColorChange
@@ -30600,7 +30633,7 @@ const LockedPolygonSettings = props => {
30600
30633
  size: spacing.medium_16
30601
30634
  }), /*#__PURE__*/React.createElement(LabelMedium, {
30602
30635
  tag: "label",
30603
- style: styles$k.row
30636
+ style: styles$m.row
30604
30637
  }, "fill", /*#__PURE__*/React.createElement(Strut, {
30605
30638
  size: spacing.xxSmall_6
30606
30639
  }), /*#__PURE__*/React.createElement(SingleSelect, {
@@ -30617,7 +30650,7 @@ const LockedPolygonSettings = props => {
30617
30650
  label: option
30618
30651
  }))))), /*#__PURE__*/React.createElement(LabelMedium, {
30619
30652
  tag: "label",
30620
- style: [styles$k.row, styles$k.spaceUnder]
30653
+ style: [styles$m.row, styles$m.spaceUnder]
30621
30654
  }, "stroke", /*#__PURE__*/React.createElement(Strut, {
30622
30655
  size: spacing.xxSmall_6
30623
30656
  }), /*#__PURE__*/React.createElement(SingleSelect, {
@@ -30640,17 +30673,17 @@ const LockedPolygonSettings = props => {
30640
30673
  onChange: newValue => onChangeProps({
30641
30674
  showVertices: newValue
30642
30675
  }),
30643
- style: styles$k.spaceUnder
30676
+ style: styles$m.spaceUnder
30644
30677
  }), /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
30645
30678
  header: /*#__PURE__*/React.createElement(LabelLarge, null, "Points"),
30646
30679
  expanded: true,
30647
- containerStyle: styles$k.pointAccordionContainer,
30648
- panelStyle: styles$k.pointAccordionPanel
30680
+ containerStyle: styles$m.pointAccordionContainer,
30681
+ panelStyle: styles$m.pointAccordionPanel
30649
30682
  }, points.map((point, index) => {
30650
30683
  const pointLabel = String.fromCharCode(65 + index);
30651
30684
  return /*#__PURE__*/React.createElement(View, {
30652
30685
  key: `locked-polygon-point-${point[0]}-${point[1]}-index-${index}`,
30653
- style: [styles$k.row, styles$k.spaceUnder]
30686
+ style: [styles$m.row, styles$m.spaceUnder]
30654
30687
  }, /*#__PURE__*/React.createElement(LabelLarge, null, `${pointLabel}:`), /*#__PURE__*/React.createElement(Strut, {
30655
30688
  size: spacing.medium_16
30656
30689
  }), /*#__PURE__*/React.createElement(CoordinatePairInput, {
@@ -30678,7 +30711,7 @@ const LockedPolygonSettings = props => {
30678
30711
  points: newPoints
30679
30712
  });
30680
30713
  },
30681
- style: styles$k.icon
30714
+ style: styles$m.icon
30682
30715
  }));
30683
30716
  }), /*#__PURE__*/React.createElement(Button, {
30684
30717
  kind: "tertiary",
@@ -30689,13 +30722,12 @@ const LockedPolygonSettings = props => {
30689
30722
  });
30690
30723
  }
30691
30724
  }, "Add point")), /*#__PURE__*/React.createElement(LockedFigureSettingsActions, {
30692
- showM2Features: props.showM2Features,
30693
30725
  figureType: props.type,
30694
30726
  onMove: onMove,
30695
30727
  onRemove: onRemove
30696
30728
  }));
30697
30729
  };
30698
- const styles$k = StyleSheet.create({
30730
+ const styles$m = StyleSheet.create({
30699
30731
  row: {
30700
30732
  display: "flex",
30701
30733
  flexDirection: "row",
@@ -30753,7 +30785,7 @@ const LockedVectorSettings = props => {
30753
30785
  expanded: props.expanded,
30754
30786
  onToggle: props.onToggle,
30755
30787
  header: /*#__PURE__*/React.createElement(View, {
30756
- style: styles$j.row
30788
+ style: styles$l.row
30757
30789
  }, /*#__PURE__*/React.createElement(LabelLarge, null, lineLabel), /*#__PURE__*/React.createElement(Strut, {
30758
30790
  size: spacing.xSmall_8
30759
30791
  }), /*#__PURE__*/React.createElement(LineSwatch, {
@@ -30761,19 +30793,19 @@ const LockedVectorSettings = props => {
30761
30793
  lineStyle: "solid"
30762
30794
  }))
30763
30795
  }, /*#__PURE__*/React.createElement(View, {
30764
- style: [styles$j.row, styles$j.spaceUnder]
30796
+ style: [styles$l.row, styles$l.spaceUnder]
30765
30797
  }, /*#__PURE__*/React.createElement(ColorSelect, {
30766
30798
  selectedValue: lineColor,
30767
30799
  onChange: handleColorChange
30768
30800
  })), isInvalid && /*#__PURE__*/React.createElement(LabelMedium, {
30769
- style: styles$j.errorText
30801
+ style: styles$l.errorText
30770
30802
  }, lengthErrorMessage), /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
30771
30803
  expanded: true // Initial state is expanded
30772
30804
  ,
30773
- containerStyle: styles$j.container,
30774
- panelStyle: styles$j.accordionPanel,
30805
+ containerStyle: styles$l.container,
30806
+ panelStyle: styles$l.accordionPanel,
30775
30807
  header: /*#__PURE__*/React.createElement(View, {
30776
- style: styles$j.row
30808
+ style: styles$l.row
30777
30809
  }, /*#__PURE__*/React.createElement(LabelLarge, null, `Tail (${tail[0]}, ${tail[1]})`))
30778
30810
  }, /*#__PURE__*/React.createElement(CoordinatePairInput, {
30779
30811
  coord: tail,
@@ -30784,10 +30816,10 @@ const LockedVectorSettings = props => {
30784
30816
  })), /*#__PURE__*/React.createElement(PerseusEditorAccordion, {
30785
30817
  expanded: true // Initial state is expanded
30786
30818
  ,
30787
- containerStyle: styles$j.container,
30788
- panelStyle: styles$j.accordionPanel,
30819
+ containerStyle: styles$l.container,
30820
+ panelStyle: styles$l.accordionPanel,
30789
30821
  header: /*#__PURE__*/React.createElement(View, {
30790
- style: styles$j.row
30822
+ style: styles$l.row
30791
30823
  }, /*#__PURE__*/React.createElement(LabelLarge, null, `Tip (${tip[0]}, ${tip[1]})`))
30792
30824
  }, /*#__PURE__*/React.createElement(CoordinatePairInput, {
30793
30825
  coord: tip,
@@ -30796,13 +30828,12 @@ const LockedVectorSettings = props => {
30796
30828
  handleChangePoint(newProps, 1);
30797
30829
  }
30798
30830
  })), /*#__PURE__*/React.createElement(LockedFigureSettingsActions, {
30799
- showM2Features: props.showM2Features,
30800
30831
  figureType: props.type,
30801
30832
  onMove: onMove,
30802
30833
  onRemove: onRemove
30803
30834
  }));
30804
30835
  };
30805
- const styles$j = StyleSheet.create({
30836
+ const styles$l = StyleSheet.create({
30806
30837
  accordionPanel: {
30807
30838
  paddingBottom: spacing.medium_16
30808
30839
  },
@@ -30839,19 +30870,11 @@ const LockedFigureSettings = props => {
30839
30870
  case "line":
30840
30871
  return /*#__PURE__*/React.createElement(LockedLineSettings, props);
30841
30872
  case "vector":
30842
- if (props.showM2Features) {
30843
- return /*#__PURE__*/React.createElement(LockedVectorSettings, props);
30844
- }
30845
- break;
30873
+ return /*#__PURE__*/React.createElement(LockedVectorSettings, props);
30846
30874
  case "ellipse":
30847
- if (props.showM2Features) {
30848
- return /*#__PURE__*/React.createElement(LockedEllipseSettings, props);
30849
- }
30850
- break;
30875
+ return /*#__PURE__*/React.createElement(LockedEllipseSettings, props);
30851
30876
  case "polygon":
30852
- if (props.showM2Features) {
30853
- return /*#__PURE__*/React.createElement(LockedPolygonSettings, props);
30854
- }
30877
+ return /*#__PURE__*/React.createElement(LockedPolygonSettings, props);
30855
30878
  }
30856
30879
  return null;
30857
30880
  };
@@ -30963,7 +30986,6 @@ const LockedFiguresSection = props => {
30963
30986
  }
30964
30987
  return /*#__PURE__*/React.createElement(LockedFigureSettings, _extends({
30965
30988
  key: `${uniqueId}-locked-${figure}-${index}`,
30966
- showM2Features: props.showM2Features,
30967
30989
  showM2bFeatures: props.showM2bFeatures,
30968
30990
  expanded: expandedStates[index],
30969
30991
  onToggle: newValue => {
@@ -30977,9 +30999,8 @@ const LockedFiguresSection = props => {
30977
30999
  onRemove: () => removeLockedFigure(index)
30978
31000
  }));
30979
31001
  }), /*#__PURE__*/React.createElement(View, {
30980
- style: styles$i.buttonContainer
31002
+ style: styles$k.buttonContainer
30981
31003
  }, /*#__PURE__*/React.createElement(LockedFigureSelect, {
30982
- showM2Features: props.showM2Features,
30983
31004
  showM2bFeatures: props.showM2bFeatures,
30984
31005
  id: `${uniqueId}-select`,
30985
31006
  onChange: addLockedFigure
@@ -30988,10 +31009,10 @@ const LockedFiguresSection = props => {
30988
31009
  }), showExpandButton && /*#__PURE__*/React.createElement(Button, {
30989
31010
  kind: "secondary",
30990
31011
  onClick: () => toggleExpanded(allCollapsed),
30991
- style: styles$i.button
31012
+ style: styles$k.button
30992
31013
  }, buttonLabel))));
30993
31014
  };
30994
- const styles$i = StyleSheet.create({
31015
+ const styles$k = StyleSheet.create({
30995
31016
  buttonContainer: {
30996
31017
  flexDirection: "row",
30997
31018
  alignItems: "center"
@@ -31026,7 +31047,7 @@ const GraphPointsCountSelector = ({
31026
31047
  // Never uses placeholder, always has value
31027
31048
  ,
31028
31049
  placeholder: "",
31029
- style: styles$h.singleSelectShort
31050
+ style: styles$j.singleSelectShort
31030
31051
  }, [...[...Array(7).keys()].map(n => /*#__PURE__*/React.createElement(OptionItem, {
31031
31052
  key: n,
31032
31053
  value: `${n}`,
@@ -31037,7 +31058,7 @@ const GraphPointsCountSelector = ({
31037
31058
  label: "unlimited"
31038
31059
  })]);
31039
31060
  };
31040
- const styles$h = StyleSheet.create({
31061
+ const styles$j = StyleSheet.create({
31041
31062
  singleSelectShort: {
31042
31063
  // Non-standard spacing, but it's the smallest we can go
31043
31064
  // without running into styling issues with the dropdown.
@@ -31050,7 +31071,7 @@ const GraphTypeSelector = props => {
31050
31071
  selectedValue: props.graphType,
31051
31072
  onChange: props.onChange,
31052
31073
  placeholder: "Select a graph type",
31053
- style: styles$g.singleSelectShort
31074
+ style: styles$i.singleSelectShort
31054
31075
  }, /*#__PURE__*/React.createElement(OptionItem, {
31055
31076
  value: "linear",
31056
31077
  label: "Linear function"
@@ -31083,7 +31104,7 @@ const GraphTypeSelector = props => {
31083
31104
  label: "Angle"
31084
31105
  }));
31085
31106
  };
31086
- const styles$g = StyleSheet.create({
31107
+ const styles$i = StyleSheet.create({
31087
31108
  singleSelectShort: {
31088
31109
  // Non-standard spacing, but it's the smallest we can go
31089
31110
  // without running into styling issues with the dropdown.
@@ -31487,10 +31508,10 @@ class InteractiveGraphSettings extends React.Component {
31487
31508
  onChange: this.change
31488
31509
  }))), /*#__PURE__*/React.createElement(LabeledRow, {
31489
31510
  label: "Background image URL:",
31490
- style: styles$f.resetSpaceTop
31511
+ style: styles$h.resetSpaceTop
31491
31512
  }, /*#__PURE__*/React.createElement("input", {
31492
31513
  type: "text",
31493
- className: css(styles$f.backgroundUrlInput),
31514
+ className: css(styles$h.backgroundUrlInput),
31494
31515
  ref: this.bgUrlRef,
31495
31516
  value: this.state.backgroundImage.url || "",
31496
31517
  onChange: e => {
@@ -31504,14 +31525,14 @@ class InteractiveGraphSettings extends React.Component {
31504
31525
  onKeyPress: this.changeBackgroundUrl,
31505
31526
  onBlur: this.changeBackgroundUrl
31506
31527
  }), /*#__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, {
31507
- style: styles$f.protractorSection
31528
+ style: styles$h.protractorSection
31508
31529
  }, /*#__PURE__*/React.createElement(View, {
31509
- style: styles$f.checkboxRow
31530
+ style: styles$h.checkboxRow
31510
31531
  }, /*#__PURE__*/React.createElement(PropCheckBox$7, {
31511
31532
  label: "Show protractor",
31512
31533
  showProtractor: this.props.showProtractor,
31513
31534
  onChange: this.change,
31514
- style: styles$f.resetSpaceTop
31535
+ style: styles$h.resetSpaceTop
31515
31536
  })), this.props.showProtractor && /*#__PURE__*/React.createElement(Banner, {
31516
31537
  layout: "floating",
31517
31538
  text: "The protractor is not accessible. Please consider an alternate approach.",
@@ -31532,7 +31553,7 @@ InteractiveGraphSettings.defaultProps = {
31532
31553
  showProtractor: false,
31533
31554
  showTooltips: false
31534
31555
  };
31535
- const styles$f = StyleSheet.create({
31556
+ const styles$h = StyleSheet.create({
31536
31557
  resetSpaceTop: {
31537
31558
  marginTop: 0
31538
31559
  },
@@ -31569,13 +31590,13 @@ const SegmentCountSelector = ({
31569
31590
  const num = +newValue;
31570
31591
  onChange(num);
31571
31592
  },
31572
- style: styles$e.singleSelectShort
31593
+ style: styles$g.singleSelectShort
31573
31594
  }, _.range(1, 7).map(n => /*#__PURE__*/React.createElement(OptionItem, {
31574
31595
  key: n,
31575
31596
  value: `${n}`,
31576
31597
  label: `${n} segment${n > 1 ? "s" : ""}`
31577
31598
  })));
31578
- const styles$e = StyleSheet.create({
31599
+ const styles$g = StyleSheet.create({
31579
31600
  singleSelectShort: {
31580
31601
  // Non-standard spacing, but it's the smallest we can go
31581
31602
  // without running into styling issues with the dropdown.
@@ -31589,9 +31610,9 @@ const StartCoordsCircle = props => {
31589
31610
  onChange
31590
31611
  } = props;
31591
31612
  return /*#__PURE__*/React.createElement(View, {
31592
- style: styles$d.tile
31613
+ style: styles$f.tile
31593
31614
  }, /*#__PURE__*/React.createElement(View, {
31594
- style: styles$d.row
31615
+ style: styles$f.row
31595
31616
  }, /*#__PURE__*/React.createElement(LabelLarge, null, "Center:"), /*#__PURE__*/React.createElement(Strut, {
31596
31617
  size: spacing.small_12
31597
31618
  }), /*#__PURE__*/React.createElement(CoordinatePairInput, {
@@ -31604,7 +31625,7 @@ const StartCoordsCircle = props => {
31604
31625
  })), /*#__PURE__*/React.createElement(Strut, {
31605
31626
  size: spacing.small_12
31606
31627
  }), /*#__PURE__*/React.createElement(View, {
31607
- style: styles$d.row
31628
+ style: styles$f.row
31608
31629
  }, /*#__PURE__*/React.createElement(LabelLarge, null, "Radius:"), /*#__PURE__*/React.createElement(Strut, {
31609
31630
  size: spacing.small_12
31610
31631
  }), /*#__PURE__*/React.createElement(TextField, {
@@ -31616,10 +31637,10 @@ const StartCoordsCircle = props => {
31616
31637
  radius: parseFloat(value)
31617
31638
  });
31618
31639
  },
31619
- style: styles$d.textField
31640
+ style: styles$f.textField
31620
31641
  })));
31621
31642
  };
31622
- const styles$d = StyleSheet.create({
31643
+ const styles$f = StyleSheet.create({
31623
31644
  tile: {
31624
31645
  backgroundColor: color.fadedBlue8,
31625
31646
  marginTop: spacing.xSmall_8,
@@ -31641,7 +31662,7 @@ const StartCoordsLine = props => {
31641
31662
  onChange
31642
31663
  } = props;
31643
31664
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
31644
- style: styles$c.tile
31665
+ style: styles$e.tile
31645
31666
  }, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 1:"), /*#__PURE__*/React.createElement(Strut, {
31646
31667
  size: spacing.small_12
31647
31668
  }), /*#__PURE__*/React.createElement(CoordinatePairInput, {
@@ -31649,7 +31670,7 @@ const StartCoordsLine = props => {
31649
31670
  labels: ["x", "y"],
31650
31671
  onChange: value => onChange([value, startCoords[1]])
31651
31672
  })), /*#__PURE__*/React.createElement(View, {
31652
- style: styles$c.tile
31673
+ style: styles$e.tile
31653
31674
  }, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 2:"), /*#__PURE__*/React.createElement(Strut, {
31654
31675
  size: spacing.small_12
31655
31676
  }), /*#__PURE__*/React.createElement(CoordinatePairInput, {
@@ -31658,7 +31679,7 @@ const StartCoordsLine = props => {
31658
31679
  onChange: value => onChange([startCoords[0], value])
31659
31680
  })));
31660
31681
  };
31661
- const styles$c = StyleSheet.create({
31682
+ const styles$e = StyleSheet.create({
31662
31683
  tile: {
31663
31684
  backgroundColor: color.fadedBlue8,
31664
31685
  marginTop: spacing.xSmall_8,
@@ -31681,7 +31702,7 @@ const StartCoordsMultiline = props => {
31681
31702
  header: /*#__PURE__*/React.createElement(LabelLarge, null, `${graphName} ${i + 1}`),
31682
31703
  expanded: true
31683
31704
  }, /*#__PURE__*/React.createElement(View, {
31684
- style: styles$b.nestedTile
31705
+ style: styles$d.nestedTile
31685
31706
  }, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 1:"), /*#__PURE__*/React.createElement(Strut, {
31686
31707
  size: spacing.small_12
31687
31708
  }), /*#__PURE__*/React.createElement(CoordinatePairInput, {
@@ -31693,7 +31714,7 @@ const StartCoordsMultiline = props => {
31693
31714
  onChange(newCoords);
31694
31715
  }
31695
31716
  })), /*#__PURE__*/React.createElement(View, {
31696
- style: styles$b.nestedTile
31717
+ style: styles$d.nestedTile
31697
31718
  }, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 2:"), /*#__PURE__*/React.createElement(Strut, {
31698
31719
  size: spacing.small_12
31699
31720
  }), /*#__PURE__*/React.createElement(CoordinatePairInput, {
@@ -31706,7 +31727,7 @@ const StartCoordsMultiline = props => {
31706
31727
  }
31707
31728
  })))));
31708
31729
  };
31709
- const styles$b = StyleSheet.create({
31730
+ const styles$d = StyleSheet.create({
31710
31731
  nestedTile: {
31711
31732
  paddingBottom: spacing.small_12,
31712
31733
  flexDirection: "row",
@@ -31714,6 +31735,112 @@ const styles$b = StyleSheet.create({
31714
31735
  }
31715
31736
  });
31716
31737
 
31738
+ const StartCoordsQuadratic = props => {
31739
+ const {
31740
+ startCoords,
31741
+ onChange
31742
+ } = props;
31743
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
31744
+ style: styles$c.equationSection
31745
+ }, /*#__PURE__*/React.createElement(LabelMedium, null, "Starting equation:"), /*#__PURE__*/React.createElement(BodyMonospace, {
31746
+ style: styles$c.equationBody
31747
+ }, getQuadraticEquation(startCoords))), /*#__PURE__*/React.createElement(View, {
31748
+ style: styles$c.tile
31749
+ }, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 1:"), /*#__PURE__*/React.createElement(Strut, {
31750
+ size: spacing.small_12
31751
+ }), /*#__PURE__*/React.createElement(CoordinatePairInput, {
31752
+ coord: startCoords[0],
31753
+ labels: ["x", "y"],
31754
+ onChange: value => onChange([value, startCoords[1], startCoords[2]])
31755
+ })), /*#__PURE__*/React.createElement(View, {
31756
+ style: styles$c.tile
31757
+ }, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 2:"), /*#__PURE__*/React.createElement(Strut, {
31758
+ size: spacing.small_12
31759
+ }), /*#__PURE__*/React.createElement(CoordinatePairInput, {
31760
+ coord: startCoords[1],
31761
+ labels: ["x", "y"],
31762
+ onChange: value => onChange([startCoords[0], value, startCoords[2]])
31763
+ })), /*#__PURE__*/React.createElement(View, {
31764
+ style: styles$c.tile
31765
+ }, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 3:"), /*#__PURE__*/React.createElement(Strut, {
31766
+ size: spacing.small_12
31767
+ }), /*#__PURE__*/React.createElement(CoordinatePairInput, {
31768
+ coord: startCoords[2],
31769
+ labels: ["x", "y"],
31770
+ onChange: value => onChange([startCoords[0], startCoords[1], value])
31771
+ })));
31772
+ };
31773
+ const styles$c = StyleSheet.create({
31774
+ tile: {
31775
+ backgroundColor: color.fadedBlue8,
31776
+ marginTop: spacing.xSmall_8,
31777
+ padding: spacing.small_12,
31778
+ borderRadius: spacing.xSmall_8,
31779
+ flexDirection: "row",
31780
+ alignItems: "center"
31781
+ },
31782
+ equationSection: {
31783
+ marginTop: spacing.small_12
31784
+ },
31785
+ equationBody: {
31786
+ backgroundColor: color.fadedOffBlack8,
31787
+ border: `1px solid ${color.fadedOffBlack32}`,
31788
+ marginTop: spacing.xSmall_8,
31789
+ paddingLeft: spacing.xSmall_8,
31790
+ paddingRight: spacing.xSmall_8,
31791
+ fontSize: font.size.xSmall
31792
+ }
31793
+ });
31794
+
31795
+ const StartCoordsSinusoid = props => {
31796
+ const {
31797
+ startCoords,
31798
+ onChange
31799
+ } = props;
31800
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
31801
+ style: styles$b.equationSection
31802
+ }, /*#__PURE__*/React.createElement(LabelMedium, null, "Starting equation:"), /*#__PURE__*/React.createElement(BodyMonospace, {
31803
+ style: styles$b.equationBody
31804
+ }, getSinusoidEquation(startCoords))), /*#__PURE__*/React.createElement(View, {
31805
+ style: styles$b.tile
31806
+ }, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 1:"), /*#__PURE__*/React.createElement(Strut, {
31807
+ size: spacing.small_12
31808
+ }), /*#__PURE__*/React.createElement(CoordinatePairInput, {
31809
+ coord: startCoords[0],
31810
+ labels: ["x", "y"],
31811
+ onChange: value => onChange([value, startCoords[1]])
31812
+ })), /*#__PURE__*/React.createElement(View, {
31813
+ style: styles$b.tile
31814
+ }, /*#__PURE__*/React.createElement(LabelLarge, null, "Point 2:"), /*#__PURE__*/React.createElement(Strut, {
31815
+ size: spacing.small_12
31816
+ }), /*#__PURE__*/React.createElement(CoordinatePairInput, {
31817
+ coord: startCoords[1],
31818
+ labels: ["x", "y"],
31819
+ onChange: value => onChange([startCoords[0], value])
31820
+ })));
31821
+ };
31822
+ const styles$b = StyleSheet.create({
31823
+ tile: {
31824
+ backgroundColor: color.fadedBlue8,
31825
+ marginTop: spacing.xSmall_8,
31826
+ padding: spacing.small_12,
31827
+ borderRadius: spacing.xSmall_8,
31828
+ flexDirection: "row",
31829
+ alignItems: "center"
31830
+ },
31831
+ equationSection: {
31832
+ marginTop: spacing.small_12
31833
+ },
31834
+ equationBody: {
31835
+ backgroundColor: color.fadedOffBlack8,
31836
+ border: `1px solid ${color.fadedOffBlack32}`,
31837
+ marginTop: spacing.xSmall_8,
31838
+ paddingLeft: spacing.xSmall_8,
31839
+ paddingRight: spacing.xSmall_8,
31840
+ fontSize: font.size.xSmall
31841
+ }
31842
+ });
31843
+
31717
31844
  const StartCoordsSettingsInner = props => {
31718
31845
  const {
31719
31846
  type,
@@ -31754,6 +31881,18 @@ const StartCoordsSettingsInner = props => {
31754
31881
  },
31755
31882
  onChange: onChange
31756
31883
  });
31884
+ case "sinusoid":
31885
+ const sinusoidCoords = getSinusoidCoords(props, range, step);
31886
+ return /*#__PURE__*/React.createElement(StartCoordsSinusoid, {
31887
+ startCoords: sinusoidCoords,
31888
+ onChange: onChange
31889
+ });
31890
+ case "quadratic":
31891
+ const quadraticCoords = getQuadraticCoords(props, range, step);
31892
+ return /*#__PURE__*/React.createElement(StartCoordsQuadratic, {
31893
+ startCoords: quadraticCoords,
31894
+ onChange: onChange
31895
+ });
31757
31896
  default:
31758
31897
  return null;
31759
31898
  }
@@ -31808,6 +31947,10 @@ const POLYGON_SIDES = _.map(_.range(3, 13), function (value) {
31808
31947
  label: `${value} sides`
31809
31948
  });
31810
31949
  });
31950
+
31951
+ // TODO(LEMS-2228): Remove flags once this is fully released
31952
+ const startCoordsUiPhase1Types = ["linear", "linear-system", "ray", "segment", "circle"];
31953
+ const startCoordsUiPhase2Types = ["sinusoid", "quadratic"];
31811
31954
  /**
31812
31955
  * An editor for the InteractiveGraph widget, which allows the user to
31813
31956
  * specify the graph's properties and the correct answer.
@@ -31859,7 +32002,7 @@ class InteractiveGraphEditor extends React.Component {
31859
32002
  DeprecationMixin.UNSAFE_componentWillMount.call(this);
31860
32003
  }
31861
32004
  render() {
31862
- 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;
32005
+ var _this$props$apiOption, _this$props$apiOption2, _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$apiOption3, _this$props$apiOption4;
31863
32006
  let graph;
31864
32007
  let equationString;
31865
32008
  const gridStep = this.props.gridStep || Util.getGridStep(this.props.range, this.props.step, interactiveSizes.defaultBoxSize);
@@ -31920,6 +32063,9 @@ class InteractiveGraphEditor extends React.Component {
31920
32063
  className: "perseus-error"
31921
32064
  }, this.props.valid);
31922
32065
  }
32066
+ const startCoordsPhase1 = (_this$props$apiOption = this.props.apiOptions) == null || (_this$props$apiOption = _this$props$apiOption.flags) == null || (_this$props$apiOption = _this$props$apiOption.mafs) == null ? void 0 : _this$props$apiOption["start-coords-ui-phase-1"];
32067
+ const startCoordsPhase2 = (_this$props$apiOption2 = this.props.apiOptions) == null || (_this$props$apiOption2 = _this$props$apiOption2.flags) == null || (_this$props$apiOption2 = _this$props$apiOption2.mafs) == null ? void 0 : _this$props$apiOption2["start-coords-ui-phase-2"];
32068
+ const displayStartCoordsUI = this.props.graph && (startCoordsPhase1 && startCoordsUiPhase1Types.includes(this.props.graph.type) || startCoordsPhase2 && startCoordsUiPhase2Types.includes(this.props.graph.type));
31923
32069
  return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(LabeledRow, {
31924
32070
  label: "Type of Graph:"
31925
32071
  }, /*#__PURE__*/React.createElement(GraphTypeSelector, {
@@ -32060,7 +32206,9 @@ class InteractiveGraphEditor extends React.Component {
32060
32206
  }
32061
32207
  });
32062
32208
  }
32063
- })), ((_this$props$graph5 = this.props.graph) == null ? void 0 : _this$props$graph5.type) && ((_this$props$apiOption = this.props.apiOptions) == null || (_this$props$apiOption = _this$props$apiOption.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, {
32209
+ })), ((_this$props$graph5 = this.props.graph) == null ? void 0 : _this$props$graph5.type) &&
32210
+ // TODO(LEMS-2228): Remove flags once this is fully released
32211
+ displayStartCoordsUI && /*#__PURE__*/React.createElement(StartCoordsSettings, _extends({}, this.props.graph, {
32064
32212
  range: this.props.range,
32065
32213
  step: this.props.step,
32066
32214
  onChange: this.changeStartCoords
@@ -32116,8 +32264,7 @@ class InteractiveGraphEditor extends React.Component {
32116
32264
  })), /*#__PURE__*/React.createElement(InfoTip$b, null, /*#__PURE__*/React.createElement("p", null, "Congruency requires only that the angle measures are the same. An exact match implies congruency, but also requires that the angles have the same orientation and that the vertices are in the same position."))),
32117
32265
  // Only show the "Add locked figure" dropdown if the graph
32118
32266
  // is using Mafs.
32119
- this.props.graph && ((_this$props$apiOption2 = this.props.apiOptions) == null || (_this$props$apiOption2 = _this$props$apiOption2.flags) == null || (_this$props$apiOption2 = _this$props$apiOption2.mafs) == null ? void 0 : _this$props$apiOption2[this.props.graph.type]) && /*#__PURE__*/React.createElement(LockedFiguresSection, {
32120
- showM2Features: (_this$props$apiOption3 = this.props.apiOptions) == null || (_this$props$apiOption3 = _this$props$apiOption3.flags) == null || (_this$props$apiOption3 = _this$props$apiOption3.mafs) == null ? void 0 : _this$props$apiOption3["interactive-graph-locked-features-m2"],
32267
+ this.props.graph && ((_this$props$apiOption3 = this.props.apiOptions) == null || (_this$props$apiOption3 = _this$props$apiOption3.flags) == null || (_this$props$apiOption3 = _this$props$apiOption3.mafs) == null ? void 0 : _this$props$apiOption3[this.props.graph.type]) && /*#__PURE__*/React.createElement(LockedFiguresSection, {
32121
32268
  showM2bFeatures: (_this$props$apiOption4 = this.props.apiOptions) == null || (_this$props$apiOption4 = _this$props$apiOption4.flags) == null || (_this$props$apiOption4 = _this$props$apiOption4.mafs) == null ? void 0 : _this$props$apiOption4["interactive-graph-locked-features-m2b"],
32122
32269
  figures: this.props.lockedFigures,
32123
32270
  onChange: this.props.onChange