@khanacademy/perseus 48.2.0 → 49.0.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/index.js CHANGED
@@ -27638,36 +27638,41 @@ class Dropdown extends React__namespace.Component {
27638
27638
  value: String(i + 1),
27639
27639
  label: choice
27640
27640
  }))];
27641
- return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.UniqueIDProvider, {
27642
- scope: "dropdown-widget",
27643
- mockOnFirstRender: true
27644
- }, ids => /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View
27645
- // NOTE(jared): These are required to prevent weird behavior
27646
- // When there's a dropdown in a zoomable table.
27647
- , {
27648
- onClick: e => {
27649
- e.stopPropagation();
27650
- },
27651
- onTouchStart: e => {
27652
- e.stopPropagation();
27653
- }
27654
- }, this.props.visibleLabel && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, {
27655
- tag: "label",
27656
- htmlFor: ids.get("dropdown")
27657
- }, this.props.visibleLabel), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
27658
- id: ids.get("dropdown"),
27659
- placeholder: "",
27660
- onChange: value => this._handleChange(parseInt(value)),
27661
- selectedValue: String(this.props.selected),
27662
- disabled: this.props.apiOptions.readOnly,
27663
- "aria-label": this.props.ariaLabel || this.props.visibleLabel || this.context.strings.selectAnAnswer
27664
- // This is currently necessary for SRs to read the labels properly.
27665
- // However, WB is working on a change to add the "combobox" role to
27666
- // all dropdowns.
27667
- // See https://khanacademy.atlassian.net/browse/WB-1671
27668
- ,
27669
- role: "combobox"
27670
- }, children)));
27641
+ return (
27642
+ /*#__PURE__*/
27643
+ // TODO(WB-1812, somewhatabstract): Migrate to Id or useId
27644
+ // eslint-disable-next-line no-restricted-syntax
27645
+ React__namespace.createElement(wonderBlocksCore.UniqueIDProvider, {
27646
+ scope: "dropdown-widget",
27647
+ mockOnFirstRender: true
27648
+ }, ids => /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View
27649
+ // NOTE(jared): These are required to prevent weird behavior
27650
+ // When there's a dropdown in a zoomable table.
27651
+ , {
27652
+ onClick: e => {
27653
+ e.stopPropagation();
27654
+ },
27655
+ onTouchStart: e => {
27656
+ e.stopPropagation();
27657
+ }
27658
+ }, this.props.visibleLabel && /*#__PURE__*/React__namespace.createElement(wonderBlocksTypography.LabelLarge, {
27659
+ tag: "label",
27660
+ htmlFor: ids.get("dropdown")
27661
+ }, this.props.visibleLabel), /*#__PURE__*/React__namespace.createElement(wonderBlocksDropdown.SingleSelect, {
27662
+ id: ids.get("dropdown"),
27663
+ placeholder: "",
27664
+ onChange: value => this._handleChange(parseInt(value)),
27665
+ selectedValue: String(this.props.selected),
27666
+ disabled: this.props.apiOptions.readOnly,
27667
+ "aria-label": this.props.ariaLabel || this.props.visibleLabel || this.context.strings.selectAnAnswer
27668
+ // This is currently necessary for SRs to read the labels properly.
27669
+ // However, WB is working on a change to add the "combobox" role to
27670
+ // all dropdowns.
27671
+ // See https://khanacademy.atlassian.net/browse/WB-1671
27672
+ ,
27673
+ role: "combobox"
27674
+ }, children)))
27675
+ );
27671
27676
  }
27672
27677
  }
27673
27678
  const optionsTransform = widgetOptions => {
@@ -27775,32 +27780,37 @@ class Explanation extends React__namespace.Component {
27775
27780
  "white-space": "normal"
27776
27781
  };
27777
27782
  const contentStyling = [styles$k.content, this.state.expanded ? styles$k.contentExpanded : styles$k.contentCollapsed, allowTransition && (this.state.expanded ? styles$k.transitionExpanded : styles$k.transitionCollapsed)];
27778
- return /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.UniqueIDProvider, {
27779
- mockOnFirstRender: true,
27780
- scope: "explanation-widget"
27781
- }, ids => /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
27782
- "aria-expanded": this.state.expanded,
27783
- "aria-controls": ids.get("content"),
27784
- endIcon: caretIcon,
27785
- kind: "tertiary",
27786
- labelStyle: labelStyle,
27787
- onClick: this._onClick,
27788
- size: "small",
27789
- style: buttonStyleOverrides
27790
- }, promptText), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
27791
- id: ids.get("content"),
27792
- style: contentStyling,
27793
- "aria-hidden": !this.state.expanded,
27794
- testId: "content-container"
27795
- }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
27796
- style: styles$k.contentWrapper
27797
- }, /*#__PURE__*/React__namespace.createElement(Renderer, {
27798
- apiOptions: this.props.apiOptions,
27799
- content: this.props.explanation,
27800
- widgets: this.props.widgets,
27801
- linterContext: this.props.linterContext,
27802
- strings: this.context.strings
27803
- })))));
27783
+ return (
27784
+ /*#__PURE__*/
27785
+ // TODO(WB-1812, somewhatabstract): Migrate to Id or useId
27786
+ // eslint-disable-next-line no-restricted-syntax
27787
+ React__namespace.createElement(wonderBlocksCore.UniqueIDProvider, {
27788
+ mockOnFirstRender: true,
27789
+ scope: "explanation-widget"
27790
+ }, ids => /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Button__default["default"], {
27791
+ "aria-expanded": this.state.expanded,
27792
+ "aria-controls": ids.get("content"),
27793
+ endIcon: caretIcon,
27794
+ kind: "tertiary",
27795
+ labelStyle: labelStyle,
27796
+ onClick: this._onClick,
27797
+ size: "small",
27798
+ style: buttonStyleOverrides
27799
+ }, promptText), /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
27800
+ id: ids.get("content"),
27801
+ style: contentStyling,
27802
+ "aria-hidden": !this.state.expanded,
27803
+ testId: "content-container"
27804
+ }, /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
27805
+ style: styles$k.contentWrapper
27806
+ }, /*#__PURE__*/React__namespace.createElement(Renderer, {
27807
+ apiOptions: this.props.apiOptions,
27808
+ content: this.props.explanation,
27809
+ widgets: this.props.widgets,
27810
+ linterContext: this.props.linterContext,
27811
+ strings: this.context.strings
27812
+ })))))
27813
+ );
27804
27814
  }
27805
27815
  }
27806
27816
  const leftBorderSpacing = 23;
@@ -39251,6 +39261,8 @@ const AnswerChoices = props => {
39251
39261
  };
39252
39262
 
39253
39263
  const HideAnswersToggle = props => {
39264
+ // TODO(WB-1812, somewhatabstract): Migrate to Id or useId
39265
+ // eslint-disable-next-line no-restricted-syntax
39254
39266
  const idFactory = wonderBlocksCore.useUniqueIdWithMock();
39255
39267
  const switchId = idFactory.get("hide-answers-toggle");
39256
39268
  const labelId = idFactory.get("hide-answers-label");
@@ -39296,6 +39308,9 @@ const AnswerPill = props => {
39296
39308
  focused,
39297
39309
  hovered
39298
39310
  } = props;
39311
+
39312
+ // TODO(WB-1812, somewhatabstract): Migrate to Id or useId
39313
+ // eslint-disable-next-line no-restricted-syntax
39299
39314
  const idFactory = wonderBlocksCore.useUniqueIdWithMock();
39300
39315
  const {
39301
39316
  strings
@@ -45643,7 +45658,7 @@ const init = function () {
45643
45658
 
45644
45659
  // This file is processed by a Rollup plugin (replace) to inject the production
45645
45660
  const libName = "@khanacademy/perseus";
45646
- const libVersion = "48.2.0";
45661
+ const libVersion = "49.0.0";
45647
45662
  perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
45648
45663
 
45649
45664
  const apiVersion = {