@khanacademy/perseus-core 42.4.0 → 42.5.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.
@@ -438,6 +438,17 @@ export type PerseusAnswerTile = {
438
438
  /** Display height in px for an image tile. */
439
439
  imageHeight?: number;
440
440
  };
441
+ /**
442
+ * An answer tile in a fill-in-the-blank widget's choice bank.
443
+ */
444
+ export type PerseusFillInTheBlankTile = PerseusAnswerTile & {
445
+ /**
446
+ * How many blanks this tile may fill: a positive number, or "unlimited".
447
+ * 1 makes the tile single-use: placing it again moves it rather than
448
+ * copying it. Authors set this per tile, e.g. 10 pennies and 5 dimes.
449
+ */
450
+ maxUses: number | "unlimited";
451
+ };
441
452
  /**
442
453
  * Options for the fill-in-the-blank widget. Presents content with inline
443
454
  * blanks above a choice bank of answer tiles.
@@ -449,11 +460,7 @@ export type PerseusFillInTheBlankWidgetOptions = {
449
460
  /** The widgets embedded in `content`, keyed by widget id. */
450
461
  widgets: PerseusWidgetsMap;
451
462
  /** The choice bank the learner draws answer tiles from */
452
- tiles: PerseusAnswerTile[];
453
- /**
454
- * How many times each tile may be placed, for the whole choice bank.
455
- */
456
- maxUsesPerTile: number | "unlimited";
463
+ tiles: PerseusFillInTheBlankTile[];
457
464
  /**
458
465
  * Randomize the order of the answer tiles or keep them as defined.
459
466
  */
@@ -1446,13 +1453,13 @@ export type PerseusNumberLineWidgetOptions = {
1446
1453
  * The position of the endpoints of the number line. Setting the range
1447
1454
  * constrains the position of the answer and the labels.
1448
1455
  */
1449
- range: number[];
1456
+ range: [min: number, max: number];
1450
1457
  /**
1451
1458
  * This controls the position of the left / right labels. By default, the
1452
1459
  * labels are set by the range. Note: Ensure that the labels line up with
1453
1460
  * the tick marks, or it may be confusing for users.
1454
1461
  */
1455
- labelRange: Array<number | null>;
1462
+ labelRange: [left: number | null, right: number | null];
1456
1463
  /**
1457
1464
  * This controls the styling of the labels for the two main labels as well
1458
1465
  * as all the tick mark labels, if applicable.
@@ -1468,7 +1475,7 @@ export type PerseusNumberLineWidgetOptions = {
1468
1475
  /**
1469
1476
  * The range of possible values for numDivisions, in the format [min, max].
1470
1477
  */
1471
- divisionRange: number[];
1478
+ divisionRange: [min: number, max: number];
1472
1479
  /**
1473
1480
  * The number of divisions of the number line. Divisions are the spaces
1474
1481
  * between tick marks.
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export type { KeypadConfiguration, KeypadContextRendererInterface, } from "./key
7
7
  export type { ErrorKind } from "./error/errors";
8
8
  /** @hidden */
9
9
  export { default as ErrorCodes, type ErrorCode } from "./error-codes";
10
+ export { isCorrect } from "./utils/is-correct";
10
11
  /** @hidden */
11
12
  export type { FunctionTypeMappingKeys } from "./utils/grapher-util";
12
13
  /** @hidden */
@@ -223,7 +224,7 @@ export { generateExplanationOptions, generateExplanationWidget, } from "./utils/
223
224
  /** @hidden */
224
225
  export { generateExpressionOptions, generateExpressionAnswerForm, generateExpressionWidget, } from "./utils/generators/expression-widget-generator";
225
226
  /** @hidden */
226
- export { generateAnswerTile, generateFillInTheBlankOptions, generateFillInTheBlankWidget, } from "./utils/generators/fill-in-the-blank-widget-generator";
227
+ export { generateAnswerTile, generateFillInTheBlankTile, generateFillInTheBlankOptions, generateFillInTheBlankWidget, } from "./utils/generators/fill-in-the-blank-widget-generator";
227
228
  /** @hidden */
228
229
  export { generateFreeResponseOptions, generateFreeResponseWidget, } from "./utils/generators/free-response-widget-generator";
229
230
  /** @hidden */
@@ -263,7 +264,7 @@ export { generateRadioOptions, generateRadioChoice, generateSimpleRadioQuestion,
263
264
  /** @hidden */
264
265
  export { generateVideoWidget } from "./utils/generators/video-widget-generator";
265
266
  /** @hidden */
266
- export { generateSorterWidget, generateSorterOptions, } from "./utils/generators/sorter-widget-generator";
267
+ export { generateSorterWidget, generateSorterOptions, generateSorterLegend, } from "./utils/generators/sorter-widget-generator";
267
268
  /** @hidden */
268
269
  export { generateTableOptions } from "./utils/generators/table-widget-generator";
269
270
  /** @hidden */