@khanacademy/perseus-editor 14.1.2 → 14.2.0
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/components/util.d.ts +0 -14
- package/dist/es/index.js +1399 -1373
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +1457 -1427
- package/dist/index.js.map +1 -1
- package/dist/{components → widgets/interactive-graph-editor/components}/graph-points-count-selector.d.ts +1 -1
- package/dist/{components → widgets/interactive-graph-editor/components}/graph-type-selector.d.ts +1 -0
- package/dist/{components → widgets/interactive-graph-editor/components}/interactive-graph-description.d.ts +1 -1
- package/dist/widgets/interactive-graph-editor/interactive-graph-editor.d.ts +220 -128
- package/dist/{components/graph-locked-figures → widgets/interactive-graph-editor/locked-figures}/locked-figures-section.d.ts +1 -1
- package/dist/widgets/interactive-graph-editor/locked-figures/util.d.ts +9 -0
- package/dist/widgets/interactive-graph-editor/start-coords/start-coords-angle.d.ts +9 -0
- package/dist/widgets/interactive-graph-editor/start-coords/start-coords-circle.d.ts +12 -0
- package/dist/{components → widgets/interactive-graph-editor/start-coords}/start-coords-line.d.ts +2 -2
- package/dist/{components → widgets/interactive-graph-editor/start-coords}/start-coords-multiline.d.ts +2 -2
- package/dist/{components → widgets/interactive-graph-editor/start-coords}/start-coords-point.d.ts +2 -2
- package/dist/{components → widgets/interactive-graph-editor/start-coords}/start-coords-quadratic.d.ts +2 -2
- package/dist/{components → widgets/interactive-graph-editor/start-coords}/start-coords-settings.d.ts +2 -1
- package/dist/widgets/interactive-graph-editor/start-coords/start-coords-sinusoid.d.ts +9 -0
- package/dist/widgets/interactive-graph-editor/start-coords/types.d.ts +24 -0
- package/dist/widgets/interactive-graph-editor/start-coords/util.d.ts +8 -0
- package/package.json +2 -2
- package/dist/components/start-coords-angle.d.ts +0 -8
- package/dist/components/start-coords-circle.d.ts +0 -11
- package/dist/components/start-coords-sinusoid.d.ts +0 -8
- /package/dist/{components → widgets/interactive-graph-editor/components}/interactive-graph-correct-answer.d.ts +0 -0
- /package/dist/{components → widgets/interactive-graph-editor/components}/interactive-graph-settings.d.ts +0 -0
- /package/dist/{components → widgets/interactive-graph-editor/components}/segment-count-selector.d.ts +0 -0
- /package/dist/{components/graph-locked-figures → widgets/interactive-graph-editor/locked-figures}/color-select.d.ts +0 -0
- /package/dist/{components/graph-locked-figures → widgets/interactive-graph-editor/locked-figures}/color-swatch.d.ts +0 -0
- /package/dist/{components/graph-locked-figures → widgets/interactive-graph-editor/locked-figures}/defining-point-settings.d.ts +0 -0
- /package/dist/{components/graph-locked-figures → widgets/interactive-graph-editor/locked-figures}/ellipse-swatch.d.ts +0 -0
- /package/dist/{components/graph-locked-figures → widgets/interactive-graph-editor/locked-figures}/labeled-row.d.ts +0 -0
- /package/dist/{components/graph-locked-figures → widgets/interactive-graph-editor/locked-figures}/labeled-switch.d.ts +0 -0
- /package/dist/{components/graph-locked-figures → widgets/interactive-graph-editor/locked-figures}/line-stroke-select.d.ts +0 -0
- /package/dist/{components/graph-locked-figures → widgets/interactive-graph-editor/locked-figures}/line-swatch.d.ts +0 -0
- /package/dist/{components/graph-locked-figures → widgets/interactive-graph-editor/locked-figures}/locked-ellipse-settings.d.ts +0 -0
- /package/dist/{components/graph-locked-figures → widgets/interactive-graph-editor/locked-figures}/locked-figure-select.d.ts +0 -0
- /package/dist/{components/graph-locked-figures → widgets/interactive-graph-editor/locked-figures}/locked-figure-settings-actions.d.ts +0 -0
- /package/dist/{components/graph-locked-figures → widgets/interactive-graph-editor/locked-figures}/locked-figure-settings.d.ts +0 -0
- /package/dist/{components/graph-locked-figures → widgets/interactive-graph-editor/locked-figures}/locked-function-examples.d.ts +0 -0
- /package/dist/{components/graph-locked-figures → widgets/interactive-graph-editor/locked-figures}/locked-function-settings.d.ts +0 -0
- /package/dist/{components/graph-locked-figures → widgets/interactive-graph-editor/locked-figures}/locked-label-settings.d.ts +0 -0
- /package/dist/{components/graph-locked-figures → widgets/interactive-graph-editor/locked-figures}/locked-line-settings.d.ts +0 -0
- /package/dist/{components/graph-locked-figures → widgets/interactive-graph-editor/locked-figures}/locked-point-settings.d.ts +0 -0
- /package/dist/{components/graph-locked-figures → widgets/interactive-graph-editor/locked-figures}/locked-polygon-settings.d.ts +0 -0
- /package/dist/{components/graph-locked-figures → widgets/interactive-graph-editor/locked-figures}/locked-vector-settings.d.ts +0 -0
- /package/dist/{components/graph-locked-figures → widgets/interactive-graph-editor/locked-figures}/polygon-swatch.d.ts +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type { Props as InteractiveGraphEditorProps } from "
|
|
2
|
+
import type { Props as InteractiveGraphEditorProps } from "../interactive-graph-editor";
|
|
3
3
|
import type { LockedFigure } from "@khanacademy/perseus";
|
|
4
4
|
type Props = {
|
|
5
5
|
showLabelsFlag?: boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LockedEllipseType, LockedFigure, LockedFigureType, LockedFunctionType, LockedLabelType, LockedLineType, LockedPointType, LockedPolygonType, LockedVectorType } from "@khanacademy/perseus";
|
|
2
|
+
export declare function getDefaultFigureForType(type: "point"): LockedPointType;
|
|
3
|
+
export declare function getDefaultFigureForType(type: "line"): LockedLineType;
|
|
4
|
+
export declare function getDefaultFigureForType(type: "vector"): LockedVectorType;
|
|
5
|
+
export declare function getDefaultFigureForType(type: "ellipse"): LockedEllipseType;
|
|
6
|
+
export declare function getDefaultFigureForType(type: "polygon"): LockedPolygonType;
|
|
7
|
+
export declare function getDefaultFigureForType(type: "function"): LockedFunctionType;
|
|
8
|
+
export declare function getDefaultFigureForType(type: "label"): LockedLabelType;
|
|
9
|
+
export declare function getDefaultFigureForType(type: LockedFigureType): LockedFigure;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { Coord } from "@khanacademy/perseus";
|
|
3
|
+
type AngleCoords = [Coord, Coord, Coord];
|
|
4
|
+
type Props = {
|
|
5
|
+
startCoords: AngleCoords;
|
|
6
|
+
onChange: (startCoords: AngleCoords) => void;
|
|
7
|
+
};
|
|
8
|
+
declare const StartCoordsAngle: (props: Props) => React.JSX.Element;
|
|
9
|
+
export default StartCoordsAngle;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { Coord } from "@khanacademy/perseus";
|
|
3
|
+
type CircleCoords = {
|
|
4
|
+
center: Coord;
|
|
5
|
+
radius: number;
|
|
6
|
+
};
|
|
7
|
+
type Props = {
|
|
8
|
+
startCoords: CircleCoords;
|
|
9
|
+
onChange: (startCoords: CircleCoords) => void;
|
|
10
|
+
};
|
|
11
|
+
declare const StartCoordsCircle: (props: Props) => React.JSX.Element;
|
|
12
|
+
export default StartCoordsCircle;
|
package/dist/{components → widgets/interactive-graph-editor/start-coords}/start-coords-line.d.ts
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type { CollinearTuple
|
|
2
|
+
import type { CollinearTuple } from "@khanacademy/perseus";
|
|
3
3
|
type Props = {
|
|
4
4
|
startCoords: CollinearTuple;
|
|
5
|
-
onChange: (startCoords:
|
|
5
|
+
onChange: (startCoords: CollinearTuple) => void;
|
|
6
6
|
};
|
|
7
7
|
declare const StartCoordsLine: (props: Props) => React.JSX.Element;
|
|
8
8
|
export default StartCoordsLine;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type { CollinearTuple
|
|
2
|
+
import type { CollinearTuple } from "@khanacademy/perseus";
|
|
3
3
|
type Props = {
|
|
4
4
|
type: "linear-system" | "segment";
|
|
5
5
|
startCoords: CollinearTuple[];
|
|
6
|
-
onChange: (startCoords:
|
|
6
|
+
onChange: (startCoords: CollinearTuple[]) => void;
|
|
7
7
|
};
|
|
8
8
|
declare const StartCoordsMultiline: (props: Props) => React.JSX.Element;
|
|
9
9
|
export default StartCoordsMultiline;
|
package/dist/{components → widgets/interactive-graph-editor/start-coords}/start-coords-point.d.ts
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type { Coord
|
|
2
|
+
import type { Coord } from "@khanacademy/perseus";
|
|
3
3
|
type Props = {
|
|
4
4
|
startCoords: ReadonlyArray<Coord>;
|
|
5
|
-
onChange: (startCoords:
|
|
5
|
+
onChange: (startCoords: ReadonlyArray<Coord>) => void;
|
|
6
6
|
};
|
|
7
7
|
declare const StartCoordsPoint: (props: Props) => React.JSX.Element;
|
|
8
8
|
export default StartCoordsPoint;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type { Coord
|
|
2
|
+
import type { Coord } from "@khanacademy/perseus";
|
|
3
3
|
type Props = {
|
|
4
4
|
startCoords: [Coord, Coord, Coord];
|
|
5
|
-
onChange: (startCoords:
|
|
5
|
+
onChange: (startCoords: [Coord, Coord, Coord]) => void;
|
|
6
6
|
};
|
|
7
7
|
declare const StartCoordsQuadratic: (props: Props) => React.JSX.Element;
|
|
8
8
|
export default StartCoordsQuadratic;
|
package/dist/{components → widgets/interactive-graph-editor/start-coords}/start-coords-settings.d.ts
RENAMED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import type { StartCoords } from "./types";
|
|
2
3
|
import type { PerseusGraphType, Range } from "@khanacademy/perseus";
|
|
3
4
|
type Props = PerseusGraphType & {
|
|
4
5
|
range: [x: Range, y: Range];
|
|
5
6
|
step: [x: number, y: number];
|
|
6
|
-
onChange: (startCoords:
|
|
7
|
+
onChange: (startCoords: StartCoords) => void;
|
|
7
8
|
};
|
|
8
9
|
declare const StartCoordsSettings: (props: Props) => React.JSX.Element;
|
|
9
10
|
export default StartCoordsSettings;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { Coord } from "@khanacademy/perseus";
|
|
3
|
+
type SinusoidCoords = [Coord, Coord];
|
|
4
|
+
type Props = {
|
|
5
|
+
startCoords: SinusoidCoords;
|
|
6
|
+
onChange: (startCoords: SinusoidCoords) => void;
|
|
7
|
+
};
|
|
8
|
+
declare const StartCoordsSinusoid: (props: Props) => React.JSX.Element;
|
|
9
|
+
export default StartCoordsSinusoid;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { PerseusGraphType } from "@khanacademy/perseus";
|
|
2
|
+
type GraphTypesThatHaveStartCoords = {
|
|
3
|
+
type: "angle";
|
|
4
|
+
} | {
|
|
5
|
+
type: "circle";
|
|
6
|
+
} | {
|
|
7
|
+
type: "linear";
|
|
8
|
+
} | {
|
|
9
|
+
type: "linear-system";
|
|
10
|
+
} | {
|
|
11
|
+
type: "point";
|
|
12
|
+
} | {
|
|
13
|
+
type: "polygon";
|
|
14
|
+
} | {
|
|
15
|
+
type: "quadratic";
|
|
16
|
+
} | {
|
|
17
|
+
type: "ray";
|
|
18
|
+
} | {
|
|
19
|
+
type: "segment";
|
|
20
|
+
} | {
|
|
21
|
+
type: "sinusoid";
|
|
22
|
+
};
|
|
23
|
+
export type StartCoords = Extract<PerseusGraphType, GraphTypesThatHaveStartCoords>["startCoords"];
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { StartCoords } from "./types";
|
|
2
|
+
import type { Range, PerseusGraphType, Coord } from "@khanacademy/perseus";
|
|
3
|
+
export declare function getStartCoords(graph: PerseusGraphType): StartCoords;
|
|
4
|
+
export declare function getDefaultGraphStartCoords(graph: PerseusGraphType, range: [x: Range, y: Range], step: [x: number, y: number]): StartCoords;
|
|
5
|
+
export declare const getSinusoidEquation: (startCoords: [Coord, Coord]) => string;
|
|
6
|
+
export declare const getQuadraticEquation: (startCoords: [Coord, Coord, Coord]) => string;
|
|
7
|
+
export declare const getAngleEquation: (startCoords: [Coord, Coord, Coord]) => string;
|
|
8
|
+
export declare const shouldShowStartCoordsUI: (graph: PerseusGraphType, isStatic?: boolean) => 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": "14.
|
|
6
|
+
"version": "14.2.0",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@khanacademy/keypad-context": "^1.0.1",
|
|
39
39
|
"@khanacademy/kmath": "^0.1.13",
|
|
40
40
|
"@khanacademy/math-input": "^21.0.2",
|
|
41
|
-
"@khanacademy/perseus": "^33.
|
|
41
|
+
"@khanacademy/perseus": "^33.3.0",
|
|
42
42
|
"@khanacademy/perseus-core": "1.5.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import type { Coord, PerseusGraphType } from "@khanacademy/perseus";
|
|
3
|
-
type Props = {
|
|
4
|
-
startCoords: [Coord, Coord, Coord];
|
|
5
|
-
onChange: (startCoords: PerseusGraphType["startCoords"]) => void;
|
|
6
|
-
};
|
|
7
|
-
declare const StartCoordsAngle: (props: Props) => React.JSX.Element;
|
|
8
|
-
export default StartCoordsAngle;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import type { Coord, PerseusGraphType } from "@khanacademy/perseus";
|
|
3
|
-
type Props = {
|
|
4
|
-
startCoords: {
|
|
5
|
-
center: Coord;
|
|
6
|
-
radius: number;
|
|
7
|
-
};
|
|
8
|
-
onChange: (startCoords: PerseusGraphType["startCoords"]) => void;
|
|
9
|
-
};
|
|
10
|
-
declare const StartCoordsCircle: (props: Props) => React.JSX.Element;
|
|
11
|
-
export default StartCoordsCircle;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import type { Coord, PerseusGraphType } from "@khanacademy/perseus";
|
|
3
|
-
type Props = {
|
|
4
|
-
startCoords: [Coord, Coord];
|
|
5
|
-
onChange: (startCoords: PerseusGraphType["startCoords"]) => void;
|
|
6
|
-
};
|
|
7
|
-
declare const StartCoordsSinusoid: (props: Props) => React.JSX.Element;
|
|
8
|
-
export default StartCoordsSinusoid;
|
|
File without changes
|
|
File without changes
|
/package/dist/{components → widgets/interactive-graph-editor/components}/segment-count-selector.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|