@khanacademy/perseus 43.0.1 → 44.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/all-widgets.d.ts +2 -23
- package/dist/basic-widgets.d.ts +2 -23
- package/dist/components/graph.d.ts +1 -0
- package/dist/components/icon.d.ts +0 -1
- package/dist/components/multi-button-group.d.ts +1 -0
- package/dist/components/number-input.d.ts +5 -3
- package/dist/components/text-input.d.ts +4 -2
- package/dist/components/tooltip.d.ts +1 -0
- package/dist/es/index.js +476 -261
- package/dist/es/index.js.map +1 -1
- package/dist/es/strings.js +4 -2
- package/dist/es/strings.js.map +1 -1
- package/dist/extra-widgets.d.ts +2 -23
- package/dist/index.d.ts +2 -2
- package/dist/index.js +465 -250
- package/dist/index.js.map +1 -1
- package/dist/interactive2/interactive-util.d.ts +1 -1
- package/dist/interactive2/movable-point-options.d.ts +2 -2
- package/dist/interactive2/movable-point.d.ts +7 -7
- package/dist/interactive2/objective_.d.ts +1 -1
- package/dist/jipt-paragraphs.d.ts +2 -2
- package/dist/perseus-api.d.ts +2 -77
- package/dist/perseus-types.d.ts +17 -17
- package/dist/server-item-renderer.d.ts +26 -49
- package/dist/strings.d.ts +1 -0
- package/dist/strings.js +4 -2
- package/dist/strings.js.map +1 -1
- package/dist/styles/global-styles.d.ts +0 -1
- package/dist/styles/shared.d.ts +0 -1
- package/dist/traversal.d.ts +1 -1
- package/dist/util/a11y.d.ts +0 -1
- package/dist/util/debounce.d.ts +1 -1
- package/dist/util/parse-perseus-json/general-purpose-parsers/defaulted.d.ts +1 -1
- package/dist/util/parse-perseus-json/general-purpose-parsers/index.d.ts +2 -0
- package/dist/util/parse-perseus-json/general-purpose-parsers/pipe-parsers.d.ts +7 -0
- package/dist/util/parse-perseus-json/general-purpose-parsers/pipe-parsers.typetest.d.ts +1 -0
- package/dist/util/parse-perseus-json/general-purpose-parsers/unknown.d.ts +2 -0
- package/dist/util/parse-perseus-json/perseus-parsers/graded-group-widget.d.ts +2 -2
- package/dist/util/parse-perseus-json/perseus-parsers/images-map.d.ts +5 -0
- package/dist/util/parse-perseus-json/perseus-parsers/widget.d.ts +4 -0
- package/dist/validation.types.d.ts +14 -6
- package/dist/widgets/categorizer/categorizer.d.ts +2 -2
- package/dist/widgets/categorizer/score-categorizer.d.ts +2 -2
- package/dist/widgets/categorizer/validate-categorizer.d.ts +15 -0
- package/dist/widgets/definition/definition.d.ts +1 -1
- package/dist/widgets/deprecated-standin/deprecated-standin.d.ts +1 -1
- package/dist/widgets/dropdown/dropdown.d.ts +9 -1
- package/dist/widgets/dropdown/validate-dropdown.d.ts +10 -0
- package/dist/widgets/explanation/explanation.d.ts +1 -1
- package/dist/widgets/expression/expression.d.ts +92 -217
- package/dist/widgets/image/image.d.ts +1 -1
- package/dist/widgets/interaction/interaction.d.ts +1 -1
- package/dist/widgets/interactive-graphs/graphs/components/movable-point.d.ts +11 -7
- package/dist/widgets/interactive-graphs/graphs/components/use-control-point.d.ts +7 -3
- package/dist/widgets/interactive-graphs/graphs/quadratic.d.ts +1 -1
- package/dist/widgets/interactive-graphs/types.d.ts +1 -0
- package/dist/widgets/label-image/answer-pill.d.ts +0 -1
- package/dist/widgets/label-image/label-image.d.ts +5 -65
- package/dist/widgets/label-image/marker.d.ts +0 -1
- package/dist/widgets/matrix/matrix.d.ts +12 -5
- package/dist/widgets/measurer/measurer.d.ts +2 -2
- package/dist/widgets/molecule/molecule.d.ts +1 -1
- package/dist/widgets/orderer/validate-orderer.d.ts +12 -0
- package/dist/widgets/passage/passage-markdown.d.ts +2 -2
- package/dist/widgets/passage/passage.d.ts +1 -1
- package/dist/widgets/passage-ref/passage-ref.d.ts +1 -1
- package/dist/widgets/passage-ref-target/passage-ref-target.d.ts +1 -1
- package/dist/widgets/plotter/plotter.d.ts +2 -2
- package/dist/widgets/plotter/score-plotter.d.ts +2 -2
- package/dist/widgets/plotter/validate-plotter.d.ts +12 -0
- package/dist/widgets/radio/choice-icon/shared-styles.d.ts +0 -1
- package/dist/widgets/radio/choice-none-above.d.ts +1 -1
- package/dist/widgets/radio/radio.d.ts +3 -3
- package/dist/widgets/radio/validate-radio.d.ts +14 -0
- package/dist/widgets/sorter/validate-sorter.d.ts +13 -0
- package/dist/widgets/video/video.d.ts +1 -1
- package/package.json +5 -5
- package/dist/util/parse-perseus-json/general-purpose-parsers/compose-parsers.d.ts +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,9 +3,9 @@ import type { Parser } from "../parser-types";
|
|
|
3
3
|
export declare const parseGradedGroupWidgetOptions: Parser<{
|
|
4
4
|
title: string;
|
|
5
5
|
hasHint: boolean | null | undefined;
|
|
6
|
-
hint: import("
|
|
6
|
+
hint: import("../../..").PerseusRenderer | null | undefined;
|
|
7
7
|
content: string;
|
|
8
|
-
widgets: import("
|
|
8
|
+
widgets: import("../../..").PerseusWidgetsMap;
|
|
9
9
|
widgetEnabled: boolean | null | undefined;
|
|
10
10
|
immutableWidgets: boolean | null | undefined;
|
|
11
11
|
images: Record<string, {
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { WidgetOptions } from "../../../perseus-types";
|
|
2
2
|
import type { Parser } from "../parser-types";
|
|
3
3
|
export declare function parseWidget<Type extends string, Options>(parseType: Parser<Type>, parseOptions: Parser<Options>): Parser<WidgetOptions<Type, Options>>;
|
|
4
|
+
export declare function parseWidgetWithVersion<Version extends {
|
|
5
|
+
major: number;
|
|
6
|
+
minor: number;
|
|
7
|
+
} | undefined, Type extends string, Options>(parseVersion: Parser<Version>, parseType: Parser<Type>, parseOptions: Parser<Options>): Parser<WidgetOptions<Type, Options>>;
|
|
@@ -27,15 +27,18 @@
|
|
|
27
27
|
* } & Perseus<Widget>ValidationData;
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
30
|
-
import type { GrapherAnswerTypes, PerseusDropdownChoice, PerseusExpressionAnswerForm, PerseusGradedGroupSetWidgetOptions, PerseusGradedGroupWidgetOptions, PerseusGraphType, PerseusGroupWidgetOptions, PerseusMatcherWidgetOptions, PerseusMatrixWidgetAnswers, PerseusNumberLineWidgetOptions, PerseusNumericInputAnswer, PerseusOrdererWidgetOptions,
|
|
30
|
+
import type { GrapherAnswerTypes, PerseusDropdownChoice, PerseusExpressionAnswerForm, PerseusGradedGroupSetWidgetOptions, PerseusGradedGroupWidgetOptions, PerseusGraphType, PerseusGroupWidgetOptions, PerseusMatcherWidgetOptions, PerseusMatrixWidgetAnswers, PerseusNumberLineWidgetOptions, PerseusNumericInputAnswer, PerseusOrdererWidgetOptions, PerseusRadioChoice, PerseusGraphCorrectType } from "./perseus-types";
|
|
31
31
|
import type { InteractiveMarkerType } from "./widgets/label-image/types";
|
|
32
32
|
import type { Relationship } from "./widgets/number-line/number-line";
|
|
33
33
|
export type UserInputStatus = "correct" | "incorrect" | "incomplete";
|
|
34
|
-
export type
|
|
34
|
+
export type PerseusCategorizerScoringData = {
|
|
35
35
|
values: ReadonlyArray<number>;
|
|
36
|
-
};
|
|
36
|
+
} & PerseusCategorizerValidationData;
|
|
37
37
|
export type PerseusCategorizerUserInput = {
|
|
38
|
-
values:
|
|
38
|
+
values: PerseusCategorizerScoringData["values"];
|
|
39
|
+
};
|
|
40
|
+
export type PerseusCategorizerValidationData = {
|
|
41
|
+
items: ReadonlyArray<string>;
|
|
39
42
|
};
|
|
40
43
|
export type PerseusCSProgramRubric = Empty;
|
|
41
44
|
export type PerseusCSProgramUserInput = {
|
|
@@ -117,7 +120,12 @@ export type PerseusOrdererRubric = PerseusOrdererWidgetOptions;
|
|
|
117
120
|
export type PerseusOrdererUserInput = {
|
|
118
121
|
current: ReadonlyArray<string>;
|
|
119
122
|
};
|
|
120
|
-
export type
|
|
123
|
+
export type PerseusPlotterScoringData = {
|
|
124
|
+
correct: ReadonlyArray<number>;
|
|
125
|
+
} & PerseusPlotterValidationData;
|
|
126
|
+
export type PerseusPlotterValidationData = {
|
|
127
|
+
starting: ReadonlyArray<number>;
|
|
128
|
+
};
|
|
121
129
|
export type PerseusPlotterUserInput = ReadonlyArray<number>;
|
|
122
130
|
export type PerseusRadioRubric = {
|
|
123
131
|
choices: ReadonlyArray<PerseusRadioChoice>;
|
|
@@ -136,7 +144,7 @@ export type PerseusTableRubric = {
|
|
|
136
144
|
answers: ReadonlyArray<ReadonlyArray<string>>;
|
|
137
145
|
};
|
|
138
146
|
export type PerseusTableUserInput = ReadonlyArray<ReadonlyArray<string>>;
|
|
139
|
-
export type Rubric =
|
|
147
|
+
export type Rubric = PerseusCategorizerScoringData | PerseusCSProgramRubric | PerseusDropdownRubric | PerseusExpressionRubric | PerseusGroupRubric | PerseusGradedGroupRubric | PerseusGradedGroupSetRubric | PerseusGrapherRubric | PerseusIFrameRubric | PerseusInputNumberRubric | PerseusInteractiveGraphRubric | PerseusLabelImageRubric | PerseusMatcherRubric | PerseusMatrixRubric | PerseusNumberLineRubric | PerseusNumericInputRubric | PerseusOrdererRubric | PerseusPlotterScoringData | PerseusRadioRubric | PerseusSorterRubric | PerseusTableRubric;
|
|
140
148
|
export type UserInput = PerseusCategorizerUserInput | PerseusCSProgramUserInput | PerseusDropdownUserInput | PerseusExpressionUserInput | PerseusGrapherUserInput | PerseusIFrameUserInput | PerseusInputNumberUserInput | PerseusInteractiveGraphUserInput | PerseusLabelImageUserInput | PerseusMatcherUserInput | PerseusMatrixUserInput | PerseusNumberLineUserInput | PerseusNumericInputUserInput | PerseusOrdererUserInput | PerseusPlotterUserInput | PerseusRadioUserInput | PerseusSorterUserInput | PerseusTableUserInput;
|
|
141
149
|
export type UserInputMap = {
|
|
142
150
|
[widgetId: string]: UserInput | UserInputMap;
|
|
@@ -3,9 +3,9 @@ import { PerseusI18nContext } from "../../components/i18n-context";
|
|
|
3
3
|
import scoreCategorizer from "./score-categorizer";
|
|
4
4
|
import type { PerseusCategorizerWidgetOptions } from "../../perseus-types";
|
|
5
5
|
import type { Widget, WidgetProps } from "../../types";
|
|
6
|
-
import type {
|
|
6
|
+
import type { PerseusCategorizerScoringData, PerseusCategorizerUserInput } from "../../validation.types";
|
|
7
7
|
import type { CategorizerPromptJSON } from "../../widget-ai-utils/categorizer/categorizer-ai-utils";
|
|
8
|
-
type Props = WidgetProps<RenderProps,
|
|
8
|
+
type Props = WidgetProps<RenderProps, PerseusCategorizerScoringData> & {
|
|
9
9
|
values: ReadonlyArray<string>;
|
|
10
10
|
};
|
|
11
11
|
type DefaultProps = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PerseusStrings } from "../../strings";
|
|
2
2
|
import type { PerseusScore } from "../../types";
|
|
3
|
-
import type {
|
|
4
|
-
declare function scoreCategorizer(userInput: PerseusCategorizerUserInput,
|
|
3
|
+
import type { PerseusCategorizerScoringData, PerseusCategorizerUserInput } from "../../validation.types";
|
|
4
|
+
declare function scoreCategorizer(userInput: PerseusCategorizerUserInput, scoringData: PerseusCategorizerScoringData, strings: PerseusStrings): PerseusScore;
|
|
5
5
|
export default scoreCategorizer;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PerseusStrings } from "../../strings";
|
|
2
|
+
import type { PerseusScore } from "../../types";
|
|
3
|
+
import type { PerseusCategorizerUserInput, PerseusCategorizerValidationData } from "../../validation.types";
|
|
4
|
+
/**
|
|
5
|
+
* Checks userInput from the categorizer widget to see if the user has selected
|
|
6
|
+
* a category for each item.
|
|
7
|
+
* @param userInput - The user's input corresponding to an array of indices that
|
|
8
|
+
* represent the selected category for each row/item.
|
|
9
|
+
* @param validationData - An array of strings corresponding to each row/item
|
|
10
|
+
* @param strings - Used to provide a validation message
|
|
11
|
+
*/
|
|
12
|
+
declare function validateCategorizer(userInput: PerseusCategorizerUserInput, validationData: PerseusCategorizerValidationData, strings: PerseusStrings): Extract<PerseusScore, {
|
|
13
|
+
type: "invalid";
|
|
14
|
+
}> | null;
|
|
15
|
+
export default validateCategorizer;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
2
3
|
import scoreDropdown from "./score-dropdown";
|
|
3
4
|
import type { PerseusDropdownWidgetOptions } from "../../perseus-types";
|
|
4
5
|
import type { Widget, WidgetProps } from "../../types";
|
|
@@ -14,6 +15,11 @@ type DefaultProps = {
|
|
|
14
15
|
apiOptions: Props["apiOptions"];
|
|
15
16
|
};
|
|
16
17
|
declare class Dropdown extends React.Component<Props> implements Widget {
|
|
18
|
+
static contextType: React.Context<{
|
|
19
|
+
strings: import("../../strings").PerseusStrings;
|
|
20
|
+
locale: string;
|
|
21
|
+
}>;
|
|
22
|
+
context: React.ContextType<typeof PerseusI18nContext>;
|
|
17
23
|
static defaultProps: DefaultProps;
|
|
18
24
|
focus: () => boolean;
|
|
19
25
|
_handleChangeEvent: (arg1: React.ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -23,7 +29,9 @@ declare class Dropdown extends React.Component<Props> implements Widget {
|
|
|
23
29
|
render(): React.ReactNode;
|
|
24
30
|
}
|
|
25
31
|
type RenderProps = {
|
|
26
|
-
placeholder:
|
|
32
|
+
placeholder: PerseusDropdownWidgetOptions["placeholder"];
|
|
33
|
+
visibleLabel: PerseusDropdownWidgetOptions["visibleLabel"];
|
|
34
|
+
ariaLabel: PerseusDropdownWidgetOptions["ariaLabel"];
|
|
27
35
|
choices: ReadonlyArray<string>;
|
|
28
36
|
};
|
|
29
37
|
declare const _default: {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PerseusScore } from "../../types";
|
|
2
|
+
import type { PerseusDropdownUserInput } from "../../validation.types";
|
|
3
|
+
/**
|
|
4
|
+
* Checks if the user has selected an item from the dropdown before scoring.
|
|
5
|
+
* This is shown with a userInput value / index other than 0.
|
|
6
|
+
*/
|
|
7
|
+
declare function validateDropdown(userInput: PerseusDropdownUserInput): Extract<PerseusScore, {
|
|
8
|
+
type: "invalid";
|
|
9
|
+
}> | null;
|
|
10
|
+
export default validateDropdown;
|
|
@@ -99,264 +99,139 @@ declare const _default: {
|
|
|
99
99
|
static: boolean | null | undefined;
|
|
100
100
|
problemNum: number | null | undefined;
|
|
101
101
|
apiOptions: Readonly<Readonly<{
|
|
102
|
-
isArticle?: boolean
|
|
103
|
-
onFocusChange?: (
|
|
104
|
-
GroupMetadataEditor?: React.ComponentType<any
|
|
105
|
-
showAlignmentOptions?: boolean
|
|
106
|
-
readOnly?: boolean
|
|
107
|
-
answerableCallback?: (
|
|
108
|
-
getAnotherHint?: (
|
|
109
|
-
interactionCallback?: (
|
|
102
|
+
isArticle?: boolean;
|
|
103
|
+
onFocusChange?: (newFocusPath: FocusPath, oldFocusPath: FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
|
|
104
|
+
GroupMetadataEditor?: React.ComponentType<any>;
|
|
105
|
+
showAlignmentOptions?: boolean;
|
|
106
|
+
readOnly?: boolean;
|
|
107
|
+
answerableCallback?: (arg1: boolean) => unknown;
|
|
108
|
+
getAnotherHint?: () => unknown;
|
|
109
|
+
interactionCallback?: (widgetData: {
|
|
110
110
|
[widgetId: string]: any;
|
|
111
|
-
}) => void
|
|
112
|
-
groupAnnotator?: (
|
|
111
|
+
}) => void;
|
|
112
|
+
groupAnnotator?: (groupNumber: number, widgetId: string) => React.ReactNode;
|
|
113
113
|
imagePlaceholder?: React.ReactNode;
|
|
114
114
|
widgetPlaceholder?: React.ReactNode;
|
|
115
115
|
baseElements?: {
|
|
116
116
|
Link: React.ComponentType<any>;
|
|
117
|
-
}
|
|
118
|
-
imagePreloader?: (
|
|
119
|
-
trackInteraction?: (
|
|
117
|
+
};
|
|
118
|
+
imagePreloader?: (dimensions: import("../../types").Dimensions) => React.ReactNode;
|
|
119
|
+
trackInteraction?: (args: {
|
|
120
120
|
type: string;
|
|
121
121
|
id: string;
|
|
122
|
-
correct?: boolean
|
|
122
|
+
correct?: boolean;
|
|
123
123
|
} & Partial<import("../../types").TrackingGradedGroupExtraArguments> & Partial<{
|
|
124
124
|
visible: number;
|
|
125
|
-
}>) => void
|
|
126
|
-
customKeypad?: boolean
|
|
127
|
-
nativeKeypadProxy?: (
|
|
128
|
-
isMobile?: boolean
|
|
129
|
-
setDrawingAreaAvailable?: (
|
|
130
|
-
hintProgressColor?: string
|
|
131
|
-
canScrollPage?: boolean
|
|
132
|
-
crossOutEnabled?: boolean
|
|
133
|
-
editorChangeDelay?: number
|
|
125
|
+
}>) => void;
|
|
126
|
+
customKeypad?: boolean;
|
|
127
|
+
nativeKeypadProxy?: (blur: () => void) => import("@khanacademy/math-input").KeypadAPI;
|
|
128
|
+
isMobile?: boolean;
|
|
129
|
+
setDrawingAreaAvailable?: (arg1: boolean) => unknown;
|
|
130
|
+
hintProgressColor?: string;
|
|
131
|
+
canScrollPage?: boolean;
|
|
132
|
+
crossOutEnabled?: boolean;
|
|
133
|
+
editorChangeDelay?: number;
|
|
134
134
|
flags?: {
|
|
135
|
-
mafs?: false | ({
|
|
136
|
-
none?: boolean | undefined;
|
|
137
|
-
linear?: boolean | undefined;
|
|
138
|
-
circle?: boolean | undefined;
|
|
139
|
-
polygon?: boolean | undefined;
|
|
140
|
-
point?: boolean | undefined;
|
|
141
|
-
quadratic?: boolean | undefined;
|
|
142
|
-
sinusoid?: boolean | undefined;
|
|
143
|
-
angle?: boolean | undefined;
|
|
144
|
-
"linear-system"?: boolean | undefined;
|
|
145
|
-
ray?: boolean | undefined;
|
|
146
|
-
segment?: boolean | undefined;
|
|
147
|
-
"unlimited-polygon"?: boolean | undefined;
|
|
148
|
-
"unlimited-point"?: boolean | undefined;
|
|
149
|
-
} & {
|
|
150
|
-
"interactive-graph-locked-features-labels"?: boolean | undefined;
|
|
151
|
-
"locked-figures-aria"?: boolean | undefined;
|
|
152
|
-
"locked-point-labels"?: boolean | undefined;
|
|
153
|
-
"locked-line-labels"?: boolean | undefined;
|
|
154
|
-
"locked-vector-labels"?: boolean | undefined;
|
|
155
|
-
"locked-ellipse-labels"?: boolean | undefined;
|
|
156
|
-
"locked-polygon-labels"?: boolean | undefined;
|
|
157
|
-
"locked-function-labels"?: boolean | undefined;
|
|
158
|
-
}) | undefined;
|
|
159
|
-
} | undefined;
|
|
160
|
-
onWidgetStartProps?: ((widgets: import("../../perseus-types").PerseusWidgetsMap) => void) | undefined;
|
|
161
|
-
}> & {
|
|
162
|
-
GroupMetadataEditor: NonNullable<React.ComponentType<any> | undefined>;
|
|
163
|
-
baseElements: {
|
|
164
|
-
Link: React.ComponentType<any>;
|
|
135
|
+
mafs?: false | ({ [Key in typeof import("../../types").MafsGraphTypeFlags[number]]?: boolean; } & { [Key in typeof import("../../types").InteractiveGraphLockedFeaturesFlags[number]]?: boolean; });
|
|
165
136
|
};
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
137
|
+
onWidgetStartProps?: (widgets: import("../..").PerseusWidgetsMap) => void;
|
|
138
|
+
}> & {
|
|
139
|
+
GroupMetadataEditor: NonNullable<import("../..").APIOptions["GroupMetadataEditor"]>;
|
|
140
|
+
baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
|
|
141
|
+
canScrollPage: NonNullable<import("../..").APIOptions["canScrollPage"]>;
|
|
142
|
+
crossOutEnabled: NonNullable<import("../..").APIOptions["crossOutEnabled"]>;
|
|
143
|
+
editorChangeDelay: NonNullable<import("../..").APIOptions["editorChangeDelay"]>;
|
|
144
|
+
groupAnnotator: NonNullable<import("../..").APIOptions["groupAnnotator"]>;
|
|
145
|
+
isArticle: NonNullable<import("../..").APIOptions["isArticle"]>;
|
|
146
|
+
isMobile: NonNullable<import("../..").APIOptions["isMobile"]>;
|
|
147
|
+
onFocusChange: NonNullable<import("../..").APIOptions["onFocusChange"]>;
|
|
148
|
+
readOnly: NonNullable<import("../..").APIOptions["readOnly"]>;
|
|
149
|
+
setDrawingAreaAvailable: NonNullable<import("../..").APIOptions["setDrawingAreaAvailable"]>;
|
|
150
|
+
showAlignmentOptions: NonNullable<import("../..").APIOptions["showAlignmentOptions"]>;
|
|
176
151
|
}>;
|
|
177
152
|
keypadElement?: any;
|
|
178
|
-
questionCompleted?: boolean
|
|
153
|
+
questionCompleted?: boolean;
|
|
179
154
|
onFocus: (blurPath: FocusPath) => void;
|
|
180
155
|
onBlur: (blurPath: FocusPath) => void;
|
|
181
|
-
findWidgets: (criterion: import("../../types").FilterCriterion) =>
|
|
156
|
+
findWidgets: (criterion: import("../../types").FilterCriterion) => ReadonlyArray<Widget>;
|
|
182
157
|
reviewModeRubric?: PerseusExpressionRubric | null | undefined;
|
|
183
158
|
reviewMode: boolean;
|
|
184
|
-
onChange: import("
|
|
159
|
+
onChange: import("../..").ChangeHandler;
|
|
185
160
|
trackInteraction: (extraData?: Empty | undefined) => void;
|
|
186
161
|
isLastUsedWidget: boolean;
|
|
187
162
|
linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
|
|
188
163
|
containerSizeClass: import("../../util/sizing-utils").SizeClass;
|
|
189
|
-
} & Partial<import("
|
|
190
|
-
apiOptions:
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
[widgetId: string]: any;
|
|
200
|
-
}) => void) | undefined;
|
|
201
|
-
groupAnnotator?: ((groupNumber: number, widgetId: string) => React.ReactNode) | undefined;
|
|
202
|
-
imagePlaceholder?: React.ReactNode;
|
|
203
|
-
widgetPlaceholder?: React.ReactNode;
|
|
204
|
-
baseElements?: {
|
|
205
|
-
Link: React.ComponentType<any>;
|
|
206
|
-
} | undefined;
|
|
207
|
-
imagePreloader?: ((dimensions: import("../../types").Dimensions) => React.ReactNode) | undefined;
|
|
208
|
-
trackInteraction?: ((args: {
|
|
209
|
-
type: string;
|
|
210
|
-
id: string;
|
|
211
|
-
correct?: boolean | undefined;
|
|
212
|
-
} & Partial<import("../../types").TrackingGradedGroupExtraArguments> & Partial<{
|
|
213
|
-
visible: number;
|
|
214
|
-
}>) => void) | undefined;
|
|
215
|
-
customKeypad?: boolean | undefined;
|
|
216
|
-
nativeKeypadProxy?: ((blur: () => void) => import("@khanacademy/math-input").KeypadAPI) | undefined;
|
|
217
|
-
isMobile?: boolean | undefined;
|
|
218
|
-
setDrawingAreaAvailable?: ((arg1: boolean) => unknown) | undefined;
|
|
219
|
-
hintProgressColor?: string | undefined;
|
|
220
|
-
canScrollPage?: boolean | undefined;
|
|
221
|
-
crossOutEnabled?: boolean | undefined;
|
|
222
|
-
editorChangeDelay?: number | undefined;
|
|
223
|
-
flags?: {
|
|
224
|
-
mafs?: false | ({
|
|
225
|
-
none?: boolean | undefined;
|
|
226
|
-
linear?: boolean | undefined;
|
|
227
|
-
circle?: boolean | undefined;
|
|
228
|
-
polygon?: boolean | undefined;
|
|
229
|
-
point?: boolean | undefined;
|
|
230
|
-
quadratic?: boolean | undefined;
|
|
231
|
-
sinusoid?: boolean | undefined;
|
|
232
|
-
angle?: boolean | undefined;
|
|
233
|
-
"linear-system"?: boolean | undefined;
|
|
234
|
-
ray?: boolean | undefined;
|
|
235
|
-
segment?: boolean | undefined;
|
|
236
|
-
"unlimited-polygon"?: boolean | undefined;
|
|
237
|
-
"unlimited-point"?: boolean | undefined;
|
|
238
|
-
} & {
|
|
239
|
-
"interactive-graph-locked-features-labels"?: boolean | undefined;
|
|
240
|
-
"locked-figures-aria"?: boolean | undefined;
|
|
241
|
-
"locked-point-labels"?: boolean | undefined;
|
|
242
|
-
"locked-line-labels"?: boolean | undefined;
|
|
243
|
-
"locked-vector-labels"?: boolean | undefined;
|
|
244
|
-
"locked-ellipse-labels"?: boolean | undefined;
|
|
245
|
-
"locked-polygon-labels"?: boolean | undefined;
|
|
246
|
-
"locked-function-labels"?: boolean | undefined;
|
|
247
|
-
}) | undefined;
|
|
248
|
-
} | undefined;
|
|
249
|
-
onWidgetStartProps?: ((widgets: import("../../perseus-types").PerseusWidgetsMap) => void) | undefined;
|
|
250
|
-
}> & {
|
|
251
|
-
GroupMetadataEditor: NonNullable<React.ComponentType<any> | undefined>;
|
|
252
|
-
baseElements: {
|
|
253
|
-
Link: React.ComponentType<any>;
|
|
254
|
-
};
|
|
255
|
-
canScrollPage: NonNullable<boolean | undefined>;
|
|
256
|
-
crossOutEnabled: NonNullable<boolean | undefined>;
|
|
257
|
-
editorChangeDelay: number;
|
|
258
|
-
groupAnnotator: (groupNumber: number, widgetId: string) => React.ReactNode;
|
|
259
|
-
isArticle: NonNullable<boolean | undefined>;
|
|
260
|
-
isMobile: NonNullable<boolean | undefined>;
|
|
261
|
-
onFocusChange: (newFocusPath: FocusPath, oldFocusPath: FocusPath, keypadHeight?: number | undefined, focusedElement?: HTMLElement | undefined) => unknown;
|
|
262
|
-
readOnly: NonNullable<boolean | undefined>;
|
|
263
|
-
setDrawingAreaAvailable: (arg1: boolean) => unknown;
|
|
264
|
-
showAlignmentOptions: NonNullable<boolean | undefined>;
|
|
265
|
-
}>;
|
|
266
|
-
buttonSets: import("../../perseus-types").LegacyButtonSets;
|
|
267
|
-
functions: readonly string[];
|
|
268
|
-
linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
|
|
269
|
-
onBlur: (blurPath: FocusPath) => void;
|
|
270
|
-
onFocus: (blurPath: FocusPath) => void;
|
|
271
|
-
times: boolean;
|
|
272
|
-
visibleLabel: string | undefined;
|
|
273
|
-
ariaLabel: string | undefined;
|
|
164
|
+
} & Partial<import("../..").PerseusDependenciesV2> & {
|
|
165
|
+
apiOptions: NonNullable<ExternalProps["apiOptions"]>;
|
|
166
|
+
buttonSets: NonNullable<ExternalProps["buttonSets"]>;
|
|
167
|
+
functions: NonNullable<ExternalProps["functions"]>;
|
|
168
|
+
linterContext: NonNullable<ExternalProps["linterContext"]>;
|
|
169
|
+
onBlur: NonNullable<ExternalProps["onBlur"]>;
|
|
170
|
+
onFocus: NonNullable<ExternalProps["onFocus"]>;
|
|
171
|
+
times: NonNullable<ExternalProps["times"]>;
|
|
172
|
+
visibleLabel: PerseusExpressionWidgetOptions["visibleLabel"];
|
|
173
|
+
ariaLabel: PerseusExpressionWidgetOptions["ariaLabel"];
|
|
274
174
|
value: string;
|
|
275
|
-
}, "ariaLabel" | "static" | "onChange" | "keypadElement" | "containerSizeClass" | "widgetId" | "problemNum" | "questionCompleted" | "findWidgets" | "trackInteraction" | "reviewMode" | keyof import("
|
|
175
|
+
}, "ariaLabel" | "static" | "onChange" | "keypadElement" | "containerSizeClass" | "widgetId" | "problemNum" | "questionCompleted" | "findWidgets" | "trackInteraction" | "reviewMode" | keyof import("../..").PerseusDependenciesV2 | "alignment" | "reviewModeRubric" | "isLastUsedWidget" | "visibleLabel" | "buttonsVisible" | "keypadConfiguration"> & {
|
|
276
176
|
value?: string | undefined;
|
|
277
177
|
onFocus?: ((blurPath: FocusPath) => void) | undefined;
|
|
278
178
|
onBlur?: ((blurPath: FocusPath) => void) | undefined;
|
|
279
179
|
apiOptions?: Readonly<Readonly<{
|
|
280
|
-
isArticle?: boolean
|
|
281
|
-
onFocusChange?: (
|
|
282
|
-
GroupMetadataEditor?: React.ComponentType<any
|
|
283
|
-
showAlignmentOptions?: boolean
|
|
284
|
-
readOnly?: boolean
|
|
285
|
-
answerableCallback?: (
|
|
286
|
-
getAnotherHint?: (
|
|
287
|
-
interactionCallback?: (
|
|
180
|
+
isArticle?: boolean;
|
|
181
|
+
onFocusChange?: (newFocusPath: FocusPath, oldFocusPath: FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
|
|
182
|
+
GroupMetadataEditor?: React.ComponentType<any>;
|
|
183
|
+
showAlignmentOptions?: boolean;
|
|
184
|
+
readOnly?: boolean;
|
|
185
|
+
answerableCallback?: (arg1: boolean) => unknown;
|
|
186
|
+
getAnotherHint?: () => unknown;
|
|
187
|
+
interactionCallback?: (widgetData: {
|
|
288
188
|
[widgetId: string]: any;
|
|
289
|
-
}) => void
|
|
290
|
-
groupAnnotator?: (
|
|
189
|
+
}) => void;
|
|
190
|
+
groupAnnotator?: (groupNumber: number, widgetId: string) => React.ReactNode;
|
|
291
191
|
imagePlaceholder?: React.ReactNode;
|
|
292
192
|
widgetPlaceholder?: React.ReactNode;
|
|
293
193
|
baseElements?: {
|
|
294
194
|
Link: React.ComponentType<any>;
|
|
295
|
-
}
|
|
296
|
-
imagePreloader?: (
|
|
297
|
-
trackInteraction?: (
|
|
195
|
+
};
|
|
196
|
+
imagePreloader?: (dimensions: import("../../types").Dimensions) => React.ReactNode;
|
|
197
|
+
trackInteraction?: (args: {
|
|
298
198
|
type: string;
|
|
299
199
|
id: string;
|
|
300
|
-
correct?: boolean
|
|
200
|
+
correct?: boolean;
|
|
301
201
|
} & Partial<import("../../types").TrackingGradedGroupExtraArguments> & Partial<{
|
|
302
202
|
visible: number;
|
|
303
|
-
}>) => void
|
|
304
|
-
customKeypad?: boolean
|
|
305
|
-
nativeKeypadProxy?: (
|
|
306
|
-
isMobile?: boolean
|
|
307
|
-
setDrawingAreaAvailable?: (
|
|
308
|
-
hintProgressColor?: string
|
|
309
|
-
canScrollPage?: boolean
|
|
310
|
-
crossOutEnabled?: boolean
|
|
311
|
-
editorChangeDelay?: number
|
|
203
|
+
}>) => void;
|
|
204
|
+
customKeypad?: boolean;
|
|
205
|
+
nativeKeypadProxy?: (blur: () => void) => import("@khanacademy/math-input").KeypadAPI;
|
|
206
|
+
isMobile?: boolean;
|
|
207
|
+
setDrawingAreaAvailable?: (arg1: boolean) => unknown;
|
|
208
|
+
hintProgressColor?: string;
|
|
209
|
+
canScrollPage?: boolean;
|
|
210
|
+
crossOutEnabled?: boolean;
|
|
211
|
+
editorChangeDelay?: number;
|
|
312
212
|
flags?: {
|
|
313
|
-
mafs?: false | ({
|
|
314
|
-
none?: boolean | undefined;
|
|
315
|
-
linear?: boolean | undefined;
|
|
316
|
-
circle?: boolean | undefined;
|
|
317
|
-
polygon?: boolean | undefined;
|
|
318
|
-
point?: boolean | undefined;
|
|
319
|
-
quadratic?: boolean | undefined;
|
|
320
|
-
sinusoid?: boolean | undefined;
|
|
321
|
-
angle?: boolean | undefined;
|
|
322
|
-
"linear-system"?: boolean | undefined;
|
|
323
|
-
ray?: boolean | undefined;
|
|
324
|
-
segment?: boolean | undefined;
|
|
325
|
-
"unlimited-polygon"?: boolean | undefined;
|
|
326
|
-
"unlimited-point"?: boolean | undefined;
|
|
327
|
-
} & {
|
|
328
|
-
"interactive-graph-locked-features-labels"?: boolean | undefined;
|
|
329
|
-
"locked-figures-aria"?: boolean | undefined;
|
|
330
|
-
"locked-point-labels"?: boolean | undefined;
|
|
331
|
-
"locked-line-labels"?: boolean | undefined;
|
|
332
|
-
"locked-vector-labels"?: boolean | undefined;
|
|
333
|
-
"locked-ellipse-labels"?: boolean | undefined;
|
|
334
|
-
"locked-polygon-labels"?: boolean | undefined;
|
|
335
|
-
"locked-function-labels"?: boolean | undefined;
|
|
336
|
-
}) | undefined;
|
|
337
|
-
} | undefined;
|
|
338
|
-
onWidgetStartProps?: ((widgets: import("../../perseus-types").PerseusWidgetsMap) => void) | undefined;
|
|
339
|
-
}> & {
|
|
340
|
-
GroupMetadataEditor: NonNullable<React.ComponentType<any> | undefined>;
|
|
341
|
-
baseElements: {
|
|
342
|
-
Link: React.ComponentType<any>;
|
|
213
|
+
mafs?: false | ({ [Key in typeof import("../../types").MafsGraphTypeFlags[number]]?: boolean; } & { [Key in typeof import("../../types").InteractiveGraphLockedFeaturesFlags[number]]?: boolean; });
|
|
343
214
|
};
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
215
|
+
onWidgetStartProps?: (widgets: import("../..").PerseusWidgetsMap) => void;
|
|
216
|
+
}> & {
|
|
217
|
+
GroupMetadataEditor: NonNullable<import("../..").APIOptions["GroupMetadataEditor"]>;
|
|
218
|
+
baseElements: NonNullable<import("../..").APIOptions["baseElements"]>;
|
|
219
|
+
canScrollPage: NonNullable<import("../..").APIOptions["canScrollPage"]>;
|
|
220
|
+
crossOutEnabled: NonNullable<import("../..").APIOptions["crossOutEnabled"]>;
|
|
221
|
+
editorChangeDelay: NonNullable<import("../..").APIOptions["editorChangeDelay"]>;
|
|
222
|
+
groupAnnotator: NonNullable<import("../..").APIOptions["groupAnnotator"]>;
|
|
223
|
+
isArticle: NonNullable<import("../..").APIOptions["isArticle"]>;
|
|
224
|
+
isMobile: NonNullable<import("../..").APIOptions["isMobile"]>;
|
|
225
|
+
onFocusChange: NonNullable<import("../..").APIOptions["onFocusChange"]>;
|
|
226
|
+
readOnly: NonNullable<import("../..").APIOptions["readOnly"]>;
|
|
227
|
+
setDrawingAreaAvailable: NonNullable<import("../..").APIOptions["setDrawingAreaAvailable"]>;
|
|
228
|
+
showAlignmentOptions: NonNullable<import("../..").APIOptions["showAlignmentOptions"]>;
|
|
354
229
|
}> | undefined;
|
|
355
230
|
linterContext?: import("@khanacademy/perseus-linter").LinterContextProps | undefined;
|
|
356
|
-
buttonSets?: import("
|
|
231
|
+
buttonSets?: import("../..").LegacyButtonSets | undefined;
|
|
357
232
|
functions?: readonly string[] | undefined;
|
|
358
233
|
times?: boolean | undefined;
|
|
359
|
-
} & {}, keyof import("
|
|
234
|
+
} & {}, keyof import("../..").PerseusDependenciesV2> & React.RefAttributes<Expression>>;
|
|
360
235
|
transform: (widgetOptions: PerseusExpressionWidgetOptions) => RenderProps;
|
|
361
236
|
version: {
|
|
362
237
|
major: number;
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { CSSCursor } from "./css-cursor";
|
|
3
|
+
import type { AriaLive } from "../../types";
|
|
3
4
|
import type { KeyboardMovementConstraint } from "../use-draggable";
|
|
4
5
|
import type { vec } from "mafs";
|
|
5
6
|
type Props = {
|
|
6
7
|
point: vec.Vector2;
|
|
8
|
+
ariaDescribedBy?: string;
|
|
9
|
+
ariaLabel?: string;
|
|
10
|
+
ariaLive?: AriaLive;
|
|
11
|
+
color?: string;
|
|
12
|
+
constrain?: KeyboardMovementConstraint;
|
|
13
|
+
cursor?: CSSCursor | undefined;
|
|
7
14
|
/**
|
|
8
15
|
* Represents where this point stands in the overall point sequence.
|
|
9
16
|
* This is used to provide screen readers with context about the point.
|
|
@@ -12,14 +19,11 @@ type Props = {
|
|
|
12
19
|
* Note: This number is 1-indexed, and should restart from 1 for each
|
|
13
20
|
* interactive figure on the graph.
|
|
14
21
|
*/
|
|
15
|
-
sequenceNumber
|
|
16
|
-
|
|
22
|
+
sequenceNumber?: number;
|
|
23
|
+
onBlur?: (event: React.FocusEvent) => unknown;
|
|
17
24
|
onClick?: () => unknown;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
constrain?: KeyboardMovementConstraint;
|
|
21
|
-
onFocus?: ((event: React.FocusEvent) => unknown) | undefined;
|
|
22
|
-
onBlur?: ((event: React.FocusEvent) => unknown) | undefined;
|
|
25
|
+
onFocus?: (event: React.FocusEvent) => unknown;
|
|
26
|
+
onMove?: (newPoint: vec.Vector2) => unknown;
|
|
23
27
|
};
|
|
24
28
|
export declare const MovablePoint: React.ForwardRefExoticComponent<Props & React.RefAttributes<SVGGElement | null>>;
|
|
25
29
|
export {};
|