@khanacademy/math-input 2.0.0 → 4.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 +55 -0
- package/dist/components/input/__tests__/test-math-wrapper.d.ts +1 -1
- package/dist/components/input/__tests__/test-math-wrapper.js.flow +1 -1
- package/dist/components/input/key-handlers/handle-arrow.d.ts +3 -0
- package/dist/components/input/key-handlers/handle-arrow.js.flow +12 -0
- package/dist/components/input/key-handlers/handle-backspace.d.ts +7 -0
- package/dist/components/input/key-handlers/handle-backspace.js.flow +14 -0
- package/dist/components/input/key-handlers/handle-exponent.d.ts +3 -0
- package/dist/components/input/key-handlers/handle-exponent.js.flow +12 -0
- package/dist/components/input/key-handlers/handle-jump-out.d.ts +7 -0
- package/dist/components/input/key-handlers/handle-jump-out.js.flow +14 -0
- package/dist/components/input/math-input.d.ts +1 -1
- package/dist/components/input/math-input.js.flow +1 -1
- package/dist/components/input/math-wrapper.d.ts +7 -78
- package/dist/components/input/math-wrapper.js.flow +16 -78
- package/dist/components/input/mathquill-helpers.d.ts +46 -0
- package/dist/components/input/mathquill-helpers.js.flow +56 -0
- package/dist/components/input/mathquill-instance.d.ts +3 -0
- package/dist/components/input/mathquill-instance.js.flow +9 -0
- package/dist/components/input/mathquill-types.d.ts +25 -0
- package/dist/components/input/mathquill-types.js.flow +34 -0
- package/dist/components/key-translator.d.ts +4 -0
- package/dist/components/key-translator.js.flow +10 -0
- package/dist/components/keypad/button-assets.d.ts +2 -2
- package/dist/components/keypad/button-assets.js.flow +2 -2
- package/dist/components/keypad/button.d.ts +1 -2
- package/dist/components/keypad/button.js.flow +1 -1
- package/dist/components/keypad/{pre-algebra-page.d.ts → geometry-page/index.d.ts} +1 -1
- package/dist/components/keypad/{pre-algebra-page.js.flow → geometry-page/index.js.flow} +1 -1
- package/dist/components/keypad/index.d.ts +5 -4
- package/dist/components/keypad/index.js.flow +9 -4
- package/dist/components/keypad/keypad-page-items.d.ts +9 -3
- package/dist/components/keypad/keypad-page-items.js.flow +9 -3
- package/dist/components/keypad/{numeric-input-page.d.ts → numbers-page/index.d.ts} +3 -2
- package/dist/components/keypad/numbers-page/index.js.flow +17 -0
- package/dist/components/keypad/numbers-page/types.d.ts +4 -0
- package/dist/components/keypad/numbers-page/types.js.flow +10 -0
- package/dist/components/keypad/operators-page/advanced-relations-buttons.d.ts +7 -0
- package/dist/components/keypad/{numeric-input-page.js.flow → operators-page/advanced-relations-buttons.js.flow} +3 -4
- package/dist/components/keypad/operators-page/basic-relations-buttons.d.ts +7 -0
- package/dist/components/keypad/{trigonometry-page.js.flow → operators-page/basic-relations-buttons.js.flow} +3 -6
- package/dist/components/keypad/operators-page/index.d.ts +9 -0
- package/dist/components/keypad/operators-page/index.js.flow +17 -0
- package/dist/components/keypad/operators-page/logarithms-buttons.d.ts +7 -0
- package/dist/components/keypad/operators-page/logarithms-buttons.js.flow +12 -0
- package/dist/components/keypad/operators-page/pre-algebra-buttons.d.ts +7 -0
- package/dist/components/keypad/operators-page/pre-algebra-buttons.js.flow +12 -0
- package/dist/components/keypad/operators-page/types.d.ts +6 -0
- package/dist/components/keypad/operators-page/types.js.flow +12 -0
- package/dist/components/{compute-layout-parameters.d.ts → keypad-legacy/compute-layout-parameters.d.ts} +1 -1
- package/dist/components/{compute-layout-parameters.js.flow → keypad-legacy/compute-layout-parameters.js.flow} +1 -1
- package/dist/components/{echo-manager.d.ts → keypad-legacy/echo-manager.d.ts} +2 -11
- package/dist/components/{echo-manager.js.flow → keypad-legacy/echo-manager.js.flow} +2 -11
- package/dist/components/{expression-keypad.d.ts → keypad-legacy/expression-keypad.d.ts} +3 -4
- package/dist/components/{expression-keypad.js.flow → keypad-legacy/expression-keypad.js.flow} +3 -4
- package/dist/components/{fraction-keypad.d.ts → keypad-legacy/fraction-keypad.d.ts} +2 -2
- package/dist/components/{fraction-keypad.js.flow → keypad-legacy/fraction-keypad.js.flow} +2 -2
- package/dist/components/{gesture-manager.d.ts → keypad-legacy/gesture-manager.d.ts} +22 -10
- package/dist/components/{gesture-manager.js.flow → keypad-legacy/gesture-manager.js.flow} +28 -13
- package/dist/components/{gesture-state-machine.d.ts → keypad-legacy/gesture-state-machine.d.ts} +9 -9
- package/dist/components/{gesture-state-machine.js.flow → keypad-legacy/gesture-state-machine.js.flow} +10 -10
- package/dist/components/{icon.d.ts → keypad-legacy/icon.d.ts} +1 -1
- package/dist/components/{icon.js.flow → keypad-legacy/icon.js.flow} +1 -1
- package/dist/components/{keypad-button.d.ts → keypad-legacy/keypad-button.d.ts} +6 -6
- package/dist/components/{keypad-button.js.flow → keypad-legacy/keypad-button.js.flow} +7 -7
- package/dist/components/{keypad-container.d.ts → keypad-legacy/keypad-container.d.ts} +2 -2
- package/dist/components/{keypad-container.js.flow → keypad-legacy/keypad-container.js.flow} +3 -3
- package/dist/components/{keypad.d.ts → keypad-legacy/keypad.d.ts} +3 -3
- package/dist/components/{keypad.js.flow → keypad-legacy/keypad.js.flow} +3 -3
- package/dist/components/{multi-symbol-grid.d.ts → keypad-legacy/multi-symbol-grid.d.ts} +1 -1
- package/dist/components/{multi-symbol-grid.js.flow → keypad-legacy/multi-symbol-grid.js.flow} +1 -1
- package/dist/components/{multi-symbol-popover.d.ts → keypad-legacy/multi-symbol-popover.d.ts} +1 -1
- package/dist/components/{multi-symbol-popover.js.flow → keypad-legacy/multi-symbol-popover.js.flow} +1 -1
- package/dist/components/{node-manager.d.ts → keypad-legacy/node-manager.d.ts} +3 -4
- package/dist/components/{node-manager.js.flow → keypad-legacy/node-manager.js.flow} +3 -5
- package/dist/components/{popover-manager.d.ts → keypad-legacy/popover-manager.d.ts} +1 -1
- package/dist/components/{popover-manager.js.flow → keypad-legacy/popover-manager.js.flow} +1 -1
- package/dist/components/{popover-state-machine.d.ts → keypad-legacy/popover-state-machine.d.ts} +1 -1
- package/dist/components/{popover-state-machine.js.flow → keypad-legacy/popover-state-machine.js.flow} +1 -1
- package/dist/components/{provided-keypad.d.ts → keypad-legacy/provided-keypad.d.ts} +1 -1
- package/dist/components/{provided-keypad.js.flow → keypad-legacy/provided-keypad.js.flow} +1 -1
- package/dist/{store → components/keypad-legacy/store}/actions.d.ts +6 -17
- package/dist/{store → components/keypad-legacy/store}/actions.js.flow +7 -22
- package/dist/{store → components/keypad-legacy/store}/index.d.ts +0 -1
- package/dist/{store → components/keypad-legacy/store}/index.js.flow +0 -1
- package/dist/components/keypad-legacy/store/shared.d.ts +7 -0
- package/dist/components/keypad-legacy/store/shared.js.flow +14 -0
- package/dist/{store → components/keypad-legacy/store}/types.d.ts +5 -15
- package/dist/{store → components/keypad-legacy/store}/types.js.flow +5 -15
- package/dist/components/keypad-legacy/touchable-keypad-button.d.ts +37 -0
- package/dist/components/keypad-legacy/touchable-keypad-button.js.flow +59 -0
- package/dist/components/{two-page-keypad.d.ts → keypad-legacy/two-page-keypad.d.ts} +0 -1
- package/dist/components/{two-page-keypad.js.flow → keypad-legacy/two-page-keypad.js.flow} +0 -1
- package/dist/data/key-configs.d.ts +4 -5
- package/dist/data/key-configs.js.flow +3 -6
- package/dist/data/keys.d.ts +2 -56
- package/dist/data/keys.js.flow +116 -57
- package/dist/enums.d.ts +2 -9
- package/dist/enums.js.flow +2 -11
- package/dist/es/index.js +6393 -5116
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +6868 -5330
- package/dist/index.js.flow +6 -3
- package/dist/index.js.map +1 -1
- package/dist/strings.js +26 -10
- package/dist/types.d.ts +19 -17
- package/dist/types.js.flow +28 -23
- package/package.json +1 -1
- package/src/components/input/__tests__/context-tracking.test.ts +43 -44
- package/src/components/input/__tests__/mathquill.test.ts +133 -135
- package/src/components/input/key-handlers/handle-arrow.ts +70 -0
- package/src/components/input/key-handlers/handle-backspace.ts +275 -0
- package/src/components/input/key-handlers/handle-exponent.ts +52 -0
- package/src/components/input/key-handlers/handle-jump-out.ts +103 -0
- package/src/components/input/math-input.tsx +12 -13
- package/src/components/input/math-wrapper.ts +88 -837
- package/src/components/input/mathquill-helpers.ts +268 -0
- package/src/components/input/mathquill-instance.ts +5 -0
- package/src/components/input/mathquill-types.ts +55 -0
- package/src/components/key-translator.ts +209 -0
- package/src/components/keypad/button-assets.tsx +452 -116
- package/src/components/keypad/button.stories.tsx +61 -13
- package/src/components/keypad/button.tsx +1 -1
- package/src/components/keypad/{trigonometry-page.tsx → geometry-page/index.tsx} +4 -5
- package/src/components/keypad/index.tsx +19 -14
- package/src/components/keypad/keypad-mathquill.stories.tsx +69 -0
- package/src/components/keypad/keypad-page-items.tsx +36 -22
- package/src/components/keypad/keypad-pages.stories.tsx +5 -5
- package/src/components/keypad/keypad.stories.tsx +75 -17
- package/src/components/keypad/{numeric-input-page.tsx → numbers-page/index.tsx} +47 -11
- package/src/components/keypad/numbers-page/types.ts +4 -0
- package/src/components/keypad/operators-page/advanced-relations-buttons.tsx +32 -0
- package/src/components/keypad/operators-page/basic-relations-buttons.tsx +32 -0
- package/src/components/keypad/{pre-algebra-page.tsx → operators-page/index.tsx} +26 -30
- package/src/components/keypad/operators-page/logarithms-buttons.tsx +32 -0
- package/src/components/keypad/operators-page/pre-algebra-buttons.tsx +36 -0
- package/src/components/keypad/operators-page/types.ts +6 -0
- package/src/components/{__tests__ → keypad-legacy/__tests__}/two-page-keypad.test.tsx +0 -2
- package/src/components/{compute-layout-parameters.ts → keypad-legacy/compute-layout-parameters.ts} +2 -3
- package/src/components/{corner-decal.tsx → keypad-legacy/corner-decal.tsx} +2 -3
- package/src/components/{echo-manager.tsx → keypad-legacy/echo-manager.tsx} +8 -21
- package/src/components/{empty-keypad-button.tsx → keypad-legacy/empty-keypad-button.tsx} +8 -6
- package/src/components/{expression-keypad.tsx → keypad-legacy/expression-keypad.tsx} +8 -17
- package/src/components/{fraction-keypad.tsx → keypad-legacy/fraction-keypad.tsx} +6 -6
- package/src/components/{gesture-manager.ts → keypad-legacy/gesture-manager.ts} +34 -11
- package/src/components/{gesture-state-machine.ts → keypad-legacy/gesture-state-machine.ts} +14 -14
- package/src/components/{icon.tsx → keypad-legacy/icon.tsx} +3 -3
- package/src/components/{keypad-button.tsx → keypad-legacy/keypad-button.tsx} +26 -26
- package/src/components/{keypad-container.tsx → keypad-legacy/keypad-container.tsx} +6 -6
- package/src/components/{keypad.tsx → keypad-legacy/keypad.tsx} +5 -5
- package/src/components/{many-keypad-button.tsx → keypad-legacy/many-keypad-button.tsx} +13 -6
- package/src/components/{math-icon.tsx → keypad-legacy/math-icon.tsx} +2 -2
- package/src/components/{multi-symbol-grid.tsx → keypad-legacy/multi-symbol-grid.tsx} +4 -4
- package/src/components/{multi-symbol-popover.tsx → keypad-legacy/multi-symbol-popover.tsx} +3 -4
- package/src/components/{navigation-pad.tsx → keypad-legacy/navigation-pad.tsx} +5 -5
- package/src/components/{node-manager.ts → keypad-legacy/node-manager.ts} +2 -10
- package/src/components/{popover-manager.tsx → keypad-legacy/popover-manager.tsx} +2 -2
- package/src/components/{popover-state-machine.ts → keypad-legacy/popover-state-machine.ts} +1 -1
- package/src/components/{provided-keypad.tsx → keypad-legacy/provided-keypad.tsx} +4 -5
- package/src/{store → components/keypad-legacy/store}/actions.ts +7 -36
- package/src/{store → components/keypad-legacy/store}/echo-reducer.ts +3 -7
- package/src/{store → components/keypad-legacy/store}/index.ts +7 -20
- package/src/{store → components/keypad-legacy/store}/input-reducer.ts +4 -5
- package/src/{store → components/keypad-legacy/store}/keypad-reducer.ts +3 -4
- package/src/{store → components/keypad-legacy/store}/layout-reducer.ts +3 -3
- package/src/{store → components/keypad-legacy/store}/shared.ts +3 -3
- package/src/{store → components/keypad-legacy/store}/types.ts +15 -19
- package/src/components/{styles.ts → keypad-legacy/styles.ts} +1 -1
- package/src/components/{text-icon.tsx → keypad-legacy/text-icon.tsx} +2 -2
- package/src/components/{touchable-keypad-button.tsx → keypad-legacy/touchable-keypad-button.tsx} +35 -21
- package/src/components/{two-page-keypad.tsx → keypad-legacy/two-page-keypad.tsx} +5 -6
- package/src/components/tabbar/icons.tsx +0 -2
- package/src/data/key-configs.ts +751 -309
- package/src/data/keys.ts +118 -70
- package/src/enums.ts +10 -9
- package/src/index.ts +6 -3
- package/src/math-input.stories.tsx +3 -3
- package/src/types.ts +21 -16
- package/tsconfig-build.tsbuildinfo +1 -1
- package/dist/components/keypad/trigonometry-page.d.ts +0 -8
- package/dist/components/touchable-keypad-button.d.ts +0 -30
- package/dist/components/touchable-keypad-button.js.flow +0 -35
- package/dist/components/velocity-tracker.d.ts +0 -48
- package/dist/components/velocity-tracker.js.flow +0 -54
- package/dist/store/pager-reducer.d.ts +0 -4
- package/dist/store/pager-reducer.js.flow +0 -13
- package/dist/store/shared.d.ts +0 -7
- package/dist/store/shared.js.flow +0 -14
- package/src/components/velocity-tracker.ts +0 -86
- package/src/store/pager-reducer.ts +0 -125
- /package/dist/components/{corner-decal.d.ts → keypad-legacy/corner-decal.d.ts} +0 -0
- /package/dist/components/{corner-decal.js.flow → keypad-legacy/corner-decal.js.flow} +0 -0
- /package/dist/components/{empty-keypad-button.d.ts → keypad-legacy/empty-keypad-button.d.ts} +0 -0
- /package/dist/components/{empty-keypad-button.js.flow → keypad-legacy/empty-keypad-button.js.flow} +0 -0
- /package/dist/components/{many-keypad-button.d.ts → keypad-legacy/many-keypad-button.d.ts} +0 -0
- /package/dist/components/{many-keypad-button.js.flow → keypad-legacy/many-keypad-button.js.flow} +0 -0
- /package/dist/components/{math-icon.d.ts → keypad-legacy/math-icon.d.ts} +0 -0
- /package/dist/components/{math-icon.js.flow → keypad-legacy/math-icon.js.flow} +0 -0
- /package/dist/components/{navigation-pad.d.ts → keypad-legacy/navigation-pad.d.ts} +0 -0
- /package/dist/components/{navigation-pad.js.flow → keypad-legacy/navigation-pad.js.flow} +0 -0
- /package/dist/{store → components/keypad-legacy/store}/echo-reducer.d.ts +0 -0
- /package/dist/{store → components/keypad-legacy/store}/echo-reducer.js.flow +0 -0
- /package/dist/{store → components/keypad-legacy/store}/input-reducer.d.ts +0 -0
- /package/dist/{store → components/keypad-legacy/store}/input-reducer.js.flow +0 -0
- /package/dist/{store → components/keypad-legacy/store}/keypad-reducer.d.ts +0 -0
- /package/dist/{store → components/keypad-legacy/store}/keypad-reducer.js.flow +0 -0
- /package/dist/{store → components/keypad-legacy/store}/layout-reducer.d.ts +0 -0
- /package/dist/{store → components/keypad-legacy/store}/layout-reducer.js.flow +0 -0
- /package/dist/components/{styles.d.ts → keypad-legacy/styles.d.ts} +0 -0
- /package/dist/components/{styles.js.flow → keypad-legacy/styles.js.flow} +0 -0
- /package/dist/components/{svg-icon.d.ts → keypad-legacy/svg-icon.d.ts} +0 -0
- /package/dist/components/{svg-icon.js.flow → keypad-legacy/svg-icon.js.flow} +0 -0
- /package/dist/components/{text-icon.d.ts → keypad-legacy/text-icon.d.ts} +0 -0
- /package/dist/components/{text-icon.js.flow → keypad-legacy/text-icon.js.flow} +0 -0
- /package/dist/components/{z-indexes.d.ts → keypad-legacy/z-indexes.d.ts} +0 -0
- /package/dist/components/{z-indexes.js.flow → keypad-legacy/z-indexes.js.flow} +0 -0
- /package/src/components/{__tests__ → keypad-legacy/__tests__}/gesture-state-machine.test.ts +0 -0
- /package/src/components/{__tests__ → keypad-legacy/__tests__}/node-manager.test.ts +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/arrow.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/backspace.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/cdot.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/cos.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/cube-root.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/dismiss.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/divide.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/down.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/equal.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/exp-2.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/exp-3.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/exp.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/frac.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/geq.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/gt.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/index.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/jump-into-numerator.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/jump-out-base.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/jump-out-denominator.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/jump-out-exponent.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/jump-out-numerator.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/jump-out-parentheses.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/left-paren.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/left.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/leq.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/ln.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/log-n.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/log.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/lt.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/minus.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/neq.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/parens.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/percent.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/period.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/plus.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/radical.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/right-paren.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/right.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/sin.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/sqrt.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/tan.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/times.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/up.js +0 -0
- /package/src/components/{svg-icon.tsx → keypad-legacy/svg-icon.tsx} +0 -0
- /package/src/components/{z-indexes.ts → keypad-legacy/z-indexes.ts} +0 -0
|
@@ -4,11 +4,10 @@
|
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import type { Cursor, KeyHandler, Popover, Echo } from "../types";
|
|
7
|
+
import Key from "../../../data/keys";
|
|
8
|
+
import { LayoutMode, KeypadType } from "../../../enums";
|
|
9
|
+
import GestureManager from "../gesture-manager";
|
|
10
|
+
import type { Cursor, KeyHandler, Popover, Echo } from "../../../types";
|
|
12
11
|
export interface InputState {
|
|
13
12
|
keyHandler: KeyHandler | null;
|
|
14
13
|
cursor: Cursor | void;
|
|
@@ -18,17 +17,9 @@ export interface KeypadState {
|
|
|
18
17
|
keypadType: KeypadType;
|
|
19
18
|
active: boolean;
|
|
20
19
|
}
|
|
21
|
-
export interface PagerState {
|
|
22
|
-
animateToPosition: boolean;
|
|
23
|
-
currentPage: number;
|
|
24
|
-
dx: number;
|
|
25
|
-
numPages: number;
|
|
26
|
-
pageWidthPx: number;
|
|
27
|
-
velocityTracker: VelocityTracker;
|
|
28
|
-
}
|
|
29
20
|
export interface GestureState {
|
|
30
21
|
popover: Popover | null;
|
|
31
|
-
focus:
|
|
22
|
+
focus: Key | null;
|
|
32
23
|
gestureManager: GestureManager;
|
|
33
24
|
}
|
|
34
25
|
export interface EchoState {
|
|
@@ -56,7 +47,6 @@ export interface LayoutState {
|
|
|
56
47
|
export interface State {
|
|
57
48
|
input: InputState;
|
|
58
49
|
keypad: KeypadState;
|
|
59
|
-
pager: PagerState;
|
|
60
50
|
gestures: GestureState;
|
|
61
51
|
echoes: EchoState;
|
|
62
52
|
layout: LayoutState;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A touchable wrapper around the base KeypadButton component. This button is
|
|
3
|
+
* responsible for keeping our button ID system (which will be used to handle
|
|
4
|
+
* touch events globally) opaque to the KeypadButton.
|
|
5
|
+
*/
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import Key from "../../data/keys";
|
|
8
|
+
import { KeyType } from "../../enums";
|
|
9
|
+
import GestureManager from "./gesture-manager";
|
|
10
|
+
import type { Border, IconConfig, KeyConfig } from "../../types";
|
|
11
|
+
import type { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
12
|
+
interface SharedProps {
|
|
13
|
+
borders?: Border;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
style?: StyleType;
|
|
16
|
+
}
|
|
17
|
+
interface OwnProps extends SharedProps {
|
|
18
|
+
keyConfig: KeyConfig;
|
|
19
|
+
}
|
|
20
|
+
interface Props extends SharedProps {
|
|
21
|
+
childKeyIds?: ReadonlyArray<string>;
|
|
22
|
+
gestureManager: GestureManager;
|
|
23
|
+
id: Key;
|
|
24
|
+
focused: boolean;
|
|
25
|
+
popoverEnabled: boolean;
|
|
26
|
+
childKeys?: ReadonlyArray<KeyConfig>;
|
|
27
|
+
ariaLabel?: string;
|
|
28
|
+
icon?: IconConfig;
|
|
29
|
+
type: KeyType;
|
|
30
|
+
}
|
|
31
|
+
declare class TouchableKeypadButton extends React.Component<Props> {
|
|
32
|
+
shouldComponentUpdate(newProps: Props): boolean;
|
|
33
|
+
componentWillUnmount(): void;
|
|
34
|
+
render(): JSX.Element;
|
|
35
|
+
}
|
|
36
|
+
declare const _default: import("react-redux").ConnectedComponent<typeof TouchableKeypadButton, import("react-redux").Omit<React.ClassAttributes<TouchableKeypadButton> & Props, "style" | "ariaLabel" | "type" | "id" | "icon" | "childKeyIds" | "focused" | "borders" | "childKeys" | "disabled" | "popoverEnabled" | "gestureManager"> & OwnProps>;
|
|
37
|
+
export default _default;
|
|
@@ -0,0 +1,59 @@
|
|
|
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 $Flowgen$Import$react_2d_redux from "react-redux";
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import Key from "../../data/keys";
|
|
10
|
+
import { KeyType } from "../../enums";
|
|
11
|
+
import GestureManager from "./gesture-manager";
|
|
12
|
+
import type { Border, IconConfig, KeyConfig } from "../../types";
|
|
13
|
+
import type { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
14
|
+
declare interface SharedProps {
|
|
15
|
+
borders?: Border;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
style?: StyleType;
|
|
18
|
+
}
|
|
19
|
+
declare type OwnProps = {
|
|
20
|
+
keyConfig: KeyConfig,
|
|
21
|
+
} & SharedProps;
|
|
22
|
+
declare type Props = {
|
|
23
|
+
childKeyIds?: $ReadOnlyArray<string>,
|
|
24
|
+
gestureManager: GestureManager,
|
|
25
|
+
id: Key,
|
|
26
|
+
focused: boolean,
|
|
27
|
+
popoverEnabled: boolean,
|
|
28
|
+
childKeys?: $ReadOnlyArray<KeyConfig>,
|
|
29
|
+
ariaLabel?: string,
|
|
30
|
+
icon?: IconConfig,
|
|
31
|
+
type: KeyType,
|
|
32
|
+
} & SharedProps;
|
|
33
|
+
declare class TouchableKeypadButton extends React.Component<Props> {
|
|
34
|
+
shouldComponentUpdate(newProps: Props): boolean;
|
|
35
|
+
componentWillUnmount(): void;
|
|
36
|
+
render(): React$Node;
|
|
37
|
+
}
|
|
38
|
+
declare var _default: $Flowgen$Import$react_2d_redux.ConnectedComponent<
|
|
39
|
+
typeof TouchableKeypadButton,
|
|
40
|
+
{|
|
|
41
|
+
...$Flowgen$Import$react_2d_redux.Omit<
|
|
42
|
+
{| ...React.ClassAttributes<TouchableKeypadButton>, ...Props |},
|
|
43
|
+
| "style"
|
|
44
|
+
| "ariaLabel"
|
|
45
|
+
| "type"
|
|
46
|
+
| "id"
|
|
47
|
+
| "icon"
|
|
48
|
+
| "childKeyIds"
|
|
49
|
+
| "focused"
|
|
50
|
+
| "borders"
|
|
51
|
+
| "childKeys"
|
|
52
|
+
| "disabled"
|
|
53
|
+
| "popoverEnabled"
|
|
54
|
+
| "gestureManager"
|
|
55
|
+
>,
|
|
56
|
+
...OwnProps,
|
|
57
|
+
|}
|
|
58
|
+
>;
|
|
59
|
+
declare export default typeof _default;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { KeyConfig } from "../types";
|
|
2
|
+
import Key from "./keys";
|
|
3
|
+
declare const KeyConfigs: {
|
|
4
|
+
[key in Key]: KeyConfig;
|
|
5
5
|
};
|
|
6
|
-
declare const KeyConfigs: any;
|
|
7
6
|
export default KeyConfigs;
|
|
@@ -4,10 +4,7 @@
|
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
ariaLabel: string,
|
|
11
|
-
|};
|
|
12
|
-
declare var KeyConfigs: any;
|
|
7
|
+
import { KeyConfig } from "../types";
|
|
8
|
+
import Key from "./keys";
|
|
9
|
+
declare var KeyConfigs: $ObjMapi<{ [k: Key]: any }, <key>(key) => KeyConfig>;
|
|
13
10
|
declare export default typeof KeyConfigs;
|
package/dist/data/keys.d.ts
CHANGED
|
@@ -1,56 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* alphanumeric characters.
|
|
4
|
-
*/
|
|
5
|
-
declare enum Keys {
|
|
6
|
-
PLUS = "PLUS",
|
|
7
|
-
MINUS = "MINUS",
|
|
8
|
-
NEGATIVE = "NEGATIVE",
|
|
9
|
-
TIMES = "TIMES",
|
|
10
|
-
DIVIDE = "DIVIDE",
|
|
11
|
-
DECIMAL = "DECIMAL",
|
|
12
|
-
PERIOD = "PERIOD",
|
|
13
|
-
PERCENT = "PERCENT",
|
|
14
|
-
CDOT = "CDOT",
|
|
15
|
-
EQUAL = "EQUAL",
|
|
16
|
-
NEQ = "NEQ",
|
|
17
|
-
GT = "GT",
|
|
18
|
-
LT = "LT",
|
|
19
|
-
GEQ = "GEQ",
|
|
20
|
-
LEQ = "LEQ",
|
|
21
|
-
FRAC_INCLUSIVE = "FRAC_INCLUSIVE",
|
|
22
|
-
FRAC_EXCLUSIVE = "FRAC_EXCLUSIVE",
|
|
23
|
-
FRAC = "FRAC",
|
|
24
|
-
EXP = "EXP",
|
|
25
|
-
EXP_2 = "EXP_2",
|
|
26
|
-
EXP_3 = "EXP_3",
|
|
27
|
-
SQRT = "SQRT",
|
|
28
|
-
CUBE_ROOT = "CUBE_ROOT",
|
|
29
|
-
RADICAL = "RADICAL",
|
|
30
|
-
LEFT_PAREN = "LEFT_PAREN",
|
|
31
|
-
RIGHT_PAREN = "RIGHT_PAREN",
|
|
32
|
-
LN = "LN",
|
|
33
|
-
LOG = "LOG",
|
|
34
|
-
LOG_N = "LOG_N",
|
|
35
|
-
SIN = "SIN",
|
|
36
|
-
COS = "COS",
|
|
37
|
-
TAN = "TAN",
|
|
38
|
-
PI = "PI",
|
|
39
|
-
THETA = "THETA",
|
|
40
|
-
UP = "UP",
|
|
41
|
-
RIGHT = "RIGHT",
|
|
42
|
-
DOWN = "DOWN",
|
|
43
|
-
LEFT = "LEFT",
|
|
44
|
-
BACKSPACE = "BACKSPACE",
|
|
45
|
-
DISMISS = "DISMISS",
|
|
46
|
-
JUMP_OUT_PARENTHESES = "JUMP_OUT_PARENTHESES",
|
|
47
|
-
JUMP_OUT_EXPONENT = "JUMP_OUT_EXPONENT",
|
|
48
|
-
JUMP_OUT_BASE = "JUMP_OUT_BASE",
|
|
49
|
-
JUMP_INTO_NUMERATOR = "JUMP_INTO_NUMERATOR",
|
|
50
|
-
JUMP_OUT_NUMERATOR = "JUMP_OUT_NUMERATOR",
|
|
51
|
-
JUMP_OUT_DENOMINATOR = "JUMP_OUT_DENOMINATOR",
|
|
52
|
-
NOOP = "NOOP",
|
|
53
|
-
FRAC_MULTI = "FRAC_MULTI",
|
|
54
|
-
MANY = "MANY"
|
|
55
|
-
}
|
|
56
|
-
export default Keys;
|
|
1
|
+
type Key = "PLUS" | "MINUS" | "NEGATIVE" | "TIMES" | "DIVIDE" | "DECIMAL" | "PERIOD" | "PERCENT" | "CDOT" | "EQUAL" | "NEQ" | "GT" | "LT" | "GEQ" | "LEQ" | "FRAC_INCLUSIVE" | "FRAC_EXCLUSIVE" | "FRAC" | "EXP" | "EXP_2" | "EXP_3" | "SQRT" | "CUBE_ROOT" | "RADICAL" | "LEFT_PAREN" | "RIGHT_PAREN" | "LN" | "LOG" | "LOG_N" | "SIN" | "COS" | "TAN" | "PI" | "THETA" | "UP" | "RIGHT" | "DOWN" | "LEFT" | "BACKSPACE" | "DISMISS" | "JUMP_OUT_PARENTHESES" | "JUMP_OUT_EXPONENT" | "JUMP_OUT_BASE" | "JUMP_INTO_NUMERATOR" | "JUMP_OUT_NUMERATOR" | "JUMP_OUT_DENOMINATOR" | "NOOP" | "MANY" | "NUM_0" | "NUM_1" | "NUM_2" | "NUM_3" | "NUM_4" | "NUM_5" | "NUM_6" | "NUM_7" | "NUM_8" | "NUM_9" | "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" | "PHI" | "NTHROOT3" | "POW" | "LOG_B";
|
|
2
|
+
export default Key;
|
package/dist/data/keys.js.flow
CHANGED
|
@@ -4,60 +4,119 @@
|
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
|
63
|
-
|
|
7
|
+
declare type Key =
|
|
8
|
+
| "PLUS"
|
|
9
|
+
| "MINUS"
|
|
10
|
+
| "NEGATIVE"
|
|
11
|
+
| "TIMES"
|
|
12
|
+
| "DIVIDE"
|
|
13
|
+
| "DECIMAL"
|
|
14
|
+
| "PERIOD"
|
|
15
|
+
| "PERCENT"
|
|
16
|
+
| "CDOT"
|
|
17
|
+
| "EQUAL"
|
|
18
|
+
| "NEQ"
|
|
19
|
+
| "GT"
|
|
20
|
+
| "LT"
|
|
21
|
+
| "GEQ"
|
|
22
|
+
| "LEQ"
|
|
23
|
+
| "FRAC_INCLUSIVE"
|
|
24
|
+
| "FRAC_EXCLUSIVE"
|
|
25
|
+
| "FRAC"
|
|
26
|
+
| "EXP"
|
|
27
|
+
| "EXP_2"
|
|
28
|
+
| "EXP_3"
|
|
29
|
+
| "SQRT"
|
|
30
|
+
| "CUBE_ROOT"
|
|
31
|
+
| "RADICAL"
|
|
32
|
+
| "LEFT_PAREN"
|
|
33
|
+
| "RIGHT_PAREN"
|
|
34
|
+
| "LN"
|
|
35
|
+
| "LOG"
|
|
36
|
+
| "LOG_N"
|
|
37
|
+
| "SIN"
|
|
38
|
+
| "COS"
|
|
39
|
+
| "TAN"
|
|
40
|
+
| "PI"
|
|
41
|
+
| "THETA"
|
|
42
|
+
| "UP"
|
|
43
|
+
| "RIGHT"
|
|
44
|
+
| "DOWN"
|
|
45
|
+
| "LEFT"
|
|
46
|
+
| "BACKSPACE"
|
|
47
|
+
| "DISMISS"
|
|
48
|
+
| "JUMP_OUT_PARENTHESES"
|
|
49
|
+
| "JUMP_OUT_EXPONENT"
|
|
50
|
+
| "JUMP_OUT_BASE"
|
|
51
|
+
| "JUMP_INTO_NUMERATOR"
|
|
52
|
+
| "JUMP_OUT_NUMERATOR"
|
|
53
|
+
| "JUMP_OUT_DENOMINATOR"
|
|
54
|
+
| "NOOP"
|
|
55
|
+
| "MANY"
|
|
56
|
+
| "NUM_0"
|
|
57
|
+
| "NUM_1"
|
|
58
|
+
| "NUM_2"
|
|
59
|
+
| "NUM_3"
|
|
60
|
+
| "NUM_4"
|
|
61
|
+
| "NUM_5"
|
|
62
|
+
| "NUM_6"
|
|
63
|
+
| "NUM_7"
|
|
64
|
+
| "NUM_8"
|
|
65
|
+
| "NUM_9"
|
|
66
|
+
| "a"
|
|
67
|
+
| "b"
|
|
68
|
+
| "c"
|
|
69
|
+
| "d"
|
|
70
|
+
| "e"
|
|
71
|
+
| "f"
|
|
72
|
+
| "g"
|
|
73
|
+
| "h"
|
|
74
|
+
| "i"
|
|
75
|
+
| "j"
|
|
76
|
+
| "k"
|
|
77
|
+
| "l"
|
|
78
|
+
| "m"
|
|
79
|
+
| "n"
|
|
80
|
+
| "o"
|
|
81
|
+
| "p"
|
|
82
|
+
| "q"
|
|
83
|
+
| "r"
|
|
84
|
+
| "s"
|
|
85
|
+
| "t"
|
|
86
|
+
| "u"
|
|
87
|
+
| "v"
|
|
88
|
+
| "w"
|
|
89
|
+
| "x"
|
|
90
|
+
| "y"
|
|
91
|
+
| "z"
|
|
92
|
+
| "A"
|
|
93
|
+
| "B"
|
|
94
|
+
| "C"
|
|
95
|
+
| "D"
|
|
96
|
+
| "E"
|
|
97
|
+
| "F"
|
|
98
|
+
| "G"
|
|
99
|
+
| "H"
|
|
100
|
+
| "I"
|
|
101
|
+
| "J"
|
|
102
|
+
| "K"
|
|
103
|
+
| "L"
|
|
104
|
+
| "M"
|
|
105
|
+
| "N"
|
|
106
|
+
| "O"
|
|
107
|
+
| "P"
|
|
108
|
+
| "Q"
|
|
109
|
+
| "R"
|
|
110
|
+
| "S"
|
|
111
|
+
| "T"
|
|
112
|
+
| "U"
|
|
113
|
+
| "V"
|
|
114
|
+
| "W"
|
|
115
|
+
| "X"
|
|
116
|
+
| "Y"
|
|
117
|
+
| "Z"
|
|
118
|
+
| "PHI"
|
|
119
|
+
| "NTHROOT3"
|
|
120
|
+
| "POW"
|
|
121
|
+
| "LOG_B";
|
|
122
|
+
declare export default typeof Key;
|
package/dist/enums.d.ts
CHANGED
|
@@ -5,15 +5,8 @@ export declare enum KeypadType {
|
|
|
5
5
|
FRACTION = "FRACTION",
|
|
6
6
|
EXPRESSION = "EXPRESSION"
|
|
7
7
|
}
|
|
8
|
-
export declare
|
|
9
|
-
|
|
10
|
-
VALUE = "VALUE",
|
|
11
|
-
OPERATOR = "OPERATOR",
|
|
12
|
-
INPUT_NAVIGATION = "INPUT_NAVIGATION",
|
|
13
|
-
KEYPAD_NAVIGATION = "KEYPAD_NAVIGATION",
|
|
14
|
-
MANY = "MANY",
|
|
15
|
-
ECHO = "ECHO"
|
|
16
|
-
}
|
|
8
|
+
export declare const KeyTypes: string[];
|
|
9
|
+
export type KeyType = typeof KeyTypes[number];
|
|
17
10
|
export declare enum DeviceOrientation {
|
|
18
11
|
LANDSCAPE = "LANDSCAPE",
|
|
19
12
|
PORTRAIT = "PORTRAIT"
|
package/dist/enums.js.flow
CHANGED
|
@@ -12,17 +12,8 @@ declare export var KeypadType: {|
|
|
|
12
12
|
+FRACTION: "FRACTION", // "FRACTION"
|
|
13
13
|
+EXPRESSION: "EXPRESSION", // "EXPRESSION"
|
|
14
14
|
|};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
+EMPTY: "EMPTY", // "EMPTY"
|
|
18
|
-
+VALUE: "VALUE", // "VALUE"
|
|
19
|
-
+OPERATOR: "OPERATOR", // "OPERATOR"
|
|
20
|
-
+INPUT_NAVIGATION: "INPUT_NAVIGATION", // "INPUT_NAVIGATION"
|
|
21
|
-
+KEYPAD_NAVIGATION: "KEYPAD_NAVIGATION", // "KEYPAD_NAVIGATION"
|
|
22
|
-
+MANY: "MANY", // "MANY"
|
|
23
|
-
+ECHO: "ECHO", // "ECHO"
|
|
24
|
-
|};
|
|
25
|
-
|
|
15
|
+
declare export var KeyTypes: string[];
|
|
16
|
+
export type KeyType = $ElementType<typeof KeyTypes, number>;
|
|
26
17
|
declare export var DeviceOrientation: {|
|
|
27
18
|
+LANDSCAPE: "LANDSCAPE", // "LANDSCAPE"
|
|
28
19
|
+PORTRAIT: "PORTRAIT", // "PORTRAIT"
|