@khanacademy/perseus 6.4.2 → 6.4.4
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/CHANGELOG.md +17 -0
- package/dist/components/graph.d.ts +2 -2
- package/dist/components/graph.js.flow +2 -2
- package/dist/components/svg-image.d.ts +1 -1
- package/dist/components/svg-image.js.flow +1 -1
- package/dist/es/index.js +6 -7
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +6 -7
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/graph.tsx +3 -2
- package/src/components/svg-image.tsx +1 -1
- package/src/util/tex.ts +8 -6
- package/src/widgets/__tests__/expression.test.ts +0 -3
- package/src/widgets/expression.tsx +0 -1
- package/tsconfig-build.tsbuildinfo +1 -1
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.4.
|
|
6
|
+
"version": "6.4.4",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@khanacademy/kas": "^0.3.1",
|
|
25
25
|
"@khanacademy/kmath": "^0.1.1",
|
|
26
|
-
"@khanacademy/math-input": "^6.0.
|
|
27
|
-
"@khanacademy/perseus-core": "0.0.
|
|
26
|
+
"@khanacademy/math-input": "^6.0.2",
|
|
27
|
+
"@khanacademy/perseus-core": "0.0.2",
|
|
28
28
|
"@khanacademy/perseus-linter": "^0.3.1",
|
|
29
29
|
"@khanacademy/pure-markdown": "^0.2.3",
|
|
30
30
|
"@khanacademy/simple-markdown": "^0.9.3"
|
package/src/components/graph.tsx
CHANGED
|
@@ -4,14 +4,15 @@ import * as React from "react";
|
|
|
4
4
|
import ReactDOM from "react-dom";
|
|
5
5
|
import _ from "underscore";
|
|
6
6
|
|
|
7
|
-
import {Coord} from "../interactive2/types";
|
|
8
|
-
import {PerseusImageBackground} from "../perseus-types";
|
|
9
7
|
import {interactiveSizes} from "../styles/constants";
|
|
10
8
|
import Util from "../util";
|
|
11
9
|
import GraphUtils from "../util/graph-utils";
|
|
12
10
|
|
|
13
11
|
import SvgImage from "./svg-image";
|
|
14
12
|
|
|
13
|
+
import type {Coord} from "../interactive2/types";
|
|
14
|
+
import type {PerseusImageBackground} from "../perseus-types";
|
|
15
|
+
|
|
15
16
|
const defaultBackgroundImage = {
|
|
16
17
|
url: null,
|
|
17
18
|
};
|
|
@@ -6,7 +6,6 @@ import * as React from "react";
|
|
|
6
6
|
import _ from "underscore";
|
|
7
7
|
|
|
8
8
|
import {getDependencies} from "../dependencies";
|
|
9
|
-
import {Coord} from "../interactive2/types";
|
|
10
9
|
import {Errors, Log} from "../logging/log";
|
|
11
10
|
import {PerseusError} from "../perseus-error";
|
|
12
11
|
import Util from "../util";
|
|
@@ -16,6 +15,7 @@ import FixedToResponsive from "./fixed-to-responsive";
|
|
|
16
15
|
import Graphie from "./graphie";
|
|
17
16
|
import ImageLoader from "./image-loader";
|
|
18
17
|
|
|
18
|
+
import type {Coord} from "../interactive2/types";
|
|
19
19
|
import type {Size} from "../perseus-types";
|
|
20
20
|
import type {Alignment, Dimensions} from "../types";
|
|
21
21
|
import type {ImageProps} from "./image-loader";
|
package/src/util/tex.ts
CHANGED
|
@@ -100,13 +100,15 @@ export default {
|
|
|
100
100
|
// We use createElement instead of JSX here because we can't name this file tex.tsx;
|
|
101
101
|
// that name is already taken.
|
|
102
102
|
reactRender(
|
|
103
|
-
React.createElement(TeX, {
|
|
103
|
+
React.createElement(TeX, {
|
|
104
|
+
children: text,
|
|
105
|
+
onRender: () => {
|
|
106
|
+
if (callback) {
|
|
107
|
+
doCallback(elem, callback);
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
}),
|
|
104
111
|
$katexHolder[0],
|
|
105
|
-
() => {
|
|
106
|
-
if (callback) {
|
|
107
|
-
doCallback(elem, callback);
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
112
|
);
|
|
111
113
|
}
|
|
112
114
|
},
|
|
@@ -32,7 +32,6 @@ const assertCorrect = (itemData: PerseusItem, input) => {
|
|
|
32
32
|
expect(testDependencies.analytics).toHaveBeenCalledWith({
|
|
33
33
|
type: "perseus:expression-evaluated",
|
|
34
34
|
payload: {
|
|
35
|
-
virtualKeypadVersion: "PERSEUS_MATH_INPUT",
|
|
36
35
|
result: "correct",
|
|
37
36
|
},
|
|
38
37
|
});
|
|
@@ -44,7 +43,6 @@ const assertIncorrect = (itemData: PerseusItem, input: string) => {
|
|
|
44
43
|
expect(testDependencies.analytics).toHaveBeenCalledWith({
|
|
45
44
|
type: "perseus:expression-evaluated",
|
|
46
45
|
payload: {
|
|
47
|
-
virtualKeypadVersion: "PERSEUS_MATH_INPUT",
|
|
48
46
|
result: "incorrect",
|
|
49
47
|
},
|
|
50
48
|
});
|
|
@@ -62,7 +60,6 @@ const assertInvalid = (itemData: PerseusItem, input, message?: string) => {
|
|
|
62
60
|
expect(testDependencies.analytics).toHaveBeenCalledWith({
|
|
63
61
|
type: "perseus:expression-evaluated",
|
|
64
62
|
payload: {
|
|
65
|
-
virtualKeypadVersion: "PERSEUS_MATH_INPUT",
|
|
66
63
|
result: "invalid",
|
|
67
64
|
},
|
|
68
65
|
});
|