@khanacademy/perseus-editor 14.9.1 → 14.10.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
@@ -98,7 +98,7 @@ var arrowCounterClockwise__default = /*#__PURE__*/_interopDefaultLegacy(arrowCou
98
98
 
99
99
  // This file is processed by a Rollup plugin (replace) to inject the production
100
100
  const libName = "@khanacademy/perseus-editor";
101
- const libVersion = "14.9.1";
101
+ const libVersion = "14.10.1";
102
102
  perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
103
103
 
104
104
  function _extends() {
@@ -116,6 +116,21 @@ function _extends() {
116
116
  return _extends.apply(this, arguments);
117
117
  }
118
118
 
119
+ const devices = {
120
+ PHONE: "phone",
121
+ TABLET: "tablet",
122
+ DESKTOP: "desktop"
123
+ };
124
+
125
+ // How many pixels do we reserve on the right-hand side of a preview
126
+ // for displaying lint indicators? This space needs to be reserved
127
+ // in DeviceFramer, but it is actually allocated in PerseusFrame
128
+ const lintGutterWidth = 36;
129
+
130
+ // How wide a border does PerseusFrame draw? We need to allocate enough
131
+ // space for it in DeviceFramer.
132
+ const perseusFrameBorderWidth = 1;
133
+
119
134
  /**
120
135
  * A component that displays its contents inside a device frame.
121
136
  */
@@ -166,7 +181,7 @@ const DeviceFramer = _ref => {
166
181
  key: "screen",
167
182
  style: {
168
183
  overflow: "scroll",
169
- width: SCREEN_SIZES[deviceType].framedWidth + 2 * perseus.constants.perseusFrameBorderWidth + perseus.constants.lintGutterWidth
184
+ width: SCREEN_SIZES[deviceType].framedWidth + 2 * perseusFrameBorderWidth + lintGutterWidth
170
185
  }
171
186
  }, /*#__PURE__*/React__namespace.createElement("div", null, children));
172
187
  }
@@ -20726,14 +20741,51 @@ const Spacing = {
20726
20741
  xxxLarge_64: 64
20727
20742
  };
20728
20743
 
20744
+ const iconChevronRight = {
20745
+ 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",
20746
+ width: 63.034,
20747
+ height: 100
20748
+ };
20749
+ const iconCircleArrowDown = {
20750
+ 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",
20751
+ width: 100,
20752
+ height: 100
20753
+ };
20754
+ const iconCircleArrowUp = {
20755
+ 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",
20756
+ width: 100,
20757
+ height: 100
20758
+ };
20759
+ const iconDesktop = {
20760
+ 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",
20761
+ width: 100,
20762
+ height: 86.648
20763
+ };
20764
+ // Grabbed from https://github.com/encharm/Font-Awesome-SVG-PNG
20765
+ const iconGear = {
20766
+ 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",
20767
+ width: 1792,
20768
+ height: 1792
20769
+ };
20770
+ const iconMobilePhone = {
20771
+ 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",
20772
+ width: 60.013,
20773
+ height: 100
20774
+ };
20775
+ const iconPlus = {
20776
+ 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",
20777
+ width: 100,
20778
+ height: 100
20779
+ };
20780
+ const iconTablet = {
20781
+ 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",
20782
+ width: 81.852,
20783
+ height: 100
20784
+ };
20785
+
20729
20786
  const {
20730
20787
  InlineIcon: InlineIcon$a
20731
20788
  } = perseus.components;
20732
- const {
20733
- iconChevronDown: iconChevronDown$1,
20734
- iconChevronRight,
20735
- iconTrash: iconTrash$7
20736
- } = perseus.icons;
20737
20789
  const _upgradeWidgetInfo = props => {
20738
20790
  // We can't call serialize here because this.refs.widget
20739
20791
  // doesn't exist before this component is mounted.
@@ -20843,7 +20895,7 @@ class WidgetEditor extends React__namespace.Component {
20843
20895
  className: "perseus-widget-editor-title-id",
20844
20896
  href: "#",
20845
20897
  onClick: this._toggleWidget
20846
- }, this.props.id, this.state.showWidget ? /*#__PURE__*/React__namespace.createElement(InlineIcon$a, iconChevronDown$1) : /*#__PURE__*/React__namespace.createElement(InlineIcon$a, iconChevronRight)), supportsStaticMode && /*#__PURE__*/React__namespace.createElement(LabeledSwitch$1, {
20898
+ }, this.props.id, this.state.showWidget ? /*#__PURE__*/React__namespace.createElement(InlineIcon$a, perseus.iconChevronDown) : /*#__PURE__*/React__namespace.createElement(InlineIcon$a, iconChevronRight)), supportsStaticMode && /*#__PURE__*/React__namespace.createElement(LabeledSwitch$1, {
20847
20899
  label: "Static",
20848
20900
  checked: !!widgetInfo.static,
20849
20901
  onChange: this._setStatic
@@ -20854,7 +20906,7 @@ class WidgetEditor extends React__namespace.Component {
20854
20906
  }, supportedAlignments.map(alignment => /*#__PURE__*/React__namespace.createElement("option", {
20855
20907
  key: alignment
20856
20908
  }, alignment))), /*#__PURE__*/React__namespace.createElement(SectionControlButton, {
20857
- icon: iconTrash$7,
20909
+ icon: perseus.iconTrash,
20858
20910
  onClick: () => {
20859
20911
  this.props.onRemove();
20860
20912
  },
@@ -21967,12 +22019,6 @@ const {
21967
22019
  HUD: HUD$1,
21968
22020
  InlineIcon: InlineIcon$9
21969
22021
  } = perseus.components;
21970
- const {
21971
- iconCircleArrowDown: iconCircleArrowDown$1,
21972
- iconCircleArrowUp: iconCircleArrowUp$1,
21973
- iconPlus: iconPlus$4,
21974
- iconTrash: iconTrash$6
21975
- } = perseus.icons;
21976
22022
  class ArticleEditor extends React__namespace.Component {
21977
22023
  static defaultProps = {
21978
22024
  contentPaths: [],
@@ -22067,25 +22113,25 @@ class ArticleEditor extends React__namespace.Component {
22067
22113
  float: "right"
22068
22114
  }
22069
22115
  }, sectionImageUploadGenerator(i), /*#__PURE__*/React__namespace.createElement(SectionControlButton, {
22070
- icon: iconPlus$4,
22116
+ icon: iconPlus,
22071
22117
  onClick: () => {
22072
22118
  this._handleAddSectionAfter(i);
22073
22119
  },
22074
22120
  title: "Add a new section after this one"
22075
22121
  }), i + 1 < sections.length && /*#__PURE__*/React__namespace.createElement(SectionControlButton, {
22076
- icon: iconCircleArrowDown$1,
22122
+ icon: iconCircleArrowDown,
22077
22123
  onClick: () => {
22078
22124
  this._handleMoveSectionLater(i);
22079
22125
  },
22080
22126
  title: "Move this section down"
22081
22127
  }), i > 0 && /*#__PURE__*/React__namespace.createElement(SectionControlButton, {
22082
- icon: iconCircleArrowUp$1,
22128
+ icon: iconCircleArrowUp,
22083
22129
  onClick: () => {
22084
22130
  this._handleMoveSectionEarlier(i);
22085
22131
  },
22086
22132
  title: "Move this section up"
22087
22133
  }), /*#__PURE__*/React__namespace.createElement(SectionControlButton, {
22088
- icon: iconTrash$6,
22134
+ icon: perseus.iconTrash,
22089
22135
  onClick: () => {
22090
22136
  const msg = "Are you sure you " + "want to delete section " + (i + 1) + "?";
22091
22137
  /* eslint-disable no-alert */
@@ -22120,7 +22166,7 @@ class ArticleEditor extends React__namespace.Component {
22120
22166
  onClick: () => {
22121
22167
  this._handleAddSectionAfter(this._sections().length - 1);
22122
22168
  }
22123
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$9, iconPlus$4), " Add a section")));
22169
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$9, iconPlus), " Add a section")));
22124
22170
  }
22125
22171
  _renderLinterHUD() {
22126
22172
  return /*#__PURE__*/React__namespace.createElement(HUD$1, {
@@ -22275,14 +22321,6 @@ const {
22275
22321
  ButtonGroup: ButtonGroup$8,
22276
22322
  InlineIcon: InlineIcon$8
22277
22323
  } = perseus.components;
22278
- const {
22279
- devices
22280
- } = perseus.constants;
22281
- const {
22282
- iconDesktop,
22283
- iconMobilePhone,
22284
- iconTablet
22285
- } = perseus.icons;
22286
22324
  const ViewportResizer = props => {
22287
22325
  const phoneButtonContents = /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(InlineIcon$8, iconMobilePhone), " Phone");
22288
22326
  const tabletButtonContents = /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(InlineIcon$8, iconTablet), " Tablet");
@@ -23622,12 +23660,6 @@ const {
23622
23660
  InfoTip: InfoTip$n,
23623
23661
  InlineIcon: InlineIcon$7
23624
23662
  } = perseus.components;
23625
- const {
23626
- iconCircleArrowDown,
23627
- iconCircleArrowUp,
23628
- iconPlus: iconPlus$3,
23629
- iconTrash: iconTrash$5
23630
- } = perseus.icons;
23631
23663
  /* Renders a hint editor box
23632
23664
  *
23633
23665
  * This includes:
@@ -23703,7 +23735,7 @@ class HintEditor extends React__namespace.Component {
23703
23735
  type: "button",
23704
23736
  className: "remove-hint simple-button orange",
23705
23737
  onClick: this.props.onRemove
23706
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$7, iconTrash$5), "Remove this hint", " ")));
23738
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$7, perseus.iconTrash), "Remove this hint", " ")));
23707
23739
  }
23708
23740
  }
23709
23741
  /* A single hint-row containing a hint editor and preview */
@@ -23915,7 +23947,7 @@ class CombinedHintsEditor extends React__namespace.Component {
23915
23947
  type: "button",
23916
23948
  className: "add-hint simple-button orange",
23917
23949
  onClick: this.addHint
23918
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$7, iconPlus$3), " Add a hint"))));
23950
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$7, iconPlus), " Add a hint"))));
23919
23951
  /* eslint-enable max-len */
23920
23952
  }
23921
23953
  }
@@ -24780,10 +24812,6 @@ const styles$P = aphrodite.StyleSheet.create({
24780
24812
  const {
24781
24813
  InlineIcon: InlineIcon$6
24782
24814
  } = perseus.components;
24783
- const {
24784
- iconChevronDown,
24785
- iconTrash: iconTrash$4
24786
- } = perseus.icons;
24787
24815
  const {
24788
24816
  MultiRenderer
24789
24817
  } = perseus.MultiItems;
@@ -25244,21 +25272,21 @@ const ArrayNodeContent = props => {
25244
25272
  onClick: () => actions.moveArrayElementUp(subpath)
25245
25273
  }, /*#__PURE__*/React__namespace.createElement("div", {
25246
25274
  className: aphrodite.css(styles$O.verticalFlip)
25247
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconChevronDown)))), i < data.length - 1 && /*#__PURE__*/React__namespace.createElement("div", {
25275
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, perseus.iconChevronDown)))), i < data.length - 1 && /*#__PURE__*/React__namespace.createElement("div", {
25248
25276
  key: "moveArrayElementDown",
25249
25277
  className: aphrodite.css(styles$O.control)
25250
25278
  }, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
25251
25279
  color: "orange",
25252
25280
  title: "Move down",
25253
25281
  onClick: () => actions.moveArrayElementDown(subpath)
25254
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconChevronDown))), /*#__PURE__*/React__namespace.createElement("div", {
25282
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, perseus.iconChevronDown))), /*#__PURE__*/React__namespace.createElement("div", {
25255
25283
  key: "removeArrayElement",
25256
25284
  className: aphrodite.css(styles$O.control)
25257
25285
  }, /*#__PURE__*/React__namespace.createElement(SimpleButton, {
25258
25286
  color: "orange",
25259
25287
  title: "Delete",
25260
25288
  onClick: () => actions.removeArrayElement(subpath)
25261
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, iconTrash$4)))];
25289
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$6, perseus.iconTrash)))];
25262
25290
  return /*#__PURE__*/React__namespace.createElement("div", {
25263
25291
  key: i,
25264
25292
  className: aphrodite.css(styles$O.arrayElement, !elementIsLeaf && styles$O.arrayElementAndNotLeaf)
@@ -25393,14 +25421,14 @@ class MultiRendererEditor extends React__namespace.Component {
25393
25421
  item: item,
25394
25422
  shape: itemShape,
25395
25423
  apiOptions: apiOptions
25396
- // Today, with analytics being the only thing in
25397
- // dependencies, we send in a dummy function as we don't
25398
- // want to gather analytics events from within the editor.
25424
+ // MultiRenderer is on its way out,
25425
+ // so I think it's save to use these dummy deps
25399
25426
  ,
25400
25427
  dependencies: {
25401
25428
  analytics: {
25402
25429
  onAnalyticsEvent: async () => {}
25403
- }
25430
+ },
25431
+ useVideo: () => {}
25404
25432
  }
25405
25433
  }, _ref4 => {
25406
25434
  let {
@@ -26035,10 +26063,6 @@ const {
26035
26063
  InfoTip: InfoTip$k,
26036
26064
  InlineIcon: InlineIcon$5
26037
26065
  } = perseus.components;
26038
- const {
26039
- iconPlus: iconPlus$2,
26040
- iconTrash: iconTrash$3
26041
- } = perseus.icons;
26042
26066
  class DropdownEditor extends React__namespace.Component {
26043
26067
  static propTypes = {
26044
26068
  choices: PropTypes__default["default"].arrayOf(PropTypes__default["default"].shape({
@@ -26165,14 +26189,14 @@ class DropdownEditor extends React__namespace.Component {
26165
26189
  this, i)
26166
26190
  }, /*#__PURE__*/React__namespace.createElement("span", {
26167
26191
  className: "remove-choice"
26168
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$5, iconTrash$3)))));
26192
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$5, perseus.iconTrash)))));
26169
26193
  }, this)), /*#__PURE__*/React__namespace.createElement("div", {
26170
26194
  className: "add-choice-container"
26171
26195
  }, /*#__PURE__*/React__namespace.createElement("a", {
26172
26196
  href: "#",
26173
26197
  className: "simple-button orange",
26174
26198
  onClick: this.addChoice
26175
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$5, iconPlus$2), " Add a choice", " ")));
26199
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$5, iconPlus), " Add a choice", " ")));
26176
26200
  }
26177
26201
  }
26178
26202
 
@@ -26873,10 +26897,6 @@ const {
26873
26897
  InlineIcon: InlineIcon$4,
26874
26898
  TextInput: TextInput$5
26875
26899
  } = perseus.components;
26876
- const {
26877
- iconPlus: iconPlus$1,
26878
- iconTrash: iconTrash$2
26879
- } = perseus.icons;
26880
26900
  class GradedGroupEditor extends React__namespace.Component {
26881
26901
  static propTypes = {
26882
26902
  ...perseus.Changeable.propTypes,
@@ -26961,7 +26981,7 @@ class GradedGroupEditor extends React__namespace.Component {
26961
26981
  },
26962
26982
  className: "add-hint simple-button orange",
26963
26983
  onClick: this.handleAddHint
26964
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$4, iconPlus$1), " Add a hint"), this.props.hint && /*#__PURE__*/React__namespace.createElement("div", {
26984
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$4, iconPlus), " Add a hint"), this.props.hint && /*#__PURE__*/React__namespace.createElement("div", {
26965
26985
  className: "perseus-hint-editor"
26966
26986
  }, /*#__PURE__*/React__namespace.createElement("div", {
26967
26987
  className: aphrodite.css(styles$L.hintsTitle)
@@ -26983,7 +27003,7 @@ class GradedGroupEditor extends React__namespace.Component {
26983
27003
  type: "button",
26984
27004
  className: "remove-hint simple-button orange",
26985
27005
  onClick: this.handleRemoveHint
26986
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$4, iconTrash$2), " Remove this hint")));
27006
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$4, perseus.iconTrash), " Remove this hint")));
26987
27007
  }
26988
27008
  }
26989
27009
  const styles$L = aphrodite.StyleSheet.create({
@@ -27586,10 +27606,6 @@ const {
27586
27606
  InfoTip: InfoTip$h,
27587
27607
  MultiButtonGroup: MultiButtonGroup$1
27588
27608
  } = perseus.components;
27589
- const {
27590
- containerSizeClass: containerSizeClass$1,
27591
- getInteractiveBoxFromSizeClass: getInteractiveBoxFromSizeClass$1
27592
- } = perseus.SizingUtils;
27593
27609
  const Grapher = perseus.GrapherWidget.widget;
27594
27610
  const {
27595
27611
  DEFAULT_GRAPHER_PROPS,
@@ -27639,7 +27655,7 @@ class GrapherEditor extends React__namespace.Component {
27639
27655
  }).value();
27640
27656
  };
27641
27657
  render() {
27642
- const sizeClass = containerSizeClass$1.SMALL;
27658
+ const sizeClass = perseus.containerSizeClass.SMALL;
27643
27659
  let equationString;
27644
27660
  let graph;
27645
27661
  if (this.props.graph.valid === true) {
@@ -27679,7 +27695,7 @@ class GrapherEditor extends React__namespace.Component {
27679
27695
  }
27680
27696
  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, {
27681
27697
  editableSettings: ["graph", "snap", "image"],
27682
- box: getInteractiveBoxFromSizeClass$1(sizeClass),
27698
+ box: perseus.getInteractiveBoxFromSizeClass(sizeClass),
27683
27699
  range: this.props.graph.range,
27684
27700
  labels: this.props.graph.labels,
27685
27701
  step: this.props.graph.step,
@@ -28022,7 +28038,7 @@ class ImageEditor extends React__namespace.Component {
28022
28038
  // eslint-disable-next-line react/jsx-no-bind
28023
28039
  ,
28024
28040
  onClick: this.removeLabel.bind(this, i)
28025
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$3, perseus.icons.iconTrash))));
28041
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$3, perseus.iconTrash))));
28026
28042
  }
28027
28043
  change() {
28028
28044
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
@@ -28354,17 +28370,17 @@ class ElementContainer extends React__namespace.Component {
28354
28370
  href: "#",
28355
28371
  className: "perseus-interaction-element-title " + (this.state.show ? "open" : "closed"),
28356
28372
  onClick: this.toggle
28357
- }, this.state.show ? /*#__PURE__*/React__namespace.createElement(InlineIcon$2, perseus.icons.iconChevronDown) : /*#__PURE__*/React__namespace.createElement(InlineIcon$2, perseus.icons.iconChevronRight), this.props.title), /*#__PURE__*/React__namespace.createElement("div", {
28373
+ }, this.state.show ? /*#__PURE__*/React__namespace.createElement(InlineIcon$2, perseus.iconChevronDown) : /*#__PURE__*/React__namespace.createElement(InlineIcon$2, iconChevronRight), this.props.title), /*#__PURE__*/React__namespace.createElement("div", {
28358
28374
  className: "perseus-interaction-element-content " + (this.state.show ? "enter" : "leave")
28359
28375
  }, this.props.children, (this.props.onUp != null || this.props.onDown != null || this.props.onDelete != null) && /*#__PURE__*/React__namespace.createElement("div", {
28360
28376
  className: "edit-controls"
28361
28377
  }, this.props.onUp != null && /*#__PURE__*/React__namespace.createElement("button", {
28362
28378
  onClick: this.props.onUp
28363
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$2, perseus.icons.iconCircleArrowUp)), this.props.onDown != null && /*#__PURE__*/React__namespace.createElement("button", {
28379
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$2, iconCircleArrowUp)), this.props.onDown != null && /*#__PURE__*/React__namespace.createElement("button", {
28364
28380
  onClick: this.props.onDown
28365
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$2, perseus.icons.iconCircleArrowDown)), this.props.onDelete != null && /*#__PURE__*/React__namespace.createElement("button", {
28381
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$2, iconCircleArrowDown)), this.props.onDelete != null && /*#__PURE__*/React__namespace.createElement("button", {
28366
28382
  onClick: this.props.onDelete
28367
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$2, perseus.icons.iconTrash)))));
28383
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$2, perseus.iconTrash)))));
28368
28384
  }
28369
28385
  }
28370
28386
 
@@ -33578,10 +33594,6 @@ const StartCoordsSettings = props => {
33578
33594
  const {
33579
33595
  InfoTip: InfoTip$b
33580
33596
  } = perseus.components;
33581
- const {
33582
- containerSizeClass,
33583
- getInteractiveBoxFromSizeClass
33584
- } = perseus.SizingUtils;
33585
33597
  const InteractiveGraph = perseus.InteractiveGraphWidget.widget;
33586
33598
  const defaultBackgroundImage = {
33587
33599
  url: null
@@ -33671,7 +33683,7 @@ class InteractiveGraphEditor extends React__namespace.Component {
33671
33683
  let equationString;
33672
33684
  const gridStep = this.props.gridStep || perseus.Util.getGridStep(this.props.range, this.props.step, perseus.interactiveSizes.defaultBoxSize);
33673
33685
  const snapStep = this.props.snapStep || perseus.Util.snapStepFromGridStep(gridStep);
33674
- const sizeClass = containerSizeClass.SMALL;
33686
+ const sizeClass = perseus.containerSizeClass.SMALL;
33675
33687
  if (this.props.valid === true) {
33676
33688
  const correct = this.props.correct;
33677
33689
 
@@ -33950,7 +33962,7 @@ class InteractiveGraphEditor extends React__namespace.Component {
33950
33962
  step: this.props.step,
33951
33963
  onChange: this.changeStartCoords
33952
33964
  })), /*#__PURE__*/React__namespace.createElement(InteractiveGraphSettings, {
33953
- box: getInteractiveBoxFromSizeClass(sizeClass),
33965
+ box: perseus.getInteractiveBoxFromSizeClass(sizeClass),
33954
33966
  range: this.props.range,
33955
33967
  labels: this.props.labels,
33956
33968
  step: this.props.step,
@@ -34131,6 +34143,15 @@ const styles$a = aphrodite.StyleSheet.create({
34131
34143
  }
34132
34144
  });
34133
34145
 
34146
+ // TODO: use WB colors
34147
+ const gray98 = "#FAFAFA";
34148
+ const gray95 = "#F0F1F2";
34149
+ const gray85 = "#D6D8DA";
34150
+ const gray76 = "#BABEC2";
34151
+ const gray68 = "#888D93";
34152
+ const gray41 = "#626569";
34153
+ const gray17 = "#21242C";
34154
+
34134
34155
  class FormWrappedTextField extends React__namespace.Component {
34135
34156
  state = {
34136
34157
  focused: false
@@ -34229,10 +34250,13 @@ const styles$9 = aphrodite.StyleSheet.create({
34229
34250
  inputBase: {
34230
34251
  background: "inherit",
34231
34252
  border: "none",
34232
- ...perseus.globalStyles.typography.bodyXsmall,
34253
+ // TODO: can we use WB typography?
34254
+ fontFamily: "inherit",
34255
+ fontSize: 15,
34256
+ lineHeight: "22px",
34233
34257
  outline: "none",
34234
34258
  "::placeholder": {
34235
- color: perseus.globalStyles.colors.gray41
34259
+ color: gray41
34236
34260
  },
34237
34261
  width: "100%",
34238
34262
  color: "inherit",
@@ -34251,7 +34275,7 @@ const styles$9 = aphrodite.StyleSheet.create({
34251
34275
  border: "none",
34252
34276
  outline: "none",
34253
34277
  "::placeholder": {
34254
- color: perseus.globalStyles.colors.gray41
34278
+ color: gray41
34255
34279
  },
34256
34280
  width: "100%",
34257
34281
  fontWeight: "normal",
@@ -34261,7 +34285,7 @@ const styles$9 = aphrodite.StyleSheet.create({
34261
34285
  },
34262
34286
  input: {
34263
34287
  height: 40,
34264
- borderRadius: perseus.globalStyles.borderRadius,
34288
+ borderRadius: 4,
34265
34289
  boxSizing: "border-box",
34266
34290
  padding: "8px 10px"
34267
34291
  },
@@ -34271,7 +34295,7 @@ const styles$9 = aphrodite.StyleSheet.create({
34271
34295
  marginBottom: 0
34272
34296
  },
34273
34297
  defaultBackground: {
34274
- backgroundColor: perseus.globalStyles.colors.white
34298
+ backgroundColor: wonderBlocksTokens.color.white
34275
34299
  },
34276
34300
  icon: {
34277
34301
  display: "flex",
@@ -34392,10 +34416,6 @@ const styles$8 = aphrodite.StyleSheet.create({
34392
34416
  /**
34393
34417
  * Controlled list of answer choices, handles adding and removing answers.
34394
34418
  */
34395
- const {
34396
- colors: colors$6,
34397
- typography: typography$3
34398
- } = perseus.globalStyles;
34399
34419
  const {
34400
34420
  Icon: Icon$1
34401
34421
  } = perseus.components;
@@ -34440,7 +34460,7 @@ const DraggableGripIcon = () => /*#__PURE__*/React__namespace.createElement("svg
34440
34460
  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"
34441
34461
  })), /*#__PURE__*/React__namespace.createElement("path", {
34442
34462
  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",
34443
- fill: colors$6.gray17,
34463
+ fill: gray17,
34444
34464
  filter: "url(#draggable-grip-shadow)"
34445
34465
  }));
34446
34466
 
@@ -34527,9 +34547,9 @@ const AnswerChoices = _ref3 => {
34527
34547
  };
34528
34548
  const styles$7 = aphrodite.StyleSheet.create({
34529
34549
  title: {
34530
- ...typography$3.bodyXsmallBold,
34550
+ ...perseus.bodyXsmallBold,
34531
34551
  marginBottom: 6,
34532
- color: colors$6.gray17
34552
+ color: gray17
34533
34553
  },
34534
34554
  answers: {
34535
34555
  marginTop: 12,
@@ -34544,7 +34564,7 @@ const styles$7 = aphrodite.StyleSheet.create({
34544
34564
  }
34545
34565
  },
34546
34566
  addAnswer: {
34547
- ...typography$3.bodyXsmallBold,
34567
+ ...perseus.bodyXsmallBold,
34548
34568
  display: "flex",
34549
34569
  flexDirection: "row",
34550
34570
  alignItems: "center",
@@ -34708,10 +34728,8 @@ class HoverBehavior extends React__namespace.Component {
34708
34728
  }
34709
34729
  }
34710
34730
 
34711
- const {
34712
- borderRadius: borderRadius$1,
34713
- colors: colors$5
34714
- } = perseus.globalStyles;
34731
+ const borderRadius = 4;
34732
+
34715
34733
  // NOTE(jangmi): Checkbox may have `onChange` depends on circumstances but lack
34716
34734
  // of onChange causes Dev only alert so we provide the no op func as default
34717
34735
  // to prevent that.
@@ -34732,7 +34750,7 @@ class Checkbox extends React__namespace.Component {
34732
34750
  dataTestId,
34733
34751
  id
34734
34752
  } = this.props;
34735
- const checkedColor = colors$5.gray41;
34753
+ const checkedColor = gray41;
34736
34754
  return /*#__PURE__*/React__namespace.createElement(HoverBehavior, null, (_ref, handlers) => {
34737
34755
  let {
34738
34756
  focused
@@ -34758,14 +34776,14 @@ class Checkbox extends React__namespace.Component {
34758
34776
  height: size,
34759
34777
  x: "0",
34760
34778
  y: "0",
34761
- rx: borderRadius$1
34779
+ rx: borderRadius
34762
34780
  }), /*#__PURE__*/React__namespace.createElement("path", {
34763
- fill: colors$5.white,
34764
- stroke: colors$5.white,
34781
+ fill: wonderBlocksTokens.color.white,
34782
+ stroke: wonderBlocksTokens.color.white,
34765
34783
  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"
34766
34784
  })), !checked && /*#__PURE__*/React__namespace.createElement("rect", {
34767
- fill: colors$5.white,
34768
- stroke: colors$5.gray68,
34785
+ fill: wonderBlocksTokens.color.white,
34786
+ stroke: gray68,
34769
34787
  width: size - 2 * padding,
34770
34788
  height: size - 2 * padding,
34771
34789
  x: padding,
@@ -34796,7 +34814,7 @@ const styles$6 = aphrodite.StyleSheet.create({
34796
34814
  display: "inline-block",
34797
34815
  verticalAlign: "middle",
34798
34816
  lineHeight: 0,
34799
- borderRadius: borderRadius$1,
34817
+ borderRadius: borderRadius,
34800
34818
  width: sizeWithPadding,
34801
34819
  height: sizeWithPadding,
34802
34820
  flexShrink: 0
@@ -34809,7 +34827,7 @@ const styles$6 = aphrodite.StyleSheet.create({
34809
34827
  right: -2,
34810
34828
  bottom: -2,
34811
34829
  left: -2,
34812
- borderRadius: borderRadius$1 + 2,
34830
+ borderRadius: borderRadius + 2,
34813
34831
  backgroundColor: "lightblue" // TODO(kevinb) get real focus ring
34814
34832
  }
34815
34833
  },
@@ -34841,10 +34859,6 @@ const styles$6 = aphrodite.StyleSheet.create({
34841
34859
  /**
34842
34860
  * Controlled component to display and change widget options.
34843
34861
  */
34844
- const {
34845
- colors: colors$4,
34846
- typography: typography$2
34847
- } = perseus.globalStyles;
34848
34862
  const Behavior = _ref => {
34849
34863
  let {
34850
34864
  multipleAnswers,
@@ -34897,18 +34911,21 @@ const Behavior = _ref => {
34897
34911
  };
34898
34912
  const styles$5 = aphrodite.StyleSheet.create({
34899
34913
  title: {
34900
- ...typography$2.bodyXsmallBold,
34914
+ ...perseus.bodyXsmallBold,
34901
34915
  marginBottom: 6,
34902
- color: colors$4.gray17
34916
+ color: gray17
34903
34917
  },
34904
34918
  option: {
34905
34919
  display: "flex",
34906
34920
  padding: "6px 0"
34907
34921
  },
34908
34922
  label: {
34909
- ...typography$2.smallSubheadingMobile,
34923
+ // TODO: could we use WB typography?
34924
+ fontFamily: "inherit",
34925
+ fontSize: 15,
34926
+ lineHeight: 1.25,
34910
34927
  marginLeft: 16,
34911
- color: colors$4.gray17
34928
+ color: gray17
34912
34929
  }
34913
34930
  });
34914
34931
 
@@ -34916,9 +34933,6 @@ const styles$5 = aphrodite.StyleSheet.create({
34916
34933
  const {
34917
34934
  Icon
34918
34935
  } = perseus.components;
34919
- const {
34920
- colors: colors$3
34921
- } = perseus.globalStyles;
34922
34936
  const findAndFocusElement = component => {
34923
34937
  const DOMNode = ReactDOM__default["default"].findDOMNode(component);
34924
34938
  const button = DOMNode;
@@ -35064,18 +35078,18 @@ const styles$4 = aphrodite.StyleSheet.create({
35064
35078
  whiteSpace: "nowrap",
35065
35079
  overflow: "hidden",
35066
35080
  textOverflow: "ellipsis",
35067
- color: colors$3.gray17,
35081
+ color: gray17,
35068
35082
  userSelect: "none",
35069
35083
  ":hover": {
35070
- backgroundColor: colors$3.gray95
35084
+ backgroundColor: gray95
35071
35085
  }
35072
35086
  },
35073
35087
  optionSelected: {
35074
- backgroundColor: colors$3.gray95,
35088
+ backgroundColor: gray95,
35075
35089
  color: "#11ACCD"
35076
35090
  },
35077
35091
  optionDisabled: {
35078
- color: colors$3.gray76,
35092
+ color: gray76,
35079
35093
  ":hover": {
35080
35094
  backgroundColor: "transparent"
35081
35095
  }
@@ -35104,10 +35118,6 @@ const styles$4 = aphrodite.StyleSheet.create({
35104
35118
  });
35105
35119
 
35106
35120
  /* eslint-disable @khanacademy/ts-no-error-suppressions */
35107
- const {
35108
- colors: colors$2,
35109
- borderRadius
35110
- } = perseus.globalStyles;
35111
35121
  class Marker extends React__namespace.Component {
35112
35122
  _marker;
35113
35123
  constructor(props) {
@@ -35295,7 +35305,7 @@ const styles$3 = aphrodite.StyleSheet.create({
35295
35305
  height: 0,
35296
35306
  left: -16,
35297
35307
  bottom: 8,
35298
- borderRight: `solid 16px ${colors$2.gray98}`,
35308
+ borderRight: `solid 16px ${gray98}`,
35299
35309
  borderTop: "solid 16px transparent",
35300
35310
  borderBottom: "solid 16px transparent"
35301
35311
  }
@@ -35306,7 +35316,7 @@ const styles$3 = aphrodite.StyleSheet.create({
35306
35316
  dividerHorizontal: {
35307
35317
  height: 0,
35308
35318
  margin: 0,
35309
- border: `solid ${colors$2.gray85}`,
35319
+ border: `solid ${gray85}`,
35310
35320
  borderWidth: "0 0 1px",
35311
35321
  boxShadow: "none"
35312
35322
  },
@@ -35315,19 +35325,15 @@ const styles$3 = aphrodite.StyleSheet.create({
35315
35325
  dropdownBody: {
35316
35326
  position: "absolute",
35317
35327
  border: "solid 1px rgba(0, 0, 0, 0.1)",
35318
- zIndex: perseus.globalConstants.zindexDropdown,
35319
- color: colors$2.gray17,
35320
- backgroundColor: colors$2.gray98,
35321
- borderRadius: borderRadius,
35328
+ zIndex: 1000,
35329
+ color: gray17,
35330
+ backgroundColor: gray98,
35331
+ borderRadius: 4,
35322
35332
  maxHeight: 320,
35323
35333
  cursor: "pointer"
35324
35334
  }
35325
35335
  });
35326
35336
 
35327
- const {
35328
- colors: colors$1,
35329
- typography: typography$1
35330
- } = perseus.globalStyles;
35331
35337
  class QuestionMarkers extends React__namespace.Component {
35332
35338
  _markers = [];
35333
35339
  openDropdownForMarkerIndices(indices) {
@@ -35403,14 +35409,17 @@ class QuestionMarkers extends React__namespace.Component {
35403
35409
  }
35404
35410
  const styles$2 = aphrodite.StyleSheet.create({
35405
35411
  title: {
35406
- ...typography$1.bodyXsmallBold,
35412
+ ...perseus.bodyXsmallBold,
35407
35413
  marginBottom: 6,
35408
- color: colors$1.gray17
35414
+ color: gray17
35409
35415
  },
35410
35416
  subtitle: {
35411
- ...typography$1.labelSmall,
35417
+ // TODO: can we use WB typography?
35418
+ fontFamily: "inherit",
35419
+ fontSize: 12,
35420
+ lineHeight: "14px",
35412
35421
  marginBottom: 12,
35413
- color: colors$1.gray68
35422
+ color: gray68
35414
35423
  },
35415
35424
  markersCanvas: {
35416
35425
  position: "relative",
@@ -35429,10 +35438,6 @@ const styles$2 = aphrodite.StyleSheet.create({
35429
35438
  /**
35430
35439
  * Controlled component for selecting the question image, for answer labeling.
35431
35440
  */
35432
- const {
35433
- colors,
35434
- typography
35435
- } = perseus.globalStyles;
35436
35441
  const SelectImage = _ref => {
35437
35442
  let {
35438
35443
  onChange,
@@ -35466,9 +35471,9 @@ const SelectImage = _ref => {
35466
35471
  };
35467
35472
  const styles$1 = aphrodite.StyleSheet.create({
35468
35473
  title: {
35469
- ...typography.bodyXsmallBold,
35474
+ ...perseus.bodyXsmallBold,
35470
35475
  marginBottom: 6,
35471
- color: colors.gray17
35476
+ color: gray17
35472
35477
  },
35473
35478
  components: {
35474
35479
  display: "flex"
@@ -36405,10 +36410,6 @@ const {
36405
36410
  NumberInput: NumberInput$4,
36406
36411
  TextInput: TextInput$2
36407
36412
  } = perseus.components;
36408
- const {
36409
- iconGear,
36410
- iconTrash: iconTrash$1
36411
- } = perseus.icons;
36412
36413
  const {
36413
36414
  firstNumericalParse
36414
36415
  } = perseus.Util;
@@ -36765,7 +36766,7 @@ class NumericInputEditor extends React__namespace.Component {
36765
36766
  this.onTrashAnswer(i);
36766
36767
  },
36767
36768
  onKeyDown: e => this.onSpace(e, this.onTrashAnswer)
36768
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon$1, iconTrash$1)), /*#__PURE__*/React__namespace.createElement("a", {
36769
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon$1, perseus.iconTrash)), /*#__PURE__*/React__namespace.createElement("a", {
36769
36770
  href: "#",
36770
36771
  className: "options-toggle",
36771
36772
  "aria-label": "Toggle options",
@@ -37489,10 +37490,6 @@ class PythonProgramEditor extends React__namespace.Component {
37489
37490
  const {
37490
37491
  InlineIcon
37491
37492
  } = perseus.components;
37492
- const {
37493
- iconPlus,
37494
- iconTrash
37495
- } = perseus.icons;
37496
37493
  class ChoiceEditor extends React__namespace.Component {
37497
37494
  static propTypes = {
37498
37495
  apiOptions: perseus.ApiOptions.propTypes,
@@ -37538,7 +37535,7 @@ class ChoiceEditor extends React__namespace.Component {
37538
37535
  this.props.onDelete();
37539
37536
  },
37540
37537
  title: "Remove this choice"
37541
- }, /*#__PURE__*/React__namespace.createElement(InlineIcon, iconTrash));
37538
+ }, /*#__PURE__*/React__namespace.createElement(InlineIcon, perseus.iconTrash));
37542
37539
  return /*#__PURE__*/React__namespace.createElement("div", {
37543
37540
  className: "choice-clue-editors"
37544
37541
  }, /*#__PURE__*/React__namespace.createElement("div", {