@khanacademy/perseus-editor 7.0.3 → 8.0.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.
package/dist/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { addLibraryVersionToPerseusDebug } from '@khanacademy/perseus-core';
2
- import { constants, components, Widgets, icons, WIDGET_PROP_DENYLIST, Util, Log, PerseusError, Errors, PerseusMarkdown, preprocessTex, ApiOptions, buildMapper, itemToTree, buildEmptyItemTreeForShape, shapes, ItemExtras, itemDataVersion, ClassNames, MultiItems, traverse, Categorizer as Categorizer$1, Changeable, EditorJsonify, Dependencies, WidgetJsonifyDeprecated, PerseusExpressionAnswerFormConsidered, Expression, interactiveSizes, KhanMath, GrapherWidget, GrapherUtil, SizingUtils, PerseusI18nContext, KhanColors, ColorPicker, DashPicker, ArrowPicker, ElementContainer, lockedFigureColors, lockedFigureFillStyles, InteractiveGraphWidget, globalStyles, globalConstants, MatrixWidget, PlotterWidget, plotterPlotTypes, BaseRadio, TableWidget, displaySigFigs, widgets } from '@khanacademy/perseus';
1
+ import { addLibraryVersionToPerseusDebug, PerseusError, Errors } from '@khanacademy/perseus-core';
2
+ import { constants, components, Widgets, icons, WIDGET_PROP_DENYLIST, Util, Log, PerseusMarkdown, preprocessTex, ApiOptions, buildMapper, itemToTree, buildEmptyItemTreeForShape, shapes, ItemExtras, itemDataVersion, ClassNames, MultiItems, traverse, Categorizer as Categorizer$1, Changeable, EditorJsonify, Dependencies, WidgetJsonifyDeprecated, PerseusExpressionAnswerFormConsidered, Expression, interactiveSizes, KhanMath, GrapherWidget, GrapherUtil, SizingUtils, PerseusI18nContext, KhanColors, ColorPicker, DashPicker, ArrowPicker, ElementContainer, lockedFigureColors, lockedFigureFillStyles, InteractiveGraphWidget, globalStyles, globalConstants, MatrixWidget, PlotterWidget, plotterPlotTypes, BaseRadio, TableWidget, displaySigFigs, widgets } from '@khanacademy/perseus';
3
3
  import * as React from 'react';
4
4
  import { useRef, useEffect } from 'react';
5
5
  import _ from 'underscore';
@@ -36,7 +36,7 @@ import Banner from '@khanacademy/wonder-blocks-banner';
36
36
 
37
37
  // This file is processed by a Rollup plugin (replace) to inject the production
38
38
  const libName = "@khanacademy/perseus-editor";
39
- const libVersion = "7.0.3";
39
+ const libVersion = "8.0.0";
40
40
  addLibraryVersionToPerseusDebug(libName, libVersion);
41
41
 
42
42
  function _extends() {
@@ -34471,9 +34471,14 @@ class NumericInputEditor extends React.Component {
34471
34471
  onChange: this.props.onChange
34472
34472
  }), /*#__PURE__*/React.createElement(InfoTip$7, null, /*#__PURE__*/React.createElement("p", null, "A coefficient style number allows the student to use - for -1 and an empty string to mean 1."))));
34473
34473
  const addAnswerButton = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", {
34474
- href: "javascript:void(0)",
34474
+ href: "#",
34475
34475
  className: "simple-button orange",
34476
- onClick: () => this.addAnswer(),
34476
+ onClick: e => {
34477
+ // preventDefault ensures that href="#"
34478
+ // doesn't scroll to the top of the page
34479
+ e.preventDefault();
34480
+ this.addAnswer();
34481
+ },
34477
34482
  onKeyDown: e => this.onSpace(e, this.addAnswer)
34478
34483
  }, /*#__PURE__*/React.createElement("span", null, "Add new answer")));
34479
34484
  const instructions = {
@@ -34555,21 +34560,36 @@ class NumericInputEditor extends React.Component {
34555
34560
  })) : null, /*#__PURE__*/React.createElement("div", {
34556
34561
  className: "value-divider"
34557
34562
  }), /*#__PURE__*/React.createElement("a", {
34558
- href: "javascript:void(0)",
34563
+ href: "#",
34559
34564
  className: "answer-status " + answer.status,
34560
- onClick: () => this.onStatusChange(i),
34565
+ onClick: e => {
34566
+ // preventDefault ensures that href="#"
34567
+ // doesn't scroll to the top of the page
34568
+ e.preventDefault();
34569
+ this.onStatusChange(i);
34570
+ },
34561
34571
  onKeyDown: e => this.onSpace(e, this.onStatusChange)
34562
34572
  }, answer.status), /*#__PURE__*/React.createElement("a", {
34563
- href: "javascript:void(0)",
34573
+ href: "#",
34564
34574
  className: "answer-trash",
34565
34575
  "aria-label": "Delete answer",
34566
- onClick: () => this.onTrashAnswer(i),
34576
+ onClick: e => {
34577
+ // preventDefault ensures that href="#"
34578
+ // doesn't scroll to the top of the page
34579
+ e.preventDefault();
34580
+ this.onTrashAnswer(i);
34581
+ },
34567
34582
  onKeyDown: e => this.onSpace(e, this.onTrashAnswer)
34568
34583
  }, /*#__PURE__*/React.createElement(InlineIcon$2, iconTrash$1)), /*#__PURE__*/React.createElement("a", {
34569
- href: "javascript:void(0)",
34584
+ href: "#",
34570
34585
  className: "options-toggle",
34571
34586
  "aria-label": "Toggle options",
34572
- onClick: () => this.onToggleOptions(i),
34587
+ onClick: e => {
34588
+ // preventDefault ensures that href="#"
34589
+ // doesn't scroll to the top of the page
34590
+ e.preventDefault();
34591
+ this.onToggleOptions(i);
34592
+ },
34573
34593
  onKeyDown: e => this.onSpace(e, this.onToggleOptions)
34574
34594
  }, /*#__PURE__*/React.createElement(InlineIcon$2, iconGear))), /*#__PURE__*/React.createElement("div", {
34575
34595
  className: "input-answer-editor-message"