@khanacademy/perseus 67.1.2 → 68.0.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.
- package/dist/es/index.js +20 -18
- package/dist/es/index.js.map +1 -1
- package/dist/hint-renderer.d.ts +0 -4
- package/dist/hints-renderer.d.ts +0 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +19 -16
- package/dist/index.js.map +1 -1
- package/dist/mixins/widget-prop-denylist.d.ts +1 -1
- package/dist/renderer.d.ts +5 -16
- package/dist/server-item-renderer.d.ts +1 -5
- package/dist/types.d.ts +5 -11
- package/dist/user-input-manager.d.ts +1 -5
- package/dist/util/extract-widget-ids.d.ts +8 -0
- package/dist/widget-ai-utils/radio/radio-ai-utils.d.ts +1 -0
- package/dist/widgets/categorizer/categorizer.d.ts +2 -2
- package/dist/widgets/cs-program/cs-program.d.ts +1 -1
- package/dist/widgets/dropdown/dropdown.d.ts +2 -10
- package/dist/widgets/expression/expression.d.ts +4 -3
- package/dist/widgets/grapher/grapher.d.ts +3 -2
- package/dist/widgets/group/group.d.ts +0 -4
- package/dist/widgets/iframe/iframe.d.ts +1 -1
- package/dist/widgets/input-number/input-number.d.ts +2 -2
- package/dist/widgets/interactive-graphs/interactive-graph.d.ts +3 -2
- package/dist/widgets/label-image/label-image.d.ts +2 -2
- package/dist/widgets/matcher/matcher.d.ts +1 -1
- package/dist/widgets/matrix/matrix.d.ts +2 -2
- package/dist/widgets/mock-widgets/mock-widget.d.ts +3 -2
- package/dist/widgets/number-line/number-line.d.ts +2 -2
- package/dist/widgets/numeric-input/numeric-input.class.d.ts +3 -2
- package/dist/widgets/orderer/orderer.d.ts +2 -2
- package/dist/widgets/plotter/plotter.d.ts +3 -2
- package/dist/widgets/radio/multiple-choice-widget.new.d.ts +0 -4
- package/dist/widgets/radio/radio-component.d.ts +2 -4
- package/dist/widgets/radio/radio.d.ts +0 -4
- package/dist/widgets/radio/radio.ff.d.ts +7 -6
- package/dist/widgets/radio/util.d.ts +6 -3
- package/dist/widgets/radio/utils/general-utils.d.ts +2 -4
- package/dist/widgets/sorter/sorter.d.ts +2 -2
- package/dist/widgets/table/table.d.ts +2 -1
- package/package.json +7 -7
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type PerseusRadioUserInput, type PerseusRadioWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
|
+
import type { RadioChoiceWithMetadata } from "./multiple-choice-widget.new";
|
|
2
3
|
import type { PerseusStrings } from "../../strings";
|
|
3
|
-
import type { PerseusRadioUserInput } from "@khanacademy/perseus-core";
|
|
4
4
|
/**
|
|
5
5
|
* Given a choice's position in the radio widget, return the corresponding
|
|
6
6
|
* "choice letter". (For example, in English, `getChoiceLetter(0)` is "A",
|
|
7
7
|
* `getChoiceLetter(1)` is "B", etc.)
|
|
8
8
|
*/
|
|
9
9
|
export declare function getChoiceLetter(pos: number, strings: PerseusStrings): string;
|
|
10
|
-
export declare function getUserInputFromSerializedState(
|
|
10
|
+
export declare function getUserInputFromSerializedState(serializedState: any): PerseusRadioUserInput;
|
|
11
|
+
export declare function moveNoneOfTheAboveToEnd(choices: ReadonlyArray<RadioChoiceWithMetadata>): RadioChoiceWithMetadata[];
|
|
12
|
+
export declare function enforceOrdering(choices: ReadonlyArray<RadioChoiceWithMetadata>, strings: PerseusStrings): readonly RadioChoiceWithMetadata[];
|
|
13
|
+
export declare function choiceTransform(choices: PerseusRadioWidgetOptions["choices"], randomize: PerseusRadioWidgetOptions["randomize"], strings: PerseusStrings, seed: number): RadioChoiceWithMetadata[];
|
|
@@ -6,20 +6,18 @@ interface GetChoiceStatesProps {
|
|
|
6
6
|
isStatic?: boolean | null;
|
|
7
7
|
showSolutions?: ShowSolutions;
|
|
8
8
|
choiceStates?: ReadonlyArray<ChoiceState>;
|
|
9
|
-
values?: ReadonlyArray<boolean>;
|
|
10
9
|
}
|
|
11
10
|
/**
|
|
12
11
|
* Determine the updated choice states for the Radio widget, based on the
|
|
13
|
-
* widget's static / showSolutions states,
|
|
12
|
+
* widget's static / showSolutions states, and choiceStates.
|
|
14
13
|
*
|
|
15
14
|
* @param choices - The choices for the Radio widget.
|
|
16
15
|
* @param isStatic - Whether the widget is static.
|
|
17
16
|
* @param showSolutions - Whether the widget is in showSolutions mode.
|
|
18
17
|
* @param choiceStates - The choice states for the widget. (The user's current selection states.)
|
|
19
|
-
* @param values - The values for the widget. (Deprecated: The user's current selection states for old content.)
|
|
20
18
|
* @returns The updated choice states for the widget.
|
|
21
19
|
*/
|
|
22
|
-
export declare const getChoiceStates: ({ choices, isStatic, showSolutions, choiceStates,
|
|
20
|
+
export declare const getChoiceStates: ({ choices, isStatic, showSolutions, choiceStates, }: GetChoiceStatesProps) => ReadonlyArray<ChoiceState>;
|
|
23
21
|
/**
|
|
24
22
|
* Parse the nested widgets in the content of a Radio widget.
|
|
25
23
|
* Currently this only supports passage-ref widgets, but can
|
|
@@ -27,7 +27,7 @@ declare class Sorter extends React.Component<Props> implements Widget {
|
|
|
27
27
|
moveOptionToIndex: (option: SortableOption, index: number) => void;
|
|
28
28
|
/**
|
|
29
29
|
* @deprecated and likely very broken API
|
|
30
|
-
* [LEMS-3185] do not trust serializedState
|
|
30
|
+
* [LEMS-3185] do not trust serializedState
|
|
31
31
|
*/
|
|
32
32
|
getSerializedState(): any;
|
|
33
33
|
render(): React.ReactNode;
|
|
@@ -35,7 +35,7 @@ declare class Sorter extends React.Component<Props> implements Widget {
|
|
|
35
35
|
declare function getStartUserInput(options: SorterPublicWidgetOptions, problemNum: number): PerseusSorterUserInput;
|
|
36
36
|
/**
|
|
37
37
|
* @deprecated and likely a very broken API
|
|
38
|
-
* [LEMS-3185] do not trust serializedState
|
|
38
|
+
* [LEMS-3185] do not trust serializedState
|
|
39
39
|
*/
|
|
40
40
|
declare function getUserInputFromSerializedState(serializedState: any): PerseusSorterUserInput;
|
|
41
41
|
declare const _default: {
|
|
@@ -38,7 +38,7 @@ declare class Table extends React.Component<Props> implements Widget {
|
|
|
38
38
|
getInputPaths(): string[][];
|
|
39
39
|
/**
|
|
40
40
|
* @deprecated and likely very broken API
|
|
41
|
-
* [LEMS-3185] do not trust serializedState
|
|
41
|
+
* [LEMS-3185] do not trust serializedState
|
|
42
42
|
*/
|
|
43
43
|
getSerializedState(): {
|
|
44
44
|
answers: PerseusTableUserInput;
|
|
@@ -48,6 +48,7 @@ declare class Table extends React.Component<Props> implements Widget {
|
|
|
48
48
|
reviewModeRubric?: Empty | null | undefined;
|
|
49
49
|
trackInteraction: (extraData?: Empty | undefined) => void;
|
|
50
50
|
widgetId: string;
|
|
51
|
+
widgetIndex: number;
|
|
51
52
|
alignment: string | null | undefined;
|
|
52
53
|
static: boolean | null | undefined;
|
|
53
54
|
problemNum: number | null | undefined;
|
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": "
|
|
6
|
+
"version": "68.0.0",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"mafs": "0.19.0",
|
|
42
42
|
"tiny-invariant": "1.3.1",
|
|
43
43
|
"uuid": "^10.0.0",
|
|
44
|
-
"@khanacademy/keypad-context": "3.2.1",
|
|
45
44
|
"@khanacademy/kas": "2.1.0",
|
|
46
|
-
"@khanacademy/
|
|
47
|
-
"@khanacademy/
|
|
48
|
-
"@khanacademy/
|
|
49
|
-
"@khanacademy/perseus-
|
|
50
|
-
"@khanacademy/perseus-
|
|
45
|
+
"@khanacademy/keypad-context": "3.2.2",
|
|
46
|
+
"@khanacademy/kmath": "2.2.2",
|
|
47
|
+
"@khanacademy/math-input": "26.2.2",
|
|
48
|
+
"@khanacademy/perseus-core": "19.0.0",
|
|
49
|
+
"@khanacademy/perseus-linter": "4.3.2",
|
|
50
|
+
"@khanacademy/perseus-score": "7.7.2",
|
|
51
51
|
"@khanacademy/perseus-utils": "2.1.0",
|
|
52
52
|
"@khanacademy/pure-markdown": "2.2.0",
|
|
53
53
|
"@khanacademy/simple-markdown": "2.1.0"
|