@khanacademy/perseus 93.0.0 → 93.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/index.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +19 -12
- package/dist/index.js.map +1 -1
- package/dist/util/graphie-utils.d.ts +4 -2
- package/dist/util/{test-utils.d.ts → scoring.testutils.d.ts} +2 -1
- package/dist/widgets/interactive-graphs/graph.testutils.d.ts +2 -0
- package/dist/widgets/interactive-graphs/utils.d.ts +0 -2
- package/dist/widgets/radio/utils/string-utils.d.ts +0 -47
- package/package.json +8 -8
- package/dist/util/scoring.d.ts +0 -2
- package/dist/widgets/mock-widgets/index.d.ts +0 -1
- /package/dist/widgets/mock-widgets/{mock-asset-loading-widget.d.ts → mock-asset-loading-widget.testutils.d.ts} +0 -0
- /package/dist/widgets/table/{test-util.d.ts → table.testutils.d.ts} +0 -0
|
@@ -32,8 +32,10 @@ type CacheEntry = {
|
|
|
32
32
|
range: [Coord, Coord];
|
|
33
33
|
};
|
|
34
34
|
/**
|
|
35
|
-
* Reset the label data cache.
|
|
36
|
-
*
|
|
35
|
+
* Reset the label data cache.
|
|
36
|
+
*
|
|
37
|
+
* @internal
|
|
38
|
+
* This is used for testing to ensure a clean state between test cases.
|
|
37
39
|
*/
|
|
38
40
|
export declare function resetLabelDataCache(): void;
|
|
39
41
|
export declare function loadGraphie(url: string, onDataLoaded: (data: CacheEntry, localized: boolean) => void): void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { CategorizerWidget,
|
|
1
|
+
import type { CategorizerWidget, PerseusItem, PerseusRenderer, PerseusScore, PerseusWidgetTypes, UserInputMap } from "@khanacademy/perseus-core";
|
|
2
|
+
export declare function isCorrect(score: PerseusScore): boolean;
|
|
2
3
|
/**
|
|
3
4
|
* Thin wrapper around scorePerseusItem for internal testing. Returns the
|
|
4
5
|
* aggregate score; tests that need the per-widget breakdown should call
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { MafsGraphProps } from "./mafs-graph";
|
|
2
1
|
import type { InteractiveGraphState, UnlimitedGraphState } from "./types";
|
|
3
2
|
import type { Coord } from "../../interactive2/types";
|
|
4
3
|
import type { PerseusInteractiveGraphWidgetOptions } from "@khanacademy/perseus-core";
|
|
@@ -37,7 +36,6 @@ export declare const mathOnlyParser: import("@khanacademy/simple-markdown").Pars
|
|
|
37
36
|
* and the text outside of the $ blocks will be non-TeX text.
|
|
38
37
|
*/
|
|
39
38
|
export declare function replaceOutsideTeX(mathString: string): string;
|
|
40
|
-
export declare function getBaseMafsGraphPropsForTests(): MafsGraphProps;
|
|
41
39
|
export declare const calculateNestedSVGCoords: (range: vec.Vector2[], width: number, height: number) => {
|
|
42
40
|
viewboxX: number;
|
|
43
41
|
viewboxY: number;
|
|
@@ -1,30 +1,4 @@
|
|
|
1
1
|
import type { PerseusStrings } from "../../../strings";
|
|
2
|
-
/**
|
|
3
|
-
* Given a choice's position in the radio widget, return the corresponding
|
|
4
|
-
* "choice letter". (For example, `getChoiceLetter(0)` is "A",
|
|
5
|
-
* `getChoiceLetter(1)` is "B", etc.)
|
|
6
|
-
*
|
|
7
|
-
* All locales use English letters for the choice letters.
|
|
8
|
-
*
|
|
9
|
-
* @param pos - The position of the choice in the radio widget.
|
|
10
|
-
* @param strings - The strings for the Radio widget.
|
|
11
|
-
* @returns The choice letter for the given position.
|
|
12
|
-
*/
|
|
13
|
-
export declare const getChoiceLetter: (pos: number, strings: PerseusStrings) => string;
|
|
14
|
-
interface GetOptionStatusTextProps {
|
|
15
|
-
checked: boolean;
|
|
16
|
-
correct: boolean;
|
|
17
|
-
strings: PerseusStrings;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Get the correct (translated) string for an option status (correct, incorrect, selected, etc.)
|
|
21
|
-
*
|
|
22
|
-
* @param checked - Whether the option is checked.
|
|
23
|
-
* @param correct - Whether the option is correct.
|
|
24
|
-
* @param strings - The strings for the Radio widget.
|
|
25
|
-
* @returns The appropriate string for the option status.
|
|
26
|
-
*/
|
|
27
|
-
export declare const getOptionStatusText: ({ checked, correct, strings, }: GetOptionStatusTextProps) => string;
|
|
28
2
|
interface GetInstructionsTextProps {
|
|
29
3
|
multipleSelect: boolean;
|
|
30
4
|
countChoices: boolean | null | undefined;
|
|
@@ -44,25 +18,4 @@ interface GetInstructionsTextProps {
|
|
|
44
18
|
* @returns The instructions string for the widget.
|
|
45
19
|
*/
|
|
46
20
|
export declare const getInstructionsText: ({ multipleSelect, countChoices, numCorrect, strings, }: GetInstructionsTextProps) => string;
|
|
47
|
-
interface GetA11yTextProps {
|
|
48
|
-
letter: string;
|
|
49
|
-
checked: boolean;
|
|
50
|
-
correct: boolean;
|
|
51
|
-
showCorrectness: boolean;
|
|
52
|
-
strings: PerseusStrings;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Get the (translated) a11y string for a Radio widget.
|
|
56
|
-
*
|
|
57
|
-
* This string is provided to screen readers to help the user
|
|
58
|
-
* understand the current state of a Radio option.
|
|
59
|
-
*
|
|
60
|
-
* @param letter - The letter for the choice.
|
|
61
|
-
* @param checked - Whether the choice is checked.
|
|
62
|
-
* @param correct - Whether the choice is correct.
|
|
63
|
-
* @param showCorrectness - Whether the correctness is shown.
|
|
64
|
-
* @param strings - The strings for the Radio widget.
|
|
65
|
-
* @returns The a11y string for the Radio option.
|
|
66
|
-
*/
|
|
67
|
-
export declare const getA11yText: ({ letter, checked, correct, showCorrectness, strings, }: GetA11yTextProps) => string;
|
|
68
21
|
export {};
|
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": "93.0.
|
|
6
|
+
"version": "93.0.1",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@dnd-kit/dom": "^0.5.0",
|
|
29
29
|
"@dnd-kit/react": "^0.5.0",
|
|
30
|
-
"@khanacademy/kas": "3.1.
|
|
31
|
-
"@khanacademy/keypad-context": "6.0.
|
|
32
|
-
"@khanacademy/kmath": "3.1.
|
|
33
|
-
"@khanacademy/math-input": "30.
|
|
34
|
-
"@khanacademy/perseus-core": "42.0
|
|
35
|
-
"@khanacademy/perseus-linter": "7.0.
|
|
36
|
-
"@khanacademy/perseus-score": "9.0.
|
|
30
|
+
"@khanacademy/kas": "3.1.1",
|
|
31
|
+
"@khanacademy/keypad-context": "6.0.10",
|
|
32
|
+
"@khanacademy/kmath": "3.1.3",
|
|
33
|
+
"@khanacademy/math-input": "30.2.0",
|
|
34
|
+
"@khanacademy/perseus-core": "42.1.0",
|
|
35
|
+
"@khanacademy/perseus-linter": "7.0.1",
|
|
36
|
+
"@khanacademy/perseus-score": "9.0.11",
|
|
37
37
|
"@khanacademy/perseus-utils": "3.0.2",
|
|
38
38
|
"@khanacademy/pure-markdown": "3.1.1",
|
|
39
39
|
"@khanacademy/simple-markdown": "4.0.2",
|
package/dist/util/scoring.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as MockWidget } from "./mock-widget";
|
|
File without changes
|
|
File without changes
|