@khanacademy/perseus 36.1.0 → 36.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/es/index.js +199 -74
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +200 -73
- package/dist/index.js.map +1 -1
- package/dist/util/graphie.d.ts +1 -1
- package/dist/validation.types.d.ts +6 -4
- package/dist/widgets/cs-program/cs-program.d.ts +2 -5
- package/dist/widgets/interactive-graph.d.ts +2 -2
- package/dist/widgets/interactive-graphs/backgrounds/axis-ticks.d.ts +1 -0
- package/dist/widgets/interactive-graphs/math/angles.d.ts +3 -1
- package/dist/widgets/interactive-graphs/math/index.d.ts +1 -1
- package/package.json +9 -9
package/dist/util/graphie.d.ts
CHANGED
|
@@ -142,7 +142,7 @@ declare const GraphUtils: {
|
|
|
142
142
|
createGraphie: (el: Element) => Graphie;
|
|
143
143
|
unscaledSvgPath: (points: (Coord | true)[]) => string;
|
|
144
144
|
getDistance: (point1: Coord, point2: Coord) => number;
|
|
145
|
-
|
|
145
|
+
findAngleDeprecated: (point1: Coord, point2: Coord, vertex?: Coord) => any;
|
|
146
146
|
graphs: {};
|
|
147
147
|
};
|
|
148
148
|
export default GraphUtils;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import type { Coord } from "./interactive2/types";
|
|
2
|
-
import type {
|
|
2
|
+
import type { PerseusDefinitionWidgetOptions, PerseusDropdownWidgetOptions, PerseusExplanationWidgetOptions, PerseusExpressionAnswerForm, PerseusGradedGroupSetWidgetOptions, PerseusGradedGroupWidgetOptions, PerseusGrapherWidgetOptions, PerseusGraphType, PerseusIFrameWidgetOptions, PerseusImageWidgetOptions, PerseusInputNumberWidgetOptions, PerseusInteractionWidgetOptions, PerseusLabelImageWidgetOptions, PerseusMatcherWidgetOptions, PerseusMatrixWidgetOptions, PerseusNumberLineWidgetOptions, PerseusNumericInputWidgetOptions, PerseusOrdererWidgetOptions, PerseusPassageRefWidgetOptions, PerseusPassageWidgetOptions, PerseusPlotterWidgetOptions, PerseusRadioWidgetOptions, PerseusSorterWidgetOptions, PerseusTableWidgetOptions, PerseusVideoWidgetOptions } from "./perseus-types";
|
|
3
3
|
import type { InteractiveMarkerType } from "./widgets/label-image/types";
|
|
4
4
|
import type { Relationship } from "./widgets/number-line/number-line";
|
|
5
5
|
export type UserInputStatus = "correct" | "incorrect" | "incomplete";
|
|
6
6
|
export type EmptyUserInput = Empty;
|
|
7
7
|
export type NullUserInput = null;
|
|
8
|
-
export type PerseusCategorizerRubric =
|
|
9
|
-
export type PerseusCategorizerUserInput = {
|
|
8
|
+
export type PerseusCategorizerRubric = {
|
|
10
9
|
values: ReadonlyArray<number>;
|
|
11
10
|
};
|
|
12
|
-
export type
|
|
11
|
+
export type PerseusCategorizerUserInput = {
|
|
12
|
+
values: PerseusCategorizerRubric["values"];
|
|
13
|
+
};
|
|
14
|
+
export type PerseusCSProgramRubric = Empty;
|
|
13
15
|
export type PerseusCSProgramUserInput = {
|
|
14
16
|
status: UserInputStatus;
|
|
15
17
|
message: string | null;
|
|
@@ -4,11 +4,8 @@
|
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import type { PerseusCSProgramWidgetOptions } from "../../perseus-types";
|
|
6
6
|
import type { PerseusScore, Widget, WidgetProps } from "../../types";
|
|
7
|
-
import type { PerseusCSProgramRubric, PerseusCSProgramUserInput
|
|
8
|
-
type RenderProps = PerseusCSProgramWidgetOptions &
|
|
9
|
-
status: UserInputStatus;
|
|
10
|
-
message: string | null;
|
|
11
|
-
};
|
|
7
|
+
import type { PerseusCSProgramRubric, PerseusCSProgramUserInput } from "../../validation.types";
|
|
8
|
+
type RenderProps = PerseusCSProgramWidgetOptions & PerseusCSProgramUserInput;
|
|
12
9
|
type Props = WidgetProps<RenderProps, PerseusCSProgramRubric>;
|
|
13
10
|
type DefaultProps = {
|
|
14
11
|
showEditor: Props["showEditor"];
|
|
@@ -4,7 +4,7 @@ import type { StatefulMafsGraphType } from "./interactive-graphs/stateful-mafs-g
|
|
|
4
4
|
import type { QuadraticGraphState } from "./interactive-graphs/types";
|
|
5
5
|
import type { Coord } from "../interactive2/types";
|
|
6
6
|
import type { PerseusGraphType, PerseusGraphTypeAngle, PerseusGraphTypePoint, PerseusGraphTypePolygon, PerseusGraphTypeSegment, PerseusInteractiveGraphWidgetOptions } from "../perseus-types";
|
|
7
|
-
import type { ChangeHandler, PerseusScore,
|
|
7
|
+
import type { ChangeHandler, PerseusScore, WidgetProps } from "../types";
|
|
8
8
|
import type { QuadraticCoefficient, Range, SineCoefficient } from "../util/geometry";
|
|
9
9
|
import type { PerseusInteractiveGraphRubric, PerseusInteractiveGraphUserInput } from "../validation.types";
|
|
10
10
|
type RenderProps = PerseusInteractiveGraphWidgetOptions;
|
|
@@ -105,7 +105,7 @@ declare class LegacyInteractiveGraph extends React.Component<Props, State> {
|
|
|
105
105
|
focus: () => void;
|
|
106
106
|
render(): React.ReactNode;
|
|
107
107
|
}
|
|
108
|
-
declare class InteractiveGraph extends React.Component<Props, State>
|
|
108
|
+
declare class InteractiveGraph extends React.Component<Props, State> {
|
|
109
109
|
legacyGraphRef: React.RefObject<LegacyInteractiveGraph>;
|
|
110
110
|
mafsRef: React.RefObject<StatefulMafsGraphType>;
|
|
111
111
|
static defaultProps: DefaultProps;
|
|
@@ -2,4 +2,5 @@ import * as React from "react";
|
|
|
2
2
|
import type { Interval } from "mafs";
|
|
3
3
|
export declare const shouldShowLabel: (currentTick: number, range: [Interval, Interval], tickStep: number) => boolean;
|
|
4
4
|
export declare function generateTickLocations(tickStep: number, min: number, max: number): number[];
|
|
5
|
+
export declare const countSignificantDecimals: (number: number) => number;
|
|
5
6
|
export declare const AxisTicks: () => React.JSX.Element;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { Coord } from "@khanacademy/perseus";
|
|
1
2
|
import type { vec } from "mafs";
|
|
2
3
|
export declare function convertDegreesToRadians(degrees: number): number;
|
|
3
4
|
export declare function calculateAngleInDegrees([x, y]: vec.Vector2): number;
|
|
4
5
|
export declare function polar(r: number | vec.Vector2, th: number): vec.Vector2;
|
|
5
|
-
export declare const
|
|
6
|
+
export declare const getAngleFromVertex: (point: vec.Vector2, vertex: vec.Vector2) => number;
|
|
7
|
+
export declare const getClockwiseAngle: (coords: [Coord, Coord, Coord], allowReflexAngles?: boolean) => number;
|
|
@@ -5,4 +5,4 @@ export { X, Y } from "./coordinates";
|
|
|
5
5
|
export { MIN, MAX, size } from "./interval";
|
|
6
6
|
export { lerp } from "./interpolation";
|
|
7
7
|
export { segmentsIntersect } from "./geometry";
|
|
8
|
-
export { calculateAngleInDegrees, convertDegreesToRadians,
|
|
8
|
+
export { calculateAngleInDegrees, convertDegreesToRadians, getClockwiseAngle, getAngleFromVertex, polar, } from "./angles";
|
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": "36.1.
|
|
6
|
+
"version": "36.1.2",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
"test": "bash -c 'yarn --silent --cwd \"../..\" test ${@:0} $($([[ ${@: -1} = -* ]] || [[ ${@: -1} = bash ]]) && echo $PWD)'"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@khanacademy/kas": "^0.3.
|
|
44
|
-
"@khanacademy/keypad-context": "^1.0.
|
|
45
|
-
"@khanacademy/kmath": "^0.1.
|
|
46
|
-
"@khanacademy/math-input": "^21.0.
|
|
47
|
-
"@khanacademy/perseus-core": "1.5.
|
|
48
|
-
"@khanacademy/perseus-linter": "^1.2.
|
|
49
|
-
"@khanacademy/pure-markdown": "^0.3.
|
|
50
|
-
"@khanacademy/simple-markdown": "^0.13.
|
|
43
|
+
"@khanacademy/kas": "^0.3.14",
|
|
44
|
+
"@khanacademy/keypad-context": "^1.0.3",
|
|
45
|
+
"@khanacademy/kmath": "^0.1.15",
|
|
46
|
+
"@khanacademy/math-input": "^21.0.4",
|
|
47
|
+
"@khanacademy/perseus-core": "1.5.2",
|
|
48
|
+
"@khanacademy/perseus-linter": "^1.2.2",
|
|
49
|
+
"@khanacademy/pure-markdown": "^0.3.10",
|
|
50
|
+
"@khanacademy/simple-markdown": "^0.13.3",
|
|
51
51
|
"@types/classnames": "2.2.0",
|
|
52
52
|
"@use-gesture/react": "^10.2.27",
|
|
53
53
|
"mafs": "0.19.0",
|