@khanacademy/math-input 6.0.3 → 8.0.0
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 +22 -0
- package/dist/components/input/math-input.d.ts +2 -2
- package/dist/components/input/math-input.js.flow +2 -2
- package/dist/components/keypad/index.d.ts +2 -26
- package/dist/components/keypad/index.js.flow +2 -31
- package/dist/components/keypad/keypad.d.ts +26 -0
- package/dist/components/keypad/keypad.js.flow +37 -0
- package/dist/components/keypad/mobile-keypad.d.ts +39 -0
- package/dist/components/keypad/mobile-keypad.js.flow +57 -0
- package/dist/components/keypad/shared-keys.d.ts +1 -1
- package/dist/components/keypad/shared-keys.js.flow +1 -1
- package/dist/components/keypad-context.d.ts +20 -0
- package/dist/components/keypad-context.js.flow +18 -0
- package/dist/components/keypad-legacy/index.d.ts +1 -0
- package/dist/components/keypad-legacy/index.js.flow +7 -0
- package/dist/components/keypad-legacy/keypad-button.d.ts +1 -1
- package/dist/components/keypad-legacy/keypad-button.js.flow +1 -1
- package/dist/components/keypad-legacy/keypad-container.d.ts +1 -1
- package/dist/components/keypad-legacy/keypad-container.js.flow +1 -1
- package/dist/components/keypad-legacy/keypad.d.ts +1 -1
- package/dist/components/keypad-legacy/keypad.js.flow +1 -1
- package/dist/components/keypad-legacy/provided-keypad.d.ts +2 -2
- package/dist/components/keypad-legacy/provided-keypad.js.flow +10 -2
- package/dist/components/keypad-legacy/touchable-keypad-button.d.ts +1 -1
- package/dist/components/keypad-legacy/touchable-keypad-button.js.flow +2 -2
- package/dist/components/keypad-legacy/two-page-keypad.d.ts +1 -1
- package/dist/components/keypad-legacy/two-page-keypad.js.flow +1 -1
- package/dist/components/keypad-switch.d.ts +10 -0
- package/dist/components/keypad-switch.js.flow +15 -0
- package/dist/components/tabbar/index.d.ts +2 -0
- package/dist/components/tabbar/index.js.flow +8 -0
- package/dist/es/index.js +5556 -5395
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +5528 -5367
- package/dist/index.js.flow +9 -9
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +9 -0
- package/dist/types.js.flow +12 -0
- package/package.json +1 -1
- package/src/components/input/math-input.tsx +4 -5
- package/src/components/keypad/index.tsx +2 -173
- package/src/components/keypad/keypad.stories.tsx +2 -1
- package/src/components/keypad/keypad.tsx +171 -0
- package/src/components/keypad/mobile-keypad.tsx +165 -0
- package/src/components/keypad/shared-keys.tsx +1 -1
- package/src/components/keypad-context.ts +34 -0
- package/src/components/keypad-legacy/index.ts +1 -0
- package/src/components/keypad-legacy/provided-keypad.tsx +7 -2
- package/src/components/keypad-legacy/two-page-keypad.tsx +3 -2
- package/src/components/keypad-switch.tsx +23 -0
- package/src/components/prop-types.js +0 -1
- package/src/components/tabbar/index.ts +2 -0
- package/src/full-math-input.stories.tsx +68 -0
- package/src/index.ts +28 -9
- package/src/types.ts +11 -0
- package/tsconfig-build.tsbuildinfo +1 -1
- package/src/math-input.stories.tsx +0 -67
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @khanacademy/math-input
|
|
2
2
|
|
|
3
|
+
## 8.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- f9ee9d24: Move KeypadContext from Perseus to MathInput
|
|
8
|
+
- b18986d3: Replace Legacy/Mobile keypads with a component that switches between them
|
|
9
|
+
|
|
10
|
+
## 7.0.0
|
|
11
|
+
|
|
12
|
+
### Major Changes
|
|
13
|
+
|
|
14
|
+
- 04e68d1c: Change keypadElement from LegacyKeypad to KeypadAPI
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- acafa72d: Add MobileKeypad to v2 keypad in MathInput
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- d0f28dbd: Add story for ExpressionEditor
|
|
23
|
+
- 54590cc7: Add index.ts files to some dirs in MathInput for organization
|
|
24
|
+
|
|
3
25
|
## 6.0.3
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import type { KeypadAPI } from "../../types";
|
|
3
3
|
type Props = {
|
|
4
|
-
keypadElement
|
|
4
|
+
keypadElement?: KeypadAPI;
|
|
5
5
|
onBlur: () => void;
|
|
6
6
|
onChange: (value: string, callback: any) => void;
|
|
7
7
|
onFocus: () => void;
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import * as React from "react";
|
|
8
|
-
import
|
|
8
|
+
import type { KeypadAPI } from "../../types";
|
|
9
9
|
declare type Props = {|
|
|
10
|
-
keypadElement
|
|
10
|
+
keypadElement?: KeypadAPI,
|
|
11
11
|
onBlur: () => void,
|
|
12
12
|
onChange: (value: string, callback: any) => void,
|
|
13
13
|
onFocus: () => void,
|
|
@@ -1,26 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { ClickKeyCallback } from "../../types";
|
|
4
|
-
import { CursorContext } from "../input/cursor-contexts";
|
|
5
|
-
import type { SendEventFn } from "@khanacademy/perseus-core";
|
|
6
|
-
export type Props = {
|
|
7
|
-
extraKeys: ReadonlyArray<Key>;
|
|
8
|
-
cursorContext?: typeof CursorContext[keyof typeof CursorContext];
|
|
9
|
-
showDismiss?: boolean;
|
|
10
|
-
multiplicationDot?: boolean;
|
|
11
|
-
divisionKey?: boolean;
|
|
12
|
-
trigonometry?: boolean;
|
|
13
|
-
preAlgebra?: boolean;
|
|
14
|
-
logarithms?: boolean;
|
|
15
|
-
basicRelations?: boolean;
|
|
16
|
-
advancedRelations?: boolean;
|
|
17
|
-
onClickKey: ClickKeyCallback;
|
|
18
|
-
sendEvent: SendEventFn;
|
|
19
|
-
};
|
|
20
|
-
declare function Keypad(props: Props): JSX.Element;
|
|
21
|
-
declare namespace Keypad {
|
|
22
|
-
var defaultProps: {
|
|
23
|
-
extraKeys: never[];
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
export default Keypad;
|
|
1
|
+
export { default } from "./keypad";
|
|
2
|
+
export { default as MobileKeypad } from "./mobile-keypad";
|
|
@@ -4,34 +4,5 @@
|
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import { CursorContext } from "../input/cursor-contexts";
|
|
10
|
-
import type { SendEventFn } from "@khanacademy/perseus-core";
|
|
11
|
-
export type Props = {|
|
|
12
|
-
extraKeys: $ReadOnlyArray<Key>,
|
|
13
|
-
cursorContext?: $ElementType<
|
|
14
|
-
typeof CursorContext,
|
|
15
|
-
$Keys<typeof CursorContext>
|
|
16
|
-
>,
|
|
17
|
-
showDismiss?: boolean,
|
|
18
|
-
multiplicationDot?: boolean,
|
|
19
|
-
divisionKey?: boolean,
|
|
20
|
-
trigonometry?: boolean,
|
|
21
|
-
preAlgebra?: boolean,
|
|
22
|
-
logarithms?: boolean,
|
|
23
|
-
basicRelations?: boolean,
|
|
24
|
-
advancedRelations?: boolean,
|
|
25
|
-
onClickKey: ClickKeyCallback,
|
|
26
|
-
sendEvent: SendEventFn,
|
|
27
|
-
|};
|
|
28
|
-
declare var Keypad: typeof npm$namespace$Keypad;
|
|
29
|
-
|
|
30
|
-
declare var npm$namespace$Keypad: {|
|
|
31
|
-
(props: Props): React$Node,
|
|
32
|
-
defaultProps: typeof Keypad$defaultProps,
|
|
33
|
-
|};
|
|
34
|
-
declare var Keypad$defaultProps: {|
|
|
35
|
-
extraKeys: empty[],
|
|
36
|
-
|};
|
|
37
|
-
declare export default typeof Keypad;
|
|
7
|
+
declare export { default } from "./keypad";
|
|
8
|
+
declare export { default as MobileKeypad } from "./mobile-keypad";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import Key from "../../data/keys";
|
|
3
|
+
import { ClickKeyCallback } from "../../types";
|
|
4
|
+
import { CursorContext } from "../input/cursor-contexts";
|
|
5
|
+
import type { SendEventFn } from "@khanacademy/perseus-core";
|
|
6
|
+
export type Props = {
|
|
7
|
+
extraKeys: ReadonlyArray<Key>;
|
|
8
|
+
cursorContext?: typeof CursorContext[keyof typeof CursorContext];
|
|
9
|
+
showDismiss?: boolean;
|
|
10
|
+
multiplicationDot?: boolean;
|
|
11
|
+
divisionKey?: boolean;
|
|
12
|
+
trigonometry?: boolean;
|
|
13
|
+
preAlgebra?: boolean;
|
|
14
|
+
logarithms?: boolean;
|
|
15
|
+
basicRelations?: boolean;
|
|
16
|
+
advancedRelations?: boolean;
|
|
17
|
+
onClickKey: ClickKeyCallback;
|
|
18
|
+
sendEvent: SendEventFn;
|
|
19
|
+
};
|
|
20
|
+
declare function Keypad(props: Props): JSX.Element;
|
|
21
|
+
declare namespace Keypad {
|
|
22
|
+
var defaultProps: {
|
|
23
|
+
extraKeys: never[];
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export default Keypad;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flowtype definitions for data
|
|
3
|
+
* Generated by Flowgen from a Typescript Definition
|
|
4
|
+
* Flowgen v1.21.0
|
|
5
|
+
* @flow
|
|
6
|
+
*/
|
|
7
|
+
import Key from "../../data/keys";
|
|
8
|
+
import { ClickKeyCallback } from "../../types";
|
|
9
|
+
import { CursorContext } from "../input/cursor-contexts";
|
|
10
|
+
import type { SendEventFn } from "@khanacademy/perseus-core";
|
|
11
|
+
export type Props = {|
|
|
12
|
+
extraKeys: $ReadOnlyArray<Key>,
|
|
13
|
+
cursorContext?: $ElementType<
|
|
14
|
+
typeof CursorContext,
|
|
15
|
+
$Keys<typeof CursorContext>
|
|
16
|
+
>,
|
|
17
|
+
showDismiss?: boolean,
|
|
18
|
+
multiplicationDot?: boolean,
|
|
19
|
+
divisionKey?: boolean,
|
|
20
|
+
trigonometry?: boolean,
|
|
21
|
+
preAlgebra?: boolean,
|
|
22
|
+
logarithms?: boolean,
|
|
23
|
+
basicRelations?: boolean,
|
|
24
|
+
advancedRelations?: boolean,
|
|
25
|
+
onClickKey: ClickKeyCallback,
|
|
26
|
+
sendEvent: SendEventFn,
|
|
27
|
+
|};
|
|
28
|
+
declare var Keypad: typeof npm$namespace$Keypad;
|
|
29
|
+
|
|
30
|
+
declare var npm$namespace$Keypad: {|
|
|
31
|
+
(props: Props): React$Node,
|
|
32
|
+
defaultProps: typeof Keypad$defaultProps,
|
|
33
|
+
|};
|
|
34
|
+
declare var Keypad$defaultProps: {|
|
|
35
|
+
extraKeys: empty[],
|
|
36
|
+
|};
|
|
37
|
+
declare export default typeof Keypad;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import ReactDOM from "react-dom";
|
|
4
|
+
import Key from "../../data/keys";
|
|
5
|
+
import { Cursor, KeypadConfiguration, KeyHandler, KeypadAPI } from "../../types";
|
|
6
|
+
/**
|
|
7
|
+
* This is the v2 equivalent of v1's ProvidedKeypad. It follows the same
|
|
8
|
+
* external API so that it can be hot-swapped with the v1 keypad and
|
|
9
|
+
* is responsible for connecting the keypad with MathInput and the Renderer.
|
|
10
|
+
*
|
|
11
|
+
* Ideally this strategy of attaching methods on the class component for
|
|
12
|
+
* other components to call will be replaced props/callbacks since React
|
|
13
|
+
* doesn't support this type of code anymore (functional components
|
|
14
|
+
* can't have methods attached to them).
|
|
15
|
+
*/
|
|
16
|
+
type Props = {
|
|
17
|
+
onElementMounted?: (arg1: any) => void;
|
|
18
|
+
onDismiss?: () => void;
|
|
19
|
+
style?: StyleType;
|
|
20
|
+
};
|
|
21
|
+
type State = {
|
|
22
|
+
active: boolean;
|
|
23
|
+
keypadConfig?: KeypadConfiguration;
|
|
24
|
+
keyHandler?: KeyHandler;
|
|
25
|
+
cursor?: Cursor;
|
|
26
|
+
};
|
|
27
|
+
declare class MobileKeypad extends React.Component<Props, State> implements KeypadAPI {
|
|
28
|
+
hasMounted: boolean;
|
|
29
|
+
state: State;
|
|
30
|
+
activate: () => void;
|
|
31
|
+
dismiss: () => void;
|
|
32
|
+
configure: (configuration: KeypadConfiguration, cb: () => void) => void;
|
|
33
|
+
setCursor: (cursor: Cursor) => void;
|
|
34
|
+
setKeyHandler: (keyHandler: KeyHandler) => void;
|
|
35
|
+
getDOMNode: () => ReturnType<typeof ReactDOM.findDOMNode>;
|
|
36
|
+
_handleClickKey(key: Key): void;
|
|
37
|
+
render(): React.ReactNode;
|
|
38
|
+
}
|
|
39
|
+
export default MobileKeypad;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flowtype definitions for data
|
|
3
|
+
* Generated by Flowgen from a Typescript Definition
|
|
4
|
+
* Flowgen v1.21.0
|
|
5
|
+
* @flow
|
|
6
|
+
*/
|
|
7
|
+
import { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import ReactDOM from "react-dom";
|
|
10
|
+
import Key from "../../data/keys";
|
|
11
|
+
import {
|
|
12
|
+
Cursor,
|
|
13
|
+
KeypadConfiguration,
|
|
14
|
+
KeyHandler,
|
|
15
|
+
KeypadAPI,
|
|
16
|
+
} from "../../types";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* This is the v2 equivalent of v1's ProvidedKeypad. It follows the same
|
|
20
|
+
* external API so that it can be hot-swapped with the v1 keypad and
|
|
21
|
+
* is responsible for connecting the keypad with MathInput and the Renderer.
|
|
22
|
+
*
|
|
23
|
+
* Ideally this strategy of attaching methods on the class component for
|
|
24
|
+
* other components to call will be replaced props/callbacks since React
|
|
25
|
+
* doesn't support this type of code anymore (functional components
|
|
26
|
+
* can't have methods attached to them).
|
|
27
|
+
*/
|
|
28
|
+
declare type Props = {|
|
|
29
|
+
onElementMounted?: (arg1: any) => void,
|
|
30
|
+
onDismiss?: () => void,
|
|
31
|
+
style?: StyleType,
|
|
32
|
+
|};
|
|
33
|
+
declare type State = {|
|
|
34
|
+
active: boolean,
|
|
35
|
+
keypadConfig?: KeypadConfiguration,
|
|
36
|
+
keyHandler?: KeyHandler,
|
|
37
|
+
cursor?: Cursor,
|
|
38
|
+
|};
|
|
39
|
+
declare class MobileKeypad
|
|
40
|
+
extends React.Component<Props, State>
|
|
41
|
+
implements KeypadAPI
|
|
42
|
+
{
|
|
43
|
+
hasMounted: boolean;
|
|
44
|
+
state: State;
|
|
45
|
+
activate: () => void;
|
|
46
|
+
dismiss: () => void;
|
|
47
|
+
configure: (configuration: KeypadConfiguration, cb: () => void) => void;
|
|
48
|
+
setCursor: (cursor: Cursor) => void;
|
|
49
|
+
setKeyHandler: (keyHandler: KeyHandler) => void;
|
|
50
|
+
getDOMNode: () => $Call<
|
|
51
|
+
<R>((...args: any[]) => R) => R,
|
|
52
|
+
typeof ReactDOM.findDOMNode
|
|
53
|
+
>;
|
|
54
|
+
_handleClickKey(key: Key): void;
|
|
55
|
+
render(): React.Node;
|
|
56
|
+
}
|
|
57
|
+
declare export default typeof MobileKeypad;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ClickKeyCallback } from "../../types";
|
|
3
3
|
import { CursorContext } from "../input/cursor-contexts";
|
|
4
|
-
import { TabbarItemType } from "../tabbar
|
|
4
|
+
import { TabbarItemType } from "../tabbar";
|
|
5
5
|
type Props = {
|
|
6
6
|
onClickKey: ClickKeyCallback;
|
|
7
7
|
selectedPage: TabbarItemType;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { ClickKeyCallback } from "../../types";
|
|
8
8
|
import { CursorContext } from "../input/cursor-contexts";
|
|
9
|
-
import { TabbarItemType } from "../tabbar
|
|
9
|
+
import { TabbarItemType } from "../tabbar";
|
|
10
10
|
declare type Props = {|
|
|
11
11
|
onClickKey: ClickKeyCallback,
|
|
12
12
|
selectedPage: TabbarItemType,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* KeypadContext provides a way to the Keypad and (Server)ItemRenderer to
|
|
3
|
+
* communicate.
|
|
4
|
+
*
|
|
5
|
+
* The KeypadContext.Provider wraps the ExerciseFooter while KeypadContext.Consumer
|
|
6
|
+
* wraps each (Server)ItemRenderer render site and the Keypad rendered in the
|
|
7
|
+
* ExerciseFooter.
|
|
8
|
+
*/
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
import type { RendererInterface } from "@khanacademy/perseus-core";
|
|
11
|
+
type KeypadContext = {
|
|
12
|
+
setKeypadElement: (keypadElement?: HTMLElement | null | undefined) => void;
|
|
13
|
+
keypadElement: HTMLElement | null | undefined;
|
|
14
|
+
setRenderer: (renderer?: RendererInterface | null | undefined) => void;
|
|
15
|
+
renderer: RendererInterface | null | undefined;
|
|
16
|
+
setScrollableElement: (scrollableElement?: HTMLElement | null | undefined) => void;
|
|
17
|
+
scrollableElement: HTMLElement | null | undefined;
|
|
18
|
+
};
|
|
19
|
+
declare const context: React.Context<KeypadContext>;
|
|
20
|
+
export default context;
|
|
@@ -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 type { RendererInterface } from "@khanacademy/perseus-core";
|
|
9
|
+
declare type KeypadContext = {|
|
|
10
|
+
setKeypadElement: (keypadElement?: HTMLElement | null | void) => void,
|
|
11
|
+
keypadElement: HTMLElement | null | void,
|
|
12
|
+
setRenderer: (renderer?: RendererInterface | null | void) => void,
|
|
13
|
+
renderer: RendererInterface | null | void,
|
|
14
|
+
setScrollableElement: (scrollableElement?: HTMLElement | null | void) => void,
|
|
15
|
+
scrollableElement: HTMLElement | null | void,
|
|
16
|
+
|};
|
|
17
|
+
declare var context: React.Context<KeypadContext>;
|
|
18
|
+
declare export default typeof context;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./provided-keypad";
|
|
@@ -44,9 +44,9 @@ declare class KeypadButton extends React.PureComponent<Props> {
|
|
|
44
44
|
}
|
|
45
45
|
declare const _default: import("react-redux").ConnectedComponent<typeof KeypadButton, import("react-redux").Omit<Pick<React.ClassAttributes<KeypadButton> & Props, "style" | "ref" | "ariaLabel" | "onTouchCancel" | "onTouchEnd" | "onTouchMove" | "onTouchStart" | "type" | "icon" | "key" | "heightPx" | "widthPx"> & {
|
|
46
46
|
focused?: boolean | undefined;
|
|
47
|
+
disabled?: boolean | undefined;
|
|
47
48
|
borders?: readonly (BorderDirection | undefined)[] | undefined;
|
|
48
49
|
childKeys?: readonly NonManyKeyConfig[] | undefined;
|
|
49
|
-
disabled?: boolean | undefined;
|
|
50
50
|
popoverEnabled?: boolean | undefined;
|
|
51
51
|
} & {}, "heightPx" | "widthPx">>;
|
|
52
52
|
export default _default;
|
|
@@ -67,9 +67,9 @@ declare var _default: $Flowgen$Import$react_2d_redux.ConnectedComponent<
|
|
|
67
67
|
>,
|
|
68
68
|
...{|
|
|
69
69
|
focused?: boolean | void,
|
|
70
|
+
disabled?: boolean | void,
|
|
70
71
|
borders?: $ReadOnlyArray<BorderDirection | void> | void,
|
|
71
72
|
childKeys?: $ReadOnlyArray<NonManyKeyConfig> | void,
|
|
72
|
-
disabled?: boolean | void,
|
|
73
73
|
popoverEnabled?: boolean | void,
|
|
74
74
|
|},
|
|
75
75
|
...{||},
|
|
@@ -35,5 +35,5 @@ declare class KeypadContainer extends React.Component<Props, State> {
|
|
|
35
35
|
renderKeypad: () => JSX.Element;
|
|
36
36
|
render(): JSX.Element;
|
|
37
37
|
}
|
|
38
|
-
declare const _default: import("react-redux").ConnectedComponent<typeof KeypadContainer, import("react-redux").Omit<React.ClassAttributes<KeypadContainer> & Props, "active" | "extraKeys" | "
|
|
38
|
+
declare const _default: import("react-redux").ConnectedComponent<typeof KeypadContainer, import("react-redux").Omit<React.ClassAttributes<KeypadContainer> & Props, "active" | "extraKeys" | "keypadType" | "onPageSizeChange" | "layoutMode" | "navigationPadEnabled">>;
|
|
39
39
|
export default _default;
|
|
@@ -48,8 +48,8 @@ declare var _default: $Flowgen$Import$react_2d_redux.ConnectedComponent<
|
|
|
48
48
|
{| ...React.ClassAttributes<KeypadContainer>, ...Props |},
|
|
49
49
|
| "active"
|
|
50
50
|
| "extraKeys"
|
|
51
|
-
| "onPageSizeChange"
|
|
52
51
|
| "keypadType"
|
|
52
|
+
| "onPageSizeChange"
|
|
53
53
|
| "layoutMode"
|
|
54
54
|
| "navigationPadEnabled"
|
|
55
55
|
>
|
|
@@ -27,5 +27,5 @@ declare class Keypad extends React.Component<Props> {
|
|
|
27
27
|
_onResize: () => void;
|
|
28
28
|
render(): JSX.Element;
|
|
29
29
|
}
|
|
30
|
-
declare const _default: import("react-redux").ConnectedComponent<typeof Keypad, import("react-redux").Omit<React.ClassAttributes<Keypad> & Props, "
|
|
30
|
+
declare const _default: import("react-redux").ConnectedComponent<typeof Keypad, import("react-redux").Omit<React.ClassAttributes<Keypad> & Props, "active" | "popover" | "echoes" | "removeEcho">>;
|
|
31
31
|
export default _default;
|
|
@@ -34,7 +34,7 @@ declare var _default: $Flowgen$Import$react_2d_redux.ConnectedComponent<
|
|
|
34
34
|
typeof Keypad,
|
|
35
35
|
$Flowgen$Import$react_2d_redux.Omit<
|
|
36
36
|
{| ...React.ClassAttributes<Keypad>, ...Props |},
|
|
37
|
-
"
|
|
37
|
+
"active" | "popover" | "echoes" | "removeEcho"
|
|
38
38
|
>
|
|
39
39
|
>;
|
|
40
40
|
declare export default typeof _default;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import ReactDOM from "react-dom";
|
|
3
|
-
import type { Cursor, KeypadConfiguration, KeyHandler } from "../../types";
|
|
3
|
+
import type { Cursor, KeypadConfiguration, KeyHandler, KeypadAPI } from "../../types";
|
|
4
4
|
import type { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
5
5
|
type Props = {
|
|
6
6
|
onElementMounted?: (arg1: any) => void;
|
|
7
7
|
onDismiss?: () => void;
|
|
8
8
|
style?: StyleType;
|
|
9
9
|
};
|
|
10
|
-
declare class ProvidedKeypad extends React.Component<Props> {
|
|
10
|
+
declare class ProvidedKeypad extends React.Component<Props> implements KeypadAPI {
|
|
11
11
|
store: any;
|
|
12
12
|
constructor(props: any);
|
|
13
13
|
activate: () => void;
|
|
@@ -6,14 +6,22 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
import ReactDOM from "react-dom";
|
|
9
|
-
import type {
|
|
9
|
+
import type {
|
|
10
|
+
Cursor,
|
|
11
|
+
KeypadConfiguration,
|
|
12
|
+
KeyHandler,
|
|
13
|
+
KeypadAPI,
|
|
14
|
+
} from "../../types";
|
|
10
15
|
import type { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
11
16
|
declare type Props = {|
|
|
12
17
|
onElementMounted?: (arg1: any) => void,
|
|
13
18
|
onDismiss?: () => void,
|
|
14
19
|
style?: StyleType,
|
|
15
20
|
|};
|
|
16
|
-
declare class ProvidedKeypad
|
|
21
|
+
declare class ProvidedKeypad
|
|
22
|
+
extends React.Component<Props>
|
|
23
|
+
implements KeypadAPI
|
|
24
|
+
{
|
|
17
25
|
store: any;
|
|
18
26
|
constructor(props: any): this;
|
|
19
27
|
activate: () => void;
|
|
@@ -33,5 +33,5 @@ declare class TouchableKeypadButton extends React.Component<Props> {
|
|
|
33
33
|
componentWillUnmount(): void;
|
|
34
34
|
render(): JSX.Element;
|
|
35
35
|
}
|
|
36
|
-
declare const _default: import("react-redux").ConnectedComponent<typeof TouchableKeypadButton, import("react-redux").Omit<React.ClassAttributes<TouchableKeypadButton> & Props, "style" | "ariaLabel" | "type" | "id" | "icon" | "
|
|
36
|
+
declare const _default: import("react-redux").ConnectedComponent<typeof TouchableKeypadButton, import("react-redux").Omit<React.ClassAttributes<TouchableKeypadButton> & Props, "style" | "ariaLabel" | "type" | "id" | "icon" | "focused" | "disabled" | "childKeyIds" | "borders" | "childKeys" | "popoverEnabled" | "gestureManager"> & OwnProps>;
|
|
37
37
|
export default _default;
|
|
@@ -45,11 +45,11 @@ declare var _default: $Flowgen$Import$react_2d_redux.ConnectedComponent<
|
|
|
45
45
|
| "type"
|
|
46
46
|
| "id"
|
|
47
47
|
| "icon"
|
|
48
|
-
| "childKeyIds"
|
|
49
48
|
| "focused"
|
|
49
|
+
| "disabled"
|
|
50
|
+
| "childKeyIds"
|
|
50
51
|
| "borders"
|
|
51
52
|
| "childKeys"
|
|
52
|
-
| "disabled"
|
|
53
53
|
| "popoverEnabled"
|
|
54
54
|
| "gestureManager"
|
|
55
55
|
>,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import * as $Flowgen$Import$react_2d_redux from "react-redux";
|
|
8
8
|
import * as React from "react";
|
|
9
|
-
import { TabbarItemType } from "../tabbar
|
|
9
|
+
import type { TabbarItemType } from "../tabbar";
|
|
10
10
|
declare interface ReduxProps {
|
|
11
11
|
paginationEnabled: boolean;
|
|
12
12
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
3
|
+
type Props = {
|
|
4
|
+
onElementMounted?: (arg1: any) => void;
|
|
5
|
+
onDismiss?: () => void;
|
|
6
|
+
style?: StyleType;
|
|
7
|
+
useV2Keypad?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare function KeypadSwitch(props: Props): JSX.Element;
|
|
10
|
+
export default KeypadSwitch;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flowtype definitions for data
|
|
3
|
+
* Generated by Flowgen from a Typescript Definition
|
|
4
|
+
* Flowgen v1.21.0
|
|
5
|
+
* @flow
|
|
6
|
+
*/
|
|
7
|
+
import { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
8
|
+
declare type Props = {|
|
|
9
|
+
onElementMounted?: (arg1: any) => void,
|
|
10
|
+
onDismiss?: () => void,
|
|
11
|
+
style?: StyleType,
|
|
12
|
+
useV2Keypad?: boolean,
|
|
13
|
+
|};
|
|
14
|
+
declare function KeypadSwitch(props: Props): React$Node;
|
|
15
|
+
declare export default typeof KeypadSwitch;
|