@khanacademy/perseus-editor 43.0.0 → 43.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-editors.d.ts +1 -1
- package/dist/components/widget-editor.d.ts +2 -2
- package/dist/es/index.js +15 -15
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +16 -16
- package/dist/index.js.map +1 -1
- package/dist/widgets/categorizer-editor/categorizer-editor.d.ts +3 -3
- package/dist/widgets/deprecated-standin-editor/deprecated-standin-editor.d.ts +1 -4
- package/dist/widgets/dropdown-editor/dropdown-editor.d.ts +8 -7
- package/dist/widgets/explanation-editor/explanation-editor.d.ts +3 -3
- package/dist/widgets/expression-editor/expression-editor.d.ts +4 -4
- package/dist/widgets/fill-in-the-blank-editor/fill-in-the-blank-editor.d.ts +1 -1
- package/dist/widgets/free-response-editor/free-response-editor.d.ts +2 -1
- package/dist/widgets/graded-group-editor/graded-group-editor.d.ts +3 -3
- package/dist/widgets/graded-group-set-editor/graded-group-set-editor.d.ts +5 -6
- package/dist/widgets/grapher-editor/grapher-editor.d.ts +6 -8
- package/package.json +7 -7
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type { ChangeableProps } from "../../mixins/changeable";
|
|
3
2
|
import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
|
|
4
3
|
import type { PerseusCategorizerWidgetOptions } from "@khanacademy/perseus-core";
|
|
5
|
-
interface Props extends PerseusCategorizerWidgetOptions
|
|
4
|
+
interface Props extends PerseusCategorizerWidgetOptions {
|
|
6
5
|
apiOptions?: APIOptionsWithDefaults;
|
|
6
|
+
onChange: (options: PerseusCategorizerWidgetOptions) => void;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* An editor for adding a categorizer widget that allows users to sort items into categories.
|
|
10
10
|
*/
|
|
11
11
|
declare class CategorizerEditor extends React.Component<Props> {
|
|
12
12
|
static defaultProps: PerseusCategorizerWidgetOptions;
|
|
13
|
-
|
|
13
|
+
handleChange(changed: Partial<PerseusCategorizerWidgetOptions>): void;
|
|
14
14
|
serialize: () => any;
|
|
15
15
|
render(): React.ReactNode;
|
|
16
16
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
onChange: (options: any) => void;
|
|
4
|
-
};
|
|
5
|
-
declare class DeprecatedStandinEditor extends React.Component<Props> {
|
|
2
|
+
declare class DeprecatedStandinEditor extends React.Component {
|
|
6
3
|
serialize(): any;
|
|
7
4
|
render(): React.ReactNode;
|
|
8
5
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { type PerseusDropdownWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
type
|
|
3
|
+
import type { APIOptions } from "@khanacademy/perseus";
|
|
4
|
+
interface Props extends PerseusDropdownWidgetOptions {
|
|
5
|
+
onChange: (options: PerseusDropdownWidgetOptions) => void;
|
|
6
|
+
apiOptions?: APIOptions;
|
|
7
|
+
}
|
|
4
8
|
/**
|
|
5
9
|
* An editor for adding a dropdown widget that allows users to select an option from a predefined list.
|
|
6
10
|
*/
|
|
@@ -10,14 +14,11 @@ declare class DropdownEditor extends React.Component<Props> {
|
|
|
10
14
|
placeholder: any;
|
|
11
15
|
};
|
|
12
16
|
static defaultProps: PerseusDropdownWidgetOptions;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
onCorrectChange: (arg1: number) => void;
|
|
17
|
-
onContentChange: (arg1: number, arg2: string) => void;
|
|
17
|
+
handleChange(changed: Partial<PerseusDropdownWidgetOptions>): void;
|
|
18
|
+
onCorrectChange(choiceIndex: number): void;
|
|
19
|
+
onContentChange(choiceIndex: number, newContent: string): void;
|
|
18
20
|
addChoice: () => void;
|
|
19
21
|
removeChoice: (arg1: number) => void;
|
|
20
|
-
focus: (arg1: number) => boolean;
|
|
21
22
|
serialize: () => any;
|
|
22
23
|
render(): React.ReactNode;
|
|
23
24
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type { ChangeableProps } from "../../mixins/changeable";
|
|
3
2
|
import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
|
|
4
3
|
import type { PerseusExplanationWidgetOptions } from "@khanacademy/perseus-core";
|
|
5
|
-
interface Props extends PerseusExplanationWidgetOptions
|
|
4
|
+
interface Props extends PerseusExplanationWidgetOptions {
|
|
6
5
|
apiOptions?: APIOptionsWithDefaults;
|
|
6
|
+
onChange: (options: PerseusExplanationWidgetOptions) => void;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* An editor for adding an explanation widget that provides supplementary information to users.
|
|
10
10
|
*/
|
|
11
11
|
declare class ExplanationEditor extends React.Component<Props> {
|
|
12
12
|
static defaultProps: PerseusExplanationWidgetOptions;
|
|
13
|
-
|
|
13
|
+
handleChange(changes: Partial<PerseusExplanationWidgetOptions>): void;
|
|
14
14
|
serialize: () => any;
|
|
15
15
|
render(): React.ReactNode;
|
|
16
16
|
}
|
|
@@ -2,12 +2,11 @@ import { PerseusExpressionAnswerFormConsidered } from "@khanacademy/perseus-core
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import type { APIOptions } from "@khanacademy/perseus";
|
|
4
4
|
import type { PerseusExpressionWidgetOptions, PerseusExpressionUserInput } from "@khanacademy/perseus-core";
|
|
5
|
+
type EditableExpressionWidgetOptions = Omit<PerseusExpressionWidgetOptions, "buttonsVisible">;
|
|
5
6
|
type Props = {
|
|
6
|
-
widgetId?: string;
|
|
7
|
-
value?: string;
|
|
8
7
|
apiOptions: APIOptions;
|
|
9
|
-
onChange: (newValues:
|
|
10
|
-
} &
|
|
8
|
+
onChange: (newValues: EditableExpressionWidgetOptions) => void;
|
|
9
|
+
} & EditableExpressionWidgetOptions;
|
|
11
10
|
type AnswerForm = PerseusExpressionWidgetOptions["answerForms"][number];
|
|
12
11
|
interface State {
|
|
13
12
|
functionsInternal: string;
|
|
@@ -18,6 +17,7 @@ interface State {
|
|
|
18
17
|
declare class ExpressionEditor extends React.Component<Props, State> {
|
|
19
18
|
static defaultProps: any;
|
|
20
19
|
constructor(props: Props);
|
|
20
|
+
handleChange(changes: Partial<EditableExpressionWidgetOptions>): void;
|
|
21
21
|
serialize(): PerseusExpressionWidgetOptions;
|
|
22
22
|
getSaveWarnings: () => any;
|
|
23
23
|
newAnswer: () => void;
|
|
@@ -9,7 +9,7 @@ type FillInTheBlankEditorHandle = {
|
|
|
9
9
|
getSaveWarnings: () => string[];
|
|
10
10
|
};
|
|
11
11
|
declare const _default: React.ForwardRefExoticComponent<PerseusFillInTheBlankWidgetOptions & {
|
|
12
|
-
onChange: (newOptions:
|
|
12
|
+
onChange: (newOptions: PerseusFillInTheBlankWidgetOptions) => void;
|
|
13
13
|
apiOptions?: APIOptionsWithDefaults;
|
|
14
14
|
} & React.RefAttributes<FillInTheBlankEditorHandle>> & {
|
|
15
15
|
defaultProps: PerseusFillInTheBlankWidgetOptions;
|
|
@@ -3,13 +3,14 @@ import type { APIOptions } from "@khanacademy/perseus";
|
|
|
3
3
|
import type { PerseusFreeResponseWidgetOptions, PerseusFreeResponseWidgetScoringCriterion } from "@khanacademy/perseus-core";
|
|
4
4
|
type Props = PerseusFreeResponseWidgetOptions & {
|
|
5
5
|
apiOptions: APIOptions;
|
|
6
|
-
onChange: (options:
|
|
6
|
+
onChange: (options: PerseusFreeResponseWidgetOptions) => void;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
9
|
* An editor for adding a free response widget that allows users to enter open-ended text answers.
|
|
10
10
|
*/
|
|
11
11
|
declare class FreeResponseEditor extends React.Component<Props> {
|
|
12
12
|
static defaultProps: any;
|
|
13
|
+
handleChange(changes: Partial<PerseusFreeResponseWidgetOptions>): void;
|
|
13
14
|
serialize: () => PerseusFreeResponseWidgetOptions;
|
|
14
15
|
getSaveWarnings: () => Array<string>;
|
|
15
16
|
handleUpdateCharacterLimit: (newValue: string) => void;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import Editor from "../../editor";
|
|
3
|
-
import type { ChangeableProps } from "../../mixins/changeable";
|
|
4
3
|
import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
|
|
5
4
|
import type { PerseusGradedGroupWidgetOptions } from "@khanacademy/perseus-core";
|
|
6
|
-
interface Props extends PerseusGradedGroupWidgetOptions
|
|
5
|
+
interface Props extends PerseusGradedGroupWidgetOptions {
|
|
7
6
|
apiOptions?: APIOptionsWithDefaults;
|
|
7
|
+
onChange: (options: PerseusGradedGroupWidgetOptions) => void;
|
|
8
8
|
}
|
|
9
9
|
declare class GradedGroupEditor extends React.Component<Props> {
|
|
10
10
|
static defaultProps: PerseusGradedGroupWidgetOptions;
|
|
11
11
|
editor: React.RefObject<Editor>;
|
|
12
12
|
hintEditor: React.RefObject<Editor>;
|
|
13
|
-
|
|
13
|
+
handleChange(changes: Partial<PerseusGradedGroupWidgetOptions>): void;
|
|
14
14
|
handleAddHint: () => void;
|
|
15
15
|
handleRemoveHint: () => void;
|
|
16
16
|
getSaveWarnings: () => any;
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import GradedGroupEditor from "../graded-group-editor";
|
|
3
3
|
import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
|
|
4
4
|
import type { PerseusGradedGroupSetWidgetOptions } from "@khanacademy/perseus-core";
|
|
5
|
-
interface Props extends PerseusGradedGroupSetWidgetOptions
|
|
5
|
+
interface Props extends PerseusGradedGroupSetWidgetOptions {
|
|
6
6
|
apiOptions?: APIOptionsWithDefaults;
|
|
7
|
+
onChange: (options: PerseusGradedGroupSetWidgetOptions) => void;
|
|
7
8
|
}
|
|
8
9
|
declare class GradedGroupSetEditor extends React.Component<Props> {
|
|
9
|
-
_editors: Array<
|
|
10
|
+
_editors: Array<GradedGroupEditor | null>;
|
|
10
11
|
static defaultProps: PerseusGradedGroupSetWidgetOptions;
|
|
11
|
-
UNSAFE_componentWillMount(): void;
|
|
12
|
-
change: (arg1: any, arg2: any, arg3: any) => any;
|
|
13
12
|
getSaveWarnings: () => ReadonlyArray<any>;
|
|
14
13
|
serialize: () => {
|
|
15
|
-
gradedGroups:
|
|
14
|
+
gradedGroups: import("@khanacademy/perseus-core").PerseusGradedGroupWidgetOptions[];
|
|
16
15
|
};
|
|
17
16
|
renderGroups: () => React.ReactNode;
|
|
18
17
|
addGroup: () => void;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
onChange: (
|
|
6
|
-
graph: PerseusGrapherWidgetOptions["graph"];
|
|
7
|
-
correct: GrapherAnswerTypes;
|
|
8
|
-
availableTypes: PerseusGrapherWidgetOptions["availableTypes"];
|
|
3
|
+
import type { PerseusGrapherWidgetOptions, GrapherFunctionType } from "@khanacademy/perseus-core";
|
|
4
|
+
interface Props extends PerseusGrapherWidgetOptions {
|
|
5
|
+
onChange: (options: PerseusGrapherWidgetOptions) => void;
|
|
9
6
|
apiOptions: APIOptionsWithDefaults;
|
|
10
|
-
}
|
|
7
|
+
}
|
|
11
8
|
declare class GrapherEditor extends React.Component<Props> {
|
|
12
9
|
static defaultProps: PerseusGrapherWidgetOptions;
|
|
13
|
-
|
|
10
|
+
handleChange(changes: Partial<PerseusGrapherWidgetOptions>): void;
|
|
11
|
+
handleAvailableTypesChange: (newAvailableTypes: GrapherFunctionType[]) => void;
|
|
14
12
|
serialize: () => any;
|
|
15
13
|
render(): React.ReactNode;
|
|
16
14
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Perseus editors",
|
|
4
4
|
"author": "Khan Academy",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "43.0.
|
|
6
|
+
"version": "43.0.1",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
"mafs": "^0.19.0",
|
|
37
37
|
"tiny-invariant": "1.3.1",
|
|
38
38
|
"@khanacademy/kas": "2.2.6",
|
|
39
|
-
"@khanacademy/keypad-context": "
|
|
40
|
-
"@khanacademy/kmath": "2.4.
|
|
41
|
-
"@khanacademy/math-input": "
|
|
42
|
-
"@khanacademy/perseus": "87.2.
|
|
43
|
-
"@khanacademy/perseus-core": "39.2.
|
|
44
|
-
"@khanacademy/perseus-linter": "5.4.
|
|
39
|
+
"@khanacademy/keypad-context": "4.0.0",
|
|
40
|
+
"@khanacademy/kmath": "2.4.53",
|
|
41
|
+
"@khanacademy/math-input": "28.0.0",
|
|
42
|
+
"@khanacademy/perseus": "87.2.2",
|
|
43
|
+
"@khanacademy/perseus-core": "39.2.2",
|
|
44
|
+
"@khanacademy/perseus-linter": "5.4.3",
|
|
45
45
|
"@khanacademy/perseus-utils": "2.1.5"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|