@khanacademy/perseus-editor 16.0.3 → 17.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.
@@ -22,7 +22,7 @@ declare class WidgetEditor extends React.Component<WidgetEditorProps, WidgetEdit
22
22
  _handleAlignmentChange: (e: React.SyntheticEvent<HTMLSelectElement>) => void;
23
23
  getSaveWarnings: () => any;
24
24
  serialize: () => {
25
- type: "definition" | "group" | "radio" | "table" | "categorizer" | "cs-program" | "dropdown" | "explanation" | "expression" | "grapher" | "graded-group-set" | "graded-group" | "iframe" | "image" | "input-number" | "interaction" | "interactive-graph" | "label-image" | "matcher" | "matrix" | "measurer" | "molecule-renderer" | "number-line" | "numeric-input" | "orderer" | "passage-ref-target" | "passage-ref" | "passage" | "phet-simulation" | "python-program" | "plotter" | "sorter" | "video" | "deprecated-standin";
25
+ type: "categorizer" | "cs-program" | "definition" | "dropdown" | "explanation" | "expression" | "grapher" | "graded-group-set" | "graded-group" | "group" | "iframe" | "image" | "input-number" | "interaction" | "interactive-graph" | "label-image" | "matcher" | "matrix" | "measurer" | "molecule-renderer" | "number-line" | "numeric-input" | "orderer" | "passage-ref-target" | "passage-ref" | "passage" | "phet-simulation" | "python-program" | "plotter" | "radio" | "sorter" | "table" | "video" | "deprecated-standin";
26
26
  alignment: string | undefined;
27
27
  static: boolean | undefined;
28
28
  graded: boolean | undefined;
package/dist/es/index.js CHANGED
@@ -46,17 +46,25 @@ import arrowCounterClockwise from '@phosphor-icons/core/bold/arrow-counter-clock
46
46
 
47
47
  // This file is processed by a Rollup plugin (replace) to inject the production
48
48
  const libName = "@khanacademy/perseus-editor";
49
- const libVersion = "16.0.3";
49
+ const libVersion = "17.0.0";
50
50
  addLibraryVersionToPerseusDebug(libName, libVersion);
51
51
 
52
52
  function _extends() {
53
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
54
- for (var e = 1; e < arguments.length; e++) {
55
- var t = arguments[e];
56
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
53
+ _extends = Object.assign || function (target) {
54
+ for (var i = 1; i < arguments.length; i++) {
55
+ var source = arguments[i];
56
+
57
+ for (var key in source) {
58
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
59
+ target[key] = source[key];
60
+ }
61
+ }
57
62
  }
58
- return n;
59
- }, _extends.apply(null, arguments);
63
+
64
+ return target;
65
+ };
66
+
67
+ return _extends.apply(this, arguments);
60
68
  }
61
69
 
62
70
  const devices = {
@@ -20509,14 +20517,19 @@ katex.__defineMacro("\\pu", function (context) {
20509
20517
  // a mathematical minus, U+2212. So we need that extra 0.56.
20510
20518
  katex.__defineMacro("\\tripledash", "{\\vphantom{-}\\raisebox{2.56mu}{$\\mkern2mu" + "\\tiny\\text{-}\\mkern1mu\\text{-}\\mkern1mu\\text{-}\\mkern2mu$}}");
20511
20519
 
20512
- function _objectWithoutPropertiesLoose(r, e) {
20513
- if (null == r) return {};
20514
- var t = {};
20515
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
20516
- if (e.includes(n)) continue;
20517
- t[n] = r[n];
20520
+ function _objectWithoutPropertiesLoose(source, excluded) {
20521
+ if (source == null) return {};
20522
+ var target = {};
20523
+ var sourceKeys = Object.keys(source);
20524
+ var key, i;
20525
+
20526
+ for (i = 0; i < sourceKeys.length; i++) {
20527
+ key = sourceKeys[i];
20528
+ if (excluded.indexOf(key) >= 0) continue;
20529
+ target[key] = source[key];
20518
20530
  }
20519
- return t;
20531
+
20532
+ return target;
20520
20533
  }
20521
20534
 
20522
20535
  const _excluded$4 = ["component", "shouldDragHighlight"];
@@ -20858,6 +20871,8 @@ function LabeledSwitch$1(props) {
20858
20871
  label
20859
20872
  } = props,
20860
20873
  switchProps = _objectWithoutPropertiesLoose(props, _excluded$3);
20874
+ // TODO(WB-1812, somewhatabstract): Migrate to Id or useId
20875
+ // eslint-disable-next-line no-restricted-syntax
20861
20876
  const ids = useUniqueIdWithMock();
20862
20877
  const id = ids.get("switch");
20863
20878
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("label", {
@@ -93897,6 +93912,8 @@ const roles = [
93897
93912
  "slider",
93898
93913
  "switch",
93899
93914
  "tab",
93915
+ // Combobox is NOT included in the WAI-ARIA 1.2 list of aria-roles that apply "presentation" to descendants
93916
+ "combobox",
93900
93917
  ];
93901
93918
  const nodeHasRoleIn = (dom, roles) => roles.some((role) => dom.matches(`[role=${role}]`));
93902
93919
  const addLabelForNonSemanticRoles = (node, container, labelFn) => {
@@ -94928,6 +94945,9 @@ const LabeledSwitch = props => {
94928
94945
  style,
94929
94946
  onChange
94930
94947
  } = props;
94948
+
94949
+ // TODO(WB-1812, somewhatabstract): Migrate to Id or useId
94950
+ // eslint-disable-next-line no-restricted-syntax
94931
94951
  const ids = useUniqueIdWithMock();
94932
94952
  const switchId = ids.get("switch");
94933
94953
  return /*#__PURE__*/React.createElement(View, {
@@ -96007,6 +96027,9 @@ const LockedFiguresSection = props => {
96007
96027
  const collapsedStateArray = Array(((_props$figures = props.figures) != null ? _props$figures : []).length).fill(false);
96008
96028
  const [expandedStates, setExpandedStates] = React.useState(collapsedStateArray);
96009
96029
  const [isExpanded, setIsExpanded] = React.useState(true);
96030
+
96031
+ // TODO(WB-1812, somewhatabstract): Migrate to Id or useId
96032
+ // eslint-disable-next-line no-restricted-syntax
96010
96033
  const uniqueId = useUniqueIdWithMock().get("locked-figures-section");
96011
96034
  const {
96012
96035
  figures,