@khanacademy/perseus-editor 14.3.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
@@ -37,6 +37,7 @@ 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
39
  var plusCircle = require('@phosphor-icons/core/regular/plus-circle.svg');
40
+ var mafs = require('mafs');
40
41
  var arrowFatDown = require('@phosphor-icons/core/regular/arrow-fat-down.svg');
41
42
  var arrowFatLeft = require('@phosphor-icons/core/regular/arrow-fat-left.svg');
42
43
  var arrowFatRight = require('@phosphor-icons/core/regular/arrow-fat-right.svg');
@@ -95,7 +96,7 @@ var arrowCounterClockwise__default = /*#__PURE__*/_interopDefaultLegacy(arrowCou
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.3.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
30782
+ style: styles$t.deleteButton
30772
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
30806
+ style: styles$t.iconButton
30796
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,22 +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]
31308
+ }, styles$p.accordionHeader]
31297
31309
  }, text)),
31298
- containerStyle: !onMove && styles$q.innerLabelAccordionPanel
31310
+ containerStyle: containerStyle
31299
31311
  }, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
31300
31312
  coord: coord,
31301
31313
  onChange: newCoords => {
@@ -31303,10 +31315,10 @@ function LockedLabelSettings(props) {
31303
31315
  coord: newCoords
31304
31316
  });
31305
31317
  },
31306
- style: styles$q.spaceUnder
31318
+ style: styles$p.spaceUnder
31307
31319
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
31308
31320
  tag: "label",
31309
- style: [styles$q.row, styles$q.spaceUnder]
31321
+ style: [styles$p.row, styles$p.spaceUnder]
31310
31322
  }, "TeX", /*#__PURE__*/React__namespace.createElement(Strut, {
31311
31323
  size: wonderBlocksTokens.spacing.xSmall_8
31312
31324
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
@@ -31316,7 +31328,7 @@ function LockedLabelSettings(props) {
31316
31328
  text: newValue
31317
31329
  })
31318
31330
  })), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31319
- style: styles$q.row
31331
+ style: styles$p.row
31320
31332
  }, onMove && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
31321
31333
  selectedValue: color,
31322
31334
  onChange: newColor => {
@@ -31324,12 +31336,12 @@ function LockedLabelSettings(props) {
31324
31336
  color: newColor
31325
31337
  });
31326
31338
  },
31327
- style: styles$q.spaceUnder
31339
+ style: styles$p.spaceUnder
31328
31340
  }), /*#__PURE__*/React__namespace.createElement(Strut, {
31329
31341
  size: wonderBlocksTokens.spacing.medium_16
31330
31342
  })), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
31331
31343
  tag: "label",
31332
- style: styles$q.row
31344
+ style: styles$p.row
31333
31345
  }, "size", /*#__PURE__*/React__namespace.createElement(Strut, {
31334
31346
  size: wonderBlocksTokens.spacing.xSmall_8
31335
31347
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
@@ -31356,7 +31368,7 @@ function LockedLabelSettings(props) {
31356
31368
  onRemove: onRemove
31357
31369
  }));
31358
31370
  }
31359
- const styles$q = aphrodite.StyleSheet.create({
31371
+ const styles$p = aphrodite.StyleSheet.create({
31360
31372
  accordionHeaderContainer: {
31361
31373
  // Stop the label summary from wrapping.
31362
31374
  whiteSpace: "nowrap"
@@ -31377,9 +31389,6 @@ const styles$q = aphrodite.StyleSheet.create({
31377
31389
  },
31378
31390
  spaceUnder: {
31379
31391
  marginBottom: wonderBlocksTokens.spacing.xSmall_8
31380
- },
31381
- innerLabelAccordionPanel: {
31382
- backgroundColor: wonderBlocksTokens.color.white
31383
31392
  }
31384
31393
  });
31385
31394
 
@@ -31393,7 +31402,7 @@ const LabeledSwitch = props => {
31393
31402
  const ids = wonderBlocksCore.useUniqueIdWithMock();
31394
31403
  const switchId = ids.get("switch");
31395
31404
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31396
- style: [styles$p.row, style]
31405
+ style: [styles$o.row, style]
31397
31406
  }, /*#__PURE__*/React__namespace.createElement(Switch__default["default"], {
31398
31407
  id: switchId,
31399
31408
  checked: checked,
@@ -31405,227 +31414,10 @@ const LabeledSwitch = props => {
31405
31414
  htmlFor: switchId
31406
31415
  }, label));
31407
31416
  };
31408
- const styles$p = aphrodite.StyleSheet.create({
31409
- row: {
31410
- flexDirection: "row",
31411
- alignItems: "center"
31412
- }
31413
- });
31414
-
31415
- /**
31416
- * DefiningPointSettings is a component that allows the user to edit the
31417
- * settings of a point that defines a locked figure (ex. line) on the graph.
31418
- *
31419
- * Used in the interactive graph editor's locked figures section.
31420
- */
31421
- const DefiningPointSettings = props => {
31422
- const {
31423
- coord,
31424
- color: pointColor,
31425
- filled = true,
31426
- label,
31427
- showPoint = "false",
31428
- error,
31429
- onChangeProps,
31430
- onTogglePoint,
31431
- expanded,
31432
- onToggle
31433
- } = props;
31434
- function handleColorChange(newValue) {
31435
- onChangeProps({
31436
- color: newValue
31437
- });
31438
- }
31439
- return /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
31440
- expanded: expanded,
31441
- onToggle: onToggle,
31442
- containerStyle: styles$o.container,
31443
- panelStyle: styles$o.accordionPanel,
31444
- header:
31445
- /*#__PURE__*/
31446
- // Summary: Point, coords, color (filled/open)
31447
- React__namespace.createElement(wonderBlocksCore.View, {
31448
- style: styles$o.row
31449
- }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `${label || "Point"} (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React__namespace.createElement(Strut, {
31450
- size: wonderBlocksTokens.spacing.xSmall_8
31451
- }), showPoint && /*#__PURE__*/React__namespace.createElement(ColorSwatch, {
31452
- color: pointColor,
31453
- filled: filled
31454
- }))
31455
- }, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
31456
- coord: coord,
31457
- error: !!error,
31458
- style: styles$o.spaceUnder,
31459
- onChange: newCoords => {
31460
- onChangeProps({
31461
- coord: newCoords
31462
- });
31463
- }
31464
- }), onTogglePoint && /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
31465
- label: "show point on graph",
31466
- checked: !!showPoint,
31467
- style: showPoint && styles$o.spaceUnder,
31468
- onChange: onTogglePoint
31469
- }), showPoint && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
31470
- selectedValue: pointColor,
31471
- onChange: handleColorChange,
31472
- style: styles$o.spaceUnder
31473
- }), /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
31474
- label: "open point",
31475
- checked: !filled,
31476
- onChange: newValue => {
31477
- onChangeProps({
31478
- filled: !newValue
31479
- });
31480
- }
31481
- })));
31482
- };
31483
31417
  const styles$o = aphrodite.StyleSheet.create({
31484
- container: {
31485
- marginTop: wonderBlocksTokens.spacing.xSmall_8,
31486
- marginBottom: 0,
31487
- marginLeft: -wonderBlocksTokens.spacing.xxxSmall_4,
31488
- marginRight: -wonderBlocksTokens.spacing.xxxSmall_4,
31489
- backgroundColor: wonderBlocksTokens.color.white
31490
- },
31491
- accordionPanel: {
31492
- // Need more space since we don't have the actions' margins.
31493
- paddingBottom: wonderBlocksTokens.spacing.medium_16
31494
- },
31495
31418
  row: {
31496
31419
  flexDirection: "row",
31497
31420
  alignItems: "center"
31498
- },
31499
- spaceUnder: {
31500
- marginBottom: wonderBlocksTokens.spacing.xSmall_8
31501
- }
31502
- });
31503
-
31504
- const lengthZeroStr = "The line cannot have length 0.";
31505
- const LockedLineSettings = props => {
31506
- const {
31507
- kind,
31508
- points,
31509
- color: lineColor,
31510
- lineStyle = "solid",
31511
- showPoint1,
31512
- showPoint2,
31513
- onChangeProps,
31514
- onMove,
31515
- onRemove
31516
- } = props;
31517
- const [point1, point2] = points;
31518
- const capitalizeKind = kind.charAt(0).toUpperCase() + kind.slice(1);
31519
- const lineLabel = `${capitalizeKind} (${point1.coord[0]},
31520
- ${point1.coord[1]}), (${point2.coord[0]}, ${point2.coord[1]})`;
31521
-
31522
- // Check if the line has length 0.
31523
- const isInvalid = kmath.vector.equal(point1.coord, point2.coord);
31524
- function handleChangePoint(newPointProps, index) {
31525
- const newPoints = [...points];
31526
- newPoints[index] = {
31527
- ...points[index],
31528
- ...newPointProps
31529
- };
31530
- onChangeProps({
31531
- points: newPoints
31532
- });
31533
- }
31534
- function handleColorChange(newColor) {
31535
- onChangeProps({
31536
- color: newColor,
31537
- // Keep the line's points' colors in sync with the line color.
31538
- points: [{
31539
- ...point1,
31540
- color: newColor
31541
- }, {
31542
- ...point2,
31543
- color: newColor
31544
- }]
31545
- });
31546
- }
31547
- return /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
31548
- expanded: props.expanded,
31549
- onToggle: props.onToggle,
31550
- header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31551
- style: styles$n.row
31552
- }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, lineLabel), /*#__PURE__*/React__namespace.createElement(Strut, {
31553
- size: wonderBlocksTokens.spacing.xSmall_8
31554
- }), /*#__PURE__*/React__namespace.createElement(LineSwatch, {
31555
- color: lineColor,
31556
- lineStyle: lineStyle
31557
- }))
31558
- }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
31559
- tag: "label",
31560
- style: [styles$n.row, styles$n.spaceUnder]
31561
- }, "kind", /*#__PURE__*/React__namespace.createElement(Strut, {
31562
- size: wonderBlocksTokens.spacing.xxxSmall_4
31563
- }), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
31564
- selectedValue: kind,
31565
- onChange: value => onChangeProps({
31566
- kind: value
31567
- })
31568
- // Placeholder is required, but never gets used.
31569
- ,
31570
- placeholder: ""
31571
- }, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
31572
- value: "line",
31573
- label: "line"
31574
- }), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
31575
- value: "ray",
31576
- label: "ray"
31577
- }), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
31578
- value: "segment",
31579
- label: "segment"
31580
- }))), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31581
- style: styles$n.row
31582
- }, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
31583
- selectedValue: lineColor,
31584
- onChange: handleColorChange
31585
- }), /*#__PURE__*/React__namespace.createElement(Strut, {
31586
- size: wonderBlocksTokens.spacing.small_12
31587
- }), /*#__PURE__*/React__namespace.createElement(LineStrokeSelect, {
31588
- selectedValue: lineStyle,
31589
- onChange: value => onChangeProps({
31590
- lineStyle: value
31591
- })
31592
- })), isInvalid && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
31593
- style: styles$n.errorText
31594
- }, lengthZeroStr), /*#__PURE__*/React__namespace.createElement(DefiningPointSettings, _extends({
31595
- label: "Point 1",
31596
- showPoint: showPoint1,
31597
- error: isInvalid ? lengthZeroStr : null
31598
- }, point1, {
31599
- onTogglePoint: newValue => onChangeProps({
31600
- showPoint1: newValue
31601
- }),
31602
- onChangeProps: newProps => handleChangePoint(newProps, 0)
31603
- })), /*#__PURE__*/React__namespace.createElement(DefiningPointSettings, _extends({
31604
- label: "Point 2",
31605
- showPoint: showPoint2,
31606
- error: isInvalid ? lengthZeroStr : null
31607
- }, point2, {
31608
- onTogglePoint: newValue => onChangeProps({
31609
- showPoint2: newValue
31610
- }),
31611
- onChangeProps: newProps => handleChangePoint(newProps, 1)
31612
- })), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
31613
- figureType: props.type,
31614
- onMove: onMove,
31615
- onRemove: onRemove
31616
- }));
31617
- };
31618
- const styles$n = aphrodite.StyleSheet.create({
31619
- row: {
31620
- display: "flex",
31621
- flexDirection: "row",
31622
- alignItems: "center"
31623
- },
31624
- spaceUnder: {
31625
- marginBottom: wonderBlocksTokens.spacing.xSmall_8
31626
- },
31627
- errorText: {
31628
- color: wonderBlocksTokens.color.red
31629
31421
  }
31630
31422
  });
31631
31423
 
@@ -31651,7 +31443,8 @@ function getDefaultFigureForType(type) {
31651
31443
  color: DEFAULT_COLOR,
31652
31444
  lineStyle: "solid",
31653
31445
  showPoint1: false,
31654
- showPoint2: false
31446
+ showPoint2: false,
31447
+ labels: []
31655
31448
  };
31656
31449
  case "vector":
31657
31450
  return {
@@ -31702,14 +31495,21 @@ function getDefaultFigureForType(type) {
31702
31495
  const LockedPointSettings = props => {
31703
31496
  const {
31704
31497
  flags,
31498
+ headerLabel,
31705
31499
  coord,
31706
31500
  color: pointColor,
31707
31501
  filled = true,
31708
31502
  labels,
31709
31503
  onChangeProps,
31710
31504
  onMove,
31711
- onRemove
31505
+ onRemove,
31506
+ // defining point props
31507
+ showPoint,
31508
+ expanded,
31509
+ onTogglePoint,
31510
+ onToggle
31712
31511
  } = props;
31512
+ const isDefiningPoint = !onMove && !onRemove;
31713
31513
  function handleColorChange(newValue) {
31714
31514
  const newProps = {
31715
31515
  color: newValue
@@ -31753,14 +31553,16 @@ const LockedPointSettings = props => {
31753
31553
  });
31754
31554
  }
31755
31555
  return /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
31756
- expanded: props.expanded,
31757
- onToggle: props.onToggle,
31556
+ expanded: expanded,
31557
+ onToggle: onToggle,
31558
+ containerStyle: isDefiningPoint ? styles$n.definingContainer : undefined,
31559
+ panelStyle: isDefiningPoint ? styles$n.definingPanel : undefined,
31758
31560
  header:
31759
31561
  /*#__PURE__*/
31760
31562
  // Summary: Point, coords, color (filled/open)
31761
31563
  React__namespace.createElement(wonderBlocksCore.View, {
31762
- style: styles$m.row
31763
- }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `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, {
31764
31566
  size: wonderBlocksTokens.spacing.xSmall_8
31765
31567
  }), /*#__PURE__*/React__namespace.createElement(ColorSwatch, {
31766
31568
  color: pointColor,
@@ -31768,12 +31570,17 @@ const LockedPointSettings = props => {
31768
31570
  }))
31769
31571
  }, /*#__PURE__*/React__namespace.createElement(CoordinatePairInput, {
31770
31572
  coord: coord,
31771
- style: styles$m.spaceUnder,
31573
+ style: styles$n.spaceUnder,
31772
31574
  onChange: handleCoordChange
31773
- }), /*#__PURE__*/React__namespace.createElement(ColorSelect, {
31575
+ }), onTogglePoint && /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
31576
+ label: "show point on graph",
31577
+ checked: !!showPoint,
31578
+ style: showPoint && styles$n.spaceUnder,
31579
+ onChange: onTogglePoint
31580
+ }), (!isDefiningPoint || showPoint) && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
31774
31581
  selectedValue: pointColor,
31775
31582
  onChange: handleColorChange,
31776
- style: styles$m.spaceUnder
31583
+ style: styles$n.spaceUnder
31777
31584
  }), /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
31778
31585
  label: "open point",
31779
31586
  checked: !filled,
@@ -31781,9 +31588,9 @@ const LockedPointSettings = props => {
31781
31588
  onChangeProps({
31782
31589
  filled: !newValue
31783
31590
  });
31784
- },
31785
- style: styles$m.spaceUnder
31786
- }), flags?.["mafs"]?.["locked-point-labels"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, labels.map((label, labelIndex) => /*#__PURE__*/React__namespace.createElement(LockedLabelSettings, _extends({}, label, {
31591
+ }
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,
31787
31594
  expanded: true,
31788
31595
  onChangeProps: newLabel => {
31789
31596
  handleLabelChange(newLabel, labelIndex);
@@ -31811,6 +31618,226 @@ const LockedPointSettings = props => {
31811
31618
  labels: [...labels, newLabel]
31812
31619
  });
31813
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
+ }));
31627
+ };
31628
+ const styles$n = aphrodite.StyleSheet.create({
31629
+ definingContainer: {
31630
+ marginTop: wonderBlocksTokens.spacing.xSmall_8,
31631
+ marginBottom: 0,
31632
+ marginLeft: -wonderBlocksTokens.spacing.xxxSmall_4,
31633
+ marginRight: -wonderBlocksTokens.spacing.xxxSmall_4,
31634
+ backgroundColor: wonderBlocksTokens.color.white
31635
+ },
31636
+ definingPanel: {
31637
+ // Need more space since we don't have the actions' margins.
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
31644
+ },
31645
+ row: {
31646
+ flexDirection: "row",
31647
+ alignItems: "center"
31648
+ },
31649
+ spaceUnder: {
31650
+ marginBottom: wonderBlocksTokens.spacing.xSmall_8
31651
+ },
31652
+ addButton: {
31653
+ alignSelf: "start"
31654
+ }
31655
+ });
31656
+
31657
+ const lengthZeroStr = "The line cannot have length 0.";
31658
+ const LockedLineSettings = props => {
31659
+ const {
31660
+ flags,
31661
+ kind,
31662
+ points,
31663
+ color: lineColor,
31664
+ lineStyle = "solid",
31665
+ showPoint1,
31666
+ showPoint2,
31667
+ labels,
31668
+ onChangeProps,
31669
+ onMove,
31670
+ onRemove
31671
+ } = props;
31672
+ const [point1, point2] = points;
31673
+ const capitalizeKind = kind.charAt(0).toUpperCase() + kind.slice(1);
31674
+ const lineLabel = `${capitalizeKind} (${point1.coord[0]},
31675
+ ${point1.coord[1]}), (${point2.coord[0]}, ${point2.coord[1]})`;
31676
+
31677
+ // Check if the line has length 0.
31678
+ const isInvalid = kmath.vector.equal(point1.coord, point2.coord);
31679
+ function handleChangePoint(newPointProps, index) {
31680
+ const newPoints = [...points];
31681
+ newPoints[index] = {
31682
+ ...points[index],
31683
+ ...newPointProps
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
+ }));
31695
+ onChangeProps({
31696
+ points: newPoints,
31697
+ labels: newLabels
31698
+ });
31699
+ }
31700
+ function handleColorChange(newColor) {
31701
+ const newLabels = labels.map(label => ({
31702
+ ...label,
31703
+ color: newColor
31704
+ }));
31705
+ onChangeProps({
31706
+ color: newColor,
31707
+ // Keep the line's points' colors in sync with the line color.
31708
+ points: [{
31709
+ ...point1,
31710
+ color: newColor,
31711
+ labels: point1.labels.map(label => ({
31712
+ ...label,
31713
+ color: newColor
31714
+ }))
31715
+ }, {
31716
+ ...point2,
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
31741
+ });
31742
+ }
31743
+ return /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
31744
+ expanded: props.expanded,
31745
+ onToggle: props.onToggle,
31746
+ header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31747
+ style: styles$m.row
31748
+ }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, lineLabel), /*#__PURE__*/React__namespace.createElement(Strut, {
31749
+ size: wonderBlocksTokens.spacing.xSmall_8
31750
+ }), /*#__PURE__*/React__namespace.createElement(LineSwatch, {
31751
+ color: lineColor,
31752
+ lineStyle: lineStyle
31753
+ }))
31754
+ }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
31755
+ tag: "label",
31756
+ style: [styles$m.row, styles$m.spaceUnder]
31757
+ }, "kind", /*#__PURE__*/React__namespace.createElement(Strut, {
31758
+ size: wonderBlocksTokens.spacing.xxxSmall_4
31759
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
31760
+ selectedValue: kind,
31761
+ onChange: value => onChangeProps({
31762
+ kind: value
31763
+ })
31764
+ // Placeholder is required, but never gets used.
31765
+ ,
31766
+ placeholder: ""
31767
+ }, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
31768
+ value: "line",
31769
+ label: "line"
31770
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
31771
+ value: "ray",
31772
+ label: "ray"
31773
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
31774
+ value: "segment",
31775
+ label: "segment"
31776
+ }))), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31777
+ style: styles$m.row
31778
+ }, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
31779
+ selectedValue: lineColor,
31780
+ onChange: handleColorChange
31781
+ }), /*#__PURE__*/React__namespace.createElement(Strut, {
31782
+ size: wonderBlocksTokens.spacing.small_12
31783
+ }), /*#__PURE__*/React__namespace.createElement(LineStrokeSelect, {
31784
+ selectedValue: lineStyle,
31785
+ onChange: value => onChangeProps({
31786
+ lineStyle: value
31787
+ })
31788
+ })), isInvalid && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
31789
+ style: styles$m.errorText
31790
+ }, lengthZeroStr), /*#__PURE__*/React__namespace.createElement(LockedPointSettings, _extends({
31791
+ flags: flags,
31792
+ headerLabel: "Point 1",
31793
+ expanded: true,
31794
+ showPoint: showPoint1,
31795
+ error: isInvalid ? lengthZeroStr : null
31796
+ }, point1, {
31797
+ onTogglePoint: newValue => onChangeProps({
31798
+ showPoint1: newValue
31799
+ }),
31800
+ onChangeProps: newProps => handleChangePoint(newProps, 0)
31801
+ })), /*#__PURE__*/React__namespace.createElement(LockedPointSettings, _extends({
31802
+ flags: flags,
31803
+ headerLabel: "Point 2",
31804
+ expanded: true,
31805
+ showPoint: showPoint2,
31806
+ error: isInvalid ? lengthZeroStr : null
31807
+ }, point2, {
31808
+ onTogglePoint: newValue => onChangeProps({
31809
+ showPoint2: newValue
31810
+ }),
31811
+ onChangeProps: newProps => handleChangePoint(newProps, 1)
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
+ },
31814
31841
  style: styles$m.addButton
31815
31842
  }, "Add visible label")), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
31816
31843
  figureType: props.type,
@@ -31820,14 +31847,27 @@ const LockedPointSettings = props => {
31820
31847
  };
31821
31848
  const styles$m = aphrodite.StyleSheet.create({
31822
31849
  row: {
31850
+ display: "flex",
31823
31851
  flexDirection: "row",
31824
31852
  alignItems: "center"
31825
31853
  },
31826
31854
  spaceUnder: {
31827
31855
  marginBottom: wonderBlocksTokens.spacing.xSmall_8
31828
31856
  },
31857
+ errorText: {
31858
+ color: wonderBlocksTokens.color.red
31859
+ },
31829
31860
  addButton: {
31830
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
31831
31871
  }
31832
31872
  });
31833
31873