@khanacademy/perseus 19.6.0 → 19.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
@@ -24970,22 +24970,19 @@ class Explanation extends React__namespace.Component {
24970
24970
  this.props.trackInteraction();
24971
24971
  };
24972
24972
  render() {
24973
- const {
24974
- Link
24975
- } = this.props.apiOptions.baseElements;
24976
24973
  const {
24977
24974
  isArticle,
24978
24975
  isMobile
24979
24976
  } = this.props.apiOptions;
24980
- const linkAnchor = this.state.expanded ? this.props.hidePrompt : this.props.showPrompt;
24981
- let linkContainer;
24977
+ const promptText = this.state.expanded ? this.props.hidePrompt : this.props.showPrompt;
24978
+ let promptContainer;
24982
24979
 
24983
24980
  // TODO(diedra): This isn't a valid href;
24984
24981
  // change this to a button that looks like a link.
24985
24982
  const href = "javascript:void(0)";
24986
24983
  const onClick = this._onClick;
24987
24984
  if (isMobile) {
24988
- linkContainer = /*#__PURE__*/React__namespace.createElement("div", {
24985
+ promptContainer = /*#__PURE__*/React__namespace.createElement("div", {
24989
24986
  className: aphrodite.css(styles$o.linkContainer)
24990
24987
  }, /*#__PURE__*/React__namespace.createElement("a", {
24991
24988
  className: aphrodite.css(styles$o.mobileExplanationLink),
@@ -24993,7 +24990,7 @@ class Explanation extends React__namespace.Component {
24993
24990
  onClick: onClick,
24994
24991
  role: "button",
24995
24992
  "aria-expanded": this.state.expanded
24996
- }, linkAnchor), this.state.expanded && /*#__PURE__*/React__namespace.createElement("svg", {
24993
+ }, promptText), this.state.expanded && /*#__PURE__*/React__namespace.createElement("svg", {
24997
24994
  className: aphrodite.css(styles$o.disclosureArrow)
24998
24995
  }, /*#__PURE__*/React__namespace.createElement("polygon", {
24999
24996
  style: {
@@ -25002,41 +24999,18 @@ class Explanation extends React__namespace.Component {
25002
24999
  points: `0,${arrowHeight} ` + `${arrowWidth},${arrowHeight} ` + `${arrowWidth / 2},0`
25003
25000
  })));
25004
25001
  } else {
25005
- if (isArticle) {
25006
- // NOTE: For articles, the baseElements `Link` may is either be
25007
- // an anchor tag (if rendered in a modal) or a Wonder Blocks
25008
- // link component in lesson page, see: `article-page.jsx`.
25009
- linkContainer = /*#__PURE__*/React__namespace.createElement("div", {
25010
- className: aphrodite.css(styles$o.linkContainer, styles$o.articleLink)
25011
- }, /*#__PURE__*/React__namespace.createElement(Link, {
25012
- className: aphrodite.css(styles$o.explanationLink)
25013
- // HACK(michaelpolyak): WB Link doesn't passthrough
25014
- // class name.
25015
- ,
25016
- style: styles$o.explanationLink,
25017
- href: href,
25018
- onClick: onClick,
25019
- role: "button",
25020
- "aria-expanded": this.state.expanded
25021
- }, `[${linkAnchor}]`));
25022
- } else {
25023
- // NOTE: For exercises, the baseElements `Link` is an
25024
- // anchor tag, see: `perseus-api.jsx`.
25025
- linkContainer = /*#__PURE__*/React__namespace.createElement("div", {
25026
- className: aphrodite.css(styles$o.linkContainer, styles$o.exerciseLink)
25027
- }, /*#__PURE__*/React__namespace.createElement(Link, {
25028
- className: aphrodite.css(styles$o.explanationLink),
25029
- href: href,
25030
- onClick: onClick,
25031
- role: "button",
25032
- "aria-expanded": this.state.expanded
25033
- }, `[${linkAnchor}]`));
25034
- }
25002
+ const viewStyling = isArticle ? [styles$o.explanationLink, styles$o.articleLink] : [styles$o.explanationLink, styles$o.exerciseLink];
25003
+ promptContainer = /*#__PURE__*/React__namespace.createElement(Clickable__default["default"], {
25004
+ onClick: onClick,
25005
+ "aria-expanded": this.state.expanded
25006
+ }, () => /*#__PURE__*/React__namespace.createElement(wonderBlocksCore.View, {
25007
+ style: viewStyling
25008
+ }, `[${promptText}]`));
25035
25009
  }
25036
25010
  const expandedStyle = isMobile ? styles$o.contentExpandedMobile : styles$o.contentExpanded;
25037
25011
  return /*#__PURE__*/React__namespace.createElement("div", {
25038
25012
  className: aphrodite.css(styles$o.container)
25039
- }, linkContainer, this.state.expanded && /*#__PURE__*/React__namespace.createElement("div", {
25013
+ }, promptContainer, this.state.expanded && /*#__PURE__*/React__namespace.createElement("div", {
25040
25014
  className: aphrodite.css(styles$o.content, isMobile && styles$o.contentMobile, this.state.expanded && expandedStyle)
25041
25015
  // eslint-disable-next-line react/no-string-refs
25042
25016
  ,
@@ -41718,7 +41692,7 @@ const init = function (options) {
41718
41692
 
41719
41693
  // This file is processed by a Rollup plugin (replace) to inject the production
41720
41694
  const libName = "@khanacademy/perseus";
41721
- const libVersion = "19.6.0";
41695
+ const libVersion = "19.6.1";
41722
41696
  perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
41723
41697
 
41724
41698
  const apiVersion = {