@khanacademy/perseus 19.5.1 → 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/es/index.js +31 -40
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +32 -40
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
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
|
|
24981
|
-
let
|
|
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
|
-
|
|
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
|
-
},
|
|
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
|
-
|
|
25006
|
-
|
|
25007
|
-
|
|
25008
|
-
|
|
25009
|
-
|
|
25010
|
-
|
|
25011
|
-
|
|
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
|
-
},
|
|
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.
|
|
41695
|
+
const libVersion = "19.6.1";
|
|
41722
41696
|
perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
41723
41697
|
|
|
41724
41698
|
const apiVersion = {
|
|
@@ -41831,7 +41805,25 @@ class ArticleRenderer extends React__namespace.Component {
|
|
|
41831
41805
|
}
|
|
41832
41806
|
};
|
|
41833
41807
|
_sections = () => {
|
|
41834
|
-
|
|
41808
|
+
const sections = Array.isArray(this.props.json) ? this.props.json : [this.props.json];
|
|
41809
|
+
|
|
41810
|
+
// In JIPT context we split sections to paragraphs in order match the
|
|
41811
|
+
// translatable strings found on Crowdin when rendering articles in
|
|
41812
|
+
// the WYSIWYG mode for translation. This is needed for the jipt.js
|
|
41813
|
+
// integration in order to attribute the rendered strings on Crowdin.
|
|
41814
|
+
if (getDependencies().JIPT.useJIPT) {
|
|
41815
|
+
const paragraphs = [];
|
|
41816
|
+
for (const section of sections) {
|
|
41817
|
+
JiptParagraphs.parseToArray(section.content).forEach(paragraph => {
|
|
41818
|
+
paragraphs.push({
|
|
41819
|
+
...section,
|
|
41820
|
+
content: paragraph
|
|
41821
|
+
});
|
|
41822
|
+
});
|
|
41823
|
+
}
|
|
41824
|
+
return paragraphs;
|
|
41825
|
+
}
|
|
41826
|
+
return sections;
|
|
41835
41827
|
};
|
|
41836
41828
|
render() {
|
|
41837
41829
|
const apiOptions = {
|