@khanacademy/perseus 17.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @khanacademy/perseus
2
2
 
3
+ ## 17.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#873](https://github.com/Khan/perseus/pull/873) [`b7777865`](https://github.com/Khan/perseus/commit/b777786517afc289e92201e3fea876c30c493290) Thanks [@nedredmond](https://github.com/nedredmond)! - Prevent paragraph class from being added to answer pills component
8
+
9
+ - Updated dependencies [[`610ebba2`](https://github.com/Khan/perseus/commit/610ebba29ab8b2ee4ddf4879f8c8b87993f29b20)]:
10
+ - @khanacademy/math-input@16.4.0
11
+
12
+ ## 17.3.0
13
+
14
+ ### Minor Changes
15
+
16
+ - [#867](https://github.com/Khan/perseus/pull/867) [`378294da`](https://github.com/Khan/perseus/commit/378294da3d207839a861333175920b562773ee97) Thanks [@nedredmond](https://github.com/nedredmond)! - Update and export PerseusAnswerArea type
17
+
18
+ ### Patch Changes
19
+
20
+ - [#869](https://github.com/Khan/perseus/pull/869) [`57eeec68`](https://github.com/Khan/perseus/commit/57eeec681072591c64b633527833f3ab9f6e3f1a) Thanks [@nedredmond](https://github.com/nedredmond)! - Remove new unused field from PerseusAnswerArea API
21
+
3
22
  ## 17.2.0
4
23
 
5
24
  ### Minor Changes
package/dist/es/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/es/index.js CHANGED
@@ -18193,11 +18193,12 @@ var PerseusMarkdown = {
18193
18193
 
18194
18194
  class QuestionParagraph extends React.Component {
18195
18195
  render() {
18196
+ var _this$props$className;
18196
18197
  const className = this.props.className ? "paragraph " + this.props.className : "paragraph";
18197
18198
  // For perseus-article just-in-place-translation (jipt), we need
18198
18199
  // to attach some metadata to top-level QuestionParagraphs:
18199
18200
  return /*#__PURE__*/React.createElement("div", {
18200
- className: className,
18201
+ className: this.props.inline ? (_this$props$className = this.props.className) != null ? _this$props$className : undefined : className,
18201
18202
  "data-perseus-component-index": this.props.translationIndex,
18202
18203
  "data-perseus-paragraph-index": this.props.paragraphIndex
18203
18204
  }, this.props.children);
@@ -19378,7 +19379,8 @@ class Renderer extends React.Component {
19378
19379
  key: state.key,
19379
19380
  className: className,
19380
19381
  translationIndex: this.translationIndex,
19381
- paragraphIndex: state.paragraphIndex
19382
+ paragraphIndex: state.paragraphIndex,
19383
+ inline: this.props.inline
19382
19384
  }, /*#__PURE__*/React.createElement(ErrorBoundary, null, output));
19383
19385
  };
19384
19386
  // output non-top-level nodes or arrays
@@ -20192,12 +20194,14 @@ class Renderer extends React.Component {
20192
20194
  this._isTwoColumn = false;
20193
20195
 
20194
20196
  // Parse the string of markdown to a parse tree
20195
- const parsedMarkdown = PerseusMarkdown.parse(content, {
20197
+ const parsedMarkdown = this.props.inline ? PerseusMarkdown.parseInline(content, {
20196
20198
  // Recognize crowdin IDs while translating articles
20197
20199
  // (This should never be hit by exercises, though if you
20198
20200
  // decide you want to add a check that this is an article,
20199
20201
  // go for it.)
20200
20202
  isJipt: this.translationIndex != null
20203
+ }) : PerseusMarkdown.parse(content, {
20204
+ isJipt: this.translationIndex != null
20201
20205
  });
20202
20206
 
20203
20207
  // Optionally apply the linter to the parse tree
@@ -31075,7 +31079,8 @@ const AnswerPill = props => {
31075
31079
  ":focus": bringToFront
31076
31080
  }, correct && styles$i.correct, incorrect && styles$i.incorrect]
31077
31081
  }, /*#__PURE__*/React.createElement(Renderer, {
31078
- content: answerString
31082
+ content: answerString,
31083
+ inline: true
31079
31084
  })));
31080
31085
  };
31081
31086
  const styles$i = StyleSheet.create({
@@ -31846,7 +31851,7 @@ class LabelImage extends React.Component {
31846
31851
  };
31847
31852
 
31848
31853
  const adjustPillDistance = {
31849
- [`margin${markerPosition.charAt(0).toUpperCase() + markerPosition.slice(1)}`]: 5 // move pill further from marker
31854
+ [`margin${markerPosition.charAt(0).toUpperCase() + markerPosition.slice(1)}`]: 15 // move pill further from marker
31850
31855
  };
31851
31856
 
31852
31857
  const showAnswerChoice = !answerChoicesActive && !this.state.hideAnswers;
@@ -38307,9 +38312,12 @@ class PassageRefTarget extends React.Component {
38307
38312
  render() {
38308
38313
  return /*#__PURE__*/React.createElement(Renderer, {
38309
38314
  content: this.props.content
38310
- // @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<...>'.
38315
+ // This was already here before inline was recently added (#873)
38316
+ // It was for a different use case a long time ago:
38317
+ // https://phabricator.khanacademy.org/D12113
38318
+ // Commenting out to prevent unanticipated side effects
38319
+ // inline={true}
38311
38320
  ,
38312
- inline: true,
38313
38321
  apiOptions: this.props.apiOptions,
38314
38322
  linterContext: this.props.linterContext
38315
38323
  });
@@ -44185,7 +44193,7 @@ const init = function init(options) {
44185
44193
 
44186
44194
  // This file is processed by a Rollup plugin (replace) to inject the production
44187
44195
  const libName = "@khanacademy/perseus";
44188
- const libVersion = "17.2.0";
44196
+ const libVersion = "17.3.1";
44189
44197
  addLibraryVersionToPerseusDebug(libName, libVersion);
44190
44198
 
44191
44199
  const apiVersion = {
@@ -45517,6 +45525,26 @@ var constants = /*#__PURE__*/Object.freeze({
45517
45525
 
45518
45526
  // TODO(FEI-5054): Figure out how to get global .d.ts files working with monorepos
45519
45527
 
45528
+ const ItemExtras = [
45529
+ // The user might benefit from using a Scientific Calculator. Provided on Khan Academy when true
45530
+ "calculator",
45531
+ // The user might benefit from using a statistics Chi Squared Table like https://people.richland.edu/james/lecture/m170/tbl-chi.html
45532
+ "chi2Table",
45533
+ // The user might benefit from a monthly payments calculator. Provided on Khan Academy when true
45534
+ "financialCalculatorMonthlyPayment",
45535
+ // The user might benefit from a total amount calculator. Provided on Khan Academy when true
45536
+ "financialCalculatorTotalAmount",
45537
+ // The user might benefit from a time to pay off calculator. Provided on Khan Academy when true
45538
+ "financialCalculatorTimeToPayOff",
45539
+ // The user might benefit from using a Periodic Table of Elements. Provided on Khan Academy when true
45540
+ "periodicTable",
45541
+ // The user might benefit from using a Periodic Table of Elements with key. Provided on Khan Academy when true
45542
+ "periodicTableWithKey",
45543
+ // The user might benefit from using a statistics T Table like https://www.statisticshowto.com/tables/t-distribution-table/
45544
+ "tTable",
45545
+ // The user might benefit from using a statistics Z Table like https://www.ztable.net/
45546
+ "zTable"];
45547
+
45520
45548
  // prettier-ignore
45521
45549
 
45522
45550
  // prettier-ignore
@@ -46737,5 +46765,5 @@ const EditorJsonify = {
46737
46765
  }
46738
46766
  };
46739
46767
 
46740
- export { ApiOptions, ArrowPicker, ArticleRenderer, BaseRadio, Categorizer$1 as Categorizer, changeable as Changeable, ClassNames, ColorPicker, DashPicker, dependencies as Dependencies, EditorJsonify, ElementContainer, Errors, Expression, util as GrapherUtil, Grapher$1 as GrapherWidget, HintRenderer, HintsRenderer, InputNumber$1 as InputNumber, InteractiveGraph$1 as InteractiveGraphWidget, JiptParagraphs, KhanColors, KhanMath, context as LoadingContext, Log, Matrix$1 as MatrixWidget, MultiItems, NumericInput$1 as NumericInput, PerseusError, PerseusExpressionAnswerFormConsidered, PerseusMarkdown, Plotter$1 as PlotterWidget, Radio, Renderer, ref as ServerItemRenderer, sizingUtils as SizingUtils, Table$1 as TableWidget, Transformer$1 as TransformerWidget, Util, denylist as WIDGET_PROP_DENYLIST, WidgetJsonifyDeprecated, widgets$1 as Widgets, apiVersion, buildEmptyItemTreeForShape, buildMapper, components, constants, displaySigFigs, globalConstants, globalStyles, iconPaths as icons, init, interactiveSizes$1 as interactiveSizes, isItemRenderableByVersion, itemDataVersion, itemToTree, ItemVersion as itemVersion, libVersion, mediaQueries, plotterPlotTypes, preprocessTex, registerAllWidgetsForTesting, shapes, traverse, violatingWidgets, allWidgets as widgets };
46768
+ export { ApiOptions, ArrowPicker, ArticleRenderer, BaseRadio, Categorizer$1 as Categorizer, changeable as Changeable, ClassNames, ColorPicker, DashPicker, dependencies as Dependencies, EditorJsonify, ElementContainer, Errors, Expression, util as GrapherUtil, Grapher$1 as GrapherWidget, HintRenderer, HintsRenderer, InputNumber$1 as InputNumber, InteractiveGraph$1 as InteractiveGraphWidget, ItemExtras, JiptParagraphs, KhanColors, KhanMath, context as LoadingContext, Log, Matrix$1 as MatrixWidget, MultiItems, NumericInput$1 as NumericInput, PerseusError, PerseusExpressionAnswerFormConsidered, PerseusMarkdown, Plotter$1 as PlotterWidget, Radio, Renderer, ref as ServerItemRenderer, sizingUtils as SizingUtils, Table$1 as TableWidget, Transformer$1 as TransformerWidget, Util, denylist as WIDGET_PROP_DENYLIST, WidgetJsonifyDeprecated, widgets$1 as Widgets, apiVersion, buildEmptyItemTreeForShape, buildMapper, components, constants, displaySigFigs, globalConstants, globalStyles, iconPaths as icons, init, interactiveSizes$1 as interactiveSizes, isItemRenderableByVersion, itemDataVersion, itemToTree, ItemVersion as itemVersion, libVersion, mediaQueries, plotterPlotTypes, preprocessTex, registerAllWidgetsForTesting, shapes, traverse, violatingWidgets, allWidgets as widgets };
46741
46769
  //# sourceMappingURL=index.js.map