@khanacademy/perseus 78.4.0 → 79.0.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/es/index.js +35 -37
- package/dist/es/index.js.map +1 -1
- package/dist/es/strings.js +1 -1
- package/dist/es/strings.js.map +1 -1
- package/dist/index.js +35 -37
- package/dist/index.js.map +1 -1
- package/dist/strings.d.ts +74 -6
- package/dist/strings.js +1 -1
- package/dist/strings.js.map +1 -1
- package/dist/types.d.ts +0 -1
- package/dist/widget-ai-utils/input-number/input-number-ai-utils.d.ts +9 -15
- package/dist/widgets/input-number/input-number.d.ts +5 -19
- package/dist/widgets/interactive-graphs/backgrounds/grid.d.ts +14 -0
- package/dist/widgets/interactive-graphs/graphs/absolute-value.d.ts +1 -3
- package/dist/widgets/interactive-graphs/graphs/components/clip-to-graph-bounds.d.ts +9 -1
- package/dist/widgets/interactive-graphs/mafs-graph.d.ts +1 -0
- package/dist/widgets/interactive-graphs/stateful-mafs-graph.d.ts +1 -0
- package/dist/widgets/interactive-graphs/types.d.ts +1 -0
- package/package.json +44 -44
package/dist/types.d.ts
CHANGED
|
@@ -84,7 +84,6 @@ export type ChangeHandler = (arg1: {
|
|
|
84
84
|
markers?: Array<LabelImageMarkerPublicData | PerseusLabelImageMarker>;
|
|
85
85
|
}, callback?: () => void, silent?: boolean) => unknown;
|
|
86
86
|
export type ImageUploader = (file: File, callback: (url: string) => unknown) => unknown;
|
|
87
|
-
export type Path = ReadonlyArray<string>;
|
|
88
87
|
type TrackInteractionArgs = {
|
|
89
88
|
type: string;
|
|
90
89
|
id: string;
|
|
@@ -9,26 +9,20 @@ import type React from "react";
|
|
|
9
9
|
*/
|
|
10
10
|
export type InputNumberPromptJSON = {
|
|
11
11
|
type: "input-number";
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* - "required" means an unsimplified answer is considered invalid,
|
|
19
|
-
* and the learner can try again without penalty.
|
|
20
|
-
* - "enforced" means unsimplified answers are counted as incorrect.
|
|
21
|
-
*/
|
|
22
|
-
simplify: string;
|
|
23
|
-
/** The expected numeric form, e.g. "rational", "decimal" */
|
|
24
|
-
answerType: string;
|
|
25
|
-
};
|
|
12
|
+
/**
|
|
13
|
+
* Accessible label for the input field, set by the content creator.
|
|
14
|
+
* Shown to learners using screen readers to describe what value should
|
|
15
|
+
* be entered.
|
|
16
|
+
*/
|
|
17
|
+
label: string;
|
|
26
18
|
/**
|
|
27
19
|
* The current state of the widget user interface. Usually represents a
|
|
28
20
|
* learner's attempt to answer a question.
|
|
29
21
|
*/
|
|
30
22
|
userInput: {
|
|
31
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* The text currently entered in the input field by the learner.
|
|
25
|
+
*/
|
|
32
26
|
value: string;
|
|
33
27
|
};
|
|
34
28
|
};
|
|
@@ -1,32 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { PerseusDependenciesV2, WidgetProps } from "../../types";
|
|
3
|
-
import type { PerseusInputNumberWidgetOptions, PerseusInputNumberUserInput } from "@khanacademy/perseus-core";
|
|
4
|
-
type ExternalProps = WidgetProps<PerseusInputNumberWidgetOptions, PerseusInputNumberUserInput>;
|
|
5
|
-
type Props = ExternalProps & {
|
|
6
|
-
apiOptions: NonNullable<ExternalProps["apiOptions"]>;
|
|
7
|
-
linterContext: NonNullable<ExternalProps["linterContext"]>;
|
|
8
|
-
rightAlign: NonNullable<ExternalProps["rightAlign"]>;
|
|
9
|
-
size: NonNullable<ExternalProps["size"]>;
|
|
10
|
-
answerType: NonNullable<ExternalProps["answerType"]>;
|
|
11
|
-
dependencies: PerseusDependenciesV2;
|
|
12
|
-
};
|
|
13
|
-
declare function getOneCorrectAnswerFromRubric(rubric: any): string | undefined;
|
|
1
|
+
import type { PerseusInputNumberUserInput } from "@khanacademy/perseus-core";
|
|
14
2
|
/**
|
|
15
3
|
* @deprecated and likely a very broken API
|
|
16
4
|
* [LEMS-3185] do not trust serializedState
|
|
17
5
|
*/
|
|
18
6
|
declare function getUserInputFromSerializedState(serializedState: any): PerseusInputNumberUserInput;
|
|
19
|
-
declare function getStartUserInput(): PerseusInputNumberUserInput;
|
|
20
|
-
declare function getCorrectUserInput(options: PerseusInputNumberWidgetOptions): PerseusInputNumberUserInput;
|
|
21
7
|
declare const _default: {
|
|
22
8
|
name: string;
|
|
23
9
|
displayName: string;
|
|
24
10
|
hidden: true;
|
|
25
|
-
widget:
|
|
11
|
+
widget: typeof import("../numeric-input/numeric-input.class").NumericInput;
|
|
26
12
|
isLintable: true;
|
|
27
|
-
getOneCorrectAnswerFromRubric:
|
|
28
|
-
getStartUserInput:
|
|
29
|
-
getCorrectUserInput:
|
|
13
|
+
getOneCorrectAnswerFromRubric: (rubric: import("@khanacademy/perseus-core").PerseusNumericInputRubric) => string | null | undefined;
|
|
14
|
+
getStartUserInput: () => import("@khanacademy/perseus-core").PerseusNumericInputUserInput;
|
|
15
|
+
getCorrectUserInput: (options: import("@khanacademy/perseus-core").PerseusNumericInputWidgetOptions) => import("@khanacademy/perseus-core").PerseusNumericInputUserInput;
|
|
30
16
|
getUserInputFromSerializedState: typeof getUserInputFromSerializedState;
|
|
31
17
|
};
|
|
32
18
|
export default _default;
|
|
@@ -10,5 +10,19 @@ interface GridProps {
|
|
|
10
10
|
width: number;
|
|
11
11
|
height: number;
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Renders the Cartesian grid lines (not the axis lines). This is intended to
|
|
15
|
+
* be clipped to the graph's exact bounds so grid lines never spill past the
|
|
16
|
+
* edge. The axis lines are rendered separately by `<Axes>`.
|
|
17
|
+
*/
|
|
13
18
|
export declare const Grid: (props: GridProps) => React.JSX.Element | null;
|
|
19
|
+
/**
|
|
20
|
+
* Renders the Cartesian axis lines (not the grid lines). When an axis sits on
|
|
21
|
+
* the graph's edge, the outer half of its stroke would be clipped away by the
|
|
22
|
+
* graph bounds, making the axis look half its intended width. To avoid that,
|
|
23
|
+
* this is clipped to the graph bounds expanded outward (by half the stroke
|
|
24
|
+
* width) only on the sides where an axis sits on the edge — see how this is
|
|
25
|
+
* clipped in mafs-graph.tsx.
|
|
26
|
+
*/
|
|
27
|
+
export declare const Axes: (props: GridProps) => React.JSX.Element | null;
|
|
14
28
|
export {};
|
|
@@ -11,10 +11,8 @@ export type AbsoluteValueCoefficients = {
|
|
|
11
11
|
/**
|
|
12
12
|
* Compute the coefficients [m, h, v] for f(x) = m * |x - h| + v from two
|
|
13
13
|
* control points: p1 (vertex) and p2 (a point on one arm).
|
|
14
|
-
*
|
|
15
|
-
* Returns undefined if p1 and p2 share the same x-coordinate (slope undefined).
|
|
16
14
|
*/
|
|
17
|
-
export declare function getAbsoluteValueCoefficients(coords: ReadonlyArray<Coord>): AbsoluteValueCoefficients
|
|
15
|
+
export declare function getAbsoluteValueCoefficients(coords: ReadonlyArray<Coord>): AbsoluteValueCoefficients;
|
|
18
16
|
/**
|
|
19
17
|
* Keyboard constraint for absolute value control points.
|
|
20
18
|
* Skips any horizontal position where both points would share the same x.
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
2
|
+
type Insets = {
|
|
3
|
+
top?: number;
|
|
4
|
+
right?: number;
|
|
5
|
+
bottom?: number;
|
|
6
|
+
left?: number;
|
|
7
|
+
};
|
|
8
|
+
export declare function ClipToGraphBounds({ children, expand, }: {
|
|
3
9
|
children: React.ReactNode;
|
|
10
|
+
expand?: Insets;
|
|
4
11
|
}): React.JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -25,6 +25,7 @@ export type MafsGraphProps = {
|
|
|
25
25
|
readOnly: boolean;
|
|
26
26
|
static: boolean | null | undefined;
|
|
27
27
|
widgetId: string;
|
|
28
|
+
ungradedDescriptionId?: string;
|
|
28
29
|
apiOptions?: APIOptionsWithDefaults;
|
|
29
30
|
};
|
|
30
31
|
export declare const MafsGraph: (props: MafsGraphProps) => React.JSX.Element;
|
|
@@ -30,6 +30,7 @@ export type StatefulMafsGraphProps = {
|
|
|
30
30
|
showAxisTicks: InteractiveGraphProps["showAxisTicks"];
|
|
31
31
|
widgetId: string;
|
|
32
32
|
graded?: boolean | null;
|
|
33
|
+
ungradedDescriptionId?: string;
|
|
33
34
|
apiOptions?: APIOptionsWithDefaults;
|
|
34
35
|
};
|
|
35
36
|
export type StatefulMafsGraphType = {
|
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": "
|
|
6
|
+
"version": "79.0.0",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -43,39 +43,39 @@
|
|
|
43
43
|
"tiny-invariant": "1.3.1",
|
|
44
44
|
"uuid": "^10.0.0",
|
|
45
45
|
"@khanacademy/kas": "2.2.3",
|
|
46
|
-
"@khanacademy/keypad-context": "3.2.
|
|
47
|
-
"@khanacademy/kmath": "2.4.
|
|
48
|
-
"@khanacademy/math-input": "26.4.
|
|
49
|
-
"@khanacademy/perseus-core": "
|
|
50
|
-
"@khanacademy/perseus-linter": "5.1.
|
|
51
|
-
"@khanacademy/perseus-score": "8.
|
|
46
|
+
"@khanacademy/keypad-context": "3.2.68",
|
|
47
|
+
"@khanacademy/kmath": "2.4.27",
|
|
48
|
+
"@khanacademy/math-input": "26.4.41",
|
|
49
|
+
"@khanacademy/perseus-core": "30.0.0",
|
|
50
|
+
"@khanacademy/perseus-linter": "5.1.8",
|
|
51
|
+
"@khanacademy/perseus-score": "8.12.0",
|
|
52
52
|
"@khanacademy/perseus-utils": "2.1.5",
|
|
53
53
|
"@khanacademy/pure-markdown": "2.3.0",
|
|
54
54
|
"@khanacademy/simple-markdown": "2.2.3"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@khanacademy/wonder-blocks-announcer": "1.1.1",
|
|
58
|
-
"@khanacademy/wonder-blocks-banner": "5.1.
|
|
59
|
-
"@khanacademy/wonder-blocks-button": "11.7.
|
|
60
|
-
"@khanacademy/wonder-blocks-clickable": "8.2.
|
|
58
|
+
"@khanacademy/wonder-blocks-banner": "5.1.5",
|
|
59
|
+
"@khanacademy/wonder-blocks-button": "11.7.2",
|
|
60
|
+
"@khanacademy/wonder-blocks-clickable": "8.2.4",
|
|
61
61
|
"@khanacademy/wonder-blocks-core": "12.4.4",
|
|
62
62
|
"@khanacademy/wonder-blocks-data": "15.0.2",
|
|
63
|
-
"@khanacademy/wonder-blocks-dropdown": "10.11.
|
|
64
|
-
"@khanacademy/wonder-blocks-form": "7.6.
|
|
65
|
-
"@khanacademy/wonder-blocks-icon": "5.3.
|
|
66
|
-
"@khanacademy/wonder-blocks-icon-button": "11.3.
|
|
67
|
-
"@khanacademy/wonder-blocks-labeled-field": "4.1.
|
|
68
|
-
"@khanacademy/wonder-blocks-layout": "3.1.
|
|
69
|
-
"@khanacademy/wonder-blocks-link": "10.3.
|
|
70
|
-
"@khanacademy/wonder-blocks-modal": "8.7.
|
|
71
|
-
"@khanacademy/wonder-blocks-pill": "3.1.
|
|
72
|
-
"@khanacademy/wonder-blocks-popover": "6.3.
|
|
73
|
-
"@khanacademy/wonder-blocks-progress-spinner": "3.1.
|
|
74
|
-
"@khanacademy/wonder-blocks-switch": "3.4.
|
|
63
|
+
"@khanacademy/wonder-blocks-dropdown": "10.11.1",
|
|
64
|
+
"@khanacademy/wonder-blocks-form": "7.6.5",
|
|
65
|
+
"@khanacademy/wonder-blocks-icon": "5.3.18",
|
|
66
|
+
"@khanacademy/wonder-blocks-icon-button": "11.3.5",
|
|
67
|
+
"@khanacademy/wonder-blocks-labeled-field": "4.1.4",
|
|
68
|
+
"@khanacademy/wonder-blocks-layout": "3.1.55",
|
|
69
|
+
"@khanacademy/wonder-blocks-link": "10.3.4",
|
|
70
|
+
"@khanacademy/wonder-blocks-modal": "8.7.5",
|
|
71
|
+
"@khanacademy/wonder-blocks-pill": "3.1.68",
|
|
72
|
+
"@khanacademy/wonder-blocks-popover": "6.3.5",
|
|
73
|
+
"@khanacademy/wonder-blocks-progress-spinner": "3.1.55",
|
|
74
|
+
"@khanacademy/wonder-blocks-switch": "3.4.4",
|
|
75
75
|
"@khanacademy/wonder-blocks-timing": "7.1.0",
|
|
76
|
-
"@khanacademy/wonder-blocks-tokens": "16.
|
|
77
|
-
"@khanacademy/wonder-blocks-tooltip": "4.1.
|
|
78
|
-
"@khanacademy/wonder-blocks-typography": "4.3.
|
|
76
|
+
"@khanacademy/wonder-blocks-tokens": "16.8.0",
|
|
77
|
+
"@khanacademy/wonder-blocks-tooltip": "4.1.80",
|
|
78
|
+
"@khanacademy/wonder-blocks-typography": "4.3.8",
|
|
79
79
|
"@khanacademy/wonder-stuff-core": "3.0.0",
|
|
80
80
|
"@phosphor-icons/core": "2.0.2",
|
|
81
81
|
"@popperjs/core": "2.10.2",
|
|
@@ -92,27 +92,27 @@
|
|
|
92
92
|
},
|
|
93
93
|
"peerDependencies": {
|
|
94
94
|
"@khanacademy/wonder-blocks-announcer": "^1.1.1",
|
|
95
|
-
"@khanacademy/wonder-blocks-banner": "^5.1.
|
|
96
|
-
"@khanacademy/wonder-blocks-button": "^11.7.
|
|
97
|
-
"@khanacademy/wonder-blocks-clickable": "^8.2.
|
|
95
|
+
"@khanacademy/wonder-blocks-banner": "^5.1.5",
|
|
96
|
+
"@khanacademy/wonder-blocks-button": "^11.7.2",
|
|
97
|
+
"@khanacademy/wonder-blocks-clickable": "^8.2.4",
|
|
98
98
|
"@khanacademy/wonder-blocks-core": "^12.4.4",
|
|
99
99
|
"@khanacademy/wonder-blocks-data": "^15.0.2",
|
|
100
|
-
"@khanacademy/wonder-blocks-dropdown": "^10.11.
|
|
101
|
-
"@khanacademy/wonder-blocks-form": "^7.6.
|
|
102
|
-
"@khanacademy/wonder-blocks-icon": "^5.3.
|
|
103
|
-
"@khanacademy/wonder-blocks-icon-button": "^11.3.
|
|
104
|
-
"@khanacademy/wonder-blocks-labeled-field": "^4.1.
|
|
105
|
-
"@khanacademy/wonder-blocks-layout": "^3.1.
|
|
106
|
-
"@khanacademy/wonder-blocks-link": "^10.3.
|
|
107
|
-
"@khanacademy/wonder-blocks-modal": "^8.7.
|
|
108
|
-
"@khanacademy/wonder-blocks-pill": "^3.1.
|
|
109
|
-
"@khanacademy/wonder-blocks-popover": "^6.3.
|
|
110
|
-
"@khanacademy/wonder-blocks-progress-spinner": "^3.1.
|
|
111
|
-
"@khanacademy/wonder-blocks-switch": "^3.4.
|
|
100
|
+
"@khanacademy/wonder-blocks-dropdown": "^10.11.1",
|
|
101
|
+
"@khanacademy/wonder-blocks-form": "^7.6.5",
|
|
102
|
+
"@khanacademy/wonder-blocks-icon": "^5.3.18",
|
|
103
|
+
"@khanacademy/wonder-blocks-icon-button": "^11.3.5",
|
|
104
|
+
"@khanacademy/wonder-blocks-labeled-field": "^4.1.4",
|
|
105
|
+
"@khanacademy/wonder-blocks-layout": "^3.1.55",
|
|
106
|
+
"@khanacademy/wonder-blocks-link": "^10.3.4",
|
|
107
|
+
"@khanacademy/wonder-blocks-modal": "^8.7.5",
|
|
108
|
+
"@khanacademy/wonder-blocks-pill": "^3.1.68",
|
|
109
|
+
"@khanacademy/wonder-blocks-popover": "^6.3.5",
|
|
110
|
+
"@khanacademy/wonder-blocks-progress-spinner": "^3.1.55",
|
|
111
|
+
"@khanacademy/wonder-blocks-switch": "^3.4.4",
|
|
112
112
|
"@khanacademy/wonder-blocks-timing": "^7.1.0",
|
|
113
|
-
"@khanacademy/wonder-blocks-tokens": "^16.
|
|
114
|
-
"@khanacademy/wonder-blocks-tooltip": "^4.1.
|
|
115
|
-
"@khanacademy/wonder-blocks-typography": "^4.3.
|
|
113
|
+
"@khanacademy/wonder-blocks-tokens": "^16.8.0",
|
|
114
|
+
"@khanacademy/wonder-blocks-tooltip": "^4.1.80",
|
|
115
|
+
"@khanacademy/wonder-blocks-typography": "^4.3.8",
|
|
116
116
|
"@khanacademy/wonder-stuff-core": "^3.0.0",
|
|
117
117
|
"@phosphor-icons/core": "^2.0.2",
|
|
118
118
|
"@popperjs/core": "^2.10.2",
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
},
|
|
128
128
|
"keywords": [],
|
|
129
129
|
"khan": {
|
|
130
|
-
"catalogHash": "
|
|
130
|
+
"catalogHash": "a4790ad979dcb9a1"
|
|
131
131
|
},
|
|
132
132
|
"scripts": {}
|
|
133
133
|
}
|