@khanacademy/perseus-editor 28.8.1 → 28.8.3
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/article-editor.d.ts +4 -4
- package/dist/editor.d.ts +0 -1
- package/dist/es/index.js +25 -23
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +31 -29
- package/dist/index.js.map +1 -1
- package/dist/messages.d.ts +1 -0
- package/dist/preview/message-types.d.ts +4 -4
- package/dist/util/tex-error-detector.d.ts +14 -0
- package/dist/widgets/interactive-graph-editor/locked-figures/util.d.ts +1 -9
- package/dist/widgets/label-image-editor/answer-choices.d.ts +1 -1
- package/dist/widgets/label-image-editor/marker.d.ts +6 -5
- package/dist/widgets/label-image-editor/question-markers.d.ts +2 -3
- package/dist/widgets/label-image-editor/select-image.d.ts +2 -2
- package/package.json +41 -41
package/dist/messages.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ import type { Issue } from "./components/issues-panel";
|
|
|
2
2
|
export declare const WARNINGS: {
|
|
3
3
|
inaccessibleWidget: (widgetType: string, widgetId: string) => Issue;
|
|
4
4
|
genericLinterWarning: (rule: string, message: string, severity: number | undefined) => Issue;
|
|
5
|
+
texError: (math: string, errorMessage: string, index: number) => Issue;
|
|
5
6
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* the preview iframe.
|
|
4
4
|
*/
|
|
5
5
|
import type { APIOptions, DeviceType } from "@khanacademy/perseus";
|
|
6
|
-
import type { Hint,
|
|
6
|
+
import type { Hint, PerseusArticle, PerseusItem } from "@khanacademy/perseus-core";
|
|
7
7
|
import type { LinterContextProps } from "@khanacademy/perseus-linter";
|
|
8
8
|
/**
|
|
9
9
|
* Constant identifier for all Perseus preview messages
|
|
@@ -43,10 +43,10 @@ export type HintPreviewData = {
|
|
|
43
43
|
* Data for article section preview
|
|
44
44
|
*/
|
|
45
45
|
export type ArticlePreviewData = {
|
|
46
|
-
content: string;
|
|
47
|
-
widgets: PerseusRenderer["widgets"];
|
|
48
|
-
images: PerseusRenderer["images"];
|
|
49
46
|
apiOptions: APIOptions;
|
|
47
|
+
json: PerseusArticle;
|
|
48
|
+
linterContext: LinterContextProps;
|
|
49
|
+
legacyPerseusLint?: ReadonlyArray<string>;
|
|
50
50
|
};
|
|
51
51
|
/**
|
|
52
52
|
* Union of all preview content types
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "../katex-mhchem";
|
|
2
|
+
type TexError = {
|
|
3
|
+
math: string;
|
|
4
|
+
message: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Detects TeX rendering errors in markdown content by parsing the content
|
|
8
|
+
* and attempting to render each math expression with KaTeX.
|
|
9
|
+
*
|
|
10
|
+
* @param content - The markdown content to check for TeX errors
|
|
11
|
+
* @returns An array of TeX errors found in the content
|
|
12
|
+
*/
|
|
13
|
+
export declare function detectTexErrors(content: string): TexError[];
|
|
14
|
+
export {};
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export declare function getDefaultFigureForType(type: "point"): LockedPointType;
|
|
3
|
-
export declare function getDefaultFigureForType(type: "line"): LockedLineType;
|
|
4
|
-
export declare function getDefaultFigureForType(type: "vector"): LockedVectorType;
|
|
5
|
-
export declare function getDefaultFigureForType(type: "ellipse"): LockedEllipseType;
|
|
6
|
-
export declare function getDefaultFigureForType(type: "polygon"): LockedPolygonType;
|
|
7
|
-
export declare function getDefaultFigureForType(type: "function"): LockedFunctionType;
|
|
8
|
-
export declare function getDefaultFigureForType(type: "label"): LockedLabelType;
|
|
9
|
-
export declare function getDefaultFigureForType(type: LockedFigureType): LockedFigure;
|
|
1
|
+
import { type LockedFigureColor, type LockedFigureFillType, type LockedLabelType, type LockedLineStyle, type StrokeWeight } from "@khanacademy/perseus-core";
|
|
10
2
|
export declare function generateLockedFigureAppearanceDescription(color: LockedFigureColor, strokeStyle?: LockedLineStyle, fill?: LockedFigureFillType, weight?: StrokeWeight): string;
|
|
11
3
|
/**
|
|
12
4
|
* Given a string that may contain math within TeX represented by $...$,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Controlled list of answer choices, handles adding and removing answers.
|
|
3
3
|
*/
|
|
4
4
|
import * as React from "react";
|
|
5
|
-
type AnswerChoicesProps = {
|
|
5
|
+
export type AnswerChoicesProps = {
|
|
6
6
|
choices: ReadonlyArray<string>;
|
|
7
7
|
onChange: (choices: ReadonlyArray<string>) => void;
|
|
8
8
|
editingDisabled: boolean;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
import type { PerseusLabelImageWidgetOptions } from "@khanacademy/perseus-core";
|
|
9
|
-
type
|
|
9
|
+
export type MarkerProps = PerseusLabelImageWidgetOptions["markers"][number] & {
|
|
10
10
|
choices: PerseusLabelImageWidgetOptions["choices"];
|
|
11
11
|
onChange: (marker: PerseusLabelImageWidgetOptions["markers"][number]) => void;
|
|
12
12
|
onRemove: () => void;
|
|
@@ -14,14 +14,15 @@ type Props = PerseusLabelImageWidgetOptions["markers"][number] & {
|
|
|
14
14
|
type State = {
|
|
15
15
|
showDropdown: boolean;
|
|
16
16
|
};
|
|
17
|
-
export default class Marker extends React.Component<
|
|
17
|
+
export default class Marker extends React.Component<MarkerProps, State> {
|
|
18
18
|
_marker: HTMLElement | null | undefined;
|
|
19
|
-
constructor(props:
|
|
19
|
+
constructor(props: MarkerProps);
|
|
20
20
|
componentDidMount(): void;
|
|
21
|
-
UNSAFE_componentWillReceiveProps(nextProps:
|
|
21
|
+
UNSAFE_componentWillReceiveProps(nextProps: MarkerProps): void;
|
|
22
22
|
componentWillUnmount(): void;
|
|
23
23
|
openDropdown(): void;
|
|
24
|
-
|
|
24
|
+
updateAnswers(answers: string[]): void;
|
|
25
|
+
updateLabel(label: string): void;
|
|
25
26
|
handleClick: (e: MouseEvent) => void;
|
|
26
27
|
handleLabelChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
27
28
|
handleSelectAnswer: (toggleAnswer: string) => void;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import Marker from "./marker";
|
|
7
7
|
import type { PerseusLabelImageWidgetOptions } from "@khanacademy/perseus-core";
|
|
8
|
-
type
|
|
8
|
+
export type QuestionMarkersProps = {
|
|
9
9
|
choices: string[];
|
|
10
10
|
imageUrl: string;
|
|
11
11
|
imageWidth: number;
|
|
@@ -14,10 +14,9 @@ type Props = {
|
|
|
14
14
|
onChange: (markers: PerseusLabelImageWidgetOptions["markers"]) => void;
|
|
15
15
|
editingDisabled: boolean;
|
|
16
16
|
};
|
|
17
|
-
export default class QuestionMarkers extends React.Component<
|
|
17
|
+
export default class QuestionMarkers extends React.Component<QuestionMarkersProps> {
|
|
18
18
|
_markers: Array<Marker | null | undefined>;
|
|
19
19
|
openDropdownForMarkerIndices(indices: ReadonlyArray<number>): void;
|
|
20
20
|
handleImageDoubleClick: (e: React.MouseEvent) => void;
|
|
21
21
|
render(): React.ReactNode;
|
|
22
22
|
}
|
|
23
|
-
export {};
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Controlled component for selecting the question image, for answer labeling.
|
|
3
3
|
*/
|
|
4
4
|
import * as React from "react";
|
|
5
|
-
type
|
|
5
|
+
export type SelectImageProps = {
|
|
6
6
|
onChange: (url: string) => void;
|
|
7
7
|
url: string;
|
|
8
8
|
};
|
|
9
|
-
declare const SelectImage: ({ onChange, url }:
|
|
9
|
+
declare const SelectImage: ({ onChange, url }: SelectImageProps) => React.ReactElement;
|
|
10
10
|
export default SelectImage;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Perseus editors",
|
|
4
4
|
"author": "Khan Academy",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "28.8.
|
|
6
|
+
"version": "28.8.3",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -34,36 +34,36 @@
|
|
|
34
34
|
"katex": "0.11.1",
|
|
35
35
|
"mafs": "^0.19.0",
|
|
36
36
|
"tiny-invariant": "1.3.1",
|
|
37
|
-
"@khanacademy/keypad-context": "3.2.19",
|
|
38
37
|
"@khanacademy/kas": "2.1.6",
|
|
39
|
-
"@khanacademy/
|
|
40
|
-
"@khanacademy/
|
|
41
|
-
"@khanacademy/
|
|
42
|
-
"@khanacademy/perseus
|
|
43
|
-
"@khanacademy/perseus-
|
|
44
|
-
"@khanacademy/perseus-
|
|
38
|
+
"@khanacademy/keypad-context": "3.2.21",
|
|
39
|
+
"@khanacademy/kmath": "2.2.21",
|
|
40
|
+
"@khanacademy/math-input": "26.2.24",
|
|
41
|
+
"@khanacademy/perseus": "72.5.0",
|
|
42
|
+
"@khanacademy/perseus-core": "20.4.1",
|
|
43
|
+
"@khanacademy/perseus-linter": "4.6.3",
|
|
44
|
+
"@khanacademy/perseus-score": "8.0.10",
|
|
45
45
|
"@khanacademy/perseus-utils": "2.1.4"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@khanacademy/mathjax-renderer": "3.0.0",
|
|
49
|
-
"@khanacademy/wonder-blocks-accordion": "3.1.
|
|
50
|
-
"@khanacademy/wonder-blocks-banner": "5.0.
|
|
51
|
-
"@khanacademy/wonder-blocks-button": "11.2.
|
|
52
|
-
"@khanacademy/wonder-blocks-clickable": "8.0.
|
|
49
|
+
"@khanacademy/wonder-blocks-accordion": "3.1.47",
|
|
50
|
+
"@khanacademy/wonder-blocks-banner": "5.0.6",
|
|
51
|
+
"@khanacademy/wonder-blocks-button": "11.2.10",
|
|
52
|
+
"@khanacademy/wonder-blocks-clickable": "8.0.5",
|
|
53
53
|
"@khanacademy/wonder-blocks-core": "12.4.2",
|
|
54
|
-
"@khanacademy/wonder-blocks-dropdown": "10.
|
|
55
|
-
"@khanacademy/wonder-blocks-form": "7.4.
|
|
56
|
-
"@khanacademy/wonder-blocks-icon": "5.3.
|
|
57
|
-
"@khanacademy/wonder-blocks-icon-button": "11.0.
|
|
58
|
-
"@khanacademy/wonder-blocks-labeled-field": "4.0.
|
|
59
|
-
"@khanacademy/wonder-blocks-layout": "3.1.
|
|
60
|
-
"@khanacademy/wonder-blocks-link": "10.0.
|
|
61
|
-
"@khanacademy/wonder-blocks-pill": "3.1.
|
|
62
|
-
"@khanacademy/wonder-blocks-switch": "3.3.
|
|
54
|
+
"@khanacademy/wonder-blocks-dropdown": "10.6.0",
|
|
55
|
+
"@khanacademy/wonder-blocks-form": "7.4.6",
|
|
56
|
+
"@khanacademy/wonder-blocks-icon": "5.3.5",
|
|
57
|
+
"@khanacademy/wonder-blocks-icon-button": "11.0.1",
|
|
58
|
+
"@khanacademy/wonder-blocks-labeled-field": "4.0.12",
|
|
59
|
+
"@khanacademy/wonder-blocks-layout": "3.1.42",
|
|
60
|
+
"@khanacademy/wonder-blocks-link": "10.0.6",
|
|
61
|
+
"@khanacademy/wonder-blocks-pill": "3.1.48",
|
|
62
|
+
"@khanacademy/wonder-blocks-switch": "3.3.25",
|
|
63
63
|
"@khanacademy/wonder-blocks-timing": "7.0.4",
|
|
64
|
-
"@khanacademy/wonder-blocks-tokens": "14.1.
|
|
65
|
-
"@khanacademy/wonder-blocks-tooltip": "4.1.
|
|
66
|
-
"@khanacademy/wonder-blocks-typography": "4.2.
|
|
64
|
+
"@khanacademy/wonder-blocks-tokens": "14.1.3",
|
|
65
|
+
"@khanacademy/wonder-blocks-tooltip": "4.1.60",
|
|
66
|
+
"@khanacademy/wonder-blocks-typography": "4.2.27",
|
|
67
67
|
"@khanacademy/wonder-stuff-core": "3.0.0",
|
|
68
68
|
"@phosphor-icons/core": "2.0.2",
|
|
69
69
|
"aphrodite": "1.2.5",
|
|
@@ -78,24 +78,24 @@
|
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
80
|
"@khanacademy/mathjax-renderer": "^3.0.0",
|
|
81
|
-
"@khanacademy/wonder-blocks-accordion": "^3.1.
|
|
82
|
-
"@khanacademy/wonder-blocks-banner": "^5.0.
|
|
83
|
-
"@khanacademy/wonder-blocks-button": "^11.2.
|
|
84
|
-
"@khanacademy/wonder-blocks-clickable": "^8.0.
|
|
81
|
+
"@khanacademy/wonder-blocks-accordion": "^3.1.47",
|
|
82
|
+
"@khanacademy/wonder-blocks-banner": "^5.0.6",
|
|
83
|
+
"@khanacademy/wonder-blocks-button": "^11.2.10",
|
|
84
|
+
"@khanacademy/wonder-blocks-clickable": "^8.0.5",
|
|
85
85
|
"@khanacademy/wonder-blocks-core": "^12.4.2",
|
|
86
|
-
"@khanacademy/wonder-blocks-dropdown": "^10.
|
|
87
|
-
"@khanacademy/wonder-blocks-form": "^7.4.
|
|
88
|
-
"@khanacademy/wonder-blocks-icon": "^5.3.
|
|
89
|
-
"@khanacademy/wonder-blocks-icon-button": "^11.0.
|
|
90
|
-
"@khanacademy/wonder-blocks-labeled-field": "^4.0.
|
|
91
|
-
"@khanacademy/wonder-blocks-layout": "^3.1.
|
|
92
|
-
"@khanacademy/wonder-blocks-link": "^10.0.
|
|
93
|
-
"@khanacademy/wonder-blocks-pill": "^3.1.
|
|
94
|
-
"@khanacademy/wonder-blocks-switch": "^3.3.
|
|
86
|
+
"@khanacademy/wonder-blocks-dropdown": "^10.6.0",
|
|
87
|
+
"@khanacademy/wonder-blocks-form": "^7.4.6",
|
|
88
|
+
"@khanacademy/wonder-blocks-icon": "^5.3.5",
|
|
89
|
+
"@khanacademy/wonder-blocks-icon-button": "^11.0.1",
|
|
90
|
+
"@khanacademy/wonder-blocks-labeled-field": "^4.0.12",
|
|
91
|
+
"@khanacademy/wonder-blocks-layout": "^3.1.42",
|
|
92
|
+
"@khanacademy/wonder-blocks-link": "^10.0.6",
|
|
93
|
+
"@khanacademy/wonder-blocks-pill": "^3.1.48",
|
|
94
|
+
"@khanacademy/wonder-blocks-switch": "^3.3.25",
|
|
95
95
|
"@khanacademy/wonder-blocks-timing": "^7.0.4",
|
|
96
|
-
"@khanacademy/wonder-blocks-tokens": "^14.1.
|
|
97
|
-
"@khanacademy/wonder-blocks-tooltip": "^4.1.
|
|
98
|
-
"@khanacademy/wonder-blocks-typography": "^4.2.
|
|
96
|
+
"@khanacademy/wonder-blocks-tokens": "^14.1.3",
|
|
97
|
+
"@khanacademy/wonder-blocks-tooltip": "^4.1.60",
|
|
98
|
+
"@khanacademy/wonder-blocks-typography": "^4.2.27",
|
|
99
99
|
"@khanacademy/wonder-stuff-core": "^3.0.0",
|
|
100
100
|
"@phosphor-icons/core": "^2.0.2",
|
|
101
101
|
"aphrodite": "^1.2.5",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
},
|
|
109
109
|
"keywords": [],
|
|
110
110
|
"khan": {
|
|
111
|
-
"catalogHash": "
|
|
111
|
+
"catalogHash": "e4644614264a2037"
|
|
112
112
|
},
|
|
113
113
|
"scripts": {}
|
|
114
114
|
}
|