@khanacademy/perseus 31.1.0 → 32.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/components/input-with-examples.d.ts +1 -1
- package/dist/components/number-input.d.ts +1 -1
- package/dist/components/range-input.d.ts +1 -1
- package/dist/components/sortable.d.ts +5 -5
- package/dist/components/text-input.d.ts +1 -1
- package/dist/components/text-list-editor.d.ts +1 -1
- package/dist/es/index.js +529 -479
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1348 -1305
- package/dist/index.js.map +1 -1
- package/dist/perseus-types.d.ts +1 -10
- package/dist/widget-container.d.ts +1 -1
- package/dist/widgets/__shared__/test-keypad-context-wrapper.d.ts +6 -0
- package/dist/widgets/{categorizer.d.ts → categorizer/categorizer.d.ts} +14 -14
- package/dist/widgets/categorizer/index.d.ts +1 -0
- package/dist/widgets/{cs-program.d.ts → cs-program/cs-program.d.ts} +7 -7
- package/dist/widgets/cs-program/index.d.ts +1 -0
- package/dist/widgets/{definition.d.ts → definition/definition.d.ts} +11 -11
- package/dist/widgets/definition/index.d.ts +1 -0
- package/dist/widgets/{dropdown.d.ts → dropdown/dropdown.d.ts} +9 -9
- package/dist/widgets/dropdown/index.d.ts +1 -0
- package/dist/widgets/{explanation.d.ts → explanation/explanation.d.ts} +14 -14
- package/dist/widgets/explanation/index.d.ts +1 -0
- package/dist/widgets/{expression.d.ts → expression/expression.d.ts} +66 -66
- package/dist/widgets/expression/index.d.ts +1 -0
- package/dist/widgets/{graded-group-answer-bar.d.ts → graded-group/graded-group-answer-bar.d.ts} +3 -3
- package/dist/widgets/{graded-group.d.ts → graded-group/graded-group.d.ts} +11 -11
- package/dist/widgets/graded-group/index.d.ts +1 -0
- package/dist/widgets/{graded-group-set.d.ts → graded-group-set/graded-group-set.d.ts} +11 -11
- package/dist/widgets/graded-group-set/index.d.ts +1 -0
- package/dist/widgets/{grapher.d.ts → grapher/grapher.d.ts} +15 -15
- package/dist/widgets/grapher/index.d.ts +1 -0
- package/dist/widgets/{group.d.ts → group/group.d.ts} +12 -12
- package/dist/widgets/group/index.d.ts +1 -0
- package/dist/widgets/{iframe.d.ts → iframe/iframe.d.ts} +10 -10
- package/dist/widgets/iframe/index.d.ts +1 -0
- package/dist/widgets/{image.d.ts → image/image.d.ts} +12 -12
- package/dist/widgets/image/index.d.ts +1 -0
- package/dist/widgets/input-number/index.d.ts +1 -0
- package/dist/widgets/{input-number.d.ts → input-number/input-number.d.ts} +19 -19
- package/dist/widgets/interaction/index.d.ts +1 -0
- package/dist/widgets/{interaction.d.ts → interaction/interaction.d.ts} +12 -12
- package/dist/widgets/interactive-graphs/reducer/interactive-graph-action.d.ts +22 -1
- package/dist/widgets/interactive-graphs/types.d.ts +1 -0
- package/dist/widgets/label-image/index.d.ts +1 -0
- package/dist/widgets/{label-image.d.ts → label-image/label-image.d.ts} +24 -24
- package/dist/widgets/matcher/index.d.ts +1 -0
- package/dist/widgets/{matcher.d.ts → matcher/matcher.d.ts} +11 -11
- package/dist/widgets/matrix/index.d.ts +1 -0
- package/dist/widgets/{matrix.d.ts → matrix/matrix.d.ts} +12 -12
- package/dist/widgets/measurer/index.d.ts +1 -0
- package/dist/widgets/measurer/measurer.d.ts +21 -0
- package/dist/widgets/molecule/index.d.ts +1 -0
- package/dist/widgets/{molecule.d.ts → molecule/molecule.d.ts} +10 -10
- package/dist/widgets/number-line/index.d.ts +1 -0
- package/dist/widgets/{number-line.d.ts → number-line/number-line.d.ts} +11 -11
- package/dist/widgets/numeric-input/index.d.ts +1 -0
- package/dist/widgets/{numeric-input.d.ts → numeric-input/numeric-input.d.ts} +13 -13
- package/dist/widgets/orderer/index.d.ts +1 -0
- package/dist/widgets/{orderer.d.ts → orderer/orderer.d.ts} +10 -10
- package/dist/widgets/passage/index.d.ts +2 -0
- package/dist/widgets/{passage.d.ts → passage/passage.d.ts} +15 -15
- package/dist/widgets/passage-ref/index.d.ts +1 -0
- package/dist/widgets/{passage-ref.d.ts → passage-ref/passage-ref.d.ts} +16 -16
- package/dist/widgets/passage-ref-target/index.d.ts +1 -0
- package/dist/widgets/{passage-ref-target.d.ts → passage-ref-target/passage-ref-target.d.ts} +12 -12
- package/dist/widgets/phet-simulation/index.d.ts +1 -0
- package/dist/widgets/{phet-simulation.d.ts → phet-simulation/phet-simulation.d.ts} +11 -13
- package/dist/widgets/plotter/index.d.ts +1 -0
- package/dist/widgets/{plotter.d.ts → plotter/plotter.d.ts} +11 -11
- package/dist/widgets/python-program/index.d.ts +1 -0
- package/dist/widgets/{python-program.d.ts → python-program/python-program.d.ts} +7 -7
- package/dist/widgets/radio/index.d.ts +2 -0
- package/dist/widgets/radio/radio-component.d.ts +66 -0
- package/dist/widgets/radio/radio.d.ts +22 -66
- package/dist/widgets/sorter/index.d.ts +1 -0
- package/dist/widgets/{sorter.d.ts → sorter/sorter.d.ts} +8 -8
- package/dist/widgets/table/index.d.ts +1 -0
- package/dist/widgets/{table.d.ts → table/table.d.ts} +10 -10
- package/dist/widgets/video/index.d.ts +1 -0
- package/dist/widgets/{video.d.ts → video/video.d.ts} +11 -11
- package/package.json +1 -1
- package/dist/widgets/measurer.d.ts +0 -21
- package/dist/widgets/radio.d.ts +0 -22
- /package/dist/widgets/{video-transcript-link.d.ts → video/video-transcript-link.d.ts} +0 -0
|
@@ -21,13 +21,13 @@ declare class Iframe extends React.Component<any> {
|
|
|
21
21
|
onChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
22
22
|
};
|
|
23
23
|
static defaultProps: any;
|
|
24
|
-
getUserInput: () => any;
|
|
25
|
-
handleMessageEvent: (arg1: any) => void;
|
|
26
24
|
componentDidMount(): void;
|
|
27
25
|
componentWillUnmount(): void;
|
|
28
|
-
|
|
26
|
+
getUserInput: () => any;
|
|
27
|
+
handleMessageEvent: (arg1: any) => void;
|
|
29
28
|
change: (...args: ReadonlyArray<unknown>) => any;
|
|
30
29
|
simpleValidate: (arg1: any) => any;
|
|
30
|
+
render(): React.ReactNode;
|
|
31
31
|
}
|
|
32
32
|
declare const _default: Readonly<{
|
|
33
33
|
name: string;
|
|
@@ -36,15 +36,15 @@ declare const _default: Readonly<{
|
|
|
36
36
|
widget: typeof Iframe;
|
|
37
37
|
accessible?: boolean | ((props: any) => boolean) | undefined;
|
|
38
38
|
hidden?: boolean | undefined;
|
|
39
|
-
version?: import("
|
|
40
|
-
supportedAlignments?: readonly import("
|
|
41
|
-
defaultAlignment?: import("
|
|
42
|
-
getDefaultAlignment?: (() => import("
|
|
39
|
+
version?: import("../../types").Version | undefined;
|
|
40
|
+
supportedAlignments?: readonly import("../../types").Alignment[] | undefined;
|
|
41
|
+
defaultAlignment?: import("../../types").Alignment | undefined;
|
|
42
|
+
getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
|
|
43
43
|
isLintable?: boolean | undefined;
|
|
44
|
-
tracking?: import("
|
|
44
|
+
tracking?: import("../../types").Tracking | undefined;
|
|
45
45
|
traverseChildWidgets?: any;
|
|
46
|
-
transform?: import("
|
|
47
|
-
staticTransform?: import("
|
|
46
|
+
transform?: import("../../types").WidgetTransform | undefined;
|
|
47
|
+
staticTransform?: import("../../types").WidgetTransform | undefined;
|
|
48
48
|
propUpgrades?: {
|
|
49
49
|
[key: string]: (arg1: any) => any;
|
|
50
50
|
} | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./iframe";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { PerseusI18nContext } from "
|
|
3
|
-
import type { PerseusImageWidgetOptions } from "
|
|
4
|
-
import type { ChangeFn, PerseusScore, WidgetProps } from "
|
|
2
|
+
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
3
|
+
import type { PerseusImageWidgetOptions } from "../../perseus-types";
|
|
4
|
+
import type { ChangeFn, PerseusScore, WidgetProps } from "../../types";
|
|
5
5
|
type RenderProps = PerseusImageWidgetOptions;
|
|
6
6
|
type Rubric = PerseusImageWidgetOptions;
|
|
7
7
|
type UserInput = null;
|
|
@@ -30,17 +30,17 @@ type DefaultProps = {
|
|
|
30
30
|
};
|
|
31
31
|
declare class ImageWidget extends React.Component<Props> {
|
|
32
32
|
static contextType: React.Context<{
|
|
33
|
-
strings: import("
|
|
33
|
+
strings: import("../../strings").PerseusStrings;
|
|
34
34
|
locale: string;
|
|
35
35
|
}>;
|
|
36
36
|
context: React.ContextType<typeof PerseusI18nContext>;
|
|
37
37
|
static defaultProps: DefaultProps;
|
|
38
|
+
static validate(userInput: UserInput, rubric: Rubric): PerseusScore;
|
|
38
39
|
change: ChangeFn;
|
|
39
40
|
getUserInput: () => UserInput;
|
|
40
41
|
simpleValidate: (arg1: Rubric) => PerseusScore;
|
|
41
42
|
focus: () => void;
|
|
42
43
|
render(): React.ReactNode;
|
|
43
|
-
static validate(userInput: UserInput, rubric: Rubric): PerseusScore;
|
|
44
44
|
}
|
|
45
45
|
declare const _default: Readonly<{
|
|
46
46
|
name: string;
|
|
@@ -49,15 +49,15 @@ declare const _default: Readonly<{
|
|
|
49
49
|
widget: typeof ImageWidget;
|
|
50
50
|
accessible?: boolean | ((props: any) => boolean) | undefined;
|
|
51
51
|
hidden?: boolean | undefined;
|
|
52
|
-
version?: import("
|
|
53
|
-
supportedAlignments?: readonly import("
|
|
54
|
-
defaultAlignment?: import("
|
|
55
|
-
getDefaultAlignment?: (() => import("
|
|
52
|
+
version?: import("../../types").Version | undefined;
|
|
53
|
+
supportedAlignments?: readonly import("../../types").Alignment[] | undefined;
|
|
54
|
+
defaultAlignment?: import("../../types").Alignment | undefined;
|
|
55
|
+
getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
|
|
56
56
|
isLintable?: boolean | undefined;
|
|
57
|
-
tracking?: import("
|
|
57
|
+
tracking?: import("../../types").Tracking | undefined;
|
|
58
58
|
traverseChildWidgets?: any;
|
|
59
|
-
transform?: import("
|
|
60
|
-
staticTransform?: import("
|
|
59
|
+
transform?: import("../../types").WidgetTransform | undefined;
|
|
60
|
+
staticTransform?: import("../../types").WidgetTransform | undefined;
|
|
61
61
|
propUpgrades?: {
|
|
62
62
|
[key: string]: (arg1: any) => any;
|
|
63
63
|
} | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./image";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./input-number";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { PerseusI18nContext } from "
|
|
3
|
-
import type { PerseusInputNumberWidgetOptions } from "
|
|
4
|
-
import type { PerseusStrings } from "
|
|
5
|
-
import type { APIOptions, Path, PerseusScore, WidgetProps } from "
|
|
2
|
+
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
3
|
+
import type { PerseusInputNumberWidgetOptions } from "../../perseus-types";
|
|
4
|
+
import type { PerseusStrings } from "../../strings";
|
|
5
|
+
import type { APIOptions, Path, PerseusScore, WidgetProps } from "../../types";
|
|
6
6
|
type UserInput = {
|
|
7
7
|
currentValue: string;
|
|
8
8
|
};
|
|
@@ -37,8 +37,14 @@ declare class InputNumber extends React.Component<Props> {
|
|
|
37
37
|
}>;
|
|
38
38
|
context: React.ContextType<typeof PerseusI18nContext>;
|
|
39
39
|
static defaultProps: DefaultProps;
|
|
40
|
+
static validate(state: {
|
|
41
|
+
currentValue: string;
|
|
42
|
+
}, rubric: Rubric, strings: PerseusStrings, onInputError?: APIOptions["onInputError"]): PerseusScore;
|
|
43
|
+
static getUserInputFromProps(props: Props): {
|
|
44
|
+
currentValue: string;
|
|
45
|
+
};
|
|
46
|
+
static getOneCorrectAnswerFromRubric(rubric: any): string | null | undefined;
|
|
40
47
|
shouldShowExamples: () => boolean;
|
|
41
|
-
render(): React.ReactNode;
|
|
42
48
|
handleChange: (arg1: string, arg2: () => void) => void;
|
|
43
49
|
_handleFocus: () => void;
|
|
44
50
|
_handleBlur: () => void;
|
|
@@ -51,13 +57,7 @@ declare class InputNumber extends React.Component<Props> {
|
|
|
51
57
|
getUserInput: () => UserInput;
|
|
52
58
|
simpleValidate: (rubric: Rubric, onInputError?: APIOptions["onInputError"]) => PerseusScore;
|
|
53
59
|
examples: () => ReadonlyArray<string>;
|
|
54
|
-
|
|
55
|
-
currentValue: string;
|
|
56
|
-
}, rubric: Rubric, strings: PerseusStrings, onInputError?: APIOptions["onInputError"]): PerseusScore;
|
|
57
|
-
static getUserInputFromProps(props: Props): {
|
|
58
|
-
currentValue: string;
|
|
59
|
-
};
|
|
60
|
-
static getOneCorrectAnswerFromRubric(rubric: any): string | null | undefined;
|
|
60
|
+
render(): React.ReactNode;
|
|
61
61
|
}
|
|
62
62
|
declare const _default: Readonly<{
|
|
63
63
|
name: string;
|
|
@@ -66,15 +66,15 @@ declare const _default: Readonly<{
|
|
|
66
66
|
widget: typeof InputNumber;
|
|
67
67
|
accessible?: boolean | ((props: any) => boolean) | undefined;
|
|
68
68
|
hidden?: boolean | undefined;
|
|
69
|
-
version?: import("
|
|
70
|
-
supportedAlignments?: readonly import("
|
|
71
|
-
defaultAlignment?: import("
|
|
72
|
-
getDefaultAlignment?: (() => import("
|
|
69
|
+
version?: import("../../types").Version | undefined;
|
|
70
|
+
supportedAlignments?: readonly import("../../types").Alignment[] | undefined;
|
|
71
|
+
defaultAlignment?: import("../../types").Alignment | undefined;
|
|
72
|
+
getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
|
|
73
73
|
isLintable?: boolean | undefined;
|
|
74
|
-
tracking?: import("
|
|
74
|
+
tracking?: import("../../types").Tracking | undefined;
|
|
75
75
|
traverseChildWidgets?: any;
|
|
76
|
-
transform?: import("
|
|
77
|
-
staticTransform?: import("
|
|
76
|
+
transform?: import("../../types").WidgetTransform | undefined;
|
|
77
|
+
staticTransform?: import("../../types").WidgetTransform | undefined;
|
|
78
78
|
propUpgrades?: {
|
|
79
79
|
[key: string]: (arg1: any) => any;
|
|
80
80
|
} | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./interaction";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type { Coord } from "
|
|
3
|
-
import type { PerseusInteractionWidgetOptions } from "
|
|
4
|
-
import type { PerseusScore, WidgetProps } from "
|
|
2
|
+
import type { Coord } from "../../interactive2/types";
|
|
3
|
+
import type { PerseusInteractionWidgetOptions } from "../../perseus-types";
|
|
4
|
+
import type { PerseusScore, WidgetProps } from "../../types";
|
|
5
5
|
type RenderProps = PerseusInteractionWidgetOptions;
|
|
6
6
|
type Rubric = PerseusInteractionWidgetOptions;
|
|
7
7
|
type Props = WidgetProps<RenderProps, Rubric>;
|
|
@@ -15,6 +15,7 @@ type State = {
|
|
|
15
15
|
};
|
|
16
16
|
declare class Interaction extends React.Component<Props, State> {
|
|
17
17
|
static defaultProps: DefaultProps;
|
|
18
|
+
static validate(state: any, rubric: any): PerseusScore;
|
|
18
19
|
state: State;
|
|
19
20
|
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
20
21
|
_setupGraphie: (arg1: any, arg2: any) => void;
|
|
@@ -23,10 +24,9 @@ declare class Interaction extends React.Component<Props, State> {
|
|
|
23
24
|
_eval: (arg1: any, arg2: any) => number;
|
|
24
25
|
_extractVars: (arg1: any) => ReadonlyArray<any>;
|
|
25
26
|
change: (arg1: any, arg2: any, arg3: any) => any;
|
|
26
|
-
render(): React.ReactNode;
|
|
27
27
|
getUserInput: () => any;
|
|
28
28
|
simpleValidate: (arg1: any) => any;
|
|
29
|
-
|
|
29
|
+
render(): React.ReactNode;
|
|
30
30
|
}
|
|
31
31
|
declare const _default: Readonly<{
|
|
32
32
|
name: string;
|
|
@@ -35,15 +35,15 @@ declare const _default: Readonly<{
|
|
|
35
35
|
widget: typeof Interaction;
|
|
36
36
|
accessible?: boolean | ((props: any) => boolean) | undefined;
|
|
37
37
|
hidden?: boolean | undefined;
|
|
38
|
-
version?: import("
|
|
39
|
-
supportedAlignments?: readonly import("
|
|
40
|
-
defaultAlignment?: import("
|
|
41
|
-
getDefaultAlignment?: (() => import("
|
|
38
|
+
version?: import("../../types").Version | undefined;
|
|
39
|
+
supportedAlignments?: readonly import("../../types").Alignment[] | undefined;
|
|
40
|
+
defaultAlignment?: import("../../types").Alignment | undefined;
|
|
41
|
+
getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
|
|
42
42
|
isLintable?: boolean | undefined;
|
|
43
|
-
tracking?: import("
|
|
43
|
+
tracking?: import("../../types").Tracking | undefined;
|
|
44
44
|
traverseChildWidgets?: any;
|
|
45
|
-
transform?: import("
|
|
46
|
-
staticTransform?: import("
|
|
45
|
+
transform?: import("../../types").WidgetTransform | undefined;
|
|
46
|
+
staticTransform?: import("../../types").WidgetTransform | undefined;
|
|
47
47
|
propUpgrades?: {
|
|
48
48
|
[key: string]: (arg1: any) => any;
|
|
49
49
|
} | undefined;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { InitializeGraphStateParams } from "./initialize-graph-state";
|
|
2
2
|
import type { Interval, vec } from "mafs";
|
|
3
|
-
export type InteractiveGraphAction = Reinitialize | MovePointInFigure | MoveLine | MoveAll | MovePoint | MoveCenter | MoveRadiusPoint | ChangeSnapStep | ChangeRange | AddPoint | RemovePoint;
|
|
3
|
+
export type InteractiveGraphAction = Reinitialize | MovePointInFigure | MoveLine | MoveAll | MovePoint | MoveCenter | MoveRadiusPoint | ChangeSnapStep | ChangeRange | AddPoint | RemovePoint | FocusPoint | BlurPoint | DeleteIntent;
|
|
4
4
|
export declare const actions: {
|
|
5
|
+
global: {
|
|
6
|
+
deleteIntent: typeof deleteIntent;
|
|
7
|
+
};
|
|
5
8
|
angle: {
|
|
6
9
|
movePoint: typeof movePoint;
|
|
7
10
|
};
|
|
@@ -21,6 +24,8 @@ export declare const actions: {
|
|
|
21
24
|
movePoint: typeof movePoint;
|
|
22
25
|
addPoint: typeof addPoint;
|
|
23
26
|
removePoint: typeof removePoint;
|
|
27
|
+
focusPoint: typeof focusPoint;
|
|
28
|
+
blurPoint: typeof blurPoint;
|
|
24
29
|
};
|
|
25
30
|
polygon: {
|
|
26
31
|
movePoint: typeof movePoint;
|
|
@@ -41,6 +46,11 @@ export declare const actions: {
|
|
|
41
46
|
movePoint: typeof movePoint;
|
|
42
47
|
};
|
|
43
48
|
};
|
|
49
|
+
export declare const DELETE_INTENT = "delete-intent";
|
|
50
|
+
export interface DeleteIntent {
|
|
51
|
+
type: typeof DELETE_INTENT;
|
|
52
|
+
}
|
|
53
|
+
declare function deleteIntent(): DeleteIntent;
|
|
44
54
|
export declare const MOVE_LINE = "move-line";
|
|
45
55
|
export interface MoveLine {
|
|
46
56
|
type: typeof MOVE_LINE;
|
|
@@ -60,6 +70,17 @@ export interface RemovePoint {
|
|
|
60
70
|
index: number;
|
|
61
71
|
}
|
|
62
72
|
declare function removePoint(index: number): RemovePoint;
|
|
73
|
+
export declare const FOCUS_POINT = "focus-point";
|
|
74
|
+
export interface FocusPoint {
|
|
75
|
+
type: typeof FOCUS_POINT;
|
|
76
|
+
index: number;
|
|
77
|
+
}
|
|
78
|
+
declare function focusPoint(index: number): FocusPoint;
|
|
79
|
+
export declare const BLUR_POINT = "blur-point";
|
|
80
|
+
export interface BlurPoint {
|
|
81
|
+
type: typeof BLUR_POINT;
|
|
82
|
+
}
|
|
83
|
+
declare function blurPoint(): BlurPoint;
|
|
63
84
|
export declare const MOVE_ALL = "move-all";
|
|
64
85
|
export interface MoveAll {
|
|
65
86
|
type: typeof MOVE_ALL;
|
|
@@ -30,6 +30,7 @@ export interface PointGraphState extends InteractiveGraphStateCommon {
|
|
|
30
30
|
type: "point";
|
|
31
31
|
coords: Coord[];
|
|
32
32
|
numPoints?: number | "unlimited";
|
|
33
|
+
focusedPointIndex: number | null;
|
|
33
34
|
}
|
|
34
35
|
export interface RayGraphState extends InteractiveGraphStateCommon {
|
|
35
36
|
type: "ray";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./label-image";
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
* knowledge by directly interacting with the image.
|
|
7
7
|
*/
|
|
8
8
|
import * as React from "react";
|
|
9
|
-
import { PerseusI18nContext } from "
|
|
10
|
-
import Marker from "./
|
|
11
|
-
import type { InteractiveMarkerType, InteractiveMarkerScore } from "./
|
|
12
|
-
import type { DependencyProps } from "
|
|
13
|
-
import type { ChangeableProps } from "
|
|
14
|
-
import type { APIOptions, PerseusScore } from "
|
|
9
|
+
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
10
|
+
import Marker from "./marker";
|
|
11
|
+
import type { InteractiveMarkerType, InteractiveMarkerScore } from "./types";
|
|
12
|
+
import type { DependencyProps } from "../../dependencies";
|
|
13
|
+
import type { ChangeableProps } from "../../mixins/changeable";
|
|
14
|
+
import type { APIOptions, PerseusScore } from "../../types";
|
|
15
15
|
export type PreferredPopoverDirection = "NONE" | "UP" | "DOWN" | "LEFT" | "RIGHT";
|
|
16
16
|
type MarkersState = {
|
|
17
17
|
markers: ReadonlyArray<InteractiveMarkerType>;
|
|
@@ -54,7 +54,7 @@ type LabelImageState = {
|
|
|
54
54
|
};
|
|
55
55
|
export declare class LabelImage extends React.Component<LabelImageProps, LabelImageState> {
|
|
56
56
|
static contextType: React.Context<{
|
|
57
|
-
strings: import("
|
|
57
|
+
strings: import("../../strings").PerseusStrings;
|
|
58
58
|
locale: string;
|
|
59
59
|
}>;
|
|
60
60
|
context: React.ContextType<typeof PerseusI18nContext>;
|
|
@@ -96,11 +96,11 @@ export declare class LabelImage extends React.Component<LabelImageProps, LabelIm
|
|
|
96
96
|
declare const _default: Readonly<{
|
|
97
97
|
name: string;
|
|
98
98
|
displayName: string;
|
|
99
|
-
getWidget?: (() => React.ForwardRefExoticComponent<Omit<ChangeableProps & Partial<import("
|
|
99
|
+
getWidget?: (() => React.ForwardRefExoticComponent<Omit<ChangeableProps & Partial<import("../../types").PerseusDependenciesV2> & {
|
|
100
100
|
apiOptions: Readonly<{
|
|
101
101
|
isArticle?: boolean | undefined;
|
|
102
102
|
onInputError?: ((widgetId: any, value: string, message?: string | null | undefined) => unknown) | undefined;
|
|
103
|
-
onFocusChange?: ((newFocusPath: import("
|
|
103
|
+
onFocusChange?: ((newFocusPath: import("../../types").FocusPath, oldFocusPath: import("../../types").FocusPath, keypadHeight?: number | undefined, focusedElement?: HTMLElement | undefined) => unknown) | undefined;
|
|
104
104
|
GroupMetadataEditor?: React.ComponentType<any> | undefined;
|
|
105
105
|
showAlignmentOptions?: boolean | undefined;
|
|
106
106
|
readOnly?: boolean | undefined;
|
|
@@ -115,12 +115,12 @@ declare const _default: Readonly<{
|
|
|
115
115
|
baseElements?: {
|
|
116
116
|
Link: React.ComponentType<any>;
|
|
117
117
|
} | undefined;
|
|
118
|
-
imagePreloader?: ((dimensions: import("
|
|
118
|
+
imagePreloader?: ((dimensions: import("../../types").Dimensions) => React.ReactNode) | undefined;
|
|
119
119
|
trackInteraction?: ((args: {
|
|
120
120
|
type: string;
|
|
121
121
|
id: string;
|
|
122
122
|
correct?: boolean | undefined;
|
|
123
|
-
} & Partial<import("
|
|
123
|
+
} & Partial<import("../../types").TrackingGradedGroupExtraArguments> & Partial<import("../../types").TrackingSequenceExtraArguments>) => void) | undefined;
|
|
124
124
|
customKeypad?: boolean | undefined;
|
|
125
125
|
nativeKeypadProxy?: ((blur: () => void) => import("@khanacademy/math-input").KeypadAPI) | undefined;
|
|
126
126
|
isMobile?: boolean | undefined;
|
|
@@ -153,7 +153,7 @@ declare const _default: Readonly<{
|
|
|
153
153
|
"start-coords-ui-angle"?: boolean | undefined;
|
|
154
154
|
}) | undefined;
|
|
155
155
|
} | undefined;
|
|
156
|
-
onWidgetStartProps?: ((widgets: import("
|
|
156
|
+
onWidgetStartProps?: ((widgets: import("../..").PerseusWidgetsMap) => void) | undefined;
|
|
157
157
|
}>;
|
|
158
158
|
choices: readonly string[];
|
|
159
159
|
imageAlt: string;
|
|
@@ -166,11 +166,11 @@ declare const _default: Readonly<{
|
|
|
166
166
|
questionCompleted: boolean;
|
|
167
167
|
preferredPopoverDirection?: PreferredPopoverDirection | undefined;
|
|
168
168
|
}, "analytics"> & React.RefAttributes<LabelImage>>) | undefined;
|
|
169
|
-
widget: React.ForwardRefExoticComponent<Omit<ChangeableProps & Partial<import("
|
|
169
|
+
widget: React.ForwardRefExoticComponent<Omit<ChangeableProps & Partial<import("../../types").PerseusDependenciesV2> & {
|
|
170
170
|
apiOptions: Readonly<{
|
|
171
171
|
isArticle?: boolean | undefined;
|
|
172
172
|
onInputError?: ((widgetId: any, value: string, message?: string | null | undefined) => unknown) | undefined;
|
|
173
|
-
onFocusChange?: ((newFocusPath: import("
|
|
173
|
+
onFocusChange?: ((newFocusPath: import("../../types").FocusPath, oldFocusPath: import("../../types").FocusPath, keypadHeight?: number | undefined, focusedElement?: HTMLElement | undefined) => unknown) | undefined;
|
|
174
174
|
GroupMetadataEditor?: React.ComponentType<any> | undefined;
|
|
175
175
|
showAlignmentOptions?: boolean | undefined;
|
|
176
176
|
readOnly?: boolean | undefined;
|
|
@@ -185,12 +185,12 @@ declare const _default: Readonly<{
|
|
|
185
185
|
baseElements?: {
|
|
186
186
|
Link: React.ComponentType<any>;
|
|
187
187
|
} | undefined;
|
|
188
|
-
imagePreloader?: ((dimensions: import("
|
|
188
|
+
imagePreloader?: ((dimensions: import("../../types").Dimensions) => React.ReactNode) | undefined;
|
|
189
189
|
trackInteraction?: ((args: {
|
|
190
190
|
type: string;
|
|
191
191
|
id: string;
|
|
192
192
|
correct?: boolean | undefined;
|
|
193
|
-
} & Partial<import("
|
|
193
|
+
} & Partial<import("../../types").TrackingGradedGroupExtraArguments> & Partial<import("../../types").TrackingSequenceExtraArguments>) => void) | undefined;
|
|
194
194
|
customKeypad?: boolean | undefined;
|
|
195
195
|
nativeKeypadProxy?: ((blur: () => void) => import("@khanacademy/math-input").KeypadAPI) | undefined;
|
|
196
196
|
isMobile?: boolean | undefined;
|
|
@@ -223,7 +223,7 @@ declare const _default: Readonly<{
|
|
|
223
223
|
"start-coords-ui-angle"?: boolean | undefined;
|
|
224
224
|
}) | undefined;
|
|
225
225
|
} | undefined;
|
|
226
|
-
onWidgetStartProps?: ((widgets: import("
|
|
226
|
+
onWidgetStartProps?: ((widgets: import("../..").PerseusWidgetsMap) => void) | undefined;
|
|
227
227
|
}>;
|
|
228
228
|
choices: readonly string[];
|
|
229
229
|
imageAlt: string;
|
|
@@ -238,15 +238,15 @@ declare const _default: Readonly<{
|
|
|
238
238
|
}, "analytics"> & React.RefAttributes<LabelImage>>;
|
|
239
239
|
accessible?: boolean | ((props: any) => boolean) | undefined;
|
|
240
240
|
hidden?: boolean | undefined;
|
|
241
|
-
version?: import("
|
|
242
|
-
supportedAlignments?: readonly import("
|
|
243
|
-
defaultAlignment?: import("
|
|
244
|
-
getDefaultAlignment?: (() => import("
|
|
241
|
+
version?: import("../../types").Version | undefined;
|
|
242
|
+
supportedAlignments?: readonly import("../../types").Alignment[] | undefined;
|
|
243
|
+
defaultAlignment?: import("../../types").Alignment | undefined;
|
|
244
|
+
getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
|
|
245
245
|
isLintable?: boolean | undefined;
|
|
246
|
-
tracking?: import("
|
|
246
|
+
tracking?: import("../../types").Tracking | undefined;
|
|
247
247
|
traverseChildWidgets?: any;
|
|
248
|
-
transform?: import("
|
|
249
|
-
staticTransform?: import("
|
|
248
|
+
transform?: import("../../types").WidgetTransform | undefined;
|
|
249
|
+
staticTransform?: import("../../types").WidgetTransform | undefined;
|
|
250
250
|
propUpgrades?: {
|
|
251
251
|
[key: string]: (arg1: any) => any;
|
|
252
252
|
} | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./matcher";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import PropTypes from "prop-types";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { PerseusI18nContext } from "
|
|
4
|
-
import type { SortableOption } from "
|
|
3
|
+
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
4
|
+
import type { SortableOption } from "../../components/sortable";
|
|
5
5
|
type State = {
|
|
6
6
|
leftHeight: number;
|
|
7
7
|
rightHeight: number;
|
|
@@ -9,7 +9,7 @@ type State = {
|
|
|
9
9
|
};
|
|
10
10
|
export declare class Matcher extends React.Component<any, any> {
|
|
11
11
|
static contextType: React.Context<{
|
|
12
|
-
strings: import("
|
|
12
|
+
strings: import("../../strings").PerseusStrings;
|
|
13
13
|
locale: string;
|
|
14
14
|
}>;
|
|
15
15
|
context: React.ContextType<typeof PerseusI18nContext>;
|
|
@@ -58,7 +58,6 @@ export declare class Matcher extends React.Component<any, any> {
|
|
|
58
58
|
};
|
|
59
59
|
static defaultProps: any;
|
|
60
60
|
state: State;
|
|
61
|
-
render(): React.ReactElement;
|
|
62
61
|
changeAndTrack: (arg1: any) => void;
|
|
63
62
|
onMeasureLeft: (arg1: any) => void;
|
|
64
63
|
onMeasureRight: (arg1: any) => void;
|
|
@@ -66,6 +65,7 @@ export declare class Matcher extends React.Component<any, any> {
|
|
|
66
65
|
moveLeftOptionToIndex: (option: SortableOption, index: number) => void;
|
|
67
66
|
moveRightOptionToIndex: (option: SortableOption, index: number) => void;
|
|
68
67
|
simpleValidate: (arg1: any) => any;
|
|
68
|
+
render(): React.ReactElement;
|
|
69
69
|
}
|
|
70
70
|
declare const _default: Readonly<{
|
|
71
71
|
name: string;
|
|
@@ -74,15 +74,15 @@ declare const _default: Readonly<{
|
|
|
74
74
|
widget: typeof Matcher;
|
|
75
75
|
accessible?: boolean | ((props: any) => boolean) | undefined;
|
|
76
76
|
hidden?: boolean | undefined;
|
|
77
|
-
version?: import("
|
|
78
|
-
supportedAlignments?: readonly import("
|
|
79
|
-
defaultAlignment?: import("
|
|
80
|
-
getDefaultAlignment?: (() => import("
|
|
77
|
+
version?: import("../../types").Version | undefined;
|
|
78
|
+
supportedAlignments?: readonly import("../../types").Alignment[] | undefined;
|
|
79
|
+
defaultAlignment?: import("../../types").Alignment | undefined;
|
|
80
|
+
getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
|
|
81
81
|
isLintable?: boolean | undefined;
|
|
82
|
-
tracking?: import("
|
|
82
|
+
tracking?: import("../../types").Tracking | undefined;
|
|
83
83
|
traverseChildWidgets?: any;
|
|
84
|
-
transform?: import("
|
|
85
|
-
staticTransform?: import("
|
|
84
|
+
transform?: import("../../types").WidgetTransform | undefined;
|
|
85
|
+
staticTransform?: import("../../types").WidgetTransform | undefined;
|
|
86
86
|
propUpgrades?: {
|
|
87
87
|
[key: string]: (arg1: any) => any;
|
|
88
88
|
} | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./matrix";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { PerseusI18nContext } from "
|
|
3
|
-
import type { PerseusMatrixWidgetOptions } from "
|
|
4
|
-
import type { PerseusStrings } from "
|
|
5
|
-
import type { WidgetProps, PerseusScore } from "
|
|
2
|
+
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
3
|
+
import type { PerseusMatrixWidgetOptions } from "../../perseus-types";
|
|
4
|
+
import type { PerseusStrings } from "../../strings";
|
|
5
|
+
import type { WidgetProps, PerseusScore } from "../../types";
|
|
6
6
|
type Rubric = PerseusMatrixWidgetOptions;
|
|
7
7
|
type ExternalProps = WidgetProps<PerseusMatrixWidgetOptions, Rubric>;
|
|
8
8
|
type Props = ExternalProps & {
|
|
@@ -35,7 +35,6 @@ declare class Matrix extends React.Component<Props, State> {
|
|
|
35
35
|
static validate(state: any, rubric: any, strings: PerseusStrings): PerseusScore;
|
|
36
36
|
state: State;
|
|
37
37
|
componentDidMount(): void;
|
|
38
|
-
render(): React.ReactNode;
|
|
39
38
|
getInputPaths: () => ReadonlyArray<ReadonlyArray<string>>;
|
|
40
39
|
getGrammarTypeForPath: (arg1: any) => string;
|
|
41
40
|
_handleFocus: (arg1: any, arg2: any) => void;
|
|
@@ -49,6 +48,7 @@ declare class Matrix extends React.Component<Props, State> {
|
|
|
49
48
|
onValueChange: (arg1: any, arg2: any, arg3: any, arg4: any) => void;
|
|
50
49
|
getUserInput: () => any;
|
|
51
50
|
simpleValidate: (arg1: any) => any;
|
|
51
|
+
render(): React.ReactNode;
|
|
52
52
|
}
|
|
53
53
|
declare const _default: Readonly<{
|
|
54
54
|
name: string;
|
|
@@ -57,15 +57,15 @@ declare const _default: Readonly<{
|
|
|
57
57
|
widget: typeof Matrix;
|
|
58
58
|
accessible?: boolean | ((props: any) => boolean) | undefined;
|
|
59
59
|
hidden?: boolean | undefined;
|
|
60
|
-
version?: import("
|
|
61
|
-
supportedAlignments?: readonly import("
|
|
62
|
-
defaultAlignment?: import("
|
|
63
|
-
getDefaultAlignment?: (() => import("
|
|
60
|
+
version?: import("../../types").Version | undefined;
|
|
61
|
+
supportedAlignments?: readonly import("../../types").Alignment[] | undefined;
|
|
62
|
+
defaultAlignment?: import("../../types").Alignment | undefined;
|
|
63
|
+
getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
|
|
64
64
|
isLintable?: boolean | undefined;
|
|
65
|
-
tracking?: import("
|
|
65
|
+
tracking?: import("../../types").Tracking | undefined;
|
|
66
66
|
traverseChildWidgets?: any;
|
|
67
|
-
transform?: import("
|
|
68
|
-
staticTransform?: import("
|
|
67
|
+
transform?: import("../../types").WidgetTransform | undefined;
|
|
68
|
+
staticTransform?: import("../../types").WidgetTransform | undefined;
|
|
69
69
|
propUpgrades?: {
|
|
70
70
|
[key: string]: (arg1: any) => any;
|
|
71
71
|
} | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./measurer";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const _default: Readonly<{
|
|
2
|
+
name: string;
|
|
3
|
+
displayName: string;
|
|
4
|
+
getWidget?: (() => any) | undefined;
|
|
5
|
+
widget: any;
|
|
6
|
+
accessible?: boolean | ((props: any) => boolean) | undefined;
|
|
7
|
+
hidden?: boolean | undefined;
|
|
8
|
+
version?: import("../../types").Version | undefined;
|
|
9
|
+
supportedAlignments?: readonly import("../../types").Alignment[] | undefined;
|
|
10
|
+
defaultAlignment?: import("../../types").Alignment | undefined;
|
|
11
|
+
getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
|
|
12
|
+
isLintable?: boolean | undefined;
|
|
13
|
+
tracking?: import("../../types").Tracking | undefined;
|
|
14
|
+
traverseChildWidgets?: any;
|
|
15
|
+
transform?: import("../../types").WidgetTransform | undefined;
|
|
16
|
+
staticTransform?: import("../../types").WidgetTransform | undefined;
|
|
17
|
+
propUpgrades?: {
|
|
18
|
+
[key: string]: (arg1: any) => any;
|
|
19
|
+
} | undefined;
|
|
20
|
+
}>;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./molecule";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { PerseusI18nContext } from "
|
|
3
|
-
import type { PerseusMoleculeRendererWidgetOptions } from "
|
|
2
|
+
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
3
|
+
import type { PerseusMoleculeRendererWidgetOptions } from "../../perseus-types";
|
|
4
4
|
type MoleculeState = {
|
|
5
5
|
parsedSmiles: any;
|
|
6
6
|
error: string | null;
|
|
@@ -12,7 +12,7 @@ type Props = {
|
|
|
12
12
|
};
|
|
13
13
|
export declare class Molecule extends React.Component<Props, MoleculeState> {
|
|
14
14
|
static contextType: React.Context<{
|
|
15
|
-
strings: import("
|
|
15
|
+
strings: import("../../strings").PerseusStrings;
|
|
16
16
|
locale: string;
|
|
17
17
|
}>;
|
|
18
18
|
context: React.ContextType<typeof PerseusI18nContext>;
|
|
@@ -43,15 +43,15 @@ declare const _default: Readonly<{
|
|
|
43
43
|
widget: typeof MoleculeWidget;
|
|
44
44
|
accessible?: boolean | ((props: any) => boolean) | undefined;
|
|
45
45
|
hidden?: boolean | undefined;
|
|
46
|
-
version?: import("
|
|
47
|
-
supportedAlignments?: readonly import("
|
|
48
|
-
defaultAlignment?: import("
|
|
49
|
-
getDefaultAlignment?: (() => import("
|
|
46
|
+
version?: import("../../types").Version | undefined;
|
|
47
|
+
supportedAlignments?: readonly import("../../types").Alignment[] | undefined;
|
|
48
|
+
defaultAlignment?: import("../../types").Alignment | undefined;
|
|
49
|
+
getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
|
|
50
50
|
isLintable?: boolean | undefined;
|
|
51
|
-
tracking?: import("
|
|
51
|
+
tracking?: import("../../types").Tracking | undefined;
|
|
52
52
|
traverseChildWidgets?: any;
|
|
53
|
-
transform?: import("
|
|
54
|
-
staticTransform?: import("
|
|
53
|
+
transform?: import("../../types").WidgetTransform | undefined;
|
|
54
|
+
staticTransform?: import("../../types").WidgetTransform | undefined;
|
|
55
55
|
propUpgrades?: {
|
|
56
56
|
[key: string]: (arg1: any) => any;
|
|
57
57
|
} | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./number-line";
|