@khanacademy/perseus-editor 6.1.0 → 6.2.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/es/index.js CHANGED
@@ -21,14 +21,14 @@ import { useMathInputI18n, createMathField } from '@khanacademy/math-input';
21
21
  import { SingleSelect, OptionItem, ActionMenu, ActionItem } from '@khanacademy/wonder-blocks-dropdown';
22
22
  import { TextField, Checkbox as Checkbox$1 } from '@khanacademy/wonder-blocks-form';
23
23
  import { LabelSmall, LabelMedium, LabelLarge, BodyMonospace } from '@khanacademy/wonder-blocks-typography';
24
+ import Switch from '@khanacademy/wonder-blocks-switch';
24
25
  import { AccordionSection } from '@khanacademy/wonder-blocks-accordion';
25
26
  import Button from '@khanacademy/wonder-blocks-button';
26
27
  import trashIcon from '@phosphor-icons/core/bold/trash-bold.svg';
27
- import Switch from '@khanacademy/wonder-blocks-switch';
28
28
 
29
29
  // This file is processed by a Rollup plugin (replace) to inject the production
30
30
  const libName = "@khanacademy/perseus-editor";
31
- const libVersion = "6.1.0";
31
+ const libVersion = "6.2.0";
32
32
  addLibraryVersionToPerseusDebug(libName, libVersion);
33
33
 
34
34
  function _extends() {
@@ -218,7 +218,7 @@ class SectionControlButton extends React.Component {
218
218
  role: "button",
219
219
  hideDefaultFocusRing: true,
220
220
  "aria-label": title,
221
- style: styles$t.button
221
+ style: styles$u.button
222
222
  }, ({
223
223
  hovered,
224
224
  focused,
@@ -226,7 +226,7 @@ class SectionControlButton extends React.Component {
226
226
  }) => /*#__PURE__*/React.createElement(InlineIcon$b, icon));
227
227
  }
228
228
  }
229
- const styles$t = StyleSheet.create({
229
+ const styles$u = StyleSheet.create({
230
230
  button: {
231
231
  backgroundColor: color.gold,
232
232
  margin: 2,
@@ -20748,19 +20748,19 @@ class TexErrorView extends React.Component {
20748
20748
  const {
20749
20749
  showErrors
20750
20750
  } = this.state;
20751
- const iconStyle = showErrors ? styles$s.iconExpanded : styles$s.iconCollapsed;
20751
+ const iconStyle = showErrors ? styles$t.iconExpanded : styles$t.iconCollapsed;
20752
20752
  return /*#__PURE__*/React.createElement(View, {
20753
- style: styles$s.errorContainer
20753
+ style: styles$t.errorContainer
20754
20754
  }, /*#__PURE__*/React.createElement(View, {
20755
- style: styles$s.title,
20755
+ style: styles$t.title,
20756
20756
  onClick: this.handleToggleTexErrors
20757
20757
  }, /*#__PURE__*/React.createElement(PhosphorIcon, {
20758
20758
  icon: caretRight,
20759
20759
  style: iconStyle
20760
20760
  }), "\xA0 TeX Errors (", errorList.length, ")"), showErrors && /*#__PURE__*/React.createElement(View, {
20761
- style: styles$s.errorExplanation
20761
+ style: styles$t.errorExplanation
20762
20762
  }, "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.createElement(View, {
20763
- style: styles$s.error,
20763
+ style: styles$t.error,
20764
20764
  key: index
20765
20765
  }, /*#__PURE__*/React.createElement(View, {
20766
20766
  style: {
@@ -20769,7 +20769,7 @@ class TexErrorView extends React.Component {
20769
20769
  }, e.math), /*#__PURE__*/React.createElement(View, null, e.message))));
20770
20770
  }
20771
20771
  }
20772
- const styles$s = StyleSheet.create({
20772
+ const styles$t = StyleSheet.create({
20773
20773
  title: {
20774
20774
  backgroundColor: "#eee",
20775
20775
  fontSize: "1.25em",
@@ -24570,7 +24570,7 @@ class SimpleButton extends React.Component {
24570
24570
  } = _this$props,
24571
24571
  otherProps = _objectWithoutPropertiesLoose(_this$props, _excluded$3);
24572
24572
  return /*#__PURE__*/React.createElement("div", _extends({
24573
- className: css(styles$r.baseButton, color === "green" && styles$r.green, color === "orange" && styles$r.orange),
24573
+ className: css(styles$s.baseButton, color === "green" && styles$s.green, color === "orange" && styles$s.orange),
24574
24574
  onClick: onClick
24575
24575
  }, otherProps), children);
24576
24576
  }
@@ -24585,7 +24585,7 @@ SimpleButton.defaultProps = {
24585
24585
  color: "green",
24586
24586
  onClick: () => {}
24587
24587
  };
24588
- const styles$r = StyleSheet.create({
24588
+ const styles$s = StyleSheet.create({
24589
24589
  baseButton: {
24590
24590
  top: "0",
24591
24591
  fontSize: "11px",
@@ -24805,23 +24805,23 @@ const LeafContainer = ({
24805
24805
  }) => {
24806
24806
  const hasPreviewHeading = shape.type === "content" || shape.type === "hint";
24807
24807
  const previewHeading = hasPreviewHeading && /*#__PURE__*/React.createElement("div", {
24808
- className: css(styles$q.containerHeader)
24808
+ className: css(styles$r.containerHeader)
24809
24809
  }, /*#__PURE__*/React.createElement(Header, {
24810
24810
  depth: path.length,
24811
- className: css(styles$q.containerTitle)
24811
+ className: css(styles$r.containerTitle)
24812
24812
  }, capitalize(name)));
24813
24813
  return /*#__PURE__*/React.createElement("div", {
24814
- className: css(styles$q.container)
24814
+ className: css(styles$r.container)
24815
24815
  }, /*#__PURE__*/React.createElement("span", {
24816
- className: css(styles$q.row, styles$q.rowHeading)
24816
+ className: css(styles$r.row, styles$r.rowHeading)
24817
24817
  }, /*#__PURE__*/React.createElement("div", {
24818
- className: css(styles$q.columnLeft)
24818
+ className: css(styles$r.columnLeft)
24819
24819
  }, /*#__PURE__*/React.createElement("div", {
24820
- className: "pod-title " + css(styles$q.containerHeader)
24820
+ className: "pod-title " + css(styles$r.containerHeader)
24821
24821
  }, /*#__PURE__*/React.createElement("div", {
24822
- className: css(styles$q.containerTitle)
24822
+ className: css(styles$r.containerTitle)
24823
24823
  }, capitalize(name)), controls)), /*#__PURE__*/React.createElement("div", {
24824
- className: css(styles$q.columnRight)
24824
+ className: css(styles$r.columnRight)
24825
24825
  }, previewHeading)), children);
24826
24826
  };
24827
24827
  const ArrayContainer = props => {
@@ -24834,11 +24834,11 @@ const ArrayContainer = props => {
24834
24834
  actions
24835
24835
  } = props;
24836
24836
  return /*#__PURE__*/React.createElement("div", {
24837
- className: css(styles$q.container)
24837
+ className: css(styles$r.container)
24838
24838
  }, controls && /*#__PURE__*/React.createElement("div", {
24839
- className: css(styles$q.columnLeft, styles$q.containerHeader)
24839
+ className: css(styles$r.columnLeft, styles$r.containerHeader)
24840
24840
  }, controls), /*#__PURE__*/React.createElement("div", null, children), /*#__PURE__*/React.createElement("div", {
24841
- className: css(styles$q.columnLeft)
24841
+ className: css(styles$r.columnLeft)
24842
24842
  }, /*#__PURE__*/React.createElement("a", {
24843
24843
  href: "javascript:void 0",
24844
24844
  onClick: () => actions.addArrayElement(path, shape.elementShape)
@@ -24851,28 +24851,28 @@ const ObjectContainer = ({
24851
24851
  path
24852
24852
  }) => {
24853
24853
  const headingEditor = /*#__PURE__*/React.createElement("div", {
24854
- className: css(styles$q.containerHeader)
24854
+ className: css(styles$r.containerHeader)
24855
24855
  }, /*#__PURE__*/React.createElement(Header, {
24856
24856
  depth: path.length,
24857
- className: css(styles$q.containerTitle)
24857
+ className: css(styles$r.containerTitle)
24858
24858
  }, capitalize(name)), controls);
24859
24859
  const headingPreview = (name || controls) && /*#__PURE__*/React.createElement("div", {
24860
- className: css(styles$q.containerHeader, styles$q.previewCollectionHeader)
24860
+ className: css(styles$r.containerHeader, styles$r.previewCollectionHeader)
24861
24861
  }, /*#__PURE__*/React.createElement(Header, {
24862
24862
  depth: path.length,
24863
- className: css(styles$q.containerTitle)
24863
+ className: css(styles$r.containerTitle)
24864
24864
  }, capitalize(name)));
24865
24865
  const hasBothHeadings = headingEditor && headingPreview;
24866
24866
  return /*#__PURE__*/React.createElement("div", {
24867
- className: css(styles$q.container)
24867
+ className: css(styles$r.container)
24868
24868
  }, hasBothHeadings && /*#__PURE__*/React.createElement("span", {
24869
- className: css(styles$q.row)
24869
+ className: css(styles$r.row)
24870
24870
  }, /*#__PURE__*/React.createElement("div", {
24871
- className: css(styles$q.columnLeft)
24871
+ className: css(styles$r.columnLeft)
24872
24872
  }, headingEditor), /*#__PURE__*/React.createElement("div", {
24873
- className: css(styles$q.columnRight)
24873
+ className: css(styles$r.columnRight)
24874
24874
  }, headingPreview)), /*#__PURE__*/React.createElement("div", {
24875
- className: css(path.length > 0 && styles$q.contentIndent)
24875
+ className: css(path.length > 0 && styles$r.contentIndent)
24876
24876
  }, children));
24877
24877
  };
24878
24878
 
@@ -24995,11 +24995,11 @@ const ItemNodeContent = withStickiness(props => {
24995
24995
  className: "framework-perseus"
24996
24996
  }, lens(renderers).get(path));
24997
24997
  return /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("div", {
24998
- className: css(styles$q.row)
24998
+ className: css(styles$r.row)
24999
24999
  }, /*#__PURE__*/React.createElement("div", {
25000
- className: css(styles$q.columnLeft)
25000
+ className: css(styles$r.columnLeft)
25001
25001
  }, /*#__PURE__*/React.createElement("div", {
25002
- className: css(sticky && styles$q.sticky)
25002
+ className: css(sticky && styles$r.sticky)
25003
25003
  },
25004
25004
  /*#__PURE__*/
25005
25005
  // @ts-expect-error - TS2769 - No overload matches this call.
@@ -25007,9 +25007,9 @@ const ItemNodeContent = withStickiness(props => {
25007
25007
  onChange: newVal => actions.mergeValueAtPath(path, newVal),
25008
25008
  apiOptions: apiOptions
25009
25009
  })))), /*#__PURE__*/React.createElement("div", {
25010
- className: css(styles$q.columnRight)
25010
+ className: css(styles$r.columnRight)
25011
25011
  }, /*#__PURE__*/React.createElement("div", {
25012
- className: css(sticky && styles$q.sticky)
25012
+ className: css(sticky && styles$r.sticky)
25013
25013
  }, preview))));
25014
25014
  });
25015
25015
  const HintNodeContent = withStickiness(props => {
@@ -25025,13 +25025,13 @@ const HintNodeContent = withStickiness(props => {
25025
25025
  className: "framework-perseus"
25026
25026
  }, lens(renderers).get(path));
25027
25027
  return /*#__PURE__*/React.createElement("div", {
25028
- className: css(styles$q.row)
25028
+ className: css(styles$r.row)
25029
25029
  }, /*#__PURE__*/React.createElement("div", {
25030
- className: css(styles$q.columnLeft)
25030
+ className: css(styles$r.columnLeft)
25031
25031
  }, /*#__PURE__*/React.createElement("div", {
25032
- className: css(sticky && styles$q.sticky)
25032
+ className: css(sticky && styles$r.sticky)
25033
25033
  }, /*#__PURE__*/React.createElement(HintEditor, _extends({}, data, {
25034
- className: css(styles$q.hintEditor),
25034
+ className: css(styles$r.hintEditor),
25035
25035
  onChange: newVal => actions.mergeValueAtPath(path, newVal),
25036
25036
  apiOptions: apiOptions,
25037
25037
  showTitle: false,
@@ -25046,9 +25046,9 @@ const HintNodeContent = withStickiness(props => {
25046
25046
  isFirst: true,
25047
25047
  isLast: true
25048
25048
  })))), /*#__PURE__*/React.createElement("div", {
25049
- className: css(styles$q.columnRight)
25049
+ className: css(styles$r.columnRight)
25050
25050
  }, /*#__PURE__*/React.createElement("div", {
25051
- className: css(sticky && styles$q.sticky)
25051
+ className: css(sticky && styles$r.sticky)
25052
25052
  }, preview)));
25053
25053
  });
25054
25054
  const TagsNodeContent = props => {
@@ -25065,9 +25065,9 @@ const TagsNodeContent = props => {
25065
25065
  return null;
25066
25066
  }
25067
25067
  return /*#__PURE__*/React.createElement("div", {
25068
- className: css(styles$q.columnLeft)
25068
+ className: css(styles$r.columnLeft)
25069
25069
  }, /*#__PURE__*/React.createElement("div", {
25070
- className: css(styles$q.tagsEditor)
25070
+ className: css(styles$r.tagsEditor)
25071
25071
  }, /*#__PURE__*/React.createElement(GroupMetadataEditor, {
25072
25072
  value: data,
25073
25073
  onChange: newVal => actions.setValueAtPath(path, newVal),
@@ -25098,23 +25098,23 @@ const ArrayNodeContent = props => {
25098
25098
  const subpath = path.concat(i);
25099
25099
  const controls = [i > 0 && /*#__PURE__*/React.createElement("div", {
25100
25100
  key: "moveArrayElementUp",
25101
- className: css(styles$q.control)
25101
+ className: css(styles$r.control)
25102
25102
  }, /*#__PURE__*/React.createElement(SimpleButton, {
25103
25103
  color: "orange",
25104
25104
  title: "Move up",
25105
25105
  onClick: () => actions.moveArrayElementUp(subpath)
25106
25106
  }, /*#__PURE__*/React.createElement("div", {
25107
- className: css(styles$q.verticalFlip)
25107
+ className: css(styles$r.verticalFlip)
25108
25108
  }, /*#__PURE__*/React.createElement(InlineIcon$6, iconChevronDown)))), i < data.length - 1 && /*#__PURE__*/React.createElement("div", {
25109
25109
  key: "moveArrayElementDown",
25110
- className: css(styles$q.control)
25110
+ className: css(styles$r.control)
25111
25111
  }, /*#__PURE__*/React.createElement(SimpleButton, {
25112
25112
  color: "orange",
25113
25113
  title: "Move down",
25114
25114
  onClick: () => actions.moveArrayElementDown(subpath)
25115
25115
  }, /*#__PURE__*/React.createElement(InlineIcon$6, iconChevronDown))), /*#__PURE__*/React.createElement("div", {
25116
25116
  key: "removeArrayElement",
25117
- className: css(styles$q.control)
25117
+ className: css(styles$r.control)
25118
25118
  }, /*#__PURE__*/React.createElement(SimpleButton, {
25119
25119
  color: "orange",
25120
25120
  title: "Delete",
@@ -25122,7 +25122,7 @@ const ArrayNodeContent = props => {
25122
25122
  }, /*#__PURE__*/React.createElement(InlineIcon$6, iconTrash$4)))];
25123
25123
  return /*#__PURE__*/React.createElement("div", {
25124
25124
  key: i,
25125
- className: css(styles$q.arrayElement, !elementIsLeaf && styles$q.arrayElementAndNotLeaf)
25125
+ className: css(styles$r.arrayElement, !elementIsLeaf && styles$r.arrayElementAndNotLeaf)
25126
25126
  }, /*#__PURE__*/React.createElement(NodeContainer, _extends({}, otherProps, {
25127
25127
  key: i,
25128
25128
  shape: shape.elementShape,
@@ -25148,7 +25148,7 @@ const ObjectNodeContent = props => {
25148
25148
  // made sense to the shape's author is the order in which we'll iterate :)
25149
25149
  const children = Object.keys(shape.shape).map(subkey => /*#__PURE__*/React.createElement("div", {
25150
25150
  key: subkey,
25151
- className: css(styles$q.objectElement)
25151
+ className: css(styles$r.objectElement)
25152
25152
  }, /*#__PURE__*/React.createElement(NodeContainer, _extends({}, otherProps, {
25153
25153
  shape: shape.shape[subkey],
25154
25154
  data: data[subkey],
@@ -25315,7 +25315,7 @@ class MultiRendererEditor extends React.Component {
25315
25315
  }, this._renderContent());
25316
25316
  }
25317
25317
  }
25318
- const styles$q = StyleSheet.create({
25318
+ const styles$r = StyleSheet.create({
25319
25319
  // This is used in a number of places throughout this file.
25320
25320
  container: {},
25321
25321
  // eslint-disable-next-line react-native/no-unused-styles
@@ -25467,47 +25467,47 @@ const StatefulArticleEditor = createReactClass({
25467
25467
  screen
25468
25468
  } = this.state;
25469
25469
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
25470
- style: styles$p.controlBar
25470
+ style: styles$q.controlBar
25471
25471
  }, /*#__PURE__*/React.createElement("span", {
25472
- style: styles$p.controls
25472
+ style: styles$q.controls
25473
25473
  }, "Mode:", " ", /*#__PURE__*/React.createElement("span", {
25474
25474
  onClick: () => this.setState({
25475
25475
  mode: "edit"
25476
25476
  }),
25477
- style: mode === "edit" ? styles$p.controlSelected : styles$p.control
25477
+ style: mode === "edit" ? styles$q.controlSelected : styles$q.control
25478
25478
  }, "EDIT"), " | ", /*#__PURE__*/React.createElement("span", {
25479
25479
  onClick: () => this.setState({
25480
25480
  mode: "preview"
25481
25481
  }),
25482
- style: mode === "preview" ? styles$p.controlSelected : styles$p.control
25482
+ style: mode === "preview" ? styles$q.controlSelected : styles$q.control
25483
25483
  }, "PREVIEW"), " | ", /*#__PURE__*/React.createElement("span", {
25484
25484
  onClick: () => this.setState({
25485
25485
  mode: "json"
25486
25486
  }),
25487
- style: mode === "json" ? styles$p.controlSelected : styles$p.control
25487
+ style: mode === "json" ? styles$q.controlSelected : styles$q.control
25488
25488
  }, "JSON")), /*#__PURE__*/React.createElement("span", {
25489
- style: styles$p.controls
25489
+ style: styles$q.controls
25490
25490
  }, "Screen:", " ", /*#__PURE__*/React.createElement("span", {
25491
25491
  onClick: () => this.setState({
25492
25492
  screen: "phone"
25493
25493
  }),
25494
- style: screen === "phone" ? styles$p.controlSelected : styles$p.control
25494
+ style: screen === "phone" ? styles$q.controlSelected : styles$q.control
25495
25495
  }, "PHONE"), " | ", /*#__PURE__*/React.createElement("span", {
25496
25496
  onClick: () => this.setState({
25497
25497
  screen: "tablet"
25498
25498
  }),
25499
- style: screen === "tablet" ? styles$p.controlSelected : styles$p.control
25499
+ style: screen === "tablet" ? styles$q.controlSelected : styles$q.control
25500
25500
  }, "TABLET"), " | ", /*#__PURE__*/React.createElement("span", {
25501
25501
  onClick: () => this.setState({
25502
25502
  screen: "desktop"
25503
25503
  }),
25504
- style: screen === "desktop" ? styles$p.controlSelected : styles$p.control
25504
+ style: screen === "desktop" ? styles$q.controlSelected : styles$q.control
25505
25505
  }, "DESKTOP"))), /*#__PURE__*/React.createElement("div", {
25506
- style: styles$p.editor
25506
+ style: styles$q.editor
25507
25507
  }, /*#__PURE__*/React.createElement(ArticleEditor, this.state)));
25508
25508
  }
25509
25509
  });
25510
- const styles$p = {
25510
+ const styles$q = {
25511
25511
  controlBar: {
25512
25512
  marginBottom: 25,
25513
25513
  marginTop: 5
@@ -26997,10 +26997,10 @@ class GradedGroupEditor extends React.Component {
26997
26997
  }, /*#__PURE__*/React.createElement("div", {
26998
26998
  className: "perseus-widget-row"
26999
26999
  }, /*#__PURE__*/React.createElement("label", {
27000
- className: css(styles$o.title)
27000
+ className: css(styles$p.title)
27001
27001
  }, "Title:", " ", /*#__PURE__*/React.createElement(TextInput$6, {
27002
27002
  value: this.props.title,
27003
- className: css(styles$o.input)
27003
+ className: css(styles$p.input)
27004
27004
  // @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
27005
27005
  ,
27006
27006
  onChange: this.change("title")
@@ -27025,7 +27025,7 @@ class GradedGroupEditor extends React.Component {
27025
27025
  }, /*#__PURE__*/React.createElement(InlineIcon$4, iconPlus$1), " Add a hint"), this.props.hint && /*#__PURE__*/React.createElement("div", {
27026
27026
  className: "perseus-hint-editor"
27027
27027
  }, /*#__PURE__*/React.createElement("div", {
27028
- className: css(styles$o.hintsTitle)
27028
+ className: css(styles$p.hintsTitle)
27029
27029
  }, "Hint"), /*#__PURE__*/React.createElement(Editor, {
27030
27030
  ref: this.hintEditor,
27031
27031
  content: this.props.hint ? this.props.hint.content : "",
@@ -27062,7 +27062,7 @@ GradedGroupEditor.defaultProps = {
27062
27062
  images: {},
27063
27063
  hint: null
27064
27064
  };
27065
- const styles$o = StyleSheet.create({
27065
+ const styles$p = StyleSheet.create({
27066
27066
  title: {
27067
27067
  fontSize: 18,
27068
27068
  fontWeight: "bold"
@@ -28400,13 +28400,13 @@ function MathquillInput(props) {
28400
28400
  }
28401
28401
  });
28402
28402
  return /*#__PURE__*/React.createElement(View, {
28403
- style: styles$n.outerWrapper
28403
+ style: styles$o.outerWrapper
28404
28404
  }, /*#__PURE__*/React.createElement("span", {
28405
28405
  ref: mathFieldWrapperRef,
28406
28406
  className: "perseus-math-input mq-editable-field mq-math-mode"
28407
28407
  }));
28408
28408
  }
28409
- const styles$n = StyleSheet.create({
28409
+ const styles$o = StyleSheet.create({
28410
28410
  outerWrapper: {
28411
28411
  display: "inline-block",
28412
28412
  borderStyle: "solid",
@@ -29467,7 +29467,7 @@ const GraphPointsCountSelector = ({
29467
29467
  // Never uses placeholder, always has value
29468
29468
  ,
29469
29469
  placeholder: "",
29470
- style: styles$m.singleSelectShort
29470
+ style: styles$n.singleSelectShort
29471
29471
  }, [...[...Array(7).keys()].map(n => /*#__PURE__*/React.createElement(OptionItem, {
29472
29472
  key: n,
29473
29473
  value: `${n}`,
@@ -29478,7 +29478,7 @@ const GraphPointsCountSelector = ({
29478
29478
  label: "unlimited"
29479
29479
  })]);
29480
29480
  };
29481
- const styles$m = StyleSheet.create({
29481
+ const styles$n = StyleSheet.create({
29482
29482
  singleSelectShort: {
29483
29483
  // Non-standard spacing, but it's the smallest we can go
29484
29484
  // without running into styling issues with the dropdown.
@@ -29491,7 +29491,7 @@ const GraphTypeSelector = props => {
29491
29491
  selectedValue: props.graphType,
29492
29492
  onChange: props.onChange,
29493
29493
  placeholder: "Select a graph type",
29494
- style: styles$l.singleSelectShort
29494
+ style: styles$m.singleSelectShort
29495
29495
  }, /*#__PURE__*/React.createElement(OptionItem, {
29496
29496
  value: "linear",
29497
29497
  label: "Linear function"
@@ -29524,7 +29524,7 @@ const GraphTypeSelector = props => {
29524
29524
  label: "Angle"
29525
29525
  }));
29526
29526
  };
29527
- const styles$l = StyleSheet.create({
29527
+ const styles$m = StyleSheet.create({
29528
29528
  singleSelectShort: {
29529
29529
  // Non-standard spacing, but it's the smallest we can go
29530
29530
  // without running into styling issues with the dropdown.
@@ -29541,16 +29541,16 @@ const LabeledRow = props => {
29541
29541
  style
29542
29542
  } = props;
29543
29543
  return /*#__PURE__*/React.createElement("label", {
29544
- className: css(styles$k.label)
29544
+ className: css(styles$l.label)
29545
29545
  }, /*#__PURE__*/React.createElement(View, {
29546
- style: [styles$k.row, style]
29546
+ style: [styles$l.row, style]
29547
29547
  }, labelSide === "start" || /*#__PURE__*/React.createElement(LabelSmall, {
29548
- style: styles$k.spaceEnd
29548
+ style: styles$l.spaceEnd
29549
29549
  }, label), children, labelSide === "end" && /*#__PURE__*/React.createElement(LabelSmall, {
29550
- style: styles$k.spaceStart
29550
+ style: styles$l.spaceStart
29551
29551
  }, label)));
29552
29552
  };
29553
- const styles$k = StyleSheet.create({
29553
+ const styles$l = StyleSheet.create({
29554
29554
  label: {
29555
29555
  width: "fit-content"
29556
29556
  },
@@ -29944,10 +29944,10 @@ class InteractiveGraphSettings extends React.Component {
29944
29944
  onChange: this.change
29945
29945
  }))), /*#__PURE__*/React.createElement(LabeledRow, {
29946
29946
  label: "Background image URL:",
29947
- style: styles$j.resetSpaceTop
29947
+ style: styles$k.resetSpaceTop
29948
29948
  }, /*#__PURE__*/React.createElement("input", {
29949
29949
  type: "text",
29950
- className: css(styles$j.backgroundUrlInput),
29950
+ className: css(styles$k.backgroundUrlInput),
29951
29951
  ref: this.bgUrlRef,
29952
29952
  value: this.state.backgroundImage.url || "",
29953
29953
  onChange: e => {
@@ -29961,24 +29961,24 @@ class InteractiveGraphSettings extends React.Component {
29961
29961
  onKeyPress: this.changeBackgroundUrl,
29962
29962
  onBlur: this.changeBackgroundUrl
29963
29963
  }), /*#__PURE__*/React.createElement(InfoTip$c, null, /*#__PURE__*/React.createElement("p", null, "Create an image in graphie, or use the \"Add image\" function to create a background."))), /*#__PURE__*/React.createElement(View, {
29964
- style: styles$j.rulerSection
29964
+ style: styles$k.rulerSection
29965
29965
  }, /*#__PURE__*/React.createElement(View, {
29966
- style: styles$j.checkboxRow
29966
+ style: styles$k.checkboxRow
29967
29967
  }, /*#__PURE__*/React.createElement(PropCheckBox$7, {
29968
29968
  label: "Show ruler",
29969
29969
  showRuler: this.props.showRuler,
29970
29970
  onChange: this.change,
29971
- style: styles$j.resetSpaceTop
29971
+ style: styles$k.resetSpaceTop
29972
29972
  }), /*#__PURE__*/React.createElement(PropCheckBox$7, {
29973
29973
  label: "Show protractor",
29974
29974
  showProtractor: this.props.showProtractor,
29975
29975
  onChange: this.change,
29976
- style: styles$j.resetSpaceTop
29976
+ style: styles$k.resetSpaceTop
29977
29977
  })), this.props.showRuler && /*#__PURE__*/React.createElement(View, {
29978
- style: styles$j.spaceTop
29978
+ style: styles$k.spaceTop
29979
29979
  }, /*#__PURE__*/React.createElement(LabeledRow, {
29980
29980
  label: "Ruler label:",
29981
- style: styles$j.resetSpaceTop
29981
+ style: styles$k.resetSpaceTop
29982
29982
  }, /*#__PURE__*/React.createElement(SingleSelect, {
29983
29983
  id: "ruler-label-select",
29984
29984
  selectedValue: this.props.rulerLabel,
@@ -29988,7 +29988,7 @@ class InteractiveGraphSettings extends React.Component {
29988
29988
  });
29989
29989
  },
29990
29990
  placeholder: "None",
29991
- style: styles$j.singleSelectShort
29991
+ style: styles$k.singleSelectShort
29992
29992
  }, /*#__PURE__*/React.createElement(OptionItem, {
29993
29993
  value: "",
29994
29994
  label: "None",
@@ -30029,7 +30029,7 @@ class InteractiveGraphSettings extends React.Component {
30029
30029
  });
30030
30030
  },
30031
30031
  placeholder: "10",
30032
- style: styles$j.singleSelectShort
30032
+ style: styles$k.singleSelectShort
30033
30033
  }, [1, 2, 4, 8, 10, 16].map(value => /*#__PURE__*/React.createElement(OptionItem, {
30034
30034
  key: value,
30035
30035
  value: `${value}`,
@@ -30053,7 +30053,7 @@ InteractiveGraphSettings.defaultProps = {
30053
30053
  rulerLabel: "",
30054
30054
  rulerTicks: 10
30055
30055
  };
30056
- const styles$j = StyleSheet.create({
30056
+ const styles$k = StyleSheet.create({
30057
30057
  resetSpaceTop: {
30058
30058
  marginTop: 0
30059
30059
  },
@@ -30097,10 +30097,10 @@ const LockedFigureSelect = props => {
30097
30097
  onChange
30098
30098
  } = props;
30099
30099
  return /*#__PURE__*/React.createElement(View, {
30100
- style: styles$i.container
30100
+ style: styles$j.container
30101
30101
  }, /*#__PURE__*/React.createElement(ActionMenu, {
30102
30102
  menuText: "Add locked figure",
30103
- style: styles$i.addElementSelect
30103
+ style: styles$j.addElementSelect
30104
30104
  }, [/*#__PURE__*/React.createElement(ActionItem, {
30105
30105
  key: `${id}-point`,
30106
30106
  label: "Point",
@@ -30111,9 +30111,9 @@ const LockedFigureSelect = props => {
30111
30111
  onClick: () => onChange("line")
30112
30112
  }, "Line")]));
30113
30113
  };
30114
- const styles$i = StyleSheet.create({
30114
+ const styles$j = StyleSheet.create({
30115
30115
  container: {
30116
- marginTop: spacing.xxxSmall_4
30116
+ marginTop: spacing.xSmall_8
30117
30117
  },
30118
30118
  addElementSelect: {
30119
30119
  backgroundColor: color.fadedBlue8,
@@ -30211,13 +30211,13 @@ const ColorSwatch = props => {
30211
30211
  "aria-label":
30212
30212
  // Don't include an aria label for decorative circles.
30213
30213
  !decorative ? `Color: ${color$1}, ${filled ? "filled" : "open"}` : undefined,
30214
- style: [styles$h.colorSwatch, {
30214
+ style: [styles$i.colorSwatch, {
30215
30215
  border: `4px solid ${lockedFigureColors[color$1]}`,
30216
30216
  backgroundColor: filled ? lockedFigureColors[color$1] : color.white
30217
30217
  }]
30218
30218
  });
30219
30219
  };
30220
- const styles$h = StyleSheet.create({
30220
+ const styles$i = StyleSheet.create({
30221
30221
  colorSwatch: {
30222
30222
  // Add a white outline so that the color swatch is visible when
30223
30223
  // the dropdown option is highlighted with its blue background.
@@ -30233,15 +30233,16 @@ const ColorSelect = props => {
30233
30233
  const {
30234
30234
  id,
30235
30235
  selectedValue,
30236
+ style,
30236
30237
  onChange
30237
30238
  } = props;
30238
30239
  return /*#__PURE__*/React.createElement(View, {
30239
- style: styles$g.row
30240
+ style: [styles$h.row, style]
30240
30241
  }, /*#__PURE__*/React.createElement(LabelMedium, {
30241
30242
  htmlFor: id,
30242
- style: styles$g.label,
30243
+ style: styles$h.label,
30243
30244
  tag: "label"
30244
- }, "Color"), /*#__PURE__*/React.createElement(SingleSelect, {
30245
+ }, "color"), /*#__PURE__*/React.createElement(SingleSelect, {
30245
30246
  id: id,
30246
30247
  selectedValue: selectedValue,
30247
30248
  onChange: onChange
@@ -30258,13 +30259,84 @@ const ColorSelect = props => {
30258
30259
  })
30259
30260
  }, colorName))));
30260
30261
  };
30261
- const styles$g = StyleSheet.create({
30262
+ const styles$h = StyleSheet.create({
30262
30263
  row: {
30263
30264
  flexDirection: "row",
30264
30265
  alignItems: "center"
30265
30266
  },
30266
30267
  label: {
30267
- marginInlineEnd: spacing.xSmall_8
30268
+ marginInlineEnd: spacing.xxxSmall_4
30269
+ }
30270
+ });
30271
+
30272
+ const LabeledSwitch = props => {
30273
+ const {
30274
+ checked,
30275
+ label,
30276
+ style,
30277
+ onChange
30278
+ } = props;
30279
+ const ids = useUniqueIdWithMock();
30280
+ const switchId = ids.get("switch");
30281
+ return /*#__PURE__*/React.createElement(View, {
30282
+ style: [styles$g.row, style]
30283
+ }, /*#__PURE__*/React.createElement(Switch, {
30284
+ id: switchId,
30285
+ checked: checked,
30286
+ onChange: onChange
30287
+ }), /*#__PURE__*/React.createElement(Strut, {
30288
+ size: spacing.xSmall_8
30289
+ }), /*#__PURE__*/React.createElement(LabelMedium, {
30290
+ tag: "label",
30291
+ htmlFor: switchId
30292
+ }, label));
30293
+ };
30294
+ const styles$g = StyleSheet.create({
30295
+ row: {
30296
+ flexDirection: "row",
30297
+ alignItems: "center"
30298
+ }
30299
+ });
30300
+
30301
+ const LockedFigureSettingsAccordion = props => {
30302
+ const {
30303
+ children,
30304
+ header,
30305
+ containerStyle,
30306
+ panelStyle
30307
+ } = props;
30308
+ return /*#__PURE__*/React.createElement(View
30309
+ // More specificity so that we can override the default
30310
+ // .heading > h2 > .header styles from the articles.less
30311
+ // file (which is imported in perseus-renderer.less).
30312
+ , {
30313
+ className: "locked-figure-accordion"
30314
+ }, /*#__PURE__*/React.createElement(AccordionSection, {
30315
+ style: [styles$f.container, containerStyle],
30316
+ headerStyle: styles$f.accordionHeader,
30317
+ header: header
30318
+ }, /*#__PURE__*/React.createElement(View, {
30319
+ style: [styles$f.accordionPanel, panelStyle]
30320
+ }, children)));
30321
+ };
30322
+ const styles$f = StyleSheet.create({
30323
+ container: {
30324
+ backgroundColor: color.fadedBlue8,
30325
+ marginTop: spacing.xSmall_8
30326
+ },
30327
+ accordionHeader: {
30328
+ padding: spacing.small_12,
30329
+ // Don't move the dropdown caret.
30330
+ paddingInlineEnd: 0,
30331
+ // Fixed height so the addition of the color swatch doesn't
30332
+ // change the height of the header when toggling.
30333
+ height: spacing.xxLarge_48
30334
+ },
30335
+ accordionPanel: {
30336
+ paddingTop: spacing.xxSmall_6,
30337
+ paddingBottom: spacing.xxxSmall_4,
30338
+ paddingLeft: spacing.small_12,
30339
+ paddingRight: spacing.small_12
30268
30340
  }
30269
30341
  });
30270
30342
 
@@ -30279,20 +30351,21 @@ const LockedFigureSettingsActions = props => {
30279
30351
  figureAriaLabel
30280
30352
  } = props;
30281
30353
  return /*#__PURE__*/React.createElement(View, {
30282
- style: styles$f.container
30354
+ style: styles$e.container
30283
30355
  }, /*#__PURE__*/React.createElement(Button, {
30284
30356
  startIcon: trashIcon,
30285
30357
  "aria-label": `Delete ${figureAriaLabel}`,
30286
30358
  onClick: onRemove,
30287
30359
  kind: "tertiary",
30288
- style: styles$f.deleteButton
30360
+ style: styles$e.deleteButton
30289
30361
  }, "Delete"));
30290
30362
  };
30291
- const styles$f = StyleSheet.create({
30363
+ const styles$e = StyleSheet.create({
30292
30364
  container: {
30293
30365
  width: "100%",
30294
30366
  flexDirection: "row",
30295
- alignItems: "center"
30367
+ alignItems: "center",
30368
+ marginTop: spacing.xxxSmall_4
30296
30369
  },
30297
30370
  deleteButton: {
30298
30371
  // Line up the delete icon with the rest of the content.
@@ -30345,13 +30418,14 @@ function getValidNumberFromString(value) {
30345
30418
  // If the value is not a number, return 0.
30346
30419
  return isNaN(parsed) ? 0 : parsed;
30347
30420
  }
30421
+ const DEFAULT_COLOR = "green";
30348
30422
  function getDefaultFigureForType(type) {
30349
30423
  switch (type) {
30350
30424
  case "point":
30351
30425
  return {
30352
30426
  type: "point",
30353
30427
  coord: [0, 0],
30354
- color: "blue",
30428
+ color: DEFAULT_COLOR,
30355
30429
  filled: true
30356
30430
  };
30357
30431
  case "line":
@@ -30361,7 +30435,7 @@ function getDefaultFigureForType(type) {
30361
30435
  points: [getDefaultFigureForType("point"), _extends({}, getDefaultFigureForType("point"), {
30362
30436
  coord: [2, 2]
30363
30437
  })],
30364
- color: "blue",
30438
+ color: DEFAULT_COLOR,
30365
30439
  lineStyle: "solid",
30366
30440
  showArrows: false,
30367
30441
  showStartPoint: false,
@@ -30403,7 +30477,6 @@ const LockedPointSettings = props => {
30403
30477
  const xCoordId = ids.get("x-coord");
30404
30478
  const yCoordId = ids.get("y-coord");
30405
30479
  const colorSelectId = ids.get("point-color-select");
30406
- const showPointToggleId = ids.get("show-point-toggle");
30407
30480
  function handleBlur() {
30408
30481
  const validCoord = [getValidNumberFromString(coordState[0]), getValidNumberFromString(coordState[1])];
30409
30482
 
@@ -30424,20 +30497,14 @@ const LockedPointSettings = props => {
30424
30497
  color: newValue
30425
30498
  });
30426
30499
  }
30427
- return /*#__PURE__*/React.createElement(View
30428
- // More specificity so that we can override the default
30429
- // .heading > h2 > .header styles from the articles.less
30430
- // file (which is imported in perseus-renderer.less).
30431
- , {
30432
- className: "locked-figure-accordion"
30433
- }, /*#__PURE__*/React.createElement(AccordionSection, {
30434
- style: [styles$e.container, style],
30435
- headerStyle: styles$e.accordionHeader,
30500
+ return /*#__PURE__*/React.createElement(LockedFigureSettingsAccordion, {
30501
+ containerStyle: style,
30502
+ panelStyle: !onRemove && styles$d.accordionPanelWithoutActions,
30436
30503
  header:
30437
30504
  /*#__PURE__*/
30438
30505
  // Summary: Point, coords, color (filled/open)
30439
30506
  React.createElement(View, {
30440
- style: styles$e.row
30507
+ style: styles$d.row
30441
30508
  }, /*#__PURE__*/React.createElement(LabelLarge, null, `${label || "Point"} (${coord[0]}, ${coord[1]})`), /*#__PURE__*/React.createElement(Strut, {
30442
30509
  size: spacing.xSmall_8
30443
30510
  }), toggled && /*#__PURE__*/React.createElement(ColorSwatch, {
@@ -30445,84 +30512,58 @@ const LockedPointSettings = props => {
30445
30512
  filled: filled
30446
30513
  }))
30447
30514
  }, /*#__PURE__*/React.createElement(View, {
30448
- style: styles$e.accordionPanel
30449
- }, /*#__PURE__*/React.createElement(View, {
30450
- style: styles$e.row
30451
- }, /*#__PURE__*/React.createElement(View, {
30452
- style: [styles$e.row, styles$e.spaceUnder]
30515
+ style: [styles$d.row, styles$d.spaceUnder]
30453
30516
  }, /*#__PURE__*/React.createElement(LabelMedium, {
30454
30517
  htmlFor: xCoordId,
30455
- style: styles$e.label,
30518
+ style: styles$d.label,
30456
30519
  tag: "label"
30457
- }, "x Coord"), /*#__PURE__*/React.createElement(TextField, {
30520
+ }, "x coord"), /*#__PURE__*/React.createElement(TextField, {
30458
30521
  id: xCoordId,
30459
30522
  type: "number",
30460
30523
  value: coordState[0],
30461
30524
  onChange: newValue => handleCoordChange(newValue, 0),
30462
30525
  onBlur: handleBlur,
30463
- style: styles$e.textField
30464
- })), /*#__PURE__*/React.createElement(Strut, {
30526
+ style: styles$d.textField
30527
+ }), /*#__PURE__*/React.createElement(Strut, {
30465
30528
  size: spacing.medium_16
30466
- }), /*#__PURE__*/React.createElement(View, {
30467
- style: [styles$e.row, styles$e.spaceUnder]
30468
- }, /*#__PURE__*/React.createElement(LabelMedium, {
30529
+ }), /*#__PURE__*/React.createElement(LabelMedium, {
30469
30530
  htmlFor: yCoordId,
30470
- style: styles$e.label,
30531
+ style: styles$d.label,
30471
30532
  tag: "label"
30472
- }, "y Coord"), /*#__PURE__*/React.createElement(TextField, {
30533
+ }, "y coord"), /*#__PURE__*/React.createElement(TextField, {
30473
30534
  id: yCoordId,
30474
30535
  type: "number",
30475
30536
  value: coordState[1],
30476
30537
  onChange: newValue => handleCoordChange(newValue, 1),
30477
30538
  onBlur: handleBlur,
30478
- style: styles$e.textField
30479
- }))), onToggle && /*#__PURE__*/React.createElement(View, {
30480
- style: [styles$e.row, styles$e.spaceUnder]
30481
- }, /*#__PURE__*/React.createElement(Switch, {
30482
- id: showPointToggleId,
30539
+ style: styles$d.textField
30540
+ })), onToggle && /*#__PURE__*/React.createElement(LabeledSwitch, {
30541
+ label: "show point on graph",
30483
30542
  checked: !!toggled,
30543
+ style: toggled && styles$d.spaceUnder,
30484
30544
  onChange: onToggle
30485
- }), /*#__PURE__*/React.createElement(Strut, {
30486
- size: spacing.small_12
30487
- }), /*#__PURE__*/React.createElement(LabelMedium, {
30488
- tag: "label",
30489
- htmlFor: showPointToggleId
30490
- }, "Show point on graph")), toggled && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ColorSelect, {
30545
+ }), toggled && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ColorSelect, {
30491
30546
  id: colorSelectId,
30492
- selectedValue: pointColor || "blue",
30493
- onChange: handleColorChange
30494
- }), /*#__PURE__*/React.createElement(Strut, {
30495
- size: spacing.xSmall_8
30496
- }), /*#__PURE__*/React.createElement(Checkbox$1, {
30497
- label: "Open point",
30547
+ selectedValue: pointColor,
30548
+ onChange: handleColorChange,
30549
+ style: styles$d.spaceUnder
30550
+ }), /*#__PURE__*/React.createElement(LabeledSwitch, {
30551
+ label: "open point",
30498
30552
  checked: !filled,
30499
30553
  onChange: newValue => {
30500
30554
  onChangeProps({
30501
30555
  filled: !newValue
30502
30556
  });
30503
- },
30504
- style: styles$e.spaceUnder
30557
+ }
30505
30558
  })), onRemove && /*#__PURE__*/React.createElement(LockedFigureSettingsActions, {
30506
30559
  onRemove: onRemove,
30507
30560
  figureAriaLabel: `locked point at ${coordState[0]}, ${coordState[1]}`
30508
- }))));
30561
+ }));
30509
30562
  };
30510
- const styles$e = StyleSheet.create({
30511
- container: {
30512
- backgroundColor: color.fadedBlue8,
30513
- marginBottom: spacing.small_12
30514
- },
30515
- accordionHeader: {
30516
- paddingTop: spacing.small_12,
30517
- paddingBottom: spacing.small_12,
30518
- paddingInlineStart: spacing.medium_16,
30519
- // Fixed height so the addition of the color swatch doesn't
30520
- // change the height of the header when toggling.
30521
- height: spacing.xxLarge_48
30522
- },
30523
- accordionPanel: {
30524
- padding: spacing.medium_16,
30525
- paddingBottom: spacing.xSmall_8
30563
+ const styles$d = StyleSheet.create({
30564
+ accordionPanelWithoutActions: {
30565
+ // Need more space since we don't have the actions' margins.
30566
+ paddingBottom: spacing.medium_16
30526
30567
  },
30527
30568
  row: {
30528
30569
  flexDirection: "row",
@@ -30532,7 +30573,7 @@ const styles$e = StyleSheet.create({
30532
30573
  marginBottom: spacing.xSmall_8
30533
30574
  },
30534
30575
  label: {
30535
- marginInlineEnd: spacing.xSmall_8
30576
+ marginInlineEnd: spacing.xxSmall_6
30536
30577
  },
30537
30578
  textField: {
30538
30579
  width: spacing.xxxLarge_64
@@ -30543,7 +30584,7 @@ const LockedLineSettings = props => {
30543
30584
  const {
30544
30585
  kind,
30545
30586
  points,
30546
- color: lineColor = "blue",
30587
+ color: lineColor,
30547
30588
  lineStyle = "solid",
30548
30589
  showArrows,
30549
30590
  showStartPoint,
@@ -30579,31 +30620,21 @@ const LockedLineSettings = props => {
30579
30620
  })]
30580
30621
  });
30581
30622
  }
30582
- return /*#__PURE__*/React.createElement(View
30583
- // More specificity so that we can override the default
30584
- // .heading > h2 > .header styles from the articles.less
30585
- // file (which is imported in perseus-renderer.less).
30586
- , {
30587
- className: "locked-figure-accordion"
30588
- }, /*#__PURE__*/React.createElement(AccordionSection, {
30589
- style: styles$d.container,
30590
- headerStyle: styles$d.accordionHeader,
30623
+ return /*#__PURE__*/React.createElement(LockedFigureSettingsAccordion, {
30591
30624
  header: /*#__PURE__*/React.createElement(View, {
30592
- style: styles$d.row
30625
+ style: styles$c.row
30593
30626
  }, /*#__PURE__*/React.createElement(LabelLarge, null, lineLabel), /*#__PURE__*/React.createElement(Strut, {
30594
30627
  size: spacing.xSmall_8
30595
30628
  }), /*#__PURE__*/React.createElement(ColorSwatch, {
30596
30629
  color: lineColor
30597
30630
  }))
30598
30631
  }, /*#__PURE__*/React.createElement(View, {
30599
- style: styles$d.accordionPanel
30600
- }, /*#__PURE__*/React.createElement(View, {
30601
- style: [styles$d.row, styles$d.spaceUnder]
30632
+ style: [styles$c.row, styles$c.spaceUnder]
30602
30633
  }, /*#__PURE__*/React.createElement(LabelMedium, {
30603
30634
  htmlFor: kindSelectId,
30604
- style: styles$d.label,
30635
+ style: styles$c.label,
30605
30636
  tag: "label"
30606
- }, "Kind"), /*#__PURE__*/React.createElement(SingleSelect, {
30637
+ }, "kind"), /*#__PURE__*/React.createElement(SingleSelect, {
30607
30638
  id: kindSelectId,
30608
30639
  selectedValue: kind,
30609
30640
  onChange: value => onChangeProps({
@@ -30622,20 +30653,20 @@ const LockedLineSettings = props => {
30622
30653
  value: "ray",
30623
30654
  label: "ray"
30624
30655
  }))), /*#__PURE__*/React.createElement(View, {
30625
- style: [styles$d.row, styles$d.spaceUnder]
30656
+ style: [styles$c.row, styles$c.spaceUnder]
30626
30657
  }, /*#__PURE__*/React.createElement(ColorSelect, {
30627
30658
  id: colorSelectId,
30628
- selectedValue: lineColor || "blue",
30659
+ selectedValue: lineColor,
30629
30660
  onChange: handleColorChange
30630
30661
  }), /*#__PURE__*/React.createElement(Strut, {
30631
- size: spacing.medium_16
30662
+ size: spacing.small_12
30632
30663
  }), /*#__PURE__*/React.createElement(View, {
30633
- style: styles$d.row
30664
+ style: styles$c.row
30634
30665
  }, /*#__PURE__*/React.createElement(LabelMedium, {
30635
30666
  htmlFor: styleSelectId,
30636
- style: styles$d.label,
30667
+ style: styles$c.label,
30637
30668
  tag: "label"
30638
- }, "Style"), /*#__PURE__*/React.createElement(SingleSelect, {
30669
+ }, "style"), /*#__PURE__*/React.createElement(SingleSelect, {
30639
30670
  id: styleSelectId,
30640
30671
  selectedValue: lineStyle,
30641
30672
  onChange: value => onChangeProps({
@@ -30643,20 +30674,20 @@ const LockedLineSettings = props => {
30643
30674
  })
30644
30675
  // Placeholder is required, but never gets used.
30645
30676
  ,
30646
- placeholder: ""
30677
+ placeholder: "",
30678
+ style: styles$c.selectMarginOffset
30647
30679
  }, /*#__PURE__*/React.createElement(OptionItem, {
30648
30680
  value: "solid",
30649
30681
  label: "solid"
30650
30682
  }), /*#__PURE__*/React.createElement(OptionItem, {
30651
30683
  value: "dashed",
30652
30684
  label: "dashed"
30653
- })))), /*#__PURE__*/React.createElement(Checkbox$1, {
30654
- label: "Show arrows",
30685
+ })))), /*#__PURE__*/React.createElement(LabeledSwitch, {
30686
+ label: "show arrows",
30655
30687
  checked: showArrows,
30656
30688
  onChange: newValue => onChangeProps({
30657
30689
  showArrows: newValue
30658
- }),
30659
- style: styles$d.spaceUnder
30690
+ })
30660
30691
  }), /*#__PURE__*/React.createElement(LockedPointSettings, _extends({
30661
30692
  label: "Start point",
30662
30693
  toggled: showStartPoint
@@ -30665,7 +30696,7 @@ const LockedLineSettings = props => {
30665
30696
  showStartPoint: newValue
30666
30697
  }),
30667
30698
  onChangeProps: newProps => handleChangePoint(newProps, 0),
30668
- style: styles$d.lockedPointSettingsContainer
30699
+ style: styles$c.lockedPointSettingsContainer
30669
30700
  })), /*#__PURE__*/React.createElement(LockedPointSettings, _extends({
30670
30701
  label: "End point",
30671
30702
  toggled: showEndPoint
@@ -30674,31 +30705,18 @@ const LockedLineSettings = props => {
30674
30705
  showEndPoint: newValue
30675
30706
  }),
30676
30707
  onChangeProps: newProps => handleChangePoint(newProps, 1),
30677
- style: styles$d.lockedPointSettingsContainer
30708
+ style: styles$c.lockedPointSettingsContainer
30678
30709
  })), /*#__PURE__*/React.createElement(LockedFigureSettingsActions, {
30679
30710
  onRemove: onRemove,
30680
30711
  figureAriaLabel: `locked line defined by
30681
30712
  ${startPoint.coord[0]}, ${startPoint.coord[1]} and
30682
30713
  ${endPoint.coord[0]}, ${endPoint.coord[1]}.`
30683
- }))));
30714
+ }));
30684
30715
  };
30685
- const styles$d = StyleSheet.create({
30686
- container: {
30687
- backgroundColor: color.fadedBlue8,
30688
- marginBottom: spacing.xSmall_8
30689
- },
30690
- accordionHeader: {
30691
- paddingTop: spacing.small_12,
30692
- paddingBottom: spacing.small_12,
30693
- paddingInlineStart: spacing.medium_16
30694
- },
30695
- accordionPanel: {
30696
- padding: spacing.medium_16,
30697
- paddingBottom: spacing.xSmall_8
30698
- },
30716
+ const styles$c = StyleSheet.create({
30699
30717
  lockedPointSettingsContainer: {
30700
30718
  marginTop: spacing.xSmall_8,
30701
- marginBottom: spacing.xSmall_8,
30719
+ marginBottom: 0,
30702
30720
  marginLeft: -spacing.xxxSmall_4,
30703
30721
  marginRight: -spacing.xxxSmall_4,
30704
30722
  backgroundColor: color.white
@@ -30711,7 +30729,11 @@ const styles$d = StyleSheet.create({
30711
30729
  marginBottom: spacing.xSmall_8
30712
30730
  },
30713
30731
  label: {
30714
- marginInlineEnd: spacing.xSmall_8
30732
+ marginInlineEnd: spacing.xxxSmall_4
30733
+ },
30734
+ selectMarginOffset: {
30735
+ // Align with the point settings accordions.
30736
+ marginInlineEnd: -spacing.xxxSmall_4
30715
30737
  }
30716
30738
  });
30717
30739
 
@@ -30766,9 +30788,7 @@ const LockedFiguresSection = props => {
30766
30788
  };
30767
30789
  onChange(newFigures);
30768
30790
  }
30769
- return /*#__PURE__*/React.createElement(View, {
30770
- style: styles$c.container
30771
- }, figures == null ? void 0 : figures.map((figure, index) => /*#__PURE__*/React.createElement(LockedFigureSettings, _extends({
30791
+ return /*#__PURE__*/React.createElement(View, null, figures == null ? void 0 : figures.map((figure, index) => /*#__PURE__*/React.createElement(LockedFigureSettings, _extends({
30772
30792
  key: `${uniqueId}-locked-${figure}-${index}`
30773
30793
  }, figure, {
30774
30794
  onChangeProps: newProps => changeProps(index, newProps),
@@ -30778,11 +30798,6 @@ const LockedFiguresSection = props => {
30778
30798
  onChange: addLockedFigure
30779
30799
  }));
30780
30800
  };
30781
- const styles$c = StyleSheet.create({
30782
- container: {
30783
- paddingTop: spacing.large_24
30784
- }
30785
- });
30786
30801
 
30787
30802
  const SegmentCountSelector = ({
30788
30803
  numSegments: _numSegments = 1,