@khanacademy/perseus 61.0.0 → 61.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/es/index.css +1 -3184
- package/dist/es/index.js +17 -5
- package/dist/es/index.js.map +1 -1
- package/dist/index.css +1 -3184
- package/dist/index.js +17 -5
- package/dist/index.js.map +1 -1
- package/dist/util.d.ts +2 -2
- package/dist/widget-ai-utils/radio/radio-ai-utils.d.ts +2 -2
- package/dist/widgets/expression/expression.d.ts +1 -1
- package/dist/widgets/interactive-graph.d.ts +11 -11
- package/dist/widgets/number-line/number-line.d.ts +2 -2
- package/dist/widgets/plotter/plotter.d.ts +1 -1
- package/dist/widgets/radio/radio-component.d.ts +4 -4
- package/dist/widgets/radio/radio-component.new.d.ts +2 -2
- package/dist/widgets/table/table.d.ts +1 -1
- package/package.json +7 -7
package/dist/util.d.ts
CHANGED
|
@@ -40,11 +40,11 @@ declare function inputPathsEqual(a?: ReadonlyArray<string> | null, b?: ReadonlyA
|
|
|
40
40
|
* {value: 2.3, exact: true}.
|
|
41
41
|
*/
|
|
42
42
|
declare function firstNumericalParse(text: string): ParsedValue | null | undefined;
|
|
43
|
-
declare function stringArrayOfSize(size: number):
|
|
43
|
+
declare function stringArrayOfSize(size: number): string[];
|
|
44
44
|
declare function stringArrayOfSize2D(opt: {
|
|
45
45
|
rows: number;
|
|
46
46
|
columns: number;
|
|
47
|
-
}):
|
|
47
|
+
}): string[][];
|
|
48
48
|
/**
|
|
49
49
|
* For a graph's x or y dimension, given the tick step,
|
|
50
50
|
* the ranges extent (e.g. [-10, 10]), the pixel dimension constraint,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type radio from "../../widgets/radio/radio";
|
|
2
|
-
import type { PerseusRadioUserInput } from "@khanacademy/perseus-core";
|
|
2
|
+
import type { PerseusRadioUserInput, RecursiveReadonly } from "@khanacademy/perseus-core";
|
|
3
3
|
import type React from "react";
|
|
4
4
|
type BasicOption = {
|
|
5
5
|
value: string;
|
|
@@ -12,5 +12,5 @@ export type RadioPromptJSON = {
|
|
|
12
12
|
selectedOptions: ReadonlyArray<boolean>;
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
|
-
export declare const getPromptJSON: (renderProps: React.ComponentProps<typeof radio.widget
|
|
15
|
+
export declare const getPromptJSON: (renderProps: RecursiveReadonly<React.ComponentProps<typeof radio.widget>>, userInput: RecursiveReadonly<PerseusRadioUserInput>) => RadioPromptJSON;
|
|
16
16
|
export {};
|
|
@@ -204,7 +204,7 @@ declare const _default: {
|
|
|
204
204
|
onFocus?: ((blurPath: FocusPath) => void) | undefined;
|
|
205
205
|
linterContext?: import("@khanacademy/perseus-linter").LinterContextProps | undefined;
|
|
206
206
|
buttonSets?: import("@khanacademy/perseus-core").LegacyButtonSets | undefined;
|
|
207
|
-
functions?:
|
|
207
|
+
functions?: string[] | undefined;
|
|
208
208
|
times?: boolean | undefined;
|
|
209
209
|
} & {}, keyof import("../..").PerseusDependenciesV2> & React.RefAttributes<Expression>>;
|
|
210
210
|
transform: (widgetOptions: PerseusExpressionWidgetOptions | ExpressionPublicWidgetOptions) => RenderProps;
|
|
@@ -42,7 +42,7 @@ type RenderProps = {
|
|
|
42
42
|
/**
|
|
43
43
|
* How to label the X and Y axis. default: ["x", "y"]
|
|
44
44
|
*/
|
|
45
|
-
labels:
|
|
45
|
+
labels: string[];
|
|
46
46
|
/**
|
|
47
47
|
* Whether to show the Protractor tool overlaid on top of the graph
|
|
48
48
|
*/
|
|
@@ -94,7 +94,7 @@ type RenderProps = {
|
|
|
94
94
|
* Shapes (points, chords, etc) displayed on the graph that cannot be moved
|
|
95
95
|
* by the user.
|
|
96
96
|
*/
|
|
97
|
-
lockedFigures?:
|
|
97
|
+
lockedFigures?: LockedFigure[];
|
|
98
98
|
/**
|
|
99
99
|
* Aria label that applies to the entire graph.
|
|
100
100
|
*/
|
|
@@ -107,7 +107,7 @@ type RenderProps = {
|
|
|
107
107
|
type Props = WidgetProps<RenderProps>;
|
|
108
108
|
type State = any;
|
|
109
109
|
type DefaultProps = {
|
|
110
|
-
labels:
|
|
110
|
+
labels: string[];
|
|
111
111
|
range: Props["range"];
|
|
112
112
|
step: Props["step"];
|
|
113
113
|
backgroundImage: Props["backgroundImage"];
|
|
@@ -126,42 +126,42 @@ declare class InteractiveGraph extends React.Component<Props, State> {
|
|
|
126
126
|
* @param {object} graph Like props.graph or props.correct
|
|
127
127
|
* @param {object} props of an InteractiveGraph instance
|
|
128
128
|
*/
|
|
129
|
-
static getLineCoords(graph: PerseusGraphType, props: Props):
|
|
129
|
+
static getLineCoords(graph: PerseusGraphType, props: Props): Coord[];
|
|
130
130
|
/**
|
|
131
131
|
* @param {object} graph Like props.graph or props.correct
|
|
132
132
|
* @param {object} props of an InteractiveGraph instance
|
|
133
133
|
*/
|
|
134
|
-
static getPointCoords(graph: PerseusGraphTypePoint, props: Props):
|
|
134
|
+
static getPointCoords(graph: PerseusGraphTypePoint, props: Props): Coord[];
|
|
135
135
|
/**
|
|
136
136
|
* @param {object} graph Like props.graph or props.correct
|
|
137
137
|
* @param {object} props of an InteractiveGraph instance
|
|
138
138
|
*/
|
|
139
|
-
static getLinearSystemCoords(graph: PerseusGraphType, props: Props):
|
|
139
|
+
static getLinearSystemCoords(graph: PerseusGraphType, props: Props): Coord[][];
|
|
140
140
|
/**
|
|
141
141
|
* @param {object} graph Like props.graph or props.correct
|
|
142
142
|
* @param {object} props of an InteractiveGraph instance
|
|
143
143
|
*/
|
|
144
|
-
static getPolygonCoords(graph: PerseusGraphType, props: Props):
|
|
144
|
+
static getPolygonCoords(graph: PerseusGraphType, props: Props): Coord[];
|
|
145
145
|
/**
|
|
146
146
|
* @param {object} graph Like props.graph or props.correct
|
|
147
147
|
* @param {object} props of an InteractiveGraph instance
|
|
148
148
|
*/
|
|
149
|
-
static getSegmentCoords(graph: PerseusGraphTypeSegment, props: Props):
|
|
149
|
+
static getSegmentCoords(graph: PerseusGraphTypeSegment, props: Props): Coord[][];
|
|
150
150
|
/**
|
|
151
151
|
* @param {object} graph Like props.graph or props.correct
|
|
152
152
|
* @param {object} props of an InteractiveGraph instance
|
|
153
153
|
*/
|
|
154
154
|
static getAngleCoords(graph: PerseusGraphTypeAngle, props: Props): [Coord, Coord, Coord];
|
|
155
|
-
static normalizeCoords(coordsList:
|
|
155
|
+
static normalizeCoords(coordsList: Coord[], ranges: [Range, Range]): Coord[];
|
|
156
156
|
static getEquationString(props: Props): string;
|
|
157
|
-
static pointsFromNormalized(props: Props, coordsList:
|
|
157
|
+
static pointsFromNormalized(props: Props, coordsList: Coord[], noSnap?: boolean): Coord[];
|
|
158
158
|
static getNoneEquationString(): string;
|
|
159
159
|
static getLinearEquationString(props: Props): string;
|
|
160
160
|
static getCurrentQuadraticCoefficients(props: Props): QuadraticCoefficient;
|
|
161
161
|
static defaultQuadraticCoords(props: Props): QuadraticGraphState["coords"];
|
|
162
162
|
static getQuadraticEquationString(props: Props): string;
|
|
163
163
|
static getCurrentSinusoidCoefficients(props: Props): SineCoefficient;
|
|
164
|
-
static defaultSinusoidCoords(props: Props):
|
|
164
|
+
static defaultSinusoidCoords(props: Props): Coord[];
|
|
165
165
|
static getSinusoidEquationString(props: Props): string;
|
|
166
166
|
static getCircleEquationString(props: Props): string;
|
|
167
167
|
static getLinearSystemEquationString(props: Props): string;
|
|
@@ -6,10 +6,10 @@ import type { NumberLinePromptJSON } from "../../widget-ai-utils/number-line/num
|
|
|
6
6
|
import type { Relationship, PerseusNumberLineUserInput } from "@khanacademy/perseus-core";
|
|
7
7
|
type Props = ChangeableProps & {
|
|
8
8
|
range: [number, number];
|
|
9
|
-
labelRange:
|
|
9
|
+
labelRange: Array<number | null>;
|
|
10
10
|
labelStyle: string;
|
|
11
11
|
labelTicks: boolean;
|
|
12
|
-
divisionRange:
|
|
12
|
+
divisionRange: number[];
|
|
13
13
|
numDivisions: number;
|
|
14
14
|
snapDivisions: number;
|
|
15
15
|
isTickCtrl: boolean;
|
|
@@ -22,7 +22,7 @@ type DefaultProps = {
|
|
|
22
22
|
labelInterval: Props["labelInterval"];
|
|
23
23
|
};
|
|
24
24
|
type State = {
|
|
25
|
-
values:
|
|
25
|
+
values: number[];
|
|
26
26
|
categoryHeights: Record<string, number>;
|
|
27
27
|
};
|
|
28
28
|
export declare class Plotter extends React.Component<Props, State> implements Widget {
|
|
@@ -10,11 +10,11 @@ export type RenderProps = {
|
|
|
10
10
|
multipleSelect?: boolean;
|
|
11
11
|
countChoices?: boolean;
|
|
12
12
|
deselectEnabled?: boolean;
|
|
13
|
-
choices:
|
|
14
|
-
selectedChoices:
|
|
13
|
+
choices: RadioChoiceWithMetadata[];
|
|
14
|
+
selectedChoices: PerseusRadioChoice["correct"][];
|
|
15
15
|
showSolutions?: ShowSolutions;
|
|
16
|
-
choiceStates?:
|
|
17
|
-
values?:
|
|
16
|
+
choiceStates?: ChoiceState[];
|
|
17
|
+
values?: boolean[];
|
|
18
18
|
};
|
|
19
19
|
type Props = WidgetProps<RenderProps, PerseusRadioRubric>;
|
|
20
20
|
type DefaultProps = Required<Pick<Props, "choices" | "multipleSelect" | "countChoices" | "deselectEnabled" | "linterContext" | "showSolutions">>;
|
|
@@ -3,7 +3,7 @@ import { PerseusI18nContext } from "../../components/i18n-context";
|
|
|
3
3
|
import type { FocusFunction } from "./base-radio.new";
|
|
4
4
|
import type { WidgetProps, ChoiceState, Widget } from "../../types";
|
|
5
5
|
import type { RadioPromptJSON } from "../../widget-ai-utils/radio/radio-ai-utils";
|
|
6
|
-
import type { PerseusRadioChoice,
|
|
6
|
+
import type { PerseusRadioChoice, ShowSolutions, PerseusRadioRubric, PerseusRadioUserInput, RecursiveReadonly } from "@khanacademy/perseus-core";
|
|
7
7
|
export type RenderProps = {
|
|
8
8
|
numCorrect: number;
|
|
9
9
|
hasNoneOfTheAbove?: boolean;
|
|
@@ -53,7 +53,7 @@ declare class Radio extends React.Component<Props> implements Widget {
|
|
|
53
53
|
* rationales.
|
|
54
54
|
* @deprecated Internal only. Use `showSolutions` prop instead.
|
|
55
55
|
*/
|
|
56
|
-
showRationalesForCurrentlySelectedChoices: (arg1:
|
|
56
|
+
showRationalesForCurrentlySelectedChoices: (arg1: RecursiveReadonly<PerseusRadioRubric>) => void;
|
|
57
57
|
/**
|
|
58
58
|
* Deselects any currently-selected choices that are not correct choices.
|
|
59
59
|
*/
|
|
@@ -37,7 +37,7 @@ declare class Table extends React.Component<Props> implements Widget {
|
|
|
37
37
|
focusInputPath(path: FocusPath): void;
|
|
38
38
|
blurInputPath(path: FocusPath): void;
|
|
39
39
|
getDOMNodeForPath(path: FocusPath): ReturnType<typeof ReactDOM.findDOMNode>;
|
|
40
|
-
getInputPaths():
|
|
40
|
+
getInputPaths(): string[][];
|
|
41
41
|
setInputValue(path: FocusPath, newValue: string, cb: any): void;
|
|
42
42
|
render(): React.ReactNode;
|
|
43
43
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Core Perseus API (includes renderers and widgets)",
|
|
4
4
|
"author": "Khan Academy",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "61.0.
|
|
6
|
+
"version": "61.0.1",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
"mafs": "0.19.0",
|
|
42
42
|
"uuid": "^10.0.0",
|
|
43
43
|
"@khanacademy/kas": "2.0.2",
|
|
44
|
-
"@khanacademy/keypad-context": "3.0.
|
|
45
|
-
"@khanacademy/kmath": "2.0.
|
|
46
|
-
"@khanacademy/math-input": "25.0
|
|
47
|
-
"@khanacademy/perseus-core": "
|
|
48
|
-
"@khanacademy/perseus-linter": "3.0.
|
|
49
|
-
"@khanacademy/perseus-score": "5.0.
|
|
44
|
+
"@khanacademy/keypad-context": "3.0.6",
|
|
45
|
+
"@khanacademy/kmath": "2.0.6",
|
|
46
|
+
"@khanacademy/math-input": "25.1.0",
|
|
47
|
+
"@khanacademy/perseus-core": "9.0.0",
|
|
48
|
+
"@khanacademy/perseus-linter": "3.0.6",
|
|
49
|
+
"@khanacademy/perseus-score": "5.0.3",
|
|
50
50
|
"@khanacademy/perseus-utils": "2.0.1",
|
|
51
51
|
"@khanacademy/pure-markdown": "2.0.2",
|
|
52
52
|
"@khanacademy/simple-markdown": "2.0.2"
|