@khanacademy/perseus-editor 45.0.2 → 45.0.4
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 -78
- package/dist/{widgets/image-editor/components → components/dark-mode-toggle}/dark-mode-toggle.d.ts +3 -4
- package/dist/components/unsupported-widget-editor.d.ts +0 -4
- package/dist/components/widget-editor-container.d.ts +0 -9
- package/dist/editor.d.ts +0 -6
- package/dist/index.css +2 -46
- package/dist/index.d.ts +1 -1
- package/dist/index.js +15924 -1855
- package/dist/index.js.map +1 -1
- package/dist/widgets/categorizer-editor/categorizer-editor.d.ts +2 -6
- package/dist/widgets/cs-program-editor/cs-program-editor.d.ts +3 -5
- package/dist/widgets/definition-editor/definition-editor.d.ts +2 -6
- package/dist/widgets/dropdown-editor/dropdown-editor.d.ts +2 -6
- package/dist/widgets/explanation-editor/explanation-editor.d.ts +2 -6
- package/dist/widgets/expression-editor/expression-editor.d.ts +2 -6
- package/dist/widgets/fill-in-the-blank-editor/fill-in-the-blank-editor.d.ts +11 -10
- package/dist/widgets/free-response-editor/free-response-editor.d.ts +2 -6
- package/dist/widgets/graded-group-editor/graded-group-editor.d.ts +2 -9
- package/dist/widgets/graded-group-set-editor/graded-group-set-editor.d.ts +2 -8
- package/dist/widgets/grapher-editor/grapher-editor.d.ts +2 -6
- package/dist/widgets/group-editor/group-editor.d.ts +3 -7
- package/dist/widgets/iframe-editor/iframe-editor.d.ts +2 -4
- package/dist/widgets/image-editor/image-editor.d.ts +2 -6
- package/dist/widgets/interaction-editor/color-picker.d.ts +1 -1
- package/dist/widgets/interaction-editor/interaction-editor.d.ts +2 -4
- package/dist/widgets/interactive-graph-editor/interactive-graph-editor.d.ts +3 -8
- package/dist/widgets/interactive-graph-editor/start-coords/util.d.ts +0 -1
- package/dist/widgets/label-image-editor/label-image-editor.d.ts +7 -8
- package/dist/widgets/label-image-editor/question-markers.d.ts +1 -0
- package/dist/widgets/matcher-editor/matcher-editor.d.ts +2 -4
- package/dist/widgets/matrix-editor/matrix-editor.d.ts +2 -6
- package/dist/widgets/measurer-editor/measurer-editor.d.ts +2 -4
- package/dist/widgets/number-line-editor/number-line-editor.d.ts +2 -5
- package/dist/widgets/numeric-input-editor/numeric-input-editor.d.ts +2 -6
- package/dist/widgets/orderer-editor/orderer-editor.d.ts +2 -4
- package/dist/widgets/phet-simulation-editor/phet-simulation-editor.d.ts +2 -4
- package/dist/widgets/plotter-editor/plotter-editor.d.ts +2 -7
- package/dist/widgets/python-program-editor/python-program-editor.d.ts +2 -4
- package/dist/widgets/radio-editor/radio-editor.d.ts +2 -6
- package/dist/widgets/sorter-editor/sorter-editor.d.ts +4 -4
- package/dist/widgets/table-editor/table-editor.d.ts +3 -6
- package/dist/widgets/video-editor/video-editor.d.ts +2 -4
- package/dist/widgets/widget-editor-props.d.ts +6 -0
- package/package.json +45 -45
- package/dist/index.css.map +0 -1
- package/dist/mixins/editor-jsonify.d.ts +0 -8
- package/dist/testing/feature-flags-util.d.ts +0 -15
- package/dist/testing/image-loader-utils.d.ts +0 -9
- package/dist/testing/object-utils.d.ts +0 -1
- package/dist/testing/preview/exercise-preview-page.d.ts +0 -7
- package/dist/testing/preview/preview-renderer.d.ts +0 -12
- package/dist/testing/test-dependencies.d.ts +0 -4
- package/dist/tex-error-view.d.ts +0 -19
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { WidgetEditorProps } from "../widget-editor-props";
|
|
3
3
|
import type { PerseusCategorizerWidgetOptions } from "@khanacademy/perseus-core";
|
|
4
|
-
|
|
5
|
-
apiOptions?: APIOptionsWithDefaults;
|
|
6
|
-
onChange: (options: PerseusCategorizerWidgetOptions) => void;
|
|
7
|
-
}
|
|
4
|
+
type Props = WidgetEditorProps<PerseusCategorizerWidgetOptions>;
|
|
8
5
|
/**
|
|
9
6
|
* An editor for adding a categorizer widget that allows users to sort items into categories.
|
|
10
7
|
*/
|
|
11
8
|
declare class CategorizerEditor extends React.Component<Props> {
|
|
12
9
|
static defaultProps: PerseusCategorizerWidgetOptions;
|
|
13
10
|
handleChange(changed: Partial<PerseusCategorizerWidgetOptions>): void;
|
|
14
|
-
serialize: () => any;
|
|
15
11
|
render(): React.ReactNode;
|
|
16
12
|
}
|
|
17
13
|
export default CategorizerEditor;
|
|
@@ -2,18 +2,16 @@
|
|
|
2
2
|
* This editor is for embedding Khan Academy CS programs.
|
|
3
3
|
*/
|
|
4
4
|
import * as React from "react";
|
|
5
|
+
import type { WidgetEditorProps } from "../widget-editor-props";
|
|
5
6
|
import type { PerseusCSProgramWidgetOptions } from "@khanacademy/perseus-core";
|
|
6
|
-
|
|
7
|
-
onChange: (options: PerseusCSProgramWidgetOptions) => void;
|
|
8
|
-
}
|
|
7
|
+
type Props = WidgetEditorProps<PerseusCSProgramWidgetOptions>;
|
|
9
8
|
/**
|
|
10
9
|
* This is the main editor for this widget, to specify all the options.
|
|
11
10
|
*/
|
|
12
|
-
declare class CSProgramEditor extends React.Component<
|
|
11
|
+
declare class CSProgramEditor extends React.Component<Props> {
|
|
13
12
|
change: (...args: ReadonlyArray<unknown>) => any;
|
|
14
13
|
handleChange(changed: Partial<PerseusCSProgramWidgetOptions>): void;
|
|
15
14
|
_handleProgramIDChange: (arg1: string) => void;
|
|
16
|
-
serialize: () => any;
|
|
17
15
|
render(): React.ReactNode;
|
|
18
16
|
}
|
|
19
17
|
export default CSProgramEditor;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { InitializeWidgetOptionsParams } from "../../editor";
|
|
3
|
-
import type {
|
|
3
|
+
import type { WidgetEditorProps } from "../widget-editor-props";
|
|
4
4
|
import type { PerseusDefinitionWidgetOptions } from "@khanacademy/perseus-core";
|
|
5
|
-
|
|
6
|
-
apiOptions?: APIOptionsWithDefaults;
|
|
7
|
-
onChange: (options: PerseusDefinitionWidgetOptions) => void;
|
|
8
|
-
}
|
|
5
|
+
type Props = WidgetEditorProps<PerseusDefinitionWidgetOptions>;
|
|
9
6
|
/**
|
|
10
7
|
* An editor for adding an interactive definition widget that allows content
|
|
11
8
|
* editors to embed clickable terms with expandable explanations within content.
|
|
@@ -14,7 +11,6 @@ declare class DefinitionEditor extends React.Component<Props> {
|
|
|
14
11
|
static defaultProps: PerseusDefinitionWidgetOptions;
|
|
15
12
|
static initializeWidgetOptions(params: InitializeWidgetOptionsParams): PerseusDefinitionWidgetOptions;
|
|
16
13
|
handleChange(changed: Partial<PerseusDefinitionWidgetOptions>): void;
|
|
17
|
-
serialize: () => any;
|
|
18
14
|
render(): React.ReactNode;
|
|
19
15
|
}
|
|
20
16
|
export default DefinitionEditor;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { type PerseusDropdownWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
onChange: (options: PerseusDropdownWidgetOptions) => void;
|
|
6
|
-
apiOptions?: APIOptions;
|
|
7
|
-
}
|
|
3
|
+
import type { WidgetEditorProps } from "../widget-editor-props";
|
|
4
|
+
type Props = WidgetEditorProps<PerseusDropdownWidgetOptions>;
|
|
8
5
|
/**
|
|
9
6
|
* An editor for adding a dropdown widget that allows users to select an option from a predefined list.
|
|
10
7
|
*/
|
|
@@ -15,7 +12,6 @@ declare class DropdownEditor extends React.Component<Props> {
|
|
|
15
12
|
onContentChange(choiceIndex: number, newContent: string): void;
|
|
16
13
|
addChoice: () => void;
|
|
17
14
|
removeChoice: (arg1: number) => void;
|
|
18
|
-
serialize: () => any;
|
|
19
15
|
render(): React.ReactNode;
|
|
20
16
|
}
|
|
21
17
|
export default DropdownEditor;
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { WidgetEditorProps } from "../widget-editor-props";
|
|
3
3
|
import type { PerseusExplanationWidgetOptions } from "@khanacademy/perseus-core";
|
|
4
|
-
|
|
5
|
-
apiOptions?: APIOptionsWithDefaults;
|
|
6
|
-
onChange: (options: PerseusExplanationWidgetOptions) => void;
|
|
7
|
-
}
|
|
4
|
+
type Props = WidgetEditorProps<PerseusExplanationWidgetOptions>;
|
|
8
5
|
/**
|
|
9
6
|
* An editor for adding an explanation widget that provides supplementary information to users.
|
|
10
7
|
*/
|
|
11
8
|
declare class ExplanationEditor extends React.Component<Props> {
|
|
12
9
|
static defaultProps: PerseusExplanationWidgetOptions;
|
|
13
10
|
handleChange(changes: Partial<PerseusExplanationWidgetOptions>): void;
|
|
14
|
-
serialize: () => any;
|
|
15
11
|
render(): React.ReactNode;
|
|
16
12
|
}
|
|
17
13
|
export default ExplanationEditor;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { PerseusExpressionAnswerFormConsidered } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import type {
|
|
3
|
+
import type { WidgetEditorProps } from "../widget-editor-props";
|
|
4
4
|
import type { PerseusExpressionWidgetOptions, LegacyButtonSets, PerseusExpressionAnswerForm, PerseusExpressionUserInput } from "@khanacademy/perseus-core";
|
|
5
5
|
type EditableExpressionWidgetOptions = Omit<PerseusExpressionWidgetOptions, "buttonsVisible">;
|
|
6
|
-
type Props =
|
|
7
|
-
apiOptions: APIOptions;
|
|
8
|
-
onChange: (newValues: EditableExpressionWidgetOptions) => void;
|
|
9
|
-
} & EditableExpressionWidgetOptions;
|
|
6
|
+
type Props = WidgetEditorProps<EditableExpressionWidgetOptions>;
|
|
10
7
|
type AnswerForm = PerseusExpressionWidgetOptions["answerForms"][number];
|
|
11
8
|
interface State {
|
|
12
9
|
functionsInternal: string;
|
|
@@ -27,7 +24,6 @@ declare class ExpressionEditor extends React.Component<Props, State> {
|
|
|
27
24
|
};
|
|
28
25
|
constructor(props: Props);
|
|
29
26
|
handleChange(changes: Partial<EditableExpressionWidgetOptions>): void;
|
|
30
|
-
serialize(): PerseusExpressionWidgetOptions;
|
|
31
27
|
getSaveWarnings: () => any;
|
|
32
28
|
newAnswer: () => void;
|
|
33
29
|
handleRemoveForm: (answerKey: number) => void;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { APIOptions } from "@khanacademy/perseus";
|
|
3
3
|
import type { PerseusFillInTheBlankWidgetOptions } from "@khanacademy/perseus-core";
|
|
4
|
+
interface Props extends PerseusFillInTheBlankWidgetOptions {
|
|
5
|
+
onChange: (options: PerseusFillInTheBlankWidgetOptions) => void;
|
|
6
|
+
apiOptions?: APIOptions;
|
|
7
|
+
}
|
|
4
8
|
/**
|
|
5
|
-
*
|
|
9
|
+
* An editor for a Fill in the Blank widget, where the learner drags answer
|
|
10
|
+
* tiles from a choice bank into blanks in a passage.
|
|
11
|
+
*
|
|
12
|
+
* The controls are not built yet (LEMS-4371).
|
|
6
13
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
getSaveWarnings: () => string[];
|
|
10
|
-
};
|
|
11
|
-
declare const _default: React.ForwardRefExoticComponent<PerseusFillInTheBlankWidgetOptions & {
|
|
12
|
-
onChange: (newOptions: PerseusFillInTheBlankWidgetOptions) => void;
|
|
13
|
-
apiOptions?: APIOptionsWithDefaults;
|
|
14
|
-
} & React.RefAttributes<FillInTheBlankEditorHandle>> & {
|
|
14
|
+
declare function FillInTheBlankEditor({ apiOptions }: Props): React.JSX.Element | null;
|
|
15
|
+
declare const _default: typeof FillInTheBlankEditor & {
|
|
15
16
|
defaultProps: PerseusFillInTheBlankWidgetOptions;
|
|
16
17
|
};
|
|
17
18
|
export default _default;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { WidgetEditorProps } from "../widget-editor-props";
|
|
3
3
|
import type { PerseusFreeResponseWidgetOptions, PerseusFreeResponseWidgetScoringCriterion } from "@khanacademy/perseus-core";
|
|
4
|
-
type Props = PerseusFreeResponseWidgetOptions
|
|
5
|
-
apiOptions: APIOptions;
|
|
6
|
-
onChange: (options: PerseusFreeResponseWidgetOptions) => void;
|
|
7
|
-
};
|
|
4
|
+
type Props = WidgetEditorProps<PerseusFreeResponseWidgetOptions>;
|
|
8
5
|
/**
|
|
9
6
|
* An editor for adding a free response widget that allows users to enter open-ended text answers.
|
|
10
7
|
*/
|
|
@@ -17,7 +14,6 @@ declare class FreeResponseEditor extends React.Component<Props> {
|
|
|
17
14
|
scoringCriteria: ReadonlyArray<PerseusFreeResponseWidgetScoringCriterion>;
|
|
18
15
|
};
|
|
19
16
|
handleChange(changes: Partial<PerseusFreeResponseWidgetOptions>): void;
|
|
20
|
-
serialize: () => PerseusFreeResponseWidgetOptions;
|
|
21
17
|
getSaveWarnings: () => Array<string>;
|
|
22
18
|
handleUpdateCharacterLimit: (newValue: string) => void;
|
|
23
19
|
handleUpdateCriterion: (index: number, criterion: PerseusFreeResponseWidgetScoringCriterion) => void;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import Editor from "../../editor";
|
|
3
|
-
import type {
|
|
3
|
+
import type { WidgetEditorProps } from "../widget-editor-props";
|
|
4
4
|
import type { PerseusGradedGroupWidgetOptions } from "@khanacademy/perseus-core";
|
|
5
|
-
|
|
6
|
-
apiOptions?: APIOptionsWithDefaults;
|
|
7
|
-
onChange: (options: PerseusGradedGroupWidgetOptions) => void;
|
|
8
|
-
}
|
|
5
|
+
type Props = WidgetEditorProps<PerseusGradedGroupWidgetOptions>;
|
|
9
6
|
declare class GradedGroupEditor extends React.Component<Props> {
|
|
10
7
|
static defaultProps: PerseusGradedGroupWidgetOptions;
|
|
11
8
|
editor: React.RefObject<Editor>;
|
|
@@ -14,10 +11,6 @@ declare class GradedGroupEditor extends React.Component<Props> {
|
|
|
14
11
|
handleAddHint: () => void;
|
|
15
12
|
handleRemoveHint: () => void;
|
|
16
13
|
getSaveWarnings: () => any;
|
|
17
|
-
serialize: () => {
|
|
18
|
-
title: string;
|
|
19
|
-
hint: any | null | undefined;
|
|
20
|
-
};
|
|
21
14
|
render(): React.ReactNode;
|
|
22
15
|
}
|
|
23
16
|
export default GradedGroupEditor;
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import GradedGroupEditor from "../graded-group-editor";
|
|
3
|
-
import type {
|
|
3
|
+
import type { WidgetEditorProps } from "../widget-editor-props";
|
|
4
4
|
import type { PerseusGradedGroupSetWidgetOptions } from "@khanacademy/perseus-core";
|
|
5
|
-
|
|
6
|
-
apiOptions?: APIOptionsWithDefaults;
|
|
7
|
-
onChange: (options: PerseusGradedGroupSetWidgetOptions) => void;
|
|
8
|
-
}
|
|
5
|
+
type Props = WidgetEditorProps<PerseusGradedGroupSetWidgetOptions>;
|
|
9
6
|
declare class GradedGroupSetEditor extends React.Component<Props> {
|
|
10
7
|
_editors: Array<GradedGroupEditor | null>;
|
|
11
8
|
static defaultProps: PerseusGradedGroupSetWidgetOptions;
|
|
12
9
|
getSaveWarnings: () => ReadonlyArray<any>;
|
|
13
|
-
serialize: () => {
|
|
14
|
-
gradedGroups: import("@khanacademy/perseus-core").PerseusGradedGroupWidgetOptions[];
|
|
15
|
-
};
|
|
16
10
|
renderGroups: () => React.ReactNode;
|
|
17
11
|
addGroup: () => void;
|
|
18
12
|
render(): React.ReactNode;
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { WidgetEditorProps } from "../widget-editor-props";
|
|
3
3
|
import type { PerseusGrapherWidgetOptions, GrapherFunctionType } from "@khanacademy/perseus-core";
|
|
4
|
-
|
|
5
|
-
onChange: (options: PerseusGrapherWidgetOptions) => void;
|
|
6
|
-
apiOptions: APIOptionsWithDefaults;
|
|
7
|
-
}
|
|
4
|
+
type Props = WidgetEditorProps<PerseusGrapherWidgetOptions>;
|
|
8
5
|
declare class GrapherEditor extends React.Component<Props> {
|
|
9
6
|
static defaultProps: PerseusGrapherWidgetOptions;
|
|
10
7
|
handleChange(changes: Partial<PerseusGrapherWidgetOptions>): void;
|
|
11
8
|
handleAvailableTypesChange: (newAvailableTypes: GrapherFunctionType[]) => void;
|
|
12
|
-
serialize: () => any;
|
|
13
9
|
render(): React.ReactNode;
|
|
14
10
|
}
|
|
15
11
|
export default GrapherEditor;
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import Editor from "../../editor";
|
|
3
|
-
import type {
|
|
4
|
-
import type { PerseusGroupWidgetOptions
|
|
5
|
-
|
|
6
|
-
onChange: (options: PerseusGroupWidgetOptions) => void;
|
|
7
|
-
apiOptions: APIOptionsWithDefaults;
|
|
8
|
-
}
|
|
3
|
+
import type { WidgetEditorProps } from "../widget-editor-props";
|
|
4
|
+
import type { PerseusGroupWidgetOptions } from "@khanacademy/perseus-core";
|
|
5
|
+
type Props = WidgetEditorProps<PerseusGroupWidgetOptions>;
|
|
9
6
|
declare class GroupEditor extends React.Component<Props> {
|
|
10
7
|
static defaultProps: PerseusGroupWidgetOptions;
|
|
11
8
|
editor: React.RefObject<Editor>;
|
|
12
9
|
getSaveWarnings: () => ReadonlyArray<any>;
|
|
13
|
-
serialize(): PerseusRenderer;
|
|
14
10
|
render(): React.ReactNode;
|
|
15
11
|
}
|
|
16
12
|
export default GroupEditor;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { type PerseusIFrameWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
3
|
+
import type { WidgetEditorProps } from "../widget-editor-props";
|
|
4
|
+
type IframeEditorProps = WidgetEditorProps<PerseusIFrameWidgetOptions>;
|
|
6
5
|
/**
|
|
7
6
|
* This is the main editor for this widget, to specify all the options.
|
|
8
7
|
*/
|
|
9
8
|
declare class IframeEditor extends React.Component<IframeEditorProps> {
|
|
10
9
|
static defaultProps: PerseusIFrameWidgetOptions;
|
|
11
10
|
handleChange(changes: Partial<PerseusIFrameWidgetOptions>): void;
|
|
12
|
-
serialize: () => any;
|
|
13
11
|
render(): React.ReactNode;
|
|
14
12
|
}
|
|
15
13
|
export default IframeEditor;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { type PerseusImageWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
apiOptions: APIOptions;
|
|
6
|
-
onChange: (options: PerseusImageWidgetOptions) => void;
|
|
7
|
-
}
|
|
3
|
+
import type { WidgetEditorProps } from "../widget-editor-props";
|
|
4
|
+
type Props = WidgetEditorProps<PerseusImageWidgetOptions>;
|
|
8
5
|
/**
|
|
9
6
|
* An editor for adding an image widget that allows users to display and configure images within content.
|
|
10
7
|
*/
|
|
@@ -12,7 +9,6 @@ declare class ImageEditor extends React.Component<Props> {
|
|
|
12
9
|
static displayName: string;
|
|
13
10
|
static defaultProps: PerseusImageWidgetOptions;
|
|
14
11
|
handleChange: (changes: Partial<PerseusImageWidgetOptions>) => void;
|
|
15
|
-
serialize(): any;
|
|
16
12
|
render(): React.JSX.Element;
|
|
17
13
|
}
|
|
18
14
|
export default ImageEditor;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import type { WidgetEditorProps } from "../widget-editor-props";
|
|
2
3
|
import type { PerseusInteractionWidgetOptions, PerseusInteractionElement } from "@khanacademy/perseus-core";
|
|
3
|
-
|
|
4
|
-
onChange: (options: PerseusInteractionWidgetOptions) => void;
|
|
5
|
-
}
|
|
4
|
+
type Props = WidgetEditorProps<PerseusInteractionWidgetOptions>;
|
|
6
5
|
type State = any;
|
|
7
6
|
/**
|
|
8
7
|
* An editor for the interaction widget that allows users to engage with interactive content.
|
|
@@ -28,7 +27,6 @@ declare class InteractionEditor extends React.Component<Props, State> {
|
|
|
28
27
|
_deleteElement: (arg1: number) => void;
|
|
29
28
|
_moveElementUp: (arg1: number) => void;
|
|
30
29
|
_moveElementDown: (arg1: number) => void;
|
|
31
|
-
serialize: () => any;
|
|
32
30
|
render(): React.ReactNode;
|
|
33
31
|
}
|
|
34
32
|
export default InteractionEditor;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { InteractiveGraphSettingsData } from "./components/interactive-graph-settings";
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
3
|
+
import type { WidgetEditorProps } from "../widget-editor-props";
|
|
4
|
+
import type { PerseusGraphType, PerseusInteractiveGraphWidgetOptions } from "@khanacademy/perseus-core";
|
|
5
5
|
interface State {
|
|
6
6
|
/**
|
|
7
7
|
* An error message to display in the graph area, or true if the
|
|
@@ -9,11 +9,7 @@ interface State {
|
|
|
9
9
|
*/
|
|
10
10
|
valid: true | string;
|
|
11
11
|
}
|
|
12
|
-
export
|
|
13
|
-
apiOptions: APIOptionsWithDefaults;
|
|
14
|
-
onChange: (options: PerseusInteractiveGraphWidgetOptions) => void;
|
|
15
|
-
static?: boolean;
|
|
16
|
-
}
|
|
12
|
+
export type Props = WidgetEditorProps<PerseusInteractiveGraphWidgetOptions>;
|
|
17
13
|
/**
|
|
18
14
|
* An editor for the InteractiveGraph widget, which allows the user to
|
|
19
15
|
* specify the graph's properties and the correct answer.
|
|
@@ -55,7 +51,6 @@ declare class InteractiveGraphEditor extends React.Component<Props, State> {
|
|
|
55
51
|
changeStartCoords: (coords: any) => void;
|
|
56
52
|
changePointLabels: (pointLabels: ReadonlyArray<string>) => void;
|
|
57
53
|
changeShowPointLabels: (showPointLabels: boolean) => void;
|
|
58
|
-
serialize(): PerseusInteractiveGraphWidgetOptions;
|
|
59
54
|
getSaveWarnings: () => any[];
|
|
60
55
|
render(): React.JSX.Element;
|
|
61
56
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { StartCoords } from "./types";
|
|
2
2
|
import type { Range, PerseusGraphType, Coord } from "@khanacademy/perseus-core";
|
|
3
|
-
export declare function getStartCoords(graph: PerseusGraphType): StartCoords;
|
|
4
3
|
export declare function getDefaultGraphStartCoords(graph: PerseusGraphType, range: [x: Range, y: Range], step: [x: number, y: number]): StartCoords;
|
|
5
4
|
export declare const getSinusoidEquation: (startCoords: [Coord, Coord]) => string;
|
|
6
5
|
export declare const getTangentEquation: (startCoords: [Coord, Coord]) => string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { WidgetEditorProps } from "../widget-editor-props";
|
|
3
3
|
import type { PerseusLabelImageWidgetOptions } from "@khanacademy/perseus-core";
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
4
|
+
export type Props = WidgetEditorProps<PerseusLabelImageWidgetOptions>;
|
|
5
|
+
type State = {
|
|
6
|
+
wbTheme?: string;
|
|
7
|
+
};
|
|
8
8
|
/**
|
|
9
9
|
* Direct image labeling widget editor.
|
|
10
10
|
*
|
|
@@ -12,18 +12,17 @@ export interface Props extends PerseusLabelImageWidgetOptions {
|
|
|
12
12
|
* that involve the use of images, and enable learners to demonstrate their
|
|
13
13
|
* knowledge by directly interacting with the image.
|
|
14
14
|
*/
|
|
15
|
-
declare class LabelImageEditor extends React.Component<Props> {
|
|
15
|
+
declare class LabelImageEditor extends React.Component<Props, State> {
|
|
16
16
|
private _questionMarkers;
|
|
17
|
+
state: State;
|
|
17
18
|
static defaultProps: PerseusLabelImageWidgetOptions;
|
|
18
19
|
componentDidUpdate(prevProps: Props): void;
|
|
19
20
|
handleChange(changes: Partial<PerseusLabelImageWidgetOptions>): void;
|
|
20
21
|
getSaveWarnings: () => ReadonlyArray<any | string>;
|
|
21
|
-
serialize(): any;
|
|
22
22
|
handleImageChange: (url: string) => void;
|
|
23
23
|
handleAltChange: (alt: string) => void;
|
|
24
24
|
handleChoicesChange: (choices: string[]) => void;
|
|
25
25
|
handleMarkersChange: (markers: PerseusLabelImageWidgetOptions["markers"]) => void;
|
|
26
|
-
handleBehaviorChange: (options?: any) => void;
|
|
27
26
|
render(): React.ReactNode;
|
|
28
27
|
}
|
|
29
28
|
export default LabelImageEditor;
|
|
@@ -12,6 +12,7 @@ type QuestionMarkersProps = {
|
|
|
12
12
|
markers: PerseusLabelImageWidgetOptions["markers"];
|
|
13
13
|
onChange: (markers: PerseusLabelImageWidgetOptions["markers"]) => void;
|
|
14
14
|
editingDisabled: boolean;
|
|
15
|
+
wbTheme?: string;
|
|
15
16
|
};
|
|
16
17
|
declare class QuestionMarkers extends React.Component<QuestionMarkersProps> {
|
|
17
18
|
private _markers;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type PerseusMatcherWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
3
|
+
import type { WidgetEditorProps } from "../widget-editor-props";
|
|
4
|
+
type Props = WidgetEditorProps<PerseusMatcherWidgetOptions>;
|
|
6
5
|
/**
|
|
7
6
|
* An editor for adding a matcher widget that allows users to match items from two different sets.
|
|
8
7
|
*/
|
|
@@ -11,7 +10,6 @@ declare class MatcherEditor extends React.Component<Props> {
|
|
|
11
10
|
handleChange(changes: Partial<PerseusMatcherWidgetOptions>): void;
|
|
12
11
|
onLabelChange: (index: number, e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
13
12
|
getSaveWarnings: () => string[];
|
|
14
|
-
serialize: () => PerseusMatcherWidgetOptions;
|
|
15
13
|
render(): React.ReactNode;
|
|
16
14
|
}
|
|
17
15
|
export default MatcherEditor;
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { WidgetEditorProps } from "../widget-editor-props";
|
|
3
3
|
import type { PerseusMatrixWidgetOptions } from "@khanacademy/perseus-core";
|
|
4
|
-
|
|
5
|
-
apiOptions: APIOptionsWithDefaults;
|
|
6
|
-
onChange: (options: PerseusMatrixWidgetOptions) => void;
|
|
7
|
-
}
|
|
4
|
+
type Props = WidgetEditorProps<PerseusMatrixWidgetOptions>;
|
|
8
5
|
declare class MatrixEditor extends React.Component<Props> {
|
|
9
6
|
static defaultProps: PerseusMatrixWidgetOptions;
|
|
10
7
|
handleChange(changes: Partial<PerseusMatrixWidgetOptions>): void;
|
|
11
8
|
onMatrixBoardSizeChange: (arg1: [number, number]) => void;
|
|
12
|
-
serialize: () => any;
|
|
13
9
|
render(): React.ReactNode;
|
|
14
10
|
}
|
|
15
11
|
export default MatrixEditor;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import type { WidgetEditorProps } from "../widget-editor-props";
|
|
2
3
|
import type { PerseusMeasurerWidgetOptions } from "@khanacademy/perseus-core";
|
|
3
|
-
|
|
4
|
-
onChange: (options: PerseusMeasurerWidgetOptions) => void;
|
|
5
|
-
}
|
|
4
|
+
type Props = WidgetEditorProps<PerseusMeasurerWidgetOptions>;
|
|
6
5
|
declare class MeasurerEditor extends React.Component<Props> {
|
|
7
6
|
static defaultProps: PerseusMeasurerWidgetOptions;
|
|
8
7
|
className: string;
|
|
@@ -12,7 +11,6 @@ declare class MeasurerEditor extends React.Component<Props> {
|
|
|
12
11
|
_changeLeft: (arg1: any) => void;
|
|
13
12
|
_changeImage: (arg1: string, arg2: any) => void;
|
|
14
13
|
renderLabelChoices: (arg1: ReadonlyArray<[string, string]>) => ReadonlyArray<React.ReactElement<React.ComponentProps<"option">>>;
|
|
15
|
-
serialize: () => any;
|
|
16
14
|
render(): React.ReactNode;
|
|
17
15
|
}
|
|
18
16
|
export default MeasurerEditor;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import type { WidgetEditorProps } from "../widget-editor-props";
|
|
2
3
|
import type { PerseusNumberLineWidgetOptions, MathFormat } from "@khanacademy/perseus-core";
|
|
3
|
-
|
|
4
|
-
static?: boolean;
|
|
5
|
-
onChange: (options: PerseusNumberLineWidgetOptions) => void;
|
|
6
|
-
}
|
|
4
|
+
type Props = WidgetEditorProps<PerseusNumberLineWidgetOptions>;
|
|
7
5
|
/**
|
|
8
6
|
* An editor for adding a number line widget that allows users to mark
|
|
9
7
|
* positions, intervals, and points on a number line.
|
|
@@ -15,7 +13,6 @@ declare class NumberLineEditor extends React.Component<Props> {
|
|
|
15
13
|
onNumDivisionsChange: (numDivisions: number) => void;
|
|
16
14
|
onTickStepChange: (tickStep: number) => void;
|
|
17
15
|
onChangeRelation: (value: "eq" | "lt" | "gt" | "le" | "ge") => void;
|
|
18
|
-
serialize: () => any;
|
|
19
16
|
getNumberInputFormat(): MathFormat;
|
|
20
17
|
render(): React.ReactNode;
|
|
21
18
|
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { type PerseusNumericInputWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
onChange: (options: PerseusNumericInputWidgetOptions) => void;
|
|
6
|
-
apiOptions: APIOptionsWithDefaults;
|
|
7
|
-
}
|
|
3
|
+
import type { WidgetEditorProps } from "../widget-editor-props";
|
|
4
|
+
type Props = WidgetEditorProps<PerseusNumericInputWidgetOptions>;
|
|
8
5
|
interface State {
|
|
9
6
|
lastStatus: string;
|
|
10
7
|
showAnswerDetails: boolean[];
|
|
@@ -34,7 +31,6 @@ declare class NumericInputEditor extends React.Component<Props, State> {
|
|
|
34
31
|
updateAnswer: (choiceIndex: any, update: any) => ((p3: any) => void) | undefined;
|
|
35
32
|
addAnswer: () => void;
|
|
36
33
|
getSaveWarnings: () => never[];
|
|
37
|
-
serialize: () => any;
|
|
38
34
|
render(): React.JSX.Element;
|
|
39
35
|
}
|
|
40
36
|
export default NumericInputEditor;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { type PerseusOrdererWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
3
|
+
import type { WidgetEditorProps } from "../widget-editor-props";
|
|
4
|
+
type Props = WidgetEditorProps<PerseusOrdererWidgetOptions>;
|
|
6
5
|
declare class OrdererEditor extends React.Component<Props> {
|
|
7
6
|
static defaultProps: PerseusOrdererWidgetOptions;
|
|
8
7
|
handleChange(changes: Partial<PerseusOrdererWidgetOptions>): void;
|
|
9
8
|
onOptionsChange: (whichOptions: "correctOptions" | "otherOptions", options: string[]) => void;
|
|
10
|
-
serialize: () => PerseusOrdererWidgetOptions;
|
|
11
9
|
render(): React.ReactNode;
|
|
12
10
|
}
|
|
13
11
|
export default OrdererEditor;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type PerseusPhetSimulationWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
3
|
+
import type { WidgetEditorProps } from "../widget-editor-props";
|
|
4
|
+
type Props = WidgetEditorProps<PerseusPhetSimulationWidgetOptions>;
|
|
6
5
|
/**
|
|
7
6
|
* An editor for adding a PhET simulation widget that allows users to interact
|
|
8
7
|
* with physics simulations.
|
|
@@ -10,7 +9,6 @@ interface Props extends PerseusPhetSimulationWidgetOptions {
|
|
|
10
9
|
declare class PhetSimulationEditor extends React.Component<Props> {
|
|
11
10
|
static defaultProps: PerseusPhetSimulationWidgetOptions;
|
|
12
11
|
handleChange(changes: Partial<PerseusPhetSimulationWidgetOptions>): void;
|
|
13
|
-
serialize(): PerseusPhetSimulationWidgetOptions;
|
|
14
12
|
getSaveWarnings: () => ReadonlyArray<string>;
|
|
15
13
|
render(): React.ReactNode;
|
|
16
14
|
}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { WidgetEditorProps } from "../widget-editor-props";
|
|
3
3
|
import type { PerseusPlotterWidgetOptions } from "@khanacademy/perseus-core";
|
|
4
4
|
declare const editingStates: string[];
|
|
5
5
|
type EditingState = (typeof editingStates)[number];
|
|
6
|
-
|
|
7
|
-
apiOptions: APIOptions;
|
|
8
|
-
static: boolean;
|
|
9
|
-
onChange: (options: PerseusPlotterWidgetOptions) => void;
|
|
10
|
-
}
|
|
6
|
+
type Props = WidgetEditorProps<PerseusPlotterWidgetOptions>;
|
|
11
7
|
type State = {
|
|
12
8
|
editing: EditingState;
|
|
13
9
|
pic: any;
|
|
@@ -38,7 +34,6 @@ declare class PlotterEditor extends React.Component<Props, State> {
|
|
|
38
34
|
changeSnaps: (arg1: any) => void;
|
|
39
35
|
changeEditing: (arg1: EditingState) => void;
|
|
40
36
|
setCategoriesFromScale: () => void;
|
|
41
|
-
serialize: () => any;
|
|
42
37
|
render(): React.ReactNode;
|
|
43
38
|
}
|
|
44
39
|
export default PlotterEditor;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import type { WidgetEditorProps } from "../widget-editor-props";
|
|
2
3
|
import type { PerseusPythonProgramWidgetOptions } from "@khanacademy/perseus-core";
|
|
3
|
-
|
|
4
|
-
onChange: (options: PerseusPythonProgramWidgetOptions) => void;
|
|
5
|
-
}
|
|
4
|
+
type Props = WidgetEditorProps<PerseusPythonProgramWidgetOptions>;
|
|
6
5
|
export declare function validateOptions(height: Props["height"], programID: Props["programID"]): ReadonlyArray<string>;
|
|
7
6
|
/**
|
|
8
7
|
* An editor for adding a Python program widget that allows users to write, edit and execute Python code.
|
|
@@ -10,7 +9,6 @@ export declare function validateOptions(height: Props["height"], programID: Prop
|
|
|
10
9
|
declare class PythonProgramEditor extends React.Component<Props> {
|
|
11
10
|
static defaultProps: PerseusPythonProgramWidgetOptions;
|
|
12
11
|
handleChange(changes: Partial<PerseusPythonProgramWidgetOptions>): void;
|
|
13
|
-
serialize(): PerseusPythonProgramWidgetOptions;
|
|
14
12
|
getSaveWarnings: () => ReadonlyArray<string>;
|
|
15
13
|
render(): React.ReactNode;
|
|
16
14
|
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { RadioOptionSettingsHandle } from "./radio-option-settings";
|
|
3
3
|
import type { ChoiceMovementType } from "./radio-option-settings-actions";
|
|
4
|
-
import type {
|
|
4
|
+
import type { WidgetEditorProps } from "../widget-editor-props";
|
|
5
5
|
import type { PerseusRadioWidgetOptions } from "@khanacademy/perseus-core";
|
|
6
|
-
export
|
|
7
|
-
apiOptions: APIOptions;
|
|
8
|
-
onChange: (options: PerseusRadioWidgetOptions) => void;
|
|
9
|
-
}
|
|
6
|
+
export type RadioEditorProps = WidgetEditorProps<PerseusRadioWidgetOptions>;
|
|
10
7
|
/**
|
|
11
8
|
* An editor for adding a radio widget that allows users to select a single option from multiple choices.
|
|
12
9
|
*/
|
|
@@ -39,7 +36,6 @@ declare class RadioEditor extends React.Component<RadioEditorProps> {
|
|
|
39
36
|
handleMove: (choiceIndex: number, movement: ChoiceMovementType) => void;
|
|
40
37
|
focus: () => boolean;
|
|
41
38
|
getSaveWarnings: () => ReadonlyArray<string>;
|
|
42
|
-
serialize(): PerseusRadioWidgetOptions;
|
|
43
39
|
render(): React.ReactNode;
|
|
44
40
|
}
|
|
45
41
|
export default RadioEditor;
|