@khanacademy/perseus-editor 4.3.4 → 4.4.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.
@@ -21,7 +21,7 @@ declare class WidgetEditor extends React.Component<WidgetEditorProps, WidgetEdit
21
21
  _handleAlignmentChange: (e: React.SyntheticEvent<HTMLSelectElement>) => void;
22
22
  getSaveWarnings: () => any;
23
23
  serialize: () => {
24
- type: "categorizer" | "iframe" | "table" | "video" | "image" | "radio" | "cs-program" | "definition" | "group" | "dropdown" | "example-graphie-widget" | "example-widget" | "explanation" | "expression" | "graded-group-set" | "graded-group" | "grapher" | "input-number" | "interaction" | "interactive-graph" | "label-image" | "lights-puzzle" | "matcher" | "matrix" | "measurer" | "molecule-renderer" | "number-line" | "numeric-input" | "orderer" | "passage-ref" | "passage" | "plotter" | "python-program" | "reaction-diagtram" | "passage-ref-target" | "sequence" | "simple-markdown-tester" | "simulator" | "sorter" | "unit-input" | "deprecated-standin";
24
+ type: "categorizer" | "iframe" | "table" | "video" | "image" | "radio" | "cs-program" | "definition" | "group" | "dropdown" | "example-graphie-widget" | "example-widget" | "explanation" | "expression" | "graded-group-set" | "graded-group" | "grapher" | "input-number" | "interaction" | "interactive-graph" | "label-image" | "lights-puzzle" | "matcher" | "matrix" | "measurer" | "molecule-renderer" | "number-line" | "numeric-input" | "orderer" | "passage-ref" | "passage" | "plotter" | "python-program" | "reaction-diagram" | "passage-ref-target" | "sequence" | "simple-markdown-tester" | "simulator" | "sorter" | "unit-input" | "deprecated-standin";
25
25
  alignment: string | undefined;
26
26
  static: boolean | undefined;
27
27
  graded: boolean | undefined;
package/dist/es/index.js CHANGED
@@ -25,7 +25,7 @@ import * as i18n$1 from '@khanacademy/wonder-blocks-i18n';
25
25
 
26
26
  // This file is processed by a Rollup plugin (replace) to inject the production
27
27
  const libName = "@khanacademy/perseus-editor";
28
- const libVersion = "4.3.4";
28
+ const libVersion = "4.4.0";
29
29
  addLibraryVersionToPerseusDebug(libName, libVersion);
30
30
 
31
31
  function _extends() {
@@ -20582,6 +20582,10 @@ class WidgetEditor extends React.Component {
20582
20582
  };
20583
20583
  this._handleWidgetChange = (newProps, cb, silent) => {
20584
20584
  var _this$widget$current$, _this$widget$current;
20585
+ // Casting to any is necessary because typescript
20586
+ // seems confused about the type of WidgetOptions
20587
+ // TODO (LC-1794): Fix this type so that we don't
20588
+ // require the cast to any.
20585
20589
  const newWidgetInfo = _extends({}, this.state.widgetInfo, {
20586
20590
  options: _extends({}, this.state.widgetInfo.options, (_this$widget$current$ = (_this$widget$current = this.widget.current) == null ? void 0 : _this$widget$current.serialize()) != null ? _this$widget$current$ : {}, newProps)
20587
20591
  });
@@ -26145,6 +26149,7 @@ DropdownEditor.defaultProps = {
26145
26149
  }]
26146
26150
  };
26147
26151
 
26152
+ /* eslint-disable @typescript-eslint/no-unused-vars, react/forbid-prop-types, react/sort-comp */
26148
26153
  const {
26149
26154
  Graphie
26150
26155
  } = components;
@@ -26222,6 +26227,7 @@ class ExampleGraphieWidget$1 extends React.Component {
26222
26227
  };
26223
26228
  }
26224
26229
  render() {
26230
+ var _this$props$apiOption;
26225
26231
  return /*#__PURE__*/React.createElement(Graphie
26226
26232
  // eslint-disable-next-line react/no-string-refs
26227
26233
  , {
@@ -26230,7 +26236,7 @@ class ExampleGraphieWidget$1 extends React.Component {
26230
26236
  range: this.props.graph.range,
26231
26237
  options: this.props.graph,
26232
26238
  setup: this.setupGraphie,
26233
- setDrawingAreaAvailable: this.props.apiOptions.setDrawingAreaAvailable
26239
+ setDrawingAreaAvailable: (_this$props$apiOption = this.props.apiOptions) == null ? void 0 : _this$props$apiOption.setDrawingAreaAvailable
26234
26240
  }, /*#__PURE__*/React.createElement(MovablePoint, {
26235
26241
  pointSize: 5,
26236
26242
  coord: this.props.coord || [0, 0],
@@ -26244,11 +26250,6 @@ class ExampleGraphieWidget$1 extends React.Component {
26244
26250
  * For this widget to work, we must export it.
26245
26251
  * We also must import this file in src/all-widgets.js
26246
26252
  */
26247
- ExampleGraphieWidget$1.propTypes = _extends({}, Changeable.propTypes, {
26248
- apiOptions: ApiOptions.propTypes,
26249
- graph: PropTypes.object.isRequired,
26250
- coord: PropTypes.arrayOf(PropTypes.number)
26251
- });
26252
26253
  ExampleGraphieWidget$1.defaultProps = {
26253
26254
  // We want to allow our coord to be null to test if the
26254
26255
  // user has interacted with this widget yet when grading it
@@ -34852,6 +34853,7 @@ VideoEditor.defaultProps = {
34852
34853
 
34853
34854
  var AllEditors = [CategorizerEditor, CSProgramEditor, DefinitionEditor, DropdownEditor, ExampleGraphieWidgetEditor, ExampleWidgetEditor, ExplanationEditor, ExpressionEditor, GradedGroupEditor, GradedGroupSetEditor, GrapherEditor, GroupEditor, IframeEditor, ImageEditor, InputNumberEditor, InteractionEditor, InteractiveGraphEditor, LabelImageEditor, LightsPuzzleEditor, MatcherEditor, MatrixEditor, MeasurerEditor, MoleculeWidgetEditor, NumberLineEditor, NumericInputEditor, OrdererEditor, PassageEditor, PassageRefEditor, PassageRefTargetEditor, PlotterEditor, PythonProgramEditor, ReactionDiagramWidgetEditor, SequenceEditor, SimpleMarkdownTesterEditor, SimulatorEditor, SorterEditor, TableEditor, UnitInputEditor, VideoEditor, RadioEditor, DeprecatedStandinEditor];
34854
34855
 
34856
+ /* eslint-disable @khanacademy/ts-no-error-suppressions */
34855
34857
  class TextInput extends React.Component {
34856
34858
  constructor(...args) {
34857
34859
  super(...args);
@@ -34875,7 +34877,6 @@ class TextInput extends React.Component {
34875
34877
  });
34876
34878
  }
34877
34879
  }
34878
-
34879
34880
  /**
34880
34881
  * This is the widget's renderer. It shows up in the right column
34881
34882
  * in the demo, and is what is visible to users, and where
@@ -34963,9 +34964,6 @@ class ExampleWidget extends React.Component {
34963
34964
  /**
34964
34965
  * For this widget to work, we must import this file in src/all-widgets.js
34965
34966
  */
34966
- ExampleWidget.propTypes = _extends({}, Changeable.propTypes, {
34967
- value: PropTypes.string
34968
- });
34969
34967
  ExampleWidget.defaultProps = {
34970
34968
  value: ""
34971
34969
  };
@@ -34980,6 +34978,7 @@ var ExampleWidget$1 = {
34980
34978
  widget: ExampleWidget
34981
34979
  };
34982
34980
 
34981
+ /* eslint-disable react/sort-comp */
34983
34982
  const mdParse = PerseusMarkdown.parse;
34984
34983
  const mdOutput = PerseusMarkdown.basicOutput;
34985
34984
  class SimpleMarkdownTester extends React.Component {
@@ -35045,9 +35044,6 @@ class SimpleMarkdownTester extends React.Component {
35045
35044
  /**
35046
35045
  * For this widget to work, we must import this file in src/all-widgets.js
35047
35046
  */
35048
- SimpleMarkdownTester.propTypes = _extends({}, Changeable.propTypes, {
35049
- value: PropTypes.string
35050
- });
35051
35047
  SimpleMarkdownTester.defaultProps = {
35052
35048
  value: ""
35053
35049
  };