@khanacademy/perseus 69.0.1 → 69.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/fixed-to-responsive.d.ts +2 -0
- package/dist/components/svg-image.d.ts +6 -0
- package/dist/es/index.css +2 -2
- package/dist/es/index.css.map +1 -1
- package/dist/es/index.js +54 -46
- 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.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/index.js +54 -45
- package/dist/index.js.map +1 -1
- package/dist/strings.d.ts +6 -0
- package/dist/strings.js +1 -1
- package/dist/strings.js.map +1 -1
- package/dist/types.d.ts +0 -1
- package/dist/widgets/expression/expression.d.ts +1 -2
- package/dist/widgets/grapher/grapher.d.ts +0 -1
- package/dist/widgets/image/components/explore-image-button.d.ts +7 -0
- package/dist/widgets/image/components/explore-image-modal-content.d.ts +3 -0
- package/dist/widgets/image/components/explore-image-modal.d.ts +3 -0
- package/dist/widgets/image/components/image-description-and-caption.d.ts +17 -0
- package/dist/widgets/image/image.class.d.ts +14 -12
- package/dist/widgets/image/image.d.ts +2 -2
- package/dist/widgets/image/utils.d.ts +15 -0
- package/dist/widgets/interactive-graphs/interactive-graph.d.ts +0 -1
- package/dist/widgets/matcher/matcher.d.ts +0 -1
- package/dist/widgets/mock-widgets/mock-widget.d.ts +0 -1
- package/dist/widgets/numeric-input/numeric-input.class.d.ts +0 -1
- package/dist/widgets/plotter/plotter.d.ts +0 -1
- package/dist/widgets/radio/multiple-choice-widget.new.d.ts +2 -1
- package/dist/widgets/radio/radio-component.d.ts +2 -1
- package/dist/widgets/radio/radio.ff.d.ts +1 -1
- package/dist/widgets/radio/utils/string-utils.d.ts +0 -1
- package/dist/widgets/table/table.d.ts +3 -5
- package/package.json +10 -10
- package/dist/widgets/image/image-description-and-caption.d.ts +0 -12
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const earthMoonImage: {
|
|
2
|
+
url: string;
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const frescoImage: {
|
|
7
|
+
url: string;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
};
|
|
11
|
+
export declare const monasteryImage: {
|
|
12
|
+
url: string;
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
};
|
|
@@ -214,7 +214,6 @@ declare class InteractiveGraph extends React.Component<Props, State> {
|
|
|
214
214
|
findWidgets: (criterion: import("../../types").FilterCriterion) => ReadonlyArray<import("../../types").Widget>;
|
|
215
215
|
reviewMode: boolean;
|
|
216
216
|
showSolutions?: import("@khanacademy/perseus-core").ShowSolutions;
|
|
217
|
-
onChange: import("../..").ChangeHandler;
|
|
218
217
|
handleUserInput: (newUserInput: PerseusGraphType, cb?: () => void, silent?: boolean) => void;
|
|
219
218
|
isLastUsedWidget: boolean;
|
|
220
219
|
linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
|
|
@@ -97,7 +97,6 @@ declare class MockWidgetComponent extends React.Component<Props> implements Widg
|
|
|
97
97
|
findWidgets: (criterion: import("../../types").FilterCriterion) => ReadonlyArray<Widget>;
|
|
98
98
|
reviewMode: boolean;
|
|
99
99
|
showSolutions?: import("@khanacademy/perseus-core").ShowSolutions;
|
|
100
|
-
onChange: import("../..").ChangeHandler;
|
|
101
100
|
handleUserInput: (newUserInput: PerseusMockWidgetUserInput, cb?: () => void, silent?: boolean) => void;
|
|
102
101
|
isLastUsedWidget: boolean;
|
|
103
102
|
linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
|
|
@@ -104,7 +104,6 @@ export declare class NumericInput extends React.Component<NumericInputProps> imp
|
|
|
104
104
|
findWidgets: (criterion: import("../../types").FilterCriterion) => ReadonlyArray<Widget>;
|
|
105
105
|
reviewMode: boolean;
|
|
106
106
|
showSolutions?: import("@khanacademy/perseus-core").ShowSolutions;
|
|
107
|
-
onChange: import("../..").ChangeHandler;
|
|
108
107
|
handleUserInput: (newUserInput: PerseusNumericInputUserInput, cb?: () => void, silent?: boolean) => void;
|
|
109
108
|
isLastUsedWidget: boolean;
|
|
110
109
|
linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
|
|
@@ -151,7 +151,6 @@ export declare class Plotter extends React.Component<Props, State> implements Wi
|
|
|
151
151
|
findWidgets: (criterion: import("../../types").FilterCriterion) => ReadonlyArray<Widget>;
|
|
152
152
|
reviewMode: boolean;
|
|
153
153
|
showSolutions?: import("@khanacademy/perseus-core").ShowSolutions;
|
|
154
|
-
onChange: import("../..").ChangeHandler;
|
|
155
154
|
handleUserInput: (newUserInput: PerseusPlotterUserInput, cb?: () => void, silent?: boolean) => void;
|
|
156
155
|
isLastUsedWidget: boolean;
|
|
157
156
|
linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type { ChoiceState, Widget } from "../../types";
|
|
2
|
+
import type { ChoiceState, Widget, ChangeHandler } from "../../types";
|
|
3
3
|
import type { PerseusRadioChoice, PerseusRadioRubric, PerseusRadioUserInput } from "@khanacademy/perseus-core";
|
|
4
4
|
/**
|
|
5
5
|
* Represents a single choice in the MultipleChoiceComponent
|
|
@@ -28,6 +28,7 @@ export type RadioProps = {
|
|
|
28
28
|
choiceStates?: ReadonlyArray<ChoiceState>;
|
|
29
29
|
editMode?: boolean;
|
|
30
30
|
labelWrap?: boolean;
|
|
31
|
+
onChange: ChangeHandler;
|
|
31
32
|
};
|
|
32
33
|
/**
|
|
33
34
|
* RadioChoiceWithMetadata is used for server-side scoring
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
3
3
|
import type { FocusFunction } from "./base-radio";
|
|
4
|
-
import type { WidgetProps, ChoiceState, Widget } from "../../types";
|
|
4
|
+
import type { WidgetProps, ChoiceState, Widget, ChangeHandler } from "../../types";
|
|
5
5
|
import type { RadioPromptJSON } from "../../widget-ai-utils/radio/radio-ai-utils";
|
|
6
6
|
import type { PerseusRadioChoice, ShowSolutions, PerseusRadioRubric, PerseusRadioUserInput, PerseusRadioWidgetOptions } from "@khanacademy/perseus-core";
|
|
7
7
|
export type RadioProps = PerseusRadioWidgetOptions & {
|
|
@@ -13,6 +13,7 @@ export type RadioProps = PerseusRadioWidgetOptions & {
|
|
|
13
13
|
choices: RadioChoiceWithMetadata[];
|
|
14
14
|
showSolutions?: ShowSolutions;
|
|
15
15
|
choiceStates?: ChoiceState[];
|
|
16
|
+
onChange: ChangeHandler;
|
|
16
17
|
};
|
|
17
18
|
export type Props = WidgetProps<RadioProps, PerseusRadioUserInput, PerseusRadioRubric>;
|
|
18
19
|
type DefaultProps = Required<Pick<Props, "choices" | "multipleSelect" | "countChoices" | "deselectEnabled" | "linterContext" | "showSolutions">>;
|
|
@@ -37,6 +37,7 @@ declare class Radio extends RadioOld {
|
|
|
37
37
|
deselectEnabled?: boolean;
|
|
38
38
|
showSolutions?: import("@khanacademy/perseus-core").ShowSolutions;
|
|
39
39
|
choiceStates?: ChoiceState[];
|
|
40
|
+
onChange: import("../..").ChangeHandler;
|
|
40
41
|
reviewModeRubric?: PerseusRadioRubric | null | undefined;
|
|
41
42
|
trackInteraction: (extraData?: Empty | undefined) => void;
|
|
42
43
|
widgetId: string;
|
|
@@ -97,7 +98,6 @@ declare class Radio extends RadioOld {
|
|
|
97
98
|
onBlur: (blurPath: import("../..").FocusPath) => void;
|
|
98
99
|
findWidgets: (criterion: import("../../types").FilterCriterion) => ReadonlyArray<import("../../types").Widget>;
|
|
99
100
|
reviewMode: boolean;
|
|
100
|
-
onChange: import("../..").ChangeHandler;
|
|
101
101
|
handleUserInput: (newUserInput: PerseusRadioUserInput, cb?: () => void, silent?: boolean) => void;
|
|
102
102
|
isLastUsedWidget: boolean;
|
|
103
103
|
linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
|
|
@@ -60,7 +60,6 @@ interface GetA11yTextProps {
|
|
|
60
60
|
* @param letter - The letter for the choice.
|
|
61
61
|
* @param checked - Whether the choice is checked.
|
|
62
62
|
* @param correct - Whether the choice is correct.
|
|
63
|
-
* @param crossedOut - Whether the choice is crossed out.
|
|
64
63
|
* @param showCorrectness - Whether the correctness is shown.
|
|
65
64
|
* @param strings - The strings for the Radio widget.
|
|
66
65
|
* @returns The a11y string for the Radio option.
|
|
@@ -6,6 +6,7 @@ import type { PerseusTableWidgetOptions, PerseusTableUserInput } from "@khanacad
|
|
|
6
6
|
type EditorProps = {
|
|
7
7
|
editableHeaders: boolean;
|
|
8
8
|
Editor: any;
|
|
9
|
+
onChange: (headers: PerseusTableWidgetOptions["headers"]) => void;
|
|
9
10
|
};
|
|
10
11
|
type Props = WidgetProps<PerseusTableWidgetOptions, PerseusTableUserInput> & EditorProps;
|
|
11
12
|
type DefaultProps = {
|
|
@@ -52,10 +53,7 @@ declare class Table extends React.Component<Props> implements Widget {
|
|
|
52
53
|
problemNum: number | null | undefined;
|
|
53
54
|
apiOptions: Readonly<Readonly<{
|
|
54
55
|
isArticle?: boolean;
|
|
55
|
-
onFocusChange?: (newFocusPath: FocusPath, oldFocusPath: FocusPath, keypadHeight
|
|
56
|
-
* @deprecated and likely very broken API
|
|
57
|
-
* [LEMS-3185] do not trust serializedState
|
|
58
|
-
*/: number, focusedElement?: HTMLElement) => unknown;
|
|
56
|
+
onFocusChange?: (newFocusPath: FocusPath, oldFocusPath: FocusPath, keypadHeight?: number, focusedElement?: HTMLElement) => unknown;
|
|
59
57
|
GroupMetadataEditor?: React.ComponentType<any>;
|
|
60
58
|
showAlignmentOptions?: boolean;
|
|
61
59
|
readOnly?: boolean;
|
|
@@ -107,12 +105,12 @@ declare class Table extends React.Component<Props> implements Widget {
|
|
|
107
105
|
findWidgets: (criterion: import("../../types").FilterCriterion) => ReadonlyArray<Widget>;
|
|
108
106
|
reviewMode: boolean;
|
|
109
107
|
showSolutions?: import("@khanacademy/perseus-core").ShowSolutions;
|
|
110
|
-
onChange: import("../..").ChangeHandler;
|
|
111
108
|
handleUserInput: (newUserInput: PerseusTableUserInput, cb?: () => void, silent?: boolean) => void;
|
|
112
109
|
isLastUsedWidget: boolean;
|
|
113
110
|
linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
|
|
114
111
|
containerSizeClass: import("../../util/sizing-utils").SizeClass;
|
|
115
112
|
Editor: any;
|
|
113
|
+
onChange: (headers: PerseusTableWidgetOptions["headers"]) => void;
|
|
116
114
|
};
|
|
117
115
|
render(): React.ReactNode;
|
|
118
116
|
}
|
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": "69.0
|
|
6
|
+
"version": "69.2.0",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"mafs": "0.19.0",
|
|
42
42
|
"tiny-invariant": "1.3.1",
|
|
43
43
|
"uuid": "^10.0.0",
|
|
44
|
-
"@khanacademy/kas": "2.1.
|
|
45
|
-
"@khanacademy/keypad-context": "3.2.
|
|
46
|
-
"@khanacademy/kmath": "2.2.
|
|
47
|
-
"@khanacademy/math-input": "26.2.
|
|
48
|
-
"@khanacademy/perseus-core": "19.0
|
|
49
|
-
"@khanacademy/perseus-
|
|
50
|
-
"@khanacademy/perseus-
|
|
44
|
+
"@khanacademy/kas": "2.1.1",
|
|
45
|
+
"@khanacademy/keypad-context": "3.2.7",
|
|
46
|
+
"@khanacademy/kmath": "2.2.7",
|
|
47
|
+
"@khanacademy/math-input": "26.2.7",
|
|
48
|
+
"@khanacademy/perseus-core": "19.2.0",
|
|
49
|
+
"@khanacademy/perseus-linter": "4.3.7",
|
|
50
|
+
"@khanacademy/perseus-score": "7.7.7",
|
|
51
51
|
"@khanacademy/perseus-utils": "2.1.0",
|
|
52
52
|
"@khanacademy/pure-markdown": "2.2.0",
|
|
53
53
|
"@khanacademy/simple-markdown": "2.1.0"
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@khanacademy/wonder-blocks-labeled-field": "4.0.5",
|
|
66
66
|
"@khanacademy/wonder-blocks-layout": "3.1.36",
|
|
67
67
|
"@khanacademy/wonder-blocks-link": "9.2.3",
|
|
68
|
-
"@khanacademy/wonder-blocks-modal": "8.
|
|
68
|
+
"@khanacademy/wonder-blocks-modal": "8.4.2",
|
|
69
69
|
"@khanacademy/wonder-blocks-pill": "3.1.40",
|
|
70
70
|
"@khanacademy/wonder-blocks-popover": "6.1.32",
|
|
71
71
|
"@khanacademy/wonder-blocks-progress-spinner": "3.1.36",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"@khanacademy/wonder-blocks-labeled-field": "^4.0.5",
|
|
104
104
|
"@khanacademy/wonder-blocks-layout": "^3.1.36",
|
|
105
105
|
"@khanacademy/wonder-blocks-link": "^9.2.3",
|
|
106
|
-
"@khanacademy/wonder-blocks-modal": "^8.
|
|
106
|
+
"@khanacademy/wonder-blocks-modal": "^8.4.2",
|
|
107
107
|
"@khanacademy/wonder-blocks-pill": "^3.1.40",
|
|
108
108
|
"@khanacademy/wonder-blocks-popover": "^6.1.32",
|
|
109
109
|
"@khanacademy/wonder-blocks-progress-spinner": "^3.1.36",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import type { APIOptions } from "../../types";
|
|
3
|
-
import type { PerseusImageBackground } from "@khanacademy/perseus-core";
|
|
4
|
-
import type { LinterContextProps } from "@khanacademy/perseus-linter";
|
|
5
|
-
interface Props {
|
|
6
|
-
caption: string;
|
|
7
|
-
backgroundImage: PerseusImageBackground;
|
|
8
|
-
apiOptions: APIOptions;
|
|
9
|
-
linterContext: LinterContextProps;
|
|
10
|
-
}
|
|
11
|
-
export declare const ImageDescriptionAndCaption: ({ caption, backgroundImage, apiOptions, linterContext, }: Props) => React.JSX.Element;
|
|
12
|
-
export {};
|