@khanacademy/perseus-core 29.0.0 → 30.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/data-schema.d.ts +11 -17
- package/dist/data-schema.typetest.d.ts +1 -0
- package/dist/es/index.item-splitting.js +3 -3
- package/dist/es/index.item-splitting.js.map +1 -1
- package/dist/es/index.js +13 -15
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.item-splitting.js +3 -3
- package/dist/index.item-splitting.js.map +1 -1
- package/dist/index.js +13 -15
- package/dist/index.js.map +1 -1
- package/dist/parse-perseus-json/perseus-parsers/expression-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/input-number-widget.d.ts +19 -2
- package/dist/parse-perseus-json/perseus-parsers/perseus-answer-area.d.ts +4 -3
- package/dist/utils/generators/input-number-widget-generator.d.ts +3 -2
- package/dist/validation.types.d.ts +2 -2
- package/dist/widgets/input-number/index.d.ts +1 -1
- package/dist/widgets/input-number/input-number-util.d.ts +4 -3
- package/dist/widgets/input-number/input-number-util.typetest.d.ts +1 -0
- package/dist/widgets/numeric-input/numeric-input-util.d.ts +2 -10
- package/package.json +1 -1
- package/dist/widgets/input-number/to-numeric-input.d.ts +0 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const parseExpressionWidget: import("../parser-types").Parser<import("../..").WidgetOptions<"expression", import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
2
2
|
answerForms: {
|
|
3
3
|
value: string;
|
|
4
|
-
simplify: boolean;
|
|
5
4
|
form: boolean;
|
|
5
|
+
simplify: boolean;
|
|
6
6
|
considered: "correct" | "wrong" | "ungraded";
|
|
7
7
|
key?: string | undefined;
|
|
8
8
|
}[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { Parser } from "../parser-types";
|
|
2
|
-
export
|
|
1
|
+
import type { ParsedValue, Parser } from "../parser-types";
|
|
2
|
+
export type PerseusInputNumberWidgetOptionsV0 = ParsedValue<typeof parseInputNumberWidgetV0>["options"];
|
|
3
|
+
declare const parseInputNumberWidgetV0: Parser<import("../..").WidgetOptions<"input-number", import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
3
4
|
answerType: "number" | "integer" | "mixed" | "improper" | "decimal" | "percent" | "pi" | "rational" | undefined;
|
|
4
5
|
inexact: boolean | undefined;
|
|
5
6
|
maxError: string | number | undefined;
|
|
@@ -8,3 +9,19 @@ export declare const parseInputNumberWidget: Parser<import("../..").WidgetOption
|
|
|
8
9
|
size: "small" | "normal";
|
|
9
10
|
value: string | number;
|
|
10
11
|
}>>>;
|
|
12
|
+
export declare const parseInputNumberWidget: Parser<import("../..").WidgetOptions<"input-number", import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
13
|
+
size: string;
|
|
14
|
+
coefficient: boolean;
|
|
15
|
+
labelText: string | undefined;
|
|
16
|
+
textAlign: "left" | "right" | "center";
|
|
17
|
+
answers: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
18
|
+
value: number | null | undefined;
|
|
19
|
+
status: string;
|
|
20
|
+
message: string;
|
|
21
|
+
answerForms: ("integer" | "mixed" | "improper" | "proper" | "decimal" | "percent" | "pi")[] | undefined;
|
|
22
|
+
strict: boolean;
|
|
23
|
+
maxError: number | null | undefined;
|
|
24
|
+
simplify: "required" | "enforced" | "optional";
|
|
25
|
+
}>[];
|
|
26
|
+
}>>>;
|
|
27
|
+
export {};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
type CalculatorVariant = "scientific" | "graphing" | "four_function";
|
|
2
|
-
|
|
3
|
-
calculatorVariant: CalculatorVariant | null;
|
|
2
|
+
type ParsedAnswerArea = {
|
|
4
3
|
calculator: boolean;
|
|
4
|
+
calculatorVariant?: CalculatorVariant;
|
|
5
5
|
financialCalculatorMonthlyPayment: boolean;
|
|
6
6
|
financialCalculatorTotalAmount: boolean;
|
|
7
7
|
financialCalculatorTimeToPayOff: boolean;
|
|
8
8
|
periodicTable: boolean;
|
|
9
9
|
periodicTableWithKey: boolean;
|
|
10
|
-
}
|
|
10
|
+
};
|
|
11
|
+
export declare const parsePerseusAnswerArea: import("../parser-types").Parser<ParsedAnswerArea>;
|
|
11
12
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import type { InputNumberWidget, PerseusInputNumberWidgetOptions } from "../../data-schema";
|
|
2
|
-
export declare function generateInputNumberWidget(inputNumberWidgetProperties?: Partial<Omit<InputNumberWidget, "type">>): InputNumberWidget;
|
|
1
|
+
import type { InputNumberWidget, PerseusInputNumberWidgetOptions, PerseusInputNumberAnswer } from "../../data-schema";
|
|
2
|
+
export declare function generateInputNumberWidget(inputNumberWidgetProperties?: Partial<Omit<InputNumberWidget, "type" | "version">>): InputNumberWidget;
|
|
3
3
|
export declare function generateInputNumberOptions(options?: Partial<PerseusInputNumberWidgetOptions>): PerseusInputNumberWidgetOptions;
|
|
4
|
+
export declare function generateInputNumberAnswer(params?: Partial<PerseusInputNumberAnswer>): PerseusInputNumberAnswer;
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
* } & Perseus<Widget>ValidationData;
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
|
-
import type { GrapherAnswerTypes, PerseusDropdownChoice, PerseusExpressionAnswerForm, PerseusGradedGroupSetWidgetOptions, PerseusGradedGroupWidgetOptions, PerseusGraphType, PerseusGroupWidgetOptions, PerseusMatrixWidgetAnswers, PerseusNumericInputAnswer, PerseusOrdererWidgetOptions, PerseusRadioChoice, PerseusGraphCorrectType, MakeWidgetMap, PerseusFreeResponseWidgetScoringCriterion, PerseusRenderer
|
|
31
|
+
import type { GrapherAnswerTypes, PerseusDropdownChoice, PerseusExpressionAnswerForm, PerseusGradedGroupSetWidgetOptions, PerseusGradedGroupWidgetOptions, PerseusGraphType, PerseusGroupWidgetOptions, PerseusMatrixWidgetAnswers, PerseusNumericInputAnswer, PerseusOrdererWidgetOptions, PerseusRadioChoice, PerseusGraphCorrectType, MakeWidgetMap, PerseusFreeResponseWidgetScoringCriterion, PerseusRenderer } from "./data-schema";
|
|
32
32
|
import type { ErrorCode } from "./error-codes";
|
|
33
33
|
import type { Relationship } from "./types";
|
|
34
34
|
/**
|
|
@@ -480,7 +480,7 @@ export interface RubricRegistry {
|
|
|
480
480
|
"graded-group": PerseusGradedGroupRubric;
|
|
481
481
|
grapher: PerseusGrapherRubric;
|
|
482
482
|
group: PerseusGroupRubric;
|
|
483
|
-
"input-number":
|
|
483
|
+
"input-number": PerseusNumericInputRubric;
|
|
484
484
|
"interactive-graph": PerseusInteractiveGraphRubric;
|
|
485
485
|
"label-image": PerseusLabelImageRubric;
|
|
486
486
|
matcher: PerseusMatcherRubric;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { InputNumberPublicWidgetOptions } from "./input-number-util";
|
|
2
2
|
import type { PerseusInputNumberWidgetOptions } from "../../data-schema";
|
|
3
3
|
import type { WidgetLogic } from "../logic-export.types";
|
|
4
|
-
export type InputNumberDefaultWidgetOptions =
|
|
4
|
+
export type InputNumberDefaultWidgetOptions = PerseusInputNumberWidgetOptions;
|
|
5
5
|
declare const inputNumberWidgetLogic: WidgetLogic<PerseusInputNumberWidgetOptions, InputNumberPublicWidgetOptions>;
|
|
6
6
|
export default inputNumberWidgetLogic;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getNumericInputPublicWidgetOptions } from "../numeric-input/numeric-input-util";
|
|
2
|
+
import type { NumericInputPublicWidgetOptions } from "../numeric-input/numeric-input-util";
|
|
2
3
|
/**
|
|
3
4
|
* For details on the individual options, see the
|
|
4
5
|
* PerseusInputNumberWidgetOptions type
|
|
5
6
|
*/
|
|
6
|
-
export type InputNumberPublicWidgetOptions =
|
|
7
|
+
export type InputNumberPublicWidgetOptions = NumericInputPublicWidgetOptions;
|
|
7
8
|
/**
|
|
8
9
|
* Given a PerseusInputNumberWidgetOptions object, return a new object with only
|
|
9
10
|
* the public options that should be exposed to the client.
|
|
10
11
|
*/
|
|
11
|
-
export declare
|
|
12
|
+
export declare const getInputNumberPublicWidgetOptions: typeof getNumericInputPublicWidgetOptions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
type NumericInputAnswerPublicData = Pick<PerseusNumericInputAnswer, "answerForms" | "simplify" | "status">;
|
|
1
|
+
import type { PerseusNumericInputWidgetOptions } from "../../data-schema";
|
|
3
2
|
/**
|
|
4
3
|
* For details on the individual options, see the
|
|
5
4
|
* PerseusNumericInputWidgetOptions type
|
|
6
5
|
*/
|
|
7
|
-
export type NumericInputPublicWidgetOptions =
|
|
8
|
-
labelText?: PerseusNumericInputWidgetOptions["labelText"];
|
|
9
|
-
size: PerseusNumericInputWidgetOptions["size"];
|
|
10
|
-
coefficient: PerseusNumericInputWidgetOptions["coefficient"];
|
|
11
|
-
textAlign: PerseusNumericInputWidgetOptions["textAlign"];
|
|
12
|
-
answers: ReadonlyArray<NumericInputAnswerPublicData>;
|
|
13
|
-
};
|
|
6
|
+
export type NumericInputPublicWidgetOptions = PerseusNumericInputWidgetOptions;
|
|
14
7
|
/**
|
|
15
8
|
* Given a PerseusNumericInputWidgetOptions object, return a new object with only
|
|
16
9
|
* the public options that should be exposed to the client.
|
|
17
10
|
*/
|
|
18
11
|
export declare function getNumericInputPublicWidgetOptions(options: PerseusNumericInputWidgetOptions): NumericInputPublicWidgetOptions;
|
|
19
|
-
export {};
|
package/package.json
CHANGED