@khanacademy/perseus-editor 38.0.0 → 38.1.2
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 +9 -2
- package/dist/editor-page.d.ts +1 -7
- package/dist/es/index.css +3 -3
- package/dist/es/index.css.map +1 -1
- package/dist/es/index.js +126 -118
- package/dist/es/index.js.map +1 -1
- package/dist/index.css +3 -3
- package/dist/index.css.map +1 -1
- package/dist/index.js +127 -117
- package/dist/index.js.map +1 -1
- package/dist/item-editor.d.ts +5 -5
- package/dist/widgets/categorizer-editor/categorizer-editor.d.ts +3 -3
- package/dist/widgets/cs-program-editor/cs-program-editor.d.ts +2 -2
- package/dist/widgets/definition-editor/definition-editor.d.ts +4 -4
- package/dist/widgets/dropdown-editor/dropdown-editor.d.ts +2 -2
- package/dist/widgets/explanation-editor/explanation-editor.d.ts +3 -3
- 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 +3 -3
- package/dist/widgets/grapher-editor/grapher-editor.d.ts +2 -2
- package/dist/widgets/group-editor/group-editor.d.ts +2 -2
- package/dist/widgets/iframe-editor/iframe-editor.d.ts +3 -3
- package/dist/widgets/image-editor/image-editor.d.ts +2 -2
- package/dist/widgets/interaction-editor/interaction-editor.d.ts +2 -2
- package/dist/widgets/interactive-graph-editor/interactive-graph-editor.d.ts +8 -4
- package/dist/widgets/label-image-editor/label-image-editor.d.ts +2 -2
- package/dist/widgets/matrix-editor/matrix-editor.d.ts +3 -3
- package/dist/widgets/measurer-editor/measurer-editor.d.ts +3 -3
- package/dist/widgets/number-line-editor/number-line-editor.d.ts +2 -2
- package/dist/widgets/orderer-editor/orderer-editor.d.ts +1 -6
- package/dist/widgets/phet-simulation-editor/phet-simulation-editor.d.ts +3 -3
- package/dist/widgets/plotter-editor/plotter-editor.d.ts +2 -2
- package/dist/widgets/python-program-editor/python-program-editor.d.ts +2 -2
- package/dist/widgets/radio-editor/radio-editor.d.ts +2 -2
- package/dist/widgets/sorter-editor/card-editor.d.ts +19 -0
- package/dist/widgets/sorter-editor/sorter-editor.d.ts +11 -11
- package/dist/widgets/table-editor/table-editor.d.ts +2 -2
- package/dist/widgets/video-editor/video-editor.d.ts +2 -2
- package/package.json +10 -10
- /package/dist/{hint-editor.d.ts → combined-hints-editor.d.ts} +0 -0
package/dist/item-editor.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import CombinedHintsEditor from "./combined-hints-editor";
|
|
2
3
|
import { A11yContext } from "./components/a11y-context";
|
|
3
4
|
import Editor from "./editor";
|
|
4
5
|
import ItemExtrasEditor from "./item-extras-editor";
|
|
5
6
|
import type { A11yReport } from "./preview/use-preview-controller";
|
|
6
7
|
import type { APIOptions, ImageUploader, ChangeHandler, DeviceType } from "@khanacademy/perseus";
|
|
7
|
-
import type { PerseusAnswerArea, PerseusRenderer, PerseusItem } from "@khanacademy/perseus-core";
|
|
8
|
+
import type { PerseusAnswerArea, PerseusRenderer, PerseusItem, Hint } from "@khanacademy/perseus-core";
|
|
8
9
|
type Props = {
|
|
9
10
|
/** Additional templates that the host application would like to display
|
|
10
11
|
* within the Perseus Editor.
|
|
@@ -15,6 +16,7 @@ type Props = {
|
|
|
15
16
|
widgetIsOpen?: boolean;
|
|
16
17
|
imageUploader?: ImageUploader;
|
|
17
18
|
question?: PerseusRenderer;
|
|
19
|
+
hints: Hint[];
|
|
18
20
|
answerArea?: PerseusAnswerArea | null;
|
|
19
21
|
/** URL of the route to show on initial load of the preview frames. */
|
|
20
22
|
previewURL: string;
|
|
@@ -39,6 +41,7 @@ declare class ItemEditor extends React.Component<Props> {
|
|
|
39
41
|
};
|
|
40
42
|
questionEditor: React.RefObject<Editor>;
|
|
41
43
|
itemExtrasEditor: React.RefObject<ItemExtrasEditor>;
|
|
44
|
+
hintsEditor: React.RefObject<CombinedHintsEditor>;
|
|
42
45
|
derivePreviewContent: (inputs: import("./util/derive-question-preview-content").DerivePreviewContentInputs) => {
|
|
43
46
|
type: "question";
|
|
44
47
|
data: import("./preview/message-types").QuestionPreviewData;
|
|
@@ -48,10 +51,7 @@ declare class ItemEditor extends React.Component<Props> {
|
|
|
48
51
|
handleItemExtrasChange: (newProps: Partial<PerseusAnswerArea>) => void;
|
|
49
52
|
getSaveWarnings: () => any;
|
|
50
53
|
handleA11yReport: (report: A11yReport | null) => void;
|
|
51
|
-
serialize():
|
|
52
|
-
answerArea: PerseusAnswerArea;
|
|
53
|
-
question: PerseusRenderer;
|
|
54
|
-
};
|
|
54
|
+
serialize(): PerseusItem;
|
|
55
55
|
render(): React.ReactNode;
|
|
56
56
|
}
|
|
57
57
|
export default ItemEditor;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { ChangeableProps } from "../../mixins/changeable";
|
|
3
3
|
import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
|
|
4
|
-
import type {
|
|
5
|
-
interface Props extends
|
|
4
|
+
import type { PerseusCategorizerWidgetOptions } from "@khanacademy/perseus-core";
|
|
5
|
+
interface Props extends PerseusCategorizerWidgetOptions, ChangeableProps {
|
|
6
6
|
apiOptions?: APIOptionsWithDefaults;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
@@ -10,7 +10,7 @@ interface Props extends CategorizerDefaultWidgetOptions, ChangeableProps {
|
|
|
10
10
|
*/
|
|
11
11
|
declare class CategorizerEditor extends React.Component<Props> {
|
|
12
12
|
static widgetName: "categorizer";
|
|
13
|
-
static defaultProps:
|
|
13
|
+
static defaultProps: PerseusCategorizerWidgetOptions;
|
|
14
14
|
change: (arg1: any, arg2: any, arg3: any) => any;
|
|
15
15
|
serialize: () => any;
|
|
16
16
|
render(): React.ReactNode;
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import type { ChangeableProps } from "../../mixins/changeable";
|
|
6
|
-
import type {
|
|
7
|
-
interface CSProgramEditorProps extends
|
|
6
|
+
import type { PerseusCSProgramWidgetOptions } from "@khanacademy/perseus-core";
|
|
7
|
+
interface CSProgramEditorProps extends PerseusCSProgramWidgetOptions, ChangeableProps {
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
10
|
* This is the main editor for this widget, to specify all the options.
|
|
@@ -2,8 +2,8 @@ import * as React from "react";
|
|
|
2
2
|
import type { InitializeWidgetOptionsParams } from "../../editor";
|
|
3
3
|
import type { ChangeableProps } from "../../mixins/changeable";
|
|
4
4
|
import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
|
|
5
|
-
import type {
|
|
6
|
-
interface Props extends
|
|
5
|
+
import type { PerseusDefinitionWidgetOptions } from "@khanacademy/perseus-core";
|
|
6
|
+
interface Props extends PerseusDefinitionWidgetOptions, ChangeableProps {
|
|
7
7
|
apiOptions?: APIOptionsWithDefaults;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
@@ -12,8 +12,8 @@ interface Props extends DefinitionDefaultWidgetOptions, ChangeableProps {
|
|
|
12
12
|
*/
|
|
13
13
|
declare class DefinitionEditor extends React.Component<Props> {
|
|
14
14
|
static widgetName: "definition";
|
|
15
|
-
static defaultProps:
|
|
16
|
-
static initializeWidgetOptions(params: InitializeWidgetOptionsParams):
|
|
15
|
+
static defaultProps: PerseusDefinitionWidgetOptions;
|
|
16
|
+
static initializeWidgetOptions(params: InitializeWidgetOptionsParams): PerseusDefinitionWidgetOptions;
|
|
17
17
|
change: (arg1: any, arg2: any, arg3: any) => any;
|
|
18
18
|
serialize: () => any;
|
|
19
19
|
render(): React.ReactNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type PerseusDropdownWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
type Props = any;
|
|
4
4
|
/**
|
|
@@ -10,7 +10,7 @@ declare class DropdownEditor extends React.Component<Props> {
|
|
|
10
10
|
placeholder: any;
|
|
11
11
|
};
|
|
12
12
|
static widgetName: "dropdown";
|
|
13
|
-
static defaultProps:
|
|
13
|
+
static defaultProps: PerseusDropdownWidgetOptions;
|
|
14
14
|
onVisibleLabelChange: (arg1: string) => void;
|
|
15
15
|
onAriaLabelChange: (arg1: string) => void;
|
|
16
16
|
onPlaceholderChange: (arg1: string) => void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { ChangeableProps } from "../../mixins/changeable";
|
|
3
3
|
import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
|
|
4
|
-
import type {
|
|
5
|
-
interface Props extends
|
|
4
|
+
import type { PerseusExplanationWidgetOptions } from "@khanacademy/perseus-core";
|
|
5
|
+
interface Props extends PerseusExplanationWidgetOptions, ChangeableProps {
|
|
6
6
|
apiOptions?: APIOptionsWithDefaults;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
@@ -10,7 +10,7 @@ interface Props extends ExplanationDefaultWidgetOptions, ChangeableProps {
|
|
|
10
10
|
*/
|
|
11
11
|
declare class ExplanationEditor extends React.Component<Props> {
|
|
12
12
|
static widgetName: "explanation";
|
|
13
|
-
static defaultProps:
|
|
13
|
+
static defaultProps: PerseusExplanationWidgetOptions;
|
|
14
14
|
change: (arg1: any, arg2: any, arg3: any) => any;
|
|
15
15
|
serialize: () => any;
|
|
16
16
|
render(): React.ReactNode;
|
|
@@ -2,13 +2,13 @@ import * as React from "react";
|
|
|
2
2
|
import Editor from "../../editor";
|
|
3
3
|
import type { ChangeableProps } from "../../mixins/changeable";
|
|
4
4
|
import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
|
|
5
|
-
import type {
|
|
6
|
-
interface Props extends
|
|
5
|
+
import type { PerseusGradedGroupWidgetOptions } from "@khanacademy/perseus-core";
|
|
6
|
+
interface Props extends PerseusGradedGroupWidgetOptions, ChangeableProps {
|
|
7
7
|
apiOptions?: APIOptionsWithDefaults;
|
|
8
8
|
}
|
|
9
9
|
declare class GradedGroupEditor extends React.Component<Props> {
|
|
10
10
|
static widgetName: "graded-group";
|
|
11
|
-
static defaultProps:
|
|
11
|
+
static defaultProps: PerseusGradedGroupWidgetOptions;
|
|
12
12
|
editor: React.RefObject<Editor>;
|
|
13
13
|
hintEditor: React.RefObject<Editor>;
|
|
14
14
|
change: (arg1: any, arg2: any, arg3: any) => any;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { ChangeableProps } from "../../mixins/changeable";
|
|
3
3
|
import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
|
|
4
|
-
import type {
|
|
5
|
-
interface Props extends
|
|
4
|
+
import type { PerseusGradedGroupSetWidgetOptions } from "@khanacademy/perseus-core";
|
|
5
|
+
interface Props extends PerseusGradedGroupSetWidgetOptions, ChangeableProps {
|
|
6
6
|
apiOptions?: APIOptionsWithDefaults;
|
|
7
7
|
}
|
|
8
8
|
declare class GradedGroupSetEditor extends React.Component<Props> {
|
|
9
9
|
_editors: Array<any>;
|
|
10
10
|
static widgetName: "graded-group-set";
|
|
11
|
-
static defaultProps:
|
|
11
|
+
static defaultProps: PerseusGradedGroupSetWidgetOptions;
|
|
12
12
|
UNSAFE_componentWillMount(): void;
|
|
13
13
|
change: (arg1: any, arg2: any, arg3: any) => any;
|
|
14
14
|
getSaveWarnings: () => ReadonlyArray<any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
|
|
3
|
-
import type { GrapherAnswerTypes,
|
|
3
|
+
import type { GrapherAnswerTypes, PerseusGrapherWidgetOptions } from "@khanacademy/perseus-core";
|
|
4
4
|
type Props = {
|
|
5
5
|
onChange: (newProps: Record<string, unknown>) => void;
|
|
6
6
|
graph: PerseusGrapherWidgetOptions["graph"];
|
|
@@ -10,7 +10,7 @@ type Props = {
|
|
|
10
10
|
};
|
|
11
11
|
declare class GrapherEditor extends React.Component<Props> {
|
|
12
12
|
static widgetName: "grapher";
|
|
13
|
-
static defaultProps:
|
|
13
|
+
static defaultProps: PerseusGrapherWidgetOptions;
|
|
14
14
|
handleAvailableTypesChange: (newAvailableTypes: Array<any>) => void;
|
|
15
15
|
serialize: () => any;
|
|
16
16
|
render(): React.ReactNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import Editor from "../../editor";
|
|
3
|
-
import type {
|
|
3
|
+
import type { PerseusGroupWidgetOptions, PerseusRenderer } from "@khanacademy/perseus-core";
|
|
4
4
|
type Props = any;
|
|
5
5
|
declare class GroupEditor extends React.Component<Props> {
|
|
6
6
|
static propTypes: {
|
|
@@ -10,7 +10,7 @@ declare class GroupEditor extends React.Component<Props> {
|
|
|
10
10
|
apiOptions: any;
|
|
11
11
|
};
|
|
12
12
|
static widgetName: "group";
|
|
13
|
-
static defaultProps:
|
|
13
|
+
static defaultProps: PerseusGroupWidgetOptions;
|
|
14
14
|
editor: React.RefObject<Editor>;
|
|
15
15
|
getSaveWarnings: () => ReadonlyArray<any>;
|
|
16
16
|
serialize(): PerseusRenderer;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type PerseusIFrameWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import type { ChangeableProps } from "../../mixins/changeable";
|
|
4
|
-
interface IframeEditorProps extends
|
|
4
|
+
interface IframeEditorProps extends PerseusIFrameWidgetOptions, ChangeableProps {
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* This is the main editor for this widget, to specify all the options.
|
|
8
8
|
*/
|
|
9
9
|
declare class IframeEditor extends React.Component<IframeEditorProps> {
|
|
10
10
|
static widgetName: "iframe";
|
|
11
|
-
static defaultProps:
|
|
11
|
+
static defaultProps: PerseusIFrameWidgetOptions;
|
|
12
12
|
change: (arg1: any, arg2: any, arg3: any) => any;
|
|
13
13
|
handleSettingsChange: (arg1: any) => void;
|
|
14
14
|
serialize: () => any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type PerseusImageWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import type { APIOptions } from "@khanacademy/perseus";
|
|
4
4
|
export interface Props extends PerseusImageWidgetOptions {
|
|
@@ -11,7 +11,7 @@ export interface Props extends PerseusImageWidgetOptions {
|
|
|
11
11
|
declare class ImageEditor extends React.Component<Props> {
|
|
12
12
|
static displayName: string;
|
|
13
13
|
static widgetName: string;
|
|
14
|
-
static defaultProps:
|
|
14
|
+
static defaultProps: PerseusImageWidgetOptions;
|
|
15
15
|
serialize(): any;
|
|
16
16
|
render(): React.JSX.Element;
|
|
17
17
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Coords, type
|
|
1
|
+
import { type Coords, type PerseusInteractionWidgetOptions, type MarkingsType } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
type Graph = {
|
|
4
4
|
box: ReadonlyArray<number>;
|
|
@@ -25,7 +25,7 @@ type State = any;
|
|
|
25
25
|
*/
|
|
26
26
|
declare class InteractionEditor extends React.Component<Props, State> {
|
|
27
27
|
static widgetName: "interaction";
|
|
28
|
-
static defaultProps:
|
|
28
|
+
static defaultProps: PerseusInteractionWidgetOptions;
|
|
29
29
|
state: State;
|
|
30
30
|
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
31
31
|
_getAllVarSubscripts(elements: ReadonlyArray<any>): ReadonlyArray<any>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type LockedFigure, type PerseusImageBackground, type PerseusInteractiveGraphWidgetOptions, type PerseusGraphType, type MarkingsType, type
|
|
1
|
+
import { type LockedFigure, type PerseusImageBackground, type PerseusInteractiveGraphWidgetOptions, type PerseusGraphType, type MarkingsType, type AxisLabelLocation, type ShowAxisArrows, type ShowAxisTicks } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
|
|
4
4
|
import type { PropsFor } from "@khanacademy/wonder-blocks-core";
|
|
@@ -42,7 +42,9 @@ declare const InteractiveGraph: {
|
|
|
42
42
|
}>) => void;
|
|
43
43
|
customKeypad?: boolean;
|
|
44
44
|
isMobile?: boolean;
|
|
45
|
-
isMobileApp
|
|
45
|
+
isMobileApp? /**
|
|
46
|
+
* The range of the graph in the x and y directions.
|
|
47
|
+
*/: boolean;
|
|
46
48
|
hintProgressColor?: string;
|
|
47
49
|
flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator", boolean>;
|
|
48
50
|
}> & {
|
|
@@ -368,7 +370,9 @@ declare const InteractiveGraph: {
|
|
|
368
370
|
}>) => void;
|
|
369
371
|
customKeypad?: boolean;
|
|
370
372
|
isMobile?: boolean;
|
|
371
|
-
isMobileApp
|
|
373
|
+
isMobileApp? /**
|
|
374
|
+
* The range of the graph in the x and y directions.
|
|
375
|
+
*/: boolean;
|
|
372
376
|
hintProgressColor?: string;
|
|
373
377
|
flags?: Record<"perseus-renderer-upgrade" | "desmos-calculator", boolean>;
|
|
374
378
|
}> & {
|
|
@@ -770,7 +774,7 @@ declare class InteractiveGraphEditor extends React.Component<Props> {
|
|
|
770
774
|
};
|
|
771
775
|
displayName: string;
|
|
772
776
|
className: string;
|
|
773
|
-
static defaultProps:
|
|
777
|
+
static defaultProps: PerseusInteractiveGraphWidgetOptions & {
|
|
774
778
|
valid: true | string;
|
|
775
779
|
};
|
|
776
780
|
changeStartCoords: (coords: any) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { PreferredPopoverDirection } from "./behavior";
|
|
3
3
|
import type { APIOptions } from "@khanacademy/perseus";
|
|
4
|
-
import type { PerseusLabelImageWidgetOptions
|
|
4
|
+
import type { PerseusLabelImageWidgetOptions } from "@khanacademy/perseus-core";
|
|
5
5
|
interface Props {
|
|
6
6
|
apiOptions: APIOptions;
|
|
7
7
|
choices: string[];
|
|
@@ -24,7 +24,7 @@ interface Props {
|
|
|
24
24
|
*/
|
|
25
25
|
declare class LabelImageEditor extends React.Component<Props> {
|
|
26
26
|
private _questionMarkers;
|
|
27
|
-
static defaultProps:
|
|
27
|
+
static defaultProps: PerseusLabelImageWidgetOptions;
|
|
28
28
|
static widgetName: "label-image";
|
|
29
29
|
componentDidUpdate(prevProps: Props): void;
|
|
30
30
|
getSaveWarnings: () => ReadonlyArray<any | string>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { ChangeableProps } from "../../mixins/changeable";
|
|
3
3
|
import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
|
|
4
|
-
import type {
|
|
5
|
-
interface Props extends
|
|
4
|
+
import type { PerseusMatrixWidgetOptions } from "@khanacademy/perseus-core";
|
|
5
|
+
interface Props extends PerseusMatrixWidgetOptions, ChangeableProps {
|
|
6
6
|
apiOptions: APIOptionsWithDefaults;
|
|
7
7
|
}
|
|
8
8
|
declare class MatrixEditor extends React.Component<Props> {
|
|
9
9
|
static widgetName: "matrix";
|
|
10
|
-
static defaultProps:
|
|
10
|
+
static defaultProps: PerseusMatrixWidgetOptions;
|
|
11
11
|
change: (arg1: any, arg2?: any, arg3?: any) => any;
|
|
12
12
|
onMatrixBoardSizeChange: (arg1: [number, number]) => void;
|
|
13
13
|
serialize: () => any;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { ChangeableProps } from "../../mixins/changeable";
|
|
3
|
-
import type {
|
|
4
|
-
interface Props extends
|
|
3
|
+
import type { PerseusMeasurerWidgetOptions } from "@khanacademy/perseus-core";
|
|
4
|
+
interface Props extends PerseusMeasurerWidgetOptions, ChangeableProps {
|
|
5
5
|
}
|
|
6
6
|
declare class MeasurerEditor extends React.Component<Props> {
|
|
7
7
|
static widgetName: "measurer";
|
|
8
|
-
static defaultProps:
|
|
8
|
+
static defaultProps: PerseusMeasurerWidgetOptions;
|
|
9
9
|
className: string;
|
|
10
10
|
change: (arg1: any, arg2: any, arg3: any) => any;
|
|
11
11
|
_changeUrl: (arg1: React.ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type PerseusNumberLineWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import type { ChangeableProps } from "../../mixins/changeable";
|
|
4
4
|
type Range = [number, number];
|
|
@@ -24,7 +24,7 @@ type Props = {
|
|
|
24
24
|
*/
|
|
25
25
|
declare class NumberLineEditor extends React.Component<Props> {
|
|
26
26
|
static widgetName: "number-line";
|
|
27
|
-
static defaultProps:
|
|
27
|
+
static defaultProps: PerseusNumberLineWidgetOptions;
|
|
28
28
|
onRangeChange: (arg1: Range) => void;
|
|
29
29
|
onLabelRangeChange: (arg1: number, arg2: number) => void;
|
|
30
30
|
onDivisionRangeChange: (arg1: Range) => void;
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import { type PerseusOrdererWidgetOptions
|
|
1
|
+
import { type PerseusOrdererWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
type Props = PerseusOrdererWidgetOptions & {
|
|
4
4
|
onChange: (newOptions: Partial<PerseusOrdererWidgetOptions>, callback?: () => void) => void;
|
|
5
5
|
};
|
|
6
|
-
/**
|
|
7
|
-
* The cards the student picks from: the correct answer and the distractors,
|
|
8
|
-
* with duplicates and empty cards removed.
|
|
9
|
-
*/
|
|
10
|
-
export declare const mergeCards: (correctOptions: PerseusRenderer[], otherOptions: PerseusRenderer[]) => PerseusRenderer[];
|
|
11
6
|
declare class OrdererEditor extends React.Component<Props> {
|
|
12
7
|
static widgetName: "orderer";
|
|
13
8
|
static defaultProps: PerseusOrdererWidgetOptions;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type PerseusPhetSimulationWidgetOptions
|
|
1
|
+
import { type PerseusPhetSimulationWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
type Props =
|
|
3
|
+
type Props = PerseusPhetSimulationWidgetOptions & {
|
|
4
4
|
onChange: (arg1: {
|
|
5
5
|
url?: Props["url"];
|
|
6
6
|
description?: Props["description"];
|
|
@@ -11,7 +11,7 @@ type Props = PhetSimulationDefaultWidgetOptions & {
|
|
|
11
11
|
* with physics simulations.
|
|
12
12
|
*/
|
|
13
13
|
declare class PhetSimulationEditor extends React.Component<Props> {
|
|
14
|
-
static defaultProps:
|
|
14
|
+
static defaultProps: PerseusPhetSimulationWidgetOptions;
|
|
15
15
|
static widgetName: "phet-simulation";
|
|
16
16
|
serialize(): PerseusPhetSimulationWidgetOptions;
|
|
17
17
|
getSaveWarnings: () => ReadonlyArray<string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { APIOptions } from "@khanacademy/perseus";
|
|
3
|
-
import type { PerseusPlotterWidgetOptions
|
|
3
|
+
import type { PerseusPlotterWidgetOptions } from "@khanacademy/perseus-core";
|
|
4
4
|
declare const editingStates: string[];
|
|
5
5
|
type EditingState = (typeof editingStates)[number];
|
|
6
6
|
type Props = {
|
|
@@ -34,7 +34,7 @@ type State = {
|
|
|
34
34
|
*/
|
|
35
35
|
declare class PlotterEditor extends React.Component<Props, State> {
|
|
36
36
|
static widgetName: "plotter";
|
|
37
|
-
static defaultProps:
|
|
37
|
+
static defaultProps: PerseusPlotterWidgetOptions;
|
|
38
38
|
state: State;
|
|
39
39
|
UNSAFE_componentWillMount(): void;
|
|
40
40
|
UNSAFE_componentWillReceiveProps(nextProps: any): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { ChangeableProps } from "../../mixins/changeable";
|
|
3
|
-
import type { PerseusPythonProgramWidgetOptions
|
|
3
|
+
import type { PerseusPythonProgramWidgetOptions } from "@khanacademy/perseus-core";
|
|
4
4
|
type Props = ChangeableProps & {
|
|
5
5
|
programID: string;
|
|
6
6
|
height: number;
|
|
@@ -11,7 +11,7 @@ export declare function validateOptions(height: Props["height"], programID: Prop
|
|
|
11
11
|
*/
|
|
12
12
|
declare class PythonProgramEditor extends React.Component<Props> {
|
|
13
13
|
static widgetName: "python-program";
|
|
14
|
-
static defaultProps:
|
|
14
|
+
static defaultProps: PerseusPythonProgramWidgetOptions;
|
|
15
15
|
change: (...args: ReadonlyArray<unknown>) => any;
|
|
16
16
|
serialize(): PerseusPythonProgramWidgetOptions;
|
|
17
17
|
getSaveWarnings: () => ReadonlyArray<string>;
|
|
@@ -2,7 +2,7 @@ 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
4
|
import type { APIOptions } from "@khanacademy/perseus";
|
|
5
|
-
import type { PerseusRadioWidgetOptions, PerseusRadioChoice
|
|
5
|
+
import type { PerseusRadioWidgetOptions, PerseusRadioChoice } from "@khanacademy/perseus-core";
|
|
6
6
|
export interface RadioEditorProps {
|
|
7
7
|
apiOptions: APIOptions;
|
|
8
8
|
countChoices: boolean;
|
|
@@ -22,7 +22,7 @@ declare class RadioEditor extends React.Component<RadioEditorProps> {
|
|
|
22
22
|
url: string;
|
|
23
23
|
label: string;
|
|
24
24
|
};
|
|
25
|
-
static defaultProps:
|
|
25
|
+
static defaultProps: PerseusRadioWidgetOptions;
|
|
26
26
|
choiceRefs: Map<string, React.RefObject<RadioOptionSettingsHandle>>;
|
|
27
27
|
componentDidMount(): void;
|
|
28
28
|
getChoiceRef: (choiceId: string) => React.RefObject<RadioOptionSettingsHandle>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
index: number;
|
|
4
|
+
value: string;
|
|
5
|
+
isFirst: boolean;
|
|
6
|
+
isLast: boolean;
|
|
7
|
+
onChange: (value: string) => void;
|
|
8
|
+
onMoveUp: () => void;
|
|
9
|
+
onMoveDown: () => void;
|
|
10
|
+
onDelete: () => void;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* An editor for a single sorter card
|
|
14
|
+
*
|
|
15
|
+
* Renders as a list item, so it belongs inside the sorter editor's list of
|
|
16
|
+
* cards.
|
|
17
|
+
*/
|
|
18
|
+
declare function CardEditor({ index, value, isFirst, isLast, onChange, onMoveUp, onMoveDown, onDelete, }: Props): React.JSX.Element;
|
|
19
|
+
export default CardEditor;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { type PerseusSorterWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
type Props = PerseusSorterWidgetOptions & {
|
|
4
|
-
onChange: (newOptions: Partial<PerseusSorterWidgetOptions>, callback?: () => void) => void;
|
|
5
|
-
};
|
|
6
3
|
/**
|
|
7
|
-
*
|
|
4
|
+
* Imperative API that WidgetEditor calls
|
|
8
5
|
*/
|
|
9
|
-
|
|
10
|
-
static widgetName: "sorter";
|
|
11
|
-
static defaultProps: PerseusSorterWidgetOptions;
|
|
12
|
-
onLayoutChange: (e: React.ChangeEvent<HTMLSelectElement>) => void;
|
|
6
|
+
type SorterEditorHandle = {
|
|
13
7
|
serialize: () => PerseusSorterWidgetOptions;
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
8
|
+
getSaveWarnings: () => string[];
|
|
9
|
+
};
|
|
10
|
+
declare const _default: React.ForwardRefExoticComponent<PerseusSorterWidgetOptions & {
|
|
11
|
+
onChange: (newOptions: Partial<PerseusSorterWidgetOptions>, callback?: () => void) => void;
|
|
12
|
+
} & React.RefAttributes<SorterEditorHandle>> & {
|
|
13
|
+
widgetName: "sorter";
|
|
14
|
+
defaultProps: PerseusSorterWidgetOptions;
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { components } from "@khanacademy/perseus";
|
|
2
|
-
import { type
|
|
2
|
+
import { type PerseusTableWidgetOptions } from "@khanacademy/perseus-core";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
type Props = any;
|
|
5
5
|
declare class TableEditor extends React.Component<Props> {
|
|
@@ -10,7 +10,7 @@ declare class TableEditor extends React.Component<Props> {
|
|
|
10
10
|
answers: any;
|
|
11
11
|
};
|
|
12
12
|
static widgetName: "table";
|
|
13
|
-
static defaultProps:
|
|
13
|
+
static defaultProps: PerseusTableWidgetOptions;
|
|
14
14
|
numberOfColumns: React.RefObject<components.NumberInput>;
|
|
15
15
|
focus: () => void;
|
|
16
16
|
onSizeInput: (arg1: number, arg2: number) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type PerseusVideoWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
export interface VideoEditorProps extends PerseusVideoWidgetOptions {
|
|
4
4
|
onChange: (options: PerseusVideoWidgetOptions) => void;
|
|
@@ -8,7 +8,7 @@ export interface VideoEditorProps extends PerseusVideoWidgetOptions {
|
|
|
8
8
|
*/
|
|
9
9
|
declare class VideoEditor extends React.Component<VideoEditorProps> {
|
|
10
10
|
static widgetName: "video";
|
|
11
|
-
static defaultProps:
|
|
11
|
+
static defaultProps: PerseusVideoWidgetOptions;
|
|
12
12
|
serialize: () => PerseusVideoWidgetOptions;
|
|
13
13
|
render(): React.ReactNode;
|
|
14
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": "38.
|
|
6
|
+
"version": "38.1.2",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -36,16 +36,16 @@
|
|
|
36
36
|
"mafs": "^0.19.0",
|
|
37
37
|
"tiny-invariant": "1.3.1",
|
|
38
38
|
"@khanacademy/kas": "2.2.6",
|
|
39
|
-
"@khanacademy/keypad-context": "3.2.
|
|
40
|
-
"@khanacademy/kmath": "2.4.
|
|
41
|
-
"@khanacademy/math-input": "27.0.
|
|
42
|
-
"@khanacademy/perseus": "85.
|
|
43
|
-
"@khanacademy/perseus-core": "
|
|
44
|
-
"@khanacademy/perseus-linter": "5.
|
|
39
|
+
"@khanacademy/keypad-context": "3.2.87",
|
|
40
|
+
"@khanacademy/kmath": "2.4.46",
|
|
41
|
+
"@khanacademy/math-input": "27.0.8",
|
|
42
|
+
"@khanacademy/perseus": "85.1.2",
|
|
43
|
+
"@khanacademy/perseus-core": "38.0.1",
|
|
44
|
+
"@khanacademy/perseus-linter": "5.2.0",
|
|
45
45
|
"@khanacademy/perseus-utils": "2.1.5"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@khanacademy/mathjax-renderer": "3.
|
|
48
|
+
"@khanacademy/mathjax-renderer": "3.2.0",
|
|
49
49
|
"@khanacademy/wonder-blocks-accordion": "3.1.69",
|
|
50
50
|
"@khanacademy/wonder-blocks-badge": "1.1.21",
|
|
51
51
|
"@khanacademy/wonder-blocks-banner": "5.1.11",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"perseus-build-settings": "0.9.1"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
|
-
"@khanacademy/mathjax-renderer": "^3.
|
|
80
|
+
"@khanacademy/mathjax-renderer": "^3.2.0",
|
|
81
81
|
"@khanacademy/wonder-blocks-accordion": "^3.1.69",
|
|
82
82
|
"@khanacademy/wonder-blocks-badge": "^1.1.21",
|
|
83
83
|
"@khanacademy/wonder-blocks-banner": "^5.1.11",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
},
|
|
109
109
|
"keywords": [],
|
|
110
110
|
"khan": {
|
|
111
|
-
"catalogHash": "
|
|
111
|
+
"catalogHash": "a12a1605e2325e3e"
|
|
112
112
|
},
|
|
113
113
|
"scripts": {}
|
|
114
114
|
}
|
|
File without changes
|