@khanacademy/perseus 47.0.0 → 47.0.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/dist/es/index.js CHANGED
@@ -27350,7 +27350,7 @@ class Dropdown extends React.Component {
27350
27350
  key: "placeholder",
27351
27351
  value: "0",
27352
27352
  disabled: true,
27353
- label: this.props.placeholder
27353
+ label: this.props.placeholder || " "
27354
27354
  }), ...this.props.choices.map((choice, i) => /*#__PURE__*/React.createElement(OptionItem, {
27355
27355
  key: String(i + 1),
27356
27356
  value: String(i + 1),
@@ -27371,15 +27371,14 @@ class Dropdown extends React.Component {
27371
27371
  }
27372
27372
  }, this.props.visibleLabel && /*#__PURE__*/React.createElement(LabelLarge, {
27373
27373
  tag: "label",
27374
- id: ids.get("dropdown-label")
27374
+ htmlFor: ids.get("dropdown")
27375
27375
  }, this.props.visibleLabel), /*#__PURE__*/React.createElement(SingleSelect, {
27376
27376
  id: ids.get("dropdown"),
27377
27377
  placeholder: "",
27378
27378
  onChange: value => this._handleChange(parseInt(value)),
27379
27379
  selectedValue: String(this.props.selected),
27380
27380
  disabled: this.props.apiOptions.readOnly,
27381
- "aria-label": this.props.ariaLabel || this.context.strings.selectAnAnswer,
27382
- "aria-labelledby": ids.get("dropdown-label")
27381
+ "aria-label": this.props.ariaLabel || this.props.visibleLabel || this.context.strings.selectAnAnswer
27383
27382
  // This is currently necessary for SRs to read the labels properly.
27384
27383
  // However, WB is working on a change to add the "combobox" role to
27385
27384
  // all dropdowns.
@@ -32223,11 +32222,39 @@ const LegacyGrid = ({
32223
32222
  return null;
32224
32223
  };
32225
32224
 
32225
+ /**
32226
+ * The Perseus "data schema" file.
32227
+ *
32228
+ * This file, and the types in it, represents the "data schema" that Perseus
32229
+ * uses. The @khanacademy/perseus-editor package edits and produces objects
32230
+ * that conform to the types in this file. Similarly, the top-level renderers
32231
+ * in @khanacademy/perseus, consume objects that conform to these types.
32232
+ *
32233
+ * WARNING: This file should not import any types from elsewhere so that it is
32234
+ * easy to reason about changes that alter the Perseus schema. This helps
32235
+ * ensure that it is not changed accidentally when upgrading a dependant
32236
+ * package or other part of Perseus code. Note that TypeScript does type
32237
+ * checking via something called "structural typing". This means that as long
32238
+ * as the shape of a type matches, the name it goes by doesn't matter. As a
32239
+ * result, a `Coord` type that looks like this `[x: number, y: number]` is
32240
+ * _identical_, in TypeScript's eyes, to this `Vector2` type `[x: number, y:
32241
+ * number]`. Also, with tuples, the labels for each entry is ignored, so `[x:
32242
+ * number, y: number]` is compatible with `[min: number, max: number]`. The
32243
+ * labels are for humans, not TypeScript. :)
32244
+ *
32245
+ * If you make changes to types in this file, be very sure that:
32246
+ *
32247
+ * a) the changes are backwards compatible. If they are not, old data from
32248
+ * previous versions of the "schema" could become unrenderable, or worse,
32249
+ * introduce hard-to-diagnose bugs.
32250
+ * b) the parsing code (`util/parse-perseus-json/`) is updated to handle
32251
+ * the new format _as well as_ the old format.
32252
+ */
32253
+
32226
32254
  // TODO(FEI-4010): Remove `Perseus` prefix for all types here
32227
- // TODO(FEI-4011): Use types generated by https://github.com/jaredly/generate-perseus-flowtypes
32228
32255
 
32229
- // Range is replaced within this file with Interval, but it is used elsewhere
32230
- // and exported from the package, so we need to keep it around.
32256
+ // Same name as Mafs
32257
+
32231
32258
  /**
32232
32259
  * Our core set of Perseus widgets.
32233
32260
  *
@@ -32271,6 +32298,7 @@ const LegacyGrid = ({
32271
32298
  *
32272
32299
  * @see {@link https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation}
32273
32300
  */
32301
+
32274
32302
  /**
32275
32303
  * A map of widget IDs to widget options. This is most often used as the type
32276
32304
  * for a set of widgets defined in a `PerseusItem` but can also be useful to
@@ -32283,6 +32311,7 @@ const LegacyGrid = ({
32283
32311
  * @see {@link PerseusWidgetTypes} additional widgets can be added to this map type
32284
32312
  * by augmenting the PerseusWidgetTypes with new widget types!
32285
32313
  */
32314
+
32286
32315
  /**
32287
32316
  * A "PerseusItem" is a classic Perseus item. It is rendered by the
32288
32317
  * `ServerItemRenderer` and the layout is pre-set.
@@ -32290,10 +32319,12 @@ const LegacyGrid = ({
32290
32319
  * To render more complex Perseus items, see the `Item` type in the multi item
32291
32320
  * area.
32292
32321
  */
32322
+
32293
32323
  /**
32294
32324
  * A "PerseusArticle" is an item that is meant to be rendered as an article.
32295
32325
  * This item is never scored and is rendered by the `ArticleRenderer`.
32296
32326
  */
32327
+
32297
32328
  const ItemExtras = [
32298
32329
  // The user might benefit from using a Scientific Calculator. Provided on Khan Academy when true
32299
32330
  "calculator",
@@ -45076,7 +45107,7 @@ const init = function init() {
45076
45107
 
45077
45108
  // This file is processed by a Rollup plugin (replace) to inject the production
45078
45109
  const libName = "@khanacademy/perseus";
45079
- const libVersion = "47.0.0";
45110
+ const libVersion = "47.0.1";
45080
45111
  addLibraryVersionToPerseusDebug(libName, libVersion);
45081
45112
 
45082
45113
  const apiVersion = {