@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/CHANGELOG.md
CHANGED
|
@@ -34,6 +34,8 @@ export interface MathFieldInterface {
|
|
|
34
34
|
moveToDirEnd: (direction: "L" | "R") => void;
|
|
35
35
|
select: () => void;
|
|
36
36
|
clearSelection: () => void;
|
|
37
|
+
cursorAtRightEnd: () => boolean;
|
|
38
|
+
cursorAtLeftEnd: () => boolean;
|
|
37
39
|
__controller: any;
|
|
38
40
|
}
|
|
39
41
|
export declare enum MathFieldActionType {
|
|
@@ -43,6 +43,8 @@ export interface MathFieldInterface {
|
|
|
43
43
|
moveToDirEnd: (direction: "L" | "R") => void;
|
|
44
44
|
select: () => void;
|
|
45
45
|
clearSelection: () => void;
|
|
46
|
+
cursorAtRightEnd: () => boolean;
|
|
47
|
+
cursorAtLeftEnd: () => boolean;
|
|
46
48
|
__controller: any;
|
|
47
49
|
}
|
|
48
50
|
declare export var MathFieldActionType: {|
|
|
@@ -1,23 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import Key from "../../data/keys";
|
|
3
3
|
import { ClickKeyCallback } from "../../types";
|
|
4
|
-
import { TabbarItemType } from "../tabbar/types";
|
|
5
|
-
import { NumbersPageOptions } from "./numbers-page/types";
|
|
6
|
-
import { OperatorsButtonSets } from "./operators-page/types";
|
|
7
4
|
export type Props = {
|
|
8
5
|
onClickKey: ClickKeyCallback;
|
|
9
6
|
trigonometry?: boolean;
|
|
10
7
|
extraKeys: ReadonlyArray<Key>;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
multiplicationDot?: boolean;
|
|
9
|
+
divisionKey?: boolean;
|
|
10
|
+
preAlgebra?: boolean;
|
|
11
|
+
logarithms?: boolean;
|
|
12
|
+
basicRelations?: boolean;
|
|
13
|
+
advancedRelations?: boolean;
|
|
14
14
|
};
|
|
15
|
-
|
|
16
|
-
extraKeys: Props["extraKeys"];
|
|
17
|
-
};
|
|
18
|
-
export default class Keypad extends React.Component<Props, State> {
|
|
19
|
-
state: State;
|
|
20
|
-
static defaultProps: DefaultProps;
|
|
21
|
-
render(): React.ReactNode;
|
|
22
|
-
}
|
|
23
|
-
export {};
|
|
15
|
+
export default function Keypad(props: Props): JSX.Element;
|
|
@@ -4,29 +4,17 @@
|
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
import * as React from "react";
|
|
8
7
|
import Key from "../../data/keys";
|
|
9
8
|
import { ClickKeyCallback } from "../../types";
|
|
10
|
-
import { TabbarItemType } from "../tabbar/types";
|
|
11
|
-
import { NumbersPageOptions } from "./numbers-page/types";
|
|
12
|
-
import { OperatorsButtonSets } from "./operators-page/types";
|
|
13
9
|
export type Props = {|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
onClickKey: ClickKeyCallback,
|
|
11
|
+
trigonometry?: boolean,
|
|
12
|
+
extraKeys: $ReadOnlyArray<Key>,
|
|
13
|
+
multiplicationDot?: boolean,
|
|
14
|
+
divisionKey?: boolean,
|
|
15
|
+
preAlgebra?: boolean,
|
|
16
|
+
logarithms?: boolean,
|
|
17
|
+
basicRelations?: boolean,
|
|
18
|
+
advancedRelations?: boolean,
|
|
21
19
|
|};
|
|
22
|
-
declare
|
|
23
|
-
selectedPage: TabbarItemType,
|
|
24
|
-
|};
|
|
25
|
-
declare type DefaultProps = {|
|
|
26
|
-
extraKeys: $PropertyType<Props, "extraKeys">,
|
|
27
|
-
|};
|
|
28
|
-
declare export default class Keypad extends React.Component<Props, State> {
|
|
29
|
-
state: State;
|
|
30
|
-
static defaultProps: DefaultProps;
|
|
31
|
-
render(): React.Node;
|
|
32
|
-
}
|
|
20
|
+
declare export default function Keypad(props: Props): React$Node;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { KeyConfig, ClickKeyCallback } from "../../types";
|
|
3
|
+
import type { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
4
|
+
export type KeypadButtonProps = {
|
|
5
|
+
coord: readonly [number, number];
|
|
6
|
+
keyConfig: KeyConfig;
|
|
7
|
+
onClickKey: ClickKeyCallback;
|
|
8
|
+
action?: boolean;
|
|
9
|
+
secondary?: boolean;
|
|
10
|
+
style?: StyleType;
|
|
11
|
+
};
|
|
12
|
+
export declare const KeypadButton: ({ coord, keyConfig, onClickKey, style, secondary, action, }: KeypadButtonProps) => React.ReactElement;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flowtype definitions for data
|
|
3
|
+
* Generated by Flowgen from a Typescript Definition
|
|
4
|
+
* Flowgen v1.21.0
|
|
5
|
+
* @flow
|
|
6
|
+
*/
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { KeyConfig, ClickKeyCallback } from "../../types";
|
|
9
|
+
import type { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
10
|
+
export type KeypadButtonProps = {|
|
|
11
|
+
coord: [number, number],
|
|
12
|
+
keyConfig: KeyConfig,
|
|
13
|
+
onClickKey: ClickKeyCallback,
|
|
14
|
+
action?: boolean,
|
|
15
|
+
secondary?: boolean,
|
|
16
|
+
style?: StyleType,
|
|
17
|
+
|};
|
|
18
|
+
declare export var KeypadButton: (x: KeypadButtonProps) => React.Element<any>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import Key from "../../../data/keys";
|
|
3
|
+
import { ClickKeyCallback } from "../../../types";
|
|
4
|
+
type Props = {
|
|
5
|
+
extraKeys: ReadonlyArray<Key>;
|
|
6
|
+
onClickKey: ClickKeyCallback;
|
|
7
|
+
};
|
|
8
|
+
export default function ExtrasPage(props: Props): JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
7
|
+
import Key from "../../../data/keys";
|
|
8
8
|
import { ClickKeyCallback } from "../../../types";
|
|
9
9
|
declare type Props = {|
|
|
10
|
+
extraKeys: $ReadOnlyArray<Key>,
|
|
10
11
|
onClickKey: ClickKeyCallback,
|
|
11
|
-
placeholder?: boolean,
|
|
12
12
|
|};
|
|
13
|
-
declare export
|
|
13
|
+
declare export default function ExtrasPage(props: Props): React$Node;
|
|
@@ -4,10 +4,8 @@
|
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
import React from "react";
|
|
8
7
|
import { ClickKeyCallback } from "../../../types";
|
|
9
8
|
declare type Props = {|
|
|
10
9
|
onClickKey: ClickKeyCallback,
|
|
11
|
-
placeholder?: boolean,
|
|
12
10
|
|};
|
|
13
|
-
declare export
|
|
11
|
+
declare export default function GeometryPage(props: Props): React$Node;
|
|
@@ -4,10 +4,8 @@
|
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
import React from "react";
|
|
8
7
|
import { ClickKeyCallback } from "../../../types";
|
|
9
8
|
declare type Props = {|
|
|
10
9
|
onClickKey: ClickKeyCallback,
|
|
11
|
-
placeholder?: boolean,
|
|
12
10
|
|};
|
|
13
|
-
declare export
|
|
11
|
+
declare export default function NumbersPage(props: Props): React$Node;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ClickKeyCallback } from "../../../types";
|
|
3
|
+
type Props = {
|
|
4
|
+
onClickKey: ClickKeyCallback;
|
|
5
|
+
preAlgebra?: boolean;
|
|
6
|
+
logarithms?: boolean;
|
|
7
|
+
basicRelations?: boolean;
|
|
8
|
+
advancedRelations?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export default function OperatorsPage(props: Props): JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
import React from "react";
|
|
8
7
|
import { ClickKeyCallback } from "../../../types";
|
|
9
8
|
declare type Props = {|
|
|
10
9
|
onClickKey: ClickKeyCallback,
|
|
11
|
-
|
|
10
|
+
preAlgebra?: boolean,
|
|
11
|
+
logarithms?: boolean,
|
|
12
|
+
basicRelations?: boolean,
|
|
13
|
+
advancedRelations?: boolean,
|
|
12
14
|
|};
|
|
13
|
-
declare export
|
|
15
|
+
declare export default function OperatorsPage(props: Props): React$Node;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ClickKeyCallback } from "../../types";
|
|
3
|
+
type Props = {
|
|
4
|
+
onClickKey: ClickKeyCallback;
|
|
5
|
+
multiplicationDot?: boolean;
|
|
6
|
+
divisionKey?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export default function SharedKeys(props: Props): JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
import { ClickKeyCallback } from "../../types";
|
|
8
|
+
declare type Props = {|
|
|
9
|
+
onClickKey: ClickKeyCallback,
|
|
8
10
|
multiplicationDot?: boolean,
|
|
9
11
|
divisionKey?: boolean,
|
|
10
12
|
|};
|
|
13
|
+
declare export default function SharedKeys(props: Props): React$Node;
|