@khanacademy/perseus 77.0.3 → 77.2.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.css +3 -3
- package/dist/es/index.css.map +1 -1
- package/dist/es/index.js +32 -32
- package/dist/es/index.js.map +1 -1
- package/dist/es/strings.js +1 -1
- package/dist/es/strings.js.map +1 -1
- package/dist/index.css +3 -3
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +30 -29
- package/dist/index.js.map +1 -1
- package/dist/strings.d.ts +50 -0
- package/dist/strings.js +1 -1
- package/dist/strings.js.map +1 -1
- package/dist/types.d.ts +0 -6
- package/dist/widget-ai-utils/interactive-graph/interactive-graph-ai-utils.d.ts +12 -2
- package/dist/widget-ai-utils/radio/radio-ai-utils.d.ts +1 -1
- package/dist/widgets/dropdown/dropdown.d.ts +0 -1
- package/dist/widgets/expression/expression.d.ts +0 -2
- package/dist/widgets/image/utils.d.ts +6 -0
- package/dist/widgets/interactive-graphs/graphs/exponential.d.ts +2 -2
- package/dist/widgets/interactive-graphs/graphs/logarithm.d.ts +12 -0
- package/dist/widgets/interactive-graphs/graphs/utils.d.ts +25 -0
- package/dist/widgets/interactive-graphs/interactive-graph-question-builder.d.ts +6 -0
- package/dist/widgets/interactive-graphs/interactive-graph.d.ts +5 -2
- package/dist/widgets/interactive-graphs/reducer/initialize-graph-state.d.ts +5 -1
- package/dist/widgets/interactive-graphs/reducer/interactive-graph-action.d.ts +4 -0
- package/dist/widgets/interactive-graphs/types.d.ts +7 -1
- package/dist/widgets/label-image/label-image.d.ts +0 -1
- package/dist/widgets/mock-widgets/mock-widget.d.ts +0 -1
- package/dist/widgets/numeric-input/numeric-input.class.d.ts +0 -1
- package/dist/widgets/numeric-input/numeric-input.d.ts +0 -1
- package/dist/widgets/radio/index.d.ts +16 -1
- package/dist/widgets/radio/{multiple-choice-component.d.ts → radio-component.d.ts} +7 -7
- package/dist/widgets/radio/radio-widget.d.ts +49 -0
- package/dist/widgets/radio/util.d.ts +1 -1
- package/dist/widgets/radio/utils/general-utils.d.ts +1 -1
- package/dist/widgets/table/table.d.ts +0 -1
- package/package.json +19 -19
- package/dist/widgets/radio/multiple-choice-widget.d.ts +0 -110
- package/dist/widgets/radio/radio.d.ts +0 -16
- package/dist/widgets/radio/radio.ff.d.ts +0 -112
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { type PerseusRadioRubric, type PerseusRadioUserInput } from "@khanacademy/perseus-core";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
4
|
-
import type { RadioProps, RadioWidgetHandle } from "./multiple-choice-widget";
|
|
5
|
-
import type { ChoiceState, Widget, WidgetProps } from "../../types";
|
|
6
|
-
import type { RadioPromptJSON } from "../../widget-ai-utils/radio/radio-ai-utils";
|
|
7
|
-
type Props = WidgetProps<RadioProps, PerseusRadioUserInput, PerseusRadioRubric>;
|
|
8
|
-
type ChoiceStateWithoutSelected = Omit<ChoiceState, "selected">;
|
|
9
|
-
type State = {
|
|
10
|
-
choiceStates: ChoiceStateWithoutSelected[];
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* This is a wrapper around the old radio widget that allows us to
|
|
14
|
-
* conditionally render the new radio widget when the feature flag is on.
|
|
15
|
-
*
|
|
16
|
-
* This is necessary to ensure that we do not interrupt the assessment studies
|
|
17
|
-
* that are currently running.
|
|
18
|
-
*
|
|
19
|
-
* TODO(LEMS-2994): Clean up this file. State, initChoiceStates, the
|
|
20
|
-
* constructor, and UNSAFE_componentWillUpdate are all now only providing
|
|
21
|
-
* static defaults that never update on user interaction.
|
|
22
|
-
*/
|
|
23
|
-
declare class Radio extends React.Component<Props> implements Widget {
|
|
24
|
-
static contextType: React.Context<import("../../components/i18n-context").I18nContextType>;
|
|
25
|
-
context: React.ContextType<typeof PerseusI18nContext>;
|
|
26
|
-
radioRef: React.RefObject<RadioWidgetHandle>;
|
|
27
|
-
state: State;
|
|
28
|
-
constructor(props: Props);
|
|
29
|
-
UNSAFE_componentWillUpdate(nextProps: Props): void;
|
|
30
|
-
/**
|
|
31
|
-
* @deprecated and likely very broken API
|
|
32
|
-
* [LEMS-3185] do not trust serializedState
|
|
33
|
-
*/
|
|
34
|
-
getSerializedState(): {
|
|
35
|
-
hasNoneOfTheAbove: boolean;
|
|
36
|
-
numCorrect: number;
|
|
37
|
-
multipleSelect?: boolean;
|
|
38
|
-
countChoices?: boolean;
|
|
39
|
-
deselectEnabled?: boolean;
|
|
40
|
-
choices: import("./multiple-choice-widget").RadioChoiceWithMetadata[];
|
|
41
|
-
choiceStates?: ChoiceState[];
|
|
42
|
-
editMode?: boolean;
|
|
43
|
-
labelWrap?: boolean;
|
|
44
|
-
trackInteraction: (extraData?: PerseusRadioRubric | undefined) => void;
|
|
45
|
-
widgetId: string;
|
|
46
|
-
widgetIndex: number;
|
|
47
|
-
alignment: string | null | undefined;
|
|
48
|
-
problemNum: number | null | undefined;
|
|
49
|
-
apiOptions: Readonly<Readonly<{
|
|
50
|
-
isArticle?: boolean;
|
|
51
|
-
onFocusChange?: (newFocusPath: import("../..").FocusPath, oldFocusPath: import("../..").FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
|
|
52
|
-
showAlignmentOptions?: boolean;
|
|
53
|
-
readOnly?: boolean;
|
|
54
|
-
editingDisabled?: boolean;
|
|
55
|
-
answerableCallback?: (arg1: boolean) => unknown;
|
|
56
|
-
getAnotherHint?: () => unknown;
|
|
57
|
-
interactionCallback?: (widgetData: {
|
|
58
|
-
[widgetId: string]: any;
|
|
59
|
-
}) => void;
|
|
60
|
-
imagePlaceholder?: React.ReactNode;
|
|
61
|
-
widgetPlaceholder?: React.ReactNode;
|
|
62
|
-
baseElements?: {
|
|
63
|
-
Link: React.ComponentType<any>;
|
|
64
|
-
};
|
|
65
|
-
imagePreloader?: (dimensions: import("../../types").Dimensions) => React.ReactNode;
|
|
66
|
-
trackInteraction?: (args: {
|
|
67
|
-
type: string;
|
|
68
|
-
id: string;
|
|
69
|
-
correct?: boolean;
|
|
70
|
-
} & Partial<import("../../types").TrackingGradedGroupExtraArguments> & Partial<{
|
|
71
|
-
visible: number;
|
|
72
|
-
}>) => void;
|
|
73
|
-
customKeypad?: boolean;
|
|
74
|
-
nativeKeypadProxy?: (blur: () => void) => import("@khanacademy/math-input").KeypadAPI;
|
|
75
|
-
isMobile?: boolean;
|
|
76
|
-
isMobileApp?: boolean;
|
|
77
|
-
setDrawingAreaAvailable?: (arg1: boolean) => unknown;
|
|
78
|
-
hintProgressColor?: string;
|
|
79
|
-
canScrollPage?: boolean;
|
|
80
|
-
editorChangeDelay?: number;
|
|
81
|
-
flags?: Record<"new-radio-widget" | "image-widget-upgrade-gif-controls" | "image-widget-upgrade-scale" | "interactive-graph-absolute-value" | "interactive-graph-tangent" | "interactive-graph-logarithm" | "interactive-graph-exponent" | "interactive-graph-vector", boolean>;
|
|
82
|
-
}> & {
|
|
83
|
-
baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
|
|
84
|
-
canScrollPage: NonNullable<import("../..").APIOptions["canScrollPage"]>;
|
|
85
|
-
editorChangeDelay: NonNullable<import("../..").APIOptions["editorChangeDelay"]>;
|
|
86
|
-
isArticle: NonNullable<import("../..").APIOptions["isArticle"]>;
|
|
87
|
-
isMobile: NonNullable<import("../..").APIOptions["isMobile"]>;
|
|
88
|
-
isMobileApp: NonNullable<import("../..").APIOptions["isMobileApp"]>;
|
|
89
|
-
editingDisabled: NonNullable<import("../..").APIOptions["editingDisabled"]>;
|
|
90
|
-
onFocusChange: NonNullable<import("../..").APIOptions["onFocusChange"]>;
|
|
91
|
-
readOnly: NonNullable<import("../..").APIOptions["readOnly"]>;
|
|
92
|
-
setDrawingAreaAvailable: NonNullable<import("../..").APIOptions["setDrawingAreaAvailable"]>;
|
|
93
|
-
showAlignmentOptions: NonNullable<import("../..").APIOptions["showAlignmentOptions"]>;
|
|
94
|
-
}>;
|
|
95
|
-
keypadElement?: any;
|
|
96
|
-
questionCompleted?: boolean;
|
|
97
|
-
onFocus: (blurPath: import("../..").FocusPath) => void;
|
|
98
|
-
onBlur: (blurPath: import("../..").FocusPath) => void;
|
|
99
|
-
findWidgets: (criterion: import("../../types").FilterCriterion) => ReadonlyArray<Widget>;
|
|
100
|
-
reviewMode: boolean;
|
|
101
|
-
showSolutions?: import("@khanacademy/perseus-core").ShowSolutions;
|
|
102
|
-
handleUserInput: (newUserInput: PerseusRadioUserInput, cb?: () => void, silent?: boolean) => void;
|
|
103
|
-
linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
|
|
104
|
-
containerSizeClass: import("../../util/sizing-utils").SizeClass;
|
|
105
|
-
};
|
|
106
|
-
getPromptJSON(): RadioPromptJSON;
|
|
107
|
-
_mergePropsAndState(): Props & {
|
|
108
|
-
numCorrect: number;
|
|
109
|
-
};
|
|
110
|
-
render(): React.ReactNode;
|
|
111
|
-
}
|
|
112
|
-
export default Radio;
|