@khanacademy/perseus 65.7.0 → 65.8.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/math-input.d.ts +0 -1
- package/dist/es/index.css +1 -1
- package/dist/es/index.css.map +1 -1
- package/dist/es/index.js +13 -13
- package/dist/es/index.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +15 -15
- package/dist/index.js.map +1 -1
- package/dist/perseus-markdown.d.ts +1 -1
- package/dist/widgets/expression/expression.d.ts +1 -10
- package/dist/widgets/grapher/grapher.d.ts +2 -0
- package/dist/widgets/radio/choice-indicator.new.d.ts +11 -0
- package/dist/widgets/radio/multiple-choice-option.new.d.ts +11 -0
- package/dist/widgets/radio/radio.ff.d.ts +1 -0
- package/package.json +8 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
characterCount: (source: string) => number;
|
|
3
|
-
traverseContent: (ast: any, cb: (
|
|
3
|
+
traverseContent: (ast: any, cb: (node: any) => void) => void;
|
|
4
4
|
parse: (source: string, state: any) => any;
|
|
5
5
|
parseInline: (source: string, state: any) => any;
|
|
6
6
|
reactFor: (arg1: import("@khanacademy/simple-markdown").ReactNodeOutput) => import("@khanacademy/simple-markdown").ReactOutput;
|
|
@@ -26,11 +26,6 @@ type Props = ExternalProps & Partial<React.ContextType<typeof DependenciesContex
|
|
|
26
26
|
visibleLabel: PerseusExpressionWidgetOptions["visibleLabel"];
|
|
27
27
|
ariaLabel: PerseusExpressionWidgetOptions["ariaLabel"];
|
|
28
28
|
};
|
|
29
|
-
type ExpressionState = {
|
|
30
|
-
invalid: boolean;
|
|
31
|
-
showErrorTooltip: boolean;
|
|
32
|
-
showErrorStyle: boolean;
|
|
33
|
-
};
|
|
34
29
|
type DefaultProps = {
|
|
35
30
|
apiOptions: Props["apiOptions"];
|
|
36
31
|
buttonSets: Props["buttonSets"];
|
|
@@ -41,25 +36,21 @@ type DefaultProps = {
|
|
|
41
36
|
times: Props["times"];
|
|
42
37
|
userInput: Props["userInput"];
|
|
43
38
|
};
|
|
44
|
-
export declare class Expression extends React.Component<Props
|
|
39
|
+
export declare class Expression extends React.Component<Props> implements Widget {
|
|
45
40
|
static contextType: React.Context<import("../../components/i18n-context").I18nContextType>;
|
|
46
41
|
context: React.ContextType<typeof PerseusI18nContext>;
|
|
47
42
|
_textareaId: string;
|
|
48
43
|
_isMounted: boolean;
|
|
49
44
|
static defaultProps: DefaultProps;
|
|
50
45
|
displayName: string;
|
|
51
|
-
state: ExpressionState;
|
|
52
46
|
componentDidMount: () => void;
|
|
53
|
-
componentDidUpdate: (prevProps: Props) => void;
|
|
54
47
|
componentWillUnmount: () => void;
|
|
55
|
-
_handleMouseDown: () => void;
|
|
56
48
|
/**
|
|
57
49
|
* TODO: remove this when everything is pulling from Renderer state
|
|
58
50
|
* @deprecated get user input from Renderer state
|
|
59
51
|
*/
|
|
60
52
|
getUserInput(): PerseusExpressionUserInput;
|
|
61
53
|
getPromptJSON(): ExpressionPromptJSON;
|
|
62
|
-
parse: (value: string, props: Props) => any;
|
|
63
54
|
changeAndTrack: (userInput: string, cb: () => void) => void;
|
|
64
55
|
_handleFocus: () => void;
|
|
65
56
|
_handleBlur: () => void;
|
|
@@ -158,6 +158,7 @@ declare function staticTransform(options: PerseusGrapherWidgetOptions): {
|
|
|
158
158
|
*/
|
|
159
159
|
declare function getUserInputFromSerializedState(serializedState: any): PerseusGrapherUserInput;
|
|
160
160
|
declare function getStartUserInput(options: GrapherPublicWidgetOptions): PerseusGrapherUserInput;
|
|
161
|
+
declare function getCorrectUserInput(options: PerseusGrapherWidgetOptions): PerseusGrapherUserInput;
|
|
161
162
|
declare const _default: {
|
|
162
163
|
name: string;
|
|
163
164
|
displayName: string;
|
|
@@ -167,5 +168,6 @@ declare const _default: {
|
|
|
167
168
|
staticTransform: typeof staticTransform;
|
|
168
169
|
getUserInputFromSerializedState: typeof getUserInputFromSerializedState;
|
|
169
170
|
getStartUserInput: typeof getStartUserInput;
|
|
171
|
+
getCorrectUserInput: typeof getCorrectUserInput;
|
|
170
172
|
};
|
|
171
173
|
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type IndicatorProps = {
|
|
3
|
+
buttonRef: React.Ref<HTMLButtonElement>;
|
|
4
|
+
checked: boolean;
|
|
5
|
+
content: string;
|
|
6
|
+
shape: "circle" | "square";
|
|
7
|
+
showCorrectness?: "correct" | "wrong";
|
|
8
|
+
updateChecked: (isChecked: boolean) => void;
|
|
9
|
+
};
|
|
10
|
+
declare const Indicator: (props: IndicatorProps) => React.JSX.Element;
|
|
11
|
+
export default Indicator;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface IndicatorProps {
|
|
3
|
+
checked: boolean;
|
|
4
|
+
children: React.ReactNode | React.ReactNode[];
|
|
5
|
+
indicatorContent: string;
|
|
6
|
+
isMultiSelect: boolean;
|
|
7
|
+
showCorrectness?: "correct" | "wrong";
|
|
8
|
+
updateChecked: (isChecked: boolean) => void;
|
|
9
|
+
}
|
|
10
|
+
declare const Choice: (props: IndicatorProps) => React.JSX.Element;
|
|
11
|
+
export default Choice;
|
|
@@ -22,6 +22,7 @@ declare class Radio extends RadioOld {
|
|
|
22
22
|
radioRef: React.RefObject<RadioOld>;
|
|
23
23
|
state: State;
|
|
24
24
|
constructor(props: Props);
|
|
25
|
+
UNSAFE_componentWillUpdate(nextProps: Props): void;
|
|
25
26
|
/**
|
|
26
27
|
* @deprecated and likely very broken API
|
|
27
28
|
* [LEMS-3185] do not trust serializedState/restoreSerializedState
|
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": "65.
|
|
6
|
+
"version": "65.8.0",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -42,14 +42,14 @@
|
|
|
42
42
|
"tiny-invariant": "1.3.1",
|
|
43
43
|
"uuid": "^10.0.0",
|
|
44
44
|
"@khanacademy/kas": "2.0.9",
|
|
45
|
-
"@khanacademy/keypad-context": "3.0.
|
|
46
|
-
"@khanacademy/kmath": "2.0.
|
|
47
|
-
"@khanacademy/math-input": "26.0.
|
|
48
|
-
"@khanacademy/perseus-core": "18.
|
|
49
|
-
"@khanacademy/perseus-linter": "4.0
|
|
50
|
-
"@khanacademy/perseus-score": "7.1.
|
|
45
|
+
"@khanacademy/keypad-context": "3.0.27",
|
|
46
|
+
"@khanacademy/kmath": "2.0.27",
|
|
47
|
+
"@khanacademy/math-input": "26.0.16",
|
|
48
|
+
"@khanacademy/perseus-core": "18.2.0",
|
|
49
|
+
"@khanacademy/perseus-linter": "4.1.0",
|
|
50
|
+
"@khanacademy/perseus-score": "7.1.14",
|
|
51
51
|
"@khanacademy/perseus-utils": "2.0.5",
|
|
52
|
-
"@khanacademy/pure-markdown": "2.0
|
|
52
|
+
"@khanacademy/pure-markdown": "2.1.0",
|
|
53
53
|
"@khanacademy/simple-markdown": "2.0.10"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|