@khanacademy/perseus 17.3.0 → 17.3.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.css CHANGED
@@ -2795,23 +2795,11 @@ body.mobile .categorizer-container td.category input[type="radio"] + span:active
2795
2795
  .framework-perseus .perseus-label-image-widget-instructions div.paragraph {
2796
2796
  margin: 0;
2797
2797
  }
2798
- .framework-perseus button[id*="perseus-label-image-widget-answer-pill"] div.paragraph,
2799
- .framework-perseus div[id*="perseus-label-image-widget-answer-pill"] div.paragraph {
2800
- all: revert;
2801
- }
2802
- .framework-perseus button[id*="perseus-label-image-widget-answer-pill"] div.perseus-block-math-inner,
2803
- .framework-perseus div[id*="perseus-label-image-widget-answer-pill"] div.perseus-block-math-inner {
2804
- margin: -5px 0 !important;
2805
- }
2806
2798
  @media (max-width: 767px) {
2807
- [id*="perseus-label-image-widget-answer-pill"] div.paragraph {
2808
- all: revert;
2809
- }
2810
2799
  [id*="perseus-label-image-widget-answer-pill"] > div.perseus-renderer-responsive {
2811
2800
  all: revert;
2812
2801
  }
2813
- .framework-perseus.perseus-mobile [id*="perseus-label-image-widget-answer-pill"] .perseus-renderer > .paragraph,
2814
- .framework-perseus.perseus-mobile [id*="perseus-label-image-widget-answer-pill"] .perseus-renderer > .paragraph .paragraph {
2802
+ .framework-perseus.perseus-mobile [id*="perseus-label-image-widget-answer-pill"] mjx-container {
2815
2803
  all: revert;
2816
2804
  }
2817
2805
  }
package/dist/index.js CHANGED
@@ -18263,7 +18263,7 @@ class QuestionParagraph extends React__namespace.Component {
18263
18263
  // For perseus-article just-in-place-translation (jipt), we need
18264
18264
  // to attach some metadata to top-level QuestionParagraphs:
18265
18265
  return /*#__PURE__*/React__namespace.createElement("div", {
18266
- className: className,
18266
+ className: this.props.inline ? this.props.className ?? undefined : className,
18267
18267
  "data-perseus-component-index": this.props.translationIndex,
18268
18268
  "data-perseus-paragraph-index": this.props.paragraphIndex
18269
18269
  }, this.props.children);
@@ -19621,7 +19621,8 @@ class Renderer extends React__namespace.Component {
19621
19621
  key: state.key,
19622
19622
  className: className,
19623
19623
  translationIndex: this.translationIndex,
19624
- paragraphIndex: state.paragraphIndex
19624
+ paragraphIndex: state.paragraphIndex,
19625
+ inline: this.props.inline
19625
19626
  }, /*#__PURE__*/React__namespace.createElement(ErrorBoundary, null, output));
19626
19627
  };
19627
19628
 
@@ -20333,12 +20334,14 @@ class Renderer extends React__namespace.Component {
20333
20334
  this._isTwoColumn = false;
20334
20335
 
20335
20336
  // Parse the string of markdown to a parse tree
20336
- const parsedMarkdown = PerseusMarkdown.parse(content, {
20337
+ const parsedMarkdown = this.props.inline ? PerseusMarkdown.parseInline(content, {
20337
20338
  // Recognize crowdin IDs while translating articles
20338
20339
  // (This should never be hit by exercises, though if you
20339
20340
  // decide you want to add a check that this is an article,
20340
20341
  // go for it.)
20341
20342
  isJipt: this.translationIndex != null
20343
+ }) : PerseusMarkdown.parse(content, {
20344
+ isJipt: this.translationIndex != null
20342
20345
  });
20343
20346
 
20344
20347
  // Optionally apply the linter to the parse tree
@@ -31203,7 +31206,8 @@ const AnswerPill = props => {
31203
31206
  ":focus": bringToFront
31204
31207
  }, correct && styles$i.correct, incorrect && styles$i.incorrect]
31205
31208
  }, /*#__PURE__*/React__namespace.createElement(Renderer, {
31206
- content: answerString
31209
+ content: answerString,
31210
+ inline: true
31207
31211
  }));
31208
31212
  });
31209
31213
  };
@@ -31973,7 +31977,7 @@ class LabelImage extends React__namespace.Component {
31973
31977
  };
31974
31978
 
31975
31979
  const adjustPillDistance = {
31976
- [`margin${markerPosition.charAt(0).toUpperCase() + markerPosition.slice(1)}`]: 5 // move pill further from marker
31980
+ [`margin${markerPosition.charAt(0).toUpperCase() + markerPosition.slice(1)}`]: 15 // move pill further from marker
31977
31981
  };
31978
31982
 
31979
31983
  const showAnswerChoice = !answerChoicesActive && !this.state.hideAnswers;
@@ -38453,9 +38457,12 @@ class PassageRefTarget extends React__namespace.Component {
38453
38457
  render() {
38454
38458
  return /*#__PURE__*/React__namespace.createElement(Renderer, {
38455
38459
  content: this.props.content
38456
- // @ts-expect-error - TS2322 - Type '{ content: any; inline: boolean; apiOptions: any; linterContext: any; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Renderer> & Pick<Readonly<Props> & Readonly<{ children?: ReactNode; }>, "children" | ... 3 more ... | "legacyPerseusLint"> & InexactPartial<...> & InexactPartial<...>'.
38460
+ // This was already here before inline was recently added (#873)
38461
+ // It was for a different use case a long time ago:
38462
+ // https://phabricator.khanacademy.org/D12113
38463
+ // Commenting out to prevent unanticipated side effects
38464
+ // inline={true}
38457
38465
  ,
38458
- inline: true,
38459
38466
  apiOptions: this.props.apiOptions,
38460
38467
  linterContext: this.props.linterContext
38461
38468
  });
@@ -44321,7 +44328,7 @@ const init = function (options) {
44321
44328
 
44322
44329
  // This file is processed by a Rollup plugin (replace) to inject the production
44323
44330
  const libName = "@khanacademy/perseus";
44324
- const libVersion = "17.3.0";
44331
+ const libVersion = "17.3.1";
44325
44332
  perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
44326
44333
 
44327
44334
  const apiVersion = {