@khanacademy/perseus-editor 45.0.0 → 45.0.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/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/mixins/changeable.d.ts +0 -10
- package/dist/widgets/phet-simulation-editor/phet-simulation-editor.d.ts +4 -6
- package/dist/widgets/plotter-editor/plotter-editor.d.ts +4 -16
- package/dist/widgets/python-program-editor/python-program-editor.d.ts +4 -6
- package/dist/widgets/radio-editor/radio-editor.d.ts +4 -9
- package/package.json +2 -2
|
@@ -25,14 +25,4 @@ type ChangeFn = (newPropsOrSinglePropName: string | {
|
|
|
25
25
|
* @deprecated
|
|
26
26
|
*/
|
|
27
27
|
export declare const deprecatedChangeableChange: ChangeFn;
|
|
28
|
-
/**
|
|
29
|
-
* TODO(LEMS-3245) remove Changeable
|
|
30
|
-
*
|
|
31
|
-
* @deprecated
|
|
32
|
-
*/
|
|
33
|
-
export type ChangeableProps = {
|
|
34
|
-
onChange: (values: {
|
|
35
|
-
[key: string]: any;
|
|
36
|
-
}, callback?: (() => unknown) | null | undefined, silent?: boolean) => unknown;
|
|
37
|
-
};
|
|
38
28
|
export {};
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { type PerseusPhetSimulationWidgetOptions } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
onChange: (
|
|
5
|
-
|
|
6
|
-
description?: Props["description"];
|
|
7
|
-
}) => void;
|
|
8
|
-
};
|
|
3
|
+
interface Props extends PerseusPhetSimulationWidgetOptions {
|
|
4
|
+
onChange: (options: PerseusPhetSimulationWidgetOptions) => void;
|
|
5
|
+
}
|
|
9
6
|
/**
|
|
10
7
|
* An editor for adding a PhET simulation widget that allows users to interact
|
|
11
8
|
* with physics simulations.
|
|
12
9
|
*/
|
|
13
10
|
declare class PhetSimulationEditor extends React.Component<Props> {
|
|
14
11
|
static defaultProps: PerseusPhetSimulationWidgetOptions;
|
|
12
|
+
handleChange(changes: Partial<PerseusPhetSimulationWidgetOptions>): void;
|
|
15
13
|
serialize(): PerseusPhetSimulationWidgetOptions;
|
|
16
14
|
getSaveWarnings: () => ReadonlyArray<string>;
|
|
17
15
|
render(): React.ReactNode;
|
|
@@ -3,24 +3,11 @@ import type { APIOptions } from "@khanacademy/perseus";
|
|
|
3
3
|
import type { PerseusPlotterWidgetOptions } from "@khanacademy/perseus-core";
|
|
4
4
|
declare const editingStates: string[];
|
|
5
5
|
type EditingState = (typeof editingStates)[number];
|
|
6
|
-
|
|
6
|
+
interface Props extends PerseusPlotterWidgetOptions {
|
|
7
7
|
apiOptions: APIOptions;
|
|
8
|
-
type: PerseusPlotterWidgetOptions["type"];
|
|
9
|
-
labels: Array<string>;
|
|
10
|
-
categories: PerseusPlotterWidgetOptions["categories"];
|
|
11
|
-
scaleY: number;
|
|
12
|
-
maxY: number;
|
|
13
|
-
snapsPerLine: number;
|
|
14
|
-
picSize: number;
|
|
15
|
-
picBoxHeight: number;
|
|
16
|
-
picUrl?: string | null;
|
|
17
|
-
plotDimensions: ReadonlyArray<number>;
|
|
18
|
-
labelInterval: number;
|
|
19
|
-
starting: ReadonlyArray<number>;
|
|
20
|
-
correct: ReadonlyArray<number>;
|
|
21
8
|
static: boolean;
|
|
22
|
-
onChange:
|
|
23
|
-
}
|
|
9
|
+
onChange: (options: PerseusPlotterWidgetOptions) => void;
|
|
10
|
+
}
|
|
24
11
|
type State = {
|
|
25
12
|
editing: EditingState;
|
|
26
13
|
pic: any;
|
|
@@ -37,6 +24,7 @@ declare class PlotterEditor extends React.Component<Props, State> {
|
|
|
37
24
|
state: State;
|
|
38
25
|
UNSAFE_componentWillMount(): void;
|
|
39
26
|
UNSAFE_componentWillReceiveProps(nextProps: any): void;
|
|
27
|
+
handleChange(changes: Partial<PerseusPlotterWidgetOptions>): void;
|
|
40
28
|
fetchPic: (url: string | null | undefined) => void;
|
|
41
29
|
handleChangeTickStep: (arg1: number) => void;
|
|
42
30
|
handleChangeRange: (arg1: [number, number]) => void;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type { ChangeableProps } from "../../mixins/changeable";
|
|
3
2
|
import type { PerseusPythonProgramWidgetOptions } from "@khanacademy/perseus-core";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
3
|
+
interface Props extends PerseusPythonProgramWidgetOptions {
|
|
4
|
+
onChange: (options: PerseusPythonProgramWidgetOptions) => void;
|
|
5
|
+
}
|
|
8
6
|
export declare function validateOptions(height: Props["height"], programID: Props["programID"]): ReadonlyArray<string>;
|
|
9
7
|
/**
|
|
10
8
|
* An editor for adding a Python program widget that allows users to write, edit and execute Python code.
|
|
11
9
|
*/
|
|
12
10
|
declare class PythonProgramEditor extends React.Component<Props> {
|
|
13
11
|
static defaultProps: PerseusPythonProgramWidgetOptions;
|
|
14
|
-
|
|
12
|
+
handleChange(changes: Partial<PerseusPythonProgramWidgetOptions>): void;
|
|
15
13
|
serialize(): PerseusPythonProgramWidgetOptions;
|
|
16
14
|
getSaveWarnings: () => ReadonlyArray<string>;
|
|
17
15
|
render(): React.ReactNode;
|
|
@@ -2,16 +2,10 @@ 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
|
|
6
|
-
export interface RadioEditorProps {
|
|
5
|
+
import type { PerseusRadioWidgetOptions } from "@khanacademy/perseus-core";
|
|
6
|
+
export interface RadioEditorProps extends PerseusRadioWidgetOptions {
|
|
7
7
|
apiOptions: APIOptions;
|
|
8
|
-
|
|
9
|
-
choices: PerseusRadioChoice[];
|
|
10
|
-
randomize: boolean;
|
|
11
|
-
hasNoneOfTheAbove: boolean;
|
|
12
|
-
multipleSelect: boolean;
|
|
13
|
-
deselectEnabled: boolean;
|
|
14
|
-
onChange: (values: Partial<PerseusRadioWidgetOptions>, callback?: (() => void) | null) => void;
|
|
8
|
+
onChange: (options: PerseusRadioWidgetOptions) => void;
|
|
15
9
|
}
|
|
16
10
|
/**
|
|
17
11
|
* An editor for adding a radio widget that allows users to select a single option from multiple choices.
|
|
@@ -24,6 +18,7 @@ declare class RadioEditor extends React.Component<RadioEditorProps> {
|
|
|
24
18
|
static defaultProps: PerseusRadioWidgetOptions;
|
|
25
19
|
choiceRefs: Map<string, React.RefObject<RadioOptionSettingsHandle>>;
|
|
26
20
|
componentDidMount(): void;
|
|
21
|
+
handleChange(changes: Partial<PerseusRadioWidgetOptions>): void;
|
|
27
22
|
getChoiceRef: (choiceId: string) => React.RefObject<RadioOptionSettingsHandle>;
|
|
28
23
|
onMultipleSelectChange: (options: {
|
|
29
24
|
multipleSelect: boolean;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Perseus editors",
|
|
4
4
|
"author": "Khan Academy",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "45.0.
|
|
6
|
+
"version": "45.0.2",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@khanacademy/keypad-context": "6.0.7",
|
|
29
29
|
"@khanacademy/kmath": "3.1.0",
|
|
30
30
|
"@khanacademy/math-input": "30.1.2",
|
|
31
|
-
"@khanacademy/perseus": "92.0.
|
|
31
|
+
"@khanacademy/perseus": "92.0.2",
|
|
32
32
|
"@khanacademy/perseus-core": "42.0.0",
|
|
33
33
|
"@khanacademy/perseus-linter": "6.1.5",
|
|
34
34
|
"@khanacademy/perseus-utils": "3.0.1",
|