@khanacademy/math-input 8.1.2 → 9.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 +19 -0
- package/dist/components/input/cursor-contexts.d.ts +9 -9
- package/dist/components/input/math-wrapper.d.ts +4 -4
- package/dist/components/input/mathquill-helpers.d.ts +1 -1
- package/dist/components/input/mathquill-instance.d.ts +1 -1
- package/dist/components/input/mathquill-types.d.ts +2 -2
- package/dist/components/key-handlers/handle-arrow.d.ts +2 -2
- package/dist/components/key-handlers/handle-backspace.d.ts +1 -1
- package/dist/components/key-handlers/handle-exponent.d.ts +2 -2
- package/dist/components/key-handlers/handle-jump-out.d.ts +2 -2
- package/dist/components/key-handlers/key-translator.d.ts +2 -2
- package/dist/components/keypad/button-assets.d.ts +1 -1
- package/dist/components/keypad/keypad-button.d.ts +1 -1
- package/dist/components/keypad/keypad-pages/extras-page.d.ts +2 -2
- package/dist/components/keypad/keypad-pages/fractions-page.d.ts +9 -0
- package/dist/components/keypad/keypad-pages/geometry-page.d.ts +1 -1
- package/dist/components/keypad/keypad-pages/numbers-page.d.ts +1 -1
- package/dist/components/keypad/keypad-pages/operators-page.d.ts +1 -1
- package/dist/components/keypad/keypad.d.ts +4 -3
- package/dist/components/keypad/mobile-keypad.d.ts +3 -3
- package/dist/components/keypad/shared-keys.d.ts +3 -3
- package/dist/components/keypad/utils.d.ts +2 -0
- package/dist/components/keypad-legacy/compute-layout-parameters.d.ts +1 -1
- package/dist/components/keypad-legacy/empty-keypad-button.d.ts +1 -1
- package/dist/components/keypad-legacy/gesture-manager.d.ts +3 -3
- package/dist/components/keypad-legacy/gesture-state-machine.d.ts +1 -1
- package/dist/components/keypad-legacy/keypad-button.d.ts +2 -1
- package/dist/components/keypad-legacy/multi-symbol-grid.d.ts +1 -1
- package/dist/components/keypad-legacy/multi-symbol-popover.d.ts +1 -1
- package/dist/components/keypad-legacy/node-manager.d.ts +1 -1
- package/dist/components/keypad-legacy/store/actions.d.ts +1 -1
- package/dist/components/keypad-legacy/store/types.d.ts +3 -3
- package/dist/components/keypad-legacy/touchable-keypad-button.d.ts +3 -3
- package/dist/components/keypad-switch.d.ts +1 -1
- package/dist/components/prop-types.d.ts +12 -0
- package/dist/components/tabbar/tabbar.d.ts +2 -2
- package/dist/components/tabbar/types.d.ts +1 -1
- package/dist/data/key-configs.d.ts +2 -2
- package/dist/es/index.js +848 -240
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +848 -240
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +6 -5
- package/package.json +6 -6
- package/src/components/input/cursor-contexts.ts +9 -9
- package/src/components/input/math-input.tsx +12 -12
- package/src/components/input/math-wrapper.ts +7 -3
- package/src/components/input/mathquill-helpers.ts +3 -5
- package/src/components/input/mathquill-instance.ts +1 -1
- package/src/components/input/mathquill-types.ts +5 -2
- package/src/components/key-handlers/handle-arrow.ts +4 -3
- package/src/components/key-handlers/handle-backspace.ts +3 -2
- package/src/components/key-handlers/handle-exponent.ts +4 -5
- package/src/components/key-handlers/handle-jump-out.ts +4 -5
- package/src/components/key-handlers/key-translator.ts +6 -5
- package/src/components/keypad/__tests__/keypad-button.test.tsx +44 -3
- package/src/components/keypad/__tests__/keypad-v2-mathquill.test.tsx +4 -3
- package/src/components/keypad/__tests__/keypad-v2.cypress.ts +2 -32
- package/src/components/keypad/__tests__/keypad.test.tsx +46 -0
- package/src/components/keypad/__tests__/test-data-tabs.ts +21 -0
- package/src/components/keypad/button-assets.tsx +761 -60
- package/src/components/keypad/keypad-button.stories.tsx +4 -2
- package/src/components/keypad/keypad-button.tsx +2 -3
- package/src/components/keypad/keypad-mathquill.stories.tsx +3 -2
- package/src/components/keypad/keypad-pages/extras-page.tsx +3 -2
- package/src/components/keypad/keypad-pages/fractions-page.tsx +125 -0
- package/src/components/keypad/keypad-pages/geometry-page.tsx +2 -1
- package/src/components/keypad/keypad-pages/numbers-page.tsx +2 -1
- package/src/components/keypad/keypad-pages/operators-page.tsx +2 -1
- package/src/components/keypad/keypad.stories.tsx +17 -2
- package/src/components/keypad/keypad.tsx +56 -22
- package/src/components/keypad/mobile-keypad.tsx +10 -3
- package/src/components/keypad/shared-keys.tsx +5 -28
- package/src/components/keypad/utils.ts +30 -0
- package/src/components/keypad-context.ts +1 -1
- package/src/components/keypad-legacy/compute-layout-parameters.ts +1 -1
- package/src/components/keypad-legacy/echo-manager.tsx +1 -1
- package/src/components/keypad-legacy/empty-keypad-button.tsx +1 -1
- package/src/components/keypad-legacy/gesture-manager.ts +4 -4
- package/src/components/keypad-legacy/gesture-state-machine.ts +1 -1
- package/src/components/keypad-legacy/keypad-button.tsx +2 -1
- package/src/components/keypad-legacy/many-keypad-button.tsx +2 -1
- package/src/components/keypad-legacy/multi-symbol-grid.tsx +2 -1
- package/src/components/keypad-legacy/multi-symbol-popover.tsx +2 -1
- package/src/components/keypad-legacy/node-manager.ts +1 -1
- package/src/components/keypad-legacy/store/actions.ts +1 -2
- package/src/components/keypad-legacy/store/index.ts +1 -1
- package/src/components/keypad-legacy/store/types.ts +3 -4
- package/src/components/keypad-legacy/touchable-keypad-button.tsx +3 -3
- package/src/components/keypad-legacy/two-page-keypad.tsx +1 -1
- package/src/components/keypad-switch.tsx +2 -1
- package/src/components/{prop-types.js → prop-types.ts} +1 -0
- package/src/components/tabbar/tabbar.tsx +4 -2
- package/src/components/tabbar/types.ts +1 -0
- package/src/data/key-configs.ts +4 -3
- package/src/full-math-input.stories.tsx +36 -4
- package/src/index.ts +1 -0
- package/src/types.ts +6 -6
- package/tsconfig-build.tsbuildinfo +1 -1
- package/dist/components/common-style.js.flow +0 -27
- package/dist/components/input/cursor-contexts.js.flow +0 -26
- package/dist/components/input/cursor-handle.js.flow +0 -28
- package/dist/components/input/drag-listener.js.flow +0 -19
- package/dist/components/input/math-input.js.flow +0 -153
- package/dist/components/input/math-wrapper.js.flow +0 -54
- package/dist/components/input/mathquill-helpers.js.flow +0 -56
- package/dist/components/input/mathquill-instance.js.flow +0 -24
- package/dist/components/input/mathquill-types.js.flow +0 -362
- package/dist/components/input/scroll-into-view.js.flow +0 -20
- package/dist/components/key-handlers/handle-arrow.js.flow +0 -12
- package/dist/components/key-handlers/handle-backspace.js.flow +0 -14
- package/dist/components/key-handlers/handle-exponent.js.flow +0 -12
- package/dist/components/key-handlers/handle-jump-out.js.flow +0 -14
- package/dist/components/key-handlers/key-translator.js.flow +0 -10
- package/dist/components/keypad/button-assets.js.flow +0 -12
- package/dist/components/keypad/index.js.flow +0 -8
- package/dist/components/keypad/keypad-button.js.flow +0 -18
- package/dist/components/keypad/keypad-pages/extras-page.js.flow +0 -13
- package/dist/components/keypad/keypad-pages/geometry-page.js.flow +0 -11
- package/dist/components/keypad/keypad-pages/numbers-page.js.flow +0 -11
- package/dist/components/keypad/keypad-pages/operators-page.js.flow +0 -15
- package/dist/components/keypad/keypad.js.flow +0 -37
- package/dist/components/keypad/mobile-keypad.js.flow +0 -57
- package/dist/components/keypad/shared-keys.js.flow +0 -20
- package/dist/components/keypad-context.js.flow +0 -18
- package/dist/components/keypad-legacy/compute-layout-parameters.js.flow +0 -21
- package/dist/components/keypad-legacy/corner-decal.js.flow +0 -15
- package/dist/components/keypad-legacy/echo-manager.js.flow +0 -20
- package/dist/components/keypad-legacy/empty-keypad-button.js.flow +0 -23
- package/dist/components/keypad-legacy/expression-keypad.js.flow +0 -34
- package/dist/components/keypad-legacy/fraction-keypad.js.flow +0 -33
- package/dist/components/keypad-legacy/gesture-manager.js.flow +0 -97
- package/dist/components/keypad-legacy/gesture-state-machine.js.flow +0 -118
- package/dist/components/keypad-legacy/icon.js.flow +0 -18
- package/dist/components/keypad-legacy/index.js.flow +0 -7
- package/dist/components/keypad-legacy/keypad-button.js.flow +0 -80
- package/dist/components/keypad-legacy/keypad-container.js.flow +0 -63
- package/dist/components/keypad-legacy/keypad.js.flow +0 -40
- package/dist/components/keypad-legacy/many-keypad-button.js.flow +0 -17
- package/dist/components/keypad-legacy/math-icon.js.flow +0 -19
- package/dist/components/keypad-legacy/multi-symbol-grid.js.flow +0 -16
- package/dist/components/keypad-legacy/multi-symbol-popover.js.flow +0 -15
- package/dist/components/keypad-legacy/navigation-pad.js.flow +0 -16
- package/dist/components/keypad-legacy/node-manager.js.flow +0 -60
- package/dist/components/keypad-legacy/popover-manager.js.flow +0 -15
- package/dist/components/keypad-legacy/popover-state-machine.js.flow +0 -77
- package/dist/components/keypad-legacy/provided-keypad.js.flow +0 -38
- package/dist/components/keypad-legacy/store/actions.js.flow +0 -90
- package/dist/components/keypad-legacy/store/echo-reducer.js.flow +0 -10
- package/dist/components/keypad-legacy/store/index.js.flow +0 -22
- package/dist/components/keypad-legacy/store/input-reducer.js.flow +0 -13
- package/dist/components/keypad-legacy/store/keypad-reducer.js.flow +0 -13
- package/dist/components/keypad-legacy/store/layout-reducer.js.flow +0 -13
- package/dist/components/keypad-legacy/store/shared.js.flow +0 -14
- package/dist/components/keypad-legacy/store/types.js.flow +0 -53
- package/dist/components/keypad-legacy/styles.js.flow +0 -11
- package/dist/components/keypad-legacy/svg-icon.js.flow +0 -15
- package/dist/components/keypad-legacy/text-icon.js.flow +0 -16
- package/dist/components/keypad-legacy/touchable-keypad-button.js.flow +0 -59
- package/dist/components/keypad-legacy/two-page-keypad.js.flow +0 -31
- package/dist/components/keypad-legacy/z-indexes.js.flow +0 -13
- package/dist/components/keypad-switch.js.flow +0 -15
- package/dist/components/tabbar/icons.js.flow +0 -14
- package/dist/components/tabbar/index.js.flow +0 -8
- package/dist/components/tabbar/item.js.flow +0 -19
- package/dist/components/tabbar/tabbar.js.flow +0 -18
- package/dist/components/tabbar/types.js.flow +0 -12
- package/dist/data/key-configs.js.flow +0 -10
- package/dist/data/keys.js.flow +0 -122
- package/dist/enums.js.flow +0 -54
- package/dist/fake-react-native-web/index.js.flow +0 -8
- package/dist/fake-react-native-web/text.js.flow +0 -19
- package/dist/fake-react-native-web/view.js.flow +0 -29
- package/dist/index.js.flow +0 -24
- package/dist/types.js.flow +0 -91
- package/dist/utils.js.flow +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @khanacademy/math-input
|
|
2
2
|
|
|
3
|
+
## 9.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 0993a46b: Don't generate Flow types
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- 87aadc43: Surface event from `onClickKey` callback
|
|
12
|
+
- b93f9f74: Added new Mobile Fraction Keypad View to the V2 Keypad
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 302ca7f7: Fix type for parameters of `moveOutOf` event.
|
|
17
|
+
- afb14cff: Add eslint rule to make type imports consistent
|
|
18
|
+
- 19054322: Tweak to capital letter icon buttons
|
|
19
|
+
- ce5e6297: Upgrade wonder-blocks deps to package versions without Flow types
|
|
20
|
+
- 196d2a39: Add icons for all letters
|
|
21
|
+
|
|
3
22
|
## 8.1.2
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
* now, we show the dismiss button rather than allowing the user to jump out of
|
|
10
10
|
* the radical.
|
|
11
11
|
*/
|
|
12
|
-
export declare
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
12
|
+
export declare enum CursorContext {
|
|
13
|
+
NONE = "NONE",
|
|
14
|
+
IN_PARENS = "IN_PARENS",
|
|
15
|
+
IN_SUPER_SCRIPT = "IN_SUPER_SCRIPT",
|
|
16
|
+
IN_SUB_SCRIPT = "IN_SUB_SCRIPT",
|
|
17
|
+
IN_NUMERATOR = "IN_NUMERATOR",
|
|
18
|
+
IN_DENOMINATOR = "IN_DENOMINATOR",
|
|
19
|
+
BEFORE_FRACTION = "BEFORE_FRACTION"
|
|
20
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Key from "../../data/keys";
|
|
2
|
-
import { Cursor } from "../../types";
|
|
3
|
-
import { MathFieldInterface } from "./mathquill-types";
|
|
1
|
+
import type Key from "../../data/keys";
|
|
2
|
+
import type { Cursor } from "../../types";
|
|
3
|
+
import type { MathFieldInterface } from "./mathquill-types";
|
|
4
4
|
/**
|
|
5
5
|
* This file contains a wrapper around MathQuill so that we can provide a
|
|
6
6
|
* more regular interface for the functionality we need while insulating us
|
|
@@ -31,7 +31,7 @@ declare class MathWrapper {
|
|
|
31
31
|
*/
|
|
32
32
|
setCursorPosition(x: number, y: number, hitNode: HTMLElement): void;
|
|
33
33
|
getCursor(): any;
|
|
34
|
-
contextForCursor(): "
|
|
34
|
+
contextForCursor(): import("./cursor-contexts").CursorContext;
|
|
35
35
|
getSelection(): any;
|
|
36
36
|
getContent(): string;
|
|
37
37
|
setContent(latex: string): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CursorContext } from "./cursor-contexts";
|
|
2
|
-
import { MathFieldCursor, MathFieldInterface } from "./mathquill-types";
|
|
2
|
+
import type { MathFieldCursor, MathFieldInterface } from "./mathquill-types";
|
|
3
3
|
export declare function getCursor(mathField: MathFieldInterface): MathFieldCursor;
|
|
4
4
|
export declare function isFraction(node: any): boolean;
|
|
5
5
|
export declare function isNumerator(node: any): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MathQuillInterface, MathFieldConfig } from "./mathquill-types";
|
|
1
|
+
import type { MathQuillInterface, MathFieldConfig } from "./mathquill-types";
|
|
2
2
|
export declare const mathQuillInstance: MathQuillInterface;
|
|
3
3
|
/**
|
|
4
4
|
* Creates a new [MathField](http://docs.mathquill.com/en/latest/Api_Methods/#mqmathfieldhtml_element-config)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Key from "../../data/keys";
|
|
1
|
+
import type Key from "../../data/keys";
|
|
2
2
|
export interface MathQuillInterface {
|
|
3
3
|
L: "L";
|
|
4
4
|
R: "R";
|
|
@@ -148,7 +148,7 @@ export type MathFieldConfig = {
|
|
|
148
148
|
handlers?: {
|
|
149
149
|
edit?: (mathField: MathFieldInterface) => void;
|
|
150
150
|
enter?: (mathField: MathFieldInterface) => void;
|
|
151
|
-
moveOutOf?: (mathField: MathFieldInterface) => void;
|
|
151
|
+
moveOutOf?: (direction: MathQuillDirection, mathField: MathFieldInterface) => void;
|
|
152
152
|
upOutOf?: (mathField: MathFieldInterface) => void;
|
|
153
153
|
downOutOf?: (mathField: MathFieldInterface) => void;
|
|
154
154
|
deleteOutOf?: (direction: MathQuillDirection, mathField: MathFieldInterface) => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import Key from "../../data/keys";
|
|
2
|
-
import { MathFieldInterface } from "../input/mathquill-types";
|
|
1
|
+
import type Key from "../../data/keys";
|
|
2
|
+
import type { MathFieldInterface } from "../input/mathquill-types";
|
|
3
3
|
export default function handleArrow(mathField: MathFieldInterface, key: Key): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MathFieldInterface } from "../input/mathquill-types";
|
|
1
|
+
import type { MathFieldInterface } from "../input/mathquill-types";
|
|
2
2
|
/**
|
|
3
3
|
* Selects and deletes part of the expression based on the cursor location.
|
|
4
4
|
* See inline comments for precise behavior of different cases.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import Key from "../../data/keys";
|
|
2
|
-
import { MathFieldInterface } from "../input/mathquill-types";
|
|
1
|
+
import type Key from "../../data/keys";
|
|
2
|
+
import type { MathFieldInterface } from "../input/mathquill-types";
|
|
3
3
|
export default function handleExponent(mathField: MathFieldInterface, key: Key): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Key from "../../data/keys";
|
|
2
|
-
import { MathFieldInterface } from "../input/mathquill-types";
|
|
1
|
+
import type Key from "../../data/keys";
|
|
2
|
+
import type { MathFieldInterface } from "../input/mathquill-types";
|
|
3
3
|
/**
|
|
4
4
|
* Advances the cursor to the next logical position.
|
|
5
5
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Key from "../../data/keys";
|
|
2
|
-
import { MathFieldUpdaterCallback } from "../input/mathquill-types";
|
|
1
|
+
import type Key from "../../data/keys";
|
|
2
|
+
import type { MathFieldUpdaterCallback } from "../input/mathquill-types";
|
|
3
3
|
declare const keyToMathquillMap: Record<Key, MathFieldUpdaterCallback>;
|
|
4
4
|
export default keyToMathquillMap;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { KeyConfig, ClickKeyCallback } from "../../types";
|
|
2
|
+
import type { KeyConfig, ClickKeyCallback } from "../../types";
|
|
3
3
|
import type { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
4
4
|
export type KeypadButtonProps = {
|
|
5
5
|
coord: readonly [number, number];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import Key from "../../../data/keys";
|
|
3
|
-
import { ClickKeyCallback } from "../../../types";
|
|
2
|
+
import type Key from "../../../data/keys";
|
|
3
|
+
import type { ClickKeyCallback } from "../../../types";
|
|
4
4
|
type Props = {
|
|
5
5
|
extraKeys: ReadonlyArray<Key>;
|
|
6
6
|
onClickKey: ClickKeyCallback;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ClickKeyCallback } from "../../../types";
|
|
3
|
+
import type { CursorContext } from "../../input/cursor-contexts";
|
|
4
|
+
type Props = {
|
|
5
|
+
onClickKey: ClickKeyCallback;
|
|
6
|
+
cursorContext?: typeof CursorContext[keyof typeof CursorContext];
|
|
7
|
+
};
|
|
8
|
+
export default function FractionsPage(props: Props): JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import Key from "../../data/keys";
|
|
3
|
-
import { ClickKeyCallback } from "../../types";
|
|
4
|
-
import { CursorContext } from "../input/cursor-contexts";
|
|
2
|
+
import type Key from "../../data/keys";
|
|
3
|
+
import type { ClickKeyCallback } from "../../types";
|
|
4
|
+
import type { CursorContext } from "../input/cursor-contexts";
|
|
5
5
|
import type { SendEventFn } from "@khanacademy/perseus-core";
|
|
6
6
|
export type Props = {
|
|
7
7
|
extraKeys: ReadonlyArray<Key>;
|
|
@@ -14,6 +14,7 @@ export type Props = {
|
|
|
14
14
|
logarithms?: boolean;
|
|
15
15
|
basicRelations?: boolean;
|
|
16
16
|
advancedRelations?: boolean;
|
|
17
|
+
fractionsOnly?: boolean;
|
|
17
18
|
onClickKey: ClickKeyCallback;
|
|
18
19
|
sendEvent?: SendEventFn;
|
|
19
20
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import ReactDOM from "react-dom";
|
|
4
|
-
import Key from "../../data/keys";
|
|
5
|
-
import { Cursor, KeypadConfiguration, KeyHandler, KeypadAPI } from "../../types";
|
|
3
|
+
import type Key from "../../data/keys";
|
|
4
|
+
import type { Cursor, KeypadConfiguration, KeyHandler, KeypadAPI } from "../../types";
|
|
5
|
+
import type { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
6
6
|
/**
|
|
7
7
|
* This is the v2 equivalent of v1's ProvidedKeypad. It follows the same
|
|
8
8
|
* external API so that it can be hot-swapped with the v1 keypad and
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ClickKeyCallback } from "../../types";
|
|
3
|
-
import { CursorContext } from "../input/cursor-contexts";
|
|
4
|
-
import { TabbarItemType } from "../tabbar";
|
|
2
|
+
import type { ClickKeyCallback } from "../../types";
|
|
3
|
+
import type { CursorContext } from "../input/cursor-contexts";
|
|
4
|
+
import type { TabbarItemType } from "../tabbar";
|
|
5
5
|
type Props = {
|
|
6
6
|
onClickKey: ClickKeyCallback;
|
|
7
7
|
selectedPage: TabbarItemType;
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* might need to be.
|
|
20
20
|
*/
|
|
21
21
|
import { DeviceOrientation, LayoutMode } from "../../enums";
|
|
22
|
-
import { GridDimensions, WidthHeight } from "./store/types";
|
|
22
|
+
import type { GridDimensions, WidthHeight } from "./store/types";
|
|
23
23
|
type ComputedLayoutProperty = {
|
|
24
24
|
buttonDimensions: WidthHeight;
|
|
25
25
|
layoutMode: LayoutMode;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* A keypad button containing no symbols and triggering no actions on click.
|
|
3
3
|
*/
|
|
4
4
|
import * as React from "react";
|
|
5
|
-
import GestureManager from "./gesture-manager";
|
|
5
|
+
import type GestureManager from "./gesture-manager";
|
|
6
6
|
interface ReduxProps {
|
|
7
7
|
gestureManager: GestureManager;
|
|
8
8
|
}
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
* connects our various bits of logic for managing gestures and interactions,
|
|
4
4
|
* and links them together.
|
|
5
5
|
*/
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
import Key from "../../data/keys";
|
|
8
|
-
import { ActiveNodesObj, LayoutProps } from "../../types";
|
|
9
6
|
import GestureStateMachine from "./gesture-state-machine";
|
|
10
7
|
import NodeManager from "./node-manager";
|
|
11
8
|
import PopoverStateMachine from "./popover-state-machine";
|
|
9
|
+
import type Key from "../../data/keys";
|
|
10
|
+
import type { ActiveNodesObj, LayoutProps } from "../../types";
|
|
11
|
+
import type * as React from "react";
|
|
12
12
|
type Options = {
|
|
13
13
|
swipeEnabled: boolean;
|
|
14
14
|
};
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* A component that renders a keypad button.
|
|
3
3
|
*/
|
|
4
4
|
import * as React from "react";
|
|
5
|
-
import { BorderDirection
|
|
5
|
+
import { BorderDirection } from "../../enums";
|
|
6
|
+
import type { KeyType } from "../../enums";
|
|
6
7
|
import type { Border, NonManyKeyConfig, IconConfig } from "../../types";
|
|
7
8
|
import type { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
8
9
|
interface ReduxProps {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Key from "../../../data/keys";
|
|
2
|
-
import { LayoutMode, KeypadType } from "../../../enums";
|
|
3
|
-
import GestureManager from "../gesture-manager";
|
|
1
|
+
import type Key from "../../../data/keys";
|
|
2
|
+
import type { LayoutMode, KeypadType } from "../../../enums";
|
|
4
3
|
import type { Cursor, KeyHandler, Popover, Echo } from "../../../types";
|
|
4
|
+
import type GestureManager from "../gesture-manager";
|
|
5
5
|
export interface InputState {
|
|
6
6
|
keyHandler: KeyHandler | null;
|
|
7
7
|
cursor: Cursor | undefined;
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* touch events globally) opaque to the KeypadButton.
|
|
5
5
|
*/
|
|
6
6
|
import * as React from "react";
|
|
7
|
-
import Key from "../../data/keys";
|
|
8
|
-
import { KeyType } from "../../enums";
|
|
9
|
-
import GestureManager from "./gesture-manager";
|
|
7
|
+
import type Key from "../../data/keys";
|
|
8
|
+
import type { KeyType } from "../../enums";
|
|
10
9
|
import type { Border, IconConfig, KeyConfig } from "../../types";
|
|
10
|
+
import type GestureManager from "./gesture-manager";
|
|
11
11
|
import type { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
12
12
|
interface SharedProps {
|
|
13
13
|
borders?: Border;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React PropTypes that may be shared between components.
|
|
3
|
+
*/
|
|
4
|
+
import PropTypes from "prop-types";
|
|
5
|
+
export declare const keypadElementPropType: PropTypes.Requireable<PropTypes.InferProps<{
|
|
6
|
+
activate: PropTypes.Validator<(...args: any[]) => any>;
|
|
7
|
+
dismiss: PropTypes.Validator<(...args: any[]) => any>;
|
|
8
|
+
configure: PropTypes.Validator<(...args: any[]) => any>;
|
|
9
|
+
setCursor: PropTypes.Validator<(...args: any[]) => any>;
|
|
10
|
+
setKeyHandler: PropTypes.Validator<(...args: any[]) => any>;
|
|
11
|
+
getDOMNode: PropTypes.Validator<(...args: any[]) => any>;
|
|
12
|
+
}>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
2
1
|
import * as React from "react";
|
|
3
|
-
import { TabbarItemType } from "./types";
|
|
2
|
+
import type { TabbarItemType } from "./types";
|
|
3
|
+
import type { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
4
4
|
type Props = {
|
|
5
5
|
items: ReadonlyArray<TabbarItemType>;
|
|
6
6
|
selectedItem: TabbarItemType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type TabbarItemType = "Geometry" | "Operators" | "Numbers" | "Extras" | "Dismiss";
|
|
1
|
+
export type TabbarItemType = "Geometry" | "Operators" | "Numbers" | "Fractions" | "Extras" | "Dismiss";
|