@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.
- package/dist/data-schema.d.ts +15 -8
- package/dist/index.d.ts +3 -2
- package/dist/index.js +327 -302
- package/dist/index.js.map +1 -1
- package/dist/parse-perseus-json/perseus-parsers/answer-tile.d.ts +10 -8
- package/dist/parse-perseus-json/perseus-parsers/fill-in-the-blank-widget.d.ts +1 -1
- package/dist/parse-perseus-json/perseus-parsers/number-line-widget.d.ts +3 -3
- package/dist/utils/generators/fill-in-the-blank-widget-generator.d.ts +2 -1
- package/dist/utils/generators/sorter-widget-generator.d.ts +2 -1
- package/dist/utils/is-correct.d.ts +5 -0
- package/package.json +1 -1
- package/dist/parse-perseus-json/general-purpose-parsers/parser.testutils.d.ts +0 -14
- package/dist/utils/range.testutils.d.ts +0 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* widget family, like `PerseusAnswerTile`.
|
|
2
|
+
* The fields of one tile in a Drag And Drop widget's choice bank. Shared
|
|
3
|
+
* across the widget family, like `PerseusAnswerTile`. A widget builds its
|
|
4
|
+
* tile parser with `object({...answerTileSchema, ...})`, adding any fields
|
|
5
|
+
* of its own, rather than restating these.
|
|
4
6
|
*/
|
|
5
|
-
export declare const
|
|
6
|
-
id: string
|
|
7
|
-
content: string
|
|
8
|
-
label: string
|
|
9
|
-
imageHeight: number | undefined
|
|
10
|
-
}
|
|
7
|
+
export declare const answerTileSchema: {
|
|
8
|
+
id: import("../parser-types").Parser<string>;
|
|
9
|
+
content: import("../parser-types").Parser<string>;
|
|
10
|
+
label: import("../parser-types").Parser<string>;
|
|
11
|
+
imageHeight: import("../parser-types").Parser<number | undefined>;
|
|
12
|
+
};
|
|
@@ -8,12 +8,12 @@ export declare const parseFillInTheBlankWidget: Parser<import("../general-purpos
|
|
|
8
8
|
content: string;
|
|
9
9
|
widgets: import("../..").MakeWidgetMap<import("../..").PerseusWidgetTypes>;
|
|
10
10
|
tiles: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
11
|
+
maxUses: number | "unlimited";
|
|
11
12
|
id: string;
|
|
12
13
|
content: string;
|
|
13
14
|
label: string;
|
|
14
15
|
imageHeight: number | undefined;
|
|
15
16
|
}>[];
|
|
16
|
-
maxUsesPerTile: number | "unlimited";
|
|
17
17
|
randomize: boolean;
|
|
18
18
|
}>;
|
|
19
19
|
key: number | null | undefined;
|
|
@@ -4,13 +4,13 @@ export declare const parseNumberLineWidget: import("../parser-types").Parser<imp
|
|
|
4
4
|
graded: boolean | undefined;
|
|
5
5
|
alignment: "default" | "block" | "inline-block" | "inline" | "wrap-left" | "wrap-right" | "full-width" | undefined;
|
|
6
6
|
options: import("../general-purpose-parsers/object-types").OptionalizeProperties<{
|
|
7
|
-
range: number
|
|
8
|
-
labelRange:
|
|
7
|
+
range: [number, number];
|
|
8
|
+
labelRange: [number | null, number | null];
|
|
9
9
|
labelStyle: "mixed" | "improper" | "decimal" | "non-reduced";
|
|
10
10
|
labelTicks: boolean;
|
|
11
11
|
isTickCtrl: boolean;
|
|
12
12
|
isInequality: boolean;
|
|
13
|
-
divisionRange: number
|
|
13
|
+
divisionRange: [number, number];
|
|
14
14
|
numDivisions: number | null | undefined;
|
|
15
15
|
snapDivisions: number;
|
|
16
16
|
tickStep: number | null | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { FillInTheBlankWidget, PerseusAnswerTile, PerseusFillInTheBlankWidgetOptions } from "../../data-schema";
|
|
1
|
+
import type { FillInTheBlankWidget, PerseusAnswerTile, PerseusFillInTheBlankTile, PerseusFillInTheBlankWidgetOptions } from "../../data-schema";
|
|
2
2
|
export declare function generateAnswerTile(tile?: Partial<PerseusAnswerTile>): PerseusAnswerTile;
|
|
3
|
+
export declare function generateFillInTheBlankTile(tile?: Partial<PerseusFillInTheBlankTile>): PerseusFillInTheBlankTile;
|
|
3
4
|
export declare function generateFillInTheBlankOptions(options?: Partial<PerseusFillInTheBlankWidgetOptions>): PerseusFillInTheBlankWidgetOptions;
|
|
4
5
|
export declare function generateFillInTheBlankWidget(fillInTheBlankWidgetProperties?: Partial<Omit<FillInTheBlankWidget, "type">>): FillInTheBlankWidget;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import type { PerseusSorterWidgetOptions, SorterWidget } from "../../data-schema";
|
|
1
|
+
import type { PerseusSorterWidgetOptions, SorterLegend, SorterWidget } from "../../data-schema";
|
|
2
2
|
export declare function generateSorterOptions(options?: Partial<PerseusSorterWidgetOptions>): PerseusSorterWidgetOptions;
|
|
3
|
+
export declare function generateSorterLegend(options?: Partial<SorterLegend>): SorterLegend;
|
|
3
4
|
export declare function generateSorterWidget(sorterWidgetProperties?: Partial<Omit<SorterWidget, "type">>): SorterWidget;
|
package/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ErrorTrackingParseContext } from "../error-tracking-parse-context";
|
|
2
|
-
import type { Mismatch } from "../parser-types";
|
|
3
|
-
import type { Failure } from "../result";
|
|
4
|
-
export declare function ctx(): ErrorTrackingParseContext;
|
|
5
|
-
export declare const anyFailure: Failure<any>;
|
|
6
|
-
export declare const anySuccess: import("../result").Success<any>;
|
|
7
|
-
export declare function parseFailureWith(expected: Partial<Mismatch>): Failure<Mismatch[]>;
|
|
8
|
-
/**
|
|
9
|
-
* Summons a value of type T out of thin air!
|
|
10
|
-
*
|
|
11
|
-
* (Terms and conditions apply. Value will not actually be returned.
|
|
12
|
-
* For use in typetests only.)
|
|
13
|
-
*/
|
|
14
|
-
export declare function summon<T>(): T;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function range(min: number, max: number): number[];
|