@khanacademy/perseus-editor 14.5.0 → 14.6.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
@@ -29,6 +29,7 @@ var wonderBlocksDropdown = require('@khanacademy/wonder-blocks-dropdown');
29
29
  var Banner = require('@khanacademy/wonder-blocks-banner');
30
30
  var plusCircle = require('@phosphor-icons/core/regular/plus-circle.svg');
31
31
  var wonderBlocksAccordion = require('@khanacademy/wonder-blocks-accordion');
32
+ var pencilCircle = require('@phosphor-icons/core/regular/pencil-circle.svg');
32
33
  var IconButton = require('@khanacademy/wonder-blocks-icon-button');
33
34
  var caretDoubleDownIcon = require('@phosphor-icons/core/bold/caret-double-down-bold.svg');
34
35
  var caretDoubleUpIcon = require('@phosphor-icons/core/bold/caret-double-up-bold.svg');
@@ -79,6 +80,7 @@ var KAS__namespace = /*#__PURE__*/_interopNamespace(KAS);
79
80
  var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
80
81
  var Banner__default = /*#__PURE__*/_interopDefaultLegacy(Banner);
81
82
  var plusCircle__default = /*#__PURE__*/_interopDefaultLegacy(plusCircle);
83
+ var pencilCircle__default = /*#__PURE__*/_interopDefaultLegacy(pencilCircle);
82
84
  var IconButton__default = /*#__PURE__*/_interopDefaultLegacy(IconButton);
83
85
  var caretDoubleDownIcon__default = /*#__PURE__*/_interopDefaultLegacy(caretDoubleDownIcon);
84
86
  var caretDoubleUpIcon__default = /*#__PURE__*/_interopDefaultLegacy(caretDoubleUpIcon);
@@ -96,7 +98,7 @@ var arrowCounterClockwise__default = /*#__PURE__*/_interopDefaultLegacy(arrowCou
96
98
 
97
99
  // This file is processed by a Rollup plugin (replace) to inject the production
98
100
  const libName = "@khanacademy/perseus-editor";
99
- const libVersion = "14.5.0";
101
+ const libVersion = "14.6.1";
100
102
  perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
101
103
 
102
104
  function _extends() {
@@ -291,13 +293,13 @@ class SectionControlButton extends React__namespace.Component {
291
293
  role: "button",
292
294
  hideDefaultFocusRing: true,
293
295
  "aria-label": title,
294
- style: styles$T.button
296
+ style: styles$U.button
295
297
  }, _ref => {
296
298
  return /*#__PURE__*/React__namespace.createElement(InlineIcon$b, icon);
297
299
  });
298
300
  }
299
301
  }
300
- const styles$T = aphrodite.StyleSheet.create({
302
+ const styles$U = aphrodite.StyleSheet.create({
301
303
  button: {
302
304
  backgroundColor: wonderBlocksTokens.color.gold,
303
305
  margin: 2,
@@ -20678,11 +20680,11 @@ class Spring extends React__namespace.Component {
20678
20680
  } = this.props;
20679
20681
  return React__namespace.createElement(wonderBlocksCore.View, {
20680
20682
  "aria-hidden": "true",
20681
- style: [styles$S.grow, style]
20683
+ style: [styles$T.grow, style]
20682
20684
  });
20683
20685
  }
20684
20686
  }
20685
- const styles$S = aphrodite.StyleSheet.create({
20687
+ const styles$T = aphrodite.StyleSheet.create({
20686
20688
  grow: {
20687
20689
  flexGrow: 1
20688
20690
  }
@@ -20925,13 +20927,13 @@ class WidgetSelect extends React__namespace.Component {
20925
20927
  * that collapse a region.
20926
20928
  */
20927
20929
  function ToggleableCaret(props) {
20928
- const iconStyle = props.isExpanded ? styles$R.expanded : styles$R.collapsed;
20930
+ const iconStyle = props.isExpanded ? styles$S.expanded : styles$S.collapsed;
20929
20931
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksIcon.PhosphorIcon, {
20930
20932
  icon: caretRight__default["default"],
20931
20933
  style: iconStyle
20932
20934
  });
20933
20935
  }
20934
- const styles$R = aphrodite.StyleSheet.create({
20936
+ const styles$S = aphrodite.StyleSheet.create({
20935
20937
  collapsed: {
20936
20938
  transition: ".15s"
20937
20939
  },
@@ -20961,16 +20963,16 @@ class TexErrorView extends React__namespace.Component {
20961
20963
  showErrors
20962
20964
  } = this.state;
20963
20965
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
20964
- style: styles$Q.errorContainer
20966
+ style: styles$R.errorContainer
20965
20967
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
20966
- style: styles$Q.title,
20968
+ style: styles$R.title,
20967
20969
  onClick: this.handleToggleTexErrors
20968
20970
  }, /*#__PURE__*/React__namespace.createElement(ToggleableCaret, {
20969
20971
  isExpanded: showErrors
20970
20972
  }), "\xA0 TeX Errors (", errorList.length, ")"), showErrors && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
20971
- style: styles$Q.errorExplanation
20973
+ style: styles$R.errorExplanation
20972
20974
  }, "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, {
20973
- style: styles$Q.error,
20975
+ style: styles$R.error,
20974
20976
  key: index
20975
20977
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
20976
20978
  style: {
@@ -20979,7 +20981,7 @@ class TexErrorView extends React__namespace.Component {
20979
20981
  }, e.math), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, e.message))));
20980
20982
  }
20981
20983
  }
20982
- const styles$Q = aphrodite.StyleSheet.create({
20984
+ const styles$R = aphrodite.StyleSheet.create({
20983
20985
  title: {
20984
20986
  backgroundColor: "#eee",
20985
20987
  fontSize: "1.25em",
@@ -23616,7 +23618,7 @@ class StructuredItemDiff extends React__namespace.Component {
23616
23618
 
23617
23619
  /* eslint-disable @khanacademy/ts-no-error-suppressions */
23618
23620
  const {
23619
- InfoTip: InfoTip$m,
23621
+ InfoTip: InfoTip$n,
23620
23622
  InlineIcon: InlineIcon$7
23621
23623
  } = perseus.components;
23622
23624
  const {
@@ -23690,7 +23692,7 @@ class HintEditor extends React__namespace.Component {
23690
23692
  type: "button",
23691
23693
  className: this.props.isFirst ? "hidden" : "",
23692
23694
  onClick: ___default["default"].partial(this.props.onMove, -1)
23693
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$7, iconCircleArrowUp)), " ", this.props.isLast && /*#__PURE__*/React__namespace.createElement(InfoTip$m, null, /*#__PURE__*/React__namespace.createElement("p", null, "The last hint is automatically bolded."))), /*#__PURE__*/React__namespace.createElement("input", {
23695
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$7, iconCircleArrowUp)), " ", this.props.isLast && /*#__PURE__*/React__namespace.createElement(InfoTip$n, null, /*#__PURE__*/React__namespace.createElement("p", null, "The last hint is automatically bolded."))), /*#__PURE__*/React__namespace.createElement("input", {
23694
23696
  type: "checkbox"
23695
23697
  // @ts-expect-error - TS2322 - Type 'boolean | null | undefined' is not assignable to type 'boolean | undefined'.
23696
23698
  ,
@@ -23918,7 +23920,7 @@ class CombinedHintsEditor extends React__namespace.Component {
23918
23920
  }
23919
23921
 
23920
23922
  const {
23921
- InfoTip: InfoTip$l
23923
+ InfoTip: InfoTip$m
23922
23924
  } = perseus.components;
23923
23925
  class ItemExtrasEditor extends React__namespace.Component {
23924
23926
  static defaultProps = {
@@ -24056,17 +24058,17 @@ class ItemExtrasEditor extends React__namespace.Component {
24056
24058
  }
24057
24059
  }
24058
24060
  const ItemExtraCheckbox = props => /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
24059
- style: [styles$P.checkbox, props.indent ? styles$P.indented : undefined]
24061
+ style: [styles$Q.checkbox, props.indent ? styles$Q.indented : undefined]
24060
24062
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
24061
24063
  label: /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
24062
24064
  style: {
24063
24065
  flexDirection: "row"
24064
24066
  }
24065
- }, props.label, " ", /*#__PURE__*/React__namespace.createElement(InfoTip$l, null, props.infoTip)),
24067
+ }, props.label, " ", /*#__PURE__*/React__namespace.createElement(InfoTip$m, null, props.infoTip)),
24066
24068
  checked: props.checked,
24067
24069
  onChange: newCheckedState => props.onChange(newCheckedState)
24068
24070
  }));
24069
- const styles$P = aphrodite.StyleSheet.create({
24071
+ const styles$Q = aphrodite.StyleSheet.create({
24070
24072
  indented: {
24071
24073
  marginInlineStart: wonderBlocksTokens.spacing.large_24
24072
24074
  }
@@ -24732,12 +24734,12 @@ class SimpleButton extends React__namespace.Component {
24732
24734
  ...otherProps
24733
24735
  } = this.props;
24734
24736
  return /*#__PURE__*/React__namespace.createElement("div", _extends({
24735
- className: aphrodite.css(styles$O.baseButton, color === "green" && styles$O.green, color === "orange" && styles$O.orange),
24737
+ className: aphrodite.css(styles$P.baseButton, color === "green" && styles$P.green, color === "orange" && styles$P.orange),
24736
24738
  onClick: onClick
24737
24739
  }, otherProps), children);
24738
24740
  }
24739
24741
  }
24740
- const styles$O = aphrodite.StyleSheet.create({
24742
+ const styles$P = aphrodite.StyleSheet.create({
24741
24743
  baseButton: {
24742
24744
  top: "0",
24743
24745
  fontSize: "11px",
@@ -24950,23 +24952,23 @@ const LeafContainer = _ref2 => {
24950
24952
  } = _ref2;
24951
24953
  const hasPreviewHeading = shape.type === "content" || shape.type === "hint";
24952
24954
  const previewHeading = hasPreviewHeading && /*#__PURE__*/React__namespace.createElement("div", {
24953
- className: aphrodite.css(styles$N.containerHeader)
24955
+ className: aphrodite.css(styles$O.containerHeader)
24954
24956
  }, /*#__PURE__*/React__namespace.createElement(Header, {
24955
24957
  depth: path.length,
24956
- className: aphrodite.css(styles$N.containerTitle)
24958
+ className: aphrodite.css(styles$O.containerTitle)
24957
24959
  }, capitalize(name)));
24958
24960
  return /*#__PURE__*/React__namespace.createElement("div", {
24959
- className: aphrodite.css(styles$N.container)
24961
+ className: aphrodite.css(styles$O.container)
24960
24962
  }, /*#__PURE__*/React__namespace.createElement("span", {
24961
- className: aphrodite.css(styles$N.row, styles$N.rowHeading)
24963
+ className: aphrodite.css(styles$O.row, styles$O.rowHeading)
24962
24964
  }, /*#__PURE__*/React__namespace.createElement("div", {
24963
- className: aphrodite.css(styles$N.columnLeft)
24965
+ className: aphrodite.css(styles$O.columnLeft)
24964
24966
  }, /*#__PURE__*/React__namespace.createElement("div", {
24965
- className: "pod-title " + aphrodite.css(styles$N.containerHeader)
24967
+ className: "pod-title " + aphrodite.css(styles$O.containerHeader)
24966
24968
  }, /*#__PURE__*/React__namespace.createElement("div", {
24967
- className: aphrodite.css(styles$N.containerTitle)
24969
+ className: aphrodite.css(styles$O.containerTitle)
24968
24970
  }, capitalize(name)), controls)), /*#__PURE__*/React__namespace.createElement("div", {
24969
- className: aphrodite.css(styles$N.columnRight)
24971
+ className: aphrodite.css(styles$O.columnRight)
24970
24972
  }, previewHeading)), children);
24971
24973
  };
24972
24974
  const ArrayContainer = props => {
@@ -24979,11 +24981,11 @@ const ArrayContainer = props => {
24979
24981
  actions
24980
24982
  } = props;
24981
24983
  return /*#__PURE__*/React__namespace.createElement("div", {
24982
- className: aphrodite.css(styles$N.container)
24984
+ className: aphrodite.css(styles$O.container)
24983
24985
  }, controls && /*#__PURE__*/React__namespace.createElement("div", {
24984
- className: aphrodite.css(styles$N.columnLeft, styles$N.containerHeader)
24986
+ className: aphrodite.css(styles$O.columnLeft, styles$O.containerHeader)
24985
24987
  }, controls), /*#__PURE__*/React__namespace.createElement("div", null, children), /*#__PURE__*/React__namespace.createElement("div", {
24986
- className: aphrodite.css(styles$N.columnLeft)
24988
+ className: aphrodite.css(styles$O.columnLeft)
24987
24989
  }, /*#__PURE__*/React__namespace.createElement("a", {
24988
24990
  href: "javascript:void 0",
24989
24991
  onClick: () => actions.addArrayElement(path, shape.elementShape)
@@ -24997,28 +24999,28 @@ const ObjectContainer = _ref3 => {
24997
24999
  path
24998
25000
  } = _ref3;
24999
25001
  const headingEditor = /*#__PURE__*/React__namespace.createElement("div", {
25000
- className: aphrodite.css(styles$N.containerHeader)
25002
+ className: aphrodite.css(styles$O.containerHeader)
25001
25003
  }, /*#__PURE__*/React__namespace.createElement(Header, {
25002
25004
  depth: path.length,
25003
- className: aphrodite.css(styles$N.containerTitle)
25005
+ className: aphrodite.css(styles$O.containerTitle)
25004
25006
  }, capitalize(name)), controls);
25005
25007
  const headingPreview = (name || controls) && /*#__PURE__*/React__namespace.createElement("div", {
25006
- className: aphrodite.css(styles$N.containerHeader, styles$N.previewCollectionHeader)
25008
+ className: aphrodite.css(styles$O.containerHeader, styles$O.previewCollectionHeader)
25007
25009
  }, /*#__PURE__*/React__namespace.createElement(Header, {
25008
25010
  depth: path.length,
25009
- className: aphrodite.css(styles$N.containerTitle)
25011
+ className: aphrodite.css(styles$O.containerTitle)
25010
25012
  }, capitalize(name)));
25011
25013
  const hasBothHeadings = headingEditor && headingPreview;
25012
25014
  return /*#__PURE__*/React__namespace.createElement("div", {
25013
- className: aphrodite.css(styles$N.container)
25015
+ className: aphrodite.css(styles$O.container)
25014
25016
  }, hasBothHeadings && /*#__PURE__*/React__namespace.createElement("span", {
25015
- className: aphrodite.css(styles$N.row)
25017
+ className: aphrodite.css(styles$O.row)
25016
25018
  }, /*#__PURE__*/React__namespace.createElement("div", {
25017
- className: aphrodite.css(styles$N.columnLeft)
25019
+ className: aphrodite.css(styles$O.columnLeft)
25018
25020
  }, headingEditor), /*#__PURE__*/React__namespace.createElement("div", {
25019
- className: aphrodite.css(styles$N.columnRight)
25021
+ className: aphrodite.css(styles$O.columnRight)
25020
25022
  }, headingPreview)), /*#__PURE__*/React__namespace.createElement("div", {
25021
- className: aphrodite.css(path.length > 0 && styles$N.contentIndent)
25023
+ className: aphrodite.css(path.length > 0 && styles$O.contentIndent)
25022
25024
  }, children));
25023
25025
  };
25024
25026
 
@@ -25138,11 +25140,11 @@ const ItemNodeContent = withStickiness(props => {
25138
25140
  className: "framework-perseus"
25139
25141
  }, lens(renderers).get(path));
25140
25142
  return /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement("div", {
25141
- className: aphrodite.css(styles$N.row)
25143
+ className: aphrodite.css(styles$O.row)
25142
25144
  }, /*#__PURE__*/React__namespace.createElement("div", {
25143
- className: aphrodite.css(styles$N.columnLeft)
25145
+ className: aphrodite.css(styles$O.columnLeft)
25144
25146
  }, /*#__PURE__*/React__namespace.createElement("div", {
25145
- className: aphrodite.css(sticky && styles$N.sticky)
25147
+ className: aphrodite.css(sticky && styles$O.sticky)
25146
25148
  },
25147
25149
  /*#__PURE__*/
25148
25150
  // @ts-expect-error - TS2769 - No overload matches this call.
@@ -25150,9 +25152,9 @@ const ItemNodeContent = withStickiness(props => {
25150
25152
  onChange: newVal => actions.mergeValueAtPath(path, newVal),
25151
25153
  apiOptions: apiOptions
25152
25154
  })))), /*#__PURE__*/React__namespace.createElement("div", {
25153
- className: aphrodite.css(styles$N.columnRight)
25155
+ className: aphrodite.css(styles$O.columnRight)
25154
25156
  }, /*#__PURE__*/React__namespace.createElement("div", {
25155
- className: aphrodite.css(sticky && styles$N.sticky)
25157
+ className: aphrodite.css(sticky && styles$O.sticky)
25156
25158
  }, preview))));
25157
25159
  });
25158
25160
  const HintNodeContent = withStickiness(props => {
@@ -25168,13 +25170,13 @@ const HintNodeContent = withStickiness(props => {
25168
25170
  className: "framework-perseus"
25169
25171
  }, lens(renderers).get(path));
25170
25172
  return /*#__PURE__*/React__namespace.createElement("div", {
25171
- className: aphrodite.css(styles$N.row)
25173
+ className: aphrodite.css(styles$O.row)
25172
25174
  }, /*#__PURE__*/React__namespace.createElement("div", {
25173
- className: aphrodite.css(styles$N.columnLeft)
25175
+ className: aphrodite.css(styles$O.columnLeft)
25174
25176
  }, /*#__PURE__*/React__namespace.createElement("div", {
25175
- className: aphrodite.css(sticky && styles$N.sticky)
25177
+ className: aphrodite.css(sticky && styles$O.sticky)
25176
25178
  }, /*#__PURE__*/React__namespace.createElement(HintEditor, _extends({}, data, {
25177
- className: aphrodite.css(styles$N.hintEditor),
25179
+ className: aphrodite.css(styles$O.hintEditor),
25178
25180
  onChange: newVal => actions.mergeValueAtPath(path, newVal),
25179
25181
  apiOptions: apiOptions,
25180
25182
  showTitle: false,
@@ -25189,9 +25191,9 @@ const HintNodeContent = withStickiness(props => {
25189
25191
  isFirst: true,
25190
25192
  isLast: true
25191
25193
  })))), /*#__PURE__*/React__namespace.createElement("div", {
25192
- className: aphrodite.css(styles$N.columnRight)
25194
+ className: aphrodite.css(styles$O.columnRight)
25193
25195
  }, /*#__PURE__*/React__namespace.createElement("div", {
25194
- className: aphrodite.css(sticky && styles$N.sticky)
25196
+ className: aphrodite.css(sticky && styles$O.sticky)
25195
25197
  }, preview)));
25196
25198
  });
25197
25199
  const TagsNodeContent = props => {
@@ -25208,9 +25210,9 @@ const TagsNodeContent = props => {
25208
25210
  return null;
25209
25211
  }
25210
25212
  return /*#__PURE__*/React__namespace.createElement("div", {
25211
- className: aphrodite.css(styles$N.columnLeft)
25213
+ className: aphrodite.css(styles$O.columnLeft)
25212
25214
  }, /*#__PURE__*/React__namespace.createElement("div", {
25213
- className: aphrodite.css(styles$N.tagsEditor)
25215
+ className: aphrodite.css(styles$O.tagsEditor)
25214
25216
  }, /*#__PURE__*/React__namespace.createElement(GroupMetadataEditor, {
25215
25217
  value: data,
25216
25218
  onChange: newVal => actions.setValueAtPath(path, newVal),
@@ -25241,23 +25243,23 @@ const ArrayNodeContent = props => {
25241
25243
  const subpath = path.concat(i);
25242
25244
  const controls = [i > 0 && /*#__PURE__*/React__namespace.createElement("div", {
25243
25245
  key: "moveArrayElementUp",
25244
- className: aphrodite.css(styles$N.control)
25246
+ className: aphrodite.css(styles$O.control)
25245
25247
  }, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
25246
25248
  color: "orange",
25247
25249
  title: "Move up",
25248
25250
  onClick: () => actions.moveArrayElementUp(subpath)
25249
25251
  }, /*#__PURE__*/React__namespace.createElement("div", {
25250
- className: aphrodite.css(styles$N.verticalFlip)
25252
+ className: aphrodite.css(styles$O.verticalFlip)
25251
25253
  }, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconChevronDown)))), i < data.length - 1 && /*#__PURE__*/React__namespace.createElement("div", {
25252
25254
  key: "moveArrayElementDown",
25253
- className: aphrodite.css(styles$N.control)
25255
+ className: aphrodite.css(styles$O.control)
25254
25256
  }, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
25255
25257
  color: "orange",
25256
25258
  title: "Move down",
25257
25259
  onClick: () => actions.moveArrayElementDown(subpath)
25258
25260
  }, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconChevronDown))), /*#__PURE__*/React__namespace.createElement("div", {
25259
25261
  key: "removeArrayElement",
25260
- className: aphrodite.css(styles$N.control)
25262
+ className: aphrodite.css(styles$O.control)
25261
25263
  }, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
25262
25264
  color: "orange",
25263
25265
  title: "Delete",
@@ -25265,7 +25267,7 @@ const ArrayNodeContent = props => {
25265
25267
  }, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconTrash$4)))];
25266
25268
  return /*#__PURE__*/React__namespace.createElement("div", {
25267
25269
  key: i,
25268
- className: aphrodite.css(styles$N.arrayElement, !elementIsLeaf && styles$N.arrayElementAndNotLeaf)
25270
+ className: aphrodite.css(styles$O.arrayElement, !elementIsLeaf && styles$O.arrayElementAndNotLeaf)
25269
25271
  }, /*#__PURE__*/React__namespace.createElement(NodeContainer, _extends({}, otherProps, {
25270
25272
  key: i,
25271
25273
  shape: shape.elementShape,
@@ -25291,7 +25293,7 @@ const ObjectNodeContent = props => {
25291
25293
  // made sense to the shape's author is the order in which we'll iterate :)
25292
25294
  const children = Object.keys(shape.shape).map(subkey => /*#__PURE__*/React__namespace.createElement("div", {
25293
25295
  key: subkey,
25294
- className: aphrodite.css(styles$N.objectElement)
25296
+ className: aphrodite.css(styles$O.objectElement)
25295
25297
  }, /*#__PURE__*/React__namespace.createElement(NodeContainer, _extends({}, otherProps, {
25296
25298
  shape: shape.shape[subkey],
25297
25299
  data: data[subkey],
@@ -25461,7 +25463,7 @@ class MultiRendererEditor extends React__namespace.Component {
25461
25463
  }, this._renderContent());
25462
25464
  }
25463
25465
  }
25464
- const styles$N = aphrodite.StyleSheet.create({
25466
+ const styles$O = aphrodite.StyleSheet.create({
25465
25467
  // This is used in a number of places throughout this file.
25466
25468
  container: {},
25467
25469
  // eslint-disable-next-line react-native/no-unused-styles
@@ -25760,7 +25762,7 @@ class BlurInput extends React__namespace.Component {
25760
25762
 
25761
25763
  /* eslint-disable no-useless-escape */
25762
25764
  const {
25763
- InfoTip: InfoTip$k
25765
+ InfoTip: InfoTip$l
25764
25766
  } = perseus.components;
25765
25767
  const DEFAULT_WIDTH = 400;
25766
25768
  const DEFAULT_HEIGHT = 400;
@@ -25951,7 +25953,7 @@ class CSProgramEditor extends React__namespace.Component {
25951
25953
  showEditor: value
25952
25954
  });
25953
25955
  }
25954
- }), /*#__PURE__*/React__namespace.createElement(InfoTip$k, null, "If you show the editor, you should use the \"full-width\" alignment to make room for the width of the editor."), /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
25956
+ }), /*#__PURE__*/React__namespace.createElement(InfoTip$l, null, "If you show the editor, you should use the \"full-width\" alignment to make room for the width of the editor."), /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
25955
25957
  label: "Show Buttons",
25956
25958
  checked: this.props.showButtons,
25957
25959
  onChange: value => {
@@ -25963,7 +25965,7 @@ class CSProgramEditor extends React__namespace.Component {
25963
25965
  name: "settings",
25964
25966
  pairs: this.props.settings,
25965
25967
  onChange: this._handleSettingsChange
25966
- }), /*#__PURE__*/React__namespace.createElement(InfoTip$k, null, "Settings that you add here are available to the program as an object returned by ", /*#__PURE__*/React__namespace.createElement("code", null, "Program.settings()"))));
25968
+ }), /*#__PURE__*/React__namespace.createElement(InfoTip$l, null, "Settings that you add here are available to the program as an object returned by ", /*#__PURE__*/React__namespace.createElement("code", null, "Program.settings()"))));
25967
25969
  }
25968
25970
  }
25969
25971
 
@@ -26040,7 +26042,7 @@ class DeprecatedStandinEditor extends React__namespace.Component {
26040
26042
 
26041
26043
  /* eslint-disable @khanacademy/ts-no-error-suppressions */
26042
26044
  const {
26043
- InfoTip: InfoTip$j,
26045
+ InfoTip: InfoTip$k,
26044
26046
  InlineIcon: InlineIcon$5
26045
26047
  } = perseus.components;
26046
26048
  const {
@@ -26121,14 +26123,14 @@ class DropdownEditor extends React__namespace.Component {
26121
26123
  className: "perseus-widget-dropdown"
26122
26124
  }, /*#__PURE__*/React__namespace.createElement("div", {
26123
26125
  className: "dropdown-info"
26124
- }, "Dropdown", /*#__PURE__*/React__namespace.createElement(InfoTip$j, null, /*#__PURE__*/React__namespace.createElement("p", null, "The drop down is useful for making inequalities in a custom format. We normally use the symbols ", "<", ",", " ", ">", ", \u2264, \u2265 (in that order) which you can copy into the choices. When possible, use the \"multiple choice\" answer type instead."))), /*#__PURE__*/React__namespace.createElement("div", {
26126
+ }, "Dropdown", /*#__PURE__*/React__namespace.createElement(InfoTip$k, null, /*#__PURE__*/React__namespace.createElement("p", null, "The drop down is useful for making inequalities in a custom format. We normally use the symbols ", "<", ",", " ", ">", ", \u2264, \u2265 (in that order) which you can copy into the choices. When possible, use the \"multiple choice\" answer type instead."))), /*#__PURE__*/React__namespace.createElement("div", {
26125
26127
  className: "dropdown-placeholder"
26126
26128
  }, /*#__PURE__*/React__namespace.createElement("input", {
26127
26129
  type: "text",
26128
26130
  placeholder: "Placeholder value",
26129
26131
  value: this.props.placeholder,
26130
26132
  onChange: this.onPlaceholderChange
26131
- }), /*#__PURE__*/React__namespace.createElement(InfoTip$j, null, /*#__PURE__*/React__namespace.createElement("p", null, "This value will appear as the drop down default. It should give the user some indication of the values available in the drop down itself, e.g., Yes/No/Maybe."))), /*#__PURE__*/React__namespace.createElement("div", {
26133
+ }), /*#__PURE__*/React__namespace.createElement(InfoTip$k, null, /*#__PURE__*/React__namespace.createElement("p", null, "This value will appear as the drop down default. It should give the user some indication of the values available in the drop down itself, e.g., Yes/No/Maybe."))), /*#__PURE__*/React__namespace.createElement("div", {
26132
26134
  className: "clearfix"
26133
26135
  }), /*#__PURE__*/React__namespace.createElement("ul", {
26134
26136
  className: "dropdown-choices"
@@ -26431,7 +26433,7 @@ const SortableItem = createReactClass__default["default"]({
26431
26433
  }
26432
26434
  return /*#__PURE__*/React__namespace.createElement("li", {
26433
26435
  draggable: this.props.draggable,
26434
- className: [dragState, aphrodite.css(styles$M.sortableListItem)].join(" "),
26436
+ className: [dragState, aphrodite.css(styles$N.sortableListItem)].join(" "),
26435
26437
  onDragStart: this.handleDragStart,
26436
26438
  onDrop: this.handleDrop,
26437
26439
  onDragEnter: this.handleDragEnter,
@@ -26439,14 +26441,14 @@ const SortableItem = createReactClass__default["default"]({
26439
26441
  }, this.props.component);
26440
26442
  }
26441
26443
  });
26442
- const styles$M = aphrodite.StyleSheet.create({
26444
+ const styles$N = aphrodite.StyleSheet.create({
26443
26445
  sortableListItem: {
26444
26446
  margin: "5px 0"
26445
26447
  }
26446
26448
  });
26447
26449
 
26448
26450
  const {
26449
- InfoTip: InfoTip$i
26451
+ InfoTip: InfoTip$j
26450
26452
  } = perseus.components;
26451
26453
 
26452
26454
  // types for iterables
@@ -26699,28 +26701,28 @@ class ExpressionEditor extends React__namespace.Component {
26699
26701
  onChange: this.handleToggleDiv
26700
26702
  }));
26701
26703
  return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.HeadingSmall, null, "Global Options"), /*#__PURE__*/React__namespace.createElement("div", {
26702
- className: aphrodite.css(styles$L.paddedY)
26704
+ className: aphrodite.css(styles$M.paddedY)
26703
26705
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.LabeledTextField, {
26704
26706
  label: "Visible label",
26705
26707
  value: this.props.visibleLabel || "",
26706
26708
  onChange: this.change("visibleLabel")
26707
- }), /*#__PURE__*/React__namespace.createElement(InfoTip$i, null, /*#__PURE__*/React__namespace.createElement("p", null, "Optional visible text; strongly encouraged to help learners using dictation software, but can be omitted if the surrounding content provides enough context."))), /*#__PURE__*/React__namespace.createElement("div", {
26708
- className: aphrodite.css(styles$L.paddedY)
26709
+ }), /*#__PURE__*/React__namespace.createElement(InfoTip$j, null, /*#__PURE__*/React__namespace.createElement("p", null, "Optional visible text; strongly encouraged to help learners using dictation software, but can be omitted if the surrounding content provides enough context."))), /*#__PURE__*/React__namespace.createElement("div", {
26710
+ className: aphrodite.css(styles$M.paddedY)
26709
26711
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.LabeledTextField, {
26710
26712
  label: "Aria label",
26711
26713
  value: this.props.ariaLabel || "",
26712
26714
  onChange: this.change("ariaLabel")
26713
- }), /*#__PURE__*/React__namespace.createElement(InfoTip$i, null, /*#__PURE__*/React__namespace.createElement("p", null, "Label text that's read by screen readers. Highly recommend adding a label here to ensure your exercise is accessible. For more information on writting accessible labels, please see", " ", /*#__PURE__*/React__namespace.createElement("a", {
26715
+ }), /*#__PURE__*/React__namespace.createElement(InfoTip$j, null, /*#__PURE__*/React__namespace.createElement("p", null, "Label text that's read by screen readers. Highly recommend adding a label here to ensure your exercise is accessible. For more information on writting accessible labels, please see", " ", /*#__PURE__*/React__namespace.createElement("a", {
26714
26716
  href: "https://www.w3.org/WAI/tips/designing/#ensure-that-form-elements-include-clearly-associated-labels",
26715
26717
  target: "_blank"
26716
26718
  }, "this article.")))), /*#__PURE__*/React__namespace.createElement("div", {
26717
- className: aphrodite.css(styles$L.paddedY)
26719
+ className: aphrodite.css(styles$M.paddedY)
26718
26720
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.LabeledTextField, {
26719
26721
  label: "Function variables",
26720
26722
  value: this.state.functionsInternal,
26721
26723
  onChange: this.handleFunctions
26722
- }), /*#__PURE__*/React__namespace.createElement(InfoTip$i, null, /*#__PURE__*/React__namespace.createElement("p", null, "Single-letter variables listed here will be interpreted as functions. This let us know that f(x) means \"f of x\" and not \"f times x\"."))), /*#__PURE__*/React__namespace.createElement("div", {
26723
- className: aphrodite.css(styles$L.paddedY)
26724
+ }), /*#__PURE__*/React__namespace.createElement(InfoTip$j, null, /*#__PURE__*/React__namespace.createElement("p", null, "Single-letter variables listed here will be interpreted as functions. This let us know that f(x) means \"f of x\" and not \"f times x\"."))), /*#__PURE__*/React__namespace.createElement("div", {
26725
+ className: aphrodite.css(styles$M.paddedY)
26724
26726
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
26725
26727
  label: "Use \xD7 instead of \u22C5 for multiplication",
26726
26728
  checked: this.props.times,
@@ -26729,8 +26731,8 @@ class ExpressionEditor extends React__namespace.Component {
26729
26731
  times: value
26730
26732
  });
26731
26733
  }
26732
- }), /*#__PURE__*/React__namespace.createElement(InfoTip$i, null, /*#__PURE__*/React__namespace.createElement("p", null, "For pre-algebra problems this option displays multiplication as \\times instead of \\cdot in both the rendered output and the acceptable formats examples."))), /*#__PURE__*/React__namespace.createElement("div", {
26733
- className: aphrodite.css(styles$L.paddedY)
26734
+ }), /*#__PURE__*/React__namespace.createElement(InfoTip$j, null, /*#__PURE__*/React__namespace.createElement("p", null, "For pre-algebra problems this option displays multiplication as \\times instead of \\cdot in both the rendered output and the acceptable formats examples."))), /*#__PURE__*/React__namespace.createElement("div", {
26735
+ className: aphrodite.css(styles$M.paddedY)
26734
26736
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.HeadingXSmall, null, "Button Sets"), buttonSetChoices), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.HeadingSmall, null, "Answers"), /*#__PURE__*/React__namespace.createElement("p", {
26735
26737
  style: {
26736
26738
  margin: "4px 0"
@@ -26797,18 +26799,18 @@ class AnswerOption extends React__namespace.Component {
26797
26799
  color: "destructive",
26798
26800
  light: true
26799
26801
  }, "Delete");
26800
- const answerStatusCss = aphrodite.css(styles$L.answerStatus, this.props.considered === "wrong" && styles$L.answerStatusWrong, this.props.considered === "correct" && styles$L.answerStatusCorrect, this.props.considered === "ungraded" && styles$L.answerStatusUngraded);
26802
+ const answerStatusCss = aphrodite.css(styles$M.answerStatus, this.props.considered === "wrong" && styles$M.answerStatusWrong, this.props.considered === "correct" && styles$M.answerStatusCorrect, this.props.considered === "ungraded" && styles$M.answerStatusUngraded);
26801
26803
  return /*#__PURE__*/React__namespace.createElement("div", {
26802
- className: aphrodite.css(styles$L.answerOption)
26804
+ className: aphrodite.css(styles$M.answerOption)
26803
26805
  }, /*#__PURE__*/React__namespace.createElement("div", {
26804
- className: aphrodite.css(styles$L.answerHandle)
26806
+ className: aphrodite.css(styles$M.answerHandle)
26805
26807
  }), /*#__PURE__*/React__namespace.createElement("div", {
26806
- className: aphrodite.css(styles$L.answerBody)
26808
+ className: aphrodite.css(styles$M.answerBody)
26807
26809
  }, /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("button", {
26808
26810
  onClick: this.toggleConsidered,
26809
26811
  className: answerStatusCss
26810
26812
  }, this.props.considered), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement(perseus.Expression, this.props.expressionProps))), /*#__PURE__*/React__namespace.createElement("div", {
26811
- className: aphrodite.css(styles$L.paddedY, styles$L.paddedX)
26813
+ className: aphrodite.css(styles$M.paddedY, styles$M.paddedX)
26812
26814
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
26813
26815
  label: "Answer expression must have the same form.",
26814
26816
  checked: this.props.form,
@@ -26817,8 +26819,8 @@ class AnswerOption extends React__namespace.Component {
26817
26819
  form: value
26818
26820
  });
26819
26821
  }
26820
- }), /*#__PURE__*/React__namespace.createElement(InfoTip$i, null, /*#__PURE__*/React__namespace.createElement("p", null, "The student's answer must be in the same form. Commutativity and excess negative signs are ignored."))), /*#__PURE__*/React__namespace.createElement("div", {
26821
- className: aphrodite.css(styles$L.paddedY, styles$L.paddedX)
26822
+ }), /*#__PURE__*/React__namespace.createElement(InfoTip$j, null, /*#__PURE__*/React__namespace.createElement("p", null, "The student's answer must be in the same form. Commutativity and excess negative signs are ignored."))), /*#__PURE__*/React__namespace.createElement("div", {
26823
+ className: aphrodite.css(styles$M.paddedY, styles$M.paddedX)
26822
26824
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
26823
26825
  label: "Answer expression must be fully expanded and simplified.",
26824
26826
  checked: this.props.simplify,
@@ -26827,12 +26829,12 @@ class AnswerOption extends React__namespace.Component {
26827
26829
  simplify: value
26828
26830
  });
26829
26831
  }
26830
- }), /*#__PURE__*/React__namespace.createElement(InfoTip$i, null, /*#__PURE__*/React__namespace.createElement("p", null, "The student's answer must be fully expanded and simplified. Answering this equation (x^2+2x+1) with this factored equation (x+1)^2 will render this response \"Your answer is not fully expanded and simplified.\""))), /*#__PURE__*/React__namespace.createElement("div", {
26831
- className: aphrodite.css(styles$L.buttonRow, styles$L.paddedY)
26832
+ }), /*#__PURE__*/React__namespace.createElement(InfoTip$j, null, /*#__PURE__*/React__namespace.createElement("p", null, "The student's answer must be fully expanded and simplified. Answering this equation (x^2+2x+1) with this factored equation (x+1)^2 will render this response \"Your answer is not fully expanded and simplified.\""))), /*#__PURE__*/React__namespace.createElement("div", {
26833
+ className: aphrodite.css(styles$M.buttonRow, styles$M.paddedY)
26832
26834
  }, removeButton)));
26833
26835
  }
26834
26836
  }
26835
- const styles$L = aphrodite.StyleSheet.create({
26837
+ const styles$M = aphrodite.StyleSheet.create({
26836
26838
  paddedX: {
26837
26839
  paddingLeft: wonderBlocksTokens.spacing.xSmall_8,
26838
26840
  paddingRight: wonderBlocksTokens.spacing.xSmall_8
@@ -26944,10 +26946,10 @@ class GradedGroupEditor extends React__namespace.Component {
26944
26946
  }, /*#__PURE__*/React__namespace.createElement("div", {
26945
26947
  className: "perseus-widget-row"
26946
26948
  }, /*#__PURE__*/React__namespace.createElement("label", {
26947
- className: aphrodite.css(styles$K.title)
26949
+ className: aphrodite.css(styles$L.title)
26948
26950
  }, "Title:", " ", /*#__PURE__*/React__namespace.createElement(TextInput$5, {
26949
26951
  value: this.props.title,
26950
- className: aphrodite.css(styles$K.input)
26952
+ className: aphrodite.css(styles$L.input)
26951
26953
  // @ts-expect-error - TS2554 - Expected 3 arguments, but got 1.
26952
26954
  ,
26953
26955
  onChange: this.change("title")
@@ -26972,7 +26974,7 @@ class GradedGroupEditor extends React__namespace.Component {
26972
26974
  }, /*#__PURE__*/React__namespace.createElement(InlineIcon$4, iconPlus$1), " Add a hint"), this.props.hint && /*#__PURE__*/React__namespace.createElement("div", {
26973
26975
  className: "perseus-hint-editor"
26974
26976
  }, /*#__PURE__*/React__namespace.createElement("div", {
26975
- className: aphrodite.css(styles$K.hintsTitle)
26977
+ className: aphrodite.css(styles$L.hintsTitle)
26976
26978
  }, "Hint"), /*#__PURE__*/React__namespace.createElement(Editor, {
26977
26979
  ref: this.hintEditor,
26978
26980
  content: this.props.hint ? this.props.hint.content : "",
@@ -26994,7 +26996,7 @@ class GradedGroupEditor extends React__namespace.Component {
26994
26996
  }, /*#__PURE__*/React__namespace.createElement(InlineIcon$4, iconTrash$2), " Remove this hint")));
26995
26997
  }
26996
26998
  }
26997
- const styles$K = aphrodite.StyleSheet.create({
26999
+ const styles$L = aphrodite.StyleSheet.create({
26998
27000
  title: {
26999
27001
  fontSize: 18,
27000
27002
  fontWeight: "bold"
@@ -27081,7 +27083,7 @@ const setArrayItem = (list, i, value) => [...list.slice(0, i), value, ...list.sl
27081
27083
  /* eslint-disable react/forbid-prop-types, react/no-unsafe */
27082
27084
  const {
27083
27085
  ButtonGroup: ButtonGroup$7,
27084
- InfoTip: InfoTip$h,
27086
+ InfoTip: InfoTip$i,
27085
27087
  RangeInput: RangeInput$6
27086
27088
  } = perseus.components;
27087
27089
  const defaultBackgroundImage$3 = {
@@ -27545,7 +27547,7 @@ const GraphSettings = createReactClass__default["default"]({
27545
27547
  },
27546
27548
  onKeyPress: this.changeBackgroundUrl,
27547
27549
  onBlur: this.changeBackgroundUrl
27548
- }), /*#__PURE__*/React__namespace.createElement(InfoTip$h, null, /*#__PURE__*/React__namespace.createElement("p", null, "Create an image in graphie, or use the \"Add image\" function to create a background.")))), ___default["default"].contains(this.props.editableSettings, "measure") && /*#__PURE__*/React__namespace.createElement("div", {
27550
+ }), /*#__PURE__*/React__namespace.createElement(InfoTip$i, null, /*#__PURE__*/React__namespace.createElement("p", null, "Create an image in graphie, or use the \"Add image\" function to create a background.")))), ___default["default"].contains(this.props.editableSettings, "measure") && /*#__PURE__*/React__namespace.createElement("div", {
27549
27551
  className: "misc-settings"
27550
27552
  }, /*#__PURE__*/React__namespace.createElement("div", {
27551
27553
  className: "perseus-widget-row"
@@ -27591,7 +27593,7 @@ const GraphSettings = createReactClass__default["default"]({
27591
27593
  });
27592
27594
 
27593
27595
  const {
27594
- InfoTip: InfoTip$g,
27596
+ InfoTip: InfoTip$h,
27595
27597
  MultiButtonGroup: MultiButtonGroup$1
27596
27598
  } = perseus.components;
27597
27599
  const {
@@ -27685,7 +27687,7 @@ class GrapherEditor extends React__namespace.Component {
27685
27687
  className: "perseus-error"
27686
27688
  }, this.props.graph.valid);
27687
27689
  }
27688
- return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", null, "Correct answer", " ", /*#__PURE__*/React__namespace.createElement(InfoTip$g, null, /*#__PURE__*/React__namespace.createElement("p", null, "Graph the correct answer in the graph below and ensure the equation or point coordinates displayed represent the correct answer.")), " ", ": ", equationString), /*#__PURE__*/React__namespace.createElement(GraphSettings, {
27690
+ return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", null, "Correct answer", " ", /*#__PURE__*/React__namespace.createElement(InfoTip$h, null, /*#__PURE__*/React__namespace.createElement("p", null, "Graph the correct answer in the graph below and ensure the equation or point coordinates displayed represent the correct answer.")), " ", ": ", equationString), /*#__PURE__*/React__namespace.createElement(GraphSettings, {
27689
27691
  editableSettings: ["graph", "snap", "image"],
27690
27692
  box: getInteractiveBoxFromSizeClass$1(sizeClass),
27691
27693
  range: this.props.graph.range,
@@ -27945,7 +27947,7 @@ class IframeEditor extends React__namespace.Component {
27945
27947
 
27946
27948
  /* eslint-disable jsx-a11y/anchor-is-valid */
27947
27949
  const {
27948
- InfoTip: InfoTip$f,
27950
+ InfoTip: InfoTip$g,
27949
27951
  InlineIcon: InlineIcon$3,
27950
27952
  RangeInput: RangeInput$5
27951
27953
  } = perseus.components;
@@ -28146,7 +28148,7 @@ class ImageEditor extends React__namespace.Component {
28146
28148
  style: {
28147
28149
  width: "100%"
28148
28150
  }
28149
- }))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, /*#__PURE__*/React__namespace.createElement("div", null, "Dimensions:"), /*#__PURE__*/React__namespace.createElement("p", null, backgroundImage.width, "x", backgroundImage.height))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, /*#__PURE__*/React__namespace.createElement("div", null, "Alt text:", /*#__PURE__*/React__namespace.createElement(InfoTip$f, null, "This is important for screenreaders. The content of this alt text will be formatted as markdown (tables, emphasis, etc. are supported).")), /*#__PURE__*/React__namespace.createElement(Editor, {
28151
+ }))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, /*#__PURE__*/React__namespace.createElement("div", null, "Dimensions:"), /*#__PURE__*/React__namespace.createElement("p", null, backgroundImage.width, "x", backgroundImage.height))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, /*#__PURE__*/React__namespace.createElement("div", null, "Alt text:", /*#__PURE__*/React__namespace.createElement(InfoTip$g, null, "This is important for screenreaders. The content of this alt text will be formatted as markdown (tables, emphasis, etc. are supported).")), /*#__PURE__*/React__namespace.createElement(Editor, {
28150
28152
  apiOptions: this.props.apiOptions,
28151
28153
  content: this.props.alt,
28152
28154
  onChange: props => {
@@ -28170,7 +28172,7 @@ class ImageEditor extends React__namespace.Component {
28170
28172
  }, this.state.backgroundImageError);
28171
28173
  return /*#__PURE__*/React__namespace.createElement("div", {
28172
28174
  className: "perseus-image-editor"
28173
- }, /*#__PURE__*/React__namespace.createElement("label", null, "Image url:", /*#__PURE__*/React__namespace.createElement(InfoTip$f, null, "Paste an image or graphie image URL."), this.state.backgroundImageError && backgroundImageErrorText, /*#__PURE__*/React__namespace.createElement(BlurInput, {
28175
+ }, /*#__PURE__*/React__namespace.createElement("label", null, "Image url:", /*#__PURE__*/React__namespace.createElement(InfoTip$g, null, "Paste an image or graphie image URL."), this.state.backgroundImageError && backgroundImageErrorText, /*#__PURE__*/React__namespace.createElement(BlurInput, {
28174
28176
  value: backgroundImage.url || "",
28175
28177
  style: {
28176
28178
  width: 332
@@ -28181,7 +28183,7 @@ class ImageEditor extends React__namespace.Component {
28181
28183
  }
28182
28184
 
28183
28185
  const {
28184
- InfoTip: InfoTip$e
28186
+ InfoTip: InfoTip$f
28185
28187
  } = perseus.components;
28186
28188
  const answerTypes = {
28187
28189
  number: {
@@ -28274,7 +28276,7 @@ class InputNumberEditor extends React__namespace.Component {
28274
28276
  value: "optional"
28275
28277
  }, "will be accepted"), /*#__PURE__*/React__namespace.createElement("option", {
28276
28278
  value: "enforced"
28277
- }, "will be marked wrong"))), /*#__PURE__*/React__namespace.createElement(InfoTip$e, null, /*#__PURE__*/React__namespace.createElement("p", null, "Normally select \"will not be graded\". This will give the user a message saying the answer is correct but not simplified. The user will then have to simplify it and re-enter, but will not be penalized. (5th grade and anything after)"), /*#__PURE__*/React__namespace.createElement("p", null, "Select \"will be accepted\" only if the user is not expected to know how to simplify fractions yet. (Anything prior to 5th grade)"), /*#__PURE__*/React__namespace.createElement("p", null, "Select \"will be marked wrong\" only if we are specifically assessing the ability to simplify."))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, /*#__PURE__*/React__namespace.createElement("input", {
28279
+ }, "will be marked wrong"))), /*#__PURE__*/React__namespace.createElement(InfoTip$f, null, /*#__PURE__*/React__namespace.createElement("p", null, "Normally select \"will not be graded\". This will give the user a message saying the answer is correct but not simplified. The user will then have to simplify it and re-enter, but will not be penalized. (5th grade and anything after)"), /*#__PURE__*/React__namespace.createElement("p", null, "Select \"will be accepted\" only if the user is not expected to know how to simplify fractions yet. (Anything prior to 5th grade)"), /*#__PURE__*/React__namespace.createElement("p", null, "Select \"will be marked wrong\" only if we are specifically assessing the ability to simplify."))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, /*#__PURE__*/React__namespace.createElement("input", {
28278
28280
  type: "checkbox",
28279
28281
  checked: this.props.inexact,
28280
28282
  onChange: e => {
@@ -28310,7 +28312,7 @@ class InputNumberEditor extends React__namespace.Component {
28310
28312
  });
28311
28313
  },
28312
28314
  "aria-label": "Answer type"
28313
- }, answerTypeOptions), /*#__PURE__*/React__namespace.createElement(InfoTip$e, null, /*#__PURE__*/React__namespace.createElement("p", null, "Use the default \"Numbers\" unless the answer must be in a specific form (e.g., question is about converting decimals to fractions)."))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Width", " ", /*#__PURE__*/React__namespace.createElement("select", {
28315
+ }, answerTypeOptions), /*#__PURE__*/React__namespace.createElement(InfoTip$f, null, /*#__PURE__*/React__namespace.createElement("p", null, "Use the default \"Numbers\" unless the answer must be in a specific form (e.g., question is about converting decimals to fractions)."))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Width", " ", /*#__PURE__*/React__namespace.createElement("select", {
28314
28316
  value: this.props.size,
28315
28317
  onChange: e => {
28316
28318
  // @ts-expect-error - TS2322 - Type 'string' is not assignable to type '"small" | "normal" | undefined'.
@@ -28322,7 +28324,7 @@ class InputNumberEditor extends React__namespace.Component {
28322
28324
  value: "normal"
28323
28325
  }, "Normal (80px)"), /*#__PURE__*/React__namespace.createElement("option", {
28324
28326
  value: "small"
28325
- }, "Small (40px)"))), /*#__PURE__*/React__namespace.createElement(InfoTip$e, null, /*#__PURE__*/React__namespace.createElement("p", null, "Use size \"Normal\" for all text boxes, unless there are multiple text boxes in one line and the answer area is too narrow to fit them."))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, /*#__PURE__*/React__namespace.createElement("input", {
28327
+ }, "Small (40px)"))), /*#__PURE__*/React__namespace.createElement(InfoTip$f, null, /*#__PURE__*/React__namespace.createElement("p", null, "Use size \"Normal\" for all text boxes, unless there are multiple text boxes in one line and the answer area is too narrow to fit them."))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, /*#__PURE__*/React__namespace.createElement("input", {
28326
28328
  type: "checkbox",
28327
28329
  checked: this.props.rightAlign,
28328
28330
  onChange: e => {
@@ -28485,13 +28487,13 @@ function MathquillInput(props) {
28485
28487
  }
28486
28488
  });
28487
28489
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
28488
- style: styles$J.outerWrapper
28490
+ style: styles$K.outerWrapper
28489
28491
  }, /*#__PURE__*/React__namespace.createElement("span", {
28490
28492
  ref: mathFieldWrapperRef,
28491
28493
  className: "perseus-math-input mq-editable-field mq-math-mode"
28492
28494
  }));
28493
28495
  }
28494
- const styles$J = aphrodite.StyleSheet.create({
28496
+ const styles$K = aphrodite.StyleSheet.create({
28495
28497
  outerWrapper: {
28496
28498
  display: "inline-block",
28497
28499
  borderStyle: "solid",
@@ -29620,7 +29622,7 @@ const GraphPointsCountSelector = _ref => {
29620
29622
  // Never uses placeholder, always has value
29621
29623
  ,
29622
29624
  placeholder: "",
29623
- style: styles$I.singleSelectShort
29625
+ style: styles$J.singleSelectShort
29624
29626
  }, [...[...Array(7).keys()].map(n => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
29625
29627
  key: n,
29626
29628
  value: `${n}`,
@@ -29631,7 +29633,7 @@ const GraphPointsCountSelector = _ref => {
29631
29633
  label: "unlimited"
29632
29634
  })]);
29633
29635
  };
29634
- const styles$I = aphrodite.StyleSheet.create({
29636
+ const styles$J = aphrodite.StyleSheet.create({
29635
29637
  singleSelectShort: {
29636
29638
  // Non-standard spacing, but it's the smallest we can go
29637
29639
  // without running into styling issues with the dropdown.
@@ -29644,7 +29646,7 @@ const GraphTypeSelector = props => {
29644
29646
  selectedValue: props.graphType,
29645
29647
  onChange: props.onChange,
29646
29648
  placeholder: "Select an answer type",
29647
- style: styles$H.singleSelectShort
29649
+ style: styles$I.singleSelectShort
29648
29650
  }, props.showNoneOption && /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
29649
29651
  value: "none",
29650
29652
  label: "None"
@@ -29680,7 +29682,7 @@ const GraphTypeSelector = props => {
29680
29682
  label: "Angle"
29681
29683
  }));
29682
29684
  };
29683
- const styles$H = aphrodite.StyleSheet.create({
29685
+ const styles$I = aphrodite.StyleSheet.create({
29684
29686
  singleSelectShort: {
29685
29687
  // Non-standard spacing, but it's the smallest we can go
29686
29688
  // without running into styling issues with the dropdown.
@@ -29696,11 +29698,11 @@ function Heading(_ref) {
29696
29698
  onToggle
29697
29699
  } = _ref;
29698
29700
  return /*#__PURE__*/React__namespace.createElement(Clickable__default["default"], {
29699
- style: [styles$G.container, !isCollapsible && styles$G.notClickable],
29701
+ style: [styles$H.container, !isCollapsible && styles$H.notClickable],
29700
29702
  disabled: !isCollapsible,
29701
29703
  onClick: () => isCollapsible && onToggle?.(!isOpen)
29702
29704
  }, () => /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
29703
- style: styles$G.heading
29705
+ style: styles$H.heading
29704
29706
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, {
29705
29707
  style: {
29706
29708
  fontSize: 14,
@@ -29710,7 +29712,7 @@ function Heading(_ref) {
29710
29712
  isExpanded: isOpen
29711
29713
  })));
29712
29714
  }
29713
- const styles$G = aphrodite.StyleSheet.create({
29715
+ const styles$H = aphrodite.StyleSheet.create({
29714
29716
  container: {
29715
29717
  marginTop: wonderBlocksTokens.spacing.small_12,
29716
29718
  // NOTE(jeremy): This is the inverse of the @editorPadding CSS
@@ -29770,8 +29772,8 @@ function InteractiveGraphDescription(props) {
29770
29772
  isOpen: isOpen,
29771
29773
  onToggle: setIsOpen
29772
29774
  }), isOpen && /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelXSmall, {
29773
- style: styles$F.caption
29774
- }, "Use these fields to describe the graph as a whole. These are used by screen readers to describe content to users who are visually impaired."), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, {
29775
+ style: styles$G.caption
29776
+ }, "Use these fields to describe the graph as a whole. These are used by screen readers to describe content to users who may be visually impaired."), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, {
29775
29777
  tag: "label"
29776
29778
  }, "Title", /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
29777
29779
  value: ariaLabelValue,
@@ -29781,7 +29783,7 @@ function InteractiveGraphDescription(props) {
29781
29783
  // is an empty string.
29782
29784
  newValue || undefined
29783
29785
  }),
29784
- style: styles$F.spaceAbove
29786
+ style: styles$G.spaceAbove
29785
29787
  })), /*#__PURE__*/React__namespace.createElement(Strut, {
29786
29788
  size: wonderBlocksTokens.spacing.small_12
29787
29789
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, {
@@ -29796,10 +29798,10 @@ function InteractiveGraphDescription(props) {
29796
29798
  // is an empty string.
29797
29799
  newValue || undefined
29798
29800
  }),
29799
- style: styles$F.spaceAbove
29801
+ style: styles$G.spaceAbove
29800
29802
  }))));
29801
29803
  }
29802
- const styles$F = aphrodite.StyleSheet.create({
29804
+ const styles$G = aphrodite.StyleSheet.create({
29803
29805
  caption: {
29804
29806
  color: wonderBlocksTokens.color.offBlack64,
29805
29807
  paddingTop: wonderBlocksTokens.spacing.xxSmall_6,
@@ -29819,16 +29821,16 @@ const LabeledRow = props => {
29819
29821
  style
29820
29822
  } = props;
29821
29823
  return /*#__PURE__*/React__namespace.createElement("label", {
29822
- className: aphrodite.css(styles$E.label)
29824
+ className: aphrodite.css(styles$F.label)
29823
29825
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
29824
- style: [styles$E.row, style]
29826
+ style: [styles$F.row, style]
29825
29827
  }, labelSide === "start" || /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelSmall, {
29826
- style: styles$E.spaceEnd
29828
+ style: styles$F.spaceEnd
29827
29829
  }, label), children, labelSide === "end" && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelSmall, {
29828
- style: styles$E.spaceStart
29830
+ style: styles$F.spaceStart
29829
29831
  }, label)));
29830
29832
  };
29831
- const styles$E = aphrodite.StyleSheet.create({
29833
+ const styles$F = aphrodite.StyleSheet.create({
29832
29834
  label: {
29833
29835
  width: "fit-content"
29834
29836
  },
@@ -29849,7 +29851,7 @@ const styles$E = aphrodite.StyleSheet.create({
29849
29851
  /* eslint-disable react/forbid-prop-types, react/no-unsafe */
29850
29852
  const {
29851
29853
  ButtonGroup: ButtonGroup$2,
29852
- InfoTip: InfoTip$d,
29854
+ InfoTip: InfoTip$e,
29853
29855
  RangeInput: RangeInput$4
29854
29856
  } = perseus.components;
29855
29857
  const defaultBackgroundImage$1 = {
@@ -30247,10 +30249,10 @@ class InteractiveGraphSettings extends React__namespace.Component {
30247
30249
  }
30248
30250
  }))), /*#__PURE__*/React__namespace.createElement(LabeledRow, {
30249
30251
  label: "Background image URL:",
30250
- style: styles$D.resetSpaceTop
30252
+ style: styles$E.resetSpaceTop
30251
30253
  }, /*#__PURE__*/React__namespace.createElement("input", {
30252
30254
  type: "text",
30253
- className: aphrodite.css(styles$D.backgroundUrlInput),
30255
+ className: aphrodite.css(styles$E.backgroundUrlInput),
30254
30256
  ref: this.bgUrlRef,
30255
30257
  value: this.state.backgroundImage.url || "",
30256
30258
  onChange: e => {
@@ -30265,10 +30267,10 @@ class InteractiveGraphSettings extends React__namespace.Component {
30265
30267
  },
30266
30268
  onKeyPress: this.changeBackgroundUrl,
30267
30269
  onBlur: this.changeBackgroundUrl
30268
- }), /*#__PURE__*/React__namespace.createElement(InfoTip$d, null, /*#__PURE__*/React__namespace.createElement("p", null, "Create an image in graphie, or use the \"Add image\" function to create a background."))), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30269
- style: styles$D.protractorSection
30270
+ }), /*#__PURE__*/React__namespace.createElement(InfoTip$e, 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, {
30271
+ style: styles$E.protractorSection
30270
30272
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30271
- style: styles$D.checkboxRow
30273
+ style: styles$E.checkboxRow
30272
30274
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.Checkbox, {
30273
30275
  label: "Show protractor",
30274
30276
  checked: this.props.showProtractor,
@@ -30277,7 +30279,7 @@ class InteractiveGraphSettings extends React__namespace.Component {
30277
30279
  showProtractor: value
30278
30280
  });
30279
30281
  },
30280
- style: styles$D.resetSpaceTop
30282
+ style: styles$E.resetSpaceTop
30281
30283
  })), this.props.showProtractor && /*#__PURE__*/React__namespace.createElement(Banner__default["default"], {
30282
30284
  layout: "floating",
30283
30285
  text: "The protractor is not accessible. Please consider an alternate approach.",
@@ -30285,7 +30287,7 @@ class InteractiveGraphSettings extends React__namespace.Component {
30285
30287
  }))));
30286
30288
  }
30287
30289
  }
30288
- const styles$D = aphrodite.StyleSheet.create({
30290
+ const styles$E = aphrodite.StyleSheet.create({
30289
30291
  resetSpaceTop: {
30290
30292
  marginTop: 0
30291
30293
  },
@@ -30324,14 +30326,14 @@ const SegmentCountSelector = _ref => {
30324
30326
  const num = +newValue;
30325
30327
  onChange(num);
30326
30328
  },
30327
- style: styles$C.singleSelectShort
30329
+ style: styles$D.singleSelectShort
30328
30330
  }, ___default["default"].range(1, 7).map(n => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.OptionItem, {
30329
30331
  key: n,
30330
30332
  value: `${n}`,
30331
30333
  label: `${n} segment${n > 1 ? "s" : ""}`
30332
30334
  })));
30333
30335
  };
30334
- const styles$C = aphrodite.StyleSheet.create({
30336
+ const styles$D = aphrodite.StyleSheet.create({
30335
30337
  singleSelectShort: {
30336
30338
  // Non-standard spacing, but it's the smallest we can go
30337
30339
  // without running into styling issues with the dropdown.
@@ -30356,17 +30358,17 @@ const LockedFigureSelect = props => {
30356
30358
  figureTypes.push("label");
30357
30359
  }
30358
30360
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30359
- style: styles$B.container
30361
+ style: styles$C.container
30360
30362
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.ActionMenu, {
30361
30363
  menuText: "Add locked figure",
30362
- style: styles$B.addElementSelect
30364
+ style: styles$C.addElementSelect
30363
30365
  }, figureTypes.map(figureType => /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.ActionItem, {
30364
30366
  key: `${id}-${figureType}`,
30365
30367
  label: figureType,
30366
30368
  onClick: () => onChange(figureType)
30367
30369
  }))));
30368
30370
  };
30369
- const styles$B = aphrodite.StyleSheet.create({
30371
+ const styles$C = aphrodite.StyleSheet.create({
30370
30372
  container: {
30371
30373
  marginTop: wonderBlocksTokens.spacing.xSmall_8
30372
30374
  },
@@ -30483,18 +30485,18 @@ const AngleInput = props => {
30483
30485
  }
30484
30486
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30485
30487
  tag: "label",
30486
- style: styles$A.row
30488
+ style: styles$B.row
30487
30489
  }, "angle (degrees)", /*#__PURE__*/React__namespace.createElement(Strut, {
30488
30490
  size: wonderBlocksTokens.spacing.xxSmall_6
30489
30491
  }), /*#__PURE__*/React__namespace.createElement(ScrolllessNumberTextField, {
30490
30492
  value: angleInput,
30491
30493
  onChange: handleAngleChange,
30492
- style: styles$A.textField
30494
+ style: styles$B.textField
30493
30495
  }), /*#__PURE__*/React__namespace.createElement(Strut, {
30494
30496
  size: wonderBlocksTokens.spacing.xxSmall_6
30495
30497
  }));
30496
30498
  };
30497
- const styles$A = aphrodite.StyleSheet.create({
30499
+ const styles$B = aphrodite.StyleSheet.create({
30498
30500
  row: {
30499
30501
  display: "flex",
30500
30502
  flexDirection: "row",
@@ -30543,30 +30545,30 @@ const CoordinatePairInput = props => {
30543
30545
  onChange(newCoords);
30544
30546
  }
30545
30547
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30546
- style: [styles$z.row, style]
30548
+ style: [styles$A.row, style]
30547
30549
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30548
30550
  tag: "label",
30549
- style: styles$z.row
30551
+ style: styles$A.row
30550
30552
  }, labels ? labels[0] : "x coord", /*#__PURE__*/React__namespace.createElement(Strut, {
30551
30553
  size: wonderBlocksTokens.spacing.xxSmall_6
30552
30554
  }), /*#__PURE__*/React__namespace.createElement(ScrolllessNumberTextField, {
30553
30555
  value: coordState[0],
30554
30556
  onChange: newValue => handleCoordChange(newValue, 0),
30555
- style: [styles$z.textField, error ? styles$z.errorField : undefined]
30557
+ style: [styles$A.textField, error ? styles$A.errorField : undefined]
30556
30558
  })), /*#__PURE__*/React__namespace.createElement(Strut, {
30557
30559
  size: wonderBlocksTokens.spacing.medium_16
30558
30560
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30559
30561
  tag: "label",
30560
- style: styles$z.row
30562
+ style: styles$A.row
30561
30563
  }, labels ? labels[1] : "y coord", /*#__PURE__*/React__namespace.createElement(Strut, {
30562
30564
  size: wonderBlocksTokens.spacing.xxSmall_6
30563
30565
  }), /*#__PURE__*/React__namespace.createElement(ScrolllessNumberTextField, {
30564
30566
  value: coordState[1],
30565
30567
  onChange: newValue => handleCoordChange(newValue, 1),
30566
- style: [styles$z.textField, error ? styles$z.errorField : undefined]
30568
+ style: [styles$A.textField, error ? styles$A.errorField : undefined]
30567
30569
  })));
30568
30570
  };
30569
- const styles$z = aphrodite.StyleSheet.create({
30571
+ const styles$A = aphrodite.StyleSheet.create({
30570
30572
  row: {
30571
30573
  display: "flex",
30572
30574
  flexDirection: "row",
@@ -30599,14 +30601,14 @@ const PerseusEditorAccordion = props => {
30599
30601
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksAccordion.AccordionSection, {
30600
30602
  expanded: expanded,
30601
30603
  onToggle: onToggle,
30602
- style: [styles$y.container, containerStyle],
30603
- headerStyle: styles$y.accordionHeader,
30604
+ style: [styles$z.container, containerStyle],
30605
+ headerStyle: styles$z.accordionHeader,
30604
30606
  header: header
30605
30607
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30606
- style: [styles$y.accordionPanel, panelStyle]
30608
+ style: [styles$z.accordionPanel, panelStyle]
30607
30609
  }, children)));
30608
30610
  };
30609
- const styles$y = aphrodite.StyleSheet.create({
30611
+ const styles$z = aphrodite.StyleSheet.create({
30610
30612
  container: {
30611
30613
  backgroundColor: wonderBlocksTokens.color.fadedBlue8,
30612
30614
  marginTop: wonderBlocksTokens.spacing.xSmall_8
@@ -30637,13 +30639,13 @@ const ColorSwatch = props => {
30637
30639
  "aria-label":
30638
30640
  // Don't include an aria label for decorative circles.
30639
30641
  !decorative ? `${color}, ${filled ? "filled" : "open"}` : undefined,
30640
- style: [styles$x.colorSwatch, {
30642
+ style: [styles$y.colorSwatch, {
30641
30643
  border: `4px solid ${perseus.lockedFigureColors[color]}`,
30642
30644
  backgroundColor: filled ? perseus.lockedFigureColors[color] : wonderBlocksTokens.color.white
30643
30645
  }]
30644
30646
  });
30645
30647
  };
30646
- const styles$x = aphrodite.StyleSheet.create({
30648
+ const styles$y = aphrodite.StyleSheet.create({
30647
30649
  colorSwatch: {
30648
30650
  // Add a white outline so that the color swatch is visible when
30649
30651
  // the dropdown option is highlighted with its blue background.
@@ -30662,10 +30664,10 @@ const ColorSelect = props => {
30662
30664
  onChange
30663
30665
  } = props;
30664
30666
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30665
- style: [styles$w.row, style]
30667
+ style: [styles$x.row, style]
30666
30668
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30667
30669
  tag: "label",
30668
- style: styles$w.row
30670
+ style: styles$x.row
30669
30671
  }, "color", /*#__PURE__*/React__namespace.createElement(Strut, {
30670
30672
  size: wonderBlocksTokens.spacing.xxSmall_6
30671
30673
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
@@ -30684,7 +30686,7 @@ const ColorSelect = props => {
30684
30686
  })
30685
30687
  })))));
30686
30688
  };
30687
- const styles$w = aphrodite.StyleSheet.create({
30689
+ const styles$x = aphrodite.StyleSheet.create({
30688
30690
  row: {
30689
30691
  display: "flex",
30690
30692
  flexDirection: "row",
@@ -30703,17 +30705,17 @@ const EllipseSwatch = props => {
30703
30705
  } = props;
30704
30706
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30705
30707
  "aria-label": `${color}, stroke ${strokeStyle}, fill ${fillStyle}`,
30706
- style: [styles$v.container, {
30708
+ style: [styles$w.container, {
30707
30709
  border: `4px ${strokeStyle} ${perseus.lockedFigureColors[color]}`
30708
30710
  }]
30709
30711
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30710
- style: [styles$v.innerCircle, {
30712
+ style: [styles$w.innerCircle, {
30711
30713
  backgroundColor: perseus.lockedFigureColors[color],
30712
30714
  opacity: fillStyle === "white" ? 0 : perseus.lockedFigureFillStyles[fillStyle]
30713
30715
  }]
30714
30716
  }));
30715
30717
  };
30716
- const styles$v = aphrodite.StyleSheet.create({
30718
+ const styles$w = aphrodite.StyleSheet.create({
30717
30719
  container: {
30718
30720
  // Add a white outline so that the color swatch is visible when
30719
30721
  // the dropdown option is highlighted with its blue background.
@@ -30739,7 +30741,7 @@ const LineStrokeSelect = props => {
30739
30741
  } = props;
30740
30742
  return /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30741
30743
  tag: "label",
30742
- style: styles$u.lineStrokeSelect
30744
+ style: styles$v.lineStrokeSelect
30743
30745
  }, "stroke", /*#__PURE__*/React__namespace.createElement(Strut, {
30744
30746
  size: wonderBlocksTokens.spacing.xxxSmall_4
30745
30747
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
@@ -30756,7 +30758,7 @@ const LineStrokeSelect = props => {
30756
30758
  label: "dashed"
30757
30759
  })));
30758
30760
  };
30759
- const styles$u = aphrodite.StyleSheet.create({
30761
+ const styles$v = aphrodite.StyleSheet.create({
30760
30762
  lineStrokeSelect: {
30761
30763
  display: "flex",
30762
30764
  flexDirection: "row",
@@ -30766,6 +30768,66 @@ const styles$u = aphrodite.StyleSheet.create({
30766
30768
  }
30767
30769
  });
30768
30770
 
30771
+ const {
30772
+ InfoTip: InfoTip$d
30773
+ } = perseus.components;
30774
+ function LockedFigureAria(props) {
30775
+ const {
30776
+ ariaLabel,
30777
+ prePopulatedAriaLabel,
30778
+ onChangeProps
30779
+ } = props;
30780
+ const id = React__namespace.useId();
30781
+ const ariaLabelId = `aria-label-${id}`;
30782
+ return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, null, /*#__PURE__*/React__namespace.createElement(Strut, {
30783
+ size: wonderBlocksTokens.spacing.xSmall_8
30784
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30785
+ style: styles$u.row
30786
+ }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30787
+ tag: "label",
30788
+ htmlFor: ariaLabelId
30789
+ }, "Aria label"), /*#__PURE__*/React__namespace.createElement(Spring, null), /*#__PURE__*/React__namespace.createElement(InfoTip$d, null, "Aria label is used by screen readers to describe content to users who may be visually impaired. ", /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement("br", null), "Populating this field will make it so that users can use a screen reader to navigate to this point and hear the description.", /*#__PURE__*/React__namespace.createElement("br", null), /*#__PURE__*/React__namespace.createElement("br", null), "If you leave this field blank, the point will be hidden from screen readers. Users will not be able to navigate to this point using a screen reader.")), /*#__PURE__*/React__namespace.createElement(Strut, {
30790
+ size: wonderBlocksTokens.spacing.xxSmall_6
30791
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelXSmall, {
30792
+ style: styles$u.caption
30793
+ }, "The figure is hidden from screen readers if this field is left blank."), /*#__PURE__*/React__namespace.createElement(Strut, {
30794
+ size: wonderBlocksTokens.spacing.xxSmall_6
30795
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextArea, {
30796
+ id: ariaLabelId,
30797
+ value: ariaLabel ?? "",
30798
+ onChange: newValue => {
30799
+ onChangeProps({
30800
+ // Save as undefined if the field is empty.
30801
+ ariaLabel: newValue || undefined
30802
+ });
30803
+ },
30804
+ placeholder: "Ex. Point at (x, y)",
30805
+ rows: 1,
30806
+ resizeType: "vertical"
30807
+ }), /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
30808
+ kind: "tertiary",
30809
+ startIcon: pencilCircle__default["default"],
30810
+ style: styles$u.button,
30811
+ onClick: () => {
30812
+ onChangeProps({
30813
+ ariaLabel: prePopulatedAriaLabel
30814
+ });
30815
+ }
30816
+ }, "Auto-generate"));
30817
+ }
30818
+ const styles$u = aphrodite.StyleSheet.create({
30819
+ row: {
30820
+ flexDirection: "row",
30821
+ alignItems: "center"
30822
+ },
30823
+ button: {
30824
+ alignSelf: "start"
30825
+ },
30826
+ caption: {
30827
+ color: wonderBlocksTokens.color.offBlack64
30828
+ }
30829
+ });
30830
+
30769
30831
  /**
30770
30832
  * The part of a locked figure settings panel that contains actions
30771
30833
  * for this panel and its associated locked figure, including
@@ -30885,7 +30947,7 @@ function LockedLabelSettings(props) {
30885
30947
  })
30886
30948
  })), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
30887
30949
  style: styles$s.row
30888
- }, onMove && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
30950
+ }, /*#__PURE__*/React__namespace.createElement(ColorSelect, {
30889
30951
  selectedValue: color,
30890
30952
  onChange: newColor => {
30891
30953
  onChangeProps({
@@ -30895,7 +30957,7 @@ function LockedLabelSettings(props) {
30895
30957
  style: styles$s.spaceUnder
30896
30958
  }), /*#__PURE__*/React__namespace.createElement(Strut, {
30897
30959
  size: wonderBlocksTokens.spacing.medium_16
30898
- })), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30960
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
30899
30961
  tag: "label",
30900
30962
  style: styles$s.row
30901
30963
  }, "size", /*#__PURE__*/React__namespace.createElement(Strut, {
@@ -31028,6 +31090,7 @@ const LockedEllipseSettings = props => {
31028
31090
  angle,
31029
31091
  color,
31030
31092
  labels,
31093
+ ariaLabel,
31031
31094
  fillStyle,
31032
31095
  strokeStyle,
31033
31096
  expanded,
@@ -31036,6 +31099,31 @@ const LockedEllipseSettings = props => {
31036
31099
  onMove,
31037
31100
  onRemove
31038
31101
  } = props;
31102
+ function getPrepopulatedAriaLabel() {
31103
+ const isCircle = radius[0] === radius[1];
31104
+ let str = "";
31105
+ if (isCircle) {
31106
+ str += `Circle with radius ${radius[0]}`;
31107
+ } else {
31108
+ str += `Ellipse with x radius ${radius[0]} and y radius ${radius[1]}`;
31109
+ }
31110
+ str += `, centered at (${center[0]}, ${center[1]})`;
31111
+ if (!isCircle && angle !== 0) {
31112
+ str += `, rotated by ${radianToDegree(angle)} degrees`;
31113
+ }
31114
+ if (labels && labels.length > 0) {
31115
+ str += ", with label";
31116
+ // Make it "with labels" instead of "with label" if there are
31117
+ // multiple labels.
31118
+ if (labels.length > 1) {
31119
+ str += "s";
31120
+ }
31121
+
31122
+ // Separate additional labels with commas.
31123
+ str += ` ${labels.map(l => l.text).join(", ")}`;
31124
+ }
31125
+ return str;
31126
+ }
31039
31127
  function handleCenterChange(newCoord) {
31040
31128
  const xOffset = newCoord[0] - center[0];
31041
31129
  const yOffset = newCoord[1] - center[1];
@@ -31150,7 +31238,23 @@ const LockedEllipseSettings = props => {
31150
31238
  onChange: value => onChangeProps({
31151
31239
  strokeStyle: value
31152
31240
  })
31153
- }), flags?.["mafs"]?.["locked-ellipse-labels"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, labels?.map((label, labelIndex) => /*#__PURE__*/React__namespace.createElement(LockedLabelSettings, _extends({}, label, {
31241
+ }), flags?.["mafs"]?.["locked-figures-aria"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Strut, {
31242
+ size: wonderBlocksTokens.spacing.small_12
31243
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31244
+ style: styles$r.horizontalRule
31245
+ }), /*#__PURE__*/React__namespace.createElement(LockedFigureAria, {
31246
+ ariaLabel: ariaLabel,
31247
+ prePopulatedAriaLabel: getPrepopulatedAriaLabel(),
31248
+ onChangeProps: newProps => {
31249
+ onChangeProps(newProps);
31250
+ }
31251
+ })), flags?.["mafs"]?.["locked-ellipse-labels"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Strut, {
31252
+ size: wonderBlocksTokens.spacing.xxxSmall_4
31253
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31254
+ style: styles$r.horizontalRule
31255
+ }), /*#__PURE__*/React__namespace.createElement(Strut, {
31256
+ size: wonderBlocksTokens.spacing.small_12
31257
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, null, "Visible labels"), labels?.map((label, labelIndex) => /*#__PURE__*/React__namespace.createElement(LockedLabelSettings, _extends({}, label, {
31154
31258
  expanded: true,
31155
31259
  onChangeProps: newLabel => {
31156
31260
  handleLabelChange(newLabel, labelIndex);
@@ -31201,6 +31305,10 @@ const styles$r = aphrodite.StyleSheet.create({
31201
31305
  },
31202
31306
  labelContainer: {
31203
31307
  backgroundColor: wonderBlocksTokens.color.white
31308
+ },
31309
+ horizontalRule: {
31310
+ height: 1,
31311
+ backgroundColor: wonderBlocksTokens.color.offBlack16
31204
31312
  }
31205
31313
  });
31206
31314
 
@@ -31245,12 +31353,12 @@ const LockedFunctionSettings = props => {
31245
31353
  directionalAxis,
31246
31354
  domain,
31247
31355
  labels,
31356
+ ariaLabel,
31248
31357
  onChangeProps,
31249
31358
  onMove,
31250
31359
  onRemove
31251
31360
  } = props;
31252
31361
  const equationPrefix = directionalAxis === "x" ? "y=" : "x=";
31253
- const domainRangeText = directionalAxis === "x" ? "domain" : "range";
31254
31362
  const lineLabel = `Function (${equationPrefix}${equation})`;
31255
31363
 
31256
31364
  // Tracking the string value of domain/range constraints to handle interim state of
@@ -31262,6 +31370,27 @@ const LockedFunctionSettings = props => {
31262
31370
  // "useEffect" used to maintain parity between domain/range constraints and their string representation.
31263
31371
  setDomainEntries([domain && domain[0] !== -Infinity ? domain[0].toString() : "", domain && domain[1] !== Infinity ? domain[1].toString() : ""]);
31264
31372
  }, [domain]);
31373
+ function getPrepopulatedAriaLabel() {
31374
+ let str = `Function with equation ${equationPrefix}${equation}`;
31375
+
31376
+ // Add the domain/range constraints to the aria label
31377
+ // if they are not the default values.
31378
+ if (domain && !(domain[0] === -Infinity && domain[1] === Infinity)) {
31379
+ str += `, domain from ${domain[0]} to ${domain[1]}`;
31380
+ }
31381
+ if (labels && labels.length > 0) {
31382
+ str += ", with label";
31383
+ // Make it "with labels" instead of "with label" if there are
31384
+ // multiple labels.
31385
+ if (labels.length > 1) {
31386
+ str += "s";
31387
+ }
31388
+
31389
+ // Separate additional labels with commas.
31390
+ str += ` ${labels.map(l => l.text).join(", ")}`;
31391
+ }
31392
+ return str;
31393
+ }
31265
31394
 
31266
31395
  // Generic function for handling property changes (except for 'domain/range')
31267
31396
  function handlePropChange(property, newValue) {
@@ -31387,7 +31516,7 @@ const LockedFunctionSettings = props => {
31387
31516
  }, /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
31388
31517
  tag: "label",
31389
31518
  style: [styles$p.dropdownLabel, styles$p.domainMin]
31390
- }, `${domainRangeText} min`, /*#__PURE__*/React__namespace.createElement(Strut, {
31519
+ }, "domain min", /*#__PURE__*/React__namespace.createElement(Strut, {
31391
31520
  size: wonderBlocksTokens.spacing.xxSmall_6
31392
31521
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksForm.TextField, {
31393
31522
  type: "number",
@@ -31400,7 +31529,7 @@ const LockedFunctionSettings = props => {
31400
31529
  size: wonderBlocksTokens.spacing.medium_16
31401
31530
  }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
31402
31531
  tag: "label",
31403
- "aria-label": `${domainRangeText} max`,
31532
+ "aria-label": "domain max",
31404
31533
  style: [styles$p.dropdownLabel, styles$p.domainMax]
31405
31534
  }, "max", /*#__PURE__*/React__namespace.createElement(Strut, {
31406
31535
  size: wonderBlocksTokens.spacing.xxSmall_6
@@ -31434,13 +31563,30 @@ const LockedFunctionSettings = props => {
31434
31563
  }))), exampleCategorySelected && /*#__PURE__*/React__namespace.createElement("ul", {
31435
31564
  className: aphrodite.css(styles$p.exampleContainer)
31436
31565
  }, exampleContent.map((example, index) => /*#__PURE__*/React__namespace.createElement(ExampleItem, {
31566
+ key: index,
31437
31567
  category: exampleCategory,
31438
31568
  example: example,
31439
31569
  index: index,
31440
31570
  pasteEquationFn: handlePropChange
31441
- })))), flags?.["mafs"]?.["locked-function-labels"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31571
+ })))), flags?.["mafs"]?.["locked-figures-aria"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Strut, {
31572
+ size: wonderBlocksTokens.spacing.small_12
31573
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31442
31574
  style: styles$p.horizontalRule
31443
- }), labels?.map((label, labelIndex) => /*#__PURE__*/React__namespace.createElement(LockedLabelSettings, _extends({}, label, {
31575
+ }), /*#__PURE__*/React__namespace.createElement(LockedFigureAria, {
31576
+ ariaLabel: ariaLabel,
31577
+ prePopulatedAriaLabel: getPrepopulatedAriaLabel(),
31578
+ onChangeProps: newProps => {
31579
+ onChangeProps(newProps);
31580
+ }
31581
+ })), flags?.["mafs"]?.["locked-function-labels"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Strut, {
31582
+ size: wonderBlocksTokens.spacing.xxxSmall_4
31583
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31584
+ style: styles$p.horizontalRule
31585
+ }), /*#__PURE__*/React__namespace.createElement(Strut, {
31586
+ size: wonderBlocksTokens.spacing.small_12
31587
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, null, "Visible labels"), labels?.map((label, labelIndex) => /*#__PURE__*/React__namespace.createElement(LockedLabelSettings, _extends({
31588
+ key: labelIndex
31589
+ }, label, {
31444
31590
  expanded: true,
31445
31591
  onChangeProps: newLabel => {
31446
31592
  handleLabelChange(newLabel, labelIndex);
@@ -31601,8 +31747,6 @@ const styles$p = aphrodite.StyleSheet.create({
31601
31747
  alignSelf: "start"
31602
31748
  },
31603
31749
  horizontalRule: {
31604
- marginTop: wonderBlocksTokens.spacing.small_12,
31605
- marginBottom: wonderBlocksTokens.spacing.xxxSmall_4,
31606
31750
  height: 1,
31607
31751
  backgroundColor: wonderBlocksTokens.color.offBlack16
31608
31752
  },
@@ -31648,6 +31792,7 @@ const LockedPointSettings = props => {
31648
31792
  color: pointColor,
31649
31793
  filled = true,
31650
31794
  labels,
31795
+ ariaLabel,
31651
31796
  onChangeProps,
31652
31797
  onMove,
31653
31798
  onRemove,
@@ -31658,6 +31803,31 @@ const LockedPointSettings = props => {
31658
31803
  onToggle
31659
31804
  } = props;
31660
31805
  const isDefiningPoint = !onMove && !onRemove;
31806
+
31807
+ /**
31808
+ * Get a prepopulated aria label for the point.
31809
+ *
31810
+ * If the point has no labels, the aria label will just be
31811
+ * "Point at (x, y)".
31812
+ *
31813
+ * If the point has labels, the aria label will be
31814
+ * "Point at (x, y) with label1, label2, label3".
31815
+ */
31816
+ function getPrepopulatedAriaLabel() {
31817
+ let str = `Point at (${coord[0]}, ${coord[1]})`;
31818
+ if (labels && labels.length > 0) {
31819
+ str += " with label";
31820
+ // Make it "with labels" instead of "with label" if there are
31821
+ // multiple labels.
31822
+ if (labels.length > 1) {
31823
+ str += "s";
31824
+ }
31825
+
31826
+ // Separate additional labels with commas.
31827
+ str += ` ${labels.map(l => l.text).join(", ")}`;
31828
+ }
31829
+ return str;
31830
+ }
31661
31831
  function handleColorChange(newValue) {
31662
31832
  const newProps = {
31663
31833
  color: newValue
@@ -31747,7 +31917,23 @@ const LockedPointSettings = props => {
31747
31917
  filled: !newValue
31748
31918
  });
31749
31919
  }
31750
- })), (!isDefiningPoint && flags?.["mafs"]?.["locked-point-labels"] || isDefiningPoint && flags?.["mafs"]?.["locked-line-labels"]) && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, labels?.map((label, labelIndex) => /*#__PURE__*/React__namespace.createElement(LockedLabelSettings, _extends({}, label, {
31920
+ })), !isDefiningPoint && flags?.["mafs"]?.["locked-figures-aria"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Strut, {
31921
+ size: wonderBlocksTokens.spacing.small_12
31922
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31923
+ style: styles$n.horizontalRule
31924
+ }), /*#__PURE__*/React__namespace.createElement(LockedFigureAria, {
31925
+ ariaLabel: ariaLabel,
31926
+ prePopulatedAriaLabel: getPrepopulatedAriaLabel(),
31927
+ onChangeProps: newProps => {
31928
+ onChangeProps(newProps);
31929
+ }
31930
+ })), (!isDefiningPoint && flags?.["mafs"]?.["locked-point-labels"] || isDefiningPoint && flags?.["mafs"]?.["locked-line-labels"]) && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Strut, {
31931
+ size: wonderBlocksTokens.spacing.xxxSmall_4
31932
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31933
+ style: styles$n.horizontalRule
31934
+ }), /*#__PURE__*/React__namespace.createElement(Strut, {
31935
+ size: wonderBlocksTokens.spacing.small_12
31936
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, null, "Visible labels"), labels?.map((label, labelIndex) => /*#__PURE__*/React__namespace.createElement(LockedLabelSettings, _extends({}, label, {
31751
31937
  containerStyle: !isDefiningPoint && styles$n.lockedPointLabelContainer,
31752
31938
  expanded: true,
31753
31939
  onChangeProps: newLabel => {
@@ -31809,6 +31995,10 @@ const styles$n = aphrodite.StyleSheet.create({
31809
31995
  },
31810
31996
  addButton: {
31811
31997
  alignSelf: "start"
31998
+ },
31999
+ horizontalRule: {
32000
+ height: 1,
32001
+ backgroundColor: wonderBlocksTokens.color.offBlack16
31812
32002
  }
31813
32003
  });
31814
32004
 
@@ -31823,6 +32013,7 @@ const LockedLineSettings = props => {
31823
32013
  showPoint1,
31824
32014
  showPoint2,
31825
32015
  labels,
32016
+ ariaLabel,
31826
32017
  onChangeProps,
31827
32018
  onMove,
31828
32019
  onRemove
@@ -31834,6 +32025,21 @@ const LockedLineSettings = props => {
31834
32025
 
31835
32026
  // Check if the line has length 0.
31836
32027
  const isInvalid = kmath.vector.equal(point1.coord, point2.coord);
32028
+ function getPrepopulatedAriaLabel() {
32029
+ let str = `${capitalizeKind} from (${point1.coord[0]}, ${point1.coord[1]}) to (${point2.coord[0]}, ${point2.coord[1]})`;
32030
+ if (labels && labels.length > 0) {
32031
+ str += " with label";
32032
+ // Make it "with labels" instead of "with label" if there are
32033
+ // multiple labels.
32034
+ if (labels.length > 1) {
32035
+ str += "s";
32036
+ }
32037
+
32038
+ // Separate additional labels with commas.
32039
+ str += ` ${labels.map(l => l.text).join(", ")}`;
32040
+ }
32041
+ return str;
32042
+ }
31837
32043
  function handleChangePoint(newPointProps, index) {
31838
32044
  const newPoints = [...points];
31839
32045
  newPoints[index] = {
@@ -31973,9 +32179,23 @@ const LockedLineSettings = props => {
31973
32179
  showPoint2: newValue
31974
32180
  }),
31975
32181
  onChangeProps: newProps => handleChangePoint(newProps, 1)
31976
- })), flags?.["mafs"]?.["locked-line-labels"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
32182
+ })), flags?.["mafs"]?.["locked-figures-aria"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Strut, {
32183
+ size: wonderBlocksTokens.spacing.small_12
32184
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
31977
32185
  style: styles$m.horizontalRule
31978
- }), labels?.map((label, labelIndex) => /*#__PURE__*/React__namespace.createElement(LockedLabelSettings, _extends({}, label, {
32186
+ }), /*#__PURE__*/React__namespace.createElement(LockedFigureAria, {
32187
+ ariaLabel: ariaLabel,
32188
+ prePopulatedAriaLabel: getPrepopulatedAriaLabel(),
32189
+ onChangeProps: newProps => {
32190
+ onChangeProps(newProps);
32191
+ }
32192
+ })), flags?.["mafs"]?.["locked-line-labels"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Strut, {
32193
+ size: wonderBlocksTokens.spacing.xxxSmall_4
32194
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
32195
+ style: styles$m.horizontalRule
32196
+ }), /*#__PURE__*/React__namespace.createElement(Strut, {
32197
+ size: wonderBlocksTokens.spacing.small_12
32198
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, null, "Visible labels"), labels?.map((label, labelIndex) => /*#__PURE__*/React__namespace.createElement(LockedLabelSettings, _extends({}, label, {
31979
32199
  expanded: true,
31980
32200
  onChangeProps: newLabel => {
31981
32201
  handleLabelChange(newLabel, labelIndex);
@@ -32025,8 +32245,6 @@ const styles$m = aphrodite.StyleSheet.create({
32025
32245
  alignSelf: "start"
32026
32246
  },
32027
32247
  horizontalRule: {
32028
- marginTop: wonderBlocksTokens.spacing.small_12,
32029
- marginBottom: wonderBlocksTokens.spacing.xxxSmall_4,
32030
32248
  height: 1,
32031
32249
  backgroundColor: wonderBlocksTokens.color.offBlack16
32032
32250
  },
@@ -32072,58 +32290,127 @@ const styles$l = aphrodite.StyleSheet.create({
32072
32290
 
32073
32291
  const LockedPolygonSettings = props => {
32074
32292
  const {
32293
+ flags,
32075
32294
  points,
32076
32295
  color,
32077
32296
  showVertices,
32078
32297
  fillStyle,
32079
32298
  strokeStyle,
32299
+ labels,
32300
+ ariaLabel,
32080
32301
  expanded,
32081
32302
  onToggle,
32082
32303
  onChangeProps,
32083
32304
  onMove,
32084
32305
  onRemove
32085
32306
  } = props;
32307
+ function getPrepopulatedAriaLabel() {
32308
+ let str = `Polygon with ${points.length} sides, vertices at `;
32309
+
32310
+ // Add the coordinates of each point to the aria label
32311
+ str += points.map(_ref => {
32312
+ let [x, y] = _ref;
32313
+ return `(${x}, ${y})`;
32314
+ }).join(", ");
32315
+ if (labels && labels.length > 0) {
32316
+ str += ", with label";
32317
+ // Make it "with labels" instead of "with label" if there are
32318
+ // multiple labels.
32319
+ if (labels.length > 1) {
32320
+ str += "s";
32321
+ }
32322
+
32323
+ // Separate additional labels with commas.
32324
+ str += ` ${labels.map(l => l.text).join(", ")}`;
32325
+ }
32326
+ return str;
32327
+ }
32086
32328
  function handleColorChange(newValue) {
32087
- onChangeProps({
32329
+ const newProps = {
32088
32330
  color: newValue
32089
- });
32331
+ };
32332
+
32333
+ // Update the color of the all labels to match the point
32334
+ newProps.labels = labels?.map(label => ({
32335
+ ...label,
32336
+ color: newValue
32337
+ }));
32338
+ onChangeProps(newProps);
32090
32339
  }
32091
32340
  function handlePolygonMove(movement) {
32092
32341
  switch (movement) {
32093
32342
  case "up":
32094
32343
  onChangeProps({
32095
- points: points.map(_ref => {
32096
- let [x, y] = _ref;
32344
+ points: points.map(_ref2 => {
32345
+ let [x, y] = _ref2;
32097
32346
  return [x, y + 1];
32098
- })
32347
+ }),
32348
+ labels: labels?.map(label => ({
32349
+ ...label,
32350
+ coord: [label.coord[0], label.coord[1] + 1]
32351
+ }))
32099
32352
  });
32100
32353
  break;
32101
32354
  case "down":
32102
32355
  onChangeProps({
32103
- points: points.map(_ref2 => {
32104
- let [x, y] = _ref2;
32356
+ points: points.map(_ref3 => {
32357
+ let [x, y] = _ref3;
32105
32358
  return [x, y - 1];
32106
- })
32359
+ }),
32360
+ labels: labels?.map(label => ({
32361
+ ...label,
32362
+ coord: [label.coord[0], label.coord[1] - 1]
32363
+ }))
32107
32364
  });
32108
32365
  break;
32109
32366
  case "left":
32110
32367
  onChangeProps({
32111
- points: points.map(_ref3 => {
32112
- let [x, y] = _ref3;
32368
+ points: points.map(_ref4 => {
32369
+ let [x, y] = _ref4;
32113
32370
  return [x - 1, y];
32114
- })
32371
+ }),
32372
+ labels: labels?.map(label => ({
32373
+ ...label,
32374
+ coord: [label.coord[0] - 1, label.coord[1]]
32375
+ }))
32115
32376
  });
32116
32377
  break;
32117
32378
  case "right":
32118
32379
  onChangeProps({
32119
- points: points.map(_ref4 => {
32120
- let [x, y] = _ref4;
32380
+ points: points.map(_ref5 => {
32381
+ let [x, y] = _ref5;
32121
32382
  return [x + 1, y];
32122
- })
32383
+ }),
32384
+ labels: labels?.map(label => ({
32385
+ ...label,
32386
+ coord: [label.coord[0] + 1, label.coord[1]]
32387
+ }))
32123
32388
  });
32124
32389
  break;
32125
32390
  }
32126
32391
  }
32392
+ function handleLabelChange(updatedLabel, labelIndex) {
32393
+ if (!labels) {
32394
+ return;
32395
+ }
32396
+ const updatedLabels = [...labels];
32397
+ updatedLabels[labelIndex] = {
32398
+ ...labels[labelIndex],
32399
+ ...updatedLabel
32400
+ };
32401
+ onChangeProps({
32402
+ labels: updatedLabels
32403
+ });
32404
+ }
32405
+ function handleLabelRemove(labelIndex) {
32406
+ if (!labels) {
32407
+ return;
32408
+ }
32409
+ const updatedLabels = labels.filter((_, index) => index !== labelIndex);
32410
+ onChangeProps({
32411
+ labels: updatedLabels
32412
+ });
32413
+ }
32127
32414
  return /*#__PURE__*/React__namespace.createElement(PerseusEditorAccordion, {
32128
32415
  expanded: expanded,
32129
32416
  onToggle: onToggle,
@@ -32252,7 +32539,50 @@ const LockedPolygonSettings = props => {
32252
32539
  size: "small",
32253
32540
  icon: arrowFatRight__default["default"],
32254
32541
  onClick: () => handlePolygonMove("right")
32255
- }))))), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
32542
+ }))))), flags?.["mafs"]?.["locked-figures-aria"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Strut, {
32543
+ size: wonderBlocksTokens.spacing.small_12
32544
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
32545
+ style: styles$k.horizontalRule
32546
+ }), /*#__PURE__*/React__namespace.createElement(LockedFigureAria, {
32547
+ ariaLabel: ariaLabel,
32548
+ prePopulatedAriaLabel: getPrepopulatedAriaLabel(),
32549
+ onChangeProps: newProps => {
32550
+ onChangeProps(newProps);
32551
+ }
32552
+ })), flags?.["mafs"]?.["locked-polygon-labels"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Strut, {
32553
+ size: wonderBlocksTokens.spacing.xxxSmall_4
32554
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
32555
+ style: styles$k.horizontalRule
32556
+ }), /*#__PURE__*/React__namespace.createElement(Strut, {
32557
+ size: wonderBlocksTokens.spacing.small_12
32558
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, null, "Visible labels"), labels?.map((label, labelIndex) => /*#__PURE__*/React__namespace.createElement(LockedLabelSettings, _extends({}, label, {
32559
+ expanded: true,
32560
+ onChangeProps: newLabel => {
32561
+ handleLabelChange(newLabel, labelIndex);
32562
+ },
32563
+ onRemove: () => {
32564
+ handleLabelRemove(labelIndex);
32565
+ },
32566
+ containerStyle: styles$k.labelContainer
32567
+ }))), /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
32568
+ kind: "tertiary",
32569
+ startIcon: plusCircle__default["default"],
32570
+ onClick: () => {
32571
+ const newLabel = {
32572
+ ...getDefaultFigureForType("label"),
32573
+ coord: [points[0][0],
32574
+ // Additional vertical offset for each
32575
+ // label so they don't overlap.
32576
+ points[0][1] - (labels?.length ?? 0)],
32577
+ // Default to the same color as the ellipse
32578
+ color: color
32579
+ };
32580
+ onChangeProps({
32581
+ labels: [...(labels ?? []), newLabel]
32582
+ });
32583
+ },
32584
+ style: styles$k.addButton
32585
+ }, "Add visible label")), /*#__PURE__*/React__namespace.createElement(LockedFigureSettingsActions, {
32256
32586
  figureType: props.type,
32257
32587
  onMove: onMove,
32258
32588
  onRemove: onRemove
@@ -32291,6 +32621,17 @@ const styles$k = aphrodite.StyleSheet.create({
32291
32621
  truncatedWidth: {
32292
32622
  // Allow truncation, stop bleeding over the edge.
32293
32623
  minWidth: 0
32624
+ },
32625
+ // Styles for the visible labels section
32626
+ addButton: {
32627
+ alignSelf: "start"
32628
+ },
32629
+ labelContainer: {
32630
+ backgroundColor: wonderBlocksTokens.color.white
32631
+ },
32632
+ horizontalRule: {
32633
+ height: 1,
32634
+ backgroundColor: wonderBlocksTokens.color.offBlack16
32294
32635
  }
32295
32636
  });
32296
32637
 
@@ -32301,6 +32642,7 @@ const LockedVectorSettings = props => {
32301
32642
  points,
32302
32643
  color: lineColor,
32303
32644
  labels,
32645
+ ariaLabel,
32304
32646
  onChangeProps,
32305
32647
  onMove,
32306
32648
  onRemove
@@ -32310,6 +32652,21 @@ const LockedVectorSettings = props => {
32310
32652
 
32311
32653
  // Check if the line has length 0.
32312
32654
  const isInvalid = kmath.vector.equal(tail, tip);
32655
+ function getPrepopulatedAriaLabel() {
32656
+ let str = `Vector from (${tail[0]}, ${tail[1]}) to (${tip[0]}, ${tip[1]})`;
32657
+ if (labels && labels.length > 0) {
32658
+ str += " with label";
32659
+ // Make it "with labels" instead of "with label" if there are
32660
+ // multiple labels.
32661
+ if (labels.length > 1) {
32662
+ str += "s";
32663
+ }
32664
+
32665
+ // Separate additional labels with commas.
32666
+ str += ` ${labels.map(l => l.text).join(", ")}`;
32667
+ }
32668
+ return str;
32669
+ }
32313
32670
  function handleChangePoint(newCoord, index) {
32314
32671
  if (typeof newCoord !== "undefined") {
32315
32672
  const newPoints = [...points];
@@ -32409,9 +32766,23 @@ const LockedVectorSettings = props => {
32409
32766
  onChange: newProps => {
32410
32767
  handleChangePoint(newProps, 1);
32411
32768
  }
32412
- })), flags?.["mafs"]?.["locked-vector-labels"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
32769
+ })), flags?.["mafs"]?.["locked-figures-aria"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Strut, {
32770
+ size: wonderBlocksTokens.spacing.small_12
32771
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
32772
+ style: styles$j.horizontalRule
32773
+ }), /*#__PURE__*/React__namespace.createElement(LockedFigureAria, {
32774
+ ariaLabel: ariaLabel,
32775
+ prePopulatedAriaLabel: getPrepopulatedAriaLabel(),
32776
+ onChangeProps: newProps => {
32777
+ onChangeProps(newProps);
32778
+ }
32779
+ })), flags?.["mafs"]?.["locked-vector-labels"] && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Strut, {
32780
+ size: wonderBlocksTokens.spacing.xxxSmall_4
32781
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
32413
32782
  style: styles$j.horizontalRule
32414
- }), labels?.map((label, labelIndex) => /*#__PURE__*/React__namespace.createElement(LockedLabelSettings, _extends({}, label, {
32783
+ }), /*#__PURE__*/React__namespace.createElement(Strut, {
32784
+ size: wonderBlocksTokens.spacing.small_12
32785
+ }), /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelMedium, null, "Visible labels"), labels?.map((label, labelIndex) => /*#__PURE__*/React__namespace.createElement(LockedLabelSettings, _extends({}, label, {
32415
32786
  expanded: true,
32416
32787
  onChangeProps: newLabel => {
32417
32788
  handleLabelChange(newLabel, labelIndex);
@@ -32468,8 +32839,6 @@ const styles$j = aphrodite.StyleSheet.create({
32468
32839
  alignSelf: "start"
32469
32840
  },
32470
32841
  horizontalRule: {
32471
- marginTop: wonderBlocksTokens.spacing.small_12,
32472
- marginBottom: wonderBlocksTokens.spacing.xxxSmall_4,
32473
32842
  height: 1,
32474
32843
  backgroundColor: wonderBlocksTokens.color.offBlack16
32475
32844
  },