@khanacademy/perseus 82.2.0 → 83.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/components.d.ts +0 -2
- package/dist/es/index.css +2 -2
- package/dist/es/index.css.map +1 -1
- package/dist/es/index.js +67 -80
- package/dist/es/index.js.map +1 -1
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/index.js +69 -82
- package/dist/index.js.map +1 -1
- package/dist/styles/constants.d.ts +2 -7
- package/dist/widgets/interaction/interaction.d.ts +2 -2
- package/dist/widgets/measurer/measurer.d.ts +1 -4
- package/dist/widgets/table/table.d.ts +17 -56
- package/package.json +9 -8
- package/dist/components/info-tip/index.d.ts +0 -19
- package/dist/components/info-tip/info-tip-base.d.ts +0 -6
- package/dist/components/text-list-editor.d.ts +0 -15
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
export declare const baseFontFamily = "'Lato', sans-serif";
|
|
2
2
|
export declare const boldFontFamily = "'Lato-Bold', 'Lato', sans-serif";
|
|
3
|
-
export declare const kaGreen = "#71B307";
|
|
4
3
|
export declare const white = "#FFFFFF";
|
|
5
|
-
export declare const gray97 = "#F6F7F7";
|
|
6
|
-
export declare const gray85 = "#D6D8DA";
|
|
7
4
|
export declare const gray76 = "#BABEC2";
|
|
8
5
|
export declare const gray68 = "#888D93";
|
|
9
6
|
export declare const gray17 = "#21242c";
|
|
@@ -17,8 +14,8 @@ export declare const pureMdMax = "1023px";
|
|
|
17
14
|
export declare const pureLgMax = "1279px";
|
|
18
15
|
export declare const phoneMargin = 16;
|
|
19
16
|
export declare const negativePhoneMargin = -16;
|
|
20
|
-
export declare const hintBorderWidth
|
|
21
|
-
export declare const
|
|
17
|
+
export declare const hintBorderWidth: string;
|
|
18
|
+
export declare const hintPaddingInlineStart: string;
|
|
22
19
|
export declare const interactiveSizes: {
|
|
23
20
|
readonly defaultBoxSize: 400;
|
|
24
21
|
readonly defaultBoxSizeSmall: 288;
|
|
@@ -29,7 +26,5 @@ export declare const warningColor = "#f86700";
|
|
|
29
26
|
export declare const warningColorHover = "#df5c00";
|
|
30
27
|
export declare const warningColorActive = "#c75300";
|
|
31
28
|
export declare const publishBlockingErrorColor = "#be2612";
|
|
32
|
-
export declare const radioBorderColor = "#BABEC2";
|
|
33
|
-
export declare const checkedColor = "#71B307";
|
|
34
29
|
export declare const articleMaxWidthInPx = 688;
|
|
35
30
|
export declare const articleMaxWidthTableInPx = 512;
|
|
@@ -18,9 +18,9 @@ declare class Interaction extends React.Component<Props, State> implements Widge
|
|
|
18
18
|
state: State;
|
|
19
19
|
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
20
20
|
_setupGraphie: (arg1: any, arg2: any) => void;
|
|
21
|
-
_updatePointLocation: (arg1:
|
|
21
|
+
_updatePointLocation: (arg1: number, arg2: Coord) => void;
|
|
22
22
|
_updateLineLocation: (arg1: any, arg2: Coord) => void;
|
|
23
|
-
_eval: (arg1: any, arg2
|
|
23
|
+
_eval: (arg1: any, arg2?: any) => number;
|
|
24
24
|
_extractVars: (arg1: any) => ReadonlyArray<any>;
|
|
25
25
|
getPromptJSON(): UnsupportedWidgetPromptJSON;
|
|
26
26
|
render(): React.ReactNode;
|
|
@@ -2,10 +2,7 @@ import { type PerseusMeasurerWidgetOptions } from "@khanacademy/perseus-core";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import type { Widget, WidgetProps } from "../../types";
|
|
4
4
|
import type { UnsupportedWidgetPromptJSON } from "../../widget-ai-utils/unsupported-widget";
|
|
5
|
-
type Props = WidgetProps<PerseusMeasurerWidgetOptions
|
|
6
|
-
protractorX: number;
|
|
7
|
-
protractorY: number;
|
|
8
|
-
};
|
|
5
|
+
type Props = WidgetProps<PerseusMeasurerWidgetOptions>;
|
|
9
6
|
declare class Measurer extends React.Component<Props> implements Widget {
|
|
10
7
|
isWidget: true;
|
|
11
8
|
ruler: any;
|
|
@@ -1,49 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { PerseusI18nContext } from "../../components/i18n-context";
|
|
4
|
-
import type { FocusPath, Widget, WidgetProps } from "../../types";
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { FocusPath, Widget } from "../../types";
|
|
5
3
|
import type { PerseusTableWidgetOptions, PerseusTableUserInput } from "@khanacademy/perseus-core";
|
|
6
4
|
type EditorProps = {
|
|
7
|
-
editableHeaders
|
|
5
|
+
editableHeaders?: boolean;
|
|
8
6
|
Editor: any;
|
|
9
|
-
onChange: (
|
|
10
|
-
};
|
|
11
|
-
type Props = WidgetProps<PerseusTableWidgetOptions, PerseusTableUserInput> & EditorProps;
|
|
12
|
-
type DefaultProps = {
|
|
13
|
-
apiOptions: Props["apiOptions"];
|
|
14
|
-
headers: Props["headers"];
|
|
15
|
-
editableHeaders: Props["editableHeaders"];
|
|
16
|
-
rows: Props["rows"];
|
|
17
|
-
columns: Props["columns"];
|
|
18
|
-
linterContext: Props["linterContext"];
|
|
19
|
-
};
|
|
20
|
-
declare class Table extends React.Component<Props> implements Widget {
|
|
21
|
-
static contextType: React.Context<import("../../components/i18n-context").I18nContextType>;
|
|
22
|
-
context: React.ContextType<typeof PerseusI18nContext>;
|
|
23
|
-
headerRefs: Record<string, any>;
|
|
24
|
-
answerRefs: Record<string, any>;
|
|
25
|
-
static defaultProps: DefaultProps;
|
|
26
|
-
_getRows(): number;
|
|
27
|
-
_getColumns(): number;
|
|
28
|
-
_getAnswersClone(): PerseusTableUserInput;
|
|
29
|
-
onValueChange(row: number, column: number, eventOrValue: any): void;
|
|
30
|
-
onHeaderChange(index: number, e: any): void;
|
|
31
|
-
_handleFocus(inputPath: any): void;
|
|
32
|
-
_handleBlur(inputPath: any): void;
|
|
33
|
-
focus(): boolean;
|
|
34
|
-
focusInputPath(path: FocusPath): void;
|
|
35
|
-
blurInputPath(path: FocusPath): void;
|
|
36
|
-
getDOMNodeForPath(path: FocusPath): ReturnType<typeof ReactDOM.findDOMNode>;
|
|
37
|
-
getInputPaths(): string[][];
|
|
38
|
-
/**
|
|
39
|
-
* @deprecated and likely very broken API
|
|
40
|
-
* [LEMS-3185] do not trust serializedState
|
|
41
|
-
*/
|
|
42
|
-
getSerializedState(): {
|
|
43
|
-
answers: PerseusTableUserInput;
|
|
7
|
+
onChange: (value: {
|
|
44
8
|
headers: string[];
|
|
45
|
-
|
|
46
|
-
|
|
9
|
+
}) => void;
|
|
10
|
+
};
|
|
11
|
+
declare function getStartUserInput(options: PerseusTableWidgetOptions): PerseusTableUserInput;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated - do not use in new code.
|
|
14
|
+
*/
|
|
15
|
+
declare function getUserInputFromSerializedState(serializedState: any): PerseusTableUserInput;
|
|
16
|
+
declare const _default: {
|
|
17
|
+
name: string;
|
|
18
|
+
displayName: string;
|
|
19
|
+
widget: React.ForwardRefExoticComponent<PerseusTableWidgetOptions & {
|
|
47
20
|
trackInteraction: (extraData?: Empty | undefined) => void;
|
|
48
21
|
widgetId: string;
|
|
49
22
|
widgetIndex: number;
|
|
@@ -96,22 +69,10 @@ declare class Table extends React.Component<Props> implements Widget {
|
|
|
96
69
|
reviewMode: boolean;
|
|
97
70
|
showSolutions?: import("@khanacademy/perseus-core").ShowSolutions;
|
|
98
71
|
handleUserInput: (newUserInput: PerseusTableUserInput, cb?: () => void, silent?: boolean) => void;
|
|
72
|
+
userInput: PerseusTableUserInput;
|
|
99
73
|
linterContext: import("@khanacademy/perseus-linter").LinterContextProps;
|
|
100
74
|
containerSizeClass: import("../../util/sizing-utils").SizeClass;
|
|
101
|
-
|
|
102
|
-
onChange: (headers: PerseusTableWidgetOptions["headers"]) => void;
|
|
103
|
-
};
|
|
104
|
-
render(): React.ReactNode;
|
|
105
|
-
}
|
|
106
|
-
declare function getStartUserInput(options: PerseusTableWidgetOptions): PerseusTableUserInput;
|
|
107
|
-
/**
|
|
108
|
-
* @deprecated - do not use in new code.
|
|
109
|
-
*/
|
|
110
|
-
declare function getUserInputFromSerializedState(serializedState: any): PerseusTableUserInput;
|
|
111
|
-
declare const _default: {
|
|
112
|
-
name: string;
|
|
113
|
-
displayName: string;
|
|
114
|
-
widget: typeof Table;
|
|
75
|
+
} & EditorProps & React.RefAttributes<Widget>>;
|
|
115
76
|
hidden: true;
|
|
116
77
|
isLintable: true;
|
|
117
78
|
getStartUserInput: typeof getStartUserInput;
|
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": "83.0.0",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -37,18 +37,19 @@
|
|
|
37
37
|
"dist"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
+
"@dnd-kit/react": "^0.5.0",
|
|
40
41
|
"@use-gesture/react": "^10.2.27",
|
|
41
42
|
"gifuct-js": "^2.1.2",
|
|
42
43
|
"mafs": "0.19.0",
|
|
43
44
|
"tiny-invariant": "1.3.1",
|
|
44
45
|
"uuid": "^10.0.0",
|
|
45
|
-
"@khanacademy/kas": "2.2.
|
|
46
|
-
"@khanacademy/keypad-context": "3.2.
|
|
47
|
-
"@khanacademy/kmath": "2.4.
|
|
48
|
-
"@khanacademy/math-input": "26.6.
|
|
49
|
-
"@khanacademy/perseus-core": "34.0.
|
|
50
|
-
"@khanacademy/perseus-linter": "5.1.
|
|
51
|
-
"@khanacademy/perseus-score": "8.12.
|
|
46
|
+
"@khanacademy/kas": "2.2.5",
|
|
47
|
+
"@khanacademy/keypad-context": "3.2.79",
|
|
48
|
+
"@khanacademy/kmath": "2.4.38",
|
|
49
|
+
"@khanacademy/math-input": "26.6.8",
|
|
50
|
+
"@khanacademy/perseus-core": "34.0.1",
|
|
51
|
+
"@khanacademy/perseus-linter": "5.1.19",
|
|
52
|
+
"@khanacademy/perseus-score": "8.12.11",
|
|
52
53
|
"@khanacademy/perseus-utils": "2.1.5",
|
|
53
54
|
"@khanacademy/pure-markdown": "2.3.1",
|
|
54
55
|
"@khanacademy/simple-markdown": "3.0.0"
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A wrapper around info-tip/info-tip.jsx that can be rendered on the
|
|
3
|
-
* server without causing a checksum mismatch on the client.
|
|
4
|
-
* (RCSS generates classnames with a randomSuffix, which ensures that any
|
|
5
|
-
* two sets of generated classnames will not match.)
|
|
6
|
-
*/
|
|
7
|
-
import * as React from "react";
|
|
8
|
-
import InfoTipBase from "./info-tip-base";
|
|
9
|
-
import type { PropsFor } from "@khanacademy/wonder-blocks-core";
|
|
10
|
-
type Props = PropsFor<typeof InfoTipBase>;
|
|
11
|
-
type State = {
|
|
12
|
-
didMount: boolean;
|
|
13
|
-
};
|
|
14
|
-
declare class InfoTip extends React.Component<Props, State> {
|
|
15
|
-
state: State;
|
|
16
|
-
componentDidMount(): void;
|
|
17
|
-
render(): React.ReactNode;
|
|
18
|
-
}
|
|
19
|
-
export default InfoTip;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
declare class TextListEditor extends React.Component<any, any> {
|
|
3
|
-
static propTypes: {
|
|
4
|
-
options: any;
|
|
5
|
-
layout: any;
|
|
6
|
-
onChange: any;
|
|
7
|
-
};
|
|
8
|
-
static defaultProps: any;
|
|
9
|
-
state: any;
|
|
10
|
-
UNSAFE_componentWillReceiveProps(nextProps: any): void;
|
|
11
|
-
onChange: (arg1: number, arg2: React.ChangeEvent<HTMLInputElement>) => void;
|
|
12
|
-
onKeyDown: (arg1: number, arg2: React.KeyboardEvent) => void;
|
|
13
|
-
render(): React.ReactNode;
|
|
14
|
-
}
|
|
15
|
-
export default TextListEditor;
|