@khanacademy/perseus-editor 2.15.3 → 2.15.4

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/editor-page.d.ts +4 -10
  3. package/dist/editor.d.ts +2 -2
  4. package/dist/es/index.js +25 -14
  5. package/dist/es/index.js.map +1 -1
  6. package/dist/index.js +25 -14
  7. package/dist/index.js.map +1 -1
  8. package/dist/widgets/interactive-graph-editor.d.ts +92 -92
  9. package/package.json +2 -2
  10. package/src/__stories__/editor-page.stories.tsx +65 -0
  11. package/src/__stories__/editor.stories.tsx +2 -4
  12. package/src/editor-page.tsx +5 -11
  13. package/src/editor.tsx +2 -2
  14. package/src/widgets/__stories__/categorizer-editor.stories.tsx +24 -0
  15. package/src/widgets/__stories__/definition-editor.stories.tsx +18 -0
  16. package/src/widgets/__stories__/dropdown-editor.stories.tsx +18 -0
  17. package/src/widgets/__stories__/explanation-editor.stories.tsx +18 -0
  18. package/src/widgets/__stories__/input-number-editor.stories.tsx +18 -0
  19. package/src/widgets/__stories__/matcher-editor.stories.tsx +18 -0
  20. package/src/widgets/__stories__/number-line-editor.stories.tsx +18 -0
  21. package/src/widgets/__stories__/numeric-input-editor.stories.tsx +18 -0
  22. package/src/widgets/__stories__/radio-editor.stories.tsx +3 -3
  23. package/src/widgets/__stories__/sorter-editor.stories.tsx +18 -0
  24. package/src/widgets/__tests__/categorizer-editor.test.tsx +51 -0
  25. package/src/widgets/__tests__/definition-editor.test.tsx +41 -0
  26. package/src/widgets/__tests__/dropdown-editor.test.tsx +57 -0
  27. package/src/widgets/__tests__/explanation-editor.test.tsx +59 -0
  28. package/src/widgets/__tests__/input-number-editor.test.tsx +128 -0
  29. package/src/widgets/__tests__/matcher-editor.test.tsx +47 -0
  30. package/src/widgets/__tests__/number-line-editor.test.tsx +144 -0
  31. package/src/widgets/__tests__/numeric-input-editor.test.tsx +177 -0
  32. package/src/widgets/__tests__/radio-editor.test.tsx +118 -0
  33. package/src/widgets/__tests__/sorter-editor.test.tsx +55 -0
  34. package/src/widgets/dropdown-editor.tsx +1 -0
  35. package/src/widgets/input-number-editor.tsx +2 -0
  36. package/src/widgets/number-line-editor.tsx +16 -5
  37. package/src/widgets/numeric-input-editor.tsx +2 -0
  38. package/tsconfig-build.tsbuildinfo +1 -1
package/dist/index.js CHANGED
@@ -64,7 +64,7 @@ var i18n__namespace = /*#__PURE__*/_interopNamespace(i18n$1);
64
64
 
65
65
  // This file is processed by a Rollup plugin (replace) to inject the production
66
66
  const libName = "@khanacademy/perseus-editor";
67
- const libVersion = "2.15.3";
67
+ const libVersion = "2.15.4";
68
68
  perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
69
69
 
70
70
  function _extends() {
@@ -26336,7 +26336,8 @@ class DropdownEditor extends React__namespace.Component {
26336
26336
  value: choice.content
26337
26337
  }), /*#__PURE__*/React__namespace.createElement("a", {
26338
26338
  href: "#",
26339
- className: "simple-button orange"
26339
+ className: "simple-button orange",
26340
+ "aria-label": "Delete choice"
26340
26341
  // eslint-disable-next-line react/jsx-no-bind
26341
26342
  // @ts-expect-error - TS2683 - 'this' implicitly has type 'any' because it does not have a type annotation.
26342
26343
  ,
@@ -28600,6 +28601,7 @@ class InputNumberEditor extends React__namespace.Component {
28600
28601
  type: "text",
28601
28602
  disabled: !this.props.inexact,
28602
28603
  defaultValue: this.props.maxError,
28604
+ "aria-label": "Max error",
28603
28605
  onBlur: e => {
28604
28606
  const ans = "" + (perseus.Util.firstNumericalParse(e.target.value) || 0);
28605
28607
  e.target.value = ans;
@@ -28614,7 +28616,8 @@ class InputNumberEditor extends React__namespace.Component {
28614
28616
  this.props.onChange({
28615
28617
  answerType: e.target.value
28616
28618
  });
28617
- }
28619
+ },
28620
+ "aria-label": "Answer type"
28618
28621
  }, answerTypeOptions), /*#__PURE__*/React__namespace.createElement(InfoTip$f, null, /*#__PURE__*/React__namespace.createElement("p", null, "Use the default \"Numbers\" unless the answer must be in a specific form (e.g., question is about converting decimals to fractions)."))), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("label", null, "Width", " ", /*#__PURE__*/React__namespace.createElement("select", {
28619
28622
  value: this.props.size,
28620
28623
  onChange: e => {
@@ -32625,18 +32628,24 @@ class NumberLineEditor extends React__namespace.Component {
32625
32628
  value: this.props.correctRel
32626
32629
  // @ts-expect-error - TS2322 - Type '(arg1: ChangeEvent<HTMLInputElement>) => void' is not assignable to type 'ChangeEventHandler<HTMLSelectElement>'.
32627
32630
  ,
32628
- onChange: this.onChangeRelation
32631
+ onChange: this.onChangeRelation,
32632
+ "aria-label": "Select relationship"
32629
32633
  }, /*#__PURE__*/React__namespace.createElement("option", {
32630
- value: "eq"
32631
- }, " = "), /*#__PURE__*/React__namespace.createElement("option", {
32632
- value: "lt"
32633
- }, " < "), /*#__PURE__*/React__namespace.createElement("option", {
32634
- value: "gt"
32635
- }, " > "), /*#__PURE__*/React__namespace.createElement("option", {
32636
- value: "le"
32637
- }, " \u2264 "), /*#__PURE__*/React__namespace.createElement("option", {
32638
- value: "ge"
32639
- }, " \u2265 ")), " ", /*#__PURE__*/React__namespace.createElement(NumberInput$7, {
32634
+ value: "eq",
32635
+ "aria-label": "Equal"
32636
+ }, "="), /*#__PURE__*/React__namespace.createElement("option", {
32637
+ value: "lt",
32638
+ "aria-label": "Less than"
32639
+ }, "<"), /*#__PURE__*/React__namespace.createElement("option", {
32640
+ value: "gt",
32641
+ "aria-label": "Greater than"
32642
+ }, ">"), /*#__PURE__*/React__namespace.createElement("option", {
32643
+ value: "le",
32644
+ "aria-label": "Less than or equal"
32645
+ }, "\u2264"), /*#__PURE__*/React__namespace.createElement("option", {
32646
+ value: "ge",
32647
+ "aria-label": "Greater than or equal"
32648
+ }, "\u2265")), " ", /*#__PURE__*/React__namespace.createElement(NumberInput$7, {
32640
32649
  value: this.props.correctX,
32641
32650
  format: this.props.labelStyle
32642
32651
  // eslint-disable-next-line react/jsx-no-bind
@@ -33000,11 +33009,13 @@ const NumericInputEditor = createReactClass__default["default"]({
33000
33009
  }, answer.status), /*#__PURE__*/React__namespace.createElement("a", {
33001
33010
  href: "javascript:void(0)",
33002
33011
  className: "answer-trash",
33012
+ "aria-label": "Delete answer",
33003
33013
  onClick: () => this.onTrashAnswer(i),
33004
33014
  onKeyDown: e => this.onSpace(e, this.onTrashAnswer, i)
33005
33015
  }, /*#__PURE__*/React__namespace.createElement(InlineIcon$3, iconTrash$2)), /*#__PURE__*/React__namespace.createElement("a", {
33006
33016
  href: "javascript:void(0)",
33007
33017
  className: "options-toggle",
33018
+ "aria-label": "Toggle options",
33008
33019
  onClick: () => this.onToggleOptions(i),
33009
33020
  onKeyDown: e => this.onSpace(e, this.onToggleOptions, i)
33010
33021
  }, /*#__PURE__*/React__namespace.createElement(InlineIcon$3, iconGear))), /*#__PURE__*/React__namespace.createElement("div", {