@khanacademy/math-input 10.0.1 → 10.1.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 +14 -0
- package/dist/components/keypad/keypad.d.ts +1 -0
- package/dist/components/keypad/mobile-keypad.d.ts +8 -0
- package/dist/components/keypad/navigation-button.d.ts +8 -0
- package/dist/components/keypad/navigation-pad.d.ts +6 -0
- package/dist/components/keypad/shared-keys.d.ts +2 -3
- package/dist/components/keypad/utils.d.ts +1 -0
- package/dist/components/keypad-legacy/two-page-keypad.d.ts +2 -2
- package/dist/components/tabbar/icons.d.ts +2 -2
- package/dist/components/tabbar/index.d.ts +0 -1
- package/dist/components/tabbar/item.d.ts +2 -2
- package/dist/components/tabbar/tabbar.d.ts +4 -4
- package/dist/es/index.js +485 -190
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +489 -190
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/keypad/__tests__/__snapshots__/keypad.test.tsx.snap +1855 -0
- package/src/components/keypad/__tests__/keypad.test.tsx +94 -0
- package/src/components/keypad/button-assets.tsx +233 -160
- package/src/components/keypad/keypad-button.tsx +1 -1
- package/src/components/keypad/keypad.stories.tsx +4 -0
- package/src/components/keypad/keypad.tsx +87 -58
- package/src/components/keypad/mobile-keypad.tsx +59 -4
- package/src/components/keypad/navigation-button.tsx +127 -0
- package/src/components/keypad/navigation-pad.stories.tsx +25 -0
- package/src/components/keypad/navigation-pad.tsx +67 -0
- package/src/components/keypad/shared-keys.tsx +2 -3
- package/src/components/keypad/utils.ts +4 -0
- package/src/components/keypad-legacy/keypad-button.tsx +2 -1
- package/src/components/keypad-legacy/two-page-keypad.tsx +2 -2
- package/src/components/tabbar/icons.tsx +2 -2
- package/src/components/tabbar/index.ts +0 -1
- package/src/components/tabbar/item.tsx +2 -2
- package/src/components/tabbar/tabbar.stories.tsx +3 -3
- package/src/components/tabbar/tabbar.tsx +4 -4
- package/src/types.ts +8 -0
- package/tsconfig-build.tsbuildinfo +1 -1
- package/dist/components/tabbar/types.d.ts +0 -1
- package/src/components/tabbar/types.ts +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @khanacademy/math-input
|
|
2
2
|
|
|
3
|
+
## 10.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3f7be05a: Updated Keypad V2 TabbarItemType to KeypadPageType as a more accurate description.
|
|
8
|
+
- 810c7bd9: Resize letter SVGs
|
|
9
|
+
- b161d004: Ensured that the keypad is hidden from screen readers when it is closed.
|
|
10
|
+
|
|
11
|
+
## 10.1.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- 781551f9: Add an expanded view in the v2 MobileKeypad for larger screens
|
|
16
|
+
|
|
3
17
|
## 10.0.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -20,13 +20,21 @@ type Props = {
|
|
|
20
20
|
};
|
|
21
21
|
type State = {
|
|
22
22
|
active: boolean;
|
|
23
|
+
containerWidth: number;
|
|
23
24
|
keypadConfig?: KeypadConfiguration;
|
|
24
25
|
keyHandler?: KeyHandler;
|
|
25
26
|
cursor?: Cursor;
|
|
26
27
|
};
|
|
27
28
|
declare class MobileKeypad extends React.Component<Props, State> implements KeypadAPI {
|
|
29
|
+
_containerRef: React.RefObject<HTMLDivElement>;
|
|
30
|
+
_containerResizeObserver: ResizeObserver | null;
|
|
31
|
+
_throttleResize: boolean;
|
|
28
32
|
hasMounted: boolean;
|
|
29
33
|
state: State;
|
|
34
|
+
componentDidMount(): void;
|
|
35
|
+
componentWillUnMount(): void;
|
|
36
|
+
_resize: () => void;
|
|
37
|
+
_throttleResizeHandler: () => void;
|
|
30
38
|
activate: () => void;
|
|
31
39
|
dismiss: () => void;
|
|
32
40
|
configure: (configuration: KeypadConfiguration, cb: () => void) => void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { KeyConfig, ClickKeyCallback } from "../../types";
|
|
3
|
+
export type KeypadButtonProps = {
|
|
4
|
+
coord: readonly [number, number];
|
|
5
|
+
keyConfig: KeyConfig;
|
|
6
|
+
onClickKey: ClickKeyCallback;
|
|
7
|
+
};
|
|
8
|
+
export default function NavigationButton({ coord, keyConfig, onClickKey, }: KeypadButtonProps): JSX.Element;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { ClickKeyCallback } from "../../types";
|
|
2
|
+
import type { ClickKeyCallback, KeypadPageType } from "../../types";
|
|
3
3
|
import type { CursorContext } from "../input/cursor-contexts";
|
|
4
|
-
import type { TabbarItemType } from "../tabbar";
|
|
5
4
|
type Props = {
|
|
6
5
|
onClickKey: ClickKeyCallback;
|
|
7
|
-
selectedPage:
|
|
6
|
+
selectedPage: KeypadPageType;
|
|
8
7
|
cursorContext?: typeof CursorContext[keyof typeof CursorContext];
|
|
9
8
|
multiplicationDot?: boolean;
|
|
10
9
|
divisionKey?: boolean;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* A keypad with two pages of keys.
|
|
3
3
|
*/
|
|
4
4
|
import * as React from "react";
|
|
5
|
-
import type {
|
|
5
|
+
import type { KeypadPageType } from "../../types";
|
|
6
6
|
interface ReduxProps {
|
|
7
7
|
paginationEnabled: boolean;
|
|
8
8
|
}
|
|
@@ -11,7 +11,7 @@ interface Props extends ReduxProps {
|
|
|
11
11
|
rightPage: React.ReactNode;
|
|
12
12
|
}
|
|
13
13
|
type State = {
|
|
14
|
-
selectedPage:
|
|
14
|
+
selectedPage: KeypadPageType;
|
|
15
15
|
};
|
|
16
16
|
declare class TwoPageKeypad extends React.Component<Props, State> {
|
|
17
17
|
state: State;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { KeypadPageType } from "../../types";
|
|
3
3
|
type Props = {
|
|
4
4
|
tintColor: string;
|
|
5
|
-
type:
|
|
5
|
+
type: KeypadPageType;
|
|
6
6
|
};
|
|
7
7
|
declare const IconAsset: ({ tintColor, type }: Props) => React.ReactElement;
|
|
8
8
|
export default IconAsset;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { KeypadPageType } from "../../types";
|
|
3
3
|
export type ItemState = "active" | "inactive" | "disabled";
|
|
4
4
|
type Props = {
|
|
5
5
|
onClick: () => void;
|
|
6
6
|
itemState: ItemState;
|
|
7
|
-
itemType:
|
|
7
|
+
itemType: KeypadPageType;
|
|
8
8
|
};
|
|
9
9
|
declare class TabbarItem extends React.Component<Props> {
|
|
10
10
|
render(): React.ReactNode;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { KeypadPageType } from "../../types";
|
|
3
3
|
import type { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
4
4
|
type Props = {
|
|
5
|
-
items: ReadonlyArray<
|
|
6
|
-
selectedItem:
|
|
5
|
+
items: ReadonlyArray<KeypadPageType>;
|
|
6
|
+
selectedItem: KeypadPageType;
|
|
7
7
|
onClickClose?: () => void;
|
|
8
|
-
onSelectItem: (item:
|
|
8
|
+
onSelectItem: (item: KeypadPageType) => void;
|
|
9
9
|
style?: StyleType;
|
|
10
10
|
};
|
|
11
11
|
declare function Tabbar(props: Props): React.ReactElement;
|