@khanacademy/perseus-editor 6.1.0 → 6.2.1

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
@@ -24,6 +24,7 @@ var mathInput = require('@khanacademy/math-input');
24
24
  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
+ var Banner = require('@khanacademy/wonder-blocks-banner');
27
28
  var wonderBlocksAccordion = require('@khanacademy/wonder-blocks-accordion');
28
29
  var Button = require('@khanacademy/wonder-blocks-button');
29
30
  var trashIcon = require('@phosphor-icons/core/bold/trash-bold.svg');
@@ -59,13 +60,14 @@ var caretRight__default = /*#__PURE__*/_interopDefaultLegacy(caretRight);
59
60
  var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
60
61
  var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
61
62
  var KAS__namespace = /*#__PURE__*/_interopNamespace(KAS);
63
+ var Banner__default = /*#__PURE__*/_interopDefaultLegacy(Banner);
62
64
  var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
63
65
  var trashIcon__default = /*#__PURE__*/_interopDefaultLegacy(trashIcon);
64
66
  var Switch__default = /*#__PURE__*/_interopDefaultLegacy(Switch);
65
67
 
66
68
  // This file is processed by a Rollup plugin (replace) to inject the production
67
69
  const libName = "@khanacademy/perseus-editor";
68
- const libVersion = "6.1.0";
70
+ const libVersion = "6.2.1";
69
71
  perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
70
72
 
71
73
  function _extends() {
@@ -260,13 +262,13 @@ class SectionControlButton extends React__namespace.Component {
260
262
  role: "button",
261
263
  hideDefaultFocusRing: true,
262
264
  "aria-label": title,
263
- style: styles$t.button
265
+ style: styles$u.button
264
266
  }, _ref => {
265
267
  return /*#__PURE__*/React__namespace.createElement(InlineIcon$b, icon);
266
268
  });
267
269
  }
268
270
  }
269
- const styles$t = aphrodite.StyleSheet.create({
271
+ const styles$u = aphrodite.StyleSheet.create({
270
272
  button: {
271
273
  backgroundColor: wonderBlocksTokens.color.gold,
272
274
  margin: 2,
@@ -20785,19 +20787,19 @@ class TexErrorView extends React__namespace.Component {
20785
20787
  const {
20786
20788
  showErrors
20787
20789
  } = this.state;
20788
- const iconStyle = showErrors ? styles$s.iconExpanded : styles$s.iconCollapsed;
20790
+ const iconStyle = showErrors ? styles$t.iconExpanded : styles$t.iconCollapsed;
20789
20791
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
20790
- style: styles$s.errorContainer
20792
+ style: styles$t.errorContainer
20791
20793
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
20792
- style: styles$s.title,
20794
+ style: styles$t.title,
20793
20795
  onClick: this.handleToggleTexErrors
20794
20796
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksIcon.PhosphorIcon, {
20795
20797
  icon: caretRight__default["default"],
20796
20798
  style: iconStyle
20797
20799
  }), "\xA0 TeX Errors (", errorList.length, ")"), showErrors && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
20798
- style: styles$s.errorExplanation
20800
+ style: styles$t.errorExplanation
20799
20801
  }, "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, {
20800
- style: styles$s.error,
20802
+ style: styles$t.error,
20801
20803
  key: index
20802
20804
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
20803
20805
  style: {
@@ -20806,7 +20808,7 @@ class TexErrorView extends React__namespace.Component {
20806
20808
  }, e.math), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, e.message))));
20807
20809
  }
20808
20810
  }
20809
- const styles$s = aphrodite.StyleSheet.create({
20811
+ const styles$t = aphrodite.StyleSheet.create({
20810
20812
  title: {
20811
20813
  backgroundColor: "#eee",
20812
20814
  fontSize: "1.25em",
@@ -24563,12 +24565,12 @@ class SimpleButton extends React__namespace.Component {
24563
24565
  ...otherProps
24564
24566
  } = this.props;
24565
24567
  return /*#__PURE__*/React__namespace.createElement("div", _extends({
24566
- className: aphrodite.css(styles$r.baseButton, color === "green" && styles$r.green, color === "orange" && styles$r.orange),
24568
+ className: aphrodite.css(styles$s.baseButton, color === "green" && styles$s.green, color === "orange" && styles$s.orange),
24567
24569
  onClick: onClick
24568
24570
  }, otherProps), children);
24569
24571
  }
24570
24572
  }
24571
- const styles$r = aphrodite.StyleSheet.create({
24573
+ const styles$s = aphrodite.StyleSheet.create({
24572
24574
  baseButton: {
24573
24575
  top: "0",
24574
24576
  fontSize: "11px",
@@ -24781,23 +24783,23 @@ const LeafContainer = _ref2 => {
24781
24783
  } = _ref2;
24782
24784
  const hasPreviewHeading = shape.type === "content" || shape.type === "hint";
24783
24785
  const previewHeading = hasPreviewHeading && /*#__PURE__*/React__namespace.createElement("div", {
24784
- className: aphrodite.css(styles$q.containerHeader)
24786
+ className: aphrodite.css(styles$r.containerHeader)
24785
24787
  }, /*#__PURE__*/React__namespace.createElement(Header, {
24786
24788
  depth: path.length,
24787
- className: aphrodite.css(styles$q.containerTitle)
24789
+ className: aphrodite.css(styles$r.containerTitle)
24788
24790
  }, capitalize(name)));
24789
24791
  return /*#__PURE__*/React__namespace.createElement("div", {
24790
- className: aphrodite.css(styles$q.container)
24792
+ className: aphrodite.css(styles$r.container)
24791
24793
  }, /*#__PURE__*/React__namespace.createElement("span", {
24792
- className: aphrodite.css(styles$q.row, styles$q.rowHeading)
24794
+ className: aphrodite.css(styles$r.row, styles$r.rowHeading)
24793
24795
  }, /*#__PURE__*/React__namespace.createElement("div", {
24794
- className: aphrodite.css(styles$q.columnLeft)
24796
+ className: aphrodite.css(styles$r.columnLeft)
24795
24797
  }, /*#__PURE__*/React__namespace.createElement("div", {
24796
- className: "pod-title " + aphrodite.css(styles$q.containerHeader)
24798
+ className: "pod-title " + aphrodite.css(styles$r.containerHeader)
24797
24799
  }, /*#__PURE__*/React__namespace.createElement("div", {
24798
- className: aphrodite.css(styles$q.containerTitle)
24800
+ className: aphrodite.css(styles$r.containerTitle)
24799
24801
  }, capitalize(name)), controls)), /*#__PURE__*/React__namespace.createElement("div", {
24800
- className: aphrodite.css(styles$q.columnRight)
24802
+ className: aphrodite.css(styles$r.columnRight)
24801
24803
  }, previewHeading)), children);
24802
24804
  };
24803
24805
  const ArrayContainer = props => {
@@ -24810,11 +24812,11 @@ const ArrayContainer = props => {
24810
24812
  actions
24811
24813
  } = props;
24812
24814
  return /*#__PURE__*/React__namespace.createElement("div", {
24813
- className: aphrodite.css(styles$q.container)
24815
+ className: aphrodite.css(styles$r.container)
24814
24816
  }, controls && /*#__PURE__*/React__namespace.createElement("div", {
24815
- className: aphrodite.css(styles$q.columnLeft, styles$q.containerHeader)
24817
+ className: aphrodite.css(styles$r.columnLeft, styles$r.containerHeader)
24816
24818
  }, controls), /*#__PURE__*/React__namespace.createElement("div", null, children), /*#__PURE__*/React__namespace.createElement("div", {
24817
- className: aphrodite.css(styles$q.columnLeft)
24819
+ className: aphrodite.css(styles$r.columnLeft)
24818
24820
  }, /*#__PURE__*/React__namespace.createElement("a", {
24819
24821
  href: "javascript:void 0",
24820
24822
  onClick: () => actions.addArrayElement(path, shape.elementShape)
@@ -24828,28 +24830,28 @@ const ObjectContainer = _ref3 => {
24828
24830
  path
24829
24831
  } = _ref3;
24830
24832
  const headingEditor = /*#__PURE__*/React__namespace.createElement("div", {
24831
- className: aphrodite.css(styles$q.containerHeader)
24833
+ className: aphrodite.css(styles$r.containerHeader)
24832
24834
  }, /*#__PURE__*/React__namespace.createElement(Header, {
24833
24835
  depth: path.length,
24834
- className: aphrodite.css(styles$q.containerTitle)
24836
+ className: aphrodite.css(styles$r.containerTitle)
24835
24837
  }, capitalize(name)), controls);
24836
24838
  const headingPreview = (name || controls) && /*#__PURE__*/React__namespace.createElement("div", {
24837
- className: aphrodite.css(styles$q.containerHeader, styles$q.previewCollectionHeader)
24839
+ className: aphrodite.css(styles$r.containerHeader, styles$r.previewCollectionHeader)
24838
24840
  }, /*#__PURE__*/React__namespace.createElement(Header, {
24839
24841
  depth: path.length,
24840
- className: aphrodite.css(styles$q.containerTitle)
24842
+ className: aphrodite.css(styles$r.containerTitle)
24841
24843
  }, capitalize(name)));
24842
24844
  const hasBothHeadings = headingEditor && headingPreview;
24843
24845
  return /*#__PURE__*/React__namespace.createElement("div", {
24844
- className: aphrodite.css(styles$q.container)
24846
+ className: aphrodite.css(styles$r.container)
24845
24847
  }, hasBothHeadings && /*#__PURE__*/React__namespace.createElement("span", {
24846
- className: aphrodite.css(styles$q.row)
24848
+ className: aphrodite.css(styles$r.row)
24847
24849
  }, /*#__PURE__*/React__namespace.createElement("div", {
24848
- className: aphrodite.css(styles$q.columnLeft)
24850
+ className: aphrodite.css(styles$r.columnLeft)
24849
24851
  }, headingEditor), /*#__PURE__*/React__namespace.createElement("div", {
24850
- className: aphrodite.css(styles$q.columnRight)
24852
+ className: aphrodite.css(styles$r.columnRight)
24851
24853
  }, headingPreview)), /*#__PURE__*/React__namespace.createElement("div", {
24852
- className: aphrodite.css(path.length > 0 && styles$q.contentIndent)
24854
+ className: aphrodite.css(path.length > 0 && styles$r.contentIndent)
24853
24855
  }, children));
24854
24856
  };
24855
24857
 
@@ -24969,11 +24971,11 @@ const ItemNodeContent = withStickiness(props => {
24969
24971
  className: "framework-perseus"
24970
24972
  }, lens(renderers).get(path));
24971
24973
  return /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement("div", {
24972
- className: aphrodite.css(styles$q.row)
24974
+ className: aphrodite.css(styles$r.row)
24973
24975
  }, /*#__PURE__*/React__namespace.createElement("div", {
24974
- className: aphrodite.css(styles$q.columnLeft)
24976
+ className: aphrodite.css(styles$r.columnLeft)
24975
24977
  }, /*#__PURE__*/React__namespace.createElement("div", {
24976
- className: aphrodite.css(sticky && styles$q.sticky)
24978
+ className: aphrodite.css(sticky && styles$r.sticky)
24977
24979
  },
24978
24980
  /*#__PURE__*/
24979
24981
  // @ts-expect-error - TS2769 - No overload matches this call.
@@ -24981,9 +24983,9 @@ const ItemNodeContent = withStickiness(props => {
24981
24983
  onChange: newVal => actions.mergeValueAtPath(path, newVal),
24982
24984
  apiOptions: apiOptions
24983
24985
  })))), /*#__PURE__*/React__namespace.createElement("div", {
24984
- className: aphrodite.css(styles$q.columnRight)
24986
+ className: aphrodite.css(styles$r.columnRight)
24985
24987
  }, /*#__PURE__*/React__namespace.createElement("div", {
24986
- className: aphrodite.css(sticky && styles$q.sticky)
24988
+ className: aphrodite.css(sticky && styles$r.sticky)
24987
24989
  }, preview))));
24988
24990
  });
24989
24991
  const HintNodeContent = withStickiness(props => {
@@ -24999,13 +25001,13 @@ const HintNodeContent = withStickiness(props => {
24999
25001
  className: "framework-perseus"
25000
25002
  }, lens(renderers).get(path));
25001
25003
  return /*#__PURE__*/React__namespace.createElement("div", {
25002
- className: aphrodite.css(styles$q.row)
25004
+ className: aphrodite.css(styles$r.row)
25003
25005
  }, /*#__PURE__*/React__namespace.createElement("div", {
25004
- className: aphrodite.css(styles$q.columnLeft)
25006
+ className: aphrodite.css(styles$r.columnLeft)
25005
25007
  }, /*#__PURE__*/React__namespace.createElement("div", {
25006
- className: aphrodite.css(sticky && styles$q.sticky)
25008
+ className: aphrodite.css(sticky && styles$r.sticky)
25007
25009
  }, /*#__PURE__*/React__namespace.createElement(HintEditor, _extends({}, data, {
25008
- className: aphrodite.css(styles$q.hintEditor),
25010
+ className: aphrodite.css(styles$r.hintEditor),
25009
25011
  onChange: newVal => actions.mergeValueAtPath(path, newVal),
25010
25012
  apiOptions: apiOptions,
25011
25013
  showTitle: false,
@@ -25020,9 +25022,9 @@ const HintNodeContent = withStickiness(props => {
25020
25022
  isFirst: true,
25021
25023
  isLast: true
25022
25024
  })))), /*#__PURE__*/React__namespace.createElement("div", {
25023
- className: aphrodite.css(styles$q.columnRight)
25025
+ className: aphrodite.css(styles$r.columnRight)
25024
25026
  }, /*#__PURE__*/React__namespace.createElement("div", {
25025
- className: aphrodite.css(sticky && styles$q.sticky)
25027
+ className: aphrodite.css(sticky && styles$r.sticky)
25026
25028
  }, preview)));
25027
25029
  });
25028
25030
  const TagsNodeContent = props => {
@@ -25039,9 +25041,9 @@ const TagsNodeContent = props => {
25039
25041
  return null;
25040
25042
  }
25041
25043
  return /*#__PURE__*/React__namespace.createElement("div", {
25042
- className: aphrodite.css(styles$q.columnLeft)
25044
+ className: aphrodite.css(styles$r.columnLeft)
25043
25045
  }, /*#__PURE__*/React__namespace.createElement("div", {
25044
- className: aphrodite.css(styles$q.tagsEditor)
25046
+ className: aphrodite.css(styles$r.tagsEditor)
25045
25047
  }, /*#__PURE__*/React__namespace.createElement(GroupMetadataEditor, {
25046
25048
  value: data,
25047
25049
  onChange: newVal => actions.setValueAtPath(path, newVal),
@@ -25072,23 +25074,23 @@ const ArrayNodeContent = props => {
25072
25074
  const subpath = path.concat(i);
25073
25075
  const controls = [i > 0 && /*#__PURE__*/React__namespace.createElement("div", {
25074
25076
  key: "moveArrayElementUp",
25075
- className: aphrodite.css(styles$q.control)
25077
+ className: aphrodite.css(styles$r.control)
25076
25078
  }, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
25077
25079
  color: "orange",
25078
25080
  title: "Move up",
25079
25081
  onClick: () => actions.moveArrayElementUp(subpath)
25080
25082
  }, /*#__PURE__*/React__namespace.createElement("div", {
25081
- className: aphrodite.css(styles$q.verticalFlip)
25083
+ className: aphrodite.css(styles$r.verticalFlip)
25082
25084
  }, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconChevronDown)))), i < data.length - 1 && /*#__PURE__*/React__namespace.createElement("div", {
25083
25085
  key: "moveArrayElementDown",
25084
- className: aphrodite.css(styles$q.control)
25086
+ className: aphrodite.css(styles$r.control)
25085
25087
  }, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
25086
25088
  color: "orange",
25087
25089
  title: "Move down",
25088
25090
  onClick: () => actions.moveArrayElementDown(subpath)
25089
25091
  }, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconChevronDown))), /*#__PURE__*/React__namespace.createElement("div", {
25090
25092
  key: "removeArrayElement",
25091
- className: aphrodite.css(styles$q.control)
25093
+ className: aphrodite.css(styles$r.control)
25092
25094
  }, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
25093
25095
  color: "orange",
25094
25096
  title: "Delete",
@@ -25096,7 +25098,7 @@ const ArrayNodeContent = props => {
25096
25098
  }, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconTrash$4)))];
25097
25099
  return /*#__PURE__*/React__namespace.createElement("div", {
25098
25100
  key: i,
25099
- className: aphrodite.css(styles$q.arrayElement, !elementIsLeaf && styles$q.arrayElementAndNotLeaf)
25101
+ className: aphrodite.css(styles$r.arrayElement, !elementIsLeaf && styles$r.arrayElementAndNotLeaf)
25100
25102
  }, /*#__PURE__*/React__namespace.createElement(NodeContainer, _extends({}, otherProps, {
25101
25103
  key: i,
25102
25104
  shape: shape.elementShape,
@@ -25122,7 +25124,7 @@ const ObjectNodeContent = props => {
25122
25124
  // made sense to the shape's author is the order in which we'll iterate :)
25123
25125
  const children = Object.keys(shape.shape).map(subkey => /*#__PURE__*/React__namespace.createElement("div", {
25124
25126
  key: subkey,
25125
- className: aphrodite.css(styles$q.objectElement)
25127
+ className: aphrodite.css(styles$r.objectElement)
25126
25128
  }, /*#__PURE__*/React__namespace.createElement(NodeContainer, _extends({}, otherProps, {
25127
25129
  shape: shape.shape[subkey],
25128
25130
  data: data[subkey],
@@ -25292,7 +25294,7 @@ class MultiRendererEditor extends React__namespace.Component {
25292
25294
  }, this._renderContent());
25293
25295
  }
25294
25296
  }
25295
- const styles$q = aphrodite.StyleSheet.create({
25297
+ const styles$r = aphrodite.StyleSheet.create({
25296
25298
  // This is used in a number of places throughout this file.
25297
25299
  container: {},
25298
25300
  // eslint-disable-next-line react-native/no-unused-styles
@@ -25444,47 +25446,47 @@ const StatefulArticleEditor = createReactClass__default["default"]({
25444
25446
  screen
25445
25447
  } = this.state;
25446
25448
  return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", {
25447
- style: styles$p.controlBar
25449
+ style: styles$q.controlBar
25448
25450
  }, /*#__PURE__*/React__namespace.createElement("span", {
25449
- style: styles$p.controls
25451
+ style: styles$q.controls
25450
25452
  }, "Mode:", " ", /*#__PURE__*/React__namespace.createElement("span", {
25451
25453
  onClick: () => this.setState({
25452
25454
  mode: "edit"
25453
25455
  }),
25454
- style: mode === "edit" ? styles$p.controlSelected : styles$p.control
25456
+ style: mode === "edit" ? styles$q.controlSelected : styles$q.control
25455
25457
  }, "EDIT"), " | ", /*#__PURE__*/React__namespace.createElement("span", {
25456
25458
  onClick: () => this.setState({
25457
25459
  mode: "preview"
25458
25460
  }),
25459
- style: mode === "preview" ? styles$p.controlSelected : styles$p.control
25461
+ style: mode === "preview" ? styles$q.controlSelected : styles$q.control
25460
25462
  }, "PREVIEW"), " | ", /*#__PURE__*/React__namespace.createElement("span", {
25461
25463
  onClick: () => this.setState({
25462
25464
  mode: "json"
25463
25465
  }),
25464
- style: mode === "json" ? styles$p.controlSelected : styles$p.control
25466
+ style: mode === "json" ? styles$q.controlSelected : styles$q.control
25465
25467
  }, "JSON")), /*#__PURE__*/React__namespace.createElement("span", {
25466
- style: styles$p.controls
25468
+ style: styles$q.controls
25467
25469
  }, "Screen:", " ", /*#__PURE__*/React__namespace.createElement("span", {
25468
25470
  onClick: () => this.setState({
25469
25471
  screen: "phone"
25470
25472
  }),
25471
- style: screen === "phone" ? styles$p.controlSelected : styles$p.control
25473
+ style: screen === "phone" ? styles$q.controlSelected : styles$q.control
25472
25474
  }, "PHONE"), " | ", /*#__PURE__*/React__namespace.createElement("span", {
25473
25475
  onClick: () => this.setState({
25474
25476
  screen: "tablet"
25475
25477
  }),
25476
- style: screen === "tablet" ? styles$p.controlSelected : styles$p.control
25478
+ style: screen === "tablet" ? styles$q.controlSelected : styles$q.control
25477
25479
  }, "TABLET"), " | ", /*#__PURE__*/React__namespace.createElement("span", {
25478
25480
  onClick: () => this.setState({
25479
25481
  screen: "desktop"
25480
25482
  }),
25481
- style: screen === "desktop" ? styles$p.controlSelected : styles$p.control
25483
+ style: screen === "desktop" ? styles$q.controlSelected : styles$q.control
25482
25484
  }, "DESKTOP"))), /*#__PURE__*/React__namespace.createElement("div", {
25483
- style: styles$p.editor
25485
+ style: styles$q.editor
25484
25486
  }, /*#__PURE__*/React__namespace.createElement(ArticleEditor, this.state)));
25485
25487
  }
25486
25488
  });
25487
- const styles$p = {
25489
+ const styles$q = {
25488
25490
  controlBar: {
25489
25491
  marginBottom: 25,
25490
25492
  marginTop: 5
@@ -27023,10 +27025,10 @@ class GradedGroupEditor extends React__namespace.Component {
27023
27025
  }, /*#__PURE__*/React__namespace.createElement("div", {
27024
27026
  className: "perseus-widget-row"
27025
27027
  }, /*#__PURE__*/React__namespace.createElement("label", {
27026
- className: aphrodite.css(styles$o.title)
27028
+ className: aphrodite.css(styles$p.title)
27027
27029
  }, "Title:", " ", /*#__PURE__*/React__namespace.createElement(TextInput$6, {
27028
27030
  value: this.props.title,
27029
- className: aphrodite.css(styles$o.input)
27031
+ className: aphrodite.css(styles$p.input)
27030
27032
  // @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
27031
27033
  ,
27032
27034
  onChange: this.change("title")
@@ -27051,7 +27053,7 @@ class GradedGroupEditor extends React__namespace.Component {
27051
27053
  }, /*#__PURE__*/React__namespace.createElement(InlineIcon$4, iconPlus$1), " Add a hint"), this.props.hint && /*#__PURE__*/React__namespace.createElement("div", {
27052
27054
  className: "perseus-hint-editor"
27053
27055
  }, /*#__PURE__*/React__namespace.createElement("div", {
27054
- className: aphrodite.css(styles$o.hintsTitle)
27056
+ className: aphrodite.css(styles$p.hintsTitle)
27055
27057
  }, "Hint"), /*#__PURE__*/React__namespace.createElement(Editor, {
27056
27058
  ref: this.hintEditor,
27057
27059
  content: this.props.hint ? this.props.hint.content : "",
@@ -27083,7 +27085,7 @@ class GradedGroupEditor extends React__namespace.Component {
27083
27085
  };
27084
27086
  };
27085
27087
  }
27086
- const styles$o = aphrodite.StyleSheet.create({
27088
+ const styles$p = aphrodite.StyleSheet.create({
27087
27089
  title: {
27088
27090
  fontSize: 18,
27089
27091
  fontWeight: "bold"
@@ -28453,13 +28455,13 @@ function MathquillInput(props) {
28453
28455
  }
28454
28456
  });
28455
28457
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
28456
- style: styles$n.outerWrapper
28458
+ style: styles$o.outerWrapper
28457
28459
  }, /*#__PURE__*/React__namespace.createElement("span", {
28458
28460
  ref: mathFieldWrapperRef,
28459
28461
  className: "perseus-math-input mq-editable-field mq-math-mode"
28460
28462
  }));
28461
28463
  }
28462
- const styles$n = aphrodite.StyleSheet.create({
28464
+ const styles$o = aphrodite.StyleSheet.create({
28463
28465
  outerWrapper: {
28464
28466
  display: "inline-block",
28465
28467
  borderStyle: "solid",
@@ -29545,7 +29547,7 @@ const GraphPointsCountSelector = _ref => {
29545
29547
  // Never uses placeholder, always has value
29546
29548
  ,
29547
29549
  placeholder: "",
29548
- style: styles$m.singleSelectShort
29550
+ style: styles$n.singleSelectShort
29549
29551
  }, [...[...Array(7).keys()].map(n => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
29550
29552
  key: n,
29551
29553
  value: `${n}`,
@@ -29556,7 +29558,7 @@ const GraphPointsCountSelector = _ref => {
29556
29558
  label: "unlimited"
29557
29559
  })]);
29558
29560
  };
29559
- const styles$m = aphrodite.StyleSheet.create({
29561
+ const styles$n = aphrodite.StyleSheet.create({
29560
29562
  singleSelectShort: {
29561
29563
  // Non-standard spacing, but it's the smallest we can go
29562
29564
  // without running into styling issues with the dropdown.
@@ -29569,7 +29571,7 @@ const GraphTypeSelector = props => {
29569
29571
  selectedValue: props.graphType,
29570
29572
  onChange: props.onChange,
29571
29573
  placeholder: "Select a graph type",
29572
- style: styles$l.singleSelectShort
29574
+ style: styles$m.singleSelectShort
29573
29575
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
29574
29576
  value: "linear",
29575
29577
  label: "Linear function"
@@ -29602,7 +29604,7 @@ const GraphTypeSelector = props => {
29602
29604
  label: "Angle"
29603
29605
  }));
29604
29606
  };
29605
- const styles$l = aphrodite.StyleSheet.create({
29607
+ const styles$m = aphrodite.StyleSheet.create({
29606
29608
  singleSelectShort: {
29607
29609
  // Non-standard spacing, but it's the smallest we can go
29608
29610
  // without running into styling issues with the dropdown.
@@ -29619,16 +29621,16 @@ const LabeledRow = props => {
29619
29621
  style
29620
29622
  } = props;
29621
29623
  return /*#__PURE__*/React__namespace.createElement("label", {
29622
- className: aphrodite.css(styles$k.label)
29624
+ className: aphrodite.css(styles$l.label)
29623
29625
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
29624
- style: [styles$k.row, style]
29626
+ style: [styles$l.row, style]
29625
29627
  }, labelSide === "start" || /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelSmall, {
29626
- style: styles$k.spaceEnd
29628
+ style: styles$l.spaceEnd
29627
29629
  }, label), children, labelSide === "end" && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelSmall, {
29628
- style: styles$k.spaceStart
29630
+ style: styles$l.spaceStart
29629
29631
  }, label)));
29630
29632
  };
29631
- const styles$k = aphrodite.StyleSheet.create({
29633
+ const styles$l = aphrodite.StyleSheet.create({
29632
29634
  label: {
29633
29635
  width: "fit-content"
29634
29636
  },
@@ -30050,10 +30052,10 @@ class InteractiveGraphSettings extends React__namespace.Component {
30050
30052
  onChange: this.change
30051
30053
  }))), /*#__PURE__*/React__namespace.createElement(LabeledRow, {
30052
30054
  label: "Background image URL:",
30053
- style: styles$j.resetSpaceTop
30055
+ style: styles$k.resetSpaceTop
30054
30056
  }, /*#__PURE__*/React__namespace.createElement("input", {
30055
30057
  type: "text",
30056
- className: aphrodite.css(styles$j.backgroundUrlInput),
30058
+ className: aphrodite.css(styles$k.backgroundUrlInput),
30057
30059
  ref: this.bgUrlRef,
30058
30060
  value: this.state.backgroundImage.url || "",
30059
30061
  onChange: e => {
@@ -30069,24 +30071,28 @@ class InteractiveGraphSettings extends React__namespace.Component {
30069
30071
  onKeyPress: this.changeBackgroundUrl,
30070
30072
  onBlur: this.changeBackgroundUrl
30071
30073
  }), /*#__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, {
30072
- style: styles$j.rulerSection
30073
- }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30074
- style: styles$j.checkboxRow
30074
+ style: styles$k.rulerSection
30075
+ }, /*#__PURE__*/React__namespace.createElement(Banner__default["default"], {
30076
+ layout: "floating",
30077
+ text: "The ruler and protractor are not accessible. Please consider an alternate approach.",
30078
+ kind: "warning"
30079
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30080
+ style: styles$k.checkboxRow
30075
30081
  }, /*#__PURE__*/React__namespace.createElement(PropCheckBox$7, {
30076
30082
  label: "Show ruler",
30077
30083
  showRuler: this.props.showRuler,
30078
30084
  onChange: this.change,
30079
- style: styles$j.resetSpaceTop
30085
+ style: styles$k.resetSpaceTop
30080
30086
  }), /*#__PURE__*/React__namespace.createElement(PropCheckBox$7, {
30081
30087
  label: "Show protractor",
30082
30088
  showProtractor: this.props.showProtractor,
30083
30089
  onChange: this.change,
30084
- style: styles$j.resetSpaceTop
30090
+ style: styles$k.resetSpaceTop
30085
30091
  })), this.props.showRuler && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30086
- style: styles$j.spaceTop
30092
+ style: styles$k.spaceTop
30087
30093
  }, /*#__PURE__*/React__namespace.createElement(LabeledRow, {
30088
30094
  label: "Ruler label:",
30089
- style: styles$j.resetSpaceTop
30095
+ style: styles$k.resetSpaceTop
30090
30096
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
30091
30097
  id: "ruler-label-select",
30092
30098
  selectedValue: this.props.rulerLabel,
@@ -30096,7 +30102,7 @@ class InteractiveGraphSettings extends React__namespace.Component {
30096
30102
  });
30097
30103
  },
30098
30104
  placeholder: "None",
30099
- style: styles$j.singleSelectShort
30105
+ style: styles$k.singleSelectShort
30100
30106
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
30101
30107
  value: "",
30102
30108
  label: "None",
@@ -30137,7 +30143,7 @@ class InteractiveGraphSettings extends React__namespace.Component {
30137
30143
  });
30138
30144
  },
30139
30145
  placeholder: "10",
30140
- style: styles$j.singleSelectShort
30146
+ style: styles$k.singleSelectShort
30141
30147
  }, [1, 2, 4, 8, 10, 16].map(value => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
30142
30148
  key: value,
30143
30149
  value: `${value}`,
@@ -30145,7 +30151,7 @@ class InteractiveGraphSettings extends React__namespace.Component {
30145
30151
  })))))));
30146
30152
  }
30147
30153
  }
30148
- const styles$j = aphrodite.StyleSheet.create({
30154
+ const styles$k = aphrodite.StyleSheet.create({
30149
30155
  resetSpaceTop: {
30150
30156
  marginTop: 0
30151
30157
  },
@@ -30165,7 +30171,8 @@ const styles$j = aphrodite.StyleSheet.create({
30165
30171
  checkboxRow: {
30166
30172
  flexDirection: "row",
30167
30173
  alignItems: "center",
30168
- justifyContent: "space-between"
30174
+ justifyContent: "space-between",
30175
+ marginTop: wonderBlocksTokens.spacing.xSmall_8
30169
30176
  },
30170
30177
  rulerSection: {
30171
30178
  marginTop: wonderBlocksTokens.spacing.xSmall_8,
@@ -30189,10 +30196,10 @@ const LockedFigureSelect = props => {
30189
30196
  onChange
30190
30197
  } = props;
30191
30198
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30192
- style: styles$i.container
30199
+ style: styles$j.container
30193
30200
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.ActionMenu, {
30194
30201
  menuText: "Add locked figure",
30195
- style: styles$i.addElementSelect
30202
+ style: styles$j.addElementSelect
30196
30203
  }, [/*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.ActionItem, {
30197
30204
  key: `${id}-point`,
30198
30205
  label: "Point",
@@ -30203,9 +30210,9 @@ const LockedFigureSelect = props => {
30203
30210
  onClick: () => onChange("line")
30204
30211
  }, "Line")]));
30205
30212
  };
30206
- const styles$i = aphrodite.StyleSheet.create({
30213
+ const styles$j = aphrodite.StyleSheet.create({
30207
30214
  container: {
30208
- marginTop: wonderBlocksTokens.spacing.xxxSmall_4
30215
+ marginTop: wonderBlocksTokens.spacing.xSmall_8
30209
30216
  },
30210
30217
  addElementSelect: {
30211
30218
  backgroundColor: wonderBlocksTokens.color.fadedBlue8,
@@ -30303,13 +30310,13 @@ const ColorSwatch = props => {
30303
30310
  "aria-label":
30304
30311
  // Don't include an aria label for decorative circles.
30305
30312
  !decorative ? `Color: ${color}, ${filled ? "filled" : "open"}` : undefined,
30306
- style: [styles$h.colorSwatch, {
30313
+ style: [styles$i.colorSwatch, {
30307
30314
  border: `4px solid ${perseus.lockedFigureColors[color]}`,
30308
30315
  backgroundColor: filled ? perseus.lockedFigureColors[color] : wonderBlocksTokens.color.white
30309
30316
  }]
30310
30317
  });
30311
30318
  };
30312
- const styles$h = aphrodite.StyleSheet.create({
30319
+ const styles$i = aphrodite.StyleSheet.create({
30313
30320
  colorSwatch: {
30314
30321
  // Add a white outline so that the color swatch is visible when
30315
30322
  // the dropdown option is highlighted with its blue background.
@@ -30325,15 +30332,16 @@ const ColorSelect = props => {
30325
30332
  const {
30326
30333
  id,
30327
30334
  selectedValue,
30335
+ style,
30328
30336
  onChange
30329
30337
  } = props;
30330
30338
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30331
- style: styles$g.row
30339
+ style: [styles$h.row, style]
30332
30340
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30333
30341
  htmlFor: id,
30334
- style: styles$g.label,
30342
+ style: styles$h.label,
30335
30343
  tag: "label"
30336
- }, "Color"), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
30344
+ }, "color"), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
30337
30345
  id: id,
30338
30346
  selectedValue: selectedValue,
30339
30347
  onChange: onChange
@@ -30350,13 +30358,55 @@ const ColorSelect = props => {
30350
30358
  })
30351
30359
  }, colorName))));
30352
30360
  };
30353
- const styles$g = aphrodite.StyleSheet.create({
30361
+ const styles$h = aphrodite.StyleSheet.create({
30354
30362
  row: {
30355
30363
  flexDirection: "row",
30356
30364
  alignItems: "center"
30357
30365
  },
30358
30366
  label: {
30359
- marginInlineEnd: wonderBlocksTokens.spacing.xSmall_8
30367
+ marginInlineEnd: wonderBlocksTokens.spacing.xxxSmall_4
30368
+ }
30369
+ });
30370
+
30371
+ const LockedFigureSettingsAccordion = props => {
30372
+ const {
30373
+ children,
30374
+ header,
30375
+ containerStyle,
30376
+ panelStyle
30377
+ } = props;
30378
+ return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View
30379
+ // More specificity so that we can override the default
30380
+ // .heading > h2 > .header styles from the articles.less
30381
+ // file (which is imported in perseus-renderer.less).
30382
+ , {
30383
+ className: "locked-figure-accordion"
30384
+ }, /*#__PURE__*/React__namespace.createElement(wonderBlocksAccordion.AccordionSection, {
30385
+ style: [styles$g.container, containerStyle],
30386
+ headerStyle: styles$g.accordionHeader,
30387
+ header: header
30388
+ }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30389
+ style: [styles$g.accordionPanel, panelStyle]
30390
+ }, children)));
30391
+ };
30392
+ const styles$g = aphrodite.StyleSheet.create({
30393
+ container: {
30394
+ backgroundColor: wonderBlocksTokens.color.fadedBlue8,
30395
+ marginTop: wonderBlocksTokens.spacing.xSmall_8
30396
+ },
30397
+ accordionHeader: {
30398
+ padding: wonderBlocksTokens.spacing.small_12,
30399
+ // Don't move the dropdown caret.
30400
+ paddingInlineEnd: 0,
30401
+ // Fixed height so the addition of the color swatch doesn't
30402
+ // change the height of the header when toggling.
30403
+ height: wonderBlocksTokens.spacing.xxLarge_48
30404
+ },
30405
+ accordionPanel: {
30406
+ paddingTop: wonderBlocksTokens.spacing.xxSmall_6,
30407
+ paddingBottom: wonderBlocksTokens.spacing.xxxSmall_4,
30408
+ paddingLeft: wonderBlocksTokens.spacing.small_12,
30409
+ paddingRight: wonderBlocksTokens.spacing.small_12
30360
30410
  }
30361
30411
  });
30362
30412
 
@@ -30384,7 +30434,8 @@ const styles$f = aphrodite.StyleSheet.create({
30384
30434
  container: {
30385
30435
  width: "100%",
30386
30436
  flexDirection: "row",
30387
- alignItems: "center"
30437
+ alignItems: "center",
30438
+ marginTop: wonderBlocksTokens.spacing.xxxSmall_4
30388
30439
  },
30389
30440
  deleteButton: {
30390
30441
  // Line up the delete icon with the rest of the content.
@@ -30392,6 +30443,35 @@ const styles$f = aphrodite.StyleSheet.create({
30392
30443
  }
30393
30444
  });
30394
30445
 
30446
+ const LabeledSwitch = props => {
30447
+ const {
30448
+ checked,
30449
+ label,
30450
+ style,
30451
+ onChange
30452
+ } = props;
30453
+ const ids = wonderBlocksCore.useUniqueIdWithMock();
30454
+ const switchId = ids.get("switch");
30455
+ return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30456
+ style: [styles$e.row, style]
30457
+ }, /*#__PURE__*/React__namespace.createElement(Switch__default["default"], {
30458
+ id: switchId,
30459
+ checked: checked,
30460
+ onChange: onChange
30461
+ }), /*#__PURE__*/React__namespace.createElement(Strut, {
30462
+ size: wonderBlocksTokens.spacing.xSmall_8
30463
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30464
+ tag: "label",
30465
+ htmlFor: switchId
30466
+ }, label));
30467
+ };
30468
+ const styles$e = aphrodite.StyleSheet.create({
30469
+ row: {
30470
+ flexDirection: "row",
30471
+ alignItems: "center"
30472
+ }
30473
+ });
30474
+
30395
30475
  function focusWithChromeStickyFocusBugWorkaround(element) {
30396
30476
  // NOTE(marksandstrom) Chrome sticky focus bug.
30397
30477
  //
@@ -30437,13 +30517,14 @@ function getValidNumberFromString(value) {
30437
30517
  // If the value is not a number, return 0.
30438
30518
  return isNaN(parsed) ? 0 : parsed;
30439
30519
  }
30520
+ const DEFAULT_COLOR = "grayH";
30440
30521
  function getDefaultFigureForType(type) {
30441
30522
  switch (type) {
30442
30523
  case "point":
30443
30524
  return {
30444
30525
  type: "point",
30445
30526
  coord: [0, 0],
30446
- color: "blue",
30527
+ color: DEFAULT_COLOR,
30447
30528
  filled: true
30448
30529
  };
30449
30530
  case "line":
@@ -30454,9 +30535,8 @@ function getDefaultFigureForType(type) {
30454
30535
  ...getDefaultFigureForType("point"),
30455
30536
  coord: [2, 2]
30456
30537
  }],
30457
- color: "blue",
30538
+ color: DEFAULT_COLOR,
30458
30539
  lineStyle: "solid",
30459
- showArrows: false,
30460
30540
  showStartPoint: false,
30461
30541
  showEndPoint: false
30462
30542
  };
@@ -30496,7 +30576,6 @@ const LockedPointSettings = props => {
30496
30576
  const xCoordId = ids.get("x-coord");
30497
30577
  const yCoordId = ids.get("y-coord");
30498
30578
  const colorSelectId = ids.get("point-color-select");
30499
- const showPointToggleId = ids.get("show-point-toggle");
30500
30579
  function handleBlur() {
30501
30580
  const validCoord = [getValidNumberFromString(coordState[0]), getValidNumberFromString(coordState[1])];
30502
30581
 
@@ -30517,20 +30596,14 @@ const LockedPointSettings = props => {
30517
30596
  color: newValue
30518
30597
  });
30519
30598
  }
30520
- return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View
30521
- // More specificity so that we can override the default
30522
- // .heading > h2 > .header styles from the articles.less
30523
- // file (which is imported in perseus-renderer.less).
30524
- , {
30525
- className: "locked-figure-accordion"
30526
- }, /*#__PURE__*/React__namespace.createElement(wonderBlocksAccordion.AccordionSection, {
30527
- style: [styles$e.container, style],
30528
- headerStyle: styles$e.accordionHeader,
30599
+ return /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsAccordion, {
30600
+ containerStyle: style,
30601
+ panelStyle: !onRemove && styles$d.accordionPanelWithoutActions,
30529
30602
  header:
30530
30603
  /*#__PURE__*/
30531
30604
  // Summary: Point, coords, color (filled/open)
30532
30605
  React__namespace.createElement(wonderBlocksCore.View, {
30533
- style: styles$e.row
30606
+ style: styles$d.row
30534
30607
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, `${label || "Point"} (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React__namespace.createElement(Strut, {
30535
30608
  size: wonderBlocksTokens.spacing.xSmall_8
30536
30609
  }), toggled && /*#__PURE__*/React__namespace.createElement(ColorSwatch, {
@@ -30538,84 +30611,58 @@ const LockedPointSettings = props => {
30538
30611
  filled: filled
30539
30612
  }))
30540
30613
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30541
- style: styles$e.accordionPanel
30542
- }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30543
- style: styles$e.row
30544
- }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30545
- style: [styles$e.row, styles$e.spaceUnder]
30614
+ style: [styles$d.row, styles$d.spaceUnder]
30546
30615
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30547
30616
  htmlFor: xCoordId,
30548
- style: styles$e.label,
30617
+ style: styles$d.label,
30549
30618
  tag: "label"
30550
- }, "x Coord"), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
30619
+ }, "x coord"), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
30551
30620
  id: xCoordId,
30552
30621
  type: "number",
30553
30622
  value: coordState[0],
30554
30623
  onChange: newValue => handleCoordChange(newValue, 0),
30555
30624
  onBlur: handleBlur,
30556
- style: styles$e.textField
30557
- })), /*#__PURE__*/React__namespace.createElement(Strut, {
30625
+ style: styles$d.textField
30626
+ }), /*#__PURE__*/React__namespace.createElement(Strut, {
30558
30627
  size: wonderBlocksTokens.spacing.medium_16
30559
- }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30560
- style: [styles$e.row, styles$e.spaceUnder]
30561
- }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30628
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30562
30629
  htmlFor: yCoordId,
30563
- style: styles$e.label,
30630
+ style: styles$d.label,
30564
30631
  tag: "label"
30565
- }, "y Coord"), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
30632
+ }, "y coord"), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
30566
30633
  id: yCoordId,
30567
30634
  type: "number",
30568
30635
  value: coordState[1],
30569
30636
  onChange: newValue => handleCoordChange(newValue, 1),
30570
30637
  onBlur: handleBlur,
30571
- style: styles$e.textField
30572
- }))), onToggle && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30573
- style: [styles$e.row, styles$e.spaceUnder]
30574
- }, /*#__PURE__*/React__namespace.createElement(Switch__default["default"], {
30575
- id: showPointToggleId,
30638
+ style: styles$d.textField
30639
+ })), onToggle && /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
30640
+ label: "show point on graph",
30576
30641
  checked: !!toggled,
30642
+ style: toggled && styles$d.spaceUnder,
30577
30643
  onChange: onToggle
30578
- }), /*#__PURE__*/React__namespace.createElement(Strut, {
30579
- size: wonderBlocksTokens.spacing.small_12
30580
- }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30581
- tag: "label",
30582
- htmlFor: showPointToggleId
30583
- }, "Show point on graph")), toggled && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
30644
+ }), toggled && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
30584
30645
  id: colorSelectId,
30585
- selectedValue: pointColor || "blue",
30586
- onChange: handleColorChange
30587
- }), /*#__PURE__*/React__namespace.createElement(Strut, {
30588
- size: wonderBlocksTokens.spacing.xSmall_8
30589
- }), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
30590
- label: "Open point",
30646
+ selectedValue: pointColor,
30647
+ onChange: handleColorChange,
30648
+ style: styles$d.spaceUnder
30649
+ }), /*#__PURE__*/React__namespace.createElement(LabeledSwitch, {
30650
+ label: "open point",
30591
30651
  checked: !filled,
30592
30652
  onChange: newValue => {
30593
30653
  onChangeProps({
30594
30654
  filled: !newValue
30595
30655
  });
30596
- },
30597
- style: styles$e.spaceUnder
30656
+ }
30598
30657
  })), onRemove && /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
30599
30658
  onRemove: onRemove,
30600
30659
  figureAriaLabel: `locked point at ${coordState[0]}, ${coordState[1]}`
30601
- }))));
30660
+ }));
30602
30661
  };
30603
- const styles$e = aphrodite.StyleSheet.create({
30604
- container: {
30605
- backgroundColor: wonderBlocksTokens.color.fadedBlue8,
30606
- marginBottom: wonderBlocksTokens.spacing.small_12
30607
- },
30608
- accordionHeader: {
30609
- paddingTop: wonderBlocksTokens.spacing.small_12,
30610
- paddingBottom: wonderBlocksTokens.spacing.small_12,
30611
- paddingInlineStart: wonderBlocksTokens.spacing.medium_16,
30612
- // Fixed height so the addition of the color swatch doesn't
30613
- // change the height of the header when toggling.
30614
- height: wonderBlocksTokens.spacing.xxLarge_48
30615
- },
30616
- accordionPanel: {
30617
- padding: wonderBlocksTokens.spacing.medium_16,
30618
- paddingBottom: wonderBlocksTokens.spacing.xSmall_8
30662
+ const styles$d = aphrodite.StyleSheet.create({
30663
+ accordionPanelWithoutActions: {
30664
+ // Need more space since we don't have the actions' margins.
30665
+ paddingBottom: wonderBlocksTokens.spacing.medium_16
30619
30666
  },
30620
30667
  row: {
30621
30668
  flexDirection: "row",
@@ -30625,7 +30672,7 @@ const styles$e = aphrodite.StyleSheet.create({
30625
30672
  marginBottom: wonderBlocksTokens.spacing.xSmall_8
30626
30673
  },
30627
30674
  label: {
30628
- marginInlineEnd: wonderBlocksTokens.spacing.xSmall_8
30675
+ marginInlineEnd: wonderBlocksTokens.spacing.xxSmall_6
30629
30676
  },
30630
30677
  textField: {
30631
30678
  width: wonderBlocksTokens.spacing.xxxLarge_64
@@ -30636,9 +30683,8 @@ const LockedLineSettings = props => {
30636
30683
  const {
30637
30684
  kind,
30638
30685
  points,
30639
- color: lineColor = "blue",
30686
+ color: lineColor,
30640
30687
  lineStyle = "solid",
30641
- showArrows,
30642
30688
  showStartPoint,
30643
30689
  showEndPoint,
30644
30690
  onChangeProps,
@@ -30677,31 +30723,21 @@ const LockedLineSettings = props => {
30677
30723
  }]
30678
30724
  });
30679
30725
  }
30680
- return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View
30681
- // More specificity so that we can override the default
30682
- // .heading > h2 > .header styles from the articles.less
30683
- // file (which is imported in perseus-renderer.less).
30684
- , {
30685
- className: "locked-figure-accordion"
30686
- }, /*#__PURE__*/React__namespace.createElement(wonderBlocksAccordion.AccordionSection, {
30687
- style: styles$d.container,
30688
- headerStyle: styles$d.accordionHeader,
30726
+ return /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsAccordion, {
30689
30727
  header: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30690
- style: styles$d.row
30728
+ style: styles$c.row
30691
30729
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, null, lineLabel), /*#__PURE__*/React__namespace.createElement(Strut, {
30692
30730
  size: wonderBlocksTokens.spacing.xSmall_8
30693
30731
  }), /*#__PURE__*/React__namespace.createElement(ColorSwatch, {
30694
30732
  color: lineColor
30695
30733
  }))
30696
30734
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30697
- style: styles$d.accordionPanel
30698
- }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30699
- style: [styles$d.row, styles$d.spaceUnder]
30735
+ style: [styles$c.row, styles$c.spaceUnder]
30700
30736
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30701
30737
  htmlFor: kindSelectId,
30702
- style: styles$d.label,
30738
+ style: styles$c.label,
30703
30739
  tag: "label"
30704
- }, "Kind"), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
30740
+ }, "kind"), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
30705
30741
  id: kindSelectId,
30706
30742
  selectedValue: kind,
30707
30743
  onChange: value => onChangeProps({
@@ -30720,20 +30756,20 @@ const LockedLineSettings = props => {
30720
30756
  value: "ray",
30721
30757
  label: "ray"
30722
30758
  }))), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30723
- style: [styles$d.row, styles$d.spaceUnder]
30759
+ style: [styles$c.row, styles$c.spaceUnder]
30724
30760
  }, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
30725
30761
  id: colorSelectId,
30726
- selectedValue: lineColor || "blue",
30762
+ selectedValue: lineColor,
30727
30763
  onChange: handleColorChange
30728
30764
  }), /*#__PURE__*/React__namespace.createElement(Strut, {
30729
- size: wonderBlocksTokens.spacing.medium_16
30765
+ size: wonderBlocksTokens.spacing.small_12
30730
30766
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30731
- style: styles$d.row
30767
+ style: styles$c.row
30732
30768
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30733
30769
  htmlFor: styleSelectId,
30734
- style: styles$d.label,
30770
+ style: styles$c.label,
30735
30771
  tag: "label"
30736
- }, "Style"), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
30772
+ }, "style"), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
30737
30773
  id: styleSelectId,
30738
30774
  selectedValue: lineStyle,
30739
30775
  onChange: value => onChangeProps({
@@ -30741,21 +30777,15 @@ const LockedLineSettings = props => {
30741
30777
  })
30742
30778
  // Placeholder is required, but never gets used.
30743
30779
  ,
30744
- placeholder: ""
30780
+ placeholder: "",
30781
+ style: styles$c.selectMarginOffset
30745
30782
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
30746
30783
  value: "solid",
30747
30784
  label: "solid"
30748
30785
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
30749
30786
  value: "dashed",
30750
30787
  label: "dashed"
30751
- })))), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
30752
- label: "Show arrows",
30753
- checked: showArrows,
30754
- onChange: newValue => onChangeProps({
30755
- showArrows: newValue
30756
- }),
30757
- style: styles$d.spaceUnder
30758
- }), /*#__PURE__*/React__namespace.createElement(LockedPointSettings, _extends({
30788
+ })))), /*#__PURE__*/React__namespace.createElement(LockedPointSettings, _extends({
30759
30789
  label: "Start point",
30760
30790
  toggled: showStartPoint
30761
30791
  }, startPoint, {
@@ -30763,7 +30793,7 @@ const LockedLineSettings = props => {
30763
30793
  showStartPoint: newValue
30764
30794
  }),
30765
30795
  onChangeProps: newProps => handleChangePoint(newProps, 0),
30766
- style: styles$d.lockedPointSettingsContainer
30796
+ style: styles$c.lockedPointSettingsContainer
30767
30797
  })), /*#__PURE__*/React__namespace.createElement(LockedPointSettings, _extends({
30768
30798
  label: "End point",
30769
30799
  toggled: showEndPoint
@@ -30772,31 +30802,18 @@ const LockedLineSettings = props => {
30772
30802
  showEndPoint: newValue
30773
30803
  }),
30774
30804
  onChangeProps: newProps => handleChangePoint(newProps, 1),
30775
- style: styles$d.lockedPointSettingsContainer
30805
+ style: styles$c.lockedPointSettingsContainer
30776
30806
  })), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
30777
30807
  onRemove: onRemove,
30778
30808
  figureAriaLabel: `locked line defined by
30779
30809
  ${startPoint.coord[0]}, ${startPoint.coord[1]} and
30780
30810
  ${endPoint.coord[0]}, ${endPoint.coord[1]}.`
30781
- }))));
30811
+ }));
30782
30812
  };
30783
- const styles$d = aphrodite.StyleSheet.create({
30784
- container: {
30785
- backgroundColor: wonderBlocksTokens.color.fadedBlue8,
30786
- marginBottom: wonderBlocksTokens.spacing.xSmall_8
30787
- },
30788
- accordionHeader: {
30789
- paddingTop: wonderBlocksTokens.spacing.small_12,
30790
- paddingBottom: wonderBlocksTokens.spacing.small_12,
30791
- paddingInlineStart: wonderBlocksTokens.spacing.medium_16
30792
- },
30793
- accordionPanel: {
30794
- padding: wonderBlocksTokens.spacing.medium_16,
30795
- paddingBottom: wonderBlocksTokens.spacing.xSmall_8
30796
- },
30813
+ const styles$c = aphrodite.StyleSheet.create({
30797
30814
  lockedPointSettingsContainer: {
30798
30815
  marginTop: wonderBlocksTokens.spacing.xSmall_8,
30799
- marginBottom: wonderBlocksTokens.spacing.xSmall_8,
30816
+ marginBottom: 0,
30800
30817
  marginLeft: -wonderBlocksTokens.spacing.xxxSmall_4,
30801
30818
  marginRight: -wonderBlocksTokens.spacing.xxxSmall_4,
30802
30819
  backgroundColor: wonderBlocksTokens.color.white
@@ -30809,7 +30826,11 @@ const styles$d = aphrodite.StyleSheet.create({
30809
30826
  marginBottom: wonderBlocksTokens.spacing.xSmall_8
30810
30827
  },
30811
30828
  label: {
30812
- marginInlineEnd: wonderBlocksTokens.spacing.xSmall_8
30829
+ marginInlineEnd: wonderBlocksTokens.spacing.xxxSmall_4
30830
+ },
30831
+ selectMarginOffset: {
30832
+ // Align with the point settings accordions.
30833
+ marginInlineEnd: -wonderBlocksTokens.spacing.xxxSmall_4
30813
30834
  }
30814
30835
  });
30815
30836
 
@@ -30867,9 +30888,7 @@ const LockedFiguresSection = props => {
30867
30888
  };
30868
30889
  onChange(newFigures);
30869
30890
  }
30870
- return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30871
- style: styles$c.container
30872
- }, figures?.map((figure, index) => /*#__PURE__*/React__namespace.createElement(LockedFigureSettings, _extends({
30891
+ return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, figures?.map((figure, index) => /*#__PURE__*/React__namespace.createElement(LockedFigureSettings, _extends({
30873
30892
  key: `${uniqueId}-locked-${figure}-${index}`
30874
30893
  }, figure, {
30875
30894
  onChangeProps: newProps => changeProps(index, newProps),
@@ -30879,11 +30898,6 @@ const LockedFiguresSection = props => {
30879
30898
  onChange: addLockedFigure
30880
30899
  }));
30881
30900
  };
30882
- const styles$c = aphrodite.StyleSheet.create({
30883
- container: {
30884
- paddingTop: wonderBlocksTokens.spacing.large_24
30885
- }
30886
- });
30887
30901
 
30888
30902
  const SegmentCountSelector = _ref => {
30889
30903
  let {