@khanacademy/perseus-editor 14.2.0 → 14.4.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
@@ -36,12 +36,13 @@ var caretUpIcon = require('@phosphor-icons/core/bold/caret-up-bold.svg');
36
36
  var trashIcon = require('@phosphor-icons/core/bold/trash-bold.svg');
37
37
  var copyIcon = require('@phosphor-icons/core/assets/regular/copy.svg');
38
38
  var autoPasteIcon = require('@phosphor-icons/core/assets/regular/note-pencil.svg');
39
+ var plusCircle = require('@phosphor-icons/core/regular/plus-circle.svg');
40
+ var mafs = require('mafs');
39
41
  var arrowFatDown = require('@phosphor-icons/core/regular/arrow-fat-down.svg');
40
42
  var arrowFatLeft = require('@phosphor-icons/core/regular/arrow-fat-left.svg');
41
43
  var arrowFatRight = require('@phosphor-icons/core/regular/arrow-fat-right.svg');
42
44
  var arrowFatUp = require('@phosphor-icons/core/regular/arrow-fat-up.svg');
43
45
  var minusCircle = require('@phosphor-icons/core/regular/minus-circle.svg');
44
- var plusCircle = require('@phosphor-icons/core/regular/plus-circle.svg');
45
46
  var arrowCounterClockwise = require('@phosphor-icons/core/bold/arrow-counter-clockwise-bold.svg');
46
47
 
47
48
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -85,17 +86,17 @@ var caretUpIcon__default = /*#__PURE__*/_interopDefaultLegacy(caretUpIcon);
85
86
  var trashIcon__default = /*#__PURE__*/_interopDefaultLegacy(trashIcon);
86
87
  var copyIcon__default = /*#__PURE__*/_interopDefaultLegacy(copyIcon);
87
88
  var autoPasteIcon__default = /*#__PURE__*/_interopDefaultLegacy(autoPasteIcon);
89
+ var plusCircle__default = /*#__PURE__*/_interopDefaultLegacy(plusCircle);
88
90
  var arrowFatDown__default = /*#__PURE__*/_interopDefaultLegacy(arrowFatDown);
89
91
  var arrowFatLeft__default = /*#__PURE__*/_interopDefaultLegacy(arrowFatLeft);
90
92
  var arrowFatRight__default = /*#__PURE__*/_interopDefaultLegacy(arrowFatRight);
91
93
  var arrowFatUp__default = /*#__PURE__*/_interopDefaultLegacy(arrowFatUp);
92
94
  var minusCircle__default = /*#__PURE__*/_interopDefaultLegacy(minusCircle);
93
- var plusCircle__default = /*#__PURE__*/_interopDefaultLegacy(plusCircle);
94
95
  var arrowCounterClockwise__default = /*#__PURE__*/_interopDefaultLegacy(arrowCounterClockwise);
95
96
 
96
97
  // This file is processed by a Rollup plugin (replace) to inject the production
97
98
  const libName = "@khanacademy/perseus-editor";
98
- const libVersion = "14.2.0";
99
+ const libVersion = "14.4.0";
99
100
  perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
100
101
 
101
102
  function _extends() {
@@ -290,13 +291,13 @@ class SectionControlButton extends React__namespace.Component {
290
291
  role: "button",
291
292
  hideDefaultFocusRing: true,
292
293
  "aria-label": title,
293
- style: styles$U.button
294
+ style: styles$T.button
294
295
  }, _ref => {
295
296
  return /*#__PURE__*/React__namespace.createElement(InlineIcon$b, icon);
296
297
  });
297
298
  }
298
299
  }
299
- const styles$U = aphrodite.StyleSheet.create({
300
+ const styles$T = aphrodite.StyleSheet.create({
300
301
  button: {
301
302
  backgroundColor: wonderBlocksTokens.color.gold,
302
303
  margin: 2,
@@ -20677,11 +20678,11 @@ class Spring extends React__namespace.Component {
20677
20678
  } = this.props;
20678
20679
  return React__namespace.createElement(wonderBlocksCore.View, {
20679
20680
  "aria-hidden": "true",
20680
- style: [styles$T.grow, style]
20681
+ style: [styles$S.grow, style]
20681
20682
  });
20682
20683
  }
20683
20684
  }
20684
- const styles$T = aphrodite.StyleSheet.create({
20685
+ const styles$S = aphrodite.StyleSheet.create({
20685
20686
  grow: {
20686
20687
  flexGrow: 1
20687
20688
  }
@@ -20749,7 +20750,7 @@ class WidgetEditor extends React__namespace.Component {
20749
20750
  constructor(props) {
20750
20751
  super(props);
20751
20752
  this.state = {
20752
- showWidget: false,
20753
+ showWidget: props.widgetIsOpen ?? true,
20753
20754
  widgetInfo: _upgradeWidgetInfo(props)
20754
20755
  };
20755
20756
  this.widget = /*#__PURE__*/React__namespace.createRef();
@@ -20760,6 +20761,12 @@ class WidgetEditor extends React__namespace.Component {
20760
20761
  this.setState({
20761
20762
  widgetInfo: _upgradeWidgetInfo(nextProps)
20762
20763
  });
20764
+ // user can update internal state while the widget is handled globally
20765
+ if (nextProps.widgetIsOpen != null && nextProps.widgetIsOpen !== this.props.widgetIsOpen) {
20766
+ this.setState({
20767
+ showWidget: nextProps.widgetIsOpen
20768
+ });
20769
+ }
20763
20770
  }
20764
20771
  _toggleWidget = e => {
20765
20772
  e.preventDefault();
@@ -20918,13 +20925,13 @@ class WidgetSelect extends React__namespace.Component {
20918
20925
  * that collapse a region.
20919
20926
  */
20920
20927
  function ToggleableCaret(props) {
20921
- const iconStyle = props.isExpanded ? styles$S.expanded : styles$S.collapsed;
20928
+ const iconStyle = props.isExpanded ? styles$R.expanded : styles$R.collapsed;
20922
20929
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksIcon.PhosphorIcon, {
20923
20930
  icon: caretRight__default["default"],
20924
20931
  style: iconStyle
20925
20932
  });
20926
20933
  }
20927
- const styles$S = aphrodite.StyleSheet.create({
20934
+ const styles$R = aphrodite.StyleSheet.create({
20928
20935
  collapsed: {
20929
20936
  transition: ".15s"
20930
20937
  },
@@ -20954,16 +20961,16 @@ class TexErrorView extends React__namespace.Component {
20954
20961
  showErrors
20955
20962
  } = this.state;
20956
20963
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
20957
- style: styles$R.errorContainer
20964
+ style: styles$Q.errorContainer
20958
20965
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
20959
- style: styles$R.title,
20966
+ style: styles$Q.title,
20960
20967
  onClick: this.handleToggleTexErrors
20961
20968
  }, /*#__PURE__*/React__namespace.createElement(ToggleableCaret, {
20962
20969
  isExpanded: showErrors
20963
20970
  }), "\xA0 TeX Errors (", errorList.length, ")"), showErrors && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
20964
- style: styles$R.errorExplanation
20971
+ style: styles$Q.errorExplanation
20965
20972
  }, "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, {
20966
- style: styles$R.error,
20973
+ style: styles$Q.error,
20967
20974
  key: index
20968
20975
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
20969
20976
  style: {
@@ -20972,7 +20979,7 @@ class TexErrorView extends React__namespace.Component {
20972
20979
  }, e.math), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, e.message))));
20973
20980
  }
20974
20981
  }
20975
- const styles$R = aphrodite.StyleSheet.create({
20982
+ const styles$Q = aphrodite.StyleSheet.create({
20976
20983
  title: {
20977
20984
  backgroundColor: "#eee",
20978
20985
  fontSize: "1.25em",
@@ -21168,7 +21175,8 @@ class Editor extends React__namespace.Component {
21168
21175
  // eslint-disable-next-line react/jsx-no-bind
21169
21176
  ,
21170
21177
  onRemove: this._handleWidgetEditorRemove.bind(this, id),
21171
- apiOptions: this.props.apiOptions
21178
+ apiOptions: this.props.apiOptions,
21179
+ widgetIsOpen: this.props.widgetIsOpen
21172
21180
  }, this.props.widgets[id]));
21173
21181
  }
21174
21182
  _handleWidgetEditorChange = (id, newWidgetInfo, cb, silent) => {
@@ -24049,7 +24057,7 @@ class ItemExtrasEditor extends React__namespace.Component {
24049
24057
  }
24050
24058
  }
24051
24059
  const ItemExtraCheckbox = props => /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
24052
- style: [styles$Q.checkbox, props.indent ? styles$Q.indented : undefined]
24060
+ style: [styles$P.checkbox, props.indent ? styles$P.indented : undefined]
24053
24061
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
24054
24062
  label: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
24055
24063
  style: {
@@ -24059,7 +24067,7 @@ const ItemExtraCheckbox = props => /*#__PURE__*/React__namespace.createElement(w
24059
24067
  checked: props.checked,
24060
24068
  onChange: newCheckedState => props.onChange(newCheckedState)
24061
24069
  }));
24062
- const styles$Q = aphrodite.StyleSheet.create({
24070
+ const styles$P = aphrodite.StyleSheet.create({
24063
24071
  indented: {
24064
24072
  marginInlineStart: wonderBlocksTokens.spacing.large_24
24065
24073
  }
@@ -24129,7 +24137,8 @@ class ItemEditor extends React__namespace.Component {
24129
24137
  imageUploader: this.props.imageUploader,
24130
24138
  onChange: this.handleEditorChange,
24131
24139
  apiOptions: this.props.apiOptions,
24132
- showWordCount: true
24140
+ showWordCount: true,
24141
+ widgetIsOpen: this.props.widgetIsOpen
24133
24142
  }, this.props.question))), /*#__PURE__*/React__namespace.createElement("div", {
24134
24143
  className: "perseus-editor-right-cell"
24135
24144
  }, /*#__PURE__*/React__namespace.createElement("div", {
@@ -24187,7 +24196,8 @@ class EditorPage extends React__namespace.Component {
24187
24196
  json: ___default["default"].pick(this.props, "question", "answerArea", "hints", "itemDataVersion"),
24188
24197
  gradeMessage: "",
24189
24198
  wasAnswered: false,
24190
- highlightLint: true
24199
+ highlightLint: true,
24200
+ widgetsAreOpen: this.props.widgetsAreOpen ?? true
24191
24201
  };
24192
24202
  this._isMounted = false;
24193
24203
  }
@@ -24339,6 +24349,7 @@ class EditorPage extends React__namespace.Component {
24339
24349
  wasAnswered: this.state.wasAnswered,
24340
24350
  gradeMessage: this.state.gradeMessage,
24341
24351
  deviceType: this.props.previewDevice,
24352
+ widgetIsOpen: this.state.widgetsAreOpen,
24342
24353
  apiOptions: deviceBasedApiOptions,
24343
24354
  previewURL: this.props.previewURL
24344
24355
  }), (!this.props.developerMode || !this.props.jsonMode) && /*#__PURE__*/React__namespace.createElement(CombinedHintsEditor, {
@@ -24722,12 +24733,12 @@ class SimpleButton extends React__namespace.Component {
24722
24733
  ...otherProps
24723
24734
  } = this.props;
24724
24735
  return /*#__PURE__*/React__namespace.createElement("div", _extends({
24725
- className: aphrodite.css(styles$P.baseButton, color === "green" && styles$P.green, color === "orange" && styles$P.orange),
24736
+ className: aphrodite.css(styles$O.baseButton, color === "green" && styles$O.green, color === "orange" && styles$O.orange),
24726
24737
  onClick: onClick
24727
24738
  }, otherProps), children);
24728
24739
  }
24729
24740
  }
24730
- const styles$P = aphrodite.StyleSheet.create({
24741
+ const styles$O = aphrodite.StyleSheet.create({
24731
24742
  baseButton: {
24732
24743
  top: "0",
24733
24744
  fontSize: "11px",
@@ -24940,23 +24951,23 @@ const LeafContainer = _ref2 => {
24940
24951
  } = _ref2;
24941
24952
  const hasPreviewHeading = shape.type === "content" || shape.type === "hint";
24942
24953
  const previewHeading = hasPreviewHeading && /*#__PURE__*/React__namespace.createElement("div", {
24943
- className: aphrodite.css(styles$O.containerHeader)
24954
+ className: aphrodite.css(styles$N.containerHeader)
24944
24955
  }, /*#__PURE__*/React__namespace.createElement(Header, {
24945
24956
  depth: path.length,
24946
- className: aphrodite.css(styles$O.containerTitle)
24957
+ className: aphrodite.css(styles$N.containerTitle)
24947
24958
  }, capitalize(name)));
24948
24959
  return /*#__PURE__*/React__namespace.createElement("div", {
24949
- className: aphrodite.css(styles$O.container)
24960
+ className: aphrodite.css(styles$N.container)
24950
24961
  }, /*#__PURE__*/React__namespace.createElement("span", {
24951
- className: aphrodite.css(styles$O.row, styles$O.rowHeading)
24962
+ className: aphrodite.css(styles$N.row, styles$N.rowHeading)
24952
24963
  }, /*#__PURE__*/React__namespace.createElement("div", {
24953
- className: aphrodite.css(styles$O.columnLeft)
24964
+ className: aphrodite.css(styles$N.columnLeft)
24954
24965
  }, /*#__PURE__*/React__namespace.createElement("div", {
24955
- className: "pod-title " + aphrodite.css(styles$O.containerHeader)
24966
+ className: "pod-title " + aphrodite.css(styles$N.containerHeader)
24956
24967
  }, /*#__PURE__*/React__namespace.createElement("div", {
24957
- className: aphrodite.css(styles$O.containerTitle)
24968
+ className: aphrodite.css(styles$N.containerTitle)
24958
24969
  }, capitalize(name)), controls)), /*#__PURE__*/React__namespace.createElement("div", {
24959
- className: aphrodite.css(styles$O.columnRight)
24970
+ className: aphrodite.css(styles$N.columnRight)
24960
24971
  }, previewHeading)), children);
24961
24972
  };
24962
24973
  const ArrayContainer = props => {
@@ -24969,11 +24980,11 @@ const ArrayContainer = props => {
24969
24980
  actions
24970
24981
  } = props;
24971
24982
  return /*#__PURE__*/React__namespace.createElement("div", {
24972
- className: aphrodite.css(styles$O.container)
24983
+ className: aphrodite.css(styles$N.container)
24973
24984
  }, controls && /*#__PURE__*/React__namespace.createElement("div", {
24974
- className: aphrodite.css(styles$O.columnLeft, styles$O.containerHeader)
24985
+ className: aphrodite.css(styles$N.columnLeft, styles$N.containerHeader)
24975
24986
  }, controls), /*#__PURE__*/React__namespace.createElement("div", null, children), /*#__PURE__*/React__namespace.createElement("div", {
24976
- className: aphrodite.css(styles$O.columnLeft)
24987
+ className: aphrodite.css(styles$N.columnLeft)
24977
24988
  }, /*#__PURE__*/React__namespace.createElement("a", {
24978
24989
  href: "javascript:void 0",
24979
24990
  onClick: () => actions.addArrayElement(path, shape.elementShape)
@@ -24987,28 +24998,28 @@ const ObjectContainer = _ref3 => {
24987
24998
  path
24988
24999
  } = _ref3;
24989
25000
  const headingEditor = /*#__PURE__*/React__namespace.createElement("div", {
24990
- className: aphrodite.css(styles$O.containerHeader)
25001
+ className: aphrodite.css(styles$N.containerHeader)
24991
25002
  }, /*#__PURE__*/React__namespace.createElement(Header, {
24992
25003
  depth: path.length,
24993
- className: aphrodite.css(styles$O.containerTitle)
25004
+ className: aphrodite.css(styles$N.containerTitle)
24994
25005
  }, capitalize(name)), controls);
24995
25006
  const headingPreview = (name || controls) && /*#__PURE__*/React__namespace.createElement("div", {
24996
- className: aphrodite.css(styles$O.containerHeader, styles$O.previewCollectionHeader)
25007
+ className: aphrodite.css(styles$N.containerHeader, styles$N.previewCollectionHeader)
24997
25008
  }, /*#__PURE__*/React__namespace.createElement(Header, {
24998
25009
  depth: path.length,
24999
- className: aphrodite.css(styles$O.containerTitle)
25010
+ className: aphrodite.css(styles$N.containerTitle)
25000
25011
  }, capitalize(name)));
25001
25012
  const hasBothHeadings = headingEditor && headingPreview;
25002
25013
  return /*#__PURE__*/React__namespace.createElement("div", {
25003
- className: aphrodite.css(styles$O.container)
25014
+ className: aphrodite.css(styles$N.container)
25004
25015
  }, hasBothHeadings && /*#__PURE__*/React__namespace.createElement("span", {
25005
- className: aphrodite.css(styles$O.row)
25016
+ className: aphrodite.css(styles$N.row)
25006
25017
  }, /*#__PURE__*/React__namespace.createElement("div", {
25007
- className: aphrodite.css(styles$O.columnLeft)
25018
+ className: aphrodite.css(styles$N.columnLeft)
25008
25019
  }, headingEditor), /*#__PURE__*/React__namespace.createElement("div", {
25009
- className: aphrodite.css(styles$O.columnRight)
25020
+ className: aphrodite.css(styles$N.columnRight)
25010
25021
  }, headingPreview)), /*#__PURE__*/React__namespace.createElement("div", {
25011
- className: aphrodite.css(path.length > 0 && styles$O.contentIndent)
25022
+ className: aphrodite.css(path.length > 0 && styles$N.contentIndent)
25012
25023
  }, children));
25013
25024
  };
25014
25025
 
@@ -25128,11 +25139,11 @@ const ItemNodeContent = withStickiness(props => {
25128
25139
  className: "framework-perseus"
25129
25140
  }, lens(renderers).get(path));
25130
25141
  return /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement("div", {
25131
- className: aphrodite.css(styles$O.row)
25142
+ className: aphrodite.css(styles$N.row)
25132
25143
  }, /*#__PURE__*/React__namespace.createElement("div", {
25133
- className: aphrodite.css(styles$O.columnLeft)
25144
+ className: aphrodite.css(styles$N.columnLeft)
25134
25145
  }, /*#__PURE__*/React__namespace.createElement("div", {
25135
- className: aphrodite.css(sticky && styles$O.sticky)
25146
+ className: aphrodite.css(sticky && styles$N.sticky)
25136
25147
  },
25137
25148
  /*#__PURE__*/
25138
25149
  // @ts-expect-error - TS2769 - No overload matches this call.
@@ -25140,9 +25151,9 @@ const ItemNodeContent = withStickiness(props => {
25140
25151
  onChange: newVal => actions.mergeValueAtPath(path, newVal),
25141
25152
  apiOptions: apiOptions
25142
25153
  })))), /*#__PURE__*/React__namespace.createElement("div", {
25143
- className: aphrodite.css(styles$O.columnRight)
25154
+ className: aphrodite.css(styles$N.columnRight)
25144
25155
  }, /*#__PURE__*/React__namespace.createElement("div", {
25145
- className: aphrodite.css(sticky && styles$O.sticky)
25156
+ className: aphrodite.css(sticky && styles$N.sticky)
25146
25157
  }, preview))));
25147
25158
  });
25148
25159
  const HintNodeContent = withStickiness(props => {
@@ -25158,13 +25169,13 @@ const HintNodeContent = withStickiness(props => {
25158
25169
  className: "framework-perseus"
25159
25170
  }, lens(renderers).get(path));
25160
25171
  return /*#__PURE__*/React__namespace.createElement("div", {
25161
- className: aphrodite.css(styles$O.row)
25172
+ className: aphrodite.css(styles$N.row)
25162
25173
  }, /*#__PURE__*/React__namespace.createElement("div", {
25163
- className: aphrodite.css(styles$O.columnLeft)
25174
+ className: aphrodite.css(styles$N.columnLeft)
25164
25175
  }, /*#__PURE__*/React__namespace.createElement("div", {
25165
- className: aphrodite.css(sticky && styles$O.sticky)
25176
+ className: aphrodite.css(sticky && styles$N.sticky)
25166
25177
  }, /*#__PURE__*/React__namespace.createElement(HintEditor, _extends({}, data, {
25167
- className: aphrodite.css(styles$O.hintEditor),
25178
+ className: aphrodite.css(styles$N.hintEditor),
25168
25179
  onChange: newVal => actions.mergeValueAtPath(path, newVal),
25169
25180
  apiOptions: apiOptions,
25170
25181
  showTitle: false,
@@ -25179,9 +25190,9 @@ const HintNodeContent = withStickiness(props => {
25179
25190
  isFirst: true,
25180
25191
  isLast: true
25181
25192
  })))), /*#__PURE__*/React__namespace.createElement("div", {
25182
- className: aphrodite.css(styles$O.columnRight)
25193
+ className: aphrodite.css(styles$N.columnRight)
25183
25194
  }, /*#__PURE__*/React__namespace.createElement("div", {
25184
- className: aphrodite.css(sticky && styles$O.sticky)
25195
+ className: aphrodite.css(sticky && styles$N.sticky)
25185
25196
  }, preview)));
25186
25197
  });
25187
25198
  const TagsNodeContent = props => {
@@ -25198,9 +25209,9 @@ const TagsNodeContent = props => {
25198
25209
  return null;
25199
25210
  }
25200
25211
  return /*#__PURE__*/React__namespace.createElement("div", {
25201
- className: aphrodite.css(styles$O.columnLeft)
25212
+ className: aphrodite.css(styles$N.columnLeft)
25202
25213
  }, /*#__PURE__*/React__namespace.createElement("div", {
25203
- className: aphrodite.css(styles$O.tagsEditor)
25214
+ className: aphrodite.css(styles$N.tagsEditor)
25204
25215
  }, /*#__PURE__*/React__namespace.createElement(GroupMetadataEditor, {
25205
25216
  value: data,
25206
25217
  onChange: newVal => actions.setValueAtPath(path, newVal),
@@ -25231,23 +25242,23 @@ const ArrayNodeContent = props => {
25231
25242
  const subpath = path.concat(i);
25232
25243
  const controls = [i > 0 && /*#__PURE__*/React__namespace.createElement("div", {
25233
25244
  key: "moveArrayElementUp",
25234
- className: aphrodite.css(styles$O.control)
25245
+ className: aphrodite.css(styles$N.control)
25235
25246
  }, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
25236
25247
  color: "orange",
25237
25248
  title: "Move up",
25238
25249
  onClick: () => actions.moveArrayElementUp(subpath)
25239
25250
  }, /*#__PURE__*/React__namespace.createElement("div", {
25240
- className: aphrodite.css(styles$O.verticalFlip)
25251
+ className: aphrodite.css(styles$N.verticalFlip)
25241
25252
  }, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconChevronDown)))), i < data.length - 1 && /*#__PURE__*/React__namespace.createElement("div", {
25242
25253
  key: "moveArrayElementDown",
25243
- className: aphrodite.css(styles$O.control)
25254
+ className: aphrodite.css(styles$N.control)
25244
25255
  }, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
25245
25256
  color: "orange",
25246
25257
  title: "Move down",
25247
25258
  onClick: () => actions.moveArrayElementDown(subpath)
25248
25259
  }, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconChevronDown))), /*#__PURE__*/React__namespace.createElement("div", {
25249
25260
  key: "removeArrayElement",
25250
- className: aphrodite.css(styles$O.control)
25261
+ className: aphrodite.css(styles$N.control)
25251
25262
  }, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
25252
25263
  color: "orange",
25253
25264
  title: "Delete",
@@ -25255,7 +25266,7 @@ const ArrayNodeContent = props => {
25255
25266
  }, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconTrash$4)))];
25256
25267
  return /*#__PURE__*/React__namespace.createElement("div", {
25257
25268
  key: i,
25258
- className: aphrodite.css(styles$O.arrayElement, !elementIsLeaf && styles$O.arrayElementAndNotLeaf)
25269
+ className: aphrodite.css(styles$N.arrayElement, !elementIsLeaf && styles$N.arrayElementAndNotLeaf)
25259
25270
  }, /*#__PURE__*/React__namespace.createElement(NodeContainer, _extends({}, otherProps, {
25260
25271
  key: i,
25261
25272
  shape: shape.elementShape,
@@ -25281,7 +25292,7 @@ const ObjectNodeContent = props => {
25281
25292
  // made sense to the shape's author is the order in which we'll iterate :)
25282
25293
  const children = Object.keys(shape.shape).map(subkey => /*#__PURE__*/React__namespace.createElement("div", {
25283
25294
  key: subkey,
25284
- className: aphrodite.css(styles$O.objectElement)
25295
+ className: aphrodite.css(styles$N.objectElement)
25285
25296
  }, /*#__PURE__*/React__namespace.createElement(NodeContainer, _extends({}, otherProps, {
25286
25297
  shape: shape.shape[subkey],
25287
25298
  data: data[subkey],
@@ -25451,7 +25462,7 @@ class MultiRendererEditor extends React__namespace.Component {
25451
25462
  }, this._renderContent());
25452
25463
  }
25453
25464
  }
25454
- const styles$O = aphrodite.StyleSheet.create({
25465
+ const styles$N = aphrodite.StyleSheet.create({
25455
25466
  // This is used in a number of places throughout this file.
25456
25467
  container: {},
25457
25468
  // eslint-disable-next-line react-native/no-unused-styles
@@ -26421,7 +26432,7 @@ const SortableItem = createReactClass__default["default"]({
26421
26432
  }
26422
26433
  return /*#__PURE__*/React__namespace.createElement("li", {
26423
26434
  draggable: this.props.draggable,
26424
- className: [dragState, aphrodite.css(styles$N.sortableListItem)].join(" "),
26435
+ className: [dragState, aphrodite.css(styles$M.sortableListItem)].join(" "),
26425
26436
  onDragStart: this.handleDragStart,
26426
26437
  onDrop: this.handleDrop,
26427
26438
  onDragEnter: this.handleDragEnter,
@@ -26429,7 +26440,7 @@ const SortableItem = createReactClass__default["default"]({
26429
26440
  }, this.props.component);
26430
26441
  }
26431
26442
  });
26432
- const styles$N = aphrodite.StyleSheet.create({
26443
+ const styles$M = aphrodite.StyleSheet.create({
26433
26444
  sortableListItem: {
26434
26445
  margin: "5px 0"
26435
26446
  }
@@ -26689,13 +26700,13 @@ class ExpressionEditor extends React__namespace.Component {
26689
26700
  onChange: this.handleToggleDiv
26690
26701
  }));
26691
26702
  return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.HeadingSmall, null, "Global Options"), /*#__PURE__*/React__namespace.createElement("div", {
26692
- className: aphrodite.css(styles$M.paddedY)
26703
+ className: aphrodite.css(styles$L.paddedY)
26693
26704
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.LabeledTextField, {
26694
26705
  label: "Visible label",
26695
26706
  value: this.props.visibleLabel || "",
26696
26707
  onChange: this.change("visibleLabel")
26697
26708
  }), /*#__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", {
26698
- className: aphrodite.css(styles$M.paddedY)
26709
+ className: aphrodite.css(styles$L.paddedY)
26699
26710
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.LabeledTextField, {
26700
26711
  label: "Aria label",
26701
26712
  value: this.props.ariaLabel || "",
@@ -26704,13 +26715,13 @@ class ExpressionEditor extends React__namespace.Component {
26704
26715
  href: "https://www.w3.org/WAI/tips/designing/#ensure-that-form-elements-include-clearly-associated-labels",
26705
26716
  target: "_blank"
26706
26717
  }, "this article.")))), /*#__PURE__*/React__namespace.createElement("div", {
26707
- className: aphrodite.css(styles$M.paddedY)
26718
+ className: aphrodite.css(styles$L.paddedY)
26708
26719
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.LabeledTextField, {
26709
26720
  label: "Function variables",
26710
26721
  value: this.state.functionsInternal,
26711
26722
  onChange: this.handleFunctions
26712
26723
  }), /*#__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", {
26713
- className: aphrodite.css(styles$M.paddedY)
26724
+ className: aphrodite.css(styles$L.paddedY)
26714
26725
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
26715
26726
  label: "Use \xD7 instead of \u22C5 for multiplication",
26716
26727
  checked: this.props.times,
@@ -26720,7 +26731,7 @@ class ExpressionEditor extends React__namespace.Component {
26720
26731
  });
26721
26732
  }
26722
26733
  }), /*#__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", {
26723
- className: aphrodite.css(styles$M.paddedY)
26734
+ className: aphrodite.css(styles$L.paddedY)
26724
26735
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.HeadingXSmall, null, "Button Sets"), buttonSetChoices), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.HeadingSmall, null, "Answers"), /*#__PURE__*/React__namespace.createElement("p", {
26725
26736
  style: {
26726
26737
  margin: "4px 0"
@@ -26787,18 +26798,18 @@ class AnswerOption extends React__namespace.Component {
26787
26798
  color: "destructive",
26788
26799
  light: true
26789
26800
  }, "Delete");
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);
26801
+ 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);
26791
26802
  return /*#__PURE__*/React__namespace.createElement("div", {
26792
- className: aphrodite.css(styles$M.answerOption)
26803
+ className: aphrodite.css(styles$L.answerOption)
26793
26804
  }, /*#__PURE__*/React__namespace.createElement("div", {
26794
- className: aphrodite.css(styles$M.answerHandle)
26805
+ className: aphrodite.css(styles$L.answerHandle)
26795
26806
  }), /*#__PURE__*/React__namespace.createElement("div", {
26796
- className: aphrodite.css(styles$M.answerBody)
26807
+ className: aphrodite.css(styles$L.answerBody)
26797
26808
  }, /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("button", {
26798
26809
  onClick: this.toggleConsidered,
26799
26810
  className: answerStatusCss
26800
26811
  }, this.props.considered), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement(perseus.Expression, this.props.expressionProps))), /*#__PURE__*/React__namespace.createElement("div", {
26801
- className: aphrodite.css(styles$M.paddedY, styles$M.paddedX)
26812
+ className: aphrodite.css(styles$L.paddedY, styles$L.paddedX)
26802
26813
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
26803
26814
  label: "Answer expression must have the same form.",
26804
26815
  checked: this.props.form,
@@ -26808,7 +26819,7 @@ class AnswerOption extends React__namespace.Component {
26808
26819
  });
26809
26820
  }
26810
26821
  }), /*#__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", {
26811
- className: aphrodite.css(styles$M.paddedY, styles$M.paddedX)
26822
+ className: aphrodite.css(styles$L.paddedY, styles$L.paddedX)
26812
26823
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
26813
26824
  label: "Answer expression must be fully expanded and simplified.",
26814
26825
  checked: this.props.simplify,
@@ -26818,11 +26829,11 @@ class AnswerOption extends React__namespace.Component {
26818
26829
  });
26819
26830
  }
26820
26831
  }), /*#__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", {
26821
- className: aphrodite.css(styles$M.buttonRow, styles$M.paddedY)
26832
+ className: aphrodite.css(styles$L.buttonRow, styles$L.paddedY)
26822
26833
  }, removeButton)));
26823
26834
  }
26824
26835
  }
26825
- const styles$M = aphrodite.StyleSheet.create({
26836
+ const styles$L = aphrodite.StyleSheet.create({
26826
26837
  paddedX: {
26827
26838
  paddingLeft: wonderBlocksTokens.spacing.xSmall_8,
26828
26839
  paddingRight: wonderBlocksTokens.spacing.xSmall_8
@@ -26934,10 +26945,10 @@ class GradedGroupEditor extends React__namespace.Component {
26934
26945
  }, /*#__PURE__*/React__namespace.createElement("div", {
26935
26946
  className: "perseus-widget-row"
26936
26947
  }, /*#__PURE__*/React__namespace.createElement("label", {
26937
- className: aphrodite.css(styles$L.title)
26948
+ className: aphrodite.css(styles$K.title)
26938
26949
  }, "Title:", " ", /*#__PURE__*/React__namespace.createElement(TextInput$5, {
26939
26950
  value: this.props.title,
26940
- className: aphrodite.css(styles$L.input)
26951
+ className: aphrodite.css(styles$K.input)
26941
26952
  // @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
26942
26953
  ,
26943
26954
  onChange: this.change("title")
@@ -26962,7 +26973,7 @@ class GradedGroupEditor extends React__namespace.Component {
26962
26973
  }, /*#__PURE__*/React__namespace.createElement(InlineIcon$4, iconPlus$1), " Add a hint"), this.props.hint && /*#__PURE__*/React__namespace.createElement("div", {
26963
26974
  className: "perseus-hint-editor"
26964
26975
  }, /*#__PURE__*/React__namespace.createElement("div", {
26965
- className: aphrodite.css(styles$L.hintsTitle)
26976
+ className: aphrodite.css(styles$K.hintsTitle)
26966
26977
  }, "Hint"), /*#__PURE__*/React__namespace.createElement(Editor, {
26967
26978
  ref: this.hintEditor,
26968
26979
  content: this.props.hint ? this.props.hint.content : "",
@@ -26984,7 +26995,7 @@ class GradedGroupEditor extends React__namespace.Component {
26984
26995
  }, /*#__PURE__*/React__namespace.createElement(InlineIcon$4, iconTrash$2), " Remove this hint")));
26985
26996
  }
26986
26997
  }
26987
- const styles$L = aphrodite.StyleSheet.create({
26998
+ const styles$K = aphrodite.StyleSheet.create({
26988
26999
  title: {
26989
27000
  fontSize: 18,
26990
27001
  fontWeight: "bold"
@@ -28475,13 +28486,13 @@ function MathquillInput(props) {
28475
28486
  }
28476
28487
  });
28477
28488
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
28478
- style: styles$K.outerWrapper
28489
+ style: styles$J.outerWrapper
28479
28490
  }, /*#__PURE__*/React__namespace.createElement("span", {
28480
28491
  ref: mathFieldWrapperRef,
28481
28492
  className: "perseus-math-input mq-editable-field mq-math-mode"
28482
28493
  }));
28483
28494
  }
28484
- const styles$K = aphrodite.StyleSheet.create({
28495
+ const styles$J = aphrodite.StyleSheet.create({
28485
28496
  outerWrapper: {
28486
28497
  display: "inline-block",
28487
28498
  borderStyle: "solid",
@@ -29610,7 +29621,7 @@ const GraphPointsCountSelector = _ref => {
29610
29621
  // Never uses placeholder, always has value
29611
29622
  ,
29612
29623
  placeholder: "",
29613
- style: styles$J.singleSelectShort
29624
+ style: styles$I.singleSelectShort
29614
29625
  }, [...[...Array(7).keys()].map(n => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
29615
29626
  key: n,
29616
29627
  value: `${n}`,
@@ -29621,7 +29632,7 @@ const GraphPointsCountSelector = _ref => {
29621
29632
  label: "unlimited"
29622
29633
  })]);
29623
29634
  };
29624
- const styles$J = aphrodite.StyleSheet.create({
29635
+ const styles$I = aphrodite.StyleSheet.create({
29625
29636
  singleSelectShort: {
29626
29637
  // Non-standard spacing, but it's the smallest we can go
29627
29638
  // without running into styling issues with the dropdown.
@@ -29634,7 +29645,7 @@ const GraphTypeSelector = props => {
29634
29645
  selectedValue: props.graphType,
29635
29646
  onChange: props.onChange,
29636
29647
  placeholder: "Select an answer type",
29637
- style: styles$I.singleSelectShort
29648
+ style: styles$H.singleSelectShort
29638
29649
  }, props.showNoneOption && /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
29639
29650
  value: "none",
29640
29651
  label: "None"
@@ -29670,7 +29681,7 @@ const GraphTypeSelector = props => {
29670
29681
  label: "Angle"
29671
29682
  }));
29672
29683
  };
29673
- const styles$I = aphrodite.StyleSheet.create({
29684
+ const styles$H = aphrodite.StyleSheet.create({
29674
29685
  singleSelectShort: {
29675
29686
  // Non-standard spacing, but it's the smallest we can go
29676
29687
  // without running into styling issues with the dropdown.
@@ -29686,11 +29697,11 @@ function Heading(_ref) {
29686
29697
  onToggle
29687
29698
  } = _ref;
29688
29699
  return /*#__PURE__*/React__namespace.createElement(Clickable__default["default"], {
29689
- style: [styles$H.container, !isCollapsible && styles$H.notClickable],
29700
+ style: [styles$G.container, !isCollapsible && styles$G.notClickable],
29690
29701
  disabled: !isCollapsible,
29691
29702
  onClick: () => isCollapsible && onToggle?.(!isOpen)
29692
29703
  }, () => /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
29693
- style: styles$H.heading
29704
+ style: styles$G.heading
29694
29705
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, {
29695
29706
  style: {
29696
29707
  fontSize: 14,
@@ -29700,7 +29711,7 @@ function Heading(_ref) {
29700
29711
  isExpanded: isOpen
29701
29712
  })));
29702
29713
  }
29703
- const styles$H = aphrodite.StyleSheet.create({
29714
+ const styles$G = aphrodite.StyleSheet.create({
29704
29715
  container: {
29705
29716
  marginTop: wonderBlocksTokens.spacing.small_12,
29706
29717
  // NOTE(jeremy): This is the inverse of the @editorPadding CSS
@@ -29760,7 +29771,7 @@ function InteractiveGraphDescription(props) {
29760
29771
  isOpen: isOpen,
29761
29772
  onToggle: setIsOpen
29762
29773
  }), isOpen && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelXSmall, {
29763
- style: styles$G.caption
29774
+ style: styles$F.caption
29764
29775
  }, "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, {
29765
29776
  tag: "label"
29766
29777
  }, "Title", /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
@@ -29768,7 +29779,7 @@ function InteractiveGraphDescription(props) {
29768
29779
  onChange: newValue => onChange({
29769
29780
  fullGraphAriaLabel: newValue
29770
29781
  }),
29771
- style: styles$G.spaceAbove
29782
+ style: styles$F.spaceAbove
29772
29783
  })), /*#__PURE__*/React__namespace.createElement(Strut, {
29773
29784
  size: wonderBlocksTokens.spacing.small_12
29774
29785
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, {
@@ -29780,10 +29791,10 @@ function InteractiveGraphDescription(props) {
29780
29791
  onChange: newValue => onChange({
29781
29792
  fullGraphAriaDescription: newValue
29782
29793
  }),
29783
- style: styles$G.spaceAbove
29794
+ style: styles$F.spaceAbove
29784
29795
  }))));
29785
29796
  }
29786
- const styles$G = aphrodite.StyleSheet.create({
29797
+ const styles$F = aphrodite.StyleSheet.create({
29787
29798
  caption: {
29788
29799
  color: wonderBlocksTokens.color.offBlack64,
29789
29800
  paddingTop: wonderBlocksTokens.spacing.xxSmall_6,
@@ -29803,16 +29814,16 @@ const LabeledRow = props => {
29803
29814
  style
29804
29815
  } = props;
29805
29816
  return /*#__PURE__*/React__namespace.createElement("label", {
29806
- className: aphrodite.css(styles$F.label)
29817
+ className: aphrodite.css(styles$E.label)
29807
29818
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
29808
- style: [styles$F.row, style]
29819
+ style: [styles$E.row, style]
29809
29820
  }, labelSide === "start" || /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelSmall, {
29810
- style: styles$F.spaceEnd
29821
+ style: styles$E.spaceEnd
29811
29822
  }, label), children, labelSide === "end" && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelSmall, {
29812
- style: styles$F.spaceStart
29823
+ style: styles$E.spaceStart
29813
29824
  }, label)));
29814
29825
  };
29815
- const styles$F = aphrodite.StyleSheet.create({
29826
+ const styles$E = aphrodite.StyleSheet.create({
29816
29827
  label: {
29817
29828
  width: "fit-content"
29818
29829
  },
@@ -30231,10 +30242,10 @@ class InteractiveGraphSettings extends React__namespace.Component {
30231
30242
  }
30232
30243
  }))), /*#__PURE__*/React__namespace.createElement(LabeledRow, {
30233
30244
  label: "Background image URL:",
30234
- style: styles$E.resetSpaceTop
30245
+ style: styles$D.resetSpaceTop
30235
30246
  }, /*#__PURE__*/React__namespace.createElement("input", {
30236
30247
  type: "text",
30237
- className: aphrodite.css(styles$E.backgroundUrlInput),
30248
+ className: aphrodite.css(styles$D.backgroundUrlInput),
30238
30249
  ref: this.bgUrlRef,
30239
30250
  value: this.state.backgroundImage.url || "",
30240
30251
  onChange: e => {
@@ -30250,9 +30261,9 @@ class InteractiveGraphSettings extends React__namespace.Component {
30250
30261
  onKeyPress: this.changeBackgroundUrl,
30251
30262
  onBlur: this.changeBackgroundUrl
30252
30263
  }), /*#__PURE__*/React__namespace.createElement(InfoTip$d, null, /*#__PURE__*/React__namespace.createElement("p", null, "Create an image in graphie, or use the \"Add image\" function to create a background."))), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30253
- style: styles$E.protractorSection
30264
+ style: styles$D.protractorSection
30254
30265
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30255
- style: styles$E.checkboxRow
30266
+ style: styles$D.checkboxRow
30256
30267
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
30257
30268
  label: "Show protractor",
30258
30269
  checked: this.props.showProtractor,
@@ -30261,7 +30272,7 @@ class InteractiveGraphSettings extends React__namespace.Component {
30261
30272
  showProtractor: value
30262
30273
  });
30263
30274
  },
30264
- style: styles$E.resetSpaceTop
30275
+ style: styles$D.resetSpaceTop
30265
30276
  })), this.props.showProtractor && /*#__PURE__*/React__namespace.createElement(Banner__default["default"], {
30266
30277
  layout: "floating",
30267
30278
  text: "The protractor is not accessible. Please consider an alternate approach.",
@@ -30269,7 +30280,7 @@ class InteractiveGraphSettings extends React__namespace.Component {
30269
30280
  }))));
30270
30281
  }
30271
30282
  }
30272
- const styles$E = aphrodite.StyleSheet.create({
30283
+ const styles$D = aphrodite.StyleSheet.create({
30273
30284
  resetSpaceTop: {
30274
30285
  marginTop: 0
30275
30286
  },
@@ -30308,14 +30319,14 @@ const SegmentCountSelector = _ref => {
30308
30319
  const num = +newValue;
30309
30320
  onChange(num);
30310
30321
  },
30311
- style: styles$D.singleSelectShort
30322
+ style: styles$C.singleSelectShort
30312
30323
  }, ___default["default"].range(1, 7).map(n => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
30313
30324
  key: n,
30314
30325
  value: `${n}`,
30315
30326
  label: `${n} segment${n > 1 ? "s" : ""}`
30316
30327
  })));
30317
30328
  };
30318
- const styles$D = aphrodite.StyleSheet.create({
30329
+ const styles$C = aphrodite.StyleSheet.create({
30319
30330
  singleSelectShort: {
30320
30331
  // Non-standard spacing, but it's the smallest we can go
30321
30332
  // without running into styling issues with the dropdown.
@@ -30340,17 +30351,17 @@ const LockedFigureSelect = props => {
30340
30351
  figureTypes.push("label");
30341
30352
  }
30342
30353
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30343
- style: styles$C.container
30354
+ style: styles$B.container
30344
30355
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.ActionMenu, {
30345
30356
  menuText: "Add locked figure",
30346
- style: styles$C.addElementSelect
30357
+ style: styles$B.addElementSelect
30347
30358
  }, figureTypes.map(figureType => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.ActionItem, {
30348
30359
  key: `${id}-${figureType}`,
30349
30360
  label: figureType,
30350
30361
  onClick: () => onChange(figureType)
30351
30362
  }))));
30352
30363
  };
30353
- const styles$C = aphrodite.StyleSheet.create({
30364
+ const styles$B = aphrodite.StyleSheet.create({
30354
30365
  container: {
30355
30366
  marginTop: wonderBlocksTokens.spacing.xSmall_8
30356
30367
  },
@@ -30467,18 +30478,18 @@ const AngleInput = props => {
30467
30478
  }
30468
30479
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30469
30480
  tag: "label",
30470
- style: styles$B.row
30481
+ style: styles$A.row
30471
30482
  }, "angle (degrees)", /*#__PURE__*/React__namespace.createElement(Strut, {
30472
30483
  size: wonderBlocksTokens.spacing.xxSmall_6
30473
30484
  }), /*#__PURE__*/React__namespace.createElement(ScrolllessNumberTextField, {
30474
30485
  value: angleInput,
30475
30486
  onChange: handleAngleChange,
30476
- style: styles$B.textField
30487
+ style: styles$A.textField
30477
30488
  }), /*#__PURE__*/React__namespace.createElement(Strut, {
30478
30489
  size: wonderBlocksTokens.spacing.xxSmall_6
30479
30490
  }));
30480
30491
  };
30481
- const styles$B = aphrodite.StyleSheet.create({
30492
+ const styles$A = aphrodite.StyleSheet.create({
30482
30493
  row: {
30483
30494
  display: "flex",
30484
30495
  flexDirection: "row",
@@ -30527,30 +30538,30 @@ const CoordinatePairInput = props => {
30527
30538
  onChange(newCoords);
30528
30539
  }
30529
30540
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30530
- style: [styles$A.row, style]
30541
+ style: [styles$z.row, style]
30531
30542
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30532
30543
  tag: "label",
30533
- style: styles$A.row
30544
+ style: styles$z.row
30534
30545
  }, labels ? labels[0] : "x coord", /*#__PURE__*/React__namespace.createElement(Strut, {
30535
30546
  size: wonderBlocksTokens.spacing.xxSmall_6
30536
30547
  }), /*#__PURE__*/React__namespace.createElement(ScrolllessNumberTextField, {
30537
30548
  value: coordState[0],
30538
30549
  onChange: newValue => handleCoordChange(newValue, 0),
30539
- style: [styles$A.textField, error ? styles$A.errorField : undefined]
30550
+ style: [styles$z.textField, error ? styles$z.errorField : undefined]
30540
30551
  })), /*#__PURE__*/React__namespace.createElement(Strut, {
30541
30552
  size: wonderBlocksTokens.spacing.medium_16
30542
30553
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30543
30554
  tag: "label",
30544
- style: styles$A.row
30555
+ style: styles$z.row
30545
30556
  }, labels ? labels[1] : "y coord", /*#__PURE__*/React__namespace.createElement(Strut, {
30546
30557
  size: wonderBlocksTokens.spacing.xxSmall_6
30547
30558
  }), /*#__PURE__*/React__namespace.createElement(ScrolllessNumberTextField, {
30548
30559
  value: coordState[1],
30549
30560
  onChange: newValue => handleCoordChange(newValue, 1),
30550
- style: [styles$A.textField, error ? styles$A.errorField : undefined]
30561
+ style: [styles$z.textField, error ? styles$z.errorField : undefined]
30551
30562
  })));
30552
30563
  };
30553
- const styles$A = aphrodite.StyleSheet.create({
30564
+ const styles$z = aphrodite.StyleSheet.create({
30554
30565
  row: {
30555
30566
  display: "flex",
30556
30567
  flexDirection: "row",
@@ -30583,14 +30594,14 @@ const PerseusEditorAccordion = props => {
30583
30594
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksAccordion.AccordionSection, {
30584
30595
  expanded: expanded,
30585
30596
  onToggle: onToggle,
30586
- style: [styles$z.container, containerStyle],
30587
- headerStyle: styles$z.accordionHeader,
30597
+ style: [styles$y.container, containerStyle],
30598
+ headerStyle: styles$y.accordionHeader,
30588
30599
  header: header
30589
30600
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30590
- style: [styles$z.accordionPanel, panelStyle]
30601
+ style: [styles$y.accordionPanel, panelStyle]
30591
30602
  }, children)));
30592
30603
  };
30593
- const styles$z = aphrodite.StyleSheet.create({
30604
+ const styles$y = aphrodite.StyleSheet.create({
30594
30605
  container: {
30595
30606
  backgroundColor: wonderBlocksTokens.color.fadedBlue8,
30596
30607
  marginTop: wonderBlocksTokens.spacing.xSmall_8
@@ -30621,13 +30632,13 @@ const ColorSwatch = props => {
30621
30632
  "aria-label":
30622
30633
  // Don't include an aria label for decorative circles.
30623
30634
  !decorative ? `${color}, ${filled ? "filled" : "open"}` : undefined,
30624
- style: [styles$y.colorSwatch, {
30635
+ style: [styles$x.colorSwatch, {
30625
30636
  border: `4px solid ${perseus.lockedFigureColors[color]}`,
30626
30637
  backgroundColor: filled ? perseus.lockedFigureColors[color] : wonderBlocksTokens.color.white
30627
30638
  }]
30628
30639
  });
30629
30640
  };
30630
- const styles$y = aphrodite.StyleSheet.create({
30641
+ const styles$x = aphrodite.StyleSheet.create({
30631
30642
  colorSwatch: {
30632
30643
  // Add a white outline so that the color swatch is visible when
30633
30644
  // the dropdown option is highlighted with its blue background.
@@ -30646,10 +30657,10 @@ const ColorSelect = props => {
30646
30657
  onChange
30647
30658
  } = props;
30648
30659
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30649
- style: [styles$x.row, style]
30660
+ style: [styles$w.row, style]
30650
30661
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30651
30662
  tag: "label",
30652
- style: styles$x.row
30663
+ style: styles$w.row
30653
30664
  }, "color", /*#__PURE__*/React__namespace.createElement(Strut, {
30654
30665
  size: wonderBlocksTokens.spacing.xxSmall_6
30655
30666
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
@@ -30668,7 +30679,7 @@ const ColorSelect = props => {
30668
30679
  })
30669
30680
  })))));
30670
30681
  };
30671
- const styles$x = aphrodite.StyleSheet.create({
30682
+ const styles$w = aphrodite.StyleSheet.create({
30672
30683
  row: {
30673
30684
  display: "flex",
30674
30685
  flexDirection: "row",
@@ -30687,17 +30698,17 @@ const EllipseSwatch = props => {
30687
30698
  } = props;
30688
30699
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30689
30700
  "aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
30690
- style: [styles$w.container, {
30701
+ style: [styles$v.container, {
30691
30702
  border: `4px ${strokeStyle} ${perseus.lockedFigureColors[color]}`
30692
30703
  }]
30693
30704
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30694
- style: [styles$w.innerCircle, {
30705
+ style: [styles$v.innerCircle, {
30695
30706
  backgroundColor: perseus.lockedFigureColors[color],
30696
30707
  opacity: fillStyle === "white" ? 0 : perseus.lockedFigureFillStyles[fillStyle]
30697
30708
  }]
30698
30709
  }));
30699
30710
  };
30700
- const styles$w = aphrodite.StyleSheet.create({
30711
+ const styles$v = aphrodite.StyleSheet.create({
30701
30712
  container: {
30702
30713
  // Add a white outline so that the color swatch is visible when
30703
30714
  // the dropdown option is highlighted with its blue background.
@@ -30723,7 +30734,7 @@ const LineStrokeSelect = props => {
30723
30734
  } = props;
30724
30735
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30725
30736
  tag: "label",
30726
- style: styles$v.lineStrokeSelect
30737
+ style: styles$u.lineStrokeSelect
30727
30738
  }, "stroke", /*#__PURE__*/React__namespace.createElement(Strut, {
30728
30739
  size: wonderBlocksTokens.spacing.xxxSmall_4
30729
30740
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
@@ -30740,7 +30751,7 @@ const LineStrokeSelect = props => {
30740
30751
  label: "dashed"
30741
30752
  })));
30742
30753
  };
30743
- const styles$v = aphrodite.StyleSheet.create({
30754
+ const styles$u = aphrodite.StyleSheet.create({
30744
30755
  lineStrokeSelect: {
30745
30756
  display: "flex",
30746
30757
  flexDirection: "row",
@@ -30762,40 +30773,40 @@ const LockedFigureSettingsActions = props => {
30762
30773
  onRemove
30763
30774
  } = props;
30764
30775
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30765
- style: styles$u.container
30776
+ style: styles$t.container
30766
30777
  }, /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
30767
30778
  startIcon: trashIcon__default["default"],
30768
30779
  "aria-label": `Delete locked ${figureType}`,
30769
30780
  onClick: onRemove,
30770
30781
  kind: "tertiary",
30771
- style: styles$u.deleteButton
30772
- }, "Delete"), /*#__PURE__*/React__namespace.createElement(Spring, null), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
30782
+ style: styles$t.deleteButton
30783
+ }, "Delete"), onMove && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Spring, null), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
30773
30784
  icon: caretDoubleUpIcon__default["default"],
30774
30785
  size: "small",
30775
30786
  "aria-label": `Move locked ${figureType} to the back`,
30776
30787
  onClick: () => onMove("back"),
30777
- style: styles$u.iconButton
30788
+ style: styles$t.iconButton
30778
30789
  }), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
30779
30790
  icon: caretUpIcon__default["default"],
30780
30791
  size: "small",
30781
30792
  "aria-label": `Move locked ${figureType} backward`,
30782
30793
  onClick: () => onMove("backward"),
30783
- style: styles$u.iconButton
30794
+ style: styles$t.iconButton
30784
30795
  }), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
30785
30796
  icon: caretDownIcon__default["default"],
30786
30797
  size: "small",
30787
30798
  "aria-label": `Move locked ${figureType} forward`,
30788
30799
  onClick: () => onMove("forward"),
30789
- style: styles$u.iconButton
30800
+ style: styles$t.iconButton
30790
30801
  }), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
30791
30802
  icon: caretDoubleDownIcon__default["default"],
30792
30803
  size: "small",
30793
30804
  "aria-label": `Move locked ${figureType} to the front`,
30794
30805
  onClick: () => onMove("front"),
30795
- style: styles$u.iconButton
30796
- }));
30806
+ style: styles$t.iconButton
30807
+ })));
30797
30808
  };
30798
- const styles$u = aphrodite.StyleSheet.create({
30809
+ const styles$t = aphrodite.StyleSheet.create({
30799
30810
  container: {
30800
30811
  width: "100%",
30801
30812
  flexDirection: "row",
@@ -30842,7 +30853,7 @@ const LockedEllipseSettings = props => {
30842
30853
  /*#__PURE__*/
30843
30854
  // Summary: Ellipse, center, radius, color (opacity, dashed)
30844
30855
  React__namespace.createElement(wonderBlocksCore.View, {
30845
- style: styles$t.row
30856
+ style: styles$s.row
30846
30857
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Ellipse (${center[0]}, ${center[1]}), radius ${radius[0]}, ${radius[1]}`), /*#__PURE__*/React__namespace.createElement(Strut, {
30847
30858
  size: wonderBlocksTokens.spacing.xSmall_8
30848
30859
  }), /*#__PURE__*/React__namespace.createElement(EllipseSwatch, {
@@ -30851,19 +30862,19 @@ const LockedEllipseSettings = props => {
30851
30862
  strokeStyle: strokeStyle
30852
30863
  }))
30853
30864
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30854
- style: styles$t.row
30865
+ style: styles$s.row
30855
30866
  }, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
30856
30867
  coord: center,
30857
- style: styles$t.spaceUnder,
30868
+ style: styles$s.spaceUnder,
30858
30869
  onChange: newCoords => onChangeProps({
30859
30870
  center: newCoords
30860
30871
  })
30861
30872
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30862
- style: styles$t.spaceUnder
30873
+ style: styles$s.spaceUnder
30863
30874
  }, /*#__PURE__*/React__namespace.createElement(InfoTip$c, null, "The coordinates for the center of the ellipse."))), /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
30864
30875
  coord: radius,
30865
30876
  labels: ["x radius", "y radius"],
30866
- style: styles$t.spaceUnder,
30877
+ style: styles$s.spaceUnder,
30867
30878
  onChange: newCoords => onChangeProps({
30868
30879
  radius: newCoords
30869
30880
  })
@@ -30875,7 +30886,7 @@ const LockedEllipseSettings = props => {
30875
30886
  }), /*#__PURE__*/React__namespace.createElement(Strut, {
30876
30887
  size: wonderBlocksTokens.spacing.xSmall_8
30877
30888
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30878
- style: [styles$t.row, styles$t.spaceUnder]
30889
+ style: [styles$s.row, styles$s.spaceUnder]
30879
30890
  }, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
30880
30891
  selectedValue: color,
30881
30892
  onChange: handleColorChange
@@ -30883,7 +30894,7 @@ const LockedEllipseSettings = props => {
30883
30894
  size: wonderBlocksTokens.spacing.medium_16
30884
30895
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30885
30896
  tag: "label",
30886
- style: [styles$t.row, styles$t.truncatedWidth]
30897
+ style: [styles$s.row, styles$s.truncatedWidth]
30887
30898
  }, "fill", /*#__PURE__*/React__namespace.createElement(Strut, {
30888
30899
  size: wonderBlocksTokens.spacing.xxSmall_6
30889
30900
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
@@ -30909,7 +30920,7 @@ const LockedEllipseSettings = props => {
30909
30920
  onRemove: onRemove
30910
30921
  }));
30911
30922
  };
30912
- const styles$t = aphrodite.StyleSheet.create({
30923
+ const styles$s = aphrodite.StyleSheet.create({
30913
30924
  row: {
30914
30925
  display: "flex",
30915
30926
  flexDirection: "row",
@@ -30930,15 +30941,15 @@ const LineSwatch = props => {
30930
30941
  lineStyle
30931
30942
  } = props;
30932
30943
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30933
- style: styles$s.container
30944
+ style: styles$r.container
30934
30945
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30935
30946
  "aria-label": `${color}, ${lineStyle}`,
30936
- style: [styles$s.lineSwatch, {
30947
+ style: [styles$r.lineSwatch, {
30937
30948
  border: `5px ${lineStyle} ${perseus.lockedFigureColors[color]}`
30938
30949
  }]
30939
30950
  }));
30940
30951
  };
30941
- const styles$s = aphrodite.StyleSheet.create({
30952
+ const styles$r = aphrodite.StyleSheet.create({
30942
30953
  container: {
30943
30954
  backgroundColor: wonderBlocksTokens.color.white,
30944
30955
  justifyContent: "center",
@@ -31023,9 +31034,9 @@ const LockedFunctionSettings = props => {
31023
31034
  expanded: props.expanded,
31024
31035
  onToggle: props.onToggle,
31025
31036
  header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31026
- style: styles$r.row
31037
+ style: styles$q.row
31027
31038
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, {
31028
- style: styles$r.accordionHeader
31039
+ style: styles$q.accordionHeader
31029
31040
  }, lineLabel), /*#__PURE__*/React__namespace.createElement(Strut, {
31030
31041
  size: wonderBlocksTokens.spacing.xSmall_8
31031
31042
  }), /*#__PURE__*/React__namespace.createElement(LineSwatch, {
@@ -31033,7 +31044,7 @@ const LockedFunctionSettings = props => {
31033
31044
  lineStyle: strokeStyle
31034
31045
  }))
31035
31046
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31036
- style: [styles$r.row, styles$r.spaceUnder]
31047
+ style: [styles$q.row, styles$q.spaceUnder]
31037
31048
  }, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
31038
31049
  selectedValue: lineColor,
31039
31050
  onChange: newValue => {
@@ -31047,14 +31058,14 @@ const LockedFunctionSettings = props => {
31047
31058
  handlePropChange("strokeStyle", newValue);
31048
31059
  }
31049
31060
  })), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31050
- style: [styles$r.row, styles$r.rowSpace]
31061
+ style: [styles$q.row, styles$q.rowSpace]
31051
31062
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
31052
31063
  selectedValue: directionalAxis,
31053
31064
  onChange: newValue => {
31054
31065
  handlePropChange("directionalAxis", newValue);
31055
31066
  },
31056
31067
  "aria-label": "equation prefix",
31057
- style: [styles$r.dropdownLabel, styles$r.axisMenu]
31068
+ style: [styles$q.dropdownLabel, styles$q.axisMenu]
31058
31069
  // Placeholder is required, but never gets used.
31059
31070
  ,
31060
31071
  placeholder: ""
@@ -31073,17 +31084,17 @@ const LockedFunctionSettings = props => {
31073
31084
  onChange: newValue => {
31074
31085
  handlePropChange("equation", newValue);
31075
31086
  },
31076
- style: [styles$r.textField]
31087
+ style: [styles$q.textField]
31077
31088
  })), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31078
- style: [styles$r.row, styles$r.rowSpace]
31089
+ style: [styles$q.row, styles$q.rowSpace]
31079
31090
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
31080
31091
  tag: "label",
31081
- style: [styles$r.dropdownLabel, styles$r.domainMin]
31092
+ style: [styles$q.dropdownLabel, styles$q.domainMin]
31082
31093
  }, `${domainRangeText} min`, /*#__PURE__*/React__namespace.createElement(Strut, {
31083
31094
  size: wonderBlocksTokens.spacing.xxSmall_6
31084
31095
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
31085
31096
  type: "number",
31086
- style: styles$r.domainMinField,
31097
+ style: styles$q.domainMinField,
31087
31098
  value: domainEntries[0],
31088
31099
  onChange: newValue => {
31089
31100
  handleDomainChange(0, newValue);
@@ -31093,12 +31104,12 @@ const LockedFunctionSettings = props => {
31093
31104
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
31094
31105
  tag: "label",
31095
31106
  "aria-label": `${domainRangeText} max`,
31096
- style: [styles$r.dropdownLabel, styles$r.domainMax]
31107
+ style: [styles$q.dropdownLabel, styles$q.domainMax]
31097
31108
  }, "max", /*#__PURE__*/React__namespace.createElement(Strut, {
31098
31109
  size: wonderBlocksTokens.spacing.xxSmall_6
31099
31110
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
31100
31111
  type: "number",
31101
- style: styles$r.domainMaxField,
31112
+ style: styles$q.domainMaxField,
31102
31113
  value: domainEntries[1],
31103
31114
  onChange: newValue => {
31104
31115
  handleDomainChange(1, newValue);
@@ -31106,11 +31117,11 @@ const LockedFunctionSettings = props => {
31106
31117
  }))), /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
31107
31118
  header: /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Example Functions"),
31108
31119
  expanded: false,
31109
- containerStyle: styles$r.exampleWorkspace,
31110
- panelStyle: styles$r.exampleAccordionPanel
31120
+ containerStyle: styles$q.exampleWorkspace,
31121
+ panelStyle: styles$q.exampleAccordionPanel
31111
31122
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
31112
31123
  tag: "label",
31113
- style: styles$r.dropdownLabel
31124
+ style: styles$q.dropdownLabel
31114
31125
  }, "Choose a category", /*#__PURE__*/React__namespace.createElement(Strut, {
31115
31126
  size: wonderBlocksTokens.spacing.xxSmall_6
31116
31127
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
@@ -31124,7 +31135,7 @@ const LockedFunctionSettings = props => {
31124
31135
  label: category
31125
31136
  });
31126
31137
  }))), exampleCategorySelected && /*#__PURE__*/React__namespace.createElement("ul", {
31127
- className: aphrodite.css(styles$r.exampleContainer)
31138
+ className: aphrodite.css(styles$q.exampleContainer)
31128
31139
  }, exampleContent.map((example, index) => /*#__PURE__*/React__namespace.createElement(ExampleItem, {
31129
31140
  category: exampleCategory,
31130
31141
  example: example,
@@ -31146,29 +31157,29 @@ const ExampleItem = props => {
31146
31157
  const exampleId = React.useId();
31147
31158
  return /*#__PURE__*/React__namespace.createElement("li", {
31148
31159
  key: `${category}-${index}`,
31149
- className: aphrodite.css(styles$r.exampleRow)
31160
+ className: aphrodite.css(styles$q.exampleRow)
31150
31161
  }, /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
31151
31162
  icon: autoPasteIcon__default["default"],
31152
31163
  "aria-label": "paste example",
31153
31164
  "aria-describedby": exampleId,
31154
31165
  onClick: () => pasteEquationFn("equation", example),
31155
31166
  size: "medium",
31156
- style: styles$r.copyPasteButton
31167
+ style: styles$q.copyPasteButton
31157
31168
  }), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
31158
31169
  icon: copyIcon__default["default"],
31159
31170
  "aria-label": "copy example",
31160
31171
  "aria-describedby": exampleId,
31161
31172
  onClick: () => navigator.clipboard.writeText(example),
31162
31173
  size: "medium",
31163
- style: styles$r.copyPasteButton
31174
+ style: styles$q.copyPasteButton
31164
31175
  }), /*#__PURE__*/React__namespace.createElement(Strut, {
31165
31176
  size: wonderBlocksTokens.spacing.xxxSmall_4
31166
31177
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31167
- style: styles$r.exampleContent,
31178
+ style: styles$q.exampleContent,
31168
31179
  id: exampleId
31169
31180
  }, example));
31170
31181
  };
31171
- const styles$r = aphrodite.StyleSheet.create({
31182
+ const styles$q = aphrodite.StyleSheet.create({
31172
31183
  accordionHeader: {
31173
31184
  textOverflow: "ellipsis",
31174
31185
  // A maximum width needs to be specified in order for the ellipsis to work.
@@ -31280,21 +31291,23 @@ function LockedLabelSettings(props) {
31280
31291
  onChangeProps,
31281
31292
  onMove,
31282
31293
  onRemove,
31283
- onToggle
31294
+ onToggle,
31295
+ containerStyle
31284
31296
  } = props;
31285
31297
  return /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
31286
31298
  expanded: expanded,
31287
31299
  onToggle: onToggle,
31288
31300
  header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31289
- style: [styles$q.row, styles$q.accordionHeaderContainer]
31301
+ style: [styles$p.row, styles$p.accordionHeaderContainer]
31290
31302
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, "Label (", coord[0], ", ", coord[1], ")"), /*#__PURE__*/React__namespace.createElement(Strut, {
31291
31303
  size: wonderBlocksTokens.spacing.xSmall_8
31292
31304
  }), text !== "" && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, {
31293
31305
  style: [{
31294
31306
  backgroundColor: wonderBlocksTokens.color.white,
31295
31307
  color: perseus.lockedFigureColors[color]
31296
- }, styles$q.accordionHeader]
31297
- }, text))
31308
+ }, styles$p.accordionHeader]
31309
+ }, text)),
31310
+ containerStyle: containerStyle
31298
31311
  }, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
31299
31312
  coord: coord,
31300
31313
  onChange: newCoords => {
@@ -31302,10 +31315,10 @@ function LockedLabelSettings(props) {
31302
31315
  coord: newCoords
31303
31316
  });
31304
31317
  },
31305
- style: styles$q.spaceUnder
31318
+ style: styles$p.spaceUnder
31306
31319
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
31307
31320
  tag: "label",
31308
- style: [styles$q.row, styles$q.spaceUnder]
31321
+ style: [styles$p.row, styles$p.spaceUnder]
31309
31322
  }, "TeX", /*#__PURE__*/React__namespace.createElement(Strut, {
31310
31323
  size: wonderBlocksTokens.spacing.xSmall_8
31311
31324
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
@@ -31315,20 +31328,20 @@ function LockedLabelSettings(props) {
31315
31328
  text: newValue
31316
31329
  })
31317
31330
  })), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31318
- style: styles$q.row
31319
- }, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
31331
+ style: styles$p.row
31332
+ }, onMove && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
31320
31333
  selectedValue: color,
31321
31334
  onChange: newColor => {
31322
31335
  onChangeProps({
31323
31336
  color: newColor
31324
31337
  });
31325
31338
  },
31326
- style: styles$q.spaceUnder
31339
+ style: styles$p.spaceUnder
31327
31340
  }), /*#__PURE__*/React__namespace.createElement(Strut, {
31328
31341
  size: wonderBlocksTokens.spacing.medium_16
31329
- }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
31342
+ })), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
31330
31343
  tag: "label",
31331
- style: styles$q.row
31344
+ style: styles$p.row
31332
31345
  }, "size", /*#__PURE__*/React__namespace.createElement(Strut, {
31333
31346
  size: wonderBlocksTokens.spacing.xSmall_8
31334
31347
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
@@ -31355,7 +31368,7 @@ function LockedLabelSettings(props) {
31355
31368
  onRemove: onRemove
31356
31369
  }));
31357
31370
  }
31358
- const styles$q = aphrodite.StyleSheet.create({
31371
+ const styles$p = aphrodite.StyleSheet.create({
31359
31372
  accordionHeaderContainer: {
31360
31373
  // Stop the label summary from wrapping.
31361
31374
  whiteSpace: "nowrap"
@@ -31389,7 +31402,7 @@ const LabeledSwitch = props => {
31389
31402
  const ids = wonderBlocksCore.useUniqueIdWithMock();
31390
31403
  const switchId = ids.get("switch");
31391
31404
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31392
- style: [styles$p.row, style]
31405
+ style: [styles$o.row, style]
31393
31406
  }, /*#__PURE__*/React__namespace.createElement(Switch__default["default"], {
31394
31407
  id: switchId,
31395
31408
  checked: checked,
@@ -31401,71 +31414,173 @@ const LabeledSwitch = props => {
31401
31414
  htmlFor: switchId
31402
31415
  }, label));
31403
31416
  };
31404
- const styles$p = aphrodite.StyleSheet.create({
31417
+ const styles$o = aphrodite.StyleSheet.create({
31405
31418
  row: {
31406
31419
  flexDirection: "row",
31407
31420
  alignItems: "center"
31408
31421
  }
31409
31422
  });
31410
31423
 
31411
- /**
31412
- * DefiningPointSettings is a component that allows the user to edit the
31413
- * settings of a point that defines a locked figure (ex. line) on the graph.
31414
- *
31415
- * Used in the interactive graph editor's locked figures section.
31416
- */
31417
- const DefiningPointSettings = props => {
31424
+ const DEFAULT_COLOR = "grayH";
31425
+ function getDefaultFigureForType(type) {
31426
+ switch (type) {
31427
+ case "point":
31428
+ return {
31429
+ type: "point",
31430
+ coord: [0, 0],
31431
+ color: DEFAULT_COLOR,
31432
+ filled: true,
31433
+ labels: []
31434
+ };
31435
+ case "line":
31436
+ return {
31437
+ type: "line",
31438
+ kind: "line",
31439
+ points: [getDefaultFigureForType("point"), {
31440
+ ...getDefaultFigureForType("point"),
31441
+ coord: [2, 2]
31442
+ }],
31443
+ color: DEFAULT_COLOR,
31444
+ lineStyle: "solid",
31445
+ showPoint1: false,
31446
+ showPoint2: false,
31447
+ labels: []
31448
+ };
31449
+ case "vector":
31450
+ return {
31451
+ type: "vector",
31452
+ points: [[0, 0], [2, 2]],
31453
+ color: DEFAULT_COLOR
31454
+ };
31455
+ case "ellipse":
31456
+ return {
31457
+ type: "ellipse",
31458
+ center: [0, 0],
31459
+ radius: [1, 1],
31460
+ angle: 0,
31461
+ color: DEFAULT_COLOR,
31462
+ fillStyle: "none",
31463
+ strokeStyle: "solid"
31464
+ };
31465
+ case "polygon":
31466
+ return {
31467
+ type: "polygon",
31468
+ points: [[0, 2], [-1, 0], [1, 0]],
31469
+ color: DEFAULT_COLOR,
31470
+ showVertices: false,
31471
+ fillStyle: "none",
31472
+ strokeStyle: "solid"
31473
+ };
31474
+ case "function":
31475
+ return {
31476
+ type: "function",
31477
+ color: DEFAULT_COLOR,
31478
+ strokeStyle: "solid",
31479
+ equation: "x^2",
31480
+ directionalAxis: "x"
31481
+ };
31482
+ case "label":
31483
+ return {
31484
+ type: "label",
31485
+ coord: [0, 0],
31486
+ text: "",
31487
+ color: DEFAULT_COLOR,
31488
+ size: "medium"
31489
+ };
31490
+ default:
31491
+ throw new wonderStuffCore.UnreachableCaseError(type);
31492
+ }
31493
+ }
31494
+
31495
+ const LockedPointSettings = props => {
31418
31496
  const {
31497
+ flags,
31498
+ headerLabel,
31419
31499
  coord,
31420
31500
  color: pointColor,
31421
31501
  filled = true,
31422
- label,
31423
- showPoint = "false",
31424
- error,
31502
+ labels,
31425
31503
  onChangeProps,
31426
- onTogglePoint,
31504
+ onMove,
31505
+ onRemove,
31506
+ // defining point props
31507
+ showPoint,
31427
31508
  expanded,
31509
+ onTogglePoint,
31428
31510
  onToggle
31429
31511
  } = props;
31512
+ const isDefiningPoint = !onMove && !onRemove;
31430
31513
  function handleColorChange(newValue) {
31431
- onChangeProps({
31514
+ const newProps = {
31515
+ color: newValue
31516
+ };
31517
+
31518
+ // Update the color of the all labels to match the point
31519
+ newProps.labels = labels.map(label => ({
31520
+ ...label,
31432
31521
  color: newValue
31522
+ }));
31523
+ onChangeProps(newProps);
31524
+ }
31525
+ function handleCoordChange(newCoord) {
31526
+ const xOffset = newCoord[0] - coord[0];
31527
+ const yOffset = newCoord[1] - coord[1];
31528
+ const newProps = {
31529
+ coord: newCoord
31530
+ };
31531
+
31532
+ // Update the coord by the same amount as the point for all labels
31533
+ newProps.labels = labels.map(label => ({
31534
+ ...label,
31535
+ coord: [label.coord[0] + xOffset, label.coord[1] + yOffset]
31536
+ }));
31537
+ onChangeProps(newProps);
31538
+ }
31539
+ function handleLabelChange(updatedLabel, labelIndex) {
31540
+ const updatedLabels = [...labels];
31541
+ updatedLabels[labelIndex] = {
31542
+ ...labels[labelIndex],
31543
+ ...updatedLabel
31544
+ };
31545
+ onChangeProps({
31546
+ labels: updatedLabels
31547
+ });
31548
+ }
31549
+ function handleLabelRemove(labelIndex) {
31550
+ const updatedLabels = labels.filter((_, index) => index !== labelIndex);
31551
+ onChangeProps({
31552
+ labels: updatedLabels
31433
31553
  });
31434
31554
  }
31435
31555
  return /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
31436
31556
  expanded: expanded,
31437
31557
  onToggle: onToggle,
31438
- containerStyle: styles$o.container,
31439
- panelStyle: styles$o.accordionPanel,
31558
+ containerStyle: isDefiningPoint ? styles$n.definingContainer : undefined,
31559
+ panelStyle: isDefiningPoint ? styles$n.definingPanel : undefined,
31440
31560
  header:
31441
31561
  /*#__PURE__*/
31442
31562
  // Summary: Point, coords, color (filled/open)
31443
31563
  React__namespace.createElement(wonderBlocksCore.View, {
31444
- style: styles$o.row
31445
- }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `${label || "Point"} (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React__namespace.createElement(Strut, {
31564
+ style: styles$n.row
31565
+ }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `${headerLabel || "Point"} (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React__namespace.createElement(Strut, {
31446
31566
  size: wonderBlocksTokens.spacing.xSmall_8
31447
- }), showPoint && /*#__PURE__*/React__namespace.createElement(ColorSwatch, {
31567
+ }), /*#__PURE__*/React__namespace.createElement(ColorSwatch, {
31448
31568
  color: pointColor,
31449
31569
  filled: filled
31450
31570
  }))
31451
31571
  }, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
31452
31572
  coord: coord,
31453
- error: !!error,
31454
- style: styles$o.spaceUnder,
31455
- onChange: newCoords => {
31456
- onChangeProps({
31457
- coord: newCoords
31458
- });
31459
- }
31573
+ style: styles$n.spaceUnder,
31574
+ onChange: handleCoordChange
31460
31575
  }), onTogglePoint && /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
31461
31576
  label: "show point on graph",
31462
31577
  checked: !!showPoint,
31463
- style: showPoint && styles$o.spaceUnder,
31578
+ style: showPoint && styles$n.spaceUnder,
31464
31579
  onChange: onTogglePoint
31465
- }), showPoint && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
31580
+ }), (!isDefiningPoint || showPoint) && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
31466
31581
  selectedValue: pointColor,
31467
31582
  onChange: handleColorChange,
31468
- style: styles$o.spaceUnder
31583
+ style: styles$n.spaceUnder
31469
31584
  }), /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
31470
31585
  label: "open point",
31471
31586
  checked: !filled,
@@ -31474,19 +31589,58 @@ const DefiningPointSettings = props => {
31474
31589
  filled: !newValue
31475
31590
  });
31476
31591
  }
31477
- })));
31592
+ })), (!isDefiningPoint && flags?.["mafs"]?.["locked-point-labels"] || isDefiningPoint && flags?.["mafs"]?.["locked-line-labels"]) && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, labels.map((label, labelIndex) => /*#__PURE__*/React__namespace.createElement(LockedLabelSettings, _extends({}, label, {
31593
+ containerStyle: !isDefiningPoint && styles$n.lockedPointLabelContainer,
31594
+ expanded: true,
31595
+ onChangeProps: newLabel => {
31596
+ handleLabelChange(newLabel, labelIndex);
31597
+ },
31598
+ onRemove: () => {
31599
+ handleLabelRemove(labelIndex);
31600
+ }
31601
+ }))), /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
31602
+ kind: "tertiary",
31603
+ startIcon: plusCircle__default["default"],
31604
+ onClick: () => {
31605
+ const newLabel = {
31606
+ ...getDefaultFigureForType("label"),
31607
+ // Place the label at the same position
31608
+ // as the point. Add a small offset to
31609
+ // avoid crowding.
31610
+ coord: [coord[0] + 0.5,
31611
+ // Additional offset for each label so
31612
+ // they don't overlap.
31613
+ coord[1] - 1 * labels?.length],
31614
+ // Default to the same color as the point
31615
+ color: pointColor
31616
+ };
31617
+ onChangeProps({
31618
+ labels: [...labels, newLabel]
31619
+ });
31620
+ },
31621
+ style: styles$n.addButton
31622
+ }, "Add visible label")), onRemove && /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
31623
+ figureType: props.type,
31624
+ onMove: onMove,
31625
+ onRemove: onRemove
31626
+ }));
31478
31627
  };
31479
- const styles$o = aphrodite.StyleSheet.create({
31480
- container: {
31628
+ const styles$n = aphrodite.StyleSheet.create({
31629
+ definingContainer: {
31481
31630
  marginTop: wonderBlocksTokens.spacing.xSmall_8,
31482
31631
  marginBottom: 0,
31483
31632
  marginLeft: -wonderBlocksTokens.spacing.xxxSmall_4,
31484
31633
  marginRight: -wonderBlocksTokens.spacing.xxxSmall_4,
31485
31634
  backgroundColor: wonderBlocksTokens.color.white
31486
31635
  },
31487
- accordionPanel: {
31636
+ definingPanel: {
31488
31637
  // Need more space since we don't have the actions' margins.
31489
- paddingBottom: wonderBlocksTokens.spacing.medium_16
31638
+ paddingBottom: wonderBlocksTokens.spacing.xxSmall_6
31639
+ },
31640
+ // A regular point (NOT a defining point) has label
31641
+ // accordions with white backgrounds.
31642
+ lockedPointLabelContainer: {
31643
+ backgroundColor: wonderBlocksTokens.color.white
31490
31644
  },
31491
31645
  row: {
31492
31646
  flexDirection: "row",
@@ -31494,18 +31648,23 @@ const styles$o = aphrodite.StyleSheet.create({
31494
31648
  },
31495
31649
  spaceUnder: {
31496
31650
  marginBottom: wonderBlocksTokens.spacing.xSmall_8
31651
+ },
31652
+ addButton: {
31653
+ alignSelf: "start"
31497
31654
  }
31498
31655
  });
31499
31656
 
31500
31657
  const lengthZeroStr = "The line cannot have length 0.";
31501
31658
  const LockedLineSettings = props => {
31502
31659
  const {
31660
+ flags,
31503
31661
  kind,
31504
31662
  points,
31505
31663
  color: lineColor,
31506
31664
  lineStyle = "solid",
31507
31665
  showPoint1,
31508
31666
  showPoint2,
31667
+ labels,
31509
31668
  onChangeProps,
31510
31669
  onMove,
31511
31670
  onRemove
@@ -31523,28 +31682,69 @@ const LockedLineSettings = props => {
31523
31682
  ...points[index],
31524
31683
  ...newPointProps
31525
31684
  };
31685
+
31686
+ // Update labels to be centered between the two points,
31687
+ // retaining existing offset.
31688
+ const oldMidpoint = mafs.vec.midpoint(points[0].coord, points[1].coord);
31689
+ const newMidpoint = mafs.vec.midpoint(newPoints[0].coord, newPoints[1].coord);
31690
+ const offset = [newMidpoint[0] - oldMidpoint[0], newMidpoint[1] - oldMidpoint[1]];
31691
+ const newLabels = labels.map((label, labelIndex) => ({
31692
+ ...label,
31693
+ coord: [label.coord[0] + offset[0], label.coord[1] + offset[1]]
31694
+ }));
31526
31695
  onChangeProps({
31527
- points: newPoints
31696
+ points: newPoints,
31697
+ labels: newLabels
31528
31698
  });
31529
31699
  }
31530
31700
  function handleColorChange(newColor) {
31701
+ const newLabels = labels.map(label => ({
31702
+ ...label,
31703
+ color: newColor
31704
+ }));
31531
31705
  onChangeProps({
31532
31706
  color: newColor,
31533
31707
  // Keep the line's points' colors in sync with the line color.
31534
31708
  points: [{
31535
31709
  ...point1,
31536
- color: newColor
31710
+ color: newColor,
31711
+ labels: point1.labels.map(label => ({
31712
+ ...label,
31713
+ color: newColor
31714
+ }))
31537
31715
  }, {
31538
31716
  ...point2,
31539
- color: newColor
31540
- }]
31717
+ color: newColor,
31718
+ labels: point2.labels.map(label => ({
31719
+ ...label,
31720
+ color: newColor
31721
+ }))
31722
+ }],
31723
+ // Keep the line's labels' colors in sync with the line color.
31724
+ labels: newLabels
31725
+ });
31726
+ }
31727
+ function handleLabelChange(updatedLabel, labelIndex) {
31728
+ const updatedLabels = [...labels];
31729
+ updatedLabels[labelIndex] = {
31730
+ ...labels[labelIndex],
31731
+ ...updatedLabel
31732
+ };
31733
+ onChangeProps({
31734
+ labels: updatedLabels
31735
+ });
31736
+ }
31737
+ function handleLabelRemove(labelIndex) {
31738
+ const updatedLabels = labels.filter((_, index) => index !== labelIndex);
31739
+ onChangeProps({
31740
+ labels: updatedLabels
31541
31741
  });
31542
31742
  }
31543
31743
  return /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
31544
31744
  expanded: props.expanded,
31545
31745
  onToggle: props.onToggle,
31546
31746
  header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31547
- style: styles$n.row
31747
+ style: styles$m.row
31548
31748
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, lineLabel), /*#__PURE__*/React__namespace.createElement(Strut, {
31549
31749
  size: wonderBlocksTokens.spacing.xSmall_8
31550
31750
  }), /*#__PURE__*/React__namespace.createElement(LineSwatch, {
@@ -31553,7 +31753,7 @@ const LockedLineSettings = props => {
31553
31753
  }))
31554
31754
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
31555
31755
  tag: "label",
31556
- style: [styles$n.row, styles$n.spaceUnder]
31756
+ style: [styles$m.row, styles$m.spaceUnder]
31557
31757
  }, "kind", /*#__PURE__*/React__namespace.createElement(Strut, {
31558
31758
  size: wonderBlocksTokens.spacing.xxxSmall_4
31559
31759
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
@@ -31574,7 +31774,7 @@ const LockedLineSettings = props => {
31574
31774
  value: "segment",
31575
31775
  label: "segment"
31576
31776
  }))), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31577
- style: styles$n.row
31777
+ style: styles$m.row
31578
31778
  }, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
31579
31779
  selectedValue: lineColor,
31580
31780
  onChange: handleColorChange
@@ -31586,9 +31786,11 @@ const LockedLineSettings = props => {
31586
31786
  lineStyle: value
31587
31787
  })
31588
31788
  })), isInvalid && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
31589
- style: styles$n.errorText
31590
- }, lengthZeroStr), /*#__PURE__*/React__namespace.createElement(DefiningPointSettings, _extends({
31591
- label: "Point 1",
31789
+ style: styles$m.errorText
31790
+ }, lengthZeroStr), /*#__PURE__*/React__namespace.createElement(LockedPointSettings, _extends({
31791
+ flags: flags,
31792
+ headerLabel: "Point 1",
31793
+ expanded: true,
31592
31794
  showPoint: showPoint1,
31593
31795
  error: isInvalid ? lengthZeroStr : null
31594
31796
  }, point1, {
@@ -31596,8 +31798,10 @@ const LockedLineSettings = props => {
31596
31798
  showPoint1: newValue
31597
31799
  }),
31598
31800
  onChangeProps: newProps => handleChangePoint(newProps, 0)
31599
- })), /*#__PURE__*/React__namespace.createElement(DefiningPointSettings, _extends({
31600
- label: "Point 2",
31801
+ })), /*#__PURE__*/React__namespace.createElement(LockedPointSettings, _extends({
31802
+ flags: flags,
31803
+ headerLabel: "Point 2",
31804
+ expanded: true,
31601
31805
  showPoint: showPoint2,
31602
31806
  error: isInvalid ? lengthZeroStr : null
31603
31807
  }, point2, {
@@ -31605,13 +31809,43 @@ const LockedLineSettings = props => {
31605
31809
  showPoint2: newValue
31606
31810
  }),
31607
31811
  onChangeProps: newProps => handleChangePoint(newProps, 1)
31608
- })), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
31812
+ })), flags?.["mafs"]?.["locked-line-labels"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31813
+ style: styles$m.horizontalRule
31814
+ }), labels.map((label, labelIndex) => /*#__PURE__*/React__namespace.createElement(LockedLabelSettings, _extends({}, label, {
31815
+ expanded: true,
31816
+ onChangeProps: newLabel => {
31817
+ handleLabelChange(newLabel, labelIndex);
31818
+ },
31819
+ onRemove: () => {
31820
+ handleLabelRemove(labelIndex);
31821
+ },
31822
+ containerStyle: styles$m.labelContainer
31823
+ }))), /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
31824
+ kind: "tertiary",
31825
+ startIcon: plusCircle__default["default"],
31826
+ onClick: () => {
31827
+ // Additional vertical offset for each label so
31828
+ // they don't overlap.
31829
+ const offsetPerLabel = [0, -1];
31830
+ const labelLocation = mafs.vec.add(mafs.vec.scale(offsetPerLabel, labels.length), mafs.vec.midpoint(points[0].coord, points[1].coord));
31831
+ const newLabel = {
31832
+ ...getDefaultFigureForType("label"),
31833
+ coord: labelLocation,
31834
+ // Default to the same color as the point
31835
+ color: lineColor
31836
+ };
31837
+ onChangeProps({
31838
+ labels: [...labels, newLabel]
31839
+ });
31840
+ },
31841
+ style: styles$m.addButton
31842
+ }, "Add visible label")), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
31609
31843
  figureType: props.type,
31610
31844
  onMove: onMove,
31611
31845
  onRemove: onRemove
31612
31846
  }));
31613
31847
  };
31614
- const styles$n = aphrodite.StyleSheet.create({
31848
+ const styles$m = aphrodite.StyleSheet.create({
31615
31849
  row: {
31616
31850
  display: "flex",
31617
31851
  flexDirection: "row",
@@ -31622,76 +31856,18 @@ const styles$n = aphrodite.StyleSheet.create({
31622
31856
  },
31623
31857
  errorText: {
31624
31858
  color: wonderBlocksTokens.color.red
31625
- }
31626
- });
31627
-
31628
- /**
31629
- * LockedPointSettings is a component that allows the user to edit the
31630
- * settings of specifically a locked point on the graph.
31631
- *
31632
- * Used in the interactive graph editor's locked figures section.
31633
- */
31634
- const LockedPointSettings = props => {
31635
- const {
31636
- coord,
31637
- color: pointColor,
31638
- filled = true,
31639
- onChangeProps,
31640
- onMove,
31641
- onRemove
31642
- } = props;
31643
- function handleColorChange(newValue) {
31644
- onChangeProps({
31645
- color: newValue
31646
- });
31647
- }
31648
- return /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
31649
- expanded: props.expanded,
31650
- onToggle: props.onToggle,
31651
- header:
31652
- /*#__PURE__*/
31653
- // Summary: Point, coords, color (filled/open)
31654
- React__namespace.createElement(wonderBlocksCore.View, {
31655
- style: styles$m.row
31656
- }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `Point (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React__namespace.createElement(Strut, {
31657
- size: wonderBlocksTokens.spacing.xSmall_8
31658
- }), /*#__PURE__*/React__namespace.createElement(ColorSwatch, {
31659
- color: pointColor,
31660
- filled: filled
31661
- }))
31662
- }, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
31663
- coord: coord,
31664
- style: styles$m.spaceUnder,
31665
- onChange: newCoord => {
31666
- onChangeProps({
31667
- coord: newCoord
31668
- });
31669
- }
31670
- }), /*#__PURE__*/React__namespace.createElement(ColorSelect, {
31671
- selectedValue: pointColor,
31672
- onChange: handleColorChange,
31673
- style: styles$m.spaceUnder
31674
- }), /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
31675
- label: "open point",
31676
- checked: !filled,
31677
- onChange: newValue => {
31678
- onChangeProps({
31679
- filled: !newValue
31680
- });
31681
- }
31682
- }), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
31683
- figureType: props.type,
31684
- onMove: onMove,
31685
- onRemove: onRemove
31686
- }));
31687
- };
31688
- const styles$m = aphrodite.StyleSheet.create({
31689
- row: {
31690
- flexDirection: "row",
31691
- alignItems: "center"
31692
31859
  },
31693
- spaceUnder: {
31694
- marginBottom: wonderBlocksTokens.spacing.xSmall_8
31860
+ addButton: {
31861
+ alignSelf: "start"
31862
+ },
31863
+ horizontalRule: {
31864
+ marginTop: wonderBlocksTokens.spacing.small_12,
31865
+ marginBottom: wonderBlocksTokens.spacing.xxxSmall_4,
31866
+ height: 1,
31867
+ backgroundColor: wonderBlocksTokens.color.offBlack16
31868
+ },
31869
+ labelContainer: {
31870
+ backgroundColor: wonderBlocksTokens.color.white
31695
31871
  }
31696
31872
  });
31697
31873
 
@@ -32093,75 +32269,6 @@ const LockedFigureSettings = props => {
32093
32269
  return null;
32094
32270
  };
32095
32271
 
32096
- const DEFAULT_COLOR = "grayH";
32097
- function getDefaultFigureForType(type) {
32098
- switch (type) {
32099
- case "point":
32100
- return {
32101
- type: "point",
32102
- coord: [0, 0],
32103
- color: DEFAULT_COLOR,
32104
- filled: true
32105
- };
32106
- case "line":
32107
- return {
32108
- type: "line",
32109
- kind: "line",
32110
- points: [getDefaultFigureForType("point"), {
32111
- ...getDefaultFigureForType("point"),
32112
- coord: [2, 2]
32113
- }],
32114
- color: DEFAULT_COLOR,
32115
- lineStyle: "solid",
32116
- showPoint1: false,
32117
- showPoint2: false
32118
- };
32119
- case "vector":
32120
- return {
32121
- type: "vector",
32122
- points: [[0, 0], [2, 2]],
32123
- color: DEFAULT_COLOR
32124
- };
32125
- case "ellipse":
32126
- return {
32127
- type: "ellipse",
32128
- center: [0, 0],
32129
- radius: [1, 1],
32130
- angle: 0,
32131
- color: DEFAULT_COLOR,
32132
- fillStyle: "none",
32133
- strokeStyle: "solid"
32134
- };
32135
- case "polygon":
32136
- return {
32137
- type: "polygon",
32138
- points: [[0, 2], [-1, 0], [1, 0]],
32139
- color: DEFAULT_COLOR,
32140
- showVertices: false,
32141
- fillStyle: "none",
32142
- strokeStyle: "solid"
32143
- };
32144
- case "function":
32145
- return {
32146
- type: "function",
32147
- color: DEFAULT_COLOR,
32148
- strokeStyle: "solid",
32149
- equation: "x^2",
32150
- directionalAxis: "x"
32151
- };
32152
- case "label":
32153
- return {
32154
- type: "label",
32155
- coord: [0, 0],
32156
- text: "",
32157
- color: DEFAULT_COLOR,
32158
- size: "medium"
32159
- };
32160
- default:
32161
- throw new wonderStuffCore.UnreachableCaseError(type);
32162
- }
32163
- }
32164
-
32165
32272
  const LockedFiguresSection = props => {
32166
32273
  // Keep track of all figures' accordions' expanded states for the
32167
32274
  // expand/collapse all button. Set the whole array to false initially.
@@ -32265,6 +32372,7 @@ const LockedFiguresSection = props => {
32265
32372
  }), isExpanded && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, figures?.map((figure, index) => {
32266
32373
  return /*#__PURE__*/React__namespace.createElement(LockedFigureSettings, _extends({
32267
32374
  key: `${uniqueId}-locked-${figure}-${index}`,
32375
+ flags: props.flags,
32268
32376
  showLabelsFlag: props.showLabelsFlag,
32269
32377
  expanded: expandedStates[index],
32270
32378
  onToggle: newValue => {
@@ -33290,6 +33398,7 @@ class InteractiveGraphEditor extends React__namespace.Component {
33290
33398
  // Only show the "Add locked figure" dropdown if the graph
33291
33399
  // is using Mafs.
33292
33400
  this.props.graph && this.props.apiOptions?.flags?.mafs?.[this.props.graph.type] && /*#__PURE__*/React__namespace.createElement(LockedFiguresSection, {
33401
+ flags: this.props.apiOptions.flags,
33293
33402
  showLabelsFlag: this.props.apiOptions?.flags?.mafs?.["interactive-graph-locked-features-labels"],
33294
33403
  figures: this.props.lockedFigures,
33295
33404
  onChange: this.props.onChange
@@ -37186,14 +37295,6 @@ class TableEditor extends React__namespace.Component {
37186
37295
  });
37187
37296
  };
37188
37297
  render() {
37189
- const tableProps = ___default["default"].pick(this.props, "headers", "answers", "onChange", "apiOptions");
37190
- ___default["default"].extend(tableProps, {
37191
- editableHeaders: true,
37192
- Editor,
37193
- onFocus: () => {},
37194
- onBlur: () => {},
37195
- trackInteraction: () => {}
37196
- });
37197
37298
  return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", {
37198
37299
  className: "perseus-widget-row"
37199
37300
  }, /*#__PURE__*/React__namespace.createElement("label", null, "Number of columns:", " ", /*#__PURE__*/React__namespace.createElement(NumberInput, {
@@ -37218,7 +37319,17 @@ class TableEditor extends React__namespace.Component {
37218
37319
  }
37219
37320
  },
37220
37321
  useArrowKeys: true
37221
- }))), /*#__PURE__*/React__namespace.createElement("div", null, " ", "Table of answers:", " ", /*#__PURE__*/React__namespace.createElement(InfoTip$1, null, /*#__PURE__*/React__namespace.createElement("p", null, "The student has to fill out all cells in the table. For partially filled tables create a table using the template, and insert text input boxes as desired."))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement(Table, tableProps)));
37322
+ }))), /*#__PURE__*/React__namespace.createElement("div", null, " ", "Table of answers:", " ", /*#__PURE__*/React__namespace.createElement(InfoTip$1, null, /*#__PURE__*/React__namespace.createElement("p", null, "The student has to fill out all cells in the table. For partially filled tables create a table using the template, and insert text input boxes as desired."))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement(Table, {
37323
+ headers: this.props.headers,
37324
+ answers: this.props.answers,
37325
+ onChange: this.props.onChange,
37326
+ apiOptions: this.props.apiOptions,
37327
+ editableHeaders: true,
37328
+ onFocus: () => {},
37329
+ onBlur: () => {},
37330
+ trackInteraction: () => {},
37331
+ Editor: Editor
37332
+ })));
37222
37333
  }
37223
37334
  }
37224
37335