@khanacademy/perseus 39.0.0 → 39.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.
@@ -1,4 +1,4 @@
1
- import type { GrapherAnswerTypes, PerseusDropdownChoice, PerseusExpressionAnswerForm, PerseusGradedGroupSetWidgetOptions, PerseusGradedGroupWidgetOptions, PerseusGraphType, PerseusGroupWidgetOptions, PerseusIFrameWidgetOptions, PerseusMatcherWidgetOptions, PerseusMatrixWidgetOptions, PerseusNumberLineWidgetOptions, PerseusNumericInputWidgetOptions, PerseusOrdererWidgetOptions, PerseusPlotterWidgetOptions, PerseusRadioWidgetOptions, PerseusSorterWidgetOptions, PerseusTableWidgetOptions } from "./perseus-types";
1
+ import type { GrapherAnswerTypes, PerseusDropdownChoice, PerseusExpressionAnswerForm, PerseusGradedGroupSetWidgetOptions, PerseusGradedGroupWidgetOptions, PerseusGraphType, PerseusGroupWidgetOptions, PerseusMatcherWidgetOptions, PerseusMatrixWidgetAnswers, PerseusNumberLineWidgetOptions, PerseusNumericInputAnswer, PerseusOrdererWidgetOptions, PerseusPlotterWidgetOptions, PerseusRadioChoice, PerseusTableWidgetOptions } from "./perseus-types";
2
2
  import type { InteractiveMarkerType } from "./widgets/label-image/types";
3
3
  import type { Relationship } from "./widgets/number-line/number-line";
4
4
  export type UserInputStatus = "correct" | "incorrect" | "incomplete";
@@ -31,7 +31,7 @@ export type PerseusGrapherRubric = {
31
31
  correct: GrapherAnswerTypes;
32
32
  };
33
33
  export type PerseusGrapherUserInput = PerseusGrapherRubric["correct"];
34
- export type PerseusIFrameRubric = PerseusIFrameWidgetOptions;
34
+ export type PerseusIFrameRubric = Empty;
35
35
  export type PerseusIFrameUserInput = {
36
36
  status: UserInputStatus;
37
37
  message: string | null;
@@ -60,9 +60,11 @@ export type PerseusMatcherUserInput = {
60
60
  left: ReadonlyArray<string>;
61
61
  right: ReadonlyArray<string>;
62
62
  };
63
- export type PerseusMatrixRubric = PerseusMatrixWidgetOptions;
63
+ export type PerseusMatrixRubric = {
64
+ answers: PerseusMatrixWidgetAnswers;
65
+ };
64
66
  export type PerseusMatrixUserInput = {
65
- answers: ReadonlyArray<ReadonlyArray<number>>;
67
+ answers: PerseusMatrixRubric["answers"];
66
68
  };
67
69
  export type PerseusNumberLineRubric = PerseusNumberLineWidgetOptions & {
68
70
  isInequality: boolean;
@@ -74,7 +76,10 @@ export type PerseusNumberLineUserInput = {
74
76
  numDivisions: number;
75
77
  divisionRange: ReadonlyArray<number>;
76
78
  };
77
- export type PerseusNumericInputRubric = PerseusNumericInputWidgetOptions;
79
+ export type PerseusNumericInputRubric = {
80
+ answers: ReadonlyArray<PerseusNumericInputAnswer>;
81
+ coefficient: boolean;
82
+ };
78
83
  export type PerseusNumericInputUserInput = {
79
84
  currentValue: string;
80
85
  };
@@ -84,15 +89,18 @@ export type PerseusOrdererUserInput = {
84
89
  };
85
90
  export type PerseusPlotterRubric = PerseusPlotterWidgetOptions;
86
91
  export type PerseusPlotterUserInput = ReadonlyArray<number>;
87
- export type PerseusRadioRubric = PerseusRadioWidgetOptions;
92
+ export type PerseusRadioRubric = {
93
+ choices: ReadonlyArray<PerseusRadioChoice>;
94
+ };
88
95
  export type PerseusRadioUserInput = {
89
- countChoices?: boolean;
90
96
  choicesSelected: ReadonlyArray<boolean>;
91
97
  numCorrect?: number;
92
98
  noneOfTheAboveIndex?: number | null | undefined;
93
99
  noneOfTheAboveSelected?: boolean;
94
100
  };
95
- export type PerseusSorterRubric = PerseusSorterWidgetOptions;
101
+ export type PerseusSorterRubric = {
102
+ correct: ReadonlyArray<string>;
103
+ };
96
104
  export type PerseusSorterUserInput = {
97
105
  options: ReadonlyArray<string>;
98
106
  changed: boolean;
@@ -1,3 +1,3 @@
1
1
  import type { PerseusScore } from "../../types";
2
2
  import type { PerseusIFrameUserInput } from "../../validation.types";
3
- export declare function iframeValidator(state: PerseusIFrameUserInput): PerseusScore;
3
+ export declare function iframeValidator(userInput: PerseusIFrameUserInput): PerseusScore;
@@ -1,5 +1,5 @@
1
1
  import type { PerseusStrings } from "../../strings";
2
2
  import type { PerseusScore } from "../../types";
3
3
  import type { PerseusMatrixRubric, PerseusMatrixUserInput } from "../../validation.types";
4
- declare function matrixValidator(state: PerseusMatrixUserInput, rubric: PerseusMatrixRubric, strings: PerseusStrings): PerseusScore;
4
+ declare function matrixValidator(userInput: PerseusMatrixUserInput, rubric: PerseusMatrixRubric, strings: PerseusStrings): PerseusScore;
5
5
  export default matrixValidator;
@@ -21,11 +21,11 @@ type Props = {
21
21
  apiOptions: APIOptions;
22
22
  choices: ReadonlyArray<ChoiceType>;
23
23
  deselectEnabled?: boolean;
24
- editMode: boolean;
24
+ editMode?: boolean;
25
25
  labelWrap: boolean;
26
26
  countChoices: boolean | null | undefined;
27
27
  numCorrect: number;
28
- multipleSelect: boolean;
28
+ multipleSelect?: boolean;
29
29
  reviewModeRubric?: PerseusRadioWidgetOptions | null;
30
30
  reviewMode: boolean;
31
31
  onChange: (newValues: {
@@ -35,11 +35,5 @@ type Props = {
35
35
  registerFocusFunction?: (arg1: FocusFunction) => void;
36
36
  isLastUsedWidget?: boolean;
37
37
  };
38
- declare const BaseRadio: {
39
- (props: Props): React.ReactElement;
40
- defaultProps: {
41
- editMode: boolean;
42
- multipleSelect: boolean;
43
- };
44
- };
38
+ declare const BaseRadio: ({ apiOptions, reviewModeRubric, reviewMode, choices, editMode, multipleSelect, labelWrap, countChoices, numCorrect, isLastUsedWidget, onChange, registerFocusFunction, }: Props) => React.ReactElement;
45
39
  export default BaseRadio;
@@ -4,16 +4,9 @@
4
4
  import * as React from "react";
5
5
  type Props = {
6
6
  children?: React.ReactNode;
7
- visible: boolean;
8
- color: string;
9
- multipleSelect: boolean;
10
- };
11
- declare const FocusRing: {
12
- (props: Props): React.ReactElement;
13
- defaultProps: {
14
- visible: boolean;
15
- color: string;
16
- multipleSelect: boolean;
17
- };
7
+ visible?: boolean;
8
+ color?: string;
9
+ multipleSelect?: boolean;
18
10
  };
11
+ declare const FocusRing: ({ visible, color, multipleSelect, children, }: Props) => React.ReactElement;
19
12
  export default FocusRing;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Core Perseus API (includes renderers and widgets)",
4
4
  "author": "Khan Academy",
5
5
  "license": "MIT",
6
- "version": "39.0.0",
6
+ "version": "39.0.1",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -43,7 +43,7 @@
43
43
  "@khanacademy/kas": "^0.3.15",
44
44
  "@khanacademy/keypad-context": "^1.0.3",
45
45
  "@khanacademy/kmath": "^0.1.15",
46
- "@khanacademy/math-input": "^21.1.1",
46
+ "@khanacademy/math-input": "^21.1.2",
47
47
  "@khanacademy/perseus-core": "1.5.2",
48
48
  "@khanacademy/perseus-linter": "^1.2.3",
49
49
  "@khanacademy/pure-markdown": "^0.3.10",