@khanacademy/perseus 67.0.0 → 67.1.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/components/scrollable-view.d.ts +12 -3
- package/dist/es/index.css +6 -6
- package/dist/es/index.css.map +1 -1
- package/dist/es/index.js +15 -13
- package/dist/es/index.js.map +1 -1
- package/dist/index.css +6 -6
- package/dist/index.css.map +1 -1
- package/dist/index.js +15 -13
- package/dist/index.js.map +1 -1
- package/dist/widget-ai-utils/image/image-ai-utils.d.ts +1 -1
- package/dist/widget-ai-utils/radio/radio-ai-utils.d.ts +1 -1
- package/dist/widgets/image/image.class.d.ts +43 -0
- package/dist/widgets/image/image.d.ts +2 -42
- package/dist/widgets/image/index.d.ts +1 -1
- package/dist/widgets/number-line/number-line.d.ts +21 -81
- package/dist/widgets/radio/base-radio.d.ts +1 -3
- package/dist/widgets/radio/multiple-choice-component.new.d.ts +1 -1
- package/dist/widgets/radio/multiple-choice-widget.new.d.ts +2 -79
- package/dist/widgets/radio/radio-component.d.ts +1 -3
- package/dist/widgets/radio/radio.d.ts +2 -2
- package/package.json +47 -47
|
@@ -10,7 +10,7 @@ export type RadioPromptJSON = {
|
|
|
10
10
|
hasNoneOfTheAbove: boolean;
|
|
11
11
|
options: BasicOption[];
|
|
12
12
|
userInput: {
|
|
13
|
-
selectedOptions: ReadonlyArray<
|
|
13
|
+
selectedOptions: ReadonlyArray<string>;
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
16
|
export declare const getPromptJSON: (renderProps: RecursiveReadonly<React.ComponentProps<typeof radio.widget>>, userInput: RecursiveReadonly<PerseusRadioUserInput>) => RadioPromptJSON;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
3
|
+
import type { WidgetProps, Widget } from "../../types";
|
|
4
|
+
import type { ImagePromptJSON } from "../../widget-ai-utils/image/image-ai-utils";
|
|
5
|
+
import type { PerseusImageWidgetOptions } from "@khanacademy/perseus-core";
|
|
6
|
+
type ExternalProps = WidgetProps<PerseusImageWidgetOptions>;
|
|
7
|
+
export interface Props extends ExternalProps {
|
|
8
|
+
alignment: NonNullable<ExternalProps["alignment"]>;
|
|
9
|
+
title: NonNullable<ExternalProps["title"]>;
|
|
10
|
+
range: NonNullable<ExternalProps["range"]>;
|
|
11
|
+
box: NonNullable<ExternalProps["box"]>;
|
|
12
|
+
backgroundImage: NonNullable<ExternalProps["backgroundImage"]>;
|
|
13
|
+
labels: NonNullable<ExternalProps["labels"]>;
|
|
14
|
+
alt: NonNullable<ExternalProps["alt"]>;
|
|
15
|
+
caption: NonNullable<ExternalProps["caption"]>;
|
|
16
|
+
linterContext: NonNullable<ExternalProps["linterContext"]>;
|
|
17
|
+
}
|
|
18
|
+
interface DefaultProps extends Partial<Props> {
|
|
19
|
+
alignment: Props["alignment"];
|
|
20
|
+
title: Props["title"];
|
|
21
|
+
range: Props["range"];
|
|
22
|
+
box: Props["box"];
|
|
23
|
+
backgroundImage: Props["backgroundImage"];
|
|
24
|
+
labels: Props["labels"];
|
|
25
|
+
alt: Props["alt"];
|
|
26
|
+
caption: Props["caption"];
|
|
27
|
+
linterContext: Props["linterContext"];
|
|
28
|
+
}
|
|
29
|
+
declare class ImageWidget extends React.Component<Props> implements Widget {
|
|
30
|
+
static contextType: React.Context<import("../../components/i18n-context").I18nContextType>;
|
|
31
|
+
context: React.ContextType<typeof PerseusI18nContext>;
|
|
32
|
+
static defaultProps: DefaultProps;
|
|
33
|
+
isWidget: true;
|
|
34
|
+
getPromptJSON(): ImagePromptJSON;
|
|
35
|
+
render(): React.ReactNode;
|
|
36
|
+
}
|
|
37
|
+
declare const _default: {
|
|
38
|
+
name: string;
|
|
39
|
+
displayName: string;
|
|
40
|
+
widget: typeof ImageWidget;
|
|
41
|
+
isLintable: true;
|
|
42
|
+
};
|
|
43
|
+
export default _default;
|
|
@@ -1,43 +1,3 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import type { ImagePromptJSON } from "../../widget-ai-utils/image/image-ai-utils";
|
|
5
|
-
import type { PerseusImageWidgetOptions } from "@khanacademy/perseus-core";
|
|
6
|
-
type ExternalProps = WidgetProps<PerseusImageWidgetOptions>;
|
|
7
|
-
type Props = ExternalProps & {
|
|
8
|
-
alignment: NonNullable<ExternalProps["alignment"]>;
|
|
9
|
-
title: NonNullable<ExternalProps["title"]>;
|
|
10
|
-
range: NonNullable<ExternalProps["range"]>;
|
|
11
|
-
box: NonNullable<ExternalProps["box"]>;
|
|
12
|
-
backgroundImage: NonNullable<ExternalProps["backgroundImage"]>;
|
|
13
|
-
labels: NonNullable<ExternalProps["labels"]>;
|
|
14
|
-
alt: NonNullable<ExternalProps["alt"]>;
|
|
15
|
-
caption: NonNullable<ExternalProps["caption"]>;
|
|
16
|
-
linterContext: NonNullable<ExternalProps["linterContext"]>;
|
|
17
|
-
};
|
|
18
|
-
type DefaultProps = {
|
|
19
|
-
alignment: Props["alignment"];
|
|
20
|
-
title: Props["title"];
|
|
21
|
-
range: Props["range"];
|
|
22
|
-
box: Props["box"];
|
|
23
|
-
backgroundImage: Props["backgroundImage"];
|
|
24
|
-
labels: Props["labels"];
|
|
25
|
-
alt: Props["alt"];
|
|
26
|
-
caption: Props["caption"];
|
|
27
|
-
linterContext: Props["linterContext"];
|
|
28
|
-
};
|
|
29
|
-
declare class ImageWidget extends React.Component<Props> implements Widget {
|
|
30
|
-
static contextType: React.Context<import("../../components/i18n-context").I18nContextType>;
|
|
31
|
-
context: React.ContextType<typeof PerseusI18nContext>;
|
|
32
|
-
static defaultProps: DefaultProps;
|
|
33
|
-
isWidget: true;
|
|
34
|
-
getPromptJSON(): ImagePromptJSON;
|
|
35
|
-
render(): React.ReactNode;
|
|
36
|
-
}
|
|
37
|
-
declare const _default: {
|
|
38
|
-
name: string;
|
|
39
|
-
displayName: string;
|
|
40
|
-
widget: typeof ImageWidget;
|
|
41
|
-
isLintable: true;
|
|
42
|
-
};
|
|
43
|
-
export default _default;
|
|
2
|
+
import type { Props } from "./image.class";
|
|
3
|
+
export declare const ImageComponent: ({ apiOptions, alt, backgroundImage, box, caption, linterContext, labels, range, title, trackInteraction, }: Props) => React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from "./image";
|
|
1
|
+
export { default } from "./image.class";
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
3
|
-
import type { FocusPath, Widget, WidgetProps
|
|
3
|
+
import type { FocusPath, Widget, WidgetProps } from "../../types";
|
|
4
4
|
import type { NumberLinePromptJSON } from "../../widget-ai-utils/number-line/number-line-ai-utils";
|
|
5
5
|
import type { PerseusNumberLineUserInput, PerseusNumberLineWidgetOptions, NumberLinePublicWidgetOptions } from "@khanacademy/perseus-core";
|
|
6
|
-
import type { PropsFor } from "@khanacademy/wonder-blocks-core";
|
|
7
6
|
/**
|
|
8
7
|
* The type of `this.props` inside the NumberLine widget.
|
|
9
8
|
*/
|
|
@@ -33,10 +32,6 @@ type DefaultProps = {
|
|
|
33
32
|
showTooltips: Props["showTooltips"];
|
|
34
33
|
apiOptions: Props["apiOptions"];
|
|
35
34
|
};
|
|
36
|
-
/**
|
|
37
|
-
* The props returned by the `transform` and `staticTransform` functions.
|
|
38
|
-
*/
|
|
39
|
-
type RenderProps = Omit<PropsFor<typeof NumberLine>, keyof UniversalWidgetProps>;
|
|
40
35
|
type State = {
|
|
41
36
|
numDivisionsEmpty: boolean;
|
|
42
37
|
};
|
|
@@ -45,6 +40,18 @@ declare class NumberLine extends React.Component<Props, State> implements Widget
|
|
|
45
40
|
context: React.ContextType<typeof PerseusI18nContext>;
|
|
46
41
|
static defaultProps: DefaultProps;
|
|
47
42
|
state: any;
|
|
43
|
+
/**
|
|
44
|
+
* isTickCtrl seems like it can be null
|
|
45
|
+
* but default props only work with undefined,
|
|
46
|
+
* so this handles both null/undefined
|
|
47
|
+
*/
|
|
48
|
+
getIsTickCtrl(): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* snapDivisions seems like it can be null
|
|
51
|
+
* but default props only work with undefined,
|
|
52
|
+
* so this handles both null/undefined
|
|
53
|
+
*/
|
|
54
|
+
getSnapDivisions(): number;
|
|
48
55
|
isValid: () => boolean;
|
|
49
56
|
onNumDivisionsChange: (arg1: number, arg2: any) => void;
|
|
50
57
|
_handleTickCtrlFocus: () => void;
|
|
@@ -69,88 +76,23 @@ declare class NumberLine extends React.Component<Props, State> implements Widget
|
|
|
69
76
|
* [LEMS-3185] do not trust serializedState/restoreSerializedState
|
|
70
77
|
*/
|
|
71
78
|
getSerializedState(): {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
rel: string;
|
|
79
|
+
alignment: string | null | undefined;
|
|
80
|
+
static: boolean | null | undefined;
|
|
75
81
|
range: number[];
|
|
76
|
-
labelRange:
|
|
82
|
+
labelRange: (number | null)[];
|
|
77
83
|
labelStyle: string;
|
|
78
84
|
labelTicks: boolean;
|
|
79
85
|
divisionRange: number[];
|
|
80
86
|
snapDivisions: number;
|
|
81
|
-
isTickCtrl: boolean;
|
|
82
87
|
isInequality: boolean;
|
|
83
|
-
showTooltips
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
static: boolean | null | undefined;
|
|
89
|
-
problemNum: number | null | undefined;
|
|
90
|
-
apiOptions: Readonly<Readonly<{
|
|
91
|
-
isArticle?: boolean;
|
|
92
|
-
onFocusChange?: (newFocusPath: FocusPath, oldFocusPath: FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
|
|
93
|
-
GroupMetadataEditor?: React.ComponentType<any>;
|
|
94
|
-
showAlignmentOptions?: boolean;
|
|
95
|
-
readOnly?: boolean;
|
|
96
|
-
answerableCallback?: (arg1: boolean) => unknown;
|
|
97
|
-
getAnotherHint?: () => unknown;
|
|
98
|
-
interactionCallback?: (widgetData: {
|
|
99
|
-
[widgetId: string]: any;
|
|
100
|
-
}) => void;
|
|
101
|
-
groupAnnotator?: (groupNumber: number, widgetId: string) => React.ReactNode;
|
|
102
|
-
imagePlaceholder?: React.ReactNode;
|
|
103
|
-
widgetPlaceholder?: React.ReactNode;
|
|
104
|
-
baseElements?: {
|
|
105
|
-
Link: React.ComponentType<any>;
|
|
106
|
-
};
|
|
107
|
-
imagePreloader?: (dimensions: import("../../types").Dimensions) => React.ReactNode;
|
|
108
|
-
trackInteraction?: (args: {
|
|
109
|
-
type: string;
|
|
110
|
-
id: string;
|
|
111
|
-
correct?: boolean;
|
|
112
|
-
} & Partial<import("../../types").TrackingGradedGroupExtraArguments> & Partial<{
|
|
113
|
-
visible: number;
|
|
114
|
-
}>) => void;
|
|
115
|
-
customKeypad?: boolean;
|
|
116
|
-
nativeKeypadProxy?: (blur: () => void) => import("@khanacademy/math-input").KeypadAPI;
|
|
117
|
-
isMobile?: boolean;
|
|
118
|
-
isMobileApp?: boolean;
|
|
119
|
-
setDrawingAreaAvailable?: (arg1: boolean) => unknown;
|
|
120
|
-
hintProgressColor?: string;
|
|
121
|
-
canScrollPage?: boolean;
|
|
122
|
-
editorChangeDelay?: number;
|
|
123
|
-
flags?: Record<"new-radio-widget", boolean>;
|
|
124
|
-
}> & {
|
|
125
|
-
baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
|
|
126
|
-
canScrollPage: NonNullable<import("../..").APIOptions["canScrollPage"]>;
|
|
127
|
-
editorChangeDelay: NonNullable<import("../..").APIOptions["editorChangeDelay"]>;
|
|
128
|
-
groupAnnotator: NonNullable<import("../..").APIOptions["groupAnnotator"]>;
|
|
129
|
-
isArticle: NonNullable<import("../..").APIOptions["isArticle"]>;
|
|
130
|
-
isMobile: NonNullable<import("../..").APIOptions["isMobile"]>;
|
|
131
|
-
isMobileApp: NonNullable<import("../..").APIOptions["isMobileApp"]>;
|
|
132
|
-
onFocusChange: NonNullable<import("../..").APIOptions["onFocusChange"]>;
|
|
133
|
-
readOnly: NonNullable<import("../..").APIOptions["readOnly"]>;
|
|
134
|
-
setDrawingAreaAvailable: NonNullable<import("../..").APIOptions["setDrawingAreaAvailable"]>;
|
|
135
|
-
showAlignmentOptions: NonNullable<import("../..").APIOptions["showAlignmentOptions"]>;
|
|
136
|
-
}>;
|
|
137
|
-
keypadElement?: any;
|
|
138
|
-
questionCompleted?: boolean;
|
|
139
|
-
onFocus: (blurPath: FocusPath) => void;
|
|
140
|
-
onBlur: (blurPath: FocusPath) => void;
|
|
141
|
-
findWidgets: (criterion: import("../../types").FilterCriterion) => ReadonlyArray<Widget>;
|
|
142
|
-
reviewMode: boolean;
|
|
143
|
-
showSolutions?: import("@khanacademy/perseus-core").ShowSolutions;
|
|
144
|
-
onChange: import("../..").ChangeHandler;
|
|
145
|
-
handleUserInput: (newUserInput: PerseusNumberLineUserInput, cb?: () => void, silent?: boolean) => void;
|
|
146
|
-
isLastUsedWidget: boolean;
|
|
147
|
-
linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
|
|
148
|
-
containerSizeClass: import("../../util/sizing-utils").SizeClass;
|
|
88
|
+
showTooltips: boolean | undefined;
|
|
89
|
+
isTickCtrl: boolean;
|
|
90
|
+
numDivisions: number;
|
|
91
|
+
numLinePosition: number;
|
|
92
|
+
rel: string;
|
|
149
93
|
};
|
|
150
94
|
render(): React.ReactNode;
|
|
151
95
|
}
|
|
152
|
-
declare function transform(editorProps: NumberLinePublicWidgetOptions): RenderProps;
|
|
153
|
-
declare function staticTransform(editorProps: PerseusNumberLineWidgetOptions): RenderProps;
|
|
154
96
|
/**
|
|
155
97
|
* @deprecated and likely a very broken API
|
|
156
98
|
* [LEMS-3185] do not trust serializedState/restoreSerializedState
|
|
@@ -162,8 +104,6 @@ declare const _default: {
|
|
|
162
104
|
name: string;
|
|
163
105
|
displayName: string;
|
|
164
106
|
widget: typeof NumberLine;
|
|
165
|
-
transform: typeof transform;
|
|
166
|
-
staticTransform: typeof staticTransform;
|
|
167
107
|
getCorrectUserInput: typeof getCorrectUserInput;
|
|
168
108
|
getStartUserInput: typeof getStartUserInput;
|
|
169
109
|
getUserInputFromSerializedState: typeof getUserInputFromSerializedState;
|
|
@@ -28,9 +28,7 @@ type Props = {
|
|
|
28
28
|
multipleSelect?: boolean;
|
|
29
29
|
reviewModeRubric?: PerseusRadioWidgetOptions | null;
|
|
30
30
|
reviewMode: boolean;
|
|
31
|
-
onChange: (
|
|
32
|
-
checked: ReadonlyArray<boolean>;
|
|
33
|
-
}) => void;
|
|
31
|
+
onChange: (checkedChoiceIds: ReadonlyArray<string>) => void;
|
|
34
32
|
registerFocusFunction?: (arg1: FocusFunction) => void;
|
|
35
33
|
isLastUsedWidget?: boolean;
|
|
36
34
|
};
|
|
@@ -8,7 +8,7 @@ export interface MultipleChoiceComponentProps {
|
|
|
8
8
|
countChoices: boolean | null | undefined;
|
|
9
9
|
multipleSelect?: boolean;
|
|
10
10
|
numCorrect: number;
|
|
11
|
-
onChoiceChange: (
|
|
11
|
+
onChoiceChange: (choiceId: string, newCheckedState: boolean) => void;
|
|
12
12
|
reviewMode: boolean;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { PerseusStrings } from "../../strings";
|
|
3
|
-
import type {
|
|
4
|
-
import type { RadioPromptJSON } from "../../widget-ai-utils/radio/radio-ai-utils";
|
|
3
|
+
import type { ChoiceState, Widget } from "../../types";
|
|
5
4
|
import type { PerseusRadioChoice, PerseusRadioRubric, PerseusRadioUserInput } from "@khanacademy/perseus-core";
|
|
6
5
|
/**
|
|
7
6
|
* Represents a single choice in the MultipleChoiceComponent
|
|
@@ -41,81 +40,5 @@ export interface RadioChoiceWithMetadata extends PerseusRadioChoice {
|
|
|
41
40
|
originalIndex: number;
|
|
42
41
|
correct?: boolean;
|
|
43
42
|
}
|
|
44
|
-
|
|
45
|
-
type DefaultProps = Required<Pick<Props, "choices" | "multipleSelect" | "countChoices" | "deselectEnabled" | "linterContext" | "showSolutions">>;
|
|
46
|
-
/**
|
|
47
|
-
* MultipleChoiceWidget implements the Widget interface for multiple choice questions.
|
|
48
|
-
*
|
|
49
|
-
* It handles Perseus-specific logic and state management while delegating
|
|
50
|
-
* UI rendering to the MultipleChoiceComponent.
|
|
51
|
-
*
|
|
52
|
-
* This class is exported as "Radio" for backwards compatibility with existing content,
|
|
53
|
-
* though it supports both radio-button (single select) and checkbox (multiple select) modes.
|
|
54
|
-
* Eventually, when Content Backfills are set up, we will officially rename the Radio Widget to MultipleChoiceWidget.
|
|
55
|
-
*
|
|
56
|
-
* Created as part of the Radio Revitalization Project (LEMS-2933).
|
|
57
|
-
*/
|
|
58
|
-
declare class MultipleChoiceWidget extends React.Component<Props> implements Widget {
|
|
59
|
-
static defaultProps: DefaultProps;
|
|
60
|
-
/**
|
|
61
|
-
* Gets the JSON representation of the User Input for AI assistance.
|
|
62
|
-
*
|
|
63
|
-
* This method is used to provide structured data about the widget's state
|
|
64
|
-
* to AI systems that can help users with answering questions.
|
|
65
|
-
*
|
|
66
|
-
* @returns A structured JSON object representing the widget's prompt
|
|
67
|
-
*/
|
|
68
|
-
getPromptJSON(): RadioPromptJSON;
|
|
69
|
-
/**
|
|
70
|
-
* Renders content that may contain nested widgets (currently only passage-refs).
|
|
71
|
-
* Parses the content, extracts any widgets, and returns a Renderer component
|
|
72
|
-
* configured with the appropriate context.
|
|
73
|
-
*
|
|
74
|
-
* @param content - The content to render (defaults to empty string)
|
|
75
|
-
* @returns A React element with the rendered content
|
|
76
|
-
*/
|
|
77
|
-
renderContent: (content?: string) => React.ReactNode;
|
|
78
|
-
/**
|
|
79
|
-
* Handles a user's selection of a choice.
|
|
80
|
-
*
|
|
81
|
-
* Updates choice states based on the selection, handles single/multiple
|
|
82
|
-
* selection logic, and notifies Perseus of the interaction.
|
|
83
|
-
*
|
|
84
|
-
* @param choiceIndex - The index of the choice that changed
|
|
85
|
-
* @param newCheckedState - Whether the choice is now selected
|
|
86
|
-
*/
|
|
87
|
-
handleChoiceChange: (choiceIndex: number, newCheckedState: boolean) => void;
|
|
88
|
-
/**
|
|
89
|
-
* Transforms choice states into component-ready props for the MultipleChoiceComponent.
|
|
90
|
-
*
|
|
91
|
-
* This method:
|
|
92
|
-
* 1. Processes each choice's content
|
|
93
|
-
* 2. Maps state properties (selected, rationaleShown, etc.) to component props
|
|
94
|
-
* 3. Renders content and rationales with nested widget support
|
|
95
|
-
* 4. Determines correctness display based on choice data or review rubric
|
|
96
|
-
*
|
|
97
|
-
* @param choiceStates - The current state of each choice
|
|
98
|
-
* @returns An array of formatted choice props ready for the MultipleChoiceComponent
|
|
99
|
-
*/
|
|
100
|
-
buildChoiceProps: (choiceStates: ReadonlyArray<ChoiceState>) => ReadonlyArray<ChoiceType>;
|
|
101
|
-
/**
|
|
102
|
-
* Prepares the choice props for rendering in the MultipleChoiceComponent.
|
|
103
|
-
*
|
|
104
|
-
* This method:
|
|
105
|
-
* 1. Uses getChoiceStates() to determine the appropriate state for each choice
|
|
106
|
-
* based on widget mode (review/static) and user selections
|
|
107
|
-
* 2. Transforms these states into component props via buildChoiceProps(),
|
|
108
|
-
* including rendered content, correctness indicators, and rationales
|
|
109
|
-
*
|
|
110
|
-
* @returns An array of choice props ready for the component
|
|
111
|
-
*/
|
|
112
|
-
prepareChoicesProps: () => readonly ChoiceType[];
|
|
113
|
-
/**
|
|
114
|
-
* Renders the MultipleChoiceComponent with the current props.
|
|
115
|
-
*
|
|
116
|
-
* @returns The rendered React component
|
|
117
|
-
*/
|
|
118
|
-
render(): React.ReactNode;
|
|
119
|
-
}
|
|
120
|
-
declare const Radio: typeof MultipleChoiceWidget;
|
|
43
|
+
declare const Radio: React.ForwardRefExoticComponent<RenderProps & import("../../types").UniversalWidgetProps<PerseusRadioRubric, PerseusRadioUserInput, Empty> & React.RefAttributes<Widget>>;
|
|
121
44
|
export default Radio;
|
|
@@ -30,9 +30,7 @@ declare class Radio extends React.Component<Props> implements Widget {
|
|
|
30
30
|
_renderRenderer: (content?: string) => React.ReactElement;
|
|
31
31
|
focus(choiceIndex?: number | null): boolean;
|
|
32
32
|
registerFocusFunction(fun: FocusFunction): void;
|
|
33
|
-
updateChoices: (
|
|
34
|
-
checked: ReadonlyArray<boolean>;
|
|
35
|
-
}>) => void;
|
|
33
|
+
updateChoices: (checkedChoiceIds: ReadonlyArray<string>) => void;
|
|
36
34
|
getPromptJSON(): RadioPromptJSON;
|
|
37
35
|
render(): React.ReactNode;
|
|
38
36
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Radio from "./radio.ff";
|
|
2
2
|
import type { RenderProps } from "./radio-component";
|
|
3
3
|
import type { PerseusStrings } from "../../strings";
|
|
4
|
-
import type { PerseusRadioUserInput, PerseusRadioWidgetOptions
|
|
5
|
-
declare function getStartUserInput(
|
|
4
|
+
import type { PerseusRadioUserInput, PerseusRadioWidgetOptions } from "@khanacademy/perseus-core";
|
|
5
|
+
declare function getStartUserInput(): PerseusRadioUserInput;
|
|
6
6
|
declare function getCorrectUserInput(options: PerseusRadioWidgetOptions): PerseusRadioUserInput;
|
|
7
7
|
declare const _default: {
|
|
8
8
|
name: string;
|
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": "67.
|
|
6
|
+
"version": "67.1.1",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -42,36 +42,36 @@
|
|
|
42
42
|
"tiny-invariant": "1.3.1",
|
|
43
43
|
"uuid": "^10.0.0",
|
|
44
44
|
"@khanacademy/kas": "2.1.0",
|
|
45
|
-
"@khanacademy/keypad-context": "3.1
|
|
46
|
-
"@khanacademy/kmath": "2.1
|
|
47
|
-
"@khanacademy/math-input": "26.1
|
|
48
|
-
"@khanacademy/perseus-core": "18.
|
|
49
|
-
"@khanacademy/perseus-linter": "4.
|
|
50
|
-
"@khanacademy/perseus-score": "7.
|
|
45
|
+
"@khanacademy/keypad-context": "3.2.1",
|
|
46
|
+
"@khanacademy/kmath": "2.2.1",
|
|
47
|
+
"@khanacademy/math-input": "26.2.1",
|
|
48
|
+
"@khanacademy/perseus-core": "18.9.1",
|
|
49
|
+
"@khanacademy/perseus-linter": "4.3.1",
|
|
50
|
+
"@khanacademy/perseus-score": "7.7.1",
|
|
51
51
|
"@khanacademy/perseus-utils": "2.1.0",
|
|
52
|
-
"@khanacademy/
|
|
53
|
-
"@khanacademy/
|
|
52
|
+
"@khanacademy/pure-markdown": "2.2.0",
|
|
53
|
+
"@khanacademy/simple-markdown": "2.1.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@khanacademy/wonder-blocks-banner": "4.
|
|
57
|
-
"@khanacademy/wonder-blocks-button": "11.0.
|
|
58
|
-
"@khanacademy/wonder-blocks-clickable": "7.1.
|
|
59
|
-
"@khanacademy/wonder-blocks-core": "12.
|
|
60
|
-
"@khanacademy/wonder-blocks-data": "14.1.
|
|
61
|
-
"@khanacademy/wonder-blocks-dropdown": "10.3.
|
|
62
|
-
"@khanacademy/wonder-blocks-form": "7.3.
|
|
63
|
-
"@khanacademy/wonder-blocks-icon-button": "10.
|
|
64
|
-
"@khanacademy/wonder-blocks-icon": "5.2.
|
|
65
|
-
"@khanacademy/wonder-blocks-labeled-field": "4.0.
|
|
66
|
-
"@khanacademy/wonder-blocks-layout": "3.1.
|
|
67
|
-
"@khanacademy/wonder-blocks-link": "9.
|
|
68
|
-
"@khanacademy/wonder-blocks-pill": "3.1.
|
|
69
|
-
"@khanacademy/wonder-blocks-popover": "6.1.
|
|
70
|
-
"@khanacademy/wonder-blocks-progress-spinner": "3.1.
|
|
71
|
-
"@khanacademy/wonder-blocks-switch": "3.3.
|
|
72
|
-
"@khanacademy/wonder-blocks-tokens": "12.
|
|
73
|
-
"@khanacademy/wonder-blocks-tooltip": "4.1.
|
|
74
|
-
"@khanacademy/wonder-blocks-typography": "4.2.
|
|
56
|
+
"@khanacademy/wonder-blocks-banner": "4.3.3",
|
|
57
|
+
"@khanacademy/wonder-blocks-button": "11.0.4",
|
|
58
|
+
"@khanacademy/wonder-blocks-clickable": "7.1.24",
|
|
59
|
+
"@khanacademy/wonder-blocks-core": "12.4.0",
|
|
60
|
+
"@khanacademy/wonder-blocks-data": "14.1.5",
|
|
61
|
+
"@khanacademy/wonder-blocks-dropdown": "10.3.8",
|
|
62
|
+
"@khanacademy/wonder-blocks-form": "7.3.6",
|
|
63
|
+
"@khanacademy/wonder-blocks-icon-button": "10.4.1",
|
|
64
|
+
"@khanacademy/wonder-blocks-icon": "5.2.18",
|
|
65
|
+
"@khanacademy/wonder-blocks-labeled-field": "4.0.4",
|
|
66
|
+
"@khanacademy/wonder-blocks-layout": "3.1.35",
|
|
67
|
+
"@khanacademy/wonder-blocks-link": "9.2.2",
|
|
68
|
+
"@khanacademy/wonder-blocks-pill": "3.1.39",
|
|
69
|
+
"@khanacademy/wonder-blocks-popover": "6.1.29",
|
|
70
|
+
"@khanacademy/wonder-blocks-progress-spinner": "3.1.35",
|
|
71
|
+
"@khanacademy/wonder-blocks-switch": "3.3.17",
|
|
72
|
+
"@khanacademy/wonder-blocks-tokens": "12.2.1",
|
|
73
|
+
"@khanacademy/wonder-blocks-tooltip": "4.1.43",
|
|
74
|
+
"@khanacademy/wonder-blocks-typography": "4.2.20",
|
|
75
75
|
"@khanacademy/wonder-stuff-core": "1.5.5",
|
|
76
76
|
"@phosphor-icons/core": "2.0.2",
|
|
77
77
|
"@popperjs/core": "2.10.2",
|
|
@@ -90,25 +90,25 @@
|
|
|
90
90
|
"raphael": "1.5.4"
|
|
91
91
|
},
|
|
92
92
|
"peerDependencies": {
|
|
93
|
-
"@khanacademy/wonder-blocks-banner": "^4.
|
|
94
|
-
"@khanacademy/wonder-blocks-button": "^11.0.
|
|
95
|
-
"@khanacademy/wonder-blocks-clickable": "^7.1.
|
|
96
|
-
"@khanacademy/wonder-blocks-core": "^12.
|
|
97
|
-
"@khanacademy/wonder-blocks-data": "^14.1.
|
|
98
|
-
"@khanacademy/wonder-blocks-dropdown": "^10.3.
|
|
99
|
-
"@khanacademy/wonder-blocks-form": "^7.3.
|
|
100
|
-
"@khanacademy/wonder-blocks-icon": "^5.2.
|
|
101
|
-
"@khanacademy/wonder-blocks-icon-button": "^10.
|
|
102
|
-
"@khanacademy/wonder-blocks-labeled-field": "^4.0.
|
|
103
|
-
"@khanacademy/wonder-blocks-layout": "^3.1.
|
|
104
|
-
"@khanacademy/wonder-blocks-link": "^9.
|
|
105
|
-
"@khanacademy/wonder-blocks-pill": "^3.1.
|
|
106
|
-
"@khanacademy/wonder-blocks-popover": "^6.1.
|
|
107
|
-
"@khanacademy/wonder-blocks-progress-spinner": "^3.1.
|
|
108
|
-
"@khanacademy/wonder-blocks-switch": "^3.3.
|
|
109
|
-
"@khanacademy/wonder-blocks-tokens": "^12.
|
|
110
|
-
"@khanacademy/wonder-blocks-tooltip": "^4.1.
|
|
111
|
-
"@khanacademy/wonder-blocks-typography": "^4.2.
|
|
93
|
+
"@khanacademy/wonder-blocks-banner": "^4.3.3",
|
|
94
|
+
"@khanacademy/wonder-blocks-button": "^11.0.4",
|
|
95
|
+
"@khanacademy/wonder-blocks-clickable": "^7.1.24",
|
|
96
|
+
"@khanacademy/wonder-blocks-core": "^12.4.0",
|
|
97
|
+
"@khanacademy/wonder-blocks-data": "^14.1.5",
|
|
98
|
+
"@khanacademy/wonder-blocks-dropdown": "^10.3.8",
|
|
99
|
+
"@khanacademy/wonder-blocks-form": "^7.3.6",
|
|
100
|
+
"@khanacademy/wonder-blocks-icon": "^5.2.18",
|
|
101
|
+
"@khanacademy/wonder-blocks-icon-button": "^10.4.1",
|
|
102
|
+
"@khanacademy/wonder-blocks-labeled-field": "^4.0.4",
|
|
103
|
+
"@khanacademy/wonder-blocks-layout": "^3.1.35",
|
|
104
|
+
"@khanacademy/wonder-blocks-link": "^9.2.2",
|
|
105
|
+
"@khanacademy/wonder-blocks-pill": "^3.1.39",
|
|
106
|
+
"@khanacademy/wonder-blocks-popover": "^6.1.29",
|
|
107
|
+
"@khanacademy/wonder-blocks-progress-spinner": "^3.1.35",
|
|
108
|
+
"@khanacademy/wonder-blocks-switch": "^3.3.17",
|
|
109
|
+
"@khanacademy/wonder-blocks-tokens": "^12.2.1",
|
|
110
|
+
"@khanacademy/wonder-blocks-tooltip": "^4.1.43",
|
|
111
|
+
"@khanacademy/wonder-blocks-typography": "^4.2.20",
|
|
112
112
|
"@khanacademy/wonder-stuff-core": "^1.5.5",
|
|
113
113
|
"@phosphor-icons/core": "^2.0.2",
|
|
114
114
|
"@popperjs/core": "^2.10.2",
|