@khanacademy/perseus 20.7.0 → 20.8.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.js +376 -149
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +386 -141
- package/dist/index.js.map +1 -1
- package/dist/util/snowman-utils.d.ts +4 -5
- package/dist/widgets/interactive-graphs/graphs/components/angle.d.ts +13 -0
- package/dist/widgets/interactive-graphs/graphs/components/movable-point.d.ts +1 -1
- package/dist/widgets/interactive-graphs/graphs/use-transform.d.ts +2 -0
- package/dist/widgets/interactive-graphs/graphs/utils.d.ts +7 -0
- package/dist/widgets/interactive-graphs/legacy-grid.d.ts +6 -1
- package/dist/widgets/interactive-graphs/mafs-supported-graph-types.d.ts +3 -0
- package/package.json +2 -6
|
@@ -48,14 +48,13 @@ export declare const QUESTION_WIDGETS: ReadonlyArray<string>;
|
|
|
48
48
|
*/
|
|
49
49
|
export declare function getWidgetRegex(): RegExp;
|
|
50
50
|
/**
|
|
51
|
-
* Add a widget placeholder using the
|
|
52
|
-
* ex. addWidget(
|
|
51
|
+
* Add a widget placeholder using the widget ID.
|
|
52
|
+
* ex. addWidget("radio 1") => "[[☃ radio 1]]"
|
|
53
53
|
*
|
|
54
|
-
* @param {
|
|
55
|
-
* @param {number} instance
|
|
54
|
+
* @param {string} id
|
|
56
55
|
* @returns {string}
|
|
57
56
|
*/
|
|
58
|
-
export declare function addWidget(
|
|
57
|
+
export declare function addWidget(id: string): string;
|
|
59
58
|
/**
|
|
60
59
|
* Extract all widget IDs, which includes the widget type and instance number.
|
|
61
60
|
* example output: ['radio 1', 'categorizer 1', 'categorizor 2']
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { vec } from "mafs";
|
|
3
|
+
import type { Interval } from "mafs";
|
|
4
|
+
interface Props {
|
|
5
|
+
centerPoint: vec.Vector2;
|
|
6
|
+
endPoints: [vec.Vector2, vec.Vector2];
|
|
7
|
+
polygonPoints: readonly vec.Vector2[];
|
|
8
|
+
active: boolean;
|
|
9
|
+
range: [Interval, Interval];
|
|
10
|
+
showAngles: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const Angle: ({ centerPoint, endPoints, range, polygonPoints, showAngles, }: Props) => JSX.Element | null;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Interval, vec } from "mafs";
|
|
2
|
+
/**
|
|
3
|
+
* Given two points, find the tips that extends through the points to the edge of the range.
|
|
4
|
+
* @param collinearPoint - The point that the line passes through. Needed to establish slope.
|
|
5
|
+
* @param extendFrom - The point that the line extends from to the edge of the graph.
|
|
6
|
+
*/
|
|
7
|
+
export declare const getRayIntersectionCoords: (collinearPoint: vec.Vector2, extendFrom: vec.Vector2, range: [Interval, Interval]) => [number, number];
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { PerseusImageBackground } from "../../perseus-types";
|
|
3
|
+
interface Props {
|
|
4
|
+
box: [number, number];
|
|
5
|
+
backgroundImage?: PerseusImageBackground;
|
|
6
|
+
}
|
|
3
7
|
/**
|
|
4
8
|
* If a graphie URL is provided in `backgroundImage`, will return the rendered graphie background.
|
|
5
9
|
* Otherwise, returns `null`.
|
|
6
10
|
*/
|
|
7
|
-
export declare const
|
|
11
|
+
export declare const LegacyGrid: ({ box, backgroundImage }: Props) => JSX.Element | null;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const mafsSupportedGraphTypes: readonly ["segment", "linear", "linear-system", "ray", "polygon"];
|
|
2
|
+
export type MafsSupportedGraphType = (typeof mafsSupportedGraphTypes)[number];
|
|
3
|
+
export declare const trueForAllMafsSupportedGraphTypes: Record<MafsSupportedGraphType, true>;
|
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": "20.
|
|
6
|
+
"version": "20.8.1",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@khanacademy/kas": "^0.3.9",
|
|
29
29
|
"@khanacademy/kmath": "^0.1.12",
|
|
30
|
-
"@khanacademy/math-input": "^17.
|
|
30
|
+
"@khanacademy/math-input": "^17.4.1",
|
|
31
31
|
"@khanacademy/perseus-core": "1.4.2",
|
|
32
32
|
"@khanacademy/perseus-linter": "^0.3.12",
|
|
33
33
|
"@khanacademy/pure-markdown": "^0.3.1",
|
|
@@ -38,7 +38,6 @@
|
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@khanacademy/wonder-blocks-button": "^6.2.8",
|
|
40
40
|
"@khanacademy/wonder-blocks-clickable": "^4.1.0",
|
|
41
|
-
"@khanacademy/wonder-blocks-color": "^3.0.0",
|
|
42
41
|
"@khanacademy/wonder-blocks-core": "^6.3.1",
|
|
43
42
|
"@khanacademy/wonder-blocks-data": "^13.0.6",
|
|
44
43
|
"@khanacademy/wonder-blocks-dropdown": "^5.1.6",
|
|
@@ -51,7 +50,6 @@
|
|
|
51
50
|
"@khanacademy/wonder-blocks-pill": "^2.0.3",
|
|
52
51
|
"@khanacademy/wonder-blocks-popover": "^3.1.3",
|
|
53
52
|
"@khanacademy/wonder-blocks-progress-spinner": "^2.0.27",
|
|
54
|
-
"@khanacademy/wonder-blocks-spacing": "^4.0.1",
|
|
55
53
|
"@khanacademy/wonder-blocks-switch": "^1.1.12",
|
|
56
54
|
"@khanacademy/wonder-blocks-tokens": "^1.1.0",
|
|
57
55
|
"@khanacademy/wonder-blocks-tooltip": "^2.1.28",
|
|
@@ -76,7 +74,6 @@
|
|
|
76
74
|
"peerDependencies": {
|
|
77
75
|
"@khanacademy/wonder-blocks-button": "^6.2.8",
|
|
78
76
|
"@khanacademy/wonder-blocks-clickable": "^4.1.0",
|
|
79
|
-
"@khanacademy/wonder-blocks-color": "^3.0.0",
|
|
80
77
|
"@khanacademy/wonder-blocks-core": "^6.3.1",
|
|
81
78
|
"@khanacademy/wonder-blocks-data": "^13.0.6",
|
|
82
79
|
"@khanacademy/wonder-blocks-dropdown": "^5.1.6",
|
|
@@ -89,7 +86,6 @@
|
|
|
89
86
|
"@khanacademy/wonder-blocks-pill": "^2.0.3",
|
|
90
87
|
"@khanacademy/wonder-blocks-popover": "^3.1.3",
|
|
91
88
|
"@khanacademy/wonder-blocks-progress-spinner": "^2.0.27",
|
|
92
|
-
"@khanacademy/wonder-blocks-spacing": "^4.0.1",
|
|
93
89
|
"@khanacademy/wonder-blocks-switch": "^1.1.12",
|
|
94
90
|
"@khanacademy/wonder-blocks-tokens": "^1.1.0",
|
|
95
91
|
"@khanacademy/wonder-blocks-tooltip": "^2.1.28",
|