@khanacademy/perseus-editor 6.0.3 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -25,10 +25,9 @@ var wonderBlocksDropdown = require('@khanacademy/wonder-blocks-dropdown');
25
25
  var wonderBlocksForm = require('@khanacademy/wonder-blocks-form');
26
26
  var wonderBlocksTypography = require('@khanacademy/wonder-blocks-typography');
27
27
  var wonderBlocksAccordion = require('@khanacademy/wonder-blocks-accordion');
28
- var IconButton = require('@khanacademy/wonder-blocks-icon-button');
28
+ var Button = require('@khanacademy/wonder-blocks-button');
29
29
  var trashIcon = require('@phosphor-icons/core/bold/trash-bold.svg');
30
30
  var Switch = require('@khanacademy/wonder-blocks-switch');
31
- var Button = require('@khanacademy/wonder-blocks-button');
32
31
 
33
32
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
34
33
 
@@ -60,14 +59,13 @@ var caretRight__default = /*#__PURE__*/_interopDefaultLegacy(caretRight);
60
59
  var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
61
60
  var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
62
61
  var KAS__namespace = /*#__PURE__*/_interopNamespace(KAS);
63
- var IconButton__default = /*#__PURE__*/_interopDefaultLegacy(IconButton);
62
+ var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
64
63
  var trashIcon__default = /*#__PURE__*/_interopDefaultLegacy(trashIcon);
65
64
  var Switch__default = /*#__PURE__*/_interopDefaultLegacy(Switch);
66
- var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
67
65
 
68
66
  // This file is processed by a Rollup plugin (replace) to inject the production
69
67
  const libName = "@khanacademy/perseus-editor";
70
- const libVersion = "6.0.3";
68
+ const libVersion = "6.1.0";
71
69
  perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
72
70
 
73
71
  function _extends() {
@@ -262,13 +260,13 @@ class SectionControlButton extends React__namespace.Component {
262
260
  role: "button",
263
261
  hideDefaultFocusRing: true,
264
262
  "aria-label": title,
265
- style: styles$s.button
263
+ style: styles$t.button
266
264
  }, _ref => {
267
265
  return /*#__PURE__*/React__namespace.createElement(InlineIcon$b, icon);
268
266
  });
269
267
  }
270
268
  }
271
- const styles$s = aphrodite.StyleSheet.create({
269
+ const styles$t = aphrodite.StyleSheet.create({
272
270
  button: {
273
271
  backgroundColor: wonderBlocksTokens.color.gold,
274
272
  margin: 2,
@@ -20787,19 +20785,19 @@ class TexErrorView extends React__namespace.Component {
20787
20785
  const {
20788
20786
  showErrors
20789
20787
  } = this.state;
20790
- const iconStyle = showErrors ? styles$r.iconExpanded : styles$r.iconCollapsed;
20788
+ const iconStyle = showErrors ? styles$s.iconExpanded : styles$s.iconCollapsed;
20791
20789
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
20792
- style: styles$r.errorContainer
20790
+ style: styles$s.errorContainer
20793
20791
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
20794
- style: styles$r.title,
20792
+ style: styles$s.title,
20795
20793
  onClick: this.handleToggleTexErrors
20796
20794
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksIcon.PhosphorIcon, {
20797
20795
  icon: caretRight__default["default"],
20798
20796
  style: iconStyle
20799
20797
  }), "\xA0 TeX Errors (", errorList.length, ")"), showErrors && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
20800
- style: styles$r.errorExplanation
20798
+ style: styles$s.errorExplanation
20801
20799
  }, "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, {
20802
- style: styles$r.error,
20800
+ style: styles$s.error,
20803
20801
  key: index
20804
20802
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
20805
20803
  style: {
@@ -20808,7 +20806,7 @@ class TexErrorView extends React__namespace.Component {
20808
20806
  }, e.math), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, e.message))));
20809
20807
  }
20810
20808
  }
20811
- const styles$r = aphrodite.StyleSheet.create({
20809
+ const styles$s = aphrodite.StyleSheet.create({
20812
20810
  title: {
20813
20811
  backgroundColor: "#eee",
20814
20812
  fontSize: "1.25em",
@@ -24565,12 +24563,12 @@ class SimpleButton extends React__namespace.Component {
24565
24563
  ...otherProps
24566
24564
  } = this.props;
24567
24565
  return /*#__PURE__*/React__namespace.createElement("div", _extends({
24568
- className: aphrodite.css(styles$q.baseButton, color === "green" && styles$q.green, color === "orange" && styles$q.orange),
24566
+ className: aphrodite.css(styles$r.baseButton, color === "green" && styles$r.green, color === "orange" && styles$r.orange),
24569
24567
  onClick: onClick
24570
24568
  }, otherProps), children);
24571
24569
  }
24572
24570
  }
24573
- const styles$q = aphrodite.StyleSheet.create({
24571
+ const styles$r = aphrodite.StyleSheet.create({
24574
24572
  baseButton: {
24575
24573
  top: "0",
24576
24574
  fontSize: "11px",
@@ -24783,23 +24781,23 @@ const LeafContainer = _ref2 => {
24783
24781
  } = _ref2;
24784
24782
  const hasPreviewHeading = shape.type === "content" || shape.type === "hint";
24785
24783
  const previewHeading = hasPreviewHeading && /*#__PURE__*/React__namespace.createElement("div", {
24786
- className: aphrodite.css(styles$p.containerHeader)
24784
+ className: aphrodite.css(styles$q.containerHeader)
24787
24785
  }, /*#__PURE__*/React__namespace.createElement(Header, {
24788
24786
  depth: path.length,
24789
- className: aphrodite.css(styles$p.containerTitle)
24787
+ className: aphrodite.css(styles$q.containerTitle)
24790
24788
  }, capitalize(name)));
24791
24789
  return /*#__PURE__*/React__namespace.createElement("div", {
24792
- className: aphrodite.css(styles$p.container)
24790
+ className: aphrodite.css(styles$q.container)
24793
24791
  }, /*#__PURE__*/React__namespace.createElement("span", {
24794
- className: aphrodite.css(styles$p.row, styles$p.rowHeading)
24792
+ className: aphrodite.css(styles$q.row, styles$q.rowHeading)
24795
24793
  }, /*#__PURE__*/React__namespace.createElement("div", {
24796
- className: aphrodite.css(styles$p.columnLeft)
24794
+ className: aphrodite.css(styles$q.columnLeft)
24797
24795
  }, /*#__PURE__*/React__namespace.createElement("div", {
24798
- className: "pod-title " + aphrodite.css(styles$p.containerHeader)
24796
+ className: "pod-title " + aphrodite.css(styles$q.containerHeader)
24799
24797
  }, /*#__PURE__*/React__namespace.createElement("div", {
24800
- className: aphrodite.css(styles$p.containerTitle)
24798
+ className: aphrodite.css(styles$q.containerTitle)
24801
24799
  }, capitalize(name)), controls)), /*#__PURE__*/React__namespace.createElement("div", {
24802
- className: aphrodite.css(styles$p.columnRight)
24800
+ className: aphrodite.css(styles$q.columnRight)
24803
24801
  }, previewHeading)), children);
24804
24802
  };
24805
24803
  const ArrayContainer = props => {
@@ -24812,11 +24810,11 @@ const ArrayContainer = props => {
24812
24810
  actions
24813
24811
  } = props;
24814
24812
  return /*#__PURE__*/React__namespace.createElement("div", {
24815
- className: aphrodite.css(styles$p.container)
24813
+ className: aphrodite.css(styles$q.container)
24816
24814
  }, controls && /*#__PURE__*/React__namespace.createElement("div", {
24817
- className: aphrodite.css(styles$p.columnLeft, styles$p.containerHeader)
24815
+ className: aphrodite.css(styles$q.columnLeft, styles$q.containerHeader)
24818
24816
  }, controls), /*#__PURE__*/React__namespace.createElement("div", null, children), /*#__PURE__*/React__namespace.createElement("div", {
24819
- className: aphrodite.css(styles$p.columnLeft)
24817
+ className: aphrodite.css(styles$q.columnLeft)
24820
24818
  }, /*#__PURE__*/React__namespace.createElement("a", {
24821
24819
  href: "javascript:void 0",
24822
24820
  onClick: () => actions.addArrayElement(path, shape.elementShape)
@@ -24830,28 +24828,28 @@ const ObjectContainer = _ref3 => {
24830
24828
  path
24831
24829
  } = _ref3;
24832
24830
  const headingEditor = /*#__PURE__*/React__namespace.createElement("div", {
24833
- className: aphrodite.css(styles$p.containerHeader)
24831
+ className: aphrodite.css(styles$q.containerHeader)
24834
24832
  }, /*#__PURE__*/React__namespace.createElement(Header, {
24835
24833
  depth: path.length,
24836
- className: aphrodite.css(styles$p.containerTitle)
24834
+ className: aphrodite.css(styles$q.containerTitle)
24837
24835
  }, capitalize(name)), controls);
24838
24836
  const headingPreview = (name || controls) && /*#__PURE__*/React__namespace.createElement("div", {
24839
- className: aphrodite.css(styles$p.containerHeader, styles$p.previewCollectionHeader)
24837
+ className: aphrodite.css(styles$q.containerHeader, styles$q.previewCollectionHeader)
24840
24838
  }, /*#__PURE__*/React__namespace.createElement(Header, {
24841
24839
  depth: path.length,
24842
- className: aphrodite.css(styles$p.containerTitle)
24840
+ className: aphrodite.css(styles$q.containerTitle)
24843
24841
  }, capitalize(name)));
24844
24842
  const hasBothHeadings = headingEditor && headingPreview;
24845
24843
  return /*#__PURE__*/React__namespace.createElement("div", {
24846
- className: aphrodite.css(styles$p.container)
24844
+ className: aphrodite.css(styles$q.container)
24847
24845
  }, hasBothHeadings && /*#__PURE__*/React__namespace.createElement("span", {
24848
- className: aphrodite.css(styles$p.row)
24846
+ className: aphrodite.css(styles$q.row)
24849
24847
  }, /*#__PURE__*/React__namespace.createElement("div", {
24850
- className: aphrodite.css(styles$p.columnLeft)
24848
+ className: aphrodite.css(styles$q.columnLeft)
24851
24849
  }, headingEditor), /*#__PURE__*/React__namespace.createElement("div", {
24852
- className: aphrodite.css(styles$p.columnRight)
24850
+ className: aphrodite.css(styles$q.columnRight)
24853
24851
  }, headingPreview)), /*#__PURE__*/React__namespace.createElement("div", {
24854
- className: aphrodite.css(path.length > 0 && styles$p.contentIndent)
24852
+ className: aphrodite.css(path.length > 0 && styles$q.contentIndent)
24855
24853
  }, children));
24856
24854
  };
24857
24855
 
@@ -24971,11 +24969,11 @@ const ItemNodeContent = withStickiness(props => {
24971
24969
  className: "framework-perseus"
24972
24970
  }, lens(renderers).get(path));
24973
24971
  return /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement("div", {
24974
- className: aphrodite.css(styles$p.row)
24972
+ className: aphrodite.css(styles$q.row)
24975
24973
  }, /*#__PURE__*/React__namespace.createElement("div", {
24976
- className: aphrodite.css(styles$p.columnLeft)
24974
+ className: aphrodite.css(styles$q.columnLeft)
24977
24975
  }, /*#__PURE__*/React__namespace.createElement("div", {
24978
- className: aphrodite.css(sticky && styles$p.sticky)
24976
+ className: aphrodite.css(sticky && styles$q.sticky)
24979
24977
  },
24980
24978
  /*#__PURE__*/
24981
24979
  // @ts-expect-error - TS2769 - No overload matches this call.
@@ -24983,9 +24981,9 @@ const ItemNodeContent = withStickiness(props => {
24983
24981
  onChange: newVal => actions.mergeValueAtPath(path, newVal),
24984
24982
  apiOptions: apiOptions
24985
24983
  })))), /*#__PURE__*/React__namespace.createElement("div", {
24986
- className: aphrodite.css(styles$p.columnRight)
24984
+ className: aphrodite.css(styles$q.columnRight)
24987
24985
  }, /*#__PURE__*/React__namespace.createElement("div", {
24988
- className: aphrodite.css(sticky && styles$p.sticky)
24986
+ className: aphrodite.css(sticky && styles$q.sticky)
24989
24987
  }, preview))));
24990
24988
  });
24991
24989
  const HintNodeContent = withStickiness(props => {
@@ -25001,13 +24999,13 @@ const HintNodeContent = withStickiness(props => {
25001
24999
  className: "framework-perseus"
25002
25000
  }, lens(renderers).get(path));
25003
25001
  return /*#__PURE__*/React__namespace.createElement("div", {
25004
- className: aphrodite.css(styles$p.row)
25002
+ className: aphrodite.css(styles$q.row)
25005
25003
  }, /*#__PURE__*/React__namespace.createElement("div", {
25006
- className: aphrodite.css(styles$p.columnLeft)
25004
+ className: aphrodite.css(styles$q.columnLeft)
25007
25005
  }, /*#__PURE__*/React__namespace.createElement("div", {
25008
- className: aphrodite.css(sticky && styles$p.sticky)
25006
+ className: aphrodite.css(sticky && styles$q.sticky)
25009
25007
  }, /*#__PURE__*/React__namespace.createElement(HintEditor, _extends({}, data, {
25010
- className: aphrodite.css(styles$p.hintEditor),
25008
+ className: aphrodite.css(styles$q.hintEditor),
25011
25009
  onChange: newVal => actions.mergeValueAtPath(path, newVal),
25012
25010
  apiOptions: apiOptions,
25013
25011
  showTitle: false,
@@ -25022,9 +25020,9 @@ const HintNodeContent = withStickiness(props => {
25022
25020
  isFirst: true,
25023
25021
  isLast: true
25024
25022
  })))), /*#__PURE__*/React__namespace.createElement("div", {
25025
- className: aphrodite.css(styles$p.columnRight)
25023
+ className: aphrodite.css(styles$q.columnRight)
25026
25024
  }, /*#__PURE__*/React__namespace.createElement("div", {
25027
- className: aphrodite.css(sticky && styles$p.sticky)
25025
+ className: aphrodite.css(sticky && styles$q.sticky)
25028
25026
  }, preview)));
25029
25027
  });
25030
25028
  const TagsNodeContent = props => {
@@ -25041,9 +25039,9 @@ const TagsNodeContent = props => {
25041
25039
  return null;
25042
25040
  }
25043
25041
  return /*#__PURE__*/React__namespace.createElement("div", {
25044
- className: aphrodite.css(styles$p.columnLeft)
25042
+ className: aphrodite.css(styles$q.columnLeft)
25045
25043
  }, /*#__PURE__*/React__namespace.createElement("div", {
25046
- className: aphrodite.css(styles$p.tagsEditor)
25044
+ className: aphrodite.css(styles$q.tagsEditor)
25047
25045
  }, /*#__PURE__*/React__namespace.createElement(GroupMetadataEditor, {
25048
25046
  value: data,
25049
25047
  onChange: newVal => actions.setValueAtPath(path, newVal),
@@ -25074,23 +25072,23 @@ const ArrayNodeContent = props => {
25074
25072
  const subpath = path.concat(i);
25075
25073
  const controls = [i > 0 && /*#__PURE__*/React__namespace.createElement("div", {
25076
25074
  key: "moveArrayElementUp",
25077
- className: aphrodite.css(styles$p.control)
25075
+ className: aphrodite.css(styles$q.control)
25078
25076
  }, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
25079
25077
  color: "orange",
25080
25078
  title: "Move up",
25081
25079
  onClick: () => actions.moveArrayElementUp(subpath)
25082
25080
  }, /*#__PURE__*/React__namespace.createElement("div", {
25083
- className: aphrodite.css(styles$p.verticalFlip)
25081
+ className: aphrodite.css(styles$q.verticalFlip)
25084
25082
  }, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconChevronDown)))), i < data.length - 1 && /*#__PURE__*/React__namespace.createElement("div", {
25085
25083
  key: "moveArrayElementDown",
25086
- className: aphrodite.css(styles$p.control)
25084
+ className: aphrodite.css(styles$q.control)
25087
25085
  }, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
25088
25086
  color: "orange",
25089
25087
  title: "Move down",
25090
25088
  onClick: () => actions.moveArrayElementDown(subpath)
25091
25089
  }, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconChevronDown))), /*#__PURE__*/React__namespace.createElement("div", {
25092
25090
  key: "removeArrayElement",
25093
- className: aphrodite.css(styles$p.control)
25091
+ className: aphrodite.css(styles$q.control)
25094
25092
  }, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
25095
25093
  color: "orange",
25096
25094
  title: "Delete",
@@ -25098,7 +25096,7 @@ const ArrayNodeContent = props => {
25098
25096
  }, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconTrash$4)))];
25099
25097
  return /*#__PURE__*/React__namespace.createElement("div", {
25100
25098
  key: i,
25101
- className: aphrodite.css(styles$p.arrayElement, !elementIsLeaf && styles$p.arrayElementAndNotLeaf)
25099
+ className: aphrodite.css(styles$q.arrayElement, !elementIsLeaf && styles$q.arrayElementAndNotLeaf)
25102
25100
  }, /*#__PURE__*/React__namespace.createElement(NodeContainer, _extends({}, otherProps, {
25103
25101
  key: i,
25104
25102
  shape: shape.elementShape,
@@ -25124,7 +25122,7 @@ const ObjectNodeContent = props => {
25124
25122
  // made sense to the shape's author is the order in which we'll iterate :)
25125
25123
  const children = Object.keys(shape.shape).map(subkey => /*#__PURE__*/React__namespace.createElement("div", {
25126
25124
  key: subkey,
25127
- className: aphrodite.css(styles$p.objectElement)
25125
+ className: aphrodite.css(styles$q.objectElement)
25128
25126
  }, /*#__PURE__*/React__namespace.createElement(NodeContainer, _extends({}, otherProps, {
25129
25127
  shape: shape.shape[subkey],
25130
25128
  data: data[subkey],
@@ -25294,7 +25292,7 @@ class MultiRendererEditor extends React__namespace.Component {
25294
25292
  }, this._renderContent());
25295
25293
  }
25296
25294
  }
25297
- const styles$p = aphrodite.StyleSheet.create({
25295
+ const styles$q = aphrodite.StyleSheet.create({
25298
25296
  // This is used in a number of places throughout this file.
25299
25297
  container: {},
25300
25298
  // eslint-disable-next-line react-native/no-unused-styles
@@ -25446,47 +25444,47 @@ const StatefulArticleEditor = createReactClass__default["default"]({
25446
25444
  screen
25447
25445
  } = this.state;
25448
25446
  return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", {
25449
- style: styles$o.controlBar
25447
+ style: styles$p.controlBar
25450
25448
  }, /*#__PURE__*/React__namespace.createElement("span", {
25451
- style: styles$o.controls
25449
+ style: styles$p.controls
25452
25450
  }, "Mode:", " ", /*#__PURE__*/React__namespace.createElement("span", {
25453
25451
  onClick: () => this.setState({
25454
25452
  mode: "edit"
25455
25453
  }),
25456
- style: mode === "edit" ? styles$o.controlSelected : styles$o.control
25454
+ style: mode === "edit" ? styles$p.controlSelected : styles$p.control
25457
25455
  }, "EDIT"), " | ", /*#__PURE__*/React__namespace.createElement("span", {
25458
25456
  onClick: () => this.setState({
25459
25457
  mode: "preview"
25460
25458
  }),
25461
- style: mode === "preview" ? styles$o.controlSelected : styles$o.control
25459
+ style: mode === "preview" ? styles$p.controlSelected : styles$p.control
25462
25460
  }, "PREVIEW"), " | ", /*#__PURE__*/React__namespace.createElement("span", {
25463
25461
  onClick: () => this.setState({
25464
25462
  mode: "json"
25465
25463
  }),
25466
- style: mode === "json" ? styles$o.controlSelected : styles$o.control
25464
+ style: mode === "json" ? styles$p.controlSelected : styles$p.control
25467
25465
  }, "JSON")), /*#__PURE__*/React__namespace.createElement("span", {
25468
- style: styles$o.controls
25466
+ style: styles$p.controls
25469
25467
  }, "Screen:", " ", /*#__PURE__*/React__namespace.createElement("span", {
25470
25468
  onClick: () => this.setState({
25471
25469
  screen: "phone"
25472
25470
  }),
25473
- style: screen === "phone" ? styles$o.controlSelected : styles$o.control
25471
+ style: screen === "phone" ? styles$p.controlSelected : styles$p.control
25474
25472
  }, "PHONE"), " | ", /*#__PURE__*/React__namespace.createElement("span", {
25475
25473
  onClick: () => this.setState({
25476
25474
  screen: "tablet"
25477
25475
  }),
25478
- style: screen === "tablet" ? styles$o.controlSelected : styles$o.control
25476
+ style: screen === "tablet" ? styles$p.controlSelected : styles$p.control
25479
25477
  }, "TABLET"), " | ", /*#__PURE__*/React__namespace.createElement("span", {
25480
25478
  onClick: () => this.setState({
25481
25479
  screen: "desktop"
25482
25480
  }),
25483
- style: screen === "desktop" ? styles$o.controlSelected : styles$o.control
25481
+ style: screen === "desktop" ? styles$p.controlSelected : styles$p.control
25484
25482
  }, "DESKTOP"))), /*#__PURE__*/React__namespace.createElement("div", {
25485
- style: styles$o.editor
25483
+ style: styles$p.editor
25486
25484
  }, /*#__PURE__*/React__namespace.createElement(ArticleEditor, this.state)));
25487
25485
  }
25488
25486
  });
25489
- const styles$o = {
25487
+ const styles$p = {
25490
25488
  controlBar: {
25491
25489
  marginBottom: 25,
25492
25490
  marginTop: 5
@@ -27025,10 +27023,10 @@ class GradedGroupEditor extends React__namespace.Component {
27025
27023
  }, /*#__PURE__*/React__namespace.createElement("div", {
27026
27024
  className: "perseus-widget-row"
27027
27025
  }, /*#__PURE__*/React__namespace.createElement("label", {
27028
- className: aphrodite.css(styles$n.title)
27026
+ className: aphrodite.css(styles$o.title)
27029
27027
  }, "Title:", " ", /*#__PURE__*/React__namespace.createElement(TextInput$6, {
27030
27028
  value: this.props.title,
27031
- className: aphrodite.css(styles$n.input)
27029
+ className: aphrodite.css(styles$o.input)
27032
27030
  // @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
27033
27031
  ,
27034
27032
  onChange: this.change("title")
@@ -27053,7 +27051,7 @@ class GradedGroupEditor extends React__namespace.Component {
27053
27051
  }, /*#__PURE__*/React__namespace.createElement(InlineIcon$4, iconPlus$1), " Add a hint"), this.props.hint && /*#__PURE__*/React__namespace.createElement("div", {
27054
27052
  className: "perseus-hint-editor"
27055
27053
  }, /*#__PURE__*/React__namespace.createElement("div", {
27056
- className: aphrodite.css(styles$n.hintsTitle)
27054
+ className: aphrodite.css(styles$o.hintsTitle)
27057
27055
  }, "Hint"), /*#__PURE__*/React__namespace.createElement(Editor, {
27058
27056
  ref: this.hintEditor,
27059
27057
  content: this.props.hint ? this.props.hint.content : "",
@@ -27085,7 +27083,7 @@ class GradedGroupEditor extends React__namespace.Component {
27085
27083
  };
27086
27084
  };
27087
27085
  }
27088
- const styles$n = aphrodite.StyleSheet.create({
27086
+ const styles$o = aphrodite.StyleSheet.create({
27089
27087
  title: {
27090
27088
  fontSize: 18,
27091
27089
  fontWeight: "bold"
@@ -28455,13 +28453,13 @@ function MathquillInput(props) {
28455
28453
  }
28456
28454
  });
28457
28455
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
28458
- style: styles$m.outerWrapper
28456
+ style: styles$n.outerWrapper
28459
28457
  }, /*#__PURE__*/React__namespace.createElement("span", {
28460
28458
  ref: mathFieldWrapperRef,
28461
28459
  className: "perseus-math-input mq-editable-field mq-math-mode"
28462
28460
  }));
28463
28461
  }
28464
- const styles$m = aphrodite.StyleSheet.create({
28462
+ const styles$n = aphrodite.StyleSheet.create({
28465
28463
  outerWrapper: {
28466
28464
  display: "inline-block",
28467
28465
  borderStyle: "solid",
@@ -29547,7 +29545,7 @@ const GraphPointsCountSelector = _ref => {
29547
29545
  // Never uses placeholder, always has value
29548
29546
  ,
29549
29547
  placeholder: "",
29550
- style: styles$l.singleSelectShort
29548
+ style: styles$m.singleSelectShort
29551
29549
  }, [...[...Array(7).keys()].map(n => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
29552
29550
  key: n,
29553
29551
  value: `${n}`,
@@ -29558,7 +29556,7 @@ const GraphPointsCountSelector = _ref => {
29558
29556
  label: "unlimited"
29559
29557
  })]);
29560
29558
  };
29561
- const styles$l = aphrodite.StyleSheet.create({
29559
+ const styles$m = aphrodite.StyleSheet.create({
29562
29560
  singleSelectShort: {
29563
29561
  // Non-standard spacing, but it's the smallest we can go
29564
29562
  // without running into styling issues with the dropdown.
@@ -29571,7 +29569,7 @@ const GraphTypeSelector = props => {
29571
29569
  selectedValue: props.graphType,
29572
29570
  onChange: props.onChange,
29573
29571
  placeholder: "Select a graph type",
29574
- style: styles$k.singleSelectShort
29572
+ style: styles$l.singleSelectShort
29575
29573
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
29576
29574
  value: "linear",
29577
29575
  label: "Linear function"
@@ -29604,7 +29602,7 @@ const GraphTypeSelector = props => {
29604
29602
  label: "Angle"
29605
29603
  }));
29606
29604
  };
29607
- const styles$k = aphrodite.StyleSheet.create({
29605
+ const styles$l = aphrodite.StyleSheet.create({
29608
29606
  singleSelectShort: {
29609
29607
  // Non-standard spacing, but it's the smallest we can go
29610
29608
  // without running into styling issues with the dropdown.
@@ -29621,16 +29619,16 @@ const LabeledRow = props => {
29621
29619
  style
29622
29620
  } = props;
29623
29621
  return /*#__PURE__*/React__namespace.createElement("label", {
29624
- className: aphrodite.css(styles$j.label)
29622
+ className: aphrodite.css(styles$k.label)
29625
29623
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
29626
- style: [styles$j.row, style]
29624
+ style: [styles$k.row, style]
29627
29625
  }, labelSide === "start" || /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelSmall, {
29628
- style: styles$j.spaceEnd
29626
+ style: styles$k.spaceEnd
29629
29627
  }, label), children, labelSide === "end" && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelSmall, {
29630
- style: styles$j.spaceStart
29628
+ style: styles$k.spaceStart
29631
29629
  }, label)));
29632
29630
  };
29633
- const styles$j = aphrodite.StyleSheet.create({
29631
+ const styles$k = aphrodite.StyleSheet.create({
29634
29632
  label: {
29635
29633
  width: "fit-content"
29636
29634
  },
@@ -30052,10 +30050,10 @@ class InteractiveGraphSettings extends React__namespace.Component {
30052
30050
  onChange: this.change
30053
30051
  }))), /*#__PURE__*/React__namespace.createElement(LabeledRow, {
30054
30052
  label: "Background image URL:",
30055
- style: styles$i.resetSpaceTop
30053
+ style: styles$j.resetSpaceTop
30056
30054
  }, /*#__PURE__*/React__namespace.createElement("input", {
30057
30055
  type: "text",
30058
- className: aphrodite.css(styles$i.backgroundUrlInput),
30056
+ className: aphrodite.css(styles$j.backgroundUrlInput),
30059
30057
  ref: this.bgUrlRef,
30060
30058
  value: this.state.backgroundImage.url || "",
30061
30059
  onChange: e => {
@@ -30071,24 +30069,24 @@ class InteractiveGraphSettings extends React__namespace.Component {
30071
30069
  onKeyPress: this.changeBackgroundUrl,
30072
30070
  onBlur: this.changeBackgroundUrl
30073
30071
  }), /*#__PURE__*/React__namespace.createElement(InfoTip$c, 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, {
30074
- style: styles$i.rulerSection
30072
+ style: styles$j.rulerSection
30075
30073
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30076
- style: styles$i.checkboxRow
30074
+ style: styles$j.checkboxRow
30077
30075
  }, /*#__PURE__*/React__namespace.createElement(PropCheckBox$7, {
30078
30076
  label: "Show ruler",
30079
30077
  showRuler: this.props.showRuler,
30080
30078
  onChange: this.change,
30081
- style: styles$i.resetSpaceTop
30079
+ style: styles$j.resetSpaceTop
30082
30080
  }), /*#__PURE__*/React__namespace.createElement(PropCheckBox$7, {
30083
30081
  label: "Show protractor",
30084
30082
  showProtractor: this.props.showProtractor,
30085
30083
  onChange: this.change,
30086
- style: styles$i.resetSpaceTop
30084
+ style: styles$j.resetSpaceTop
30087
30085
  })), this.props.showRuler && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30088
- style: styles$i.spaceTop
30086
+ style: styles$j.spaceTop
30089
30087
  }, /*#__PURE__*/React__namespace.createElement(LabeledRow, {
30090
30088
  label: "Ruler label:",
30091
- style: styles$i.resetSpaceTop
30089
+ style: styles$j.resetSpaceTop
30092
30090
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
30093
30091
  id: "ruler-label-select",
30094
30092
  selectedValue: this.props.rulerLabel,
@@ -30098,7 +30096,7 @@ class InteractiveGraphSettings extends React__namespace.Component {
30098
30096
  });
30099
30097
  },
30100
30098
  placeholder: "None",
30101
- style: styles$i.singleSelectShort
30099
+ style: styles$j.singleSelectShort
30102
30100
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
30103
30101
  value: "",
30104
30102
  label: "None",
@@ -30139,7 +30137,7 @@ class InteractiveGraphSettings extends React__namespace.Component {
30139
30137
  });
30140
30138
  },
30141
30139
  placeholder: "10",
30142
- style: styles$i.singleSelectShort
30140
+ style: styles$j.singleSelectShort
30143
30141
  }, [1, 2, 4, 8, 10, 16].map(value => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
30144
30142
  key: value,
30145
30143
  value: `${value}`,
@@ -30147,7 +30145,7 @@ class InteractiveGraphSettings extends React__namespace.Component {
30147
30145
  })))))));
30148
30146
  }
30149
30147
  }
30150
- const styles$i = aphrodite.StyleSheet.create({
30148
+ const styles$j = aphrodite.StyleSheet.create({
30151
30149
  resetSpaceTop: {
30152
30150
  marginTop: 0
30153
30151
  },
@@ -30191,10 +30189,10 @@ const LockedFigureSelect = props => {
30191
30189
  onChange
30192
30190
  } = props;
30193
30191
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30194
- style: styles$h.container
30192
+ style: styles$i.container
30195
30193
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.ActionMenu, {
30196
30194
  menuText: "Add locked figure",
30197
- style: styles$h.addElementSelect
30195
+ style: styles$i.addElementSelect
30198
30196
  }, [/*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.ActionItem, {
30199
30197
  key: `${id}-point`,
30200
30198
  label: "Point",
@@ -30205,7 +30203,7 @@ const LockedFigureSelect = props => {
30205
30203
  onClick: () => onChange("line")
30206
30204
  }, "Line")]));
30207
30205
  };
30208
- const styles$h = aphrodite.StyleSheet.create({
30206
+ const styles$i = aphrodite.StyleSheet.create({
30209
30207
  container: {
30210
30208
  marginTop: wonderBlocksTokens.spacing.xxxSmall_4
30211
30209
  },
@@ -30305,13 +30303,13 @@ const ColorSwatch = props => {
30305
30303
  "aria-label":
30306
30304
  // Don't include an aria label for decorative circles.
30307
30305
  !decorative ? `Color: ${color}, ${filled ? "filled" : "open"}` : undefined,
30308
- style: [styles$g.colorSwatch, {
30306
+ style: [styles$h.colorSwatch, {
30309
30307
  border: `4px solid ${perseus.lockedFigureColors[color]}`,
30310
30308
  backgroundColor: filled ? perseus.lockedFigureColors[color] : wonderBlocksTokens.color.white
30311
30309
  }]
30312
30310
  });
30313
30311
  };
30314
- const styles$g = aphrodite.StyleSheet.create({
30312
+ const styles$h = aphrodite.StyleSheet.create({
30315
30313
  colorSwatch: {
30316
30314
  // Add a white outline so that the color swatch is visible when
30317
30315
  // the dropdown option is highlighted with its blue background.
@@ -30330,10 +30328,10 @@ const ColorSelect = props => {
30330
30328
  onChange
30331
30329
  } = props;
30332
30330
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30333
- style: styles$f.row
30331
+ style: styles$g.row
30334
30332
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30335
30333
  htmlFor: id,
30336
- style: styles$f.label,
30334
+ style: styles$g.label,
30337
30335
  tag: "label"
30338
30336
  }, "Color"), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
30339
30337
  id: id,
@@ -30352,7 +30350,7 @@ const ColorSelect = props => {
30352
30350
  })
30353
30351
  }, colorName))));
30354
30352
  };
30355
- const styles$f = aphrodite.StyleSheet.create({
30353
+ const styles$g = aphrodite.StyleSheet.create({
30356
30354
  row: {
30357
30355
  flexDirection: "row",
30358
30356
  alignItems: "center"
@@ -30362,6 +30360,38 @@ const styles$f = aphrodite.StyleSheet.create({
30362
30360
  }
30363
30361
  });
30364
30362
 
30363
+ /**
30364
+ * The part of a locked figure settings panel that contains actions
30365
+ * for this panel and its associated locked figure, including
30366
+ * the delete button.
30367
+ */
30368
+ const LockedFigureSettingsActions = props => {
30369
+ const {
30370
+ onRemove,
30371
+ figureAriaLabel
30372
+ } = props;
30373
+ return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30374
+ style: styles$f.container
30375
+ }, /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
30376
+ startIcon: trashIcon__default["default"],
30377
+ "aria-label": `Delete ${figureAriaLabel}`,
30378
+ onClick: onRemove,
30379
+ kind: "tertiary",
30380
+ style: styles$f.deleteButton
30381
+ }, "Delete"));
30382
+ };
30383
+ const styles$f = aphrodite.StyleSheet.create({
30384
+ container: {
30385
+ width: "100%",
30386
+ flexDirection: "row",
30387
+ alignItems: "center"
30388
+ },
30389
+ deleteButton: {
30390
+ // Line up the delete icon with the rest of the content.
30391
+ marginInlineStart: -wonderBlocksTokens.spacing.xxxSmall_4
30392
+ }
30393
+ });
30394
+
30365
30395
  function focusWithChromeStickyFocusBugWorkaround(element) {
30366
30396
  // NOTE(marksandstrom) Chrome sticky focus bug.
30367
30397
  //
@@ -30565,11 +30595,9 @@ const LockedPointSettings = props => {
30565
30595
  });
30566
30596
  },
30567
30597
  style: styles$e.spaceUnder
30568
- })), onRemove && /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
30569
- icon: trashIcon__default["default"],
30570
- "aria-label": `Delete locked point at ${coordState[0]}, ${coordState[1]}`,
30571
- onClick: onRemove,
30572
- style: styles$e.deleteButton
30598
+ })), onRemove && /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
30599
+ onRemove: onRemove,
30600
+ figureAriaLabel: `locked point at ${coordState[0]}, ${coordState[1]}`
30573
30601
  }))));
30574
30602
  };
30575
30603
  const styles$e = aphrodite.StyleSheet.create({
@@ -30601,11 +30629,6 @@ const styles$e = aphrodite.StyleSheet.create({
30601
30629
  },
30602
30630
  textField: {
30603
30631
  width: wonderBlocksTokens.spacing.xxxLarge_64
30604
- },
30605
- deleteButton: {
30606
- position: "absolute",
30607
- top: wonderBlocksTokens.spacing.small_12,
30608
- right: wonderBlocksTokens.spacing.small_12
30609
30632
  }
30610
30633
  });
30611
30634
 
@@ -30750,13 +30773,11 @@ const LockedLineSettings = props => {
30750
30773
  }),
30751
30774
  onChangeProps: newProps => handleChangePoint(newProps, 1),
30752
30775
  style: styles$d.lockedPointSettingsContainer
30753
- })), /*#__PURE__*/React__namespace.createElement(IconButton__default["default"], {
30754
- icon: trashIcon__default["default"],
30755
- "aria-label": `Delete locked line defined by
30756
- ${startPoint.coord[0]}, ${startPoint.coord[1]} and
30757
- ${endPoint.coord[0]}, ${endPoint.coord[1]}.`,
30758
- onClick: onRemove,
30759
- style: styles$d.deleteButton
30776
+ })), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
30777
+ onRemove: onRemove,
30778
+ figureAriaLabel: `locked line defined by
30779
+ ${startPoint.coord[0]}, ${startPoint.coord[1]} and
30780
+ ${endPoint.coord[0]}, ${endPoint.coord[1]}.`
30760
30781
  }))));
30761
30782
  };
30762
30783
  const styles$d = aphrodite.StyleSheet.create({
@@ -30789,11 +30810,6 @@ const styles$d = aphrodite.StyleSheet.create({
30789
30810
  },
30790
30811
  label: {
30791
30812
  marginInlineEnd: wonderBlocksTokens.spacing.xSmall_8
30792
- },
30793
- deleteButton: {
30794
- position: "absolute",
30795
- top: wonderBlocksTokens.spacing.small_12,
30796
- right: wonderBlocksTokens.spacing.small_12
30797
30813
  }
30798
30814
  });
30799
30815
 
@@ -30830,10 +30846,13 @@ const LockedFiguresSection = props => {
30830
30846
  onChange(newProps);
30831
30847
  }
30832
30848
  function removeLockedFigure(index) {
30833
- const lockedFigures = figures || [];
30834
- onChange({
30835
- lockedFigures: [...lockedFigures.slice(0, index), ...lockedFigures.slice(index + 1)]
30836
- });
30849
+ // eslint-disable-next-line no-alert
30850
+ if (window.confirm("Are you sure you want to delete this figure?")) {
30851
+ const lockedFigures = figures || [];
30852
+ onChange({
30853
+ lockedFigures: [...lockedFigures.slice(0, index), ...lockedFigures.slice(index + 1)]
30854
+ });
30855
+ }
30837
30856
  }
30838
30857
  function changeProps(index,
30839
30858
  // Omit the type from the figure props so it doesn't think
@@ -31097,7 +31116,7 @@ class InteractiveGraphEditor extends React__namespace.Component {
31097
31116
  }), this.props.correct?.numSides !== "unlimited" && /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
31098
31117
  value: "sides",
31099
31118
  label: "side measures"
31100
- })), /*#__PURE__*/React__namespace.createElement(InfoTip$b, null, /*#__PURE__*/React__namespace.createElement("p", null, "These options affect the movement of the vertex points. The grid option will guide the points to the nearest half step along the grid."), /*#__PURE__*/React__namespace.createElement("p", null, "The interior angle and side measure options guide the points to the nearest whole angle or side"), " ", "measure respectively.")), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31119
+ })), /*#__PURE__*/React__namespace.createElement(InfoTip$b, null, /*#__PURE__*/React__namespace.createElement("p", null, "These options affect the movement of the vertex points. The grid option will guide the points to the nearest half step along the grid."), /*#__PURE__*/React__namespace.createElement("p", null, "The interior angle and side measure options guide the points to the nearest whole angle or side measure respectively."))), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31101
31120
  style: styles$a.row
31102
31121
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
31103
31122
  label: /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelSmall, null, "Show angle measures"),