@khanacademy/math-input 4.2.0 → 4.3.1
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 +12 -0
- package/dist/components/input/mathquill-types.d.ts +2 -0
- package/dist/components/input/mathquill-types.js.flow +2 -0
- package/dist/components/keypad/index.d.ts +8 -16
- package/dist/components/keypad/index.js.flow +10 -22
- package/dist/components/keypad/keypad-button.d.ts +12 -0
- package/dist/components/keypad/keypad-button.js.flow +18 -0
- package/dist/components/keypad/keypad-pages/extras-page.d.ts +9 -0
- package/dist/components/keypad/{operators-page/basic-relations-buttons.js.flow → keypad-pages/extras-page.js.flow} +3 -3
- package/dist/components/keypad/keypad-pages/geometry-page.d.ts +7 -0
- package/dist/components/keypad/{operators-page/logarithms-buttons.js.flow → keypad-pages/geometry-page.js.flow} +1 -3
- package/dist/components/keypad/keypad-pages/numbers-page.d.ts +7 -0
- package/dist/components/keypad/{operators-page/pre-algebra-buttons.js.flow → keypad-pages/numbers-page.js.flow} +1 -3
- package/dist/components/keypad/keypad-pages/operators-page.d.ts +11 -0
- package/dist/components/keypad/{operators-page/advanced-relations-buttons.js.flow → keypad-pages/operators-page.js.flow} +5 -3
- package/dist/components/keypad/shared-keys.d.ts +9 -0
- package/dist/components/keypad/{numbers-page/types.js.flow → shared-keys.js.flow} +4 -1
- package/dist/es/index.js +771 -842
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +834 -930
- package/dist/index.js.map +1 -1
- package/package.json +2 -3
- package/src/components/input/__tests__/test-math-wrapper.ts +2 -5
- package/src/components/input/mathquill-types.ts +6 -0
- package/src/components/keypad/__tests__/keypad-button.test.tsx +4 -2
- package/src/components/keypad/button-assets.tsx +506 -310
- package/src/components/keypad/index.tsx +73 -49
- package/src/components/keypad/{button.stories.tsx → keypad-button.stories.tsx} +2 -1
- package/src/components/keypad/keypad-button.tsx +128 -0
- package/src/components/keypad/keypad-mathquill.stories.tsx +10 -4
- package/src/components/keypad/keypad-pages/extras-page.tsx +34 -0
- package/src/components/keypad/keypad-pages/geometry-page.tsx +33 -0
- package/src/components/keypad/keypad-pages/numbers-page.tsx +84 -0
- package/src/components/keypad/keypad-pages/operators-page.tsx +116 -0
- package/src/components/keypad/keypad.stories.tsx +11 -0
- package/src/components/keypad/shared-keys.tsx +78 -0
- package/src/components/tabbar/icons.tsx +26 -8
- package/tsconfig-build.tsbuildinfo +1 -1
- package/dist/components/keypad/button.d.ts +0 -12
- package/dist/components/keypad/button.js.flow +0 -18
- package/dist/components/keypad/extras-page/index.d.ts +0 -10
- package/dist/components/keypad/extras-page/index.js.flow +0 -15
- package/dist/components/keypad/geometry-page/index.d.ts +0 -9
- package/dist/components/keypad/geometry-page/index.js.flow +0 -14
- package/dist/components/keypad/keypad-page-items.d.ts +0 -26
- package/dist/components/keypad/keypad-page-items.js.flow +0 -40
- package/dist/components/keypad/numbers-page/index.d.ts +0 -10
- package/dist/components/keypad/numbers-page/index.js.flow +0 -18
- package/dist/components/keypad/numbers-page/types.d.ts +0 -4
- package/dist/components/keypad/operators-page/advanced-relations-buttons.d.ts +0 -8
- package/dist/components/keypad/operators-page/basic-relations-buttons.d.ts +0 -8
- package/dist/components/keypad/operators-page/index.d.ts +0 -10
- package/dist/components/keypad/operators-page/index.js.flow +0 -18
- package/dist/components/keypad/operators-page/logarithms-buttons.d.ts +0 -8
- package/dist/components/keypad/operators-page/pre-algebra-buttons.d.ts +0 -8
- package/dist/components/keypad/operators-page/types.d.ts +0 -6
- package/dist/components/keypad/operators-page/types.js.flow +0 -12
- package/src/components/keypad/__tests__/Button.test.tsx +0 -51
- package/src/components/keypad/button.tsx +0 -108
- package/src/components/keypad/extras-page/index.tsx +0 -27
- package/src/components/keypad/geometry-page/index.tsx +0 -89
- package/src/components/keypad/keypad-page-items.tsx +0 -118
- package/src/components/keypad/numbers-page/index.tsx +0 -136
- package/src/components/keypad/numbers-page/types.ts +0 -4
- package/src/components/keypad/operators-page/advanced-relations-buttons.tsx +0 -33
- package/src/components/keypad/operators-page/basic-relations-buttons.tsx +0 -33
- package/src/components/keypad/operators-page/index.tsx +0 -94
- package/src/components/keypad/operators-page/logarithms-buttons.tsx +0 -33
- package/src/components/keypad/operators-page/pre-algebra-buttons.tsx +0 -37
- package/src/components/keypad/operators-page/types.ts +0 -6
- /package/src/components/keypad/{keypad-pages.stories.tsx → keypad-pages/keypad-pages.stories.tsx} +0 -0
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Khan Academy's new expression editor for the mobile web.",
|
|
4
4
|
"author": "Khan Academy",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "4.
|
|
6
|
+
"version": "4.3.1",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"source": "src/index.ts",
|
|
20
20
|
"scripts": {},
|
|
21
21
|
"dependencies": {
|
|
22
|
+
"mathquill": "git+https://git@github.com/Khan/mathquill.git#a9ae54e057c5c1acc8244a5627acbff29901d992",
|
|
22
23
|
"performance-now": "^0.2.0"
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": {
|
|
@@ -31,7 +32,6 @@
|
|
|
31
32
|
"aphrodite": "^1.1.0",
|
|
32
33
|
"jquery": "^2.1.1",
|
|
33
34
|
"katex": "^0.11.1",
|
|
34
|
-
"mathquill": "git+https://git@github.com/Khan/mathquill.git#a9ae54e057c5c1acc8244a5627acbff29901d992",
|
|
35
35
|
"perseus-build-settings": "^0.1.0",
|
|
36
36
|
"prop-types": "15.6.1",
|
|
37
37
|
"react": "^16.8.0",
|
|
@@ -51,7 +51,6 @@
|
|
|
51
51
|
"aphrodite": "^1.1.0",
|
|
52
52
|
"jquery": "^2.1.1",
|
|
53
53
|
"katex": "^0.11.1",
|
|
54
|
-
"mathquill": "git+https://git@github.com/Khan/mathquill.git#a9ae54e057c5c1acc8244a5627acbff29901d992",
|
|
55
54
|
"prop-types": "15.6.1",
|
|
56
55
|
"react": "^16.8.0",
|
|
57
56
|
"react-dom": "^16.8.0",
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import MathQuill from "mathquill";
|
|
2
|
-
|
|
3
1
|
import MathWrapper from "../math-wrapper";
|
|
4
|
-
|
|
5
|
-
const MQ = MathQuill.getInterface(2);
|
|
2
|
+
import {mathQuillInstance} from "../mathquill-instance";
|
|
6
3
|
|
|
7
4
|
export default class TestMathWrapper extends MathWrapper {
|
|
8
5
|
getContent() {
|
|
@@ -18,7 +15,7 @@ export default class TestMathWrapper extends MathWrapper {
|
|
|
18
15
|
}
|
|
19
16
|
|
|
20
17
|
moveToStart() {
|
|
21
|
-
this.mathField.moveToDirEnd(
|
|
18
|
+
this.mathField.moveToDirEnd(mathQuillInstance.L);
|
|
22
19
|
}
|
|
23
20
|
|
|
24
21
|
isSelected() {
|
|
@@ -62,6 +62,12 @@ export interface MathFieldInterface {
|
|
|
62
62
|
// Clears the selection
|
|
63
63
|
// https://docs.mathquill.com/en/latest/Api_Methods/#clearselection
|
|
64
64
|
clearSelection: () => void;
|
|
65
|
+
// Custom helper in our MathQuill fork
|
|
66
|
+
// check to see if cursor is on right end
|
|
67
|
+
cursorAtRightEnd: () => boolean;
|
|
68
|
+
// Custom helper in our MathQuill fork
|
|
69
|
+
// check to see if cursor is on left end
|
|
70
|
+
cursorAtLeftEnd: () => boolean;
|
|
65
71
|
// This isn't part of the MathQuill public API
|
|
66
72
|
// I don't know what it is and it feels wrong using it
|
|
67
73
|
__controller: any;
|
|
@@ -4,15 +4,16 @@ import * as React from "react";
|
|
|
4
4
|
import "@testing-library/jest-dom";
|
|
5
5
|
|
|
6
6
|
import Keys from "../../../data/key-configs";
|
|
7
|
-
import {KeypadButton} from "../keypad-
|
|
7
|
+
import {KeypadButton} from "../keypad-button";
|
|
8
8
|
|
|
9
9
|
describe("<KeypadButton />", () => {
|
|
10
10
|
it("uses the aria label from the key config", () => {
|
|
11
11
|
// Arrange
|
|
12
12
|
render(
|
|
13
13
|
<KeypadButton
|
|
14
|
-
onClickKey={(
|
|
14
|
+
onClickKey={() => {}}
|
|
15
15
|
keyConfig={Keys.LEFT_PAREN}
|
|
16
|
+
coord={[0, 0]}
|
|
16
17
|
/>,
|
|
17
18
|
);
|
|
18
19
|
|
|
@@ -29,6 +30,7 @@ describe("<KeypadButton />", () => {
|
|
|
29
30
|
<KeypadButton
|
|
30
31
|
onClickKey={mockClickKeyCallback}
|
|
31
32
|
keyConfig={Keys.LEFT_PAREN}
|
|
33
|
+
coord={[0, 0]}
|
|
32
34
|
/>,
|
|
33
35
|
);
|
|
34
36
|
|