@khanacademy/perseus 28.0.0 → 28.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/es/index.css +4 -5
- package/dist/es/index.js +45 -40
- package/dist/es/index.js.map +1 -1
- package/dist/index.css +4 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +46 -40
- package/dist/index.js.map +1 -1
- package/dist/renderer.d.ts +1 -8
- package/dist/types.d.ts +0 -1
- package/dist/widgets/expression.d.ts +2 -4
- package/dist/widgets/interactive-graphs/interactive-graph-question-builder.d.ts +2 -0
- package/dist/widgets/interactive-graphs/mafs-graph.d.ts +1 -1
- package/dist/widgets/interactive-graphs/stateful-mafs-graph.d.ts +2 -1
- package/package.json +6 -4
package/dist/renderer.d.ts
CHANGED
|
@@ -62,13 +62,6 @@ type Props = Partial<React.ContextType<typeof DependenciesContext>> & {
|
|
|
62
62
|
problemNum?: number;
|
|
63
63
|
questionCompleted?: boolean;
|
|
64
64
|
reviewMode?: boolean | null | undefined;
|
|
65
|
-
/**
|
|
66
|
-
* Some widgets (e.g. InteractiveGraph) support "hint mode", a state where
|
|
67
|
-
* the widget is non-editable, may have a partial solution filled in,
|
|
68
|
-
* and may have special styling. Setting hintMode to true will turn on hint
|
|
69
|
-
* mode for all rendered widgets.
|
|
70
|
-
*/
|
|
71
|
-
hintMode?: boolean;
|
|
72
65
|
/**
|
|
73
66
|
* If set to "all", all rationales or solutions will be shown. If set to
|
|
74
67
|
* "selected", soltions will only be shown for selected choices. If set to
|
|
@@ -108,7 +101,7 @@ type State = {
|
|
|
108
101
|
jiptContent: any;
|
|
109
102
|
lastUsedWidgetId: string | null | undefined;
|
|
110
103
|
};
|
|
111
|
-
type DefaultProps = Required<Pick<Props, "alwaysUpdate" | "content" | "findExternalWidgets" | "highlightedWidgets" | "images" | "linterContext" | "onInteractWithWidget" | "onRender" | "onSerializedStateUpdated" | "questionCompleted" | "showSolutions" | "reviewMode" | "
|
|
104
|
+
type DefaultProps = Required<Pick<Props, "alwaysUpdate" | "content" | "findExternalWidgets" | "highlightedWidgets" | "images" | "linterContext" | "onInteractWithWidget" | "onRender" | "onSerializedStateUpdated" | "questionCompleted" | "showSolutions" | "reviewMode" | "serializedState" | "widgets">>;
|
|
112
105
|
declare class Renderer extends React.Component<Props, State> {
|
|
113
106
|
_currentFocus: FocusPath | null | undefined;
|
|
114
107
|
_foundTextNodes: boolean;
|
package/dist/types.d.ts
CHANGED
|
@@ -373,7 +373,6 @@ export type WidgetProps<RenderProps, Rubric, TrackingExtraArgs = Empty> = Render
|
|
|
373
373
|
onBlur: (blurPath: FocusPath) => void;
|
|
374
374
|
findWidgets: (arg1: FilterCriterion) => ReadonlyArray<Widget>;
|
|
375
375
|
reviewModeRubric: Rubric;
|
|
376
|
-
hintMode: boolean;
|
|
377
376
|
onChange: ChangeHandler;
|
|
378
377
|
trackInteraction: (extraData?: TrackingExtraArgs) => void;
|
|
379
378
|
isLastUsedWidget: boolean;
|
|
@@ -183,7 +183,6 @@ declare const _default: Readonly<{
|
|
|
183
183
|
onBlur: (blurPath: import("../types").FocusPath) => void;
|
|
184
184
|
findWidgets: (arg1: import("../types").FilterCriterion) => readonly any[];
|
|
185
185
|
reviewModeRubric: PerseusExpressionWidgetOptions;
|
|
186
|
-
hintMode: boolean;
|
|
187
186
|
onChange: import("../types").ChangeHandler;
|
|
188
187
|
trackInteraction: (extraData?: Empty | undefined) => void;
|
|
189
188
|
isLastUsedWidget: boolean;
|
|
@@ -271,7 +270,7 @@ declare const _default: Readonly<{
|
|
|
271
270
|
visibleLabel: string | undefined;
|
|
272
271
|
ariaLabel: string | undefined;
|
|
273
272
|
value: string;
|
|
274
|
-
}, "static" | "analytics" | "onChange" | "ariaLabel" | "buttonsVisible" | "containerSizeClass" | "widgetId" | "problemNum" | "questionCompleted" | "findWidgets" | "
|
|
273
|
+
}, "static" | "analytics" | "onChange" | "ariaLabel" | "buttonsVisible" | "containerSizeClass" | "widgetId" | "problemNum" | "questionCompleted" | "findWidgets" | "trackInteraction" | "keypadElement" | "visibleLabel" | "keypadConfiguration" | "alignment" | "reviewModeRubric" | "isLastUsedWidget"> & {
|
|
275
274
|
value?: string | undefined;
|
|
276
275
|
buttonSets?: import("../perseus-types").LegacyButtonSets | undefined;
|
|
277
276
|
onFocus?: ((blurPath: import("../types").FocusPath) => void) | undefined;
|
|
@@ -435,7 +434,6 @@ declare const _default: Readonly<{
|
|
|
435
434
|
onBlur: (blurPath: import("../types").FocusPath) => void;
|
|
436
435
|
findWidgets: (arg1: import("../types").FilterCriterion) => readonly any[];
|
|
437
436
|
reviewModeRubric: PerseusExpressionWidgetOptions;
|
|
438
|
-
hintMode: boolean;
|
|
439
437
|
onChange: import("../types").ChangeHandler;
|
|
440
438
|
trackInteraction: (extraData?: Empty | undefined) => void;
|
|
441
439
|
isLastUsedWidget: boolean;
|
|
@@ -523,7 +521,7 @@ declare const _default: Readonly<{
|
|
|
523
521
|
visibleLabel: string | undefined;
|
|
524
522
|
ariaLabel: string | undefined;
|
|
525
523
|
value: string;
|
|
526
|
-
}, "static" | "analytics" | "onChange" | "ariaLabel" | "buttonsVisible" | "containerSizeClass" | "widgetId" | "problemNum" | "questionCompleted" | "findWidgets" | "
|
|
524
|
+
}, "static" | "analytics" | "onChange" | "ariaLabel" | "buttonsVisible" | "containerSizeClass" | "widgetId" | "problemNum" | "questionCompleted" | "findWidgets" | "trackInteraction" | "keypadElement" | "visibleLabel" | "keypadConfiguration" | "alignment" | "reviewModeRubric" | "isLastUsedWidget"> & {
|
|
527
525
|
value?: string | undefined;
|
|
528
526
|
buttonSets?: import("../perseus-types").LegacyButtonSets | undefined;
|
|
529
527
|
onFocus?: ((blurPath: import("../types").FocusPath) => void) | undefined;
|
|
@@ -17,8 +17,10 @@ declare class InteractiveGraphQuestionBuilder {
|
|
|
17
17
|
private interactiveFigureConfig;
|
|
18
18
|
private lockedFigures;
|
|
19
19
|
private snapTo;
|
|
20
|
+
private staticMode;
|
|
20
21
|
build(): PerseusRenderer;
|
|
21
22
|
withContent(content: string): InteractiveGraphQuestionBuilder;
|
|
23
|
+
withStaticMode(staticMode: boolean): InteractiveGraphQuestionBuilder;
|
|
22
24
|
withBackgroundImage(url: string, height: number, width: number, options?: {
|
|
23
25
|
scale?: number;
|
|
24
26
|
bottom?: number;
|
|
@@ -16,7 +16,7 @@ export type MafsGraphProps = {
|
|
|
16
16
|
labels: InteractiveGraphProps["labels"];
|
|
17
17
|
state: InteractiveGraphState;
|
|
18
18
|
dispatch: React.Dispatch<InteractiveGraphAction>;
|
|
19
|
-
hintMode: boolean;
|
|
20
19
|
readOnly: boolean;
|
|
20
|
+
static: boolean | null | undefined;
|
|
21
21
|
};
|
|
22
22
|
export declare const MafsGraph: (props: MafsGraphProps) => React.JSX.Element;
|
|
@@ -6,6 +6,7 @@ export type StatefulMafsGraphProps = {
|
|
|
6
6
|
box: [number, number];
|
|
7
7
|
backgroundImage?: InteractiveGraphProps["backgroundImage"];
|
|
8
8
|
graph: PerseusGraphType;
|
|
9
|
+
correct: PerseusGraphType;
|
|
9
10
|
lockedFigures?: InteractiveGraphProps["lockedFigures"];
|
|
10
11
|
range: InteractiveGraphProps["range"];
|
|
11
12
|
snapStep: InteractiveGraphProps["snapStep"];
|
|
@@ -17,7 +18,7 @@ export type StatefulMafsGraphProps = {
|
|
|
17
18
|
showTooltips: Required<InteractiveGraphProps["showTooltips"]>;
|
|
18
19
|
showProtractor: boolean;
|
|
19
20
|
labels: InteractiveGraphProps["labels"];
|
|
20
|
-
hintMode: boolean;
|
|
21
21
|
readOnly: boolean;
|
|
22
|
+
static: InteractiveGraphProps["static"];
|
|
22
23
|
};
|
|
23
24
|
export declare const StatefulMafsGraph: React.ForwardRefExoticComponent<StatefulMafsGraphProps & React.RefAttributes<Partial<Widget>>>;
|
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": "28.
|
|
6
|
+
"version": "28.2.0",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
"require": "./dist/strings.js",
|
|
31
31
|
"types": "./dist/strings.d.ts",
|
|
32
32
|
"source": "./src/strings.ts"
|
|
33
|
-
}
|
|
33
|
+
},
|
|
34
|
+
"./styles.css": "./dist/index.css"
|
|
34
35
|
},
|
|
35
36
|
"files": [
|
|
36
37
|
"dist"
|
|
@@ -41,9 +42,10 @@
|
|
|
41
42
|
"dependencies": {
|
|
42
43
|
"@khanacademy/kas": "^0.3.11",
|
|
43
44
|
"@khanacademy/kmath": "^0.1.13",
|
|
44
|
-
"@khanacademy/
|
|
45
|
+
"@khanacademy/keypad-context": "^1.0.0",
|
|
46
|
+
"@khanacademy/math-input": "^21.0.0",
|
|
45
47
|
"@khanacademy/perseus-core": "1.5.0",
|
|
46
|
-
"@khanacademy/perseus-linter": "^1.
|
|
48
|
+
"@khanacademy/perseus-linter": "^1.1.0",
|
|
47
49
|
"@khanacademy/pure-markdown": "^0.3.7",
|
|
48
50
|
"@khanacademy/simple-markdown": "^0.13.0",
|
|
49
51
|
"@use-gesture/react": "^10.2.27",
|