@khanacademy/perseus-editor 14.9.0 → 14.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { addLibraryVersionToPerseusDebug, PerseusError, Errors } from '@khanacademy/perseus-core';
2
- import { constants, components, Widgets, icons, WIDGET_PROP_DENYLIST, Util, Log, PerseusMarkdown, preprocessTex, ApiOptions, buildMapper, itemToTree, buildEmptyItemTreeForShape, shapes, ItemExtras, itemDataVersion, ClassNames, MultiItems, traverse, Categorizer as Categorizer$1, Changeable, EditorJsonify, Dependencies, PerseusExpressionAnswerFormConsidered, Expression, interactiveSizes, KhanMath, GrapherWidget, GrapherUtil, SizingUtils, PerseusI18nContext, KhanColors, lockedFigureColors, lockedFigureFillStyles, getAngleCoords, getPolygonCoords, getPointCoords, getQuadraticCoords, getSinusoidCoords, getCircleCoords, getLinearSystemCoords, getSegmentCoords, getLineCoords, getClockwiseAngle, InteractiveGraphWidget, globalStyles, globalConstants, MatrixWidget, makeSafeUrl, PlotterWidget, plotterPlotTypes, BaseRadio, TableWidget, widgets } from '@khanacademy/perseus';
2
+ import { components, Widgets, iconChevronDown, iconTrash, WIDGET_PROP_DENYLIST, Util, Log, PerseusMarkdown, preprocessTex, ApiOptions, buildMapper, itemToTree, buildEmptyItemTreeForShape, shapes, ItemExtras, itemDataVersion, ClassNames, MultiItems, traverse, Categorizer as Categorizer$1, Changeable, EditorJsonify, Dependencies, PerseusExpressionAnswerFormConsidered, Expression, interactiveSizes, KhanMath, GrapherWidget, GrapherUtil, containerSizeClass, getInteractiveBoxFromSizeClass, PerseusI18nContext, KhanColors, lockedFigureColors, lockedFigureFillStyles, getAngleCoords, getPolygonCoords, getPointCoords, getQuadraticCoords, getSinusoidCoords, getCircleCoords, getLinearSystemCoords, getSegmentCoords, getLineCoords, getClockwiseAngle, InteractiveGraphWidget, bodyXsmallBold, MatrixWidget, makeSafeUrl, PlotterWidget, plotterPlotTypes, BaseRadio, TableWidget, widgets } from '@khanacademy/perseus';
3
3
  export { widgets } from '@khanacademy/perseus';
4
4
  import * as React from 'react';
5
5
  import { useRef, useEffect, useState, useId } from 'react';
@@ -46,7 +46,7 @@ import arrowCounterClockwise from '@phosphor-icons/core/bold/arrow-counter-clock
46
46
 
47
47
  // This file is processed by a Rollup plugin (replace) to inject the production
48
48
  const libName = "@khanacademy/perseus-editor";
49
- const libVersion = "14.9.0";
49
+ const libVersion = "14.10.0";
50
50
  addLibraryVersionToPerseusDebug(libName, libVersion);
51
51
 
52
52
  function _extends() {
@@ -59,6 +59,21 @@ function _extends() {
59
59
  }, _extends.apply(null, arguments);
60
60
  }
61
61
 
62
+ const devices = {
63
+ PHONE: "phone",
64
+ TABLET: "tablet",
65
+ DESKTOP: "desktop"
66
+ };
67
+
68
+ // How many pixels do we reserve on the right-hand side of a preview
69
+ // for displaying lint indicators? This space needs to be reserved
70
+ // in DeviceFramer, but it is actually allocated in PerseusFrame
71
+ const lintGutterWidth = 36;
72
+
73
+ // How wide a border does PerseusFrame draw? We need to allocate enough
74
+ // space for it in DeviceFramer.
75
+ const perseusFrameBorderWidth = 1;
76
+
62
77
  const SCREEN_SIZES = {
63
78
  phone: {
64
79
  width: 320,
@@ -105,7 +120,7 @@ const DeviceFramer = ({
105
120
  key: "screen",
106
121
  style: {
107
122
  overflow: "scroll",
108
- width: SCREEN_SIZES[_deviceType].framedWidth + 2 * constants.perseusFrameBorderWidth + constants.lintGutterWidth
123
+ width: SCREEN_SIZES[_deviceType].framedWidth + 2 * perseusFrameBorderWidth + lintGutterWidth
109
124
  }
110
125
  }, /*#__PURE__*/React.createElement("div", null, children));
111
126
  }
@@ -20676,15 +20691,52 @@ const Spacing = {
20676
20691
  xxxLarge_64: 64
20677
20692
  };
20678
20693
 
20694
+ const iconChevronRight = {
20695
+ path: "M62.808 49.728q0 3.36-2.352 5.88l-41.72 41.664q-2.352 2.408-5.768 2.408t-5.768-2.408l-4.872-4.76q-2.352-2.52-2.352-5.88t2.352-5.712l31.08-31.136-31.08-31.024q-2.352-2.52-2.352-5.88t2.352-5.712l4.872-4.76q2.296-2.408 5.768-2.408t5.768 2.408l41.72 41.664q2.352 2.296 2.352 5.656z",
20696
+ width: 63.034,
20697
+ height: 100
20698
+ };
20699
+ const iconCircleArrowDown = {
20700
+ path: "M50.046 83.676q1.767 0 2.907-1.14l29.526-29.526q1.197-1.197 1.197-2.907t-1.197-2.964l-5.928-5.928q-1.197-1.14-2.964-1.14t-2.907 1.14l-12.312 12.312l0-32.661q0-1.71-1.254-2.964t-2.907-1.254l-8.322 0q-1.71 0-2.964 1.254t-1.254 2.964l0 32.661l-12.312-12.312q-1.197-1.254-2.907-1.254t-2.907 1.254l-5.928 5.928q-1.197 1.197-1.197 2.964t1.197 2.907l29.469 29.526q1.197 1.14 2.964 1.14zm49.989-33.63q.057 13.623-6.669 25.137t-18.24 18.183-25.08 6.669-25.137-6.726q-11.514-6.726-18.183-18.183-6.726-11.571-6.726-25.137t6.726-25.08 18.24-18.24 25.08-6.669q13.566 0 25.08 6.726 11.514 6.669 18.24 18.183t6.669 25.137z",
20701
+ width: 100,
20702
+ height: 100
20703
+ };
20704
+ const iconCircleArrowUp = {
20705
+ path: "M54.207 83.391q1.653 0 2.907-1.254t1.254-2.907l0-32.718l12.312 12.312q1.254 1.254 2.964 1.254t2.907-1.254l5.928-5.928q1.197-1.197 1.14-2.964 0-1.767-1.14-2.907l-29.526-29.526q-1.197-1.14-2.907-1.14t-2.964 1.14l-29.469 29.526q-1.197 1.254-1.197 2.964t1.197 2.907l5.928 5.928q1.197 1.197 2.907 1.197t2.907-1.197l12.312-12.312l0 32.718q0 1.653 1.254 2.907t2.964 1.254l8.322 0zm45.828-33.345q.057 13.623-6.669 25.137t-18.24 18.183-25.08 6.669-25.137-6.726q-11.514-6.726-18.183-18.183-6.726-11.571-6.726-25.137t6.726-25.08 18.24-18.24 25.08-6.669q13.566 0 25.08 6.726 11.514 6.669 18.24 18.183t6.669 25.137z",
20706
+ width: 100,
20707
+ height: 100
20708
+ };
20709
+ const iconDesktop = {
20710
+ path: "M94.208 52.119l0-43.746q0-.69-.506-1.15t-1.196-.506l-84.088 0q-.69 0-1.196.506t-.506 1.15l0 43.746q0 .69.506 1.196t1.196.506l84.088 0q.69 0 1.196-.506t.506-1.196zm6.716-43.746l0 57.224q0 3.45-2.484 5.934t-5.934 2.484l-28.566 0q0 3.128 2.53 7.774.828 1.61.828 2.622t-1.012 2.07q-1.012 1.012-2.346.966l-26.91 0q-1.38 0-2.392-1.012t-1.012-2.024q0-1.058 1.656-4.14t1.748-6.256l-28.612 0q-3.45 0-5.934-2.484t-2.484-5.934l0-57.224q0-3.45 2.484-5.934t5.934-2.438l84.088 0q3.45 0 5.98 2.438 2.438 2.484 2.438 5.934z",
20711
+ width: 100,
20712
+ height: 86.648
20713
+ };
20714
+ // Grabbed from https://github.com/encharm/Font-Awesome-SVG-PNG
20715
+ const iconGear = {
20716
+ path: "M1152 896q0-106-75-181t-181-75-181 75-75 181 75 181 181 75 181-75 75-181zm512-109v222q0 12-8 23t-20 13l-185 28q-19 54-39 91 35 50 107 138 10 12 10 25t-9 23q-27 37-99 108t-94 71q-12 0-26-9l-138-108q-44 23-91 38-16 136-29 186-7 28-36 28h-222q-14 0-24.5-8.5t-11.5-21.5l-28-184q-49-16-90-37l-141 107q-10 9-25 9-14 0-25-11-126-114-165-168-7-10-7-23 0-12 8-23 15-21 51-66.5t54-70.5q-27-50-41-99l-183-27q-13-2-21-12.5t-8-23.5v-222q0-12 8-23t19-13l186-28q14-46 39-92-40-57-107-138-10-12-10-24 0-10 9-23 26-36 98.5-107.5t94.5-71.5q13 0 26 10l138 107q44-23 91-38 16-136 29-186 7-28 36-28h222q14 0 24.5 8.5t11.5 21.5l28 184q49 16 90 37l142-107q9-9 24-9 13 0 25 10 129 119 165 170 7 8 7 22 0 12-8 23-15 21-51 66.5t-54 70.5q26 50 41 98l183 28q13 2 21 12.5t8 23.5z",
20717
+ width: 1792,
20718
+ height: 1792
20719
+ };
20720
+ const iconMobilePhone = {
20721
+ path: "M36.04 89.557q0-2.584-1.836-4.42t-4.42-1.836-4.352 1.836q-1.836 1.836-1.836 4.42t1.836 4.352 4.42 1.836q2.652-.068 4.42-1.836t1.768-4.352zm16.184-12.444l0-54.74q0-1.088-.748-1.768t-1.768-.68l-39.78 0q-1.088 0-1.768.748t-.68 1.7l0 54.74q0 1.02.748 1.768t1.7.68l39.78 0q1.02-.068 1.768-.748t.748-1.7zm-14.892-65.892q0-1.224-1.292-1.292l-12.444 0q-1.224.068-1.224 1.292t1.224 1.224l12.444 0q1.292 0 1.292-1.224zm22.372-1.292l0 79.628q0 3.944-2.992 6.936t-7.004 2.992l-39.78 0q-4.012 0-7.004-2.924-2.924-2.924-2.924-7.004l0-79.628q0-4.012 2.924-6.936t7.004-2.992l39.78 0q4.012-.068 7.004 2.924t2.992 7.004z",
20722
+ width: 60.013,
20723
+ height: 100
20724
+ };
20725
+ const iconPlus = {
20726
+ path: "M99.758 43.09l0 13.578q0 2.852-1.984 4.836t-4.836 1.984l-29.45 0l0 29.45q0 2.852-1.984 4.836t-4.836 1.984l-13.578 0q-2.852 0-4.836-1.984t-1.984-4.836l0-29.45l-29.45 0q-2.852 0-4.836-1.984t-1.984-4.836l0-13.578q0-2.852 1.984-4.836t4.836-1.984l29.45 0l0-29.45q0-2.852 1.984-4.836t4.836-1.984l13.578 0q2.852 0 4.836 1.984t1.984 4.836l0 29.45l29.45 0q2.852 0 4.836 1.984t1.984 4.836z",
20727
+ width: 100,
20728
+ height: 100
20729
+ };
20730
+ const iconTablet = {
20731
+ path: "M45.322 90.706q0-1.86-1.302-3.224-1.364-1.364-3.224-1.364t-3.224 1.364-1.302 3.224q0 1.86 1.364 3.224 1.302 1.364 3.162 1.302 1.86.062 3.224-1.302t1.302-3.224zm27.218-11.346l0-68.014q0-.93-.682-1.612t-1.55-.682l-58.962 0q-.93 0-1.612.682t-.682 1.612l0 68.014q0 .93.682 1.612t1.612.62l58.962 0q.992-.062 1.612-.682t.62-1.55zm9.114-68.014l0 77.066q0 4.65-3.348 7.998t-7.998 3.348l-58.962 0q-4.65 0-7.998-3.348t-3.348-7.998l0-77.066q0-4.65 3.348-7.998t7.998-3.348l58.962 0q4.65 0 7.998 3.348t3.348 7.998z",
20732
+ width: 81.852,
20733
+ height: 100
20734
+ };
20735
+
20679
20736
  const _excluded$4 = ["label"];
20680
20737
  const {
20681
20738
  InlineIcon: InlineIcon$a
20682
20739
  } = components;
20683
- const {
20684
- iconChevronDown: iconChevronDown$1,
20685
- iconChevronRight,
20686
- iconTrash: iconTrash$7
20687
- } = icons;
20688
20740
  const _upgradeWidgetInfo = props => {
20689
20741
  // We can't call serialize here because this.refs.widget
20690
20742
  // doesn't exist before this component is mounted.
@@ -20791,7 +20843,7 @@ class WidgetEditor extends React.Component {
20791
20843
  className: "perseus-widget-editor-title-id",
20792
20844
  href: "#",
20793
20845
  onClick: this._toggleWidget
20794
- }, this.props.id, this.state.showWidget ? /*#__PURE__*/React.createElement(InlineIcon$a, iconChevronDown$1) : /*#__PURE__*/React.createElement(InlineIcon$a, iconChevronRight)), supportsStaticMode && /*#__PURE__*/React.createElement(LabeledSwitch$1, {
20846
+ }, this.props.id, this.state.showWidget ? /*#__PURE__*/React.createElement(InlineIcon$a, iconChevronDown) : /*#__PURE__*/React.createElement(InlineIcon$a, iconChevronRight)), supportsStaticMode && /*#__PURE__*/React.createElement(LabeledSwitch$1, {
20795
20847
  label: "Static",
20796
20848
  checked: !!widgetInfo.static,
20797
20849
  onChange: this._setStatic
@@ -20802,7 +20854,7 @@ class WidgetEditor extends React.Component {
20802
20854
  }, supportedAlignments.map(alignment => /*#__PURE__*/React.createElement("option", {
20803
20855
  key: alignment
20804
20856
  }, alignment))), /*#__PURE__*/React.createElement(SectionControlButton, {
20805
- icon: iconTrash$7,
20857
+ icon: iconTrash,
20806
20858
  onClick: () => {
20807
20859
  this.props.onRemove();
20808
20860
  },
@@ -21925,12 +21977,6 @@ const {
21925
21977
  HUD: HUD$1,
21926
21978
  InlineIcon: InlineIcon$9
21927
21979
  } = components;
21928
- const {
21929
- iconCircleArrowDown: iconCircleArrowDown$1,
21930
- iconCircleArrowUp: iconCircleArrowUp$1,
21931
- iconPlus: iconPlus$4,
21932
- iconTrash: iconTrash$6
21933
- } = icons;
21934
21980
  class ArticleEditor extends React.Component {
21935
21981
  constructor(...args) {
21936
21982
  super(...args);
@@ -22029,25 +22075,25 @@ class ArticleEditor extends React.Component {
22029
22075
  float: "right"
22030
22076
  }
22031
22077
  }, sectionImageUploadGenerator(i), /*#__PURE__*/React.createElement(SectionControlButton, {
22032
- icon: iconPlus$4,
22078
+ icon: iconPlus,
22033
22079
  onClick: () => {
22034
22080
  this._handleAddSectionAfter(i);
22035
22081
  },
22036
22082
  title: "Add a new section after this one"
22037
22083
  }), i + 1 < sections.length && /*#__PURE__*/React.createElement(SectionControlButton, {
22038
- icon: iconCircleArrowDown$1,
22084
+ icon: iconCircleArrowDown,
22039
22085
  onClick: () => {
22040
22086
  this._handleMoveSectionLater(i);
22041
22087
  },
22042
22088
  title: "Move this section down"
22043
22089
  }), i > 0 && /*#__PURE__*/React.createElement(SectionControlButton, {
22044
- icon: iconCircleArrowUp$1,
22090
+ icon: iconCircleArrowUp,
22045
22091
  onClick: () => {
22046
22092
  this._handleMoveSectionEarlier(i);
22047
22093
  },
22048
22094
  title: "Move this section up"
22049
22095
  }), /*#__PURE__*/React.createElement(SectionControlButton, {
22050
- icon: iconTrash$6,
22096
+ icon: iconTrash,
22051
22097
  onClick: () => {
22052
22098
  const msg = "Are you sure you " + "want to delete section " + (i + 1) + "?";
22053
22099
  /* eslint-disable no-alert */
@@ -22082,7 +22128,7 @@ class ArticleEditor extends React.Component {
22082
22128
  onClick: () => {
22083
22129
  this._handleAddSectionAfter(this._sections().length - 1);
22084
22130
  }
22085
- }, /*#__PURE__*/React.createElement(InlineIcon$9, iconPlus$4), " Add a section")));
22131
+ }, /*#__PURE__*/React.createElement(InlineIcon$9, iconPlus), " Add a section")));
22086
22132
  }
22087
22133
  _renderLinterHUD() {
22088
22134
  return /*#__PURE__*/React.createElement(HUD$1, {
@@ -22232,14 +22278,6 @@ const {
22232
22278
  ButtonGroup: ButtonGroup$8,
22233
22279
  InlineIcon: InlineIcon$8
22234
22280
  } = components;
22235
- const {
22236
- devices
22237
- } = constants;
22238
- const {
22239
- iconDesktop,
22240
- iconMobilePhone,
22241
- iconTablet
22242
- } = icons;
22243
22281
  const ViewportResizer = props => {
22244
22282
  const phoneButtonContents = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(InlineIcon$8, iconMobilePhone), " Phone");
22245
22283
  const tabletButtonContents = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(InlineIcon$8, iconTablet), " Tablet");
@@ -23593,12 +23631,6 @@ const {
23593
23631
  InfoTip: InfoTip$n,
23594
23632
  InlineIcon: InlineIcon$7
23595
23633
  } = components;
23596
- const {
23597
- iconCircleArrowDown,
23598
- iconCircleArrowUp,
23599
- iconPlus: iconPlus$3,
23600
- iconTrash: iconTrash$5
23601
- } = icons;
23602
23634
  /* Renders a hint editor box
23603
23635
  *
23604
23636
  * This includes:
@@ -23672,7 +23704,7 @@ class HintEditor extends React.Component {
23672
23704
  type: "button",
23673
23705
  className: "remove-hint simple-button orange",
23674
23706
  onClick: this.props.onRemove
23675
- }, /*#__PURE__*/React.createElement(InlineIcon$7, iconTrash$5), "Remove this hint", " ")));
23707
+ }, /*#__PURE__*/React.createElement(InlineIcon$7, iconTrash), "Remove this hint", " ")));
23676
23708
  }
23677
23709
  }
23678
23710
  HintEditor.defaultProps = {
@@ -23896,7 +23928,7 @@ class CombinedHintsEditor extends React.Component {
23896
23928
  type: "button",
23897
23929
  className: "add-hint simple-button orange",
23898
23930
  onClick: this.addHint
23899
- }, /*#__PURE__*/React.createElement(InlineIcon$7, iconPlus$3), " Add a hint"))));
23931
+ }, /*#__PURE__*/React.createElement(InlineIcon$7, iconPlus), " Add a hint"))));
23900
23932
  /* eslint-enable max-len */
23901
23933
  }
23902
23934
  }
@@ -24779,10 +24811,6 @@ const _excluded$2 = ["depth"],
24779
24811
  const {
24780
24812
  InlineIcon: InlineIcon$6
24781
24813
  } = components;
24782
- const {
24783
- iconChevronDown,
24784
- iconTrash: iconTrash$4
24785
- } = icons;
24786
24814
  const {
24787
24815
  MultiRenderer
24788
24816
  } = MultiItems;
@@ -25261,7 +25289,7 @@ const ArrayNodeContent = props => {
25261
25289
  color: "orange",
25262
25290
  title: "Delete",
25263
25291
  onClick: () => actions.removeArrayElement(subpath)
25264
- }, /*#__PURE__*/React.createElement(InlineIcon$6, iconTrash$4)))];
25292
+ }, /*#__PURE__*/React.createElement(InlineIcon$6, iconTrash)))];
25265
25293
  return /*#__PURE__*/React.createElement("div", {
25266
25294
  key: i,
25267
25295
  className: css(styles$O.arrayElement, !elementIsLeaf && styles$O.arrayElementAndNotLeaf)
@@ -26013,10 +26041,6 @@ const {
26013
26041
  InfoTip: InfoTip$k,
26014
26042
  InlineIcon: InlineIcon$5
26015
26043
  } = components;
26016
- const {
26017
- iconPlus: iconPlus$2,
26018
- iconTrash: iconTrash$3
26019
- } = icons;
26020
26044
  class DropdownEditor extends React.Component {
26021
26045
  constructor(...args) {
26022
26046
  super(...args);
@@ -26131,14 +26155,14 @@ class DropdownEditor extends React.Component {
26131
26155
  this, i)
26132
26156
  }, /*#__PURE__*/React.createElement("span", {
26133
26157
  className: "remove-choice"
26134
- }, /*#__PURE__*/React.createElement(InlineIcon$5, iconTrash$3)))));
26158
+ }, /*#__PURE__*/React.createElement(InlineIcon$5, iconTrash)))));
26135
26159
  }, this)), /*#__PURE__*/React.createElement("div", {
26136
26160
  className: "add-choice-container"
26137
26161
  }, /*#__PURE__*/React.createElement("a", {
26138
26162
  href: "#",
26139
26163
  className: "simple-button orange",
26140
26164
  onClick: this.addChoice
26141
- }, /*#__PURE__*/React.createElement(InlineIcon$5, iconPlus$2), " Add a choice", " ")));
26165
+ }, /*#__PURE__*/React.createElement(InlineIcon$5, iconPlus), " Add a choice", " ")));
26142
26166
  }
26143
26167
  }
26144
26168
  DropdownEditor.propTypes = {
@@ -26840,10 +26864,6 @@ const {
26840
26864
  InlineIcon: InlineIcon$4,
26841
26865
  TextInput: TextInput$5
26842
26866
  } = components;
26843
- const {
26844
- iconPlus: iconPlus$1,
26845
- iconTrash: iconTrash$2
26846
- } = icons;
26847
26867
  class GradedGroupEditor extends React.Component {
26848
26868
  constructor(..._args) {
26849
26869
  super(..._args);
@@ -26912,7 +26932,7 @@ class GradedGroupEditor extends React.Component {
26912
26932
  },
26913
26933
  className: "add-hint simple-button orange",
26914
26934
  onClick: this.handleAddHint
26915
- }, /*#__PURE__*/React.createElement(InlineIcon$4, iconPlus$1), " Add a hint"), this.props.hint && /*#__PURE__*/React.createElement("div", {
26935
+ }, /*#__PURE__*/React.createElement(InlineIcon$4, iconPlus), " Add a hint"), this.props.hint && /*#__PURE__*/React.createElement("div", {
26916
26936
  className: "perseus-hint-editor"
26917
26937
  }, /*#__PURE__*/React.createElement("div", {
26918
26938
  className: css(styles$L.hintsTitle)
@@ -26934,7 +26954,7 @@ class GradedGroupEditor extends React.Component {
26934
26954
  type: "button",
26935
26955
  className: "remove-hint simple-button orange",
26936
26956
  onClick: this.handleRemoveHint
26937
- }, /*#__PURE__*/React.createElement(InlineIcon$4, iconTrash$2), " Remove this hint")));
26957
+ }, /*#__PURE__*/React.createElement(InlineIcon$4, iconTrash), " Remove this hint")));
26938
26958
  }
26939
26959
  }
26940
26960
  GradedGroupEditor.propTypes = _extends({}, Changeable.propTypes, {
@@ -27538,10 +27558,6 @@ const {
27538
27558
  InfoTip: InfoTip$h,
27539
27559
  MultiButtonGroup: MultiButtonGroup$1
27540
27560
  } = components;
27541
- const {
27542
- containerSizeClass: containerSizeClass$1,
27543
- getInteractiveBoxFromSizeClass: getInteractiveBoxFromSizeClass$1
27544
- } = SizingUtils;
27545
27561
  const Grapher = GrapherWidget.widget;
27546
27562
  const {
27547
27563
  DEFAULT_GRAPHER_PROPS,
@@ -27579,7 +27595,7 @@ class GrapherEditor extends React.Component {
27579
27595
  };
27580
27596
  }
27581
27597
  render() {
27582
- const sizeClass = containerSizeClass$1.SMALL;
27598
+ const sizeClass = containerSizeClass.SMALL;
27583
27599
  let equationString;
27584
27600
  let graph;
27585
27601
  if (this.props.graph.valid === true) {
@@ -27620,7 +27636,7 @@ class GrapherEditor extends React.Component {
27620
27636
  }
27621
27637
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, "Correct answer", " ", /*#__PURE__*/React.createElement(InfoTip$h, null, /*#__PURE__*/React.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.createElement(GraphSettings, {
27622
27638
  editableSettings: ["graph", "snap", "image"],
27623
- box: getInteractiveBoxFromSizeClass$1(sizeClass),
27639
+ box: getInteractiveBoxFromSizeClass(sizeClass),
27624
27640
  range: this.props.graph.range,
27625
27641
  labels: this.props.graph.labels,
27626
27642
  step: this.props.graph.step,
@@ -27945,7 +27961,7 @@ class ImageEditor extends React.Component {
27945
27961
  // eslint-disable-next-line react/jsx-no-bind
27946
27962
  ,
27947
27963
  onClick: this.removeLabel.bind(this, i)
27948
- }, /*#__PURE__*/React.createElement(InlineIcon$3, icons.iconTrash))));
27964
+ }, /*#__PURE__*/React.createElement(InlineIcon$3, iconTrash))));
27949
27965
  }
27950
27966
  change(...args) {
27951
27967
  return Changeable.change.apply(this, args);
@@ -28285,17 +28301,17 @@ class ElementContainer extends React.Component {
28285
28301
  href: "#",
28286
28302
  className: "perseus-interaction-element-title " + (this.state.show ? "open" : "closed"),
28287
28303
  onClick: this.toggle
28288
- }, this.state.show ? /*#__PURE__*/React.createElement(InlineIcon$2, icons.iconChevronDown) : /*#__PURE__*/React.createElement(InlineIcon$2, icons.iconChevronRight), this.props.title), /*#__PURE__*/React.createElement("div", {
28304
+ }, this.state.show ? /*#__PURE__*/React.createElement(InlineIcon$2, iconChevronDown) : /*#__PURE__*/React.createElement(InlineIcon$2, iconChevronRight), this.props.title), /*#__PURE__*/React.createElement("div", {
28289
28305
  className: "perseus-interaction-element-content " + (this.state.show ? "enter" : "leave")
28290
28306
  }, this.props.children, (this.props.onUp != null || this.props.onDown != null || this.props.onDelete != null) && /*#__PURE__*/React.createElement("div", {
28291
28307
  className: "edit-controls"
28292
28308
  }, this.props.onUp != null && /*#__PURE__*/React.createElement("button", {
28293
28309
  onClick: this.props.onUp
28294
- }, /*#__PURE__*/React.createElement(InlineIcon$2, icons.iconCircleArrowUp)), this.props.onDown != null && /*#__PURE__*/React.createElement("button", {
28310
+ }, /*#__PURE__*/React.createElement(InlineIcon$2, iconCircleArrowUp)), this.props.onDown != null && /*#__PURE__*/React.createElement("button", {
28295
28311
  onClick: this.props.onDown
28296
- }, /*#__PURE__*/React.createElement(InlineIcon$2, icons.iconCircleArrowDown)), this.props.onDelete != null && /*#__PURE__*/React.createElement("button", {
28312
+ }, /*#__PURE__*/React.createElement(InlineIcon$2, iconCircleArrowDown)), this.props.onDelete != null && /*#__PURE__*/React.createElement("button", {
28297
28313
  onClick: this.props.onDelete
28298
- }, /*#__PURE__*/React.createElement(InlineIcon$2, icons.iconTrash)))));
28314
+ }, /*#__PURE__*/React.createElement(InlineIcon$2, iconTrash)))));
28299
28315
  }
28300
28316
  }
28301
28317
  ElementContainer.defaultProps = {
@@ -33407,10 +33423,6 @@ const StartCoordsSettings = props => {
33407
33423
  const {
33408
33424
  InfoTip: InfoTip$b
33409
33425
  } = components;
33410
- const {
33411
- containerSizeClass,
33412
- getInteractiveBoxFromSizeClass
33413
- } = SizingUtils;
33414
33426
  const InteractiveGraph = InteractiveGraphWidget.widget;
33415
33427
  const defaultBackgroundImage = {
33416
33428
  url: null
@@ -33908,6 +33920,15 @@ const styles$a = StyleSheet.create({
33908
33920
  }
33909
33921
  });
33910
33922
 
33923
+ // TODO: use WB colors
33924
+ const gray98 = "#FAFAFA";
33925
+ const gray95 = "#F0F1F2";
33926
+ const gray85 = "#D6D8DA";
33927
+ const gray76 = "#BABEC2";
33928
+ const gray68 = "#888D93";
33929
+ const gray41 = "#626569";
33930
+ const gray17 = "#21242C";
33931
+
33911
33932
  const _excluded$1 = ["forwardedRef", "width", "grow", "shrink", "icon", "backgroundColor", "focusBorderColor", "borderColor", "color", "onSubmit", "leftSideIcon", "id", "testId", "type", "labelMediumInputText"];
33912
33933
  class FormWrappedTextField extends React.Component {
33913
33934
  constructor(...args) {
@@ -34008,13 +34029,16 @@ class FormWrappedTextField extends React.Component {
34008
34029
  }
34009
34030
  }
34010
34031
  const styles$9 = StyleSheet.create({
34011
- inputBase: _extends({
34032
+ inputBase: {
34012
34033
  background: "inherit",
34013
- border: "none"
34014
- }, globalStyles.typography.bodyXsmall, {
34034
+ border: "none",
34035
+ // TODO: can we use WB typography?
34036
+ fontFamily: "inherit",
34037
+ fontSize: 15,
34038
+ lineHeight: "22px",
34015
34039
  outline: "none",
34016
34040
  "::placeholder": {
34017
- color: globalStyles.colors.gray41
34041
+ color: gray41
34018
34042
  },
34019
34043
  width: "100%",
34020
34044
  color: "inherit",
@@ -34024,7 +34048,7 @@ const styles$9 = StyleSheet.create({
34024
34048
  padding: 0,
34025
34049
  // override Chrome's stylesheet
34026
34050
  margin: 0 // override Safari's stylesheet
34027
- }),
34051
+ },
34028
34052
 
34029
34053
  // HACK(mattmorgan) to enforce WB LabelMedium-like styles on this older
34030
34054
  // component.
@@ -34033,7 +34057,7 @@ const styles$9 = StyleSheet.create({
34033
34057
  border: "none",
34034
34058
  outline: "none",
34035
34059
  "::placeholder": {
34036
- color: globalStyles.colors.gray41
34060
+ color: gray41
34037
34061
  },
34038
34062
  width: "100%",
34039
34063
  fontWeight: "normal",
@@ -34043,7 +34067,7 @@ const styles$9 = StyleSheet.create({
34043
34067
  },
34044
34068
  input: {
34045
34069
  height: 40,
34046
- borderRadius: globalStyles.borderRadius,
34070
+ borderRadius: 4,
34047
34071
  boxSizing: "border-box",
34048
34072
  padding: "8px 10px"
34049
34073
  },
@@ -34053,7 +34077,7 @@ const styles$9 = StyleSheet.create({
34053
34077
  marginBottom: 0
34054
34078
  },
34055
34079
  defaultBackground: {
34056
- backgroundColor: globalStyles.colors.white
34080
+ backgroundColor: color.white
34057
34081
  },
34058
34082
  icon: {
34059
34083
  display: "flex",
@@ -34166,10 +34190,6 @@ const styles$8 = StyleSheet.create({
34166
34190
  }
34167
34191
  });
34168
34192
 
34169
- const {
34170
- colors: colors$6,
34171
- typography: typography$3
34172
- } = globalStyles;
34173
34193
  const {
34174
34194
  Icon: Icon$1
34175
34195
  } = components;
@@ -34214,7 +34234,7 @@ const DraggableGripIcon = () => /*#__PURE__*/React.createElement("svg", {
34214
34234
  values: "0 0 0 0 0.129411765 0 0 0 0 0.141176471 0 0 0 0 0.17254902 0 0 0 0.2 0"
34215
34235
  })), /*#__PURE__*/React.createElement("path", {
34216
34236
  d: "M1 4a1 1 0 1 1 0-2h14a1 1 0 0 1 0 2H1zm0 10a1 1 0 0 1 0-2h14a1 1 0 0 1 0 2H1zm0-5a1 1 0 1 1 0-2h14a1 1 0 0 1 0 2H1z",
34217
- fill: colors$6.gray17,
34237
+ fill: gray17,
34218
34238
  filter: "url(#draggable-grip-shadow)"
34219
34239
  }));
34220
34240
 
@@ -34291,9 +34311,9 @@ const AnswerChoices = ({
34291
34311
  onClick: () => onChange([...choices, ""])
34292
34312
  }));
34293
34313
  const styles$7 = StyleSheet.create({
34294
- title: _extends({}, typography$3.bodyXsmallBold, {
34314
+ title: _extends({}, bodyXsmallBold, {
34295
34315
  marginBottom: 6,
34296
- color: colors$6.gray17
34316
+ color: gray17
34297
34317
  }),
34298
34318
  answers: {
34299
34319
  marginTop: 12,
@@ -34307,7 +34327,7 @@ const styles$7 = StyleSheet.create({
34307
34327
  marginTop: 12
34308
34328
  }
34309
34329
  },
34310
- addAnswer: _extends({}, typography$3.bodyXsmallBold, {
34330
+ addAnswer: _extends({}, bodyXsmallBold, {
34311
34331
  display: "flex",
34312
34332
  flexDirection: "row",
34313
34333
  alignItems: "center",
@@ -34471,10 +34491,8 @@ HoverBehavior.defaultProps = {
34471
34491
  shouldUpdate: () => true
34472
34492
  };
34473
34493
 
34474
- const {
34475
- borderRadius: borderRadius$1,
34476
- colors: colors$5
34477
- } = globalStyles;
34494
+ const borderRadius = 4;
34495
+
34478
34496
  // NOTE(jangmi): Checkbox may have `onChange` depends on circumstances but lack
34479
34497
  // of onChange causes Dev only alert so we provide the no op func as default
34480
34498
  // to prevent that.
@@ -34491,7 +34509,7 @@ class Checkbox extends React.Component {
34491
34509
  dataTestId,
34492
34510
  id
34493
34511
  } = this.props;
34494
- const checkedColor = colors$5.gray41;
34512
+ const checkedColor = gray41;
34495
34513
  return /*#__PURE__*/React.createElement(HoverBehavior, null, ({
34496
34514
  focused
34497
34515
  }, handlers) => /*#__PURE__*/React.createElement("div", _extends({}, handlers, {
@@ -34515,14 +34533,14 @@ class Checkbox extends React.Component {
34515
34533
  height: size,
34516
34534
  x: "0",
34517
34535
  y: "0",
34518
- rx: borderRadius$1
34536
+ rx: borderRadius
34519
34537
  }), /*#__PURE__*/React.createElement("path", {
34520
- fill: colors$5.white,
34521
- stroke: colors$5.white,
34538
+ fill: color.white,
34539
+ stroke: color.white,
34522
34540
  d: "M4.98 7.41a0.58.58 0 1 0-0.81.81L6.47 10.53c0.23.23.59.23.81 0l4.55-4.55a0.58.58 0 0 0-0.81-0.81L6.88 9.31 4.98 7.41z"
34523
34541
  })), !checked && /*#__PURE__*/React.createElement("rect", {
34524
- fill: colors$5.white,
34525
- stroke: colors$5.gray68,
34542
+ fill: color.white,
34543
+ stroke: gray68,
34526
34544
  width: size - 2 * padding,
34527
34545
  height: size - 2 * padding,
34528
34546
  x: padding,
@@ -34556,7 +34574,7 @@ const styles$6 = StyleSheet.create({
34556
34574
  display: "inline-block",
34557
34575
  verticalAlign: "middle",
34558
34576
  lineHeight: 0,
34559
- borderRadius: borderRadius$1,
34577
+ borderRadius: borderRadius,
34560
34578
  width: sizeWithPadding,
34561
34579
  height: sizeWithPadding,
34562
34580
  flexShrink: 0
@@ -34569,7 +34587,7 @@ const styles$6 = StyleSheet.create({
34569
34587
  right: -2,
34570
34588
  bottom: -2,
34571
34589
  left: -2,
34572
- borderRadius: borderRadius$1 + 2,
34590
+ borderRadius: borderRadius + 2,
34573
34591
  backgroundColor: "lightblue" // TODO(kevinb) get real focus ring
34574
34592
  }
34575
34593
  },
@@ -34598,10 +34616,6 @@ const styles$6 = StyleSheet.create({
34598
34616
  }
34599
34617
  });
34600
34618
 
34601
- const {
34602
- colors: colors$4,
34603
- typography: typography$2
34604
- } = globalStyles;
34605
34619
  const Behavior = ({
34606
34620
  multipleAnswers,
34607
34621
  hideChoicesFromInstructions,
@@ -34650,26 +34664,27 @@ const Behavior = ({
34650
34664
  value: "RIGHT"
34651
34665
  }, " Right ")))));
34652
34666
  const styles$5 = StyleSheet.create({
34653
- title: _extends({}, typography$2.bodyXsmallBold, {
34667
+ title: _extends({}, bodyXsmallBold, {
34654
34668
  marginBottom: 6,
34655
- color: colors$4.gray17
34669
+ color: gray17
34656
34670
  }),
34657
34671
  option: {
34658
34672
  display: "flex",
34659
34673
  padding: "6px 0"
34660
34674
  },
34661
- label: _extends({}, typography$2.smallSubheadingMobile, {
34675
+ label: {
34676
+ // TODO: could we use WB typography?
34677
+ fontFamily: "inherit",
34678
+ fontSize: 15,
34679
+ lineHeight: 1.25,
34662
34680
  marginLeft: 16,
34663
- color: colors$4.gray17
34664
- })
34681
+ color: gray17
34682
+ }
34665
34683
  });
34666
34684
 
34667
34685
  const {
34668
34686
  Icon
34669
34687
  } = components;
34670
- const {
34671
- colors: colors$3
34672
- } = globalStyles;
34673
34688
  const findAndFocusElement = component => {
34674
34689
  const DOMNode = ReactDOM.findDOMNode(component);
34675
34690
  const button = DOMNode;
@@ -34718,7 +34733,6 @@ class Option extends React.Component {
34718
34733
  value,
34719
34734
  onClick,
34720
34735
  children,
34721
- optionRenderer,
34722
34736
  disabled,
34723
34737
  hideFocusState,
34724
34738
  testId,
@@ -34745,14 +34759,7 @@ class Option extends React.Component {
34745
34759
  "aria-disabled": disabled,
34746
34760
  "aria-label": ariaLabel,
34747
34761
  "data-testid": testId
34748
- }, optionRenderer && optionRenderer(
34749
- /*#__PURE__*/
34750
- /**
34751
- * This expects a `React.Element<>` but `children` is a
34752
- * `React.Node`. We can convert a `React.Node` to a
34753
- * `React.Element<>` by wrapping it in a fragment.
34754
- */
34755
- React.createElement(React.Fragment, null, children), value || "", selected || false, disabled), !optionRenderer && /*#__PURE__*/React.createElement("span", {
34762
+ }, /*#__PURE__*/React.createElement("span", {
34756
34763
  className: css(styles$4.option, selected && styles$4.optionSelected, disabled && styles$4.optionDisabled)
34757
34764
  }, children, selected && /*#__PURE__*/React.createElement("span", {
34758
34765
  className: css(styles$4.check)
@@ -34782,7 +34789,6 @@ class OptionGroup extends React.Component {
34782
34789
  children,
34783
34790
  onSelected,
34784
34791
  selectedValues,
34785
- optionRenderer,
34786
34792
  noMargin,
34787
34793
  onDropdownClose,
34788
34794
  hideFocusState
@@ -34804,7 +34810,6 @@ class OptionGroup extends React.Component {
34804
34810
  selected: selected,
34805
34811
  // @ts-expect-error - TS2532 - Object is possibly 'undefined'.
34806
34812
  onClick: () => onSelected(child.props.value),
34807
- optionRenderer: optionRenderer,
34808
34813
  ref: reference,
34809
34814
  onDropdownClose: onDropdownClose,
34810
34815
  hideFocusState: hideFocusState
@@ -34829,18 +34834,18 @@ const styles$4 = StyleSheet.create({
34829
34834
  whiteSpace: "nowrap",
34830
34835
  overflow: "hidden",
34831
34836
  textOverflow: "ellipsis",
34832
- color: colors$3.gray17,
34837
+ color: gray17,
34833
34838
  userSelect: "none",
34834
34839
  ":hover": {
34835
- backgroundColor: colors$3.gray95
34840
+ backgroundColor: gray95
34836
34841
  }
34837
34842
  },
34838
34843
  optionSelected: {
34839
- backgroundColor: colors$3.gray95,
34844
+ backgroundColor: gray95,
34840
34845
  color: "#11ACCD"
34841
34846
  },
34842
34847
  optionDisabled: {
34843
- color: colors$3.gray76,
34848
+ color: gray76,
34844
34849
  ":hover": {
34845
34850
  backgroundColor: "transparent"
34846
34851
  }
@@ -34868,10 +34873,6 @@ const styles$4 = StyleSheet.create({
34868
34873
  }
34869
34874
  });
34870
34875
 
34871
- const {
34872
- colors: colors$2,
34873
- borderRadius
34874
- } = globalStyles;
34875
34876
  class Marker extends React.Component {
34876
34877
  constructor(props) {
34877
34878
  super(props);
@@ -35057,7 +35058,7 @@ const styles$3 = StyleSheet.create({
35057
35058
  height: 0,
35058
35059
  left: -16,
35059
35060
  bottom: 8,
35060
- borderRight: `solid 16px ${colors$2.gray98}`,
35061
+ borderRight: `solid 16px ${gray98}`,
35061
35062
  borderTop: "solid 16px transparent",
35062
35063
  borderBottom: "solid 16px transparent"
35063
35064
  }
@@ -35068,7 +35069,7 @@ const styles$3 = StyleSheet.create({
35068
35069
  dividerHorizontal: {
35069
35070
  height: 0,
35070
35071
  margin: 0,
35071
- border: `solid ${colors$2.gray85}`,
35072
+ border: `solid ${gray85}`,
35072
35073
  borderWidth: "0 0 1px",
35073
35074
  boxShadow: "none"
35074
35075
  },
@@ -35077,19 +35078,15 @@ const styles$3 = StyleSheet.create({
35077
35078
  dropdownBody: {
35078
35079
  position: "absolute",
35079
35080
  border: "solid 1px rgba(0, 0, 0, 0.1)",
35080
- zIndex: globalConstants.zindexDropdown,
35081
- color: colors$2.gray17,
35082
- backgroundColor: colors$2.gray98,
35083
- borderRadius: borderRadius,
35081
+ zIndex: 1000,
35082
+ color: gray17,
35083
+ backgroundColor: gray98,
35084
+ borderRadius: 4,
35084
35085
  maxHeight: 320,
35085
35086
  cursor: "pointer"
35086
35087
  }
35087
35088
  });
35088
35089
 
35089
- const {
35090
- colors: colors$1,
35091
- typography: typography$1
35092
- } = globalStyles;
35093
35090
  class QuestionMarkers extends React.Component {
35094
35091
  constructor(...args) {
35095
35092
  super(...args);
@@ -35168,14 +35165,18 @@ class QuestionMarkers extends React.Component {
35168
35165
  }
35169
35166
  }
35170
35167
  const styles$2 = StyleSheet.create({
35171
- title: _extends({}, typography$1.bodyXsmallBold, {
35168
+ title: _extends({}, bodyXsmallBold, {
35172
35169
  marginBottom: 6,
35173
- color: colors$1.gray17
35170
+ color: gray17
35174
35171
  }),
35175
- subtitle: _extends({}, typography$1.labelSmall, {
35172
+ subtitle: {
35173
+ // TODO: can we use WB typography?
35174
+ fontFamily: "inherit",
35175
+ fontSize: 12,
35176
+ lineHeight: "14px",
35176
35177
  marginBottom: 12,
35177
- color: colors$1.gray68
35178
- }),
35178
+ color: gray68
35179
+ },
35179
35180
  markersCanvas: {
35180
35181
  position: "relative",
35181
35182
  border: "solid 1px rgba(33, 36, 44, 0.16)"
@@ -35190,10 +35191,6 @@ const styles$2 = StyleSheet.create({
35190
35191
  }
35191
35192
  });
35192
35193
 
35193
- const {
35194
- colors,
35195
- typography
35196
- } = globalStyles;
35197
35194
  const SelectImage = ({
35198
35195
  onChange,
35199
35196
  url
@@ -35223,9 +35220,9 @@ const SelectImage = ({
35223
35220
  style: styles$1.btn
35224
35221
  }, url ? "Remove" : "Upload")));
35225
35222
  const styles$1 = StyleSheet.create({
35226
- title: _extends({}, typography.bodyXsmallBold, {
35223
+ title: _extends({}, bodyXsmallBold, {
35227
35224
  marginBottom: 6,
35228
- color: colors.gray17
35225
+ color: gray17
35229
35226
  }),
35230
35227
  components: {
35231
35228
  display: "flex"
@@ -36158,10 +36155,6 @@ const {
36158
36155
  NumberInput: NumberInput$4,
36159
36156
  TextInput: TextInput$2
36160
36157
  } = components;
36161
- const {
36162
- iconGear,
36163
- iconTrash: iconTrash$1
36164
- } = icons;
36165
36158
  const {
36166
36159
  firstNumericalParse
36167
36160
  } = Util;
@@ -36496,7 +36489,7 @@ class NumericInputEditor extends React.Component {
36496
36489
  this.onTrashAnswer(i);
36497
36490
  },
36498
36491
  onKeyDown: e => this.onSpace(e, this.onTrashAnswer)
36499
- }, /*#__PURE__*/React.createElement(InlineIcon$1, iconTrash$1)), /*#__PURE__*/React.createElement("a", {
36492
+ }, /*#__PURE__*/React.createElement(InlineIcon$1, iconTrash)), /*#__PURE__*/React.createElement("a", {
36500
36493
  href: "#",
36501
36494
  className: "options-toggle",
36502
36495
  "aria-label": "Toggle options",
@@ -37218,10 +37211,6 @@ PythonProgramEditor.defaultProps = {
37218
37211
  const {
37219
37212
  InlineIcon
37220
37213
  } = components;
37221
- const {
37222
- iconPlus,
37223
- iconTrash
37224
- } = icons;
37225
37214
  class ChoiceEditor extends React.Component {
37226
37215
  render() {
37227
37216
  const checkedClass = this.props.choice.correct ? "correct" : "incorrect";