@khanacademy/perseus-editor 14.0.1 → 14.1.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/index.js CHANGED
@@ -33,6 +33,8 @@ var caretDoubleUpIcon = require('@phosphor-icons/core/bold/caret-double-up-bold.
33
33
  var caretDownIcon = require('@phosphor-icons/core/bold/caret-down-bold.svg');
34
34
  var caretUpIcon = require('@phosphor-icons/core/bold/caret-up-bold.svg');
35
35
  var trashIcon = require('@phosphor-icons/core/bold/trash-bold.svg');
36
+ var copyIcon = require('@phosphor-icons/core/assets/regular/copy.svg');
37
+ var autoPasteIcon = require('@phosphor-icons/core/assets/regular/note-pencil.svg');
36
38
  var arrowFatDown = require('@phosphor-icons/core/regular/arrow-fat-down.svg');
37
39
  var arrowFatLeft = require('@phosphor-icons/core/regular/arrow-fat-left.svg');
38
40
  var arrowFatRight = require('@phosphor-icons/core/regular/arrow-fat-right.svg');
@@ -80,6 +82,8 @@ var caretDoubleUpIcon__default = /*#__PURE__*/_interopDefaultLegacy(caretDoubleU
80
82
  var caretDownIcon__default = /*#__PURE__*/_interopDefaultLegacy(caretDownIcon);
81
83
  var caretUpIcon__default = /*#__PURE__*/_interopDefaultLegacy(caretUpIcon);
82
84
  var trashIcon__default = /*#__PURE__*/_interopDefaultLegacy(trashIcon);
85
+ var copyIcon__default = /*#__PURE__*/_interopDefaultLegacy(copyIcon);
86
+ var autoPasteIcon__default = /*#__PURE__*/_interopDefaultLegacy(autoPasteIcon);
83
87
  var arrowFatDown__default = /*#__PURE__*/_interopDefaultLegacy(arrowFatDown);
84
88
  var arrowFatLeft__default = /*#__PURE__*/_interopDefaultLegacy(arrowFatLeft);
85
89
  var arrowFatRight__default = /*#__PURE__*/_interopDefaultLegacy(arrowFatRight);
@@ -91,7 +95,7 @@ var arrowCounterClockwise__default = /*#__PURE__*/_interopDefaultLegacy(arrowCou
91
95
 
92
96
  // This file is processed by a Rollup plugin (replace) to inject the production
93
97
  const libName = "@khanacademy/perseus-editor";
94
- const libVersion = "14.0.1";
98
+ const libVersion = "14.1.0";
95
99
  perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
96
100
 
97
101
  function _extends() {
@@ -268,7 +272,7 @@ const JsonEditor = createReactClass__default["default"]({
268
272
  });
269
273
 
270
274
  const {
271
- InlineIcon: InlineIcon$a
275
+ InlineIcon: InlineIcon$b
272
276
  } = perseus.components;
273
277
  class SectionControlButton extends React__namespace.Component {
274
278
  render() {
@@ -286,13 +290,13 @@ class SectionControlButton extends React__namespace.Component {
286
290
  role: "button",
287
291
  hideDefaultFocusRing: true,
288
292
  "aria-label": title,
289
- style: styles$T.button
293
+ style: styles$U.button
290
294
  }, _ref => {
291
- return /*#__PURE__*/React__namespace.createElement(InlineIcon$a, icon);
295
+ return /*#__PURE__*/React__namespace.createElement(InlineIcon$b, icon);
292
296
  });
293
297
  }
294
298
  }
295
- const styles$T = aphrodite.StyleSheet.create({
299
+ const styles$U = aphrodite.StyleSheet.create({
296
300
  button: {
297
301
  backgroundColor: wonderBlocksTokens.color.gold,
298
302
  margin: 2,
@@ -20673,11 +20677,11 @@ class Spring extends React__namespace.Component {
20673
20677
  } = this.props;
20674
20678
  return React__namespace.createElement(wonderBlocksCore.View, {
20675
20679
  "aria-hidden": "true",
20676
- style: [styles$S.grow, style]
20680
+ style: [styles$T.grow, style]
20677
20681
  });
20678
20682
  }
20679
20683
  }
20680
- const styles$S = aphrodite.StyleSheet.create({
20684
+ const styles$T = aphrodite.StyleSheet.create({
20681
20685
  grow: {
20682
20686
  flexGrow: 1
20683
20687
  }
@@ -20720,7 +20724,7 @@ const Spacing = {
20720
20724
  };
20721
20725
 
20722
20726
  const {
20723
- InlineIcon: InlineIcon$9
20727
+ InlineIcon: InlineIcon$a
20724
20728
  } = perseus.components;
20725
20729
  const {
20726
20730
  iconChevronDown: iconChevronDown$1,
@@ -20830,7 +20834,7 @@ class WidgetEditor extends React__namespace.Component {
20830
20834
  className: "perseus-widget-editor-title-id",
20831
20835
  href: "#",
20832
20836
  onClick: this._toggleWidget
20833
- }, this.props.id, this.state.showWidget ? /*#__PURE__*/React__namespace.createElement(InlineIcon$9, iconChevronDown$1) : /*#__PURE__*/React__namespace.createElement(InlineIcon$9, iconChevronRight)), supportsStaticMode && /*#__PURE__*/React__namespace.createElement(LabeledSwitch$1, {
20837
+ }, this.props.id, this.state.showWidget ? /*#__PURE__*/React__namespace.createElement(InlineIcon$a, iconChevronDown$1) : /*#__PURE__*/React__namespace.createElement(InlineIcon$a, iconChevronRight)), supportsStaticMode && /*#__PURE__*/React__namespace.createElement(LabeledSwitch$1, {
20834
20838
  label: "Static",
20835
20839
  checked: !!widgetInfo.static,
20836
20840
  onChange: this._setStatic
@@ -20914,13 +20918,13 @@ class WidgetSelect extends React__namespace.Component {
20914
20918
  * that collapse a region.
20915
20919
  */
20916
20920
  function ToggleableCaret(props) {
20917
- const iconStyle = props.isExpanded ? styles$R.expanded : styles$R.collapsed;
20921
+ const iconStyle = props.isExpanded ? styles$S.expanded : styles$S.collapsed;
20918
20922
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksIcon.PhosphorIcon, {
20919
20923
  icon: caretRight__default["default"],
20920
20924
  style: iconStyle
20921
20925
  });
20922
20926
  }
20923
- const styles$R = aphrodite.StyleSheet.create({
20927
+ const styles$S = aphrodite.StyleSheet.create({
20924
20928
  collapsed: {
20925
20929
  transition: ".15s"
20926
20930
  },
@@ -20950,16 +20954,16 @@ class TexErrorView extends React__namespace.Component {
20950
20954
  showErrors
20951
20955
  } = this.state;
20952
20956
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
20953
- style: styles$Q.errorContainer
20957
+ style: styles$R.errorContainer
20954
20958
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
20955
- style: styles$Q.title,
20959
+ style: styles$R.title,
20956
20960
  onClick: this.handleToggleTexErrors
20957
20961
  }, /*#__PURE__*/React__namespace.createElement(ToggleableCaret, {
20958
20962
  isExpanded: showErrors
20959
20963
  }), "\xA0 TeX Errors (", errorList.length, ")"), showErrors && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
20960
- style: styles$Q.errorExplanation
20964
+ style: styles$R.errorExplanation
20961
20965
  }, "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__namespace.createElement(wonderBlocksCore.View, {
20962
- style: styles$Q.error,
20966
+ style: styles$R.error,
20963
20967
  key: index
20964
20968
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
20965
20969
  style: {
@@ -20968,7 +20972,7 @@ class TexErrorView extends React__namespace.Component {
20968
20972
  }, e.math), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, e.message))));
20969
20973
  }
20970
20974
  }
20971
- const styles$Q = aphrodite.StyleSheet.create({
20975
+ const styles$R = aphrodite.StyleSheet.create({
20972
20976
  title: {
20973
20977
  backgroundColor: "#eee",
20974
20978
  fontSize: "1.25em",
@@ -21951,7 +21955,7 @@ class IframeContentRenderer extends React__namespace.Component {
21951
21955
 
21952
21956
  const {
21953
21957
  HUD: HUD$1,
21954
- InlineIcon: InlineIcon$8
21958
+ InlineIcon: InlineIcon$9
21955
21959
  } = perseus.components;
21956
21960
  const {
21957
21961
  iconCircleArrowDown: iconCircleArrowDown$1,
@@ -22106,7 +22110,7 @@ class ArticleEditor extends React__namespace.Component {
22106
22110
  onClick: () => {
22107
22111
  this._handleAddSectionAfter(this._sections().length - 1);
22108
22112
  }
22109
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$8, iconPlus$4), " Add a section")));
22113
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$9, iconPlus$4), " Add a section")));
22110
22114
  }
22111
22115
  _renderLinterHUD() {
22112
22116
  return /*#__PURE__*/React__namespace.createElement(HUD$1, {
@@ -22258,8 +22262,8 @@ class ArticleEditor extends React__namespace.Component {
22258
22262
  * Renders three buttons: "Phone", "Tablet", and "Desktop".
22259
22263
  */
22260
22264
  const {
22261
- ButtonGroup: ButtonGroup$5,
22262
- InlineIcon: InlineIcon$7
22265
+ ButtonGroup: ButtonGroup$8,
22266
+ InlineIcon: InlineIcon$8
22263
22267
  } = perseus.components;
22264
22268
  const {
22265
22269
  devices
@@ -22270,14 +22274,14 @@ const {
22270
22274
  iconTablet
22271
22275
  } = perseus.icons;
22272
22276
  const ViewportResizer = props => {
22273
- const phoneButtonContents = /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(InlineIcon$7, iconMobilePhone), " Phone");
22274
- const tabletButtonContents = /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(InlineIcon$7, iconTablet), " Tablet");
22275
- const desktopButtonContents = /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(InlineIcon$7, iconDesktop), " Desktop");
22277
+ const phoneButtonContents = /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(InlineIcon$8, iconMobilePhone), " Phone");
22278
+ const tabletButtonContents = /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(InlineIcon$8, iconTablet), " Tablet");
22279
+ const desktopButtonContents = /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(InlineIcon$8, iconDesktop), " Desktop");
22276
22280
 
22277
22281
  // TODO(david): Allow input of custom viewport sizes.
22278
22282
  return /*#__PURE__*/React__namespace.createElement("span", {
22279
22283
  className: "viewport-resizer"
22280
- }, "Viewport:", " ", /*#__PURE__*/React__namespace.createElement(ButtonGroup$5, {
22284
+ }, "Viewport:", " ", /*#__PURE__*/React__namespace.createElement(ButtonGroup$8, {
22281
22285
  value: props.deviceType,
22282
22286
  allowEmpty: false,
22283
22287
  buttons: [{
@@ -23606,7 +23610,7 @@ class StructuredItemDiff extends React__namespace.Component {
23606
23610
  /* eslint-disable @khanacademy/ts-no-error-suppressions */
23607
23611
  const {
23608
23612
  InfoTip: InfoTip$m,
23609
- InlineIcon: InlineIcon$6
23613
+ InlineIcon: InlineIcon$7
23610
23614
  } = perseus.components;
23611
23615
  const {
23612
23616
  iconCircleArrowDown,
@@ -23675,11 +23679,11 @@ class HintEditor extends React__namespace.Component {
23675
23679
  type: "button",
23676
23680
  className: this.props.isLast ? "hidden" : "",
23677
23681
  onClick: ___default["default"].partial(this.props.onMove, 1)
23678
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconCircleArrowDown)), " ", /*#__PURE__*/React__namespace.createElement("button", {
23682
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$7, iconCircleArrowDown)), " ", /*#__PURE__*/React__namespace.createElement("button", {
23679
23683
  type: "button",
23680
23684
  className: this.props.isFirst ? "hidden" : "",
23681
23685
  onClick: ___default["default"].partial(this.props.onMove, -1)
23682
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconCircleArrowUp)), " ", this.props.isLast && /*#__PURE__*/React__namespace.createElement(InfoTip$m, null, /*#__PURE__*/React__namespace.createElement("p", null, "The last hint is automatically bolded."))), /*#__PURE__*/React__namespace.createElement("input", {
23686
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$7, iconCircleArrowUp)), " ", this.props.isLast && /*#__PURE__*/React__namespace.createElement(InfoTip$m, null, /*#__PURE__*/React__namespace.createElement("p", null, "The last hint is automatically bolded."))), /*#__PURE__*/React__namespace.createElement("input", {
23683
23687
  type: "checkbox"
23684
23688
  // @ts-expect-error - TS2322 - Type 'boolean | null | undefined' is not assignable to type 'boolean | undefined'.
23685
23689
  ,
@@ -23689,7 +23693,7 @@ class HintEditor extends React__namespace.Component {
23689
23693
  type: "button",
23690
23694
  className: "remove-hint simple-button orange",
23691
23695
  onClick: this.props.onRemove
23692
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconTrash$5), "Remove this hint", " ")));
23696
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$7, iconTrash$5), "Remove this hint", " ")));
23693
23697
  }
23694
23698
  }
23695
23699
  /* A single hint-row containing a hint editor and preview */
@@ -23901,7 +23905,7 @@ class CombinedHintsEditor extends React__namespace.Component {
23901
23905
  type: "button",
23902
23906
  className: "add-hint simple-button orange",
23903
23907
  onClick: this.addHint
23904
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconPlus$3), " Add a hint"))));
23908
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$7, iconPlus$3), " Add a hint"))));
23905
23909
  /* eslint-enable max-len */
23906
23910
  }
23907
23911
  }
@@ -24045,7 +24049,7 @@ class ItemExtrasEditor extends React__namespace.Component {
24045
24049
  }
24046
24050
  }
24047
24051
  const ItemExtraCheckbox = props => /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
24048
- style: [styles$P.checkbox, props.indent ? styles$P.indented : undefined]
24052
+ style: [styles$Q.checkbox, props.indent ? styles$Q.indented : undefined]
24049
24053
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
24050
24054
  label: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
24051
24055
  style: {
@@ -24055,7 +24059,7 @@ const ItemExtraCheckbox = props => /*#__PURE__*/React__namespace.createElement(w
24055
24059
  checked: props.checked,
24056
24060
  onChange: newCheckedState => props.onChange(newCheckedState)
24057
24061
  }));
24058
- const styles$P = aphrodite.StyleSheet.create({
24062
+ const styles$Q = aphrodite.StyleSheet.create({
24059
24063
  indented: {
24060
24064
  marginInlineStart: wonderBlocksTokens.spacing.large_24
24061
24065
  }
@@ -24718,12 +24722,12 @@ class SimpleButton extends React__namespace.Component {
24718
24722
  ...otherProps
24719
24723
  } = this.props;
24720
24724
  return /*#__PURE__*/React__namespace.createElement("div", _extends({
24721
- className: aphrodite.css(styles$O.baseButton, color === "green" && styles$O.green, color === "orange" && styles$O.orange),
24725
+ className: aphrodite.css(styles$P.baseButton, color === "green" && styles$P.green, color === "orange" && styles$P.orange),
24722
24726
  onClick: onClick
24723
24727
  }, otherProps), children);
24724
24728
  }
24725
24729
  }
24726
- const styles$O = aphrodite.StyleSheet.create({
24730
+ const styles$P = aphrodite.StyleSheet.create({
24727
24731
  baseButton: {
24728
24732
  top: "0",
24729
24733
  fontSize: "11px",
@@ -24768,7 +24772,7 @@ const styles$O = aphrodite.StyleSheet.create({
24768
24772
  });
24769
24773
 
24770
24774
  const {
24771
- InlineIcon: InlineIcon$5
24775
+ InlineIcon: InlineIcon$6
24772
24776
  } = perseus.components;
24773
24777
  const {
24774
24778
  iconChevronDown,
@@ -24936,23 +24940,23 @@ const LeafContainer = _ref2 => {
24936
24940
  } = _ref2;
24937
24941
  const hasPreviewHeading = shape.type === "content" || shape.type === "hint";
24938
24942
  const previewHeading = hasPreviewHeading && /*#__PURE__*/React__namespace.createElement("div", {
24939
- className: aphrodite.css(styles$N.containerHeader)
24943
+ className: aphrodite.css(styles$O.containerHeader)
24940
24944
  }, /*#__PURE__*/React__namespace.createElement(Header, {
24941
24945
  depth: path.length,
24942
- className: aphrodite.css(styles$N.containerTitle)
24946
+ className: aphrodite.css(styles$O.containerTitle)
24943
24947
  }, capitalize(name)));
24944
24948
  return /*#__PURE__*/React__namespace.createElement("div", {
24945
- className: aphrodite.css(styles$N.container)
24949
+ className: aphrodite.css(styles$O.container)
24946
24950
  }, /*#__PURE__*/React__namespace.createElement("span", {
24947
- className: aphrodite.css(styles$N.row, styles$N.rowHeading)
24951
+ className: aphrodite.css(styles$O.row, styles$O.rowHeading)
24948
24952
  }, /*#__PURE__*/React__namespace.createElement("div", {
24949
- className: aphrodite.css(styles$N.columnLeft)
24953
+ className: aphrodite.css(styles$O.columnLeft)
24950
24954
  }, /*#__PURE__*/React__namespace.createElement("div", {
24951
- className: "pod-title " + aphrodite.css(styles$N.containerHeader)
24955
+ className: "pod-title " + aphrodite.css(styles$O.containerHeader)
24952
24956
  }, /*#__PURE__*/React__namespace.createElement("div", {
24953
- className: aphrodite.css(styles$N.containerTitle)
24957
+ className: aphrodite.css(styles$O.containerTitle)
24954
24958
  }, capitalize(name)), controls)), /*#__PURE__*/React__namespace.createElement("div", {
24955
- className: aphrodite.css(styles$N.columnRight)
24959
+ className: aphrodite.css(styles$O.columnRight)
24956
24960
  }, previewHeading)), children);
24957
24961
  };
24958
24962
  const ArrayContainer = props => {
@@ -24965,11 +24969,11 @@ const ArrayContainer = props => {
24965
24969
  actions
24966
24970
  } = props;
24967
24971
  return /*#__PURE__*/React__namespace.createElement("div", {
24968
- className: aphrodite.css(styles$N.container)
24972
+ className: aphrodite.css(styles$O.container)
24969
24973
  }, controls && /*#__PURE__*/React__namespace.createElement("div", {
24970
- className: aphrodite.css(styles$N.columnLeft, styles$N.containerHeader)
24974
+ className: aphrodite.css(styles$O.columnLeft, styles$O.containerHeader)
24971
24975
  }, controls), /*#__PURE__*/React__namespace.createElement("div", null, children), /*#__PURE__*/React__namespace.createElement("div", {
24972
- className: aphrodite.css(styles$N.columnLeft)
24976
+ className: aphrodite.css(styles$O.columnLeft)
24973
24977
  }, /*#__PURE__*/React__namespace.createElement("a", {
24974
24978
  href: "javascript:void 0",
24975
24979
  onClick: () => actions.addArrayElement(path, shape.elementShape)
@@ -24983,28 +24987,28 @@ const ObjectContainer = _ref3 => {
24983
24987
  path
24984
24988
  } = _ref3;
24985
24989
  const headingEditor = /*#__PURE__*/React__namespace.createElement("div", {
24986
- className: aphrodite.css(styles$N.containerHeader)
24990
+ className: aphrodite.css(styles$O.containerHeader)
24987
24991
  }, /*#__PURE__*/React__namespace.createElement(Header, {
24988
24992
  depth: path.length,
24989
- className: aphrodite.css(styles$N.containerTitle)
24993
+ className: aphrodite.css(styles$O.containerTitle)
24990
24994
  }, capitalize(name)), controls);
24991
24995
  const headingPreview = (name || controls) && /*#__PURE__*/React__namespace.createElement("div", {
24992
- className: aphrodite.css(styles$N.containerHeader, styles$N.previewCollectionHeader)
24996
+ className: aphrodite.css(styles$O.containerHeader, styles$O.previewCollectionHeader)
24993
24997
  }, /*#__PURE__*/React__namespace.createElement(Header, {
24994
24998
  depth: path.length,
24995
- className: aphrodite.css(styles$N.containerTitle)
24999
+ className: aphrodite.css(styles$O.containerTitle)
24996
25000
  }, capitalize(name)));
24997
25001
  const hasBothHeadings = headingEditor && headingPreview;
24998
25002
  return /*#__PURE__*/React__namespace.createElement("div", {
24999
- className: aphrodite.css(styles$N.container)
25003
+ className: aphrodite.css(styles$O.container)
25000
25004
  }, hasBothHeadings && /*#__PURE__*/React__namespace.createElement("span", {
25001
- className: aphrodite.css(styles$N.row)
25005
+ className: aphrodite.css(styles$O.row)
25002
25006
  }, /*#__PURE__*/React__namespace.createElement("div", {
25003
- className: aphrodite.css(styles$N.columnLeft)
25007
+ className: aphrodite.css(styles$O.columnLeft)
25004
25008
  }, headingEditor), /*#__PURE__*/React__namespace.createElement("div", {
25005
- className: aphrodite.css(styles$N.columnRight)
25009
+ className: aphrodite.css(styles$O.columnRight)
25006
25010
  }, headingPreview)), /*#__PURE__*/React__namespace.createElement("div", {
25007
- className: aphrodite.css(path.length > 0 && styles$N.contentIndent)
25011
+ className: aphrodite.css(path.length > 0 && styles$O.contentIndent)
25008
25012
  }, children));
25009
25013
  };
25010
25014
 
@@ -25124,11 +25128,11 @@ const ItemNodeContent = withStickiness(props => {
25124
25128
  className: "framework-perseus"
25125
25129
  }, lens(renderers).get(path));
25126
25130
  return /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement("div", {
25127
- className: aphrodite.css(styles$N.row)
25131
+ className: aphrodite.css(styles$O.row)
25128
25132
  }, /*#__PURE__*/React__namespace.createElement("div", {
25129
- className: aphrodite.css(styles$N.columnLeft)
25133
+ className: aphrodite.css(styles$O.columnLeft)
25130
25134
  }, /*#__PURE__*/React__namespace.createElement("div", {
25131
- className: aphrodite.css(sticky && styles$N.sticky)
25135
+ className: aphrodite.css(sticky && styles$O.sticky)
25132
25136
  },
25133
25137
  /*#__PURE__*/
25134
25138
  // @ts-expect-error - TS2769 - No overload matches this call.
@@ -25136,9 +25140,9 @@ const ItemNodeContent = withStickiness(props => {
25136
25140
  onChange: newVal => actions.mergeValueAtPath(path, newVal),
25137
25141
  apiOptions: apiOptions
25138
25142
  })))), /*#__PURE__*/React__namespace.createElement("div", {
25139
- className: aphrodite.css(styles$N.columnRight)
25143
+ className: aphrodite.css(styles$O.columnRight)
25140
25144
  }, /*#__PURE__*/React__namespace.createElement("div", {
25141
- className: aphrodite.css(sticky && styles$N.sticky)
25145
+ className: aphrodite.css(sticky && styles$O.sticky)
25142
25146
  }, preview))));
25143
25147
  });
25144
25148
  const HintNodeContent = withStickiness(props => {
@@ -25154,13 +25158,13 @@ const HintNodeContent = withStickiness(props => {
25154
25158
  className: "framework-perseus"
25155
25159
  }, lens(renderers).get(path));
25156
25160
  return /*#__PURE__*/React__namespace.createElement("div", {
25157
- className: aphrodite.css(styles$N.row)
25161
+ className: aphrodite.css(styles$O.row)
25158
25162
  }, /*#__PURE__*/React__namespace.createElement("div", {
25159
- className: aphrodite.css(styles$N.columnLeft)
25163
+ className: aphrodite.css(styles$O.columnLeft)
25160
25164
  }, /*#__PURE__*/React__namespace.createElement("div", {
25161
- className: aphrodite.css(sticky && styles$N.sticky)
25165
+ className: aphrodite.css(sticky && styles$O.sticky)
25162
25166
  }, /*#__PURE__*/React__namespace.createElement(HintEditor, _extends({}, data, {
25163
- className: aphrodite.css(styles$N.hintEditor),
25167
+ className: aphrodite.css(styles$O.hintEditor),
25164
25168
  onChange: newVal => actions.mergeValueAtPath(path, newVal),
25165
25169
  apiOptions: apiOptions,
25166
25170
  showTitle: false,
@@ -25175,9 +25179,9 @@ const HintNodeContent = withStickiness(props => {
25175
25179
  isFirst: true,
25176
25180
  isLast: true
25177
25181
  })))), /*#__PURE__*/React__namespace.createElement("div", {
25178
- className: aphrodite.css(styles$N.columnRight)
25182
+ className: aphrodite.css(styles$O.columnRight)
25179
25183
  }, /*#__PURE__*/React__namespace.createElement("div", {
25180
- className: aphrodite.css(sticky && styles$N.sticky)
25184
+ className: aphrodite.css(sticky && styles$O.sticky)
25181
25185
  }, preview)));
25182
25186
  });
25183
25187
  const TagsNodeContent = props => {
@@ -25194,9 +25198,9 @@ const TagsNodeContent = props => {
25194
25198
  return null;
25195
25199
  }
25196
25200
  return /*#__PURE__*/React__namespace.createElement("div", {
25197
- className: aphrodite.css(styles$N.columnLeft)
25201
+ className: aphrodite.css(styles$O.columnLeft)
25198
25202
  }, /*#__PURE__*/React__namespace.createElement("div", {
25199
- className: aphrodite.css(styles$N.tagsEditor)
25203
+ className: aphrodite.css(styles$O.tagsEditor)
25200
25204
  }, /*#__PURE__*/React__namespace.createElement(GroupMetadataEditor, {
25201
25205
  value: data,
25202
25206
  onChange: newVal => actions.setValueAtPath(path, newVal),
@@ -25227,31 +25231,31 @@ const ArrayNodeContent = props => {
25227
25231
  const subpath = path.concat(i);
25228
25232
  const controls = [i > 0 && /*#__PURE__*/React__namespace.createElement("div", {
25229
25233
  key: "moveArrayElementUp",
25230
- className: aphrodite.css(styles$N.control)
25234
+ className: aphrodite.css(styles$O.control)
25231
25235
  }, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
25232
25236
  color: "orange",
25233
25237
  title: "Move up",
25234
25238
  onClick: () => actions.moveArrayElementUp(subpath)
25235
25239
  }, /*#__PURE__*/React__namespace.createElement("div", {
25236
- className: aphrodite.css(styles$N.verticalFlip)
25237
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$5, iconChevronDown)))), i < data.length - 1 && /*#__PURE__*/React__namespace.createElement("div", {
25240
+ className: aphrodite.css(styles$O.verticalFlip)
25241
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconChevronDown)))), i < data.length - 1 && /*#__PURE__*/React__namespace.createElement("div", {
25238
25242
  key: "moveArrayElementDown",
25239
- className: aphrodite.css(styles$N.control)
25243
+ className: aphrodite.css(styles$O.control)
25240
25244
  }, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
25241
25245
  color: "orange",
25242
25246
  title: "Move down",
25243
25247
  onClick: () => actions.moveArrayElementDown(subpath)
25244
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$5, iconChevronDown))), /*#__PURE__*/React__namespace.createElement("div", {
25248
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconChevronDown))), /*#__PURE__*/React__namespace.createElement("div", {
25245
25249
  key: "removeArrayElement",
25246
- className: aphrodite.css(styles$N.control)
25250
+ className: aphrodite.css(styles$O.control)
25247
25251
  }, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
25248
25252
  color: "orange",
25249
25253
  title: "Delete",
25250
25254
  onClick: () => actions.removeArrayElement(subpath)
25251
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$5, iconTrash$4)))];
25255
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconTrash$4)))];
25252
25256
  return /*#__PURE__*/React__namespace.createElement("div", {
25253
25257
  key: i,
25254
- className: aphrodite.css(styles$N.arrayElement, !elementIsLeaf && styles$N.arrayElementAndNotLeaf)
25258
+ className: aphrodite.css(styles$O.arrayElement, !elementIsLeaf && styles$O.arrayElementAndNotLeaf)
25255
25259
  }, /*#__PURE__*/React__namespace.createElement(NodeContainer, _extends({}, otherProps, {
25256
25260
  key: i,
25257
25261
  shape: shape.elementShape,
@@ -25277,7 +25281,7 @@ const ObjectNodeContent = props => {
25277
25281
  // made sense to the shape's author is the order in which we'll iterate :)
25278
25282
  const children = Object.keys(shape.shape).map(subkey => /*#__PURE__*/React__namespace.createElement("div", {
25279
25283
  key: subkey,
25280
- className: aphrodite.css(styles$N.objectElement)
25284
+ className: aphrodite.css(styles$O.objectElement)
25281
25285
  }, /*#__PURE__*/React__namespace.createElement(NodeContainer, _extends({}, otherProps, {
25282
25286
  shape: shape.shape[subkey],
25283
25287
  data: data[subkey],
@@ -25447,7 +25451,7 @@ class MultiRendererEditor extends React__namespace.Component {
25447
25451
  }, this._renderContent());
25448
25452
  }
25449
25453
  }
25450
- const styles$N = aphrodite.StyleSheet.create({
25454
+ const styles$O = aphrodite.StyleSheet.create({
25451
25455
  // This is used in a number of places throughout this file.
25452
25456
  container: {},
25453
25457
  // eslint-disable-next-line react-native/no-unused-styles
@@ -26027,7 +26031,7 @@ class DeprecatedStandinEditor extends React__namespace.Component {
26027
26031
  /* eslint-disable @khanacademy/ts-no-error-suppressions */
26028
26032
  const {
26029
26033
  InfoTip: InfoTip$j,
26030
- InlineIcon: InlineIcon$4
26034
+ InlineIcon: InlineIcon$5
26031
26035
  } = perseus.components;
26032
26036
  const {
26033
26037
  iconPlus: iconPlus$2,
@@ -26159,14 +26163,14 @@ class DropdownEditor extends React__namespace.Component {
26159
26163
  this, i)
26160
26164
  }, /*#__PURE__*/React__namespace.createElement("span", {
26161
26165
  className: "remove-choice"
26162
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$4, iconTrash$3)))));
26166
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$5, iconTrash$3)))));
26163
26167
  }, this)), /*#__PURE__*/React__namespace.createElement("div", {
26164
26168
  className: "add-choice-container"
26165
26169
  }, /*#__PURE__*/React__namespace.createElement("a", {
26166
26170
  href: "#",
26167
26171
  className: "simple-button orange",
26168
26172
  onClick: this.addChoice
26169
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$4, iconPlus$2), " Add a choice", " ")));
26173
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$5, iconPlus$2), " Add a choice", " ")));
26170
26174
  }
26171
26175
  }
26172
26176
 
@@ -26417,7 +26421,7 @@ const SortableItem = createReactClass__default["default"]({
26417
26421
  }
26418
26422
  return /*#__PURE__*/React__namespace.createElement("li", {
26419
26423
  draggable: this.props.draggable,
26420
- className: [dragState, aphrodite.css(styles$M.sortableListItem)].join(" "),
26424
+ className: [dragState, aphrodite.css(styles$N.sortableListItem)].join(" "),
26421
26425
  onDragStart: this.handleDragStart,
26422
26426
  onDrop: this.handleDrop,
26423
26427
  onDragEnter: this.handleDragEnter,
@@ -26425,7 +26429,7 @@ const SortableItem = createReactClass__default["default"]({
26425
26429
  }, this.props.component);
26426
26430
  }
26427
26431
  });
26428
- const styles$M = aphrodite.StyleSheet.create({
26432
+ const styles$N = aphrodite.StyleSheet.create({
26429
26433
  sortableListItem: {
26430
26434
  margin: "5px 0"
26431
26435
  }
@@ -26685,13 +26689,13 @@ class ExpressionEditor extends React__namespace.Component {
26685
26689
  onChange: this.handleToggleDiv
26686
26690
  }));
26687
26691
  return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.HeadingSmall, null, "Global Options"), /*#__PURE__*/React__namespace.createElement("div", {
26688
- className: aphrodite.css(styles$L.paddedY)
26692
+ className: aphrodite.css(styles$M.paddedY)
26689
26693
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.LabeledTextField, {
26690
26694
  label: "Visible label",
26691
26695
  value: this.props.visibleLabel || "",
26692
26696
  onChange: this.change("visibleLabel")
26693
26697
  }), /*#__PURE__*/React__namespace.createElement(InfoTip$i, null, /*#__PURE__*/React__namespace.createElement("p", null, "Optional visible text; strongly encouraged to help learners using dictation software, but can be omitted if the surrounding content provides enough context."))), /*#__PURE__*/React__namespace.createElement("div", {
26694
- className: aphrodite.css(styles$L.paddedY)
26698
+ className: aphrodite.css(styles$M.paddedY)
26695
26699
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.LabeledTextField, {
26696
26700
  label: "Aria label",
26697
26701
  value: this.props.ariaLabel || "",
@@ -26700,13 +26704,13 @@ class ExpressionEditor extends React__namespace.Component {
26700
26704
  href: "https://www.w3.org/WAI/tips/designing/#ensure-that-form-elements-include-clearly-associated-labels",
26701
26705
  target: "_blank"
26702
26706
  }, "this article.")))), /*#__PURE__*/React__namespace.createElement("div", {
26703
- className: aphrodite.css(styles$L.paddedY)
26707
+ className: aphrodite.css(styles$M.paddedY)
26704
26708
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.LabeledTextField, {
26705
26709
  label: "Function variables",
26706
26710
  value: this.state.functionsInternal,
26707
26711
  onChange: this.handleFunctions
26708
26712
  }), /*#__PURE__*/React__namespace.createElement(InfoTip$i, null, /*#__PURE__*/React__namespace.createElement("p", null, "Single-letter variables listed here will be interpreted as functions. This let us know that f(x) means \"f of x\" and not \"f times x\"."))), /*#__PURE__*/React__namespace.createElement("div", {
26709
- className: aphrodite.css(styles$L.paddedY)
26713
+ className: aphrodite.css(styles$M.paddedY)
26710
26714
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
26711
26715
  label: "Use \xD7 instead of \u22C5 for multiplication",
26712
26716
  checked: this.props.times,
@@ -26716,7 +26720,7 @@ class ExpressionEditor extends React__namespace.Component {
26716
26720
  });
26717
26721
  }
26718
26722
  }), /*#__PURE__*/React__namespace.createElement(InfoTip$i, null, /*#__PURE__*/React__namespace.createElement("p", null, "For pre-algebra problems this option displays multiplication as \\times instead of \\cdot in both the rendered output and the acceptable formats examples."))), /*#__PURE__*/React__namespace.createElement("div", {
26719
- className: aphrodite.css(styles$L.paddedY)
26723
+ className: aphrodite.css(styles$M.paddedY)
26720
26724
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.HeadingXSmall, null, "Button Sets"), buttonSetChoices), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.HeadingSmall, null, "Answers"), /*#__PURE__*/React__namespace.createElement("p", {
26721
26725
  style: {
26722
26726
  margin: "4px 0"
@@ -26783,18 +26787,18 @@ class AnswerOption extends React__namespace.Component {
26783
26787
  color: "destructive",
26784
26788
  light: true
26785
26789
  }, "Delete");
26786
- const answerStatusCss = aphrodite.css(styles$L.answerStatus, this.props.considered === "wrong" && styles$L.answerStatusWrong, this.props.considered === "correct" && styles$L.answerStatusCorrect, this.props.considered === "ungraded" && styles$L.answerStatusUngraded);
26790
+ const answerStatusCss = aphrodite.css(styles$M.answerStatus, this.props.considered === "wrong" && styles$M.answerStatusWrong, this.props.considered === "correct" && styles$M.answerStatusCorrect, this.props.considered === "ungraded" && styles$M.answerStatusUngraded);
26787
26791
  return /*#__PURE__*/React__namespace.createElement("div", {
26788
- className: aphrodite.css(styles$L.answerOption)
26792
+ className: aphrodite.css(styles$M.answerOption)
26789
26793
  }, /*#__PURE__*/React__namespace.createElement("div", {
26790
- className: aphrodite.css(styles$L.answerHandle)
26794
+ className: aphrodite.css(styles$M.answerHandle)
26791
26795
  }), /*#__PURE__*/React__namespace.createElement("div", {
26792
- className: aphrodite.css(styles$L.answerBody)
26796
+ className: aphrodite.css(styles$M.answerBody)
26793
26797
  }, /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("button", {
26794
26798
  onClick: this.toggleConsidered,
26795
26799
  className: answerStatusCss
26796
26800
  }, this.props.considered), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement(perseus.Expression, this.props.expressionProps))), /*#__PURE__*/React__namespace.createElement("div", {
26797
- className: aphrodite.css(styles$L.paddedY, styles$L.paddedX)
26801
+ className: aphrodite.css(styles$M.paddedY, styles$M.paddedX)
26798
26802
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
26799
26803
  label: "Answer expression must have the same form.",
26800
26804
  checked: this.props.form,
@@ -26804,7 +26808,7 @@ class AnswerOption extends React__namespace.Component {
26804
26808
  });
26805
26809
  }
26806
26810
  }), /*#__PURE__*/React__namespace.createElement(InfoTip$i, null, /*#__PURE__*/React__namespace.createElement("p", null, "The student's answer must be in the same form. Commutativity and excess negative signs are ignored."))), /*#__PURE__*/React__namespace.createElement("div", {
26807
- className: aphrodite.css(styles$L.paddedY, styles$L.paddedX)
26811
+ className: aphrodite.css(styles$M.paddedY, styles$M.paddedX)
26808
26812
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
26809
26813
  label: "Answer expression must be fully expanded and simplified.",
26810
26814
  checked: this.props.simplify,
@@ -26814,11 +26818,11 @@ class AnswerOption extends React__namespace.Component {
26814
26818
  });
26815
26819
  }
26816
26820
  }), /*#__PURE__*/React__namespace.createElement(InfoTip$i, null, /*#__PURE__*/React__namespace.createElement("p", null, "The student's answer must be fully expanded and simplified. Answering this equation (x^2+2x+1) with this factored equation (x+1)^2 will render this response \"Your answer is not fully expanded and simplified.\""))), /*#__PURE__*/React__namespace.createElement("div", {
26817
- className: aphrodite.css(styles$L.buttonRow, styles$L.paddedY)
26821
+ className: aphrodite.css(styles$M.buttonRow, styles$M.paddedY)
26818
26822
  }, removeButton)));
26819
26823
  }
26820
26824
  }
26821
- const styles$L = aphrodite.StyleSheet.create({
26825
+ const styles$M = aphrodite.StyleSheet.create({
26822
26826
  paddedX: {
26823
26827
  paddingLeft: wonderBlocksTokens.spacing.xSmall_8,
26824
26828
  paddingRight: wonderBlocksTokens.spacing.xSmall_8
@@ -26864,7 +26868,7 @@ const styles$L = aphrodite.StyleSheet.create({
26864
26868
 
26865
26869
  /* eslint-disable @khanacademy/ts-no-error-suppressions */
26866
26870
  const {
26867
- InlineIcon: InlineIcon$3,
26871
+ InlineIcon: InlineIcon$4,
26868
26872
  TextInput: TextInput$5
26869
26873
  } = perseus.components;
26870
26874
  const {
@@ -26930,10 +26934,10 @@ class GradedGroupEditor extends React__namespace.Component {
26930
26934
  }, /*#__PURE__*/React__namespace.createElement("div", {
26931
26935
  className: "perseus-widget-row"
26932
26936
  }, /*#__PURE__*/React__namespace.createElement("label", {
26933
- className: aphrodite.css(styles$K.title)
26937
+ className: aphrodite.css(styles$L.title)
26934
26938
  }, "Title:", " ", /*#__PURE__*/React__namespace.createElement(TextInput$5, {
26935
26939
  value: this.props.title,
26936
- className: aphrodite.css(styles$K.input)
26940
+ className: aphrodite.css(styles$L.input)
26937
26941
  // @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
26938
26942
  ,
26939
26943
  onChange: this.change("title")
@@ -26955,10 +26959,10 @@ class GradedGroupEditor extends React__namespace.Component {
26955
26959
  },
26956
26960
  className: "add-hint simple-button orange",
26957
26961
  onClick: this.handleAddHint
26958
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$3, iconPlus$1), " Add a hint"), this.props.hint && /*#__PURE__*/React__namespace.createElement("div", {
26962
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$4, iconPlus$1), " Add a hint"), this.props.hint && /*#__PURE__*/React__namespace.createElement("div", {
26959
26963
  className: "perseus-hint-editor"
26960
26964
  }, /*#__PURE__*/React__namespace.createElement("div", {
26961
- className: aphrodite.css(styles$K.hintsTitle)
26965
+ className: aphrodite.css(styles$L.hintsTitle)
26962
26966
  }, "Hint"), /*#__PURE__*/React__namespace.createElement(Editor, {
26963
26967
  ref: this.hintEditor,
26964
26968
  content: this.props.hint ? this.props.hint.content : "",
@@ -26977,10 +26981,10 @@ class GradedGroupEditor extends React__namespace.Component {
26977
26981
  type: "button",
26978
26982
  className: "remove-hint simple-button orange",
26979
26983
  onClick: this.handleRemoveHint
26980
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$3, iconTrash$2), " Remove this hint")));
26984
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$4, iconTrash$2), " Remove this hint")));
26981
26985
  }
26982
26986
  }
26983
- const styles$K = aphrodite.StyleSheet.create({
26987
+ const styles$L = aphrodite.StyleSheet.create({
26984
26988
  title: {
26985
26989
  fontSize: 18,
26986
26990
  fontWeight: "bold"
@@ -27066,7 +27070,7 @@ const setArrayItem = (list, i, value) => [...list.slice(0, i), value, ...list.sl
27066
27070
 
27067
27071
  /* eslint-disable react/forbid-prop-types, react/no-unsafe */
27068
27072
  const {
27069
- ButtonGroup: ButtonGroup$4,
27073
+ ButtonGroup: ButtonGroup$7,
27070
27074
  InfoTip: InfoTip$h,
27071
27075
  RangeInput: RangeInput$6
27072
27076
  } = perseus.components;
@@ -27486,7 +27490,7 @@ const GraphSettings = createReactClass__default["default"]({
27486
27490
  onChange: this.changeSnapStep
27487
27491
  }))), /*#__PURE__*/React__namespace.createElement("div", {
27488
27492
  className: "perseus-widget-row"
27489
- }, /*#__PURE__*/React__namespace.createElement("label", null, "Markings: "), /*#__PURE__*/React__namespace.createElement(ButtonGroup$4, {
27493
+ }, /*#__PURE__*/React__namespace.createElement("label", null, "Markings: "), /*#__PURE__*/React__namespace.createElement(ButtonGroup$7, {
27490
27494
  value: this.props.markings,
27491
27495
  allowEmpty: false,
27492
27496
  buttons: [{
@@ -27932,7 +27936,7 @@ class IframeEditor extends React__namespace.Component {
27932
27936
  /* eslint-disable jsx-a11y/anchor-is-valid */
27933
27937
  const {
27934
27938
  InfoTip: InfoTip$f,
27935
- InlineIcon: InlineIcon$2,
27939
+ InlineIcon: InlineIcon$3,
27936
27940
  RangeInput: RangeInput$5
27937
27941
  } = perseus.components;
27938
27942
  const defaultBoxSize = 400;
@@ -28016,7 +28020,7 @@ class ImageEditor extends React__namespace.Component {
28016
28020
  // eslint-disable-next-line react/jsx-no-bind
28017
28021
  ,
28018
28022
  onClick: this.removeLabel.bind(this, i)
28019
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$2, perseus.icons.iconTrash))));
28023
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$3, perseus.icons.iconTrash))));
28020
28024
  }
28021
28025
  change() {
28022
28026
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
@@ -28320,6 +28324,111 @@ class InputNumberEditor extends React__namespace.Component {
28320
28324
  }
28321
28325
  }
28322
28326
 
28327
+ /* eslint-disable jsx-a11y/anchor-is-valid */
28328
+ const {
28329
+ InlineIcon: InlineIcon$2
28330
+ } = perseus.components;
28331
+ class ElementContainer extends React__namespace.Component {
28332
+ static defaultProps = {
28333
+ initiallyVisible: false,
28334
+ title: "More"
28335
+ };
28336
+ constructor(props) {
28337
+ super(props);
28338
+ this.state = {
28339
+ show: props.initiallyVisible
28340
+ };
28341
+ }
28342
+ toggle = e => {
28343
+ e.preventDefault();
28344
+ this.setState({
28345
+ show: !this.state.show
28346
+ });
28347
+ };
28348
+ render() {
28349
+ return /*#__PURE__*/React__namespace.createElement("div", {
28350
+ className: "perseus-interaction-element"
28351
+ }, /*#__PURE__*/React__namespace.createElement("a", {
28352
+ href: "#",
28353
+ className: "perseus-interaction-element-title " + (this.state.show ? "open" : "closed"),
28354
+ onClick: this.toggle
28355
+ }, this.state.show ? /*#__PURE__*/React__namespace.createElement(InlineIcon$2, perseus.icons.iconChevronDown) : /*#__PURE__*/React__namespace.createElement(InlineIcon$2, perseus.icons.iconChevronRight), this.props.title), /*#__PURE__*/React__namespace.createElement("div", {
28356
+ className: "perseus-interaction-element-content " + (this.state.show ? "enter" : "leave")
28357
+ }, this.props.children, (this.props.onUp != null || this.props.onDown != null || this.props.onDelete != null) && /*#__PURE__*/React__namespace.createElement("div", {
28358
+ className: "edit-controls"
28359
+ }, this.props.onUp != null && /*#__PURE__*/React__namespace.createElement("button", {
28360
+ onClick: this.props.onUp
28361
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$2, perseus.icons.iconCircleArrowUp)), this.props.onDown != null && /*#__PURE__*/React__namespace.createElement("button", {
28362
+ onClick: this.props.onDown
28363
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$2, perseus.icons.iconCircleArrowDown)), this.props.onDelete != null && /*#__PURE__*/React__namespace.createElement("button", {
28364
+ onClick: this.props.onDelete
28365
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$2, perseus.icons.iconTrash)))));
28366
+ }
28367
+ }
28368
+
28369
+ const {
28370
+ ButtonGroup: ButtonGroup$6
28371
+ } = perseus.components;
28372
+ const COLORS = [perseus.KhanColors.BLACK, perseus.KhanColors.BLUE, perseus.KhanColors.GREEN, perseus.KhanColors.PINK, perseus.KhanColors.PURPLE, perseus.KhanColors.RED, perseus.KhanColors.GRAY];
28373
+ const LIGHT_COLORS = [perseus.KhanColors.LIGHT_BLUE, perseus.KhanColors.LIGHT_ORANGE, perseus.KhanColors.LIGHT_PINK, perseus.KhanColors.LIGHT_GREEN, perseus.KhanColors.LIGHT_PURPLE, perseus.KhanColors.LIGHT_RED, "#fff"];
28374
+ class ColorPicker extends React__namespace.Component {
28375
+ static defaultProps = {
28376
+ value: perseus.KhanColors.BLACK,
28377
+ lightColors: false
28378
+ };
28379
+ render() {
28380
+ const colors = this.props.lightColors ? LIGHT_COLORS : COLORS;
28381
+ return /*#__PURE__*/React__namespace.createElement(ButtonGroup$6, {
28382
+ value: this.props.value,
28383
+ allowEmpty: false,
28384
+ buttons: ___default["default"].map(colors, color => {
28385
+ return {
28386
+ value: color,
28387
+ content: /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement("span", {
28388
+ className: "colorpicker-circle",
28389
+ style: {
28390
+ background: color
28391
+ }
28392
+ }), "\xA0")
28393
+ };
28394
+ }),
28395
+ onChange: this.props.onChange
28396
+ });
28397
+ }
28398
+ }
28399
+
28400
+ const {
28401
+ ButtonGroup: ButtonGroup$5
28402
+ } = perseus.components;
28403
+ class DashPicker extends React__namespace.Component {
28404
+ static defaultProps = {
28405
+ value: ""
28406
+ };
28407
+ render() {
28408
+ return /*#__PURE__*/React__namespace.createElement(ButtonGroup$5, {
28409
+ value: this.props.value,
28410
+ allowEmpty: false,
28411
+ buttons: [{
28412
+ value: "",
28413
+ content: /*#__PURE__*/React__namespace.createElement("span", null, "\u2014")
28414
+ }, {
28415
+ value: "-",
28416
+ content: /*#__PURE__*/React__namespace.createElement("span", null, "\u2013\u2013\u2013")
28417
+ }, {
28418
+ value: "- ",
28419
+ content: /*#__PURE__*/React__namespace.createElement("span", null, "\u2013\xA0\xA0\u2013")
28420
+ }, {
28421
+ value: ".",
28422
+ content: /*#__PURE__*/React__namespace.createElement("span", null, "\xB7\xB7\xB7\xB7")
28423
+ }, {
28424
+ value: ". ",
28425
+ content: /*#__PURE__*/React__namespace.createElement("span", null, "\xB7 \xB7 \xB7")
28426
+ }],
28427
+ onChange: this.props.onChange
28428
+ });
28429
+ }
28430
+ }
28431
+
28323
28432
  /**
28324
28433
  * A simple Mathquill MathField input for the InteractionEditor.
28325
28434
  * Unlike our other uses of Mathquill, we're not using a keypad here;
@@ -28366,13 +28475,13 @@ function MathquillInput(props) {
28366
28475
  }
28367
28476
  });
28368
28477
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
28369
- style: styles$J.outerWrapper
28478
+ style: styles$K.outerWrapper
28370
28479
  }, /*#__PURE__*/React__namespace.createElement("span", {
28371
28480
  ref: mathFieldWrapperRef,
28372
28481
  className: "perseus-math-input mq-editable-field mq-math-mode"
28373
28482
  }));
28374
28483
  }
28375
- const styles$J = aphrodite.StyleSheet.create({
28484
+ const styles$K = aphrodite.StyleSheet.create({
28376
28485
  outerWrapper: {
28377
28486
  display: "inline-block",
28378
28487
  borderStyle: "solid",
@@ -28432,12 +28541,12 @@ class FunctionEditor extends React__namespace.Component {
28432
28541
  onChange: this.change("rangeMax")
28433
28542
  }), /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large)")), /*#__PURE__*/React__namespace.createElement("div", {
28434
28543
  className: "perseus-widget-row"
28435
- }, /*#__PURE__*/React__namespace.createElement(perseus.ColorPicker, {
28544
+ }, /*#__PURE__*/React__namespace.createElement(ColorPicker, {
28436
28545
  value: this.props.color,
28437
28546
  onChange: this.change("color")
28438
28547
  })), /*#__PURE__*/React__namespace.createElement("div", {
28439
28548
  className: "perseus-widget-row"
28440
- }, /*#__PURE__*/React__namespace.createElement(perseus.DashPicker, {
28549
+ }, /*#__PURE__*/React__namespace.createElement(DashPicker, {
28441
28550
  value: this.props.strokeDasharray,
28442
28551
  onChange: this.change("strokeDasharray")
28443
28552
  })), /*#__PURE__*/React__namespace.createElement("div", {
@@ -28503,13 +28612,42 @@ class LabelEditor extends React__namespace.Component {
28503
28612
  onChange: this.change("coordY")
28504
28613
  }), /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large)")), /*#__PURE__*/React__namespace.createElement("div", {
28505
28614
  className: "perseus-widget-row"
28506
- }, /*#__PURE__*/React__namespace.createElement(perseus.ColorPicker, {
28615
+ }, /*#__PURE__*/React__namespace.createElement(ColorPicker, {
28507
28616
  value: this.props.color,
28508
28617
  onChange: this.change("color")
28509
28618
  })));
28510
28619
  }
28511
28620
  }
28512
28621
 
28622
+ const {
28623
+ ButtonGroup: ButtonGroup$4
28624
+ } = perseus.components;
28625
+ class ArrowPicker extends React__namespace.Component {
28626
+ static defaultProps = {
28627
+ value: ""
28628
+ };
28629
+ render() {
28630
+ return /*#__PURE__*/React__namespace.createElement(ButtonGroup$4, {
28631
+ value: this.props.value,
28632
+ allowEmpty: false,
28633
+ buttons: [{
28634
+ value: "",
28635
+ content: /*#__PURE__*/React__namespace.createElement("span", null, "\u2014")
28636
+ }, {
28637
+ value: "->",
28638
+ content: /*#__PURE__*/React__namespace.createElement("span", null, "\u2192")
28639
+ }
28640
+ /*
28641
+ TODO(eater): fix khan-exercises so these are supported
28642
+ {value: "<-", content: <span>&#x2190;</span>},
28643
+ {value: "<->", content: <span>&#x2194;</span>}
28644
+ */],
28645
+
28646
+ onChange: this.props.onChange
28647
+ });
28648
+ }
28649
+ }
28650
+
28513
28651
  const {
28514
28652
  NumberInput: NumberInput$c
28515
28653
  } = perseus.components;
@@ -28564,15 +28702,15 @@ class LineEditor extends React__namespace.Component {
28564
28702
  onChange: this.change("endY")
28565
28703
  }), /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large)")), /*#__PURE__*/React__namespace.createElement("div", {
28566
28704
  className: "perseus-widget-row"
28567
- }, /*#__PURE__*/React__namespace.createElement(perseus.ColorPicker, {
28705
+ }, /*#__PURE__*/React__namespace.createElement(ColorPicker, {
28568
28706
  value: this.props.color,
28569
28707
  onChange: this.change("color")
28570
28708
  })), /*#__PURE__*/React__namespace.createElement("div", {
28571
28709
  className: "perseus-widget-row"
28572
- }, /*#__PURE__*/React__namespace.createElement(perseus.DashPicker, {
28710
+ }, /*#__PURE__*/React__namespace.createElement(DashPicker, {
28573
28711
  value: this.props.strokeDasharray,
28574
28712
  onChange: this.change("strokeDasharray")
28575
- }), "\xA0 \xA0", /*#__PURE__*/React__namespace.createElement(perseus.ArrowPicker, {
28713
+ }), "\xA0 \xA0", /*#__PURE__*/React__namespace.createElement(ArrowPicker, {
28576
28714
  value: this.props.arrows,
28577
28715
  onChange: this.change("arrows")
28578
28716
  })), /*#__PURE__*/React__namespace.createElement("div", {
@@ -28858,12 +28996,12 @@ class ParametricEditor extends React__namespace.Component {
28858
28996
  onChange: this.change("rangeMax")
28859
28997
  }), /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large)")), /*#__PURE__*/React__namespace.createElement("div", {
28860
28998
  className: "perseus-widget-row"
28861
- }, /*#__PURE__*/React__namespace.createElement(perseus.ColorPicker, {
28999
+ }, /*#__PURE__*/React__namespace.createElement(ColorPicker, {
28862
29000
  value: this.props.color,
28863
29001
  onChange: this.change("color")
28864
29002
  })), /*#__PURE__*/React__namespace.createElement("div", {
28865
29003
  className: "perseus-widget-row"
28866
- }, /*#__PURE__*/React__namespace.createElement(perseus.DashPicker, {
29004
+ }, /*#__PURE__*/React__namespace.createElement(DashPicker, {
28867
29005
  value: this.props.strokeDasharray,
28868
29006
  onChange: this.change("strokeDasharray")
28869
29007
  })), /*#__PURE__*/React__namespace.createElement("div", {
@@ -28916,7 +29054,7 @@ class PointEditor extends React__namespace.Component {
28916
29054
  onChange: this.change("coordY")
28917
29055
  }), /*#__PURE__*/React__namespace.createElement(TeX, null, "\\Large)")), /*#__PURE__*/React__namespace.createElement("div", {
28918
29056
  className: "perseus-widget-row"
28919
- }, /*#__PURE__*/React__namespace.createElement(perseus.ColorPicker, {
29057
+ }, /*#__PURE__*/React__namespace.createElement(ColorPicker, {
28920
29058
  value: this.props.color,
28921
29059
  onChange: this.change("color")
28922
29060
  })));
@@ -28973,7 +29111,7 @@ class RectangleEditor extends React__namespace.Component {
28973
29111
  onChange: this.change("height")
28974
29112
  })), /*#__PURE__*/React__namespace.createElement("div", {
28975
29113
  className: "perseus-widget-row"
28976
- }, /*#__PURE__*/React__namespace.createElement(perseus.ColorPicker, {
29114
+ }, /*#__PURE__*/React__namespace.createElement(ColorPicker, {
28977
29115
  value: this.props.color,
28978
29116
  lightColors: true,
28979
29117
  onChange: this.change("color")
@@ -29116,7 +29254,7 @@ class InteractionEditor extends React__namespace.Component {
29116
29254
  } = getDependencies();
29117
29255
  return /*#__PURE__*/React__namespace.createElement("div", {
29118
29256
  className: "perseus-widget-interaction-editor"
29119
- }, /*#__PURE__*/React__namespace.createElement(perseus.ElementContainer, {
29257
+ }, /*#__PURE__*/React__namespace.createElement(ElementContainer, {
29120
29258
  title: "Grid settings"
29121
29259
  }, /*#__PURE__*/React__namespace.createElement(GraphSettings, {
29122
29260
  editableSettings: ["canvas", "graph"],
@@ -29129,7 +29267,7 @@ class InteractionEditor extends React__namespace.Component {
29129
29267
  onChange: this._updateGraphProps
29130
29268
  }), /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, this.props.graph.valid !== true && /*#__PURE__*/React__namespace.createElement("div", null, this.props.graph.valid))), ___default["default"].map(this.props.elements, function (element, n) {
29131
29269
  if (element.type === "movable-point") {
29132
- return /*#__PURE__*/React__namespace.createElement(perseus.ElementContainer, {
29270
+ return /*#__PURE__*/React__namespace.createElement(ElementContainer, {
29133
29271
  title: /*#__PURE__*/React__namespace.createElement("span", null, "Movable point", " ", /*#__PURE__*/React__namespace.createElement(TeX, null, "(x_{" + element.options.varSubscript + "}, y_{" + element.options.varSubscript + "})"))
29134
29272
  // eslint-disable-next-line react/jsx-no-bind
29135
29273
  ,
@@ -29164,7 +29302,7 @@ class InteractionEditor extends React__namespace.Component {
29164
29302
  })));
29165
29303
  }
29166
29304
  if (element.type === "movable-line") {
29167
- return /*#__PURE__*/React__namespace.createElement(perseus.ElementContainer, {
29305
+ return /*#__PURE__*/React__namespace.createElement(ElementContainer, {
29168
29306
  title: /*#__PURE__*/React__namespace.createElement("span", null, "Movable line", " ", /*#__PURE__*/React__namespace.createElement(TeX, null, "(x_{" + element.options.startSubscript + "}, y_{" + element.options.startSubscript + "})"), " ", "to", " ", /*#__PURE__*/React__namespace.createElement(TeX, null, "(x_{" + element.options.endSubscript + "}, y_{" + element.options.endSubscript + "})"))
29169
29307
  // eslint-disable-next-line react/jsx-no-bind
29170
29308
  ,
@@ -29199,7 +29337,7 @@ class InteractionEditor extends React__namespace.Component {
29199
29337
  })));
29200
29338
  }
29201
29339
  if (element.type === "point") {
29202
- return /*#__PURE__*/React__namespace.createElement(perseus.ElementContainer, {
29340
+ return /*#__PURE__*/React__namespace.createElement(ElementContainer, {
29203
29341
  title: /*#__PURE__*/React__namespace.createElement("span", null, "Point", " ", /*#__PURE__*/React__namespace.createElement(TeX, null, "(" + element.options.coordX + ", " + element.options.coordY + ")"))
29204
29342
  // eslint-disable-next-line react/jsx-no-bind
29205
29343
  ,
@@ -29234,7 +29372,7 @@ class InteractionEditor extends React__namespace.Component {
29234
29372
  })));
29235
29373
  }
29236
29374
  if (element.type === "line") {
29237
- return /*#__PURE__*/React__namespace.createElement(perseus.ElementContainer, {
29375
+ return /*#__PURE__*/React__namespace.createElement(ElementContainer, {
29238
29376
  title: /*#__PURE__*/React__namespace.createElement("span", null, "Line", " ", /*#__PURE__*/React__namespace.createElement(TeX, null, "(" + element.options.startX + ", " + element.options.startY + ")"), " ", "to", " ", /*#__PURE__*/React__namespace.createElement(TeX, null, "(" + element.options.endX + ", " + element.options.endY + ")"))
29239
29377
  // eslint-disable-next-line react/jsx-no-bind
29240
29378
  ,
@@ -29269,7 +29407,7 @@ class InteractionEditor extends React__namespace.Component {
29269
29407
  })));
29270
29408
  }
29271
29409
  if (element.type === "function") {
29272
- return /*#__PURE__*/React__namespace.createElement(perseus.ElementContainer, {
29410
+ return /*#__PURE__*/React__namespace.createElement(ElementContainer, {
29273
29411
  title: /*#__PURE__*/React__namespace.createElement("span", null, "Function", " ", /*#__PURE__*/React__namespace.createElement(TeX, null, element.options.funcName + "(x) = " + element.options.value))
29274
29412
  // eslint-disable-next-line react/jsx-no-bind
29275
29413
  ,
@@ -29303,7 +29441,7 @@ class InteractionEditor extends React__namespace.Component {
29303
29441
  })));
29304
29442
  }
29305
29443
  if (element.type === "parametric") {
29306
- return /*#__PURE__*/React__namespace.createElement(perseus.ElementContainer, {
29444
+ return /*#__PURE__*/React__namespace.createElement(ElementContainer, {
29307
29445
  title: /*#__PURE__*/React__namespace.createElement("span", null, "Parametric")
29308
29446
  // eslint-disable-next-line react/jsx-no-bind
29309
29447
  ,
@@ -29337,7 +29475,7 @@ class InteractionEditor extends React__namespace.Component {
29337
29475
  })));
29338
29476
  }
29339
29477
  if (element.type === "label") {
29340
- return /*#__PURE__*/React__namespace.createElement(perseus.ElementContainer, {
29478
+ return /*#__PURE__*/React__namespace.createElement(ElementContainer, {
29341
29479
  title: /*#__PURE__*/React__namespace.createElement("span", null, "Label", " ", /*#__PURE__*/React__namespace.createElement(TeX, null, unescapeMathMode(element.options.label)), " ")
29342
29480
  // eslint-disable-next-line react/jsx-no-bind
29343
29481
  ,
@@ -29371,7 +29509,7 @@ class InteractionEditor extends React__namespace.Component {
29371
29509
  })));
29372
29510
  }
29373
29511
  if (element.type === "rectangle") {
29374
- return /*#__PURE__*/React__namespace.createElement(perseus.ElementContainer, {
29512
+ return /*#__PURE__*/React__namespace.createElement(ElementContainer, {
29375
29513
  title: /*#__PURE__*/React__namespace.createElement("span", null, "Rectangle", " ", /*#__PURE__*/React__namespace.createElement(TeX, null, "(" + element.options.coordX + ", " + element.options.coordY + ")"), "\xA0\u2014\xA0", /*#__PURE__*/React__namespace.createElement(TeX, null, element.options.width + " \\times " + element.options.height))
29376
29514
  // eslint-disable-next-line react/jsx-no-bind
29377
29515
  ,
@@ -29433,6 +29571,20 @@ class InteractionEditor extends React__namespace.Component {
29433
29571
  }
29434
29572
  }
29435
29573
 
29574
+ var isProduction = process.env.NODE_ENV === 'production';
29575
+ var prefix = 'Invariant failed';
29576
+ function invariant(condition, message) {
29577
+ if (condition) {
29578
+ return;
29579
+ }
29580
+ if (isProduction) {
29581
+ throw new Error(prefix);
29582
+ }
29583
+ var provided = typeof message === 'function' ? message() : message;
29584
+ var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix;
29585
+ throw new Error(value);
29586
+ }
29587
+
29436
29588
  // Renders the given children in a View laid out horizontally.
29437
29589
  const LabeledRow = props => {
29438
29590
  const {
@@ -29442,16 +29594,16 @@ const LabeledRow = props => {
29442
29594
  style
29443
29595
  } = props;
29444
29596
  return /*#__PURE__*/React__namespace.createElement("label", {
29445
- className: aphrodite.css(styles$I.label)
29597
+ className: aphrodite.css(styles$J.label)
29446
29598
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
29447
- style: [styles$I.row, style]
29599
+ style: [styles$J.row, style]
29448
29600
  }, labelSide === "start" || /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelSmall, {
29449
- style: styles$I.spaceEnd
29601
+ style: styles$J.spaceEnd
29450
29602
  }, label), children, labelSide === "end" && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelSmall, {
29451
- style: styles$I.spaceStart
29603
+ style: styles$J.spaceStart
29452
29604
  }, label)));
29453
29605
  };
29454
- const styles$I = aphrodite.StyleSheet.create({
29606
+ const styles$J = aphrodite.StyleSheet.create({
29455
29607
  label: {
29456
29608
  width: "fit-content"
29457
29609
  },
@@ -29477,11 +29629,11 @@ function Heading(_ref) {
29477
29629
  onToggle
29478
29630
  } = _ref;
29479
29631
  return /*#__PURE__*/React__namespace.createElement(Clickable__default["default"], {
29480
- style: [styles$H.container, !isCollapsible && styles$H.notClickable],
29632
+ style: [styles$I.container, !isCollapsible && styles$I.notClickable],
29481
29633
  disabled: !isCollapsible,
29482
29634
  onClick: () => isCollapsible && onToggle?.(!isOpen)
29483
29635
  }, () => /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
29484
- style: styles$H.heading
29636
+ style: styles$I.heading
29485
29637
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, {
29486
29638
  style: {
29487
29639
  fontSize: 14,
@@ -29491,7 +29643,7 @@ function Heading(_ref) {
29491
29643
  isExpanded: isOpen
29492
29644
  })));
29493
29645
  }
29494
- const styles$H = aphrodite.StyleSheet.create({
29646
+ const styles$I = aphrodite.StyleSheet.create({
29495
29647
  container: {
29496
29648
  marginTop: wonderBlocksTokens.spacing.small_12,
29497
29649
  // NOTE(jeremy): This is the inverse of the @editorPadding CSS
@@ -29778,17 +29930,17 @@ const LockedFigureSelect = props => {
29778
29930
  figureTypes.push("label");
29779
29931
  }
29780
29932
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
29781
- style: styles$G.container
29933
+ style: styles$H.container
29782
29934
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.ActionMenu, {
29783
29935
  menuText: "Add locked figure",
29784
- style: styles$G.addElementSelect
29936
+ style: styles$H.addElementSelect
29785
29937
  }, figureTypes.map(figureType => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.ActionItem, {
29786
29938
  key: `${id}-${figureType}`,
29787
29939
  label: figureType,
29788
29940
  onClick: () => onChange(figureType)
29789
29941
  }))));
29790
29942
  };
29791
- const styles$G = aphrodite.StyleSheet.create({
29943
+ const styles$H = aphrodite.StyleSheet.create({
29792
29944
  container: {
29793
29945
  marginTop: wonderBlocksTokens.spacing.xSmall_8
29794
29946
  },
@@ -29858,18 +30010,18 @@ const AngleInput = props => {
29858
30010
  }
29859
30011
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
29860
30012
  tag: "label",
29861
- style: styles$F.row
30013
+ style: styles$G.row
29862
30014
  }, "angle (degrees)", /*#__PURE__*/React__namespace.createElement(Strut, {
29863
30015
  size: wonderBlocksTokens.spacing.xxSmall_6
29864
30016
  }), /*#__PURE__*/React__namespace.createElement(ScrolllessNumberTextField, {
29865
30017
  value: angleInput,
29866
30018
  onChange: handleAngleChange,
29867
- style: styles$F.textField
30019
+ style: styles$G.textField
29868
30020
  }), /*#__PURE__*/React__namespace.createElement(Strut, {
29869
30021
  size: wonderBlocksTokens.spacing.xxSmall_6
29870
30022
  }));
29871
30023
  };
29872
- const styles$F = aphrodite.StyleSheet.create({
30024
+ const styles$G = aphrodite.StyleSheet.create({
29873
30025
  row: {
29874
30026
  display: "flex",
29875
30027
  flexDirection: "row",
@@ -29918,30 +30070,30 @@ const CoordinatePairInput = props => {
29918
30070
  onChange(newCoords);
29919
30071
  }
29920
30072
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
29921
- style: [styles$E.row, style]
30073
+ style: [styles$F.row, style]
29922
30074
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
29923
30075
  tag: "label",
29924
- style: styles$E.row
30076
+ style: styles$F.row
29925
30077
  }, labels ? labels[0] : "x coord", /*#__PURE__*/React__namespace.createElement(Strut, {
29926
30078
  size: wonderBlocksTokens.spacing.xxSmall_6
29927
30079
  }), /*#__PURE__*/React__namespace.createElement(ScrolllessNumberTextField, {
29928
30080
  value: coordState[0],
29929
30081
  onChange: newValue => handleCoordChange(newValue, 0),
29930
- style: [styles$E.textField, error ? styles$E.errorField : undefined]
30082
+ style: [styles$F.textField, error ? styles$F.errorField : undefined]
29931
30083
  })), /*#__PURE__*/React__namespace.createElement(Strut, {
29932
30084
  size: wonderBlocksTokens.spacing.medium_16
29933
30085
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
29934
30086
  tag: "label",
29935
- style: styles$E.row
30087
+ style: styles$F.row
29936
30088
  }, labels ? labels[1] : "y coord", /*#__PURE__*/React__namespace.createElement(Strut, {
29937
30089
  size: wonderBlocksTokens.spacing.xxSmall_6
29938
30090
  }), /*#__PURE__*/React__namespace.createElement(ScrolllessNumberTextField, {
29939
30091
  value: coordState[1],
29940
30092
  onChange: newValue => handleCoordChange(newValue, 1),
29941
- style: [styles$E.textField, error ? styles$E.errorField : undefined]
30093
+ style: [styles$F.textField, error ? styles$F.errorField : undefined]
29942
30094
  })));
29943
30095
  };
29944
- const styles$E = aphrodite.StyleSheet.create({
30096
+ const styles$F = aphrodite.StyleSheet.create({
29945
30097
  row: {
29946
30098
  display: "flex",
29947
30099
  flexDirection: "row",
@@ -29974,14 +30126,14 @@ const PerseusEditorAccordion = props => {
29974
30126
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksAccordion.AccordionSection, {
29975
30127
  expanded: expanded,
29976
30128
  onToggle: onToggle,
29977
- style: [styles$D.container, containerStyle],
29978
- headerStyle: styles$D.accordionHeader,
30129
+ style: [styles$E.container, containerStyle],
30130
+ headerStyle: styles$E.accordionHeader,
29979
30131
  header: header
29980
30132
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
29981
- style: [styles$D.accordionPanel, panelStyle]
30133
+ style: [styles$E.accordionPanel, panelStyle]
29982
30134
  }, children)));
29983
30135
  };
29984
- const styles$D = aphrodite.StyleSheet.create({
30136
+ const styles$E = aphrodite.StyleSheet.create({
29985
30137
  container: {
29986
30138
  backgroundColor: wonderBlocksTokens.color.fadedBlue8,
29987
30139
  marginTop: wonderBlocksTokens.spacing.xSmall_8
@@ -30012,13 +30164,13 @@ const ColorSwatch = props => {
30012
30164
  "aria-label":
30013
30165
  // Don't include an aria label for decorative circles.
30014
30166
  !decorative ? `${color}, ${filled ? "filled" : "open"}` : undefined,
30015
- style: [styles$C.colorSwatch, {
30167
+ style: [styles$D.colorSwatch, {
30016
30168
  border: `4px solid ${perseus.lockedFigureColors[color]}`,
30017
30169
  backgroundColor: filled ? perseus.lockedFigureColors[color] : wonderBlocksTokens.color.white
30018
30170
  }]
30019
30171
  });
30020
30172
  };
30021
- const styles$C = aphrodite.StyleSheet.create({
30173
+ const styles$D = aphrodite.StyleSheet.create({
30022
30174
  colorSwatch: {
30023
30175
  // Add a white outline so that the color swatch is visible when
30024
30176
  // the dropdown option is highlighted with its blue background.
@@ -30037,10 +30189,10 @@ const ColorSelect = props => {
30037
30189
  onChange
30038
30190
  } = props;
30039
30191
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30040
- style: [styles$B.row, style]
30192
+ style: [styles$C.row, style]
30041
30193
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30042
30194
  tag: "label",
30043
- style: styles$B.row
30195
+ style: styles$C.row
30044
30196
  }, "color", /*#__PURE__*/React__namespace.createElement(Strut, {
30045
30197
  size: wonderBlocksTokens.spacing.xxSmall_6
30046
30198
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
@@ -30059,7 +30211,7 @@ const ColorSelect = props => {
30059
30211
  })
30060
30212
  })))));
30061
30213
  };
30062
- const styles$B = aphrodite.StyleSheet.create({
30214
+ const styles$C = aphrodite.StyleSheet.create({
30063
30215
  row: {
30064
30216
  display: "flex",
30065
30217
  flexDirection: "row",
@@ -30078,17 +30230,17 @@ const EllipseSwatch = props => {
30078
30230
  } = props;
30079
30231
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30080
30232
  "aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
30081
- style: [styles$A.container, {
30233
+ style: [styles$B.container, {
30082
30234
  border: `4px ${strokeStyle} ${perseus.lockedFigureColors[color]}`
30083
30235
  }]
30084
30236
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30085
- style: [styles$A.innerCircle, {
30237
+ style: [styles$B.innerCircle, {
30086
30238
  backgroundColor: perseus.lockedFigureColors[color],
30087
30239
  opacity: fillStyle === "white" ? 0 : perseus.lockedFigureFillStyles[fillStyle]
30088
30240
  }]
30089
30241
  }));
30090
30242
  };
30091
- const styles$A = aphrodite.StyleSheet.create({
30243
+ const styles$B = aphrodite.StyleSheet.create({
30092
30244
  container: {
30093
30245
  // Add a white outline so that the color swatch is visible when
30094
30246
  // the dropdown option is highlighted with its blue background.
@@ -30114,7 +30266,7 @@ const LineStrokeSelect = props => {
30114
30266
  } = props;
30115
30267
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30116
30268
  tag: "label",
30117
- style: styles$z.lineStrokeSelect
30269
+ style: styles$A.lineStrokeSelect
30118
30270
  }, "stroke", /*#__PURE__*/React__namespace.createElement(Strut, {
30119
30271
  size: wonderBlocksTokens.spacing.xxxSmall_4
30120
30272
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
@@ -30131,7 +30283,7 @@ const LineStrokeSelect = props => {
30131
30283
  label: "dashed"
30132
30284
  })));
30133
30285
  };
30134
- const styles$z = aphrodite.StyleSheet.create({
30286
+ const styles$A = aphrodite.StyleSheet.create({
30135
30287
  lineStrokeSelect: {
30136
30288
  display: "flex",
30137
30289
  flexDirection: "row",
@@ -30153,40 +30305,40 @@ const LockedFigureSettingsActions = props => {
30153
30305
  onRemove
30154
30306
  } = props;
30155
30307
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30156
- style: styles$y.container
30308
+ style: styles$z.container
30157
30309
  }, /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
30158
30310
  startIcon: trashIcon__default["default"],
30159
30311
  "aria-label": `Delete locked ${figureType}`,
30160
30312
  onClick: onRemove,
30161
30313
  kind: "tertiary",
30162
- style: styles$y.deleteButton
30314
+ style: styles$z.deleteButton
30163
30315
  }, "Delete"), /*#__PURE__*/React__namespace.createElement(Spring, null), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
30164
30316
  icon: caretDoubleUpIcon__default["default"],
30165
30317
  size: "small",
30166
30318
  "aria-label": `Move locked ${figureType} to the back`,
30167
30319
  onClick: () => onMove("back"),
30168
- style: styles$y.iconButton
30320
+ style: styles$z.iconButton
30169
30321
  }), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
30170
30322
  icon: caretUpIcon__default["default"],
30171
30323
  size: "small",
30172
30324
  "aria-label": `Move locked ${figureType} backward`,
30173
30325
  onClick: () => onMove("backward"),
30174
- style: styles$y.iconButton
30326
+ style: styles$z.iconButton
30175
30327
  }), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
30176
30328
  icon: caretDownIcon__default["default"],
30177
30329
  size: "small",
30178
30330
  "aria-label": `Move locked ${figureType} forward`,
30179
30331
  onClick: () => onMove("forward"),
30180
- style: styles$y.iconButton
30332
+ style: styles$z.iconButton
30181
30333
  }), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
30182
30334
  icon: caretDoubleDownIcon__default["default"],
30183
30335
  size: "small",
30184
30336
  "aria-label": `Move locked ${figureType} to the front`,
30185
30337
  onClick: () => onMove("front"),
30186
- style: styles$y.iconButton
30338
+ style: styles$z.iconButton
30187
30339
  }));
30188
30340
  };
30189
- const styles$y = aphrodite.StyleSheet.create({
30341
+ const styles$z = aphrodite.StyleSheet.create({
30190
30342
  container: {
30191
30343
  width: "100%",
30192
30344
  flexDirection: "row",
@@ -30233,7 +30385,7 @@ const LockedEllipseSettings = props => {
30233
30385
  /*#__PURE__*/
30234
30386
  // Summary: Ellipse, center, radius, color (opacity, dashed)
30235
30387
  React__namespace.createElement(wonderBlocksCore.View, {
30236
- style: styles$x.row
30388
+ style: styles$y.row
30237
30389
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Ellipse (${center[0]}, ${center[1]}), radius ${radius[0]}, ${radius[1]}`), /*#__PURE__*/React__namespace.createElement(Strut, {
30238
30390
  size: wonderBlocksTokens.spacing.xSmall_8
30239
30391
  }), /*#__PURE__*/React__namespace.createElement(EllipseSwatch, {
@@ -30242,19 +30394,19 @@ const LockedEllipseSettings = props => {
30242
30394
  strokeStyle: strokeStyle
30243
30395
  }))
30244
30396
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30245
- style: styles$x.row
30397
+ style: styles$y.row
30246
30398
  }, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
30247
30399
  coord: center,
30248
- style: styles$x.spaceUnder,
30400
+ style: styles$y.spaceUnder,
30249
30401
  onChange: newCoords => onChangeProps({
30250
30402
  center: newCoords
30251
30403
  })
30252
30404
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30253
- style: styles$x.spaceUnder
30405
+ style: styles$y.spaceUnder
30254
30406
  }, /*#__PURE__*/React__namespace.createElement(InfoTip$d, null, "The coordinates for the center of the ellipse."))), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
30255
30407
  coord: radius,
30256
30408
  labels: ["x radius", "y radius"],
30257
- style: styles$x.spaceUnder,
30409
+ style: styles$y.spaceUnder,
30258
30410
  onChange: newCoords => onChangeProps({
30259
30411
  radius: newCoords
30260
30412
  })
@@ -30266,7 +30418,7 @@ const LockedEllipseSettings = props => {
30266
30418
  }), /*#__PURE__*/React__namespace.createElement(Strut, {
30267
30419
  size: wonderBlocksTokens.spacing.xSmall_8
30268
30420
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30269
- style: [styles$x.row, styles$x.spaceUnder]
30421
+ style: [styles$y.row, styles$y.spaceUnder]
30270
30422
  }, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
30271
30423
  selectedValue: color,
30272
30424
  onChange: handleColorChange
@@ -30274,7 +30426,7 @@ const LockedEllipseSettings = props => {
30274
30426
  size: wonderBlocksTokens.spacing.medium_16
30275
30427
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30276
30428
  tag: "label",
30277
- style: [styles$x.row, styles$x.truncatedWidth]
30429
+ style: [styles$y.row, styles$y.truncatedWidth]
30278
30430
  }, "fill", /*#__PURE__*/React__namespace.createElement(Strut, {
30279
30431
  size: wonderBlocksTokens.spacing.xxSmall_6
30280
30432
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
@@ -30300,7 +30452,7 @@ const LockedEllipseSettings = props => {
30300
30452
  onRemove: onRemove
30301
30453
  }));
30302
30454
  };
30303
- const styles$x = aphrodite.StyleSheet.create({
30455
+ const styles$y = aphrodite.StyleSheet.create({
30304
30456
  row: {
30305
30457
  display: "flex",
30306
30458
  flexDirection: "row",
@@ -30321,15 +30473,15 @@ const LineSwatch = props => {
30321
30473
  lineStyle
30322
30474
  } = props;
30323
30475
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30324
- style: styles$w.container
30476
+ style: styles$x.container
30325
30477
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30326
30478
  "aria-label": `${color}, ${lineStyle}`,
30327
- style: [styles$w.lineSwatch, {
30479
+ style: [styles$x.lineSwatch, {
30328
30480
  border: `5px ${lineStyle} ${perseus.lockedFigureColors[color]}`
30329
30481
  }]
30330
30482
  }));
30331
30483
  };
30332
- const styles$w = aphrodite.StyleSheet.create({
30484
+ const styles$x = aphrodite.StyleSheet.create({
30333
30485
  container: {
30334
30486
  backgroundColor: wonderBlocksTokens.color.white,
30335
30487
  justifyContent: "center",
@@ -30341,6 +30493,12 @@ const styles$w = aphrodite.StyleSheet.create({
30341
30493
  }
30342
30494
  });
30343
30495
 
30496
+ const examples = {
30497
+ linear: ["x + 5", "1/2x - 2"],
30498
+ polynomial: ["1/2x^2 + 3x - 4", "(1/3)x^3 - 2x^2 + 3x - 4"],
30499
+ trigonometric: ["sin(x) * 3", "arctan(2x) + 4"]
30500
+ };
30501
+
30344
30502
  /**
30345
30503
  * LockedFunctionSettings is a component that allows the user to edit the
30346
30504
  * settings of specifically a locked function on the graph.
@@ -30359,18 +30517,20 @@ const LockedFunctionSettings = props => {
30359
30517
  onRemove
30360
30518
  } = props;
30361
30519
  const equationPrefix = directionalAxis === "x" ? "y=" : "x=";
30520
+ const domainRangeText = directionalAxis === "x" ? "domain" : "range";
30362
30521
  const lineLabel = `Function (${equationPrefix}${equation})`;
30363
30522
 
30364
- // Tracking the string value of domain constraints to handle interim state of
30523
+ // Tracking the string value of domain/range constraints to handle interim state of
30365
30524
  // entering a negative value, as well as representing Infinity as an empty string.
30366
30525
  // This variable is used when specifying the values of the input fields.
30367
30526
  const [domainEntries, setDomainEntries] = React.useState([domain && domain[0] !== -Infinity ? domain[0].toString() : "", domain && domain[1] !== Infinity ? domain[1].toString() : ""]);
30527
+ const [exampleCategory, setExampleCategory] = React.useState("");
30368
30528
  React.useEffect(() => {
30369
- // "useEffect" used to maintain parity between domain constraints and their string representation.
30529
+ // "useEffect" used to maintain parity between domain/range constraints and their string representation.
30370
30530
  setDomainEntries([domain && domain[0] !== -Infinity ? domain[0].toString() : "", domain && domain[1] !== Infinity ? domain[1].toString() : ""]);
30371
30531
  }, [domain]);
30372
30532
 
30373
- // Generic function for handling property changes (except for 'domain')
30533
+ // Generic function for handling property changes (except for 'domain/range')
30374
30534
  function handlePropChange(property, newValue) {
30375
30535
  const updatedProps = {};
30376
30536
  updatedProps[property] = newValue;
@@ -30378,8 +30538,8 @@ const LockedFunctionSettings = props => {
30378
30538
  }
30379
30539
 
30380
30540
  /*
30381
- Reason for having a separate 'propChange' function for 'domain':
30382
- Domain entries are optional. Their default value is +/- Infinity.
30541
+ Reason for having a separate 'propChange' function for 'domain/range':
30542
+ Domain/Range entries are optional. Their default value is +/- Infinity.
30383
30543
  Since input fields that are empty evaluate to zero, there needs to be
30384
30544
  dedicated code to convert empty to Infinity.
30385
30545
  */
@@ -30399,13 +30559,16 @@ const LockedFunctionSettings = props => {
30399
30559
  domain: newDomain
30400
30560
  });
30401
30561
  }
30562
+ const exampleCategories = Object.keys(examples);
30563
+ const exampleCategorySelected = exampleCategory !== "";
30564
+ const exampleContent = exampleCategorySelected ? examples[exampleCategory] : ["Select category to see example equations"];
30402
30565
  return /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
30403
30566
  expanded: props.expanded,
30404
30567
  onToggle: props.onToggle,
30405
30568
  header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30406
- style: styles$v.row
30569
+ style: styles$w.row
30407
30570
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, {
30408
- style: styles$v.accordionHeader
30571
+ style: styles$w.accordionHeader
30409
30572
  }, lineLabel), /*#__PURE__*/React__namespace.createElement(Strut, {
30410
30573
  size: wonderBlocksTokens.spacing.xSmall_8
30411
30574
  }), /*#__PURE__*/React__namespace.createElement(LineSwatch, {
@@ -30413,7 +30576,7 @@ const LockedFunctionSettings = props => {
30413
30576
  lineStyle: strokeStyle
30414
30577
  }))
30415
30578
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30416
- style: [styles$v.row, styles$v.spaceUnder]
30579
+ style: [styles$w.row, styles$w.spaceUnder]
30417
30580
  }, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
30418
30581
  selectedValue: lineColor,
30419
30582
  onChange: newValue => {
@@ -30427,14 +30590,14 @@ const LockedFunctionSettings = props => {
30427
30590
  handlePropChange("strokeStyle", newValue);
30428
30591
  }
30429
30592
  })), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30430
- style: [styles$v.row, styles$v.rowSpace]
30593
+ style: [styles$w.row, styles$w.rowSpace]
30431
30594
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
30432
30595
  selectedValue: directionalAxis,
30433
30596
  onChange: newValue => {
30434
30597
  handlePropChange("directionalAxis", newValue);
30435
30598
  },
30436
30599
  "aria-label": "equation prefix",
30437
- style: styles$v.equationPrefix
30600
+ style: [styles$w.dropdownLabel, styles$w.axisMenu]
30438
30601
  // Placeholder is required, but never gets used.
30439
30602
  ,
30440
30603
  placeholder: ""
@@ -30453,17 +30616,17 @@ const LockedFunctionSettings = props => {
30453
30616
  onChange: newValue => {
30454
30617
  handlePropChange("equation", newValue);
30455
30618
  },
30456
- style: [styles$v.textField]
30619
+ style: [styles$w.textField]
30457
30620
  })), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30458
- style: [styles$v.row, styles$v.rowSpace]
30621
+ style: [styles$w.row, styles$w.rowSpace]
30459
30622
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30460
30623
  tag: "label",
30461
- style: styles$v.domainMin
30462
- }, "domain min", /*#__PURE__*/React__namespace.createElement(Strut, {
30624
+ style: [styles$w.dropdownLabel, styles$w.domainMin]
30625
+ }, `${domainRangeText} min`, /*#__PURE__*/React__namespace.createElement(Strut, {
30463
30626
  size: wonderBlocksTokens.spacing.xxSmall_6
30464
30627
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
30465
30628
  type: "number",
30466
- style: styles$v.domainMinField,
30629
+ style: styles$w.domainMinField,
30467
30630
  value: domainEntries[0],
30468
30631
  onChange: newValue => {
30469
30632
  handleDomainChange(0, newValue);
@@ -30472,24 +30635,83 @@ const LockedFunctionSettings = props => {
30472
30635
  size: wonderBlocksTokens.spacing.medium_16
30473
30636
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30474
30637
  tag: "label",
30475
- "aria-label": "domain max",
30476
- style: styles$v.domainMax
30638
+ "aria-label": `${domainRangeText} max`,
30639
+ style: [styles$w.dropdownLabel, styles$w.domainMax]
30477
30640
  }, "max", /*#__PURE__*/React__namespace.createElement(Strut, {
30478
30641
  size: wonderBlocksTokens.spacing.xxSmall_6
30479
30642
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
30480
30643
  type: "number",
30481
- style: styles$v.domainMaxField,
30644
+ style: styles$w.domainMaxField,
30482
30645
  value: domainEntries[1],
30483
30646
  onChange: newValue => {
30484
30647
  handleDomainChange(1, newValue);
30485
30648
  }
30486
- }))), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
30649
+ }))), /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
30650
+ header: /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Example Functions"),
30651
+ expanded: false,
30652
+ containerStyle: styles$w.exampleWorkspace,
30653
+ panelStyle: styles$w.exampleAccordionPanel
30654
+ }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30655
+ tag: "label",
30656
+ style: styles$w.dropdownLabel
30657
+ }, "Choose a category", /*#__PURE__*/React__namespace.createElement(Strut, {
30658
+ size: wonderBlocksTokens.spacing.xxSmall_6
30659
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
30660
+ selectedValue: exampleCategory,
30661
+ onChange: setExampleCategory,
30662
+ placeholder: "examples"
30663
+ }, exampleCategories.map(category => {
30664
+ return /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
30665
+ key: category,
30666
+ value: category,
30667
+ label: category
30668
+ });
30669
+ }))), exampleCategorySelected && /*#__PURE__*/React__namespace.createElement("ul", {
30670
+ className: aphrodite.css(styles$w.exampleContainer)
30671
+ }, exampleContent.map((example, index) => /*#__PURE__*/React__namespace.createElement(ExampleItem, {
30672
+ category: exampleCategory,
30673
+ example: example,
30674
+ index: index,
30675
+ pasteEquationFn: handlePropChange
30676
+ })))), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
30487
30677
  figureType: props.type,
30488
30678
  onMove: onMove,
30489
30679
  onRemove: onRemove
30490
30680
  }));
30491
30681
  };
30492
- const styles$v = aphrodite.StyleSheet.create({
30682
+ const ExampleItem = props => {
30683
+ const {
30684
+ category,
30685
+ example,
30686
+ index,
30687
+ pasteEquationFn
30688
+ } = props;
30689
+ const exampleId = React.useId();
30690
+ return /*#__PURE__*/React__namespace.createElement("li", {
30691
+ key: `${category}-${index}`,
30692
+ className: aphrodite.css(styles$w.exampleRow)
30693
+ }, /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
30694
+ icon: autoPasteIcon__default["default"],
30695
+ "aria-label": "paste example",
30696
+ "aria-describedby": exampleId,
30697
+ onClick: () => pasteEquationFn("equation", example),
30698
+ size: "medium",
30699
+ style: styles$w.copyPasteButton
30700
+ }), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
30701
+ icon: copyIcon__default["default"],
30702
+ "aria-label": "copy example",
30703
+ "aria-describedby": exampleId,
30704
+ onClick: () => navigator.clipboard.writeText(example),
30705
+ size: "medium",
30706
+ style: styles$w.copyPasteButton
30707
+ }), /*#__PURE__*/React__namespace.createElement(Strut, {
30708
+ size: wonderBlocksTokens.spacing.xxxSmall_4
30709
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30710
+ style: styles$w.exampleContent,
30711
+ id: exampleId
30712
+ }, example));
30713
+ };
30714
+ const styles$w = aphrodite.StyleSheet.create({
30493
30715
  accordionHeader: {
30494
30716
  textOverflow: "ellipsis",
30495
30717
  // A maximum width needs to be specified in order for the ellipsis to work.
@@ -30499,17 +30721,20 @@ const styles$v = aphrodite.StyleSheet.create({
30499
30721
  overflow: "hidden",
30500
30722
  whiteSpace: "nowrap"
30501
30723
  },
30502
- equationPrefix: {
30724
+ axisMenu: {
30503
30725
  minWidth: "auto"
30504
30726
  },
30727
+ copyPasteButton: {
30728
+ flexShrink: "0",
30729
+ margin: "0 2px"
30730
+ },
30505
30731
  domainMin: {
30506
- alignItems: "center",
30507
- display: "flex",
30732
+ justifyContent: "space-between",
30508
30733
  // The 'width' property is applied to the label, which wraps the text and the input field.
30509
30734
  // The width of the input fields (min/max) should be the same (to have a consistent look),
30510
30735
  // so the following calculation distributes the space accordingly.
30511
- // For the "domain min" block, the text is 82.7px, and the strut is 6px (88.7px total).
30512
- // The "domain max" block is 30.23px, and the strut is 6px (36.23px total).
30736
+ // For the "domain/range min" block, the text is 82.7px, and the strut is 6px (88.7px total).
30737
+ // The "domain/range max" block is 30.23px, and the strut is 6px (36.23px total).
30513
30738
  // The calculation takes the remain space after the text & struts (141px total) are removed,
30514
30739
  // and divides it between the two input fields equally.
30515
30740
  // The calculation reads: "Take 1/2 of the non-text space, and add the required space for this label's text"
@@ -30522,8 +30747,6 @@ const styles$v = aphrodite.StyleSheet.create({
30522
30747
  },
30523
30748
 
30524
30749
  domainMax: {
30525
- alignItems: "center",
30526
- display: "flex",
30527
30750
  // See explanation for "domainMin" for the calculation below.
30528
30751
  width: "calc(((100% - 141px) / 2) + 36.2px)"
30529
30752
  },
@@ -30531,6 +30754,44 @@ const styles$v = aphrodite.StyleSheet.create({
30531
30754
  width: "calc(100% - 36.2px)" // make room for the label
30532
30755
  },
30533
30756
 
30757
+ dropdownLabel: {
30758
+ alignItems: "center",
30759
+ display: "flex"
30760
+ },
30761
+ exampleAccordionPanel: {
30762
+ alignItems: "start",
30763
+ paddingBottom: "12px",
30764
+ flexDirection: "row",
30765
+ flexWrap: "wrap"
30766
+ },
30767
+ exampleContainer: {
30768
+ background: "white",
30769
+ border: `1px solid ${wonderBlocksTokens.color.fadedOffBlack16}`,
30770
+ borderRadius: "4px",
30771
+ flexGrow: "1",
30772
+ listStyleType: "none",
30773
+ // Nothing special about the maxHeight value,
30774
+ // just a good height to partially show a 3rd example in the list
30775
+ // to hint at scrollable content.
30776
+ maxHeight: "88px",
30777
+ margin: "8px 0 0 0",
30778
+ overflowY: "scroll",
30779
+ padding: "4px 12px 4px 4px"
30780
+ },
30781
+ exampleContent: {
30782
+ fontFamily: `"Lato", sans-serif`,
30783
+ flexGrow: "1",
30784
+ color: wonderBlocksTokens.color.offBlack
30785
+ },
30786
+ exampleRow: {
30787
+ alignItems: "center",
30788
+ display: "flex",
30789
+ flexDirection: "row",
30790
+ minHeight: "44px"
30791
+ },
30792
+ exampleWorkspace: {
30793
+ background: wonderBlocksTokens.color.white50
30794
+ },
30534
30795
  rowSpace: {
30535
30796
  marginTop: wonderBlocksTokens.spacing.xSmall_8
30536
30797
  },
@@ -30568,14 +30829,14 @@ function LockedLabelSettings(props) {
30568
30829
  expanded: expanded,
30569
30830
  onToggle: onToggle,
30570
30831
  header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30571
- style: [styles$u.row, styles$u.accordionHeaderContainer]
30832
+ style: [styles$v.row, styles$v.accordionHeaderContainer]
30572
30833
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Label (", coord[0], ", ", coord[1], ")"), /*#__PURE__*/React__namespace.createElement(Strut, {
30573
30834
  size: wonderBlocksTokens.spacing.xSmall_8
30574
30835
  }), text !== "" && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, {
30575
30836
  style: [{
30576
30837
  backgroundColor: wonderBlocksTokens.color.white,
30577
30838
  color: perseus.lockedFigureColors[color]
30578
- }, styles$u.accordionHeader]
30839
+ }, styles$v.accordionHeader]
30579
30840
  }, text))
30580
30841
  }, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
30581
30842
  coord: coord,
@@ -30584,10 +30845,10 @@ function LockedLabelSettings(props) {
30584
30845
  coord: newCoords
30585
30846
  });
30586
30847
  },
30587
- style: styles$u.spaceUnder
30848
+ style: styles$v.spaceUnder
30588
30849
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30589
30850
  tag: "label",
30590
- style: [styles$u.row, styles$u.spaceUnder]
30851
+ style: [styles$v.row, styles$v.spaceUnder]
30591
30852
  }, "TeX", /*#__PURE__*/React__namespace.createElement(Strut, {
30592
30853
  size: wonderBlocksTokens.spacing.xSmall_8
30593
30854
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
@@ -30597,7 +30858,7 @@ function LockedLabelSettings(props) {
30597
30858
  text: newValue
30598
30859
  })
30599
30860
  })), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30600
- style: styles$u.row
30861
+ style: styles$v.row
30601
30862
  }, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
30602
30863
  selectedValue: color,
30603
30864
  onChange: newColor => {
@@ -30605,12 +30866,12 @@ function LockedLabelSettings(props) {
30605
30866
  color: newColor
30606
30867
  });
30607
30868
  },
30608
- style: styles$u.spaceUnder
30869
+ style: styles$v.spaceUnder
30609
30870
  }), /*#__PURE__*/React__namespace.createElement(Strut, {
30610
30871
  size: wonderBlocksTokens.spacing.medium_16
30611
30872
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30612
30873
  tag: "label",
30613
- style: styles$u.row
30874
+ style: styles$v.row
30614
30875
  }, "size", /*#__PURE__*/React__namespace.createElement(Strut, {
30615
30876
  size: wonderBlocksTokens.spacing.xSmall_8
30616
30877
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
@@ -30637,7 +30898,7 @@ function LockedLabelSettings(props) {
30637
30898
  onRemove: onRemove
30638
30899
  }));
30639
30900
  }
30640
- const styles$u = aphrodite.StyleSheet.create({
30901
+ const styles$v = aphrodite.StyleSheet.create({
30641
30902
  accordionHeaderContainer: {
30642
30903
  // Stop the label summary from wrapping.
30643
30904
  whiteSpace: "nowrap"
@@ -30671,7 +30932,7 @@ const LabeledSwitch = props => {
30671
30932
  const ids = wonderBlocksCore.useUniqueIdWithMock();
30672
30933
  const switchId = ids.get("switch");
30673
30934
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30674
- style: [styles$t.row, style]
30935
+ style: [styles$u.row, style]
30675
30936
  }, /*#__PURE__*/React__namespace.createElement(Switch__default["default"], {
30676
30937
  id: switchId,
30677
30938
  checked: checked,
@@ -30683,7 +30944,7 @@ const LabeledSwitch = props => {
30683
30944
  htmlFor: switchId
30684
30945
  }, label));
30685
30946
  };
30686
- const styles$t = aphrodite.StyleSheet.create({
30947
+ const styles$u = aphrodite.StyleSheet.create({
30687
30948
  row: {
30688
30949
  flexDirection: "row",
30689
30950
  alignItems: "center"
@@ -30717,13 +30978,13 @@ const DefiningPointSettings = props => {
30717
30978
  return /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
30718
30979
  expanded: expanded,
30719
30980
  onToggle: onToggle,
30720
- containerStyle: styles$s.container,
30721
- panelStyle: styles$s.accordionPanel,
30981
+ containerStyle: styles$t.container,
30982
+ panelStyle: styles$t.accordionPanel,
30722
30983
  header:
30723
30984
  /*#__PURE__*/
30724
30985
  // Summary: Point, coords, color (filled/open)
30725
30986
  React__namespace.createElement(wonderBlocksCore.View, {
30726
- style: styles$s.row
30987
+ style: styles$t.row
30727
30988
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `${label || "Point"} (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React__namespace.createElement(Strut, {
30728
30989
  size: wonderBlocksTokens.spacing.xSmall_8
30729
30990
  }), showPoint && /*#__PURE__*/React__namespace.createElement(ColorSwatch, {
@@ -30733,7 +30994,7 @@ const DefiningPointSettings = props => {
30733
30994
  }, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
30734
30995
  coord: coord,
30735
30996
  error: !!error,
30736
- style: styles$s.spaceUnder,
30997
+ style: styles$t.spaceUnder,
30737
30998
  onChange: newCoords => {
30738
30999
  onChangeProps({
30739
31000
  coord: newCoords
@@ -30742,12 +31003,12 @@ const DefiningPointSettings = props => {
30742
31003
  }), onTogglePoint && /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
30743
31004
  label: "show point on graph",
30744
31005
  checked: !!showPoint,
30745
- style: showPoint && styles$s.spaceUnder,
31006
+ style: showPoint && styles$t.spaceUnder,
30746
31007
  onChange: onTogglePoint
30747
31008
  }), showPoint && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
30748
31009
  selectedValue: pointColor,
30749
31010
  onChange: handleColorChange,
30750
- style: styles$s.spaceUnder
31011
+ style: styles$t.spaceUnder
30751
31012
  }), /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
30752
31013
  label: "open point",
30753
31014
  checked: !filled,
@@ -30758,7 +31019,7 @@ const DefiningPointSettings = props => {
30758
31019
  }
30759
31020
  })));
30760
31021
  };
30761
- const styles$s = aphrodite.StyleSheet.create({
31022
+ const styles$t = aphrodite.StyleSheet.create({
30762
31023
  container: {
30763
31024
  marginTop: wonderBlocksTokens.spacing.xSmall_8,
30764
31025
  marginBottom: 0,
@@ -30826,7 +31087,7 @@ const LockedLineSettings = props => {
30826
31087
  expanded: props.expanded,
30827
31088
  onToggle: props.onToggle,
30828
31089
  header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30829
- style: styles$r.row
31090
+ style: styles$s.row
30830
31091
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, lineLabel), /*#__PURE__*/React__namespace.createElement(Strut, {
30831
31092
  size: wonderBlocksTokens.spacing.xSmall_8
30832
31093
  }), /*#__PURE__*/React__namespace.createElement(LineSwatch, {
@@ -30835,7 +31096,7 @@ const LockedLineSettings = props => {
30835
31096
  }))
30836
31097
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30837
31098
  tag: "label",
30838
- style: [styles$r.row, styles$r.spaceUnder]
31099
+ style: [styles$s.row, styles$s.spaceUnder]
30839
31100
  }, "kind", /*#__PURE__*/React__namespace.createElement(Strut, {
30840
31101
  size: wonderBlocksTokens.spacing.xxxSmall_4
30841
31102
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
@@ -30856,7 +31117,7 @@ const LockedLineSettings = props => {
30856
31117
  value: "segment",
30857
31118
  label: "segment"
30858
31119
  }))), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30859
- style: styles$r.row
31120
+ style: styles$s.row
30860
31121
  }, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
30861
31122
  selectedValue: lineColor,
30862
31123
  onChange: handleColorChange
@@ -30868,7 +31129,7 @@ const LockedLineSettings = props => {
30868
31129
  lineStyle: value
30869
31130
  })
30870
31131
  })), isInvalid && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30871
- style: styles$r.errorText
31132
+ style: styles$s.errorText
30872
31133
  }, lengthZeroStr), /*#__PURE__*/React__namespace.createElement(DefiningPointSettings, _extends({
30873
31134
  label: "Point 1",
30874
31135
  showPoint: showPoint1,
@@ -30893,7 +31154,7 @@ const LockedLineSettings = props => {
30893
31154
  onRemove: onRemove
30894
31155
  }));
30895
31156
  };
30896
- const styles$r = aphrodite.StyleSheet.create({
31157
+ const styles$s = aphrodite.StyleSheet.create({
30897
31158
  row: {
30898
31159
  display: "flex",
30899
31160
  flexDirection: "row",
@@ -30934,7 +31195,7 @@ const LockedPointSettings = props => {
30934
31195
  /*#__PURE__*/
30935
31196
  // Summary: Point, coords, color (filled/open)
30936
31197
  React__namespace.createElement(wonderBlocksCore.View, {
30937
- style: styles$q.row
31198
+ style: styles$r.row
30938
31199
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Point (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React__namespace.createElement(Strut, {
30939
31200
  size: wonderBlocksTokens.spacing.xSmall_8
30940
31201
  }), /*#__PURE__*/React__namespace.createElement(ColorSwatch, {
@@ -30943,7 +31204,7 @@ const LockedPointSettings = props => {
30943
31204
  }))
30944
31205
  }, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
30945
31206
  coord: coord,
30946
- style: styles$q.spaceUnder,
31207
+ style: styles$r.spaceUnder,
30947
31208
  onChange: newCoord => {
30948
31209
  onChangeProps({
30949
31210
  coord: newCoord
@@ -30952,7 +31213,7 @@ const LockedPointSettings = props => {
30952
31213
  }), /*#__PURE__*/React__namespace.createElement(ColorSelect, {
30953
31214
  selectedValue: pointColor,
30954
31215
  onChange: handleColorChange,
30955
- style: styles$q.spaceUnder
31216
+ style: styles$r.spaceUnder
30956
31217
  }), /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
30957
31218
  label: "open point",
30958
31219
  checked: !filled,
@@ -30967,7 +31228,7 @@ const LockedPointSettings = props => {
30967
31228
  onRemove: onRemove
30968
31229
  }));
30969
31230
  };
30970
- const styles$q = aphrodite.StyleSheet.create({
31231
+ const styles$r = aphrodite.StyleSheet.create({
30971
31232
  row: {
30972
31233
  flexDirection: "row",
30973
31234
  alignItems: "center"
@@ -30985,17 +31246,17 @@ const PolygonSwatch = props => {
30985
31246
  } = props;
30986
31247
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30987
31248
  "aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
30988
- style: [styles$p.container, {
31249
+ style: [styles$q.container, {
30989
31250
  border: `4px ${strokeStyle} ${perseus.lockedFigureColors[color]}`
30990
31251
  }]
30991
31252
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30992
- style: [styles$p.innerSquare, {
31253
+ style: [styles$q.innerSquare, {
30993
31254
  backgroundColor: perseus.lockedFigureColors[color],
30994
31255
  opacity: fillStyle === "white" ? 0 : perseus.lockedFigureFillStyles[fillStyle]
30995
31256
  }]
30996
31257
  }));
30997
31258
  };
30998
- const styles$p = aphrodite.StyleSheet.create({
31259
+ const styles$q = aphrodite.StyleSheet.create({
30999
31260
  container: {
31000
31261
  // Add a white outline so that the color swatch is visible when
31001
31262
  // the dropdown option is highlighted with its blue background.
@@ -31073,7 +31334,7 @@ const LockedPolygonSettings = props => {
31073
31334
  /*#__PURE__*/
31074
31335
  // Summary: Polygon, number of sides, style swatch
31075
31336
  React__namespace.createElement(wonderBlocksCore.View, {
31076
- style: styles$o.row
31337
+ style: styles$p.row
31077
31338
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Polygon, ${points.length} sides`), /*#__PURE__*/React__namespace.createElement(Strut, {
31078
31339
  size: wonderBlocksTokens.spacing.xSmall_8
31079
31340
  }), /*#__PURE__*/React__namespace.createElement(PolygonSwatch, {
@@ -31082,7 +31343,7 @@ const LockedPolygonSettings = props => {
31082
31343
  strokeStyle: strokeStyle
31083
31344
  }))
31084
31345
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31085
- style: [styles$o.row, styles$o.spaceUnder]
31346
+ style: [styles$p.row, styles$p.spaceUnder]
31086
31347
  }, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
31087
31348
  selectedValue: color,
31088
31349
  onChange: handleColorChange
@@ -31090,7 +31351,7 @@ const LockedPolygonSettings = props => {
31090
31351
  size: wonderBlocksTokens.spacing.medium_16
31091
31352
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
31092
31353
  tag: "label",
31093
- style: [styles$o.row, styles$o.truncatedWidth]
31354
+ style: [styles$p.row, styles$p.truncatedWidth]
31094
31355
  }, "fill", /*#__PURE__*/React__namespace.createElement(Strut, {
31095
31356
  size: wonderBlocksTokens.spacing.xxSmall_6
31096
31357
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
@@ -31116,17 +31377,17 @@ const LockedPolygonSettings = props => {
31116
31377
  onChange: newValue => onChangeProps({
31117
31378
  showVertices: newValue
31118
31379
  }),
31119
- style: styles$o.spaceUnder
31380
+ style: styles$p.spaceUnder
31120
31381
  }), /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
31121
31382
  header: /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Points"),
31122
31383
  expanded: true,
31123
- containerStyle: styles$o.pointAccordionContainer,
31124
- panelStyle: styles$o.pointAccordionPanel
31384
+ containerStyle: styles$p.pointAccordionContainer,
31385
+ panelStyle: styles$p.pointAccordionPanel
31125
31386
  }, points.map((point, index) => {
31126
31387
  const pointLabel = String.fromCharCode(65 + index);
31127
31388
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31128
31389
  key: `locked-polygon-point-index-${index}`,
31129
- style: [styles$o.row, styles$o.spaceUnder]
31390
+ style: [styles$p.row, styles$p.spaceUnder]
31130
31391
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `${pointLabel}:`), /*#__PURE__*/React__namespace.createElement(Strut, {
31131
31392
  size: wonderBlocksTokens.spacing.medium_16
31132
31393
  }), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
@@ -31154,10 +31415,10 @@ const LockedPolygonSettings = props => {
31154
31415
  points: newPoints
31155
31416
  });
31156
31417
  },
31157
- style: styles$o.icon
31418
+ style: styles$p.icon
31158
31419
  }));
31159
31420
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31160
- style: [styles$o.row, styles$o.polygonActionsContainer]
31421
+ style: [styles$p.row, styles$p.polygonActionsContainer]
31161
31422
  }, /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
31162
31423
  kind: "tertiary",
31163
31424
  startIcon: plusCircle__default["default"],
@@ -31167,30 +31428,30 @@ const LockedPolygonSettings = props => {
31167
31428
  });
31168
31429
  }
31169
31430
  }, "Add point"), /*#__PURE__*/React__namespace.createElement(Spring, null), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31170
- style: styles$o.movementButtonsContainer
31431
+ style: styles$p.movementButtonsContainer
31171
31432
  }, /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
31172
31433
  "aria-label": "Move polygon up",
31173
- style: styles$o.iconButton,
31434
+ style: styles$p.iconButton,
31174
31435
  size: "small",
31175
31436
  icon: arrowFatUp__default["default"],
31176
31437
  onClick: () => handlePolygonMove("up")
31177
31438
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31178
- style: styles$o.row
31439
+ style: styles$p.row
31179
31440
  }, /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
31180
31441
  "aria-label": "Move polygon left",
31181
- style: styles$o.iconButton,
31442
+ style: styles$p.iconButton,
31182
31443
  size: "small",
31183
31444
  icon: arrowFatLeft__default["default"],
31184
31445
  onClick: () => handlePolygonMove("left")
31185
31446
  }), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
31186
31447
  "aria-label": "Move polygon down",
31187
- style: styles$o.iconButton,
31448
+ style: styles$p.iconButton,
31188
31449
  size: "small",
31189
31450
  icon: arrowFatDown__default["default"],
31190
31451
  onClick: () => handlePolygonMove("down")
31191
31452
  }), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
31192
31453
  "aria-label": "Move polygon right",
31193
- style: styles$o.iconButton,
31454
+ style: styles$p.iconButton,
31194
31455
  size: "small",
31195
31456
  icon: arrowFatRight__default["default"],
31196
31457
  onClick: () => handlePolygonMove("right")
@@ -31200,7 +31461,7 @@ const LockedPolygonSettings = props => {
31200
31461
  onRemove: onRemove
31201
31462
  }));
31202
31463
  };
31203
- const styles$o = aphrodite.StyleSheet.create({
31464
+ const styles$p = aphrodite.StyleSheet.create({
31204
31465
  row: {
31205
31466
  display: "flex",
31206
31467
  flexDirection: "row",
@@ -31274,7 +31535,7 @@ const LockedVectorSettings = props => {
31274
31535
  expanded: props.expanded,
31275
31536
  onToggle: props.onToggle,
31276
31537
  header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31277
- style: styles$n.row
31538
+ style: styles$o.row
31278
31539
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, lineLabel), /*#__PURE__*/React__namespace.createElement(Strut, {
31279
31540
  size: wonderBlocksTokens.spacing.xSmall_8
31280
31541
  }), /*#__PURE__*/React__namespace.createElement(LineSwatch, {
@@ -31282,19 +31543,19 @@ const LockedVectorSettings = props => {
31282
31543
  lineStyle: "solid"
31283
31544
  }))
31284
31545
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31285
- style: [styles$n.row, styles$n.spaceUnder]
31546
+ style: [styles$o.row, styles$o.spaceUnder]
31286
31547
  }, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
31287
31548
  selectedValue: lineColor,
31288
31549
  onChange: handleColorChange
31289
31550
  })), isInvalid && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
31290
- style: styles$n.errorText
31551
+ style: styles$o.errorText
31291
31552
  }, lengthErrorMessage), /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
31292
31553
  expanded: true // Initial state is expanded
31293
31554
  ,
31294
- containerStyle: styles$n.container,
31295
- panelStyle: styles$n.accordionPanel,
31555
+ containerStyle: styles$o.container,
31556
+ panelStyle: styles$o.accordionPanel,
31296
31557
  header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31297
- style: styles$n.row
31558
+ style: styles$o.row
31298
31559
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Tail (${tail[0]}, ${tail[1]})`))
31299
31560
  }, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
31300
31561
  coord: tail,
@@ -31305,10 +31566,10 @@ const LockedVectorSettings = props => {
31305
31566
  })), /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
31306
31567
  expanded: true // Initial state is expanded
31307
31568
  ,
31308
- containerStyle: styles$n.container,
31309
- panelStyle: styles$n.accordionPanel,
31569
+ containerStyle: styles$o.container,
31570
+ panelStyle: styles$o.accordionPanel,
31310
31571
  header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31311
- style: styles$n.row
31572
+ style: styles$o.row
31312
31573
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Tip (${tip[0]}, ${tip[1]})`))
31313
31574
  }, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
31314
31575
  coord: tip,
@@ -31322,7 +31583,7 @@ const LockedVectorSettings = props => {
31322
31583
  onRemove: onRemove
31323
31584
  }));
31324
31585
  };
31325
- const styles$n = aphrodite.StyleSheet.create({
31586
+ const styles$o = aphrodite.StyleSheet.create({
31326
31587
  accordionPanel: {
31327
31588
  paddingBottom: wonderBlocksTokens.spacing.medium_16
31328
31589
  },
@@ -31495,7 +31756,7 @@ const LockedFiguresSection = props => {
31495
31756
  onRemove: () => removeLockedFigure(index)
31496
31757
  }));
31497
31758
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31498
- style: styles$m.buttonContainer
31759
+ style: styles$n.buttonContainer
31499
31760
  }, /*#__PURE__*/React__namespace.createElement(LockedFigureSelect, {
31500
31761
  showM2bFeatures: props.showM2bFeatures,
31501
31762
  showLabelsFlag: props.showLabelsFlag,
@@ -31506,10 +31767,10 @@ const LockedFiguresSection = props => {
31506
31767
  }), showExpandButton && /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
31507
31768
  kind: "secondary",
31508
31769
  onClick: () => toggleExpanded(allCollapsed),
31509
- style: styles$m.button
31770
+ style: styles$n.button
31510
31771
  }, buttonLabel))));
31511
31772
  };
31512
- const styles$m = aphrodite.StyleSheet.create({
31773
+ const styles$n = aphrodite.StyleSheet.create({
31513
31774
  buttonContainer: {
31514
31775
  flexDirection: "row",
31515
31776
  alignItems: "center"
@@ -31545,7 +31806,7 @@ const GraphPointsCountSelector = _ref => {
31545
31806
  // Never uses placeholder, always has value
31546
31807
  ,
31547
31808
  placeholder: "",
31548
- style: styles$l.singleSelectShort
31809
+ style: styles$m.singleSelectShort
31549
31810
  }, [...[...Array(7).keys()].map(n => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
31550
31811
  key: n,
31551
31812
  value: `${n}`,
@@ -31556,7 +31817,7 @@ const GraphPointsCountSelector = _ref => {
31556
31817
  label: "unlimited"
31557
31818
  })]);
31558
31819
  };
31559
- const styles$l = aphrodite.StyleSheet.create({
31820
+ const styles$m = aphrodite.StyleSheet.create({
31560
31821
  singleSelectShort: {
31561
31822
  // Non-standard spacing, but it's the smallest we can go
31562
31823
  // without running into styling issues with the dropdown.
@@ -31569,7 +31830,7 @@ const GraphTypeSelector = props => {
31569
31830
  selectedValue: props.graphType,
31570
31831
  onChange: props.onChange,
31571
31832
  placeholder: "Select a graph type",
31572
- style: styles$k.singleSelectShort
31833
+ style: styles$l.singleSelectShort
31573
31834
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
31574
31835
  value: "linear",
31575
31836
  label: "Linear function"
@@ -31602,7 +31863,7 @@ const GraphTypeSelector = props => {
31602
31863
  label: "Angle"
31603
31864
  }));
31604
31865
  };
31605
- const styles$k = aphrodite.StyleSheet.create({
31866
+ const styles$l = aphrodite.StyleSheet.create({
31606
31867
  singleSelectShort: {
31607
31868
  // Non-standard spacing, but it's the smallest we can go
31608
31869
  // without running into styling issues with the dropdown.
@@ -31633,6 +31894,54 @@ function InteractiveGraphCorrectAnswer(props) {
31633
31894
  }, props.equationString)), props.children));
31634
31895
  }
31635
31896
 
31897
+ function InteractiveGraphDescription(props) {
31898
+ const {
31899
+ ariaLabelValue,
31900
+ ariaDescriptionValue,
31901
+ onChange
31902
+ } = props;
31903
+ const [isOpen, setIsOpen] = React__namespace.useState(true);
31904
+ return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Heading, {
31905
+ title: "Description",
31906
+ isCollapsible: true,
31907
+ isOpen: isOpen,
31908
+ onToggle: setIsOpen
31909
+ }), isOpen && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelXSmall, {
31910
+ style: styles$k.caption
31911
+ }, "Use these fields to describe the graph as a whole. These are used by screen readers to describe content to users who are visually impaired."), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, {
31912
+ tag: "label"
31913
+ }, "Title", /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
31914
+ value: ariaLabelValue,
31915
+ onChange: newValue => onChange({
31916
+ fullGraphAriaLabel: newValue
31917
+ })
31918
+ })), /*#__PURE__*/React__namespace.createElement(Strut, {
31919
+ size: wonderBlocksTokens.spacing.xSmall_8
31920
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, {
31921
+ tag: "label"
31922
+ // TODO(LEMS-2332): Remove this style prop after
31923
+ // switching to WB TextArea
31924
+ ,
31925
+ style: {
31926
+ display: "flex",
31927
+ flexDirection: "column"
31928
+ }
31929
+ }, "Description", /*#__PURE__*/React__namespace.createElement("textarea", {
31930
+ rows: 8,
31931
+ value: ariaDescriptionValue,
31932
+ onChange: e => onChange({
31933
+ fullGraphAriaDescription: e.target.value
31934
+ })
31935
+ }))));
31936
+ }
31937
+ const styles$k = aphrodite.StyleSheet.create({
31938
+ caption: {
31939
+ color: wonderBlocksTokens.color.offBlack64,
31940
+ paddingTop: wonderBlocksTokens.spacing.xxSmall_6,
31941
+ paddingBottom: wonderBlocksTokens.spacing.xxSmall_6
31942
+ }
31943
+ });
31944
+
31636
31945
  /* eslint-disable react/forbid-prop-types, react/no-unsafe */
31637
31946
  const {
31638
31947
  ButtonGroup: ButtonGroup$2,
@@ -32608,15 +32917,6 @@ class InteractiveGraphEditor extends React__namespace.Component {
32608
32917
  coords: null
32609
32918
  }
32610
32919
  };
32611
- changeMatchType = newValue => {
32612
- const correct = {
32613
- ...this.props.correct,
32614
- match: newValue
32615
- };
32616
- this.props.onChange({
32617
- correct: correct
32618
- });
32619
- };
32620
32920
  changeStartCoords = coords => {
32621
32921
  if (!this.props.graph?.type) {
32622
32922
  return;
@@ -32635,7 +32935,7 @@ class InteractiveGraphEditor extends React__namespace.Component {
32635
32935
  // is copied from the question editor and pasted into the hint editor
32636
32936
  // (double brackets in the markdown).
32637
32937
  serialize() {
32638
- const json = ___default["default"].pick(this.props, "step", "backgroundImage", "markings", "labels", "showProtractor", "showTooltips", "range", "gridStep", "snapStep", "lockedFigures");
32938
+ const json = ___default["default"].pick(this.props, "step", "backgroundImage", "markings", "labels", "showProtractor", "showTooltips", "range", "gridStep", "snapStep", "lockedFigures", "fullGraphAriaLabel", "fullGraphAriaDescription");
32639
32939
 
32640
32940
  // eslint-disable-next-line react/no-string-refs
32641
32941
  const graph = this.refs.graph;
@@ -32694,18 +32994,22 @@ class InteractiveGraphEditor extends React__namespace.Component {
32694
32994
  showProtractor: this.props.showProtractor,
32695
32995
  showTooltips: this.props.showTooltips,
32696
32996
  lockedFigures: this.props.lockedFigures,
32997
+ fullGraphAriaLabel: this.props.fullGraphAriaLabel,
32998
+ fullGraphAriaDescription: this.props.fullGraphAriaDescription,
32697
32999
  trackInteraction: function () {},
32698
- onChange: newProps => {
33000
+ onChange: _ref => {
33001
+ let {
33002
+ graph: newGraph
33003
+ } = _ref;
32699
33004
  let correct = this.props.correct;
32700
- // @ts-expect-error - TS2532 - Object is possibly 'undefined'.
32701
- if (correct.type === newProps.graph.type) {
32702
- correct = {
32703
- ...correct,
32704
- ...newProps.graph
32705
- };
33005
+ // TODO(benchristel): can we improve the type of onChange
33006
+ // so this invariant isn't necessary?
33007
+ invariant(newGraph != null);
33008
+ if (correct.type === newGraph.type) {
33009
+ correct = mergeGraphs(correct, newGraph);
32706
33010
  } else {
32707
33011
  // Clear options from previous graph
32708
- correct = newProps.graph;
33012
+ correct = newGraph;
32709
33013
  }
32710
33014
  this.props.onChange({
32711
33015
  correct: correct,
@@ -32749,7 +33053,11 @@ class InteractiveGraphEditor extends React__namespace.Component {
32749
33053
  }
32750
33054
  });
32751
33055
  }
32752
- })), /*#__PURE__*/React__namespace.createElement(InteractiveGraphCorrectAnswer, {
33056
+ })), this.props.graph && this.props.apiOptions?.flags?.mafs?.[this.props.graph.type] && /*#__PURE__*/React__namespace.createElement(InteractiveGraphDescription, {
33057
+ ariaLabelValue: this.props.fullGraphAriaLabel ?? "",
33058
+ ariaDescriptionValue: this.props.fullGraphAriaDescription ?? "",
33059
+ onChange: this.props.onChange
33060
+ }), /*#__PURE__*/React__namespace.createElement(InteractiveGraphCorrectAnswer, {
32753
33061
  equationString: equationString
32754
33062
  }, graph), this.props.correct?.type === "point" && /*#__PURE__*/React__namespace.createElement(LabeledRow, {
32755
33063
  label: "Number of Points:"
@@ -32774,8 +33082,8 @@ class InteractiveGraphEditor extends React__namespace.Component {
32774
33082
  selectedValue: this.props.correct?.numSides ? `${this.props.correct.numSides}` : "3",
32775
33083
  placeholder: "",
32776
33084
  onChange: newValue => {
32777
- const graph = {
32778
- ...this.props.correct,
33085
+ invariant(this.props.graph?.type === "polygon");
33086
+ const updates = {
32779
33087
  numSides: parsePointCount(newValue),
32780
33088
  coords: null,
32781
33089
  // reset the snap for UNLIMITED, which
@@ -32784,8 +33092,14 @@ class InteractiveGraphEditor extends React__namespace.Component {
32784
33092
  snapTo: "grid"
32785
33093
  };
32786
33094
  this.props.onChange({
32787
- correct: graph,
32788
- graph: graph
33095
+ correct: {
33096
+ ...this.props.correct,
33097
+ ...updates
33098
+ },
33099
+ graph: {
33100
+ ...this.props.graph,
33101
+ ...updates
33102
+ }
32789
33103
  });
32790
33104
  },
32791
33105
  style: styles$a.singleSelectShort
@@ -32801,14 +33115,21 @@ class InteractiveGraphEditor extends React__namespace.Component {
32801
33115
  ,
32802
33116
  placeholder: "",
32803
33117
  onChange: newValue => {
32804
- const graph = {
32805
- ...this.props.correct,
33118
+ invariant(this.props.correct.type === "polygon", `Expected correct answer type to be polygon, but got ${this.props.correct.type}`);
33119
+ invariant(this.props.graph?.type === "polygon", `Expected graph type to be polygon, but got ${this.props.graph?.type}`);
33120
+ const updates = {
32806
33121
  snapTo: newValue,
32807
33122
  coords: null
32808
33123
  };
32809
33124
  this.props.onChange({
32810
- correct: graph,
32811
- graph: graph
33125
+ correct: {
33126
+ ...this.props.correct,
33127
+ ...updates
33128
+ },
33129
+ graph: {
33130
+ ...this.props.graph,
33131
+ ...updates
33132
+ }
32812
33133
  });
32813
33134
  },
32814
33135
  style: styles$a.singleSelectShort
@@ -32830,6 +33151,7 @@ class InteractiveGraphEditor extends React__namespace.Component {
32830
33151
  !!this.props.correct?.showAngles,
32831
33152
  onChange: () => {
32832
33153
  if (this.props.graph?.type === "polygon") {
33154
+ invariant(this.props.correct.type === "polygon", `Expected graph type to be polygon, but got ${this.props.correct.type}`);
32833
33155
  this.props.onChange({
32834
33156
  correct: {
32835
33157
  ...this.props.correct,
@@ -32850,7 +33172,7 @@ class InteractiveGraphEditor extends React__namespace.Component {
32850
33172
  // Don't show indeterminate checkbox state
32851
33173
  !!this.props.correct?.showSides,
32852
33174
  onChange: () => {
32853
- if (this.props.graph?.type === "polygon") {
33175
+ if (this.props.graph?.type === "polygon" && this.props.correct.type === "polygon") {
32854
33176
  this.props.onChange({
32855
33177
  correct: {
32856
33178
  ...this.props.correct,
@@ -32903,7 +33225,23 @@ class InteractiveGraphEditor extends React__namespace.Component {
32903
33225
  label: "Student answer must"
32904
33226
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
32905
33227
  selectedValue: this.props.correct.match || "exact",
32906
- onChange: this.changeMatchType
33228
+ onChange: newValue => {
33229
+ invariant(this.props.correct.type === "polygon", `Expected graph type to be polygon, but got ${this.props.correct.type}`);
33230
+ const correct = {
33231
+ ...this.props.correct,
33232
+ // TODO(benchristel): this cast is necessary
33233
+ // because "exact" is not actually a valid
33234
+ // value for `match`; a value of undefined
33235
+ // means exact matching. The code happens
33236
+ // to work because "exact" falls through
33237
+ // to the correct else branch in
33238
+ // InteractiveGraph.validate()
33239
+ match: newValue
33240
+ };
33241
+ this.props.onChange({
33242
+ correct
33243
+ });
33244
+ }
32907
33245
  // Never uses placeholder, always has value
32908
33246
  ,
32909
33247
  placeholder: "",
@@ -32924,7 +33262,21 @@ class InteractiveGraphEditor extends React__namespace.Component {
32924
33262
  label: "Student answer must"
32925
33263
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
32926
33264
  selectedValue: this.props.correct.match || "exact",
32927
- onChange: this.changeMatchType
33265
+ onChange: newValue => {
33266
+ this.props.onChange({
33267
+ correct: {
33268
+ ...this.props.correct,
33269
+ // TODO(benchristel): this cast is necessary
33270
+ // because "exact" is not actually a valid
33271
+ // value for `match`; a value of undefined
33272
+ // means exact matching. The code happens
33273
+ // to work because "exact" falls through
33274
+ // to the correct else branch in
33275
+ // InteractiveGraph.validate()
33276
+ match: newValue
33277
+ }
33278
+ });
33279
+ }
32928
33280
  // Never uses placeholder, always has value
32929
33281
  ,
32930
33282
  placeholder: "",
@@ -32946,6 +33298,79 @@ class InteractiveGraphEditor extends React__namespace.Component {
32946
33298
  }));
32947
33299
  }
32948
33300
  }
33301
+
33302
+ // Merges two graphs that have the same `type`. Properties defined in `b`
33303
+ // overwrite properties of the same name in `a`. Throws an exception if the
33304
+ // types are different or not recognized.
33305
+ function mergeGraphs(a, b) {
33306
+ if (a.type !== b.type) {
33307
+ throw new Error(`Cannot merge graphs with different types (${a.type} and ${b.type})`);
33308
+ }
33309
+ switch (a.type) {
33310
+ case "angle":
33311
+ invariant(b.type === "angle");
33312
+ return {
33313
+ ...a,
33314
+ ...b
33315
+ };
33316
+ case "circle":
33317
+ invariant(b.type === "circle");
33318
+ return {
33319
+ ...a,
33320
+ ...b
33321
+ };
33322
+ case "linear":
33323
+ invariant(b.type === "linear");
33324
+ return {
33325
+ ...a,
33326
+ ...b
33327
+ };
33328
+ case "linear-system":
33329
+ invariant(b.type === "linear-system");
33330
+ return {
33331
+ ...a,
33332
+ ...b
33333
+ };
33334
+ case "point":
33335
+ invariant(b.type === "point");
33336
+ return {
33337
+ ...a,
33338
+ ...b
33339
+ };
33340
+ case "polygon":
33341
+ invariant(b.type === "polygon");
33342
+ return {
33343
+ ...a,
33344
+ ...b
33345
+ };
33346
+ case "quadratic":
33347
+ invariant(b.type === "quadratic");
33348
+ return {
33349
+ ...a,
33350
+ ...b
33351
+ };
33352
+ case "ray":
33353
+ invariant(b.type === "ray");
33354
+ return {
33355
+ ...a,
33356
+ ...b
33357
+ };
33358
+ case "segment":
33359
+ invariant(b.type === "segment");
33360
+ return {
33361
+ ...a,
33362
+ ...b
33363
+ };
33364
+ case "sinusoid":
33365
+ invariant(b.type === "sinusoid");
33366
+ return {
33367
+ ...a,
33368
+ ...b
33369
+ };
33370
+ default:
33371
+ throw new wonderStuffCore.UnreachableCaseError(a);
33372
+ }
33373
+ }
32949
33374
  const styles$a = aphrodite.StyleSheet.create({
32950
33375
  singleSelectShort: {
32951
33376
  // Non-standard spacing, but it's the smallest we can go