@khanacademy/perseus-core 19.5.0 → 20.1.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.
@@ -29,12 +29,13 @@
29
29
  * ```
30
30
  */
31
31
  import type { GrapherAnswerTypes, PerseusDropdownChoice, PerseusExpressionAnswerForm, PerseusGradedGroupSetWidgetOptions, PerseusGradedGroupWidgetOptions, PerseusGraphType, PerseusGroupWidgetOptions, PerseusMatrixWidgetAnswers, PerseusNumericInputAnswer, PerseusOrdererWidgetOptions, PerseusRadioChoice, PerseusGraphCorrectType, MakeWidgetMap, PerseusFreeResponseWidgetScoringCriterion } from "./data-schema";
32
+ import type { ErrorCode } from "./error-codes";
32
33
  import type { Relationship } from "./types";
33
34
  export type WidgetValidatorFunction = (userInput: UserInput | undefined, validationData: ValidationData, locale: string) => ValidationResult;
34
35
  export type WidgetScorerFunction = (userInput: UserInput | undefined, rubric: Rubric, locale?: string) => PerseusScore;
35
36
  export type PerseusScore = {
36
37
  type: "invalid";
37
- message?: string | null | undefined;
38
+ message?: ErrorCode | null;
38
39
  suppressAlmostThere?: boolean | null | undefined;
39
40
  } | {
40
41
  type: "points";
@@ -31,6 +31,11 @@ export declare const getSupportedAlignments: (type: string) => ReadonlyArray<Ali
31
31
  * the exports of a widget's module.
32
32
  */
33
33
  export declare const getDefaultAlignment: (type: string) => Alignment;
34
+ /**
35
+ * Returns the CSS class name corresponding to the specified widget alignment.
36
+ * Uses explicit mapping to make it easy to locate related CSS style definitions.
37
+ */
38
+ export declare const getAlignmentClassName: (type: string, alignment: Alignment) => string;
34
39
  /**
35
40
  * We use a function here rather than registering widgets
36
41
  * at the top-level of the file to avoid circular dependencies.
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Shared Perseus infrastructure",
4
4
  "author": "Khan Academy",
5
5
  "license": "MIT",
6
- "version": "19.5.0",
6
+ "version": "20.1.0",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },