@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { PerseusI18nContext } from "
|
|
3
|
-
import type { ChangeableProps } from "
|
|
4
|
-
import type { APIOptions } from "
|
|
2
|
+
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
3
|
+
import type { ChangeableProps } from "../../mixins/changeable";
|
|
4
|
+
import type { APIOptions } from "../../types";
|
|
5
5
|
type Props = ChangeableProps & {
|
|
6
6
|
range: [number, number];
|
|
7
7
|
labelRange: ReadonlyArray<number | null>;
|
|
@@ -42,7 +42,7 @@ type State = {
|
|
|
42
42
|
};
|
|
43
43
|
declare class NumberLine extends React.Component<Props, State> {
|
|
44
44
|
static contextType: React.Context<{
|
|
45
|
-
strings: import("
|
|
45
|
+
strings: import("../../strings").PerseusStrings;
|
|
46
46
|
locale: string;
|
|
47
47
|
}>;
|
|
48
48
|
context: React.ContextType<typeof PerseusI18nContext>;
|
|
@@ -80,15 +80,15 @@ declare const _default: Readonly<{
|
|
|
80
80
|
widget: typeof NumberLine;
|
|
81
81
|
accessible?: boolean | ((props: any) => boolean) | undefined;
|
|
82
82
|
hidden?: boolean | undefined;
|
|
83
|
-
version?: import("
|
|
84
|
-
supportedAlignments?: readonly import("
|
|
85
|
-
defaultAlignment?: import("
|
|
86
|
-
getDefaultAlignment?: (() => import("
|
|
83
|
+
version?: import("../../types").Version | undefined;
|
|
84
|
+
supportedAlignments?: readonly import("../../types").Alignment[] | undefined;
|
|
85
|
+
defaultAlignment?: import("../../types").Alignment | undefined;
|
|
86
|
+
getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
|
|
87
87
|
isLintable?: boolean | undefined;
|
|
88
|
-
tracking?: import("
|
|
88
|
+
tracking?: import("../../types").Tracking | undefined;
|
|
89
89
|
traverseChildWidgets?: any;
|
|
90
|
-
transform?: import("
|
|
91
|
-
staticTransform?: import("
|
|
90
|
+
transform?: import("../../types").WidgetTransform | undefined;
|
|
91
|
+
staticTransform?: import("../../types").WidgetTransform | undefined;
|
|
92
92
|
propUpgrades?: {
|
|
93
93
|
[key: string]: (arg1: any) => any;
|
|
94
94
|
} | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./numeric-input";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { PerseusI18nContext } from "
|
|
3
|
-
import InputWithExamples from "
|
|
4
|
-
import SimpleKeypadInput from "
|
|
5
|
-
import type { PerseusNumericInputWidgetOptions, PerseusNumericInputAnswerForm } from "
|
|
6
|
-
import type { PerseusStrings } from "
|
|
7
|
-
import type { FocusPath, PerseusScore, WidgetProps } from "
|
|
2
|
+
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
3
|
+
import InputWithExamples from "../../components/input-with-examples";
|
|
4
|
+
import SimpleKeypadInput from "../../components/simple-keypad-input";
|
|
5
|
+
import type { PerseusNumericInputWidgetOptions, PerseusNumericInputAnswerForm } from "../../perseus-types";
|
|
6
|
+
import type { PerseusStrings } from "../../strings";
|
|
7
|
+
import type { FocusPath, PerseusScore, WidgetProps } from "../../types";
|
|
8
8
|
type UserInput = {
|
|
9
9
|
currentValue: string;
|
|
10
10
|
};
|
|
@@ -69,15 +69,15 @@ declare const _default: Readonly<{
|
|
|
69
69
|
widget: typeof NumericInput;
|
|
70
70
|
accessible?: boolean | ((props: any) => boolean) | undefined;
|
|
71
71
|
hidden?: boolean | undefined;
|
|
72
|
-
version?: import("
|
|
73
|
-
supportedAlignments?: readonly import("
|
|
74
|
-
defaultAlignment?: import("
|
|
75
|
-
getDefaultAlignment?: (() => import("
|
|
72
|
+
version?: import("../../types").Version | undefined;
|
|
73
|
+
supportedAlignments?: readonly import("../../types").Alignment[] | undefined;
|
|
74
|
+
defaultAlignment?: import("../../types").Alignment | undefined;
|
|
75
|
+
getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
|
|
76
76
|
isLintable?: boolean | undefined;
|
|
77
|
-
tracking?: import("
|
|
77
|
+
tracking?: import("../../types").Tracking | undefined;
|
|
78
78
|
traverseChildWidgets?: any;
|
|
79
|
-
transform?: import("
|
|
80
|
-
staticTransform?: import("
|
|
79
|
+
transform?: import("../../types").WidgetTransform | undefined;
|
|
80
|
+
staticTransform?: import("../../types").WidgetTransform | undefined;
|
|
81
81
|
propUpgrades?: {
|
|
82
82
|
[key: string]: (arg1: any) => any;
|
|
83
83
|
} | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./orderer";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type { PerseusOrdererWidgetOptions } from "
|
|
3
|
-
import type { WidgetProps } from "
|
|
2
|
+
import type { PerseusOrdererWidgetOptions } from "../../perseus-types";
|
|
3
|
+
import type { WidgetProps } from "../../types";
|
|
4
4
|
type Rubric = PerseusOrdererWidgetOptions;
|
|
5
5
|
type RenderProps = PerseusOrdererWidgetOptions & {
|
|
6
6
|
current: any;
|
|
@@ -36,7 +36,6 @@ declare class Orderer extends React.Component<OrdererProps, OrdererState> {
|
|
|
36
36
|
static defaultProps: OrdererDefaultProps;
|
|
37
37
|
state: OrdererState;
|
|
38
38
|
UNSAFE_componentWillReceiveProps(nextProps: OrdererProps): void;
|
|
39
|
-
render(): React.ReactNode;
|
|
40
39
|
onClick: (arg1: string, arg2: number, arg3: any, arg4: Element) => void;
|
|
41
40
|
onRelease: (arg1: any) => void;
|
|
42
41
|
onMouseMove: (arg1: any) => void;
|
|
@@ -45,6 +44,7 @@ declare class Orderer extends React.Component<OrdererProps, OrdererState> {
|
|
|
45
44
|
setListValues: (arg1: ReadonlyArray<string>) => void;
|
|
46
45
|
getUserInput: () => any;
|
|
47
46
|
simpleValidate: (arg1: any) => any;
|
|
47
|
+
render(): React.ReactNode;
|
|
48
48
|
}
|
|
49
49
|
declare const _default: Readonly<{
|
|
50
50
|
name: string;
|
|
@@ -53,15 +53,15 @@ declare const _default: Readonly<{
|
|
|
53
53
|
widget: typeof Orderer;
|
|
54
54
|
accessible?: boolean | ((props: any) => boolean) | undefined;
|
|
55
55
|
hidden?: boolean | undefined;
|
|
56
|
-
version?: import("
|
|
57
|
-
supportedAlignments?: readonly import("
|
|
58
|
-
defaultAlignment?: import("
|
|
59
|
-
getDefaultAlignment?: (() => import("
|
|
56
|
+
version?: import("../../types").Version | undefined;
|
|
57
|
+
supportedAlignments?: readonly import("../../types").Alignment[] | undefined;
|
|
58
|
+
defaultAlignment?: import("../../types").Alignment | undefined;
|
|
59
|
+
getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
|
|
60
60
|
isLintable?: boolean | undefined;
|
|
61
|
-
tracking?: import("
|
|
61
|
+
tracking?: import("../../types").Tracking | undefined;
|
|
62
62
|
traverseChildWidgets?: any;
|
|
63
|
-
transform?: import("
|
|
64
|
-
staticTransform?: import("
|
|
63
|
+
transform?: import("../../types").WidgetTransform | undefined;
|
|
64
|
+
staticTransform?: import("../../types").WidgetTransform | undefined;
|
|
65
65
|
propUpgrades?: {
|
|
66
66
|
[key: string]: (arg1: any) => any;
|
|
67
67
|
} | undefined;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { PerseusI18nContext } from "
|
|
3
|
-
import type { ParseState } from "./passage
|
|
4
|
-
import type { SerializedHighlightSet } from "
|
|
5
|
-
import type { ChangeableProps } from "
|
|
6
|
-
import type { PerseusPassageWidgetOptions, PerseusWidget } from "
|
|
7
|
-
import type { PerseusScore, WidgetProps } from "
|
|
2
|
+
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
3
|
+
import type { ParseState } from "./passage-markdown";
|
|
4
|
+
import type { SerializedHighlightSet } from "../../components/highlighting/types";
|
|
5
|
+
import type { ChangeableProps } from "../../mixins/changeable";
|
|
6
|
+
import type { PerseusPassageWidgetOptions, PerseusWidget } from "../../perseus-types";
|
|
7
|
+
import type { PerseusScore, WidgetProps } from "../../types";
|
|
8
8
|
import type { SingleASTNode } from "@khanacademy/simple-markdown";
|
|
9
9
|
export declare class LineHeightMeasurer extends React.Component<Record<any, any>> {
|
|
10
10
|
_line: HTMLDivElement | null | undefined;
|
|
@@ -44,7 +44,7 @@ export type Reference = {
|
|
|
44
44
|
};
|
|
45
45
|
export declare class Passage extends React.Component<PassageProps, PassageState> {
|
|
46
46
|
static contextType: React.Context<{
|
|
47
|
-
strings: import("
|
|
47
|
+
strings: import("../../strings").PerseusStrings;
|
|
48
48
|
locale: string;
|
|
49
49
|
}>;
|
|
50
50
|
context: React.ContextType<typeof PerseusI18nContext>;
|
|
@@ -54,6 +54,7 @@ export declare class Passage extends React.Component<PassageProps, PassageState>
|
|
|
54
54
|
_stylesAppiedTimer: number;
|
|
55
55
|
static defaultProps: DefaultPassageProps;
|
|
56
56
|
state: PassageState;
|
|
57
|
+
static validate(state: UserInput, rubric: Rubric): PerseusScore;
|
|
57
58
|
componentDidMount(): void;
|
|
58
59
|
shouldComponentUpdate(nextProps: PassageProps, nextState: PassageState): any | boolean;
|
|
59
60
|
componentDidUpdate(): void;
|
|
@@ -95,7 +96,6 @@ export declare class Passage extends React.Component<PassageProps, PassageState>
|
|
|
95
96
|
*/
|
|
96
97
|
getUserInput(): UserInput;
|
|
97
98
|
simpleValidate(rubric: Rubric): PerseusScore;
|
|
98
|
-
static validate(state: UserInput, rubric: Rubric): PerseusScore;
|
|
99
99
|
/**
|
|
100
100
|
* Rendering
|
|
101
101
|
*
|
|
@@ -115,15 +115,15 @@ declare const _default: Readonly<{
|
|
|
115
115
|
widget: typeof Passage;
|
|
116
116
|
accessible?: boolean | ((props: any) => boolean) | undefined;
|
|
117
117
|
hidden?: boolean | undefined;
|
|
118
|
-
version?: import("
|
|
119
|
-
supportedAlignments?: readonly import("
|
|
120
|
-
defaultAlignment?: import("
|
|
121
|
-
getDefaultAlignment?: (() => import("
|
|
118
|
+
version?: import("../../types").Version | undefined;
|
|
119
|
+
supportedAlignments?: readonly import("../../types").Alignment[] | undefined;
|
|
120
|
+
defaultAlignment?: import("../../types").Alignment | undefined;
|
|
121
|
+
getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
|
|
122
122
|
isLintable?: boolean | undefined;
|
|
123
|
-
tracking?: import("
|
|
123
|
+
tracking?: import("../../types").Tracking | undefined;
|
|
124
124
|
traverseChildWidgets?: any;
|
|
125
|
-
transform?: import("
|
|
126
|
-
staticTransform?: import("
|
|
125
|
+
transform?: import("../../types").WidgetTransform | undefined;
|
|
126
|
+
staticTransform?: import("../../types").WidgetTransform | undefined;
|
|
127
127
|
propUpgrades?: {
|
|
128
128
|
[key: string]: (arg1: any) => any;
|
|
129
129
|
} | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./passage-ref";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { PerseusI18nContext } from "
|
|
3
|
-
import type { PerseusPassageRefWidgetOptions } from "
|
|
4
|
-
import type { ChangeFn, PerseusScore, WidgetProps } from "
|
|
2
|
+
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
3
|
+
import type { PerseusPassageRefWidgetOptions } from "../../perseus-types";
|
|
4
|
+
import type { ChangeFn, PerseusScore, WidgetProps } from "../../types";
|
|
5
5
|
import type { LinterContextProps } from "@khanacademy/perseus-linter";
|
|
6
6
|
type UserInput = RenderProps & {
|
|
7
7
|
static: boolean | null | undefined;
|
|
@@ -28,7 +28,7 @@ type State = {
|
|
|
28
28
|
};
|
|
29
29
|
declare class PassageRef extends React.Component<Props, State> {
|
|
30
30
|
static contextType: React.Context<{
|
|
31
|
-
strings: import("
|
|
31
|
+
strings: import("../../strings").PerseusStrings;
|
|
32
32
|
locale: string;
|
|
33
33
|
}>;
|
|
34
34
|
context: React.ContextType<typeof PerseusI18nContext>;
|
|
@@ -37,17 +37,17 @@ declare class PassageRef extends React.Component<Props, State> {
|
|
|
37
37
|
_throttledUpdateRange: () => void;
|
|
38
38
|
static defaultProps: DefaultProps;
|
|
39
39
|
state: State;
|
|
40
|
-
|
|
41
|
-
getUserInput: () => UserInput;
|
|
42
|
-
render(): React.ReactNode;
|
|
43
|
-
change: ChangeFn;
|
|
40
|
+
static validate(userInput: UserInput, rubric: Rubric): PerseusScore;
|
|
44
41
|
componentDidMount(): void;
|
|
42
|
+
shouldComponentUpdate(nextProps: Props, nextState: State): boolean;
|
|
45
43
|
componentDidUpdate(): void;
|
|
46
44
|
componentWillUnmount(): void;
|
|
45
|
+
getUserInput: () => UserInput;
|
|
46
|
+
change: ChangeFn;
|
|
47
47
|
_deferredUpdateRange: () => void;
|
|
48
48
|
_updateRange: () => void;
|
|
49
49
|
simpleValidate: (arg1: Rubric) => PerseusScore;
|
|
50
|
-
|
|
50
|
+
render(): React.ReactNode;
|
|
51
51
|
}
|
|
52
52
|
declare const _default: Readonly<{
|
|
53
53
|
name: string;
|
|
@@ -56,15 +56,15 @@ declare const _default: Readonly<{
|
|
|
56
56
|
widget: typeof PassageRef;
|
|
57
57
|
accessible?: boolean | ((props: any) => boolean) | undefined;
|
|
58
58
|
hidden?: boolean | undefined;
|
|
59
|
-
version?: import("
|
|
60
|
-
supportedAlignments?: readonly import("
|
|
61
|
-
defaultAlignment?: import("
|
|
62
|
-
getDefaultAlignment?: (() => import("
|
|
59
|
+
version?: import("../../types").Version | undefined;
|
|
60
|
+
supportedAlignments?: readonly import("../../types").Alignment[] | undefined;
|
|
61
|
+
defaultAlignment?: import("../../types").Alignment | undefined;
|
|
62
|
+
getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
|
|
63
63
|
isLintable?: boolean | undefined;
|
|
64
|
-
tracking?: import("
|
|
64
|
+
tracking?: import("../../types").Tracking | undefined;
|
|
65
65
|
traverseChildWidgets?: any;
|
|
66
|
-
transform?: import("
|
|
67
|
-
staticTransform?: import("
|
|
66
|
+
transform?: import("../../types").WidgetTransform | undefined;
|
|
67
|
+
staticTransform?: import("../../types").WidgetTransform | undefined;
|
|
68
68
|
propUpgrades?: {
|
|
69
69
|
[key: string]: (arg1: any) => any;
|
|
70
70
|
} | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./passage-ref-target";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { PerseusI18nContext } from "
|
|
3
|
-
import * as Changeable from "
|
|
4
|
-
import type { PerseusPassageRefTargetWidgetOptions } from "
|
|
5
|
-
import type { APIOptions } from "
|
|
2
|
+
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
3
|
+
import * as Changeable from "../../mixins/changeable";
|
|
4
|
+
import type { PerseusPassageRefTargetWidgetOptions } from "../../perseus-types";
|
|
5
|
+
import type { APIOptions } from "../../types";
|
|
6
6
|
import type { LinterContextProps } from "@khanacademy/perseus-linter";
|
|
7
7
|
type Props = Changeable.ChangeableProps & {
|
|
8
8
|
apiOptions: APIOptions;
|
|
@@ -15,7 +15,7 @@ type DefaultProps = {
|
|
|
15
15
|
};
|
|
16
16
|
declare class PassageRefTarget extends React.Component<Props> {
|
|
17
17
|
static contextType: React.Context<{
|
|
18
|
-
strings: import("
|
|
18
|
+
strings: import("../../strings").PerseusStrings;
|
|
19
19
|
locale: string;
|
|
20
20
|
}>;
|
|
21
21
|
context: React.ContextType<typeof PerseusI18nContext>;
|
|
@@ -33,15 +33,15 @@ declare const _default: Readonly<{
|
|
|
33
33
|
widget: typeof PassageRefTarget;
|
|
34
34
|
accessible?: boolean | ((props: any) => boolean) | undefined;
|
|
35
35
|
hidden?: boolean | undefined;
|
|
36
|
-
version?: import("
|
|
37
|
-
supportedAlignments?: readonly import("
|
|
38
|
-
defaultAlignment?: import("
|
|
39
|
-
getDefaultAlignment?: (() => import("
|
|
36
|
+
version?: import("../../types").Version | undefined;
|
|
37
|
+
supportedAlignments?: readonly import("../../types").Alignment[] | undefined;
|
|
38
|
+
defaultAlignment?: import("../../types").Alignment | undefined;
|
|
39
|
+
getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
|
|
40
40
|
isLintable?: boolean | undefined;
|
|
41
|
-
tracking?: import("
|
|
41
|
+
tracking?: import("../../types").Tracking | undefined;
|
|
42
42
|
traverseChildWidgets?: any;
|
|
43
|
-
transform?: import("
|
|
44
|
-
staticTransform?: import("
|
|
43
|
+
transform?: import("../../types").WidgetTransform | undefined;
|
|
44
|
+
staticTransform?: import("../../types").WidgetTransform | undefined;
|
|
45
45
|
propUpgrades?: {
|
|
46
46
|
[key: string]: (arg1: any) => any;
|
|
47
47
|
} | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, makeSafeUrl } from "./phet-simulation";
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* from https://phet.colorado.edu/.
|
|
4
4
|
*/
|
|
5
5
|
import * as React from "react";
|
|
6
|
-
import { PerseusI18nContext } from "
|
|
7
|
-
import type { PerseusPhetSimulationWidgetOptions } from "
|
|
8
|
-
import type { WidgetProps } from "
|
|
6
|
+
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
7
|
+
import type { PerseusPhetSimulationWidgetOptions } from "../../perseus-types";
|
|
8
|
+
import type { WidgetProps } from "../../types";
|
|
9
9
|
type RenderProps = PerseusPhetSimulationWidgetOptions;
|
|
10
10
|
type Props = WidgetProps<RenderProps, PerseusPhetSimulationWidgetOptions>;
|
|
11
11
|
type UserInput = null;
|
|
@@ -18,7 +18,7 @@ type State = {
|
|
|
18
18
|
};
|
|
19
19
|
export declare class PhetSimulation extends React.Component<Props, State> {
|
|
20
20
|
static contextType: React.Context<{
|
|
21
|
-
strings: import("
|
|
21
|
+
strings: import("../../strings").PerseusStrings;
|
|
22
22
|
locale: string;
|
|
23
23
|
}>;
|
|
24
24
|
context: React.ContextType<typeof PerseusI18nContext>;
|
|
@@ -29,8 +29,6 @@ export declare class PhetSimulation extends React.Component<Props, State> {
|
|
|
29
29
|
componentDidMount(): Promise<void>;
|
|
30
30
|
componentDidUpdate(prevProps: any): Promise<void>;
|
|
31
31
|
getUserInput(): UserInput;
|
|
32
|
-
change: (...args: ReadonlyArray<unknown>) => any;
|
|
33
|
-
simpleValidate: (arg1: any) => any;
|
|
34
32
|
getPhetCompatibleLocale: (arg1: string) => string;
|
|
35
33
|
displayLoadFailure: () => void;
|
|
36
34
|
updateSimState(urlString: string): Promise<void>;
|
|
@@ -45,15 +43,15 @@ declare const _default: Readonly<{
|
|
|
45
43
|
widget: typeof PhetSimulation;
|
|
46
44
|
accessible?: boolean | ((props: any) => boolean) | undefined;
|
|
47
45
|
hidden?: boolean | undefined;
|
|
48
|
-
version?: import("
|
|
49
|
-
supportedAlignments?: readonly import("
|
|
50
|
-
defaultAlignment?: import("
|
|
51
|
-
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;
|
|
52
50
|
isLintable?: boolean | undefined;
|
|
53
|
-
tracking?: import("
|
|
51
|
+
tracking?: import("../../types").Tracking | undefined;
|
|
54
52
|
traverseChildWidgets?: any;
|
|
55
|
-
transform?: import("
|
|
56
|
-
staticTransform?: import("
|
|
53
|
+
transform?: import("../../types").WidgetTransform | undefined;
|
|
54
|
+
staticTransform?: import("../../types").WidgetTransform | undefined;
|
|
57
55
|
propUpgrades?: {
|
|
58
56
|
[key: string]: (arg1: any) => any;
|
|
59
57
|
} | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./plotter";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { PerseusI18nContext } from "
|
|
3
|
-
import type { PerseusPlotterWidgetOptions } from "
|
|
4
|
-
import type { WidgetProps } from "
|
|
2
|
+
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
3
|
+
import type { PerseusPlotterWidgetOptions } from "../../perseus-types";
|
|
4
|
+
import type { WidgetProps } from "../../types";
|
|
5
5
|
type Rubric = PerseusPlotterWidgetOptions;
|
|
6
6
|
type RenderProps = PerseusPlotterWidgetOptions;
|
|
7
7
|
type Props = WidgetProps<RenderProps, Rubric> & {
|
|
@@ -27,7 +27,7 @@ type State = {
|
|
|
27
27
|
};
|
|
28
28
|
export declare class Plotter extends React.Component<Props, State> {
|
|
29
29
|
static contextType: React.Context<{
|
|
30
|
-
strings: import("
|
|
30
|
+
strings: import("../../strings").PerseusStrings;
|
|
31
31
|
locale: string;
|
|
32
32
|
}>;
|
|
33
33
|
context: React.ContextType<typeof PerseusI18nContext>;
|
|
@@ -78,15 +78,15 @@ declare const _default: Readonly<{
|
|
|
78
78
|
widget: typeof Plotter;
|
|
79
79
|
accessible?: boolean | ((props: any) => boolean) | undefined;
|
|
80
80
|
hidden?: boolean | undefined;
|
|
81
|
-
version?: import("
|
|
82
|
-
supportedAlignments?: readonly import("
|
|
83
|
-
defaultAlignment?: import("
|
|
84
|
-
getDefaultAlignment?: (() => import("
|
|
81
|
+
version?: import("../../types").Version | undefined;
|
|
82
|
+
supportedAlignments?: readonly import("../../types").Alignment[] | undefined;
|
|
83
|
+
defaultAlignment?: import("../../types").Alignment | undefined;
|
|
84
|
+
getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
|
|
85
85
|
isLintable?: boolean | undefined;
|
|
86
|
-
tracking?: import("
|
|
86
|
+
tracking?: import("../../types").Tracking | undefined;
|
|
87
87
|
traverseChildWidgets?: any;
|
|
88
|
-
transform?: import("
|
|
89
|
-
staticTransform?: import("
|
|
88
|
+
transform?: import("../../types").WidgetTransform | undefined;
|
|
89
|
+
staticTransform?: import("../../types").WidgetTransform | undefined;
|
|
90
90
|
propUpgrades?: {
|
|
91
91
|
[key: string]: (arg1: any) => any;
|
|
92
92
|
} | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./python-program";
|
|
@@ -17,15 +17,15 @@ declare const _default: Readonly<{
|
|
|
17
17
|
widget: typeof PythonProgram;
|
|
18
18
|
accessible?: boolean | ((props: any) => boolean) | undefined;
|
|
19
19
|
hidden?: boolean | undefined;
|
|
20
|
-
version?: import("
|
|
21
|
-
supportedAlignments?: readonly import("
|
|
22
|
-
defaultAlignment?: import("
|
|
23
|
-
getDefaultAlignment?: (() => import("
|
|
20
|
+
version?: import("../../types").Version | undefined;
|
|
21
|
+
supportedAlignments?: readonly import("../../types").Alignment[] | undefined;
|
|
22
|
+
defaultAlignment?: import("../../types").Alignment | undefined;
|
|
23
|
+
getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
|
|
24
24
|
isLintable?: boolean | undefined;
|
|
25
|
-
tracking?: import("
|
|
25
|
+
tracking?: import("../../types").Tracking | undefined;
|
|
26
26
|
traverseChildWidgets?: any;
|
|
27
|
-
transform?: import("
|
|
28
|
-
staticTransform?: import("
|
|
27
|
+
transform?: import("../../types").WidgetTransform | undefined;
|
|
28
|
+
staticTransform?: import("../../types").WidgetTransform | undefined;
|
|
29
29
|
propUpgrades?: {
|
|
30
30
|
[key: string]: (arg1: any) => any;
|
|
31
31
|
} | undefined;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
3
|
+
import type { FocusFunction } from "./base-radio";
|
|
4
|
+
import type { PerseusRadioChoice, PerseusRadioWidgetOptions, ShowSolutions } from "../../perseus-types";
|
|
5
|
+
import type { PerseusStrings } from "../../strings";
|
|
6
|
+
import type { PerseusScore, WidgetProps, ChoiceState } from "../../types";
|
|
7
|
+
export type RenderProps = {
|
|
8
|
+
numCorrect: number;
|
|
9
|
+
hasNoneOfTheAbove?: boolean;
|
|
10
|
+
multipleSelect?: boolean;
|
|
11
|
+
countChoices?: boolean;
|
|
12
|
+
deselectEnabled?: boolean;
|
|
13
|
+
choices: ReadonlyArray<RadioChoiceWithMetadata>;
|
|
14
|
+
selectedChoices: ReadonlyArray<PerseusRadioChoice["correct"]>;
|
|
15
|
+
showSolutions?: ShowSolutions;
|
|
16
|
+
choiceStates?: ReadonlyArray<ChoiceState>;
|
|
17
|
+
values?: ReadonlyArray<boolean>;
|
|
18
|
+
};
|
|
19
|
+
type UserInput = {
|
|
20
|
+
countChoices?: boolean;
|
|
21
|
+
choicesSelected: ReadonlyArray<boolean>;
|
|
22
|
+
numCorrect?: number;
|
|
23
|
+
noneOfTheAboveIndex?: number | null | undefined;
|
|
24
|
+
noneOfTheAboveSelected?: boolean;
|
|
25
|
+
};
|
|
26
|
+
type Rubric = PerseusRadioWidgetOptions;
|
|
27
|
+
type Props = WidgetProps<RenderProps, Rubric>;
|
|
28
|
+
type DefaultProps = Required<Pick<Props, "choices" | "multipleSelect" | "countChoices" | "deselectEnabled" | "linterContext" | "showSolutions">>;
|
|
29
|
+
export type RadioChoiceWithMetadata = PerseusRadioChoice & {
|
|
30
|
+
originalIndex: number;
|
|
31
|
+
correct: boolean;
|
|
32
|
+
};
|
|
33
|
+
declare class Radio extends React.Component<Props> {
|
|
34
|
+
static contextType: React.Context<{
|
|
35
|
+
strings: PerseusStrings;
|
|
36
|
+
locale: string;
|
|
37
|
+
}>;
|
|
38
|
+
context: React.ContextType<typeof PerseusI18nContext>;
|
|
39
|
+
focusFunction: FocusFunction;
|
|
40
|
+
static defaultProps: DefaultProps;
|
|
41
|
+
static validate(userInput: UserInput, rubric: Rubric, strings: PerseusStrings): PerseusScore;
|
|
42
|
+
static getUserInputFromProps(props: Props): UserInput;
|
|
43
|
+
componentDidUpdate(prevProps: Props): void;
|
|
44
|
+
_renderRenderer: (content?: string) => React.ReactElement;
|
|
45
|
+
focus(choiceIndex?: number | null): boolean;
|
|
46
|
+
registerFocusFunction(fun: FocusFunction): void;
|
|
47
|
+
updateChoices: (newValueLists: Readonly<{
|
|
48
|
+
checked: ReadonlyArray<boolean>;
|
|
49
|
+
crossedOut: ReadonlyArray<boolean>;
|
|
50
|
+
}>) => void;
|
|
51
|
+
getUserInput: () => UserInput;
|
|
52
|
+
simpleValidate: (arg1: PerseusRadioWidgetOptions) => PerseusScore;
|
|
53
|
+
/**
|
|
54
|
+
* Turn on rationale display for the currently selected choices. Note that
|
|
55
|
+
* this leaves rationales on for choices that are already showing
|
|
56
|
+
* rationales.
|
|
57
|
+
* @deprecated Internal only. Use `showSolutions` prop instead.
|
|
58
|
+
*/
|
|
59
|
+
showRationalesForCurrentlySelectedChoices: (arg1: PerseusRadioWidgetOptions) => void;
|
|
60
|
+
/**
|
|
61
|
+
* Deselects any currently-selected choices that are not correct choices.
|
|
62
|
+
*/
|
|
63
|
+
deselectIncorrectSelectedChoices: () => void;
|
|
64
|
+
render(): React.ReactNode;
|
|
65
|
+
}
|
|
66
|
+
export default Radio;
|
|
@@ -1,66 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
noneOfTheAboveIndex?: number | null | undefined;
|
|
24
|
-
noneOfTheAboveSelected?: boolean;
|
|
25
|
-
};
|
|
26
|
-
type Rubric = PerseusRadioWidgetOptions;
|
|
27
|
-
type Props = WidgetProps<RenderProps, Rubric>;
|
|
28
|
-
type DefaultProps = Required<Pick<Props, "choices" | "multipleSelect" | "countChoices" | "deselectEnabled" | "linterContext" | "showSolutions">>;
|
|
29
|
-
export type RadioChoiceWithMetadata = PerseusRadioChoice & {
|
|
30
|
-
originalIndex: number;
|
|
31
|
-
correct: boolean;
|
|
32
|
-
};
|
|
33
|
-
declare class Radio extends React.Component<Props> {
|
|
34
|
-
static contextType: React.Context<{
|
|
35
|
-
strings: PerseusStrings;
|
|
36
|
-
locale: string;
|
|
37
|
-
}>;
|
|
38
|
-
context: React.ContextType<typeof PerseusI18nContext>;
|
|
39
|
-
focusFunction: FocusFunction;
|
|
40
|
-
static defaultProps: DefaultProps;
|
|
41
|
-
static validate(userInput: UserInput, rubric: Rubric, strings: PerseusStrings): PerseusScore;
|
|
42
|
-
static getUserInputFromProps(props: Props): UserInput;
|
|
43
|
-
componentDidUpdate(prevProps: Props): void;
|
|
44
|
-
_renderRenderer: (content?: string) => React.ReactElement;
|
|
45
|
-
focus(choiceIndex?: number | null): boolean;
|
|
46
|
-
registerFocusFunction(fun: FocusFunction): void;
|
|
47
|
-
updateChoices: (newValueLists: Readonly<{
|
|
48
|
-
checked: ReadonlyArray<boolean>;
|
|
49
|
-
crossedOut: ReadonlyArray<boolean>;
|
|
50
|
-
}>) => void;
|
|
51
|
-
getUserInput: () => UserInput;
|
|
52
|
-
simpleValidate: (arg1: PerseusRadioWidgetOptions) => PerseusScore;
|
|
53
|
-
/**
|
|
54
|
-
* Turn on rationale display for the currently selected choices. Note that
|
|
55
|
-
* this leaves rationales on for choices that are already showing
|
|
56
|
-
* rationales.
|
|
57
|
-
* @deprecated Internal only. Use `showSolutions` prop instead.
|
|
58
|
-
*/
|
|
59
|
-
showRationalesForCurrentlySelectedChoices: (arg1: PerseusRadioWidgetOptions) => void;
|
|
60
|
-
/**
|
|
61
|
-
* Deselects any currently-selected choices that are not correct choices.
|
|
62
|
-
*/
|
|
63
|
-
deselectIncorrectSelectedChoices: () => void;
|
|
64
|
-
render(): React.ReactNode;
|
|
65
|
-
}
|
|
66
|
-
export default Radio;
|
|
1
|
+
import Radio from "./radio-component";
|
|
2
|
+
declare const _default: Readonly<{
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
getWidget?: (() => typeof Radio) | undefined;
|
|
6
|
+
widget: typeof Radio;
|
|
7
|
+
accessible?: boolean | ((props: any) => boolean) | undefined;
|
|
8
|
+
hidden?: boolean | undefined;
|
|
9
|
+
version?: import("../../types").Version | undefined;
|
|
10
|
+
supportedAlignments?: readonly import("../../types").Alignment[] | undefined;
|
|
11
|
+
defaultAlignment?: import("../../types").Alignment | undefined;
|
|
12
|
+
getDefaultAlignment?: (() => import("../../types").Alignment) | undefined;
|
|
13
|
+
isLintable?: boolean | undefined;
|
|
14
|
+
tracking?: import("../../types").Tracking | undefined;
|
|
15
|
+
traverseChildWidgets?: any;
|
|
16
|
+
transform?: import("../../types").WidgetTransform | undefined;
|
|
17
|
+
staticTransform?: import("../../types").WidgetTransform | undefined;
|
|
18
|
+
propUpgrades?: {
|
|
19
|
+
[key: string]: (arg1: any) => any;
|
|
20
|
+
} | undefined;
|
|
21
|
+
}>;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./sorter";
|