@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
package/dist/components/{gesture-state-machine.d.ts → keypad-legacy/gesture-state-machine.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Key from "../../data/keys";
|
|
2
2
|
/**
|
|
3
3
|
* The state machine that backs our gesture system. In particular, this state
|
|
4
4
|
* machine manages the interplay between focuses, touch ups, and swiping.
|
|
@@ -11,8 +11,8 @@ export type Handlers = {
|
|
|
11
11
|
onBlur: () => void;
|
|
12
12
|
onTrigger: (id: string) => void;
|
|
13
13
|
onLongPress: (id: string) => void;
|
|
14
|
-
onSwipeChange
|
|
15
|
-
onSwipeEnd
|
|
14
|
+
onSwipeChange?: (x: number) => void;
|
|
15
|
+
onSwipeEnd?: (x: number) => void;
|
|
16
16
|
onTouchEnd: (id: string) => void;
|
|
17
17
|
};
|
|
18
18
|
type Options = {
|
|
@@ -21,25 +21,25 @@ type Options = {
|
|
|
21
21
|
holdIntervalMs: number;
|
|
22
22
|
};
|
|
23
23
|
type TouchState = {
|
|
24
|
-
activeNodeId:
|
|
24
|
+
activeNodeId: Key;
|
|
25
25
|
pressAndHoldIntervalId: number | null;
|
|
26
26
|
longPressTimeoutId: number | null;
|
|
27
27
|
swipeLocked: boolean;
|
|
28
28
|
startX: number;
|
|
29
29
|
};
|
|
30
|
-
type TouchStateMap = Record<
|
|
30
|
+
type TouchStateMap = Record<Key, TouchState>;
|
|
31
31
|
type SwipeState = {
|
|
32
|
-
touchId:
|
|
32
|
+
touchId: Key;
|
|
33
33
|
startX: number;
|
|
34
34
|
};
|
|
35
35
|
declare class GestureStateMachine {
|
|
36
36
|
handlers: Handlers;
|
|
37
37
|
options: Options;
|
|
38
|
-
swipeDisabledNodeIds:
|
|
39
|
-
multiPressableKeys:
|
|
38
|
+
swipeDisabledNodeIds: ReadonlyArray<Key>;
|
|
39
|
+
multiPressableKeys: ReadonlyArray<Key>;
|
|
40
40
|
touchState: Partial<TouchStateMap>;
|
|
41
41
|
swipeState: SwipeState | null;
|
|
42
|
-
constructor(handlers: Handlers, options: Partial<Options>, swipeDisabledNodeIds?:
|
|
42
|
+
constructor(handlers: Handlers, options: Partial<Options>, swipeDisabledNodeIds?: ReadonlyArray<Key>, multiPressableKeys?: ReadonlyArray<Key>);
|
|
43
43
|
_maybeCancelLongPressForTouch(touchId: any): void;
|
|
44
44
|
_maybeCancelPressAndHoldForTouch(touchId: any): void;
|
|
45
45
|
_cleanupTouchEvent(touchId: any): void;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
7
|
+
import Key from "../../data/keys";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* The state machine that backs our gesture system. In particular, this state
|
|
@@ -18,8 +18,8 @@ export type Handlers = {|
|
|
|
18
18
|
onBlur: () => void,
|
|
19
19
|
onTrigger: (id: string) => void,
|
|
20
20
|
onLongPress: (id: string) => void,
|
|
21
|
-
onSwipeChange
|
|
22
|
-
onSwipeEnd
|
|
21
|
+
onSwipeChange?: (x: number) => void,
|
|
22
|
+
onSwipeEnd?: (x: number) => void,
|
|
23
23
|
onTouchEnd: (id: string) => void,
|
|
24
24
|
|};
|
|
25
25
|
declare type Options = {|
|
|
@@ -28,29 +28,29 @@ declare type Options = {|
|
|
|
28
28
|
holdIntervalMs: number,
|
|
29
29
|
|};
|
|
30
30
|
declare type TouchState = {|
|
|
31
|
-
activeNodeId:
|
|
31
|
+
activeNodeId: Key,
|
|
32
32
|
pressAndHoldIntervalId: number | null,
|
|
33
33
|
longPressTimeoutId: number | null,
|
|
34
34
|
swipeLocked: boolean,
|
|
35
35
|
startX: number,
|
|
36
36
|
|};
|
|
37
|
-
declare type TouchStateMap = { [key:
|
|
37
|
+
declare type TouchStateMap = { [key: Key]: TouchState };
|
|
38
38
|
declare type SwipeState = {|
|
|
39
|
-
touchId:
|
|
39
|
+
touchId: Key,
|
|
40
40
|
startX: number,
|
|
41
41
|
|};
|
|
42
42
|
declare class GestureStateMachine {
|
|
43
43
|
handlers: Handlers;
|
|
44
44
|
options: Options;
|
|
45
|
-
swipeDisabledNodeIds: $
|
|
46
|
-
multiPressableKeys: $
|
|
45
|
+
swipeDisabledNodeIds: $ReadOnlyArray<Key>;
|
|
46
|
+
multiPressableKeys: $ReadOnlyArray<Key>;
|
|
47
47
|
touchState: $Rest<TouchStateMap, {}>;
|
|
48
48
|
swipeState: SwipeState | null;
|
|
49
49
|
constructor(
|
|
50
50
|
handlers: Handlers,
|
|
51
51
|
options: $Rest<Options, {}>,
|
|
52
|
-
swipeDisabledNodeIds?:
|
|
53
|
-
multiPressableKeys?:
|
|
52
|
+
swipeDisabledNodeIds?: $ReadOnlyArray<Key>,
|
|
53
|
+
multiPressableKeys?: $ReadOnlyArray<Key>
|
|
54
54
|
): this;
|
|
55
55
|
_maybeCancelLongPressForTouch(touchId: any): void;
|
|
56
56
|
_maybeCancelPressAndHoldForTouch(touchId: any): void;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* A component that renders an icon for a symbol with the given name.
|
|
3
3
|
*/
|
|
4
4
|
import * as React from "react";
|
|
5
|
-
import type { IconConfig } from "
|
|
5
|
+
import type { IconConfig } from "../../types";
|
|
6
6
|
import type { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
7
7
|
type Props = {
|
|
8
8
|
focused: boolean;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* A component that renders a keypad button.
|
|
3
3
|
*/
|
|
4
4
|
import * as React from "react";
|
|
5
|
-
import { BorderDirection, KeyType } from "
|
|
6
|
-
import type { Border,
|
|
5
|
+
import { BorderDirection, KeyType } from "../../enums";
|
|
6
|
+
import type { Border, NonManyKeyConfig, IconConfig } from "../../types";
|
|
7
7
|
import type { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
8
8
|
interface ReduxProps {
|
|
9
9
|
heightPx: number;
|
|
@@ -12,12 +12,12 @@ interface ReduxProps {
|
|
|
12
12
|
interface Props extends ReduxProps {
|
|
13
13
|
ariaLabel?: string;
|
|
14
14
|
borders: Border;
|
|
15
|
-
childKeys: ReadonlyArray<
|
|
15
|
+
childKeys: ReadonlyArray<NonManyKeyConfig>;
|
|
16
16
|
disabled: boolean;
|
|
17
17
|
focused: boolean;
|
|
18
18
|
popoverEnabled: boolean;
|
|
19
19
|
type: KeyType;
|
|
20
|
-
icon
|
|
20
|
+
icon?: IconConfig;
|
|
21
21
|
style?: StyleType;
|
|
22
22
|
onTouchCancel?: (evt: React.TouchEvent<HTMLDivElement>) => void;
|
|
23
23
|
onTouchEnd?: (evt: React.TouchEvent<HTMLDivElement>) => void;
|
|
@@ -42,10 +42,10 @@ declare class KeypadButton extends React.PureComponent<Props> {
|
|
|
42
42
|
_getButtonStyle: (type: any, borders: any, style?: any) => any[];
|
|
43
43
|
render(): JSX.Element;
|
|
44
44
|
}
|
|
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" | "
|
|
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
47
|
borders?: readonly (BorderDirection | undefined)[] | undefined;
|
|
48
|
-
childKeys?: readonly
|
|
48
|
+
childKeys?: readonly NonManyKeyConfig[] | undefined;
|
|
49
49
|
disabled?: boolean | undefined;
|
|
50
50
|
popoverEnabled?: boolean | undefined;
|
|
51
51
|
} & {}, "heightPx" | "widthPx">>;
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import * as $Flowgen$Import$react_2d_redux from "react-redux";
|
|
8
8
|
import * as React from "react";
|
|
9
|
-
import { BorderDirection, KeyType } from "
|
|
10
|
-
import type { Border,
|
|
9
|
+
import { BorderDirection, KeyType } from "../../enums";
|
|
10
|
+
import type { Border, NonManyKeyConfig, IconConfig } from "../../types";
|
|
11
11
|
import type { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
12
12
|
declare interface ReduxProps {
|
|
13
13
|
heightPx: number;
|
|
@@ -16,12 +16,12 @@ declare interface ReduxProps {
|
|
|
16
16
|
declare type Props = {
|
|
17
17
|
ariaLabel?: string,
|
|
18
18
|
borders: Border,
|
|
19
|
-
childKeys: $ReadOnlyArray<
|
|
19
|
+
childKeys: $ReadOnlyArray<NonManyKeyConfig>,
|
|
20
20
|
disabled: boolean,
|
|
21
21
|
focused: boolean,
|
|
22
22
|
popoverEnabled: boolean,
|
|
23
23
|
type: KeyType,
|
|
24
|
-
icon
|
|
24
|
+
icon?: IconConfig,
|
|
25
25
|
style?: StyleType,
|
|
26
26
|
onTouchCancel?: (evt: SyntheticTouchEvent<HTMLDivElement>) => void,
|
|
27
27
|
onTouchEnd?: (evt: SyntheticTouchEvent<HTMLDivElement>) => void,
|
|
@@ -59,16 +59,16 @@ declare var _default: $Flowgen$Import$react_2d_redux.ConnectedComponent<
|
|
|
59
59
|
| "onTouchEnd"
|
|
60
60
|
| "onTouchMove"
|
|
61
61
|
| "onTouchStart"
|
|
62
|
-
| "icon"
|
|
63
62
|
| "type"
|
|
63
|
+
| "icon"
|
|
64
|
+
| "key"
|
|
64
65
|
| "heightPx"
|
|
65
66
|
| "widthPx"
|
|
66
|
-
| "key"
|
|
67
67
|
>,
|
|
68
68
|
...{|
|
|
69
69
|
focused?: boolean | void,
|
|
70
70
|
borders?: $ReadOnlyArray<BorderDirection | void> | void,
|
|
71
|
-
childKeys?: $ReadOnlyArray<
|
|
71
|
+
childKeys?: $ReadOnlyArray<NonManyKeyConfig> | void,
|
|
72
72
|
disabled?: boolean | void,
|
|
73
73
|
popoverEnabled?: boolean | void,
|
|
74
74
|
|},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { LayoutMode, KeypadType } from "
|
|
2
|
+
import { LayoutMode, KeypadType } from "../../enums";
|
|
3
3
|
import type { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
4
4
|
interface ReduxProps {
|
|
5
5
|
active?: boolean;
|
|
@@ -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" | "onPageSizeChange" | "keypadType" | "layoutMode" | "navigationPadEnabled">>;
|
|
39
39
|
export default _default;
|
|
@@ -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 { LayoutMode, KeypadType } from "
|
|
9
|
+
import { LayoutMode, KeypadType } from "../../enums";
|
|
10
10
|
import type { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
11
11
|
declare interface ReduxProps {
|
|
12
12
|
active?: boolean;
|
|
@@ -48,10 +48,10 @@ declare var _default: $Flowgen$Import$react_2d_redux.ConnectedComponent<
|
|
|
48
48
|
{| ...React.ClassAttributes<KeypadContainer>, ...Props |},
|
|
49
49
|
| "active"
|
|
50
50
|
| "extraKeys"
|
|
51
|
-
| "navigationPadEnabled"
|
|
52
|
-
| "keypadType"
|
|
53
51
|
| "onPageSizeChange"
|
|
52
|
+
| "keypadType"
|
|
54
53
|
| "layoutMode"
|
|
54
|
+
| "navigationPadEnabled"
|
|
55
55
|
>
|
|
56
56
|
>;
|
|
57
57
|
declare export default typeof _default;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* and manages the rendering of echo animations on top of those buttons.
|
|
4
4
|
*/
|
|
5
5
|
import * as React from "react";
|
|
6
|
-
import type { Popover, Echo } from "
|
|
6
|
+
import type { Bound, Popover, Echo } from "../../types";
|
|
7
7
|
import type { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
8
8
|
interface ReduxProps {
|
|
9
9
|
active: boolean;
|
|
@@ -18,7 +18,7 @@ interface Props extends ReduxProps {
|
|
|
18
18
|
declare class Keypad extends React.Component<Props> {
|
|
19
19
|
_isMounted: boolean | undefined;
|
|
20
20
|
_resizeTimeout: number | null | undefined;
|
|
21
|
-
_container:
|
|
21
|
+
_container: Bound | null | undefined;
|
|
22
22
|
componentDidMount(): void;
|
|
23
23
|
UNSAFE_componentWillReceiveProps(newProps: any): void;
|
|
24
24
|
componentWillUnmount(): void;
|
|
@@ -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, "popover" | "
|
|
30
|
+
declare const _default: import("react-redux").ConnectedComponent<typeof Keypad, import("react-redux").Omit<React.ClassAttributes<Keypad> & Props, "popover" | "active" | "echoes" | "removeEcho">>;
|
|
31
31
|
export default _default;
|
|
@@ -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 type { Popover, Echo } from "
|
|
9
|
+
import type { Bound, Popover, Echo } from "../../types";
|
|
10
10
|
import type { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
11
11
|
declare interface ReduxProps {
|
|
12
12
|
active: boolean;
|
|
@@ -21,7 +21,7 @@ declare type Props = {
|
|
|
21
21
|
declare class Keypad extends React.Component<Props> {
|
|
22
22
|
_isMounted: boolean | void;
|
|
23
23
|
_resizeTimeout: number | null | void;
|
|
24
|
-
_container:
|
|
24
|
+
_container: Bound | null | void;
|
|
25
25
|
componentDidMount(): void;
|
|
26
26
|
UNSAFE_componentWillReceiveProps(newProps: any): void;
|
|
27
27
|
componentWillUnmount(): void;
|
|
@@ -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
|
-
"popover" | "
|
|
37
|
+
"popover" | "active" | "echoes" | "removeEcho"
|
|
38
38
|
>
|
|
39
39
|
>;
|
|
40
40
|
declare export default typeof _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { LayoutProps, Bound } from "../../types";
|
|
2
2
|
/**
|
|
3
3
|
* A manager for our node-to-ID system. In particular, this class is
|
|
4
4
|
* responsible for maintaing a mapping between DOM nodes and node IDs, and
|
|
@@ -8,9 +8,8 @@ import type { Border, LayoutProps } from "../types";
|
|
|
8
8
|
*/
|
|
9
9
|
declare class NodeManager {
|
|
10
10
|
_nodesById: Record<string, HTMLElement>;
|
|
11
|
-
_bordersById: Record<string, Border>;
|
|
12
11
|
_orderedIds: ReadonlyArray<string>;
|
|
13
|
-
_cachedBoundingBoxesById: Record<string,
|
|
12
|
+
_cachedBoundingBoxesById: Record<string, Bound>;
|
|
14
13
|
constructor();
|
|
15
14
|
/**
|
|
16
15
|
* Register a DOM node with a given identifier.
|
|
@@ -19,7 +18,7 @@ declare class NodeManager {
|
|
|
19
18
|
* @param {node} domNode - the DOM node linked to the identifier
|
|
20
19
|
* @param {object} borders - an opaque object describing the node's borders
|
|
21
20
|
*/
|
|
22
|
-
registerDOMNode(id: string, domNode: HTMLElement, childIds: ReadonlyArray<string
|
|
21
|
+
registerDOMNode(id: string, domNode: HTMLElement, childIds: ReadonlyArray<string>): void;
|
|
23
22
|
/**
|
|
24
23
|
* Unregister the DOM node with the given identifier.
|
|
25
24
|
*
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
7
|
+
import { LayoutProps, Bound } from "../../types";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* A manager for our node-to-ID system. In particular, this class is
|
|
@@ -15,9 +15,8 @@ import type { Border, LayoutProps } from "../types";
|
|
|
15
15
|
*/
|
|
16
16
|
declare class NodeManager {
|
|
17
17
|
_nodesById: { [key: string]: HTMLElement };
|
|
18
|
-
_bordersById: { [key: string]: Border };
|
|
19
18
|
_orderedIds: $ReadOnlyArray<string>;
|
|
20
|
-
_cachedBoundingBoxesById: { [key: string]:
|
|
19
|
+
_cachedBoundingBoxesById: { [key: string]: Bound };
|
|
21
20
|
constructor(): this;
|
|
22
21
|
|
|
23
22
|
/**
|
|
@@ -29,8 +28,7 @@ declare class NodeManager {
|
|
|
29
28
|
registerDOMNode(
|
|
30
29
|
id: string,
|
|
31
30
|
domNode: HTMLElement,
|
|
32
|
-
childIds: $ReadOnlyArray<string
|
|
33
|
-
borders: Border
|
|
31
|
+
childIds: $ReadOnlyArray<string>
|
|
34
32
|
): void;
|
|
35
33
|
|
|
36
34
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import ReactDOM from "react-dom";
|
|
3
|
-
import type { Cursor, KeypadConfiguration, KeyHandler } from "
|
|
3
|
+
import type { Cursor, KeypadConfiguration, KeyHandler } from "../../types";
|
|
4
4
|
import type { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
5
5
|
type Props = {
|
|
6
6
|
onElementMounted?: (arg1: any) => void;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
import ReactDOM from "react-dom";
|
|
9
|
-
import type { Cursor, KeypadConfiguration, KeyHandler } from "
|
|
9
|
+
import type { Cursor, KeypadConfiguration, KeyHandler } from "../../types";
|
|
10
10
|
import type { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
11
11
|
declare type Props = {|
|
|
12
12
|
onElementMounted?: (arg1: any) => void,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { KeypadConfiguration, KeyHandler, Cursor, ActiveNodesObj
|
|
1
|
+
import Key from "../../../data/keys";
|
|
2
|
+
import type { Bound, KeypadConfiguration, KeyHandler, Cursor, ActiveNodesObj } from "../../../types";
|
|
3
3
|
type DismissKeypadAction = {
|
|
4
4
|
type: "DismissKeypad";
|
|
5
5
|
};
|
|
@@ -37,16 +37,6 @@ type SetCursorAction = {
|
|
|
37
37
|
cursor: Cursor;
|
|
38
38
|
};
|
|
39
39
|
export declare const setCursor: (cursor: Cursor) => SetCursorAction;
|
|
40
|
-
type OnSwipeChangeAction = {
|
|
41
|
-
type: "OnSwipeChange";
|
|
42
|
-
dx: number;
|
|
43
|
-
};
|
|
44
|
-
export declare const onSwipeChange: (dx: number) => OnSwipeChangeAction;
|
|
45
|
-
type OnSwipeEndAction = {
|
|
46
|
-
type: "OnSwipeEnd";
|
|
47
|
-
dx: number;
|
|
48
|
-
};
|
|
49
|
-
export declare const onSwipeEnd: (dx: number) => OnSwipeEndAction;
|
|
50
40
|
type SetActiveNodesAction = {
|
|
51
41
|
type: "SetActiveNodes";
|
|
52
42
|
activeNodes: any;
|
|
@@ -54,11 +44,10 @@ type SetActiveNodesAction = {
|
|
|
54
44
|
export declare const setActiveNodes: (activeNodes: ActiveNodesObj) => SetActiveNodesAction;
|
|
55
45
|
type PressKeyAction = {
|
|
56
46
|
type: "PressKey";
|
|
57
|
-
key:
|
|
58
|
-
|
|
59
|
-
initialBounds: DOMRect;
|
|
47
|
+
key: Key;
|
|
48
|
+
initialBounds: Bound;
|
|
60
49
|
inPopover: boolean;
|
|
61
50
|
};
|
|
62
|
-
export declare const pressKey: (key:
|
|
63
|
-
export type Action = DismissKeypadAction | ActivateKeypadAction | ConfigureKeypadAction | SetPageSizeAction | RemoveEchoAction | SetKeyHandlerAction | SetCursorAction |
|
|
51
|
+
export declare const pressKey: (key: Key, initialBounds: Bound, inPopover: any) => PressKeyAction;
|
|
52
|
+
export type Action = DismissKeypadAction | ActivateKeypadAction | ConfigureKeypadAction | SetPageSizeAction | RemoveEchoAction | SetKeyHandlerAction | SetCursorAction | SetActiveNodesAction | PressKeyAction;
|
|
64
53
|
export {};
|
|
@@ -4,15 +4,14 @@
|
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
8
|
-
import Keys from "../data/keys";
|
|
7
|
+
import Key from "../../../data/keys";
|
|
9
8
|
import type {
|
|
9
|
+
Bound,
|
|
10
10
|
KeypadConfiguration,
|
|
11
11
|
KeyHandler,
|
|
12
12
|
Cursor,
|
|
13
13
|
ActiveNodesObj,
|
|
14
|
-
|
|
15
|
-
} from "../types";
|
|
14
|
+
} from "../../../types";
|
|
16
15
|
declare type DismissKeypadAction = {|
|
|
17
16
|
type: "DismissKeypad",
|
|
18
17
|
|};
|
|
@@ -57,16 +56,6 @@ declare type SetCursorAction = {|
|
|
|
57
56
|
cursor: Cursor,
|
|
58
57
|
|};
|
|
59
58
|
declare export var setCursor: (cursor: Cursor) => SetCursorAction;
|
|
60
|
-
declare type OnSwipeChangeAction = {|
|
|
61
|
-
type: "OnSwipeChange",
|
|
62
|
-
dx: number,
|
|
63
|
-
|};
|
|
64
|
-
declare export var onSwipeChange: (dx: number) => OnSwipeChangeAction;
|
|
65
|
-
declare type OnSwipeEndAction = {|
|
|
66
|
-
type: "OnSwipeEnd",
|
|
67
|
-
dx: number,
|
|
68
|
-
|};
|
|
69
|
-
declare export var onSwipeEnd: (dx: number) => OnSwipeEndAction;
|
|
70
59
|
declare type SetActiveNodesAction = {|
|
|
71
60
|
type: "SetActiveNodes",
|
|
72
61
|
activeNodes: any,
|
|
@@ -76,15 +65,13 @@ declare export var setActiveNodes: (
|
|
|
76
65
|
) => SetActiveNodesAction;
|
|
77
66
|
declare type PressKeyAction = {|
|
|
78
67
|
type: "PressKey",
|
|
79
|
-
key:
|
|
80
|
-
|
|
81
|
-
initialBounds: DOMRect,
|
|
68
|
+
key: Key,
|
|
69
|
+
initialBounds: Bound,
|
|
82
70
|
inPopover: boolean,
|
|
83
71
|
|};
|
|
84
72
|
declare export var pressKey: (
|
|
85
|
-
key:
|
|
86
|
-
|
|
87
|
-
initialBounds: DOMRect,
|
|
73
|
+
key: Key,
|
|
74
|
+
initialBounds: Bound,
|
|
88
75
|
inPopover: any
|
|
89
76
|
) => PressKeyAction;
|
|
90
77
|
export type Action =
|
|
@@ -95,7 +82,5 @@ export type Action =
|
|
|
95
82
|
| RemoveEchoAction
|
|
96
83
|
| SetKeyHandlerAction
|
|
97
84
|
| SetCursorAction
|
|
98
|
-
| OnSwipeChangeAction
|
|
99
|
-
| OnSwipeEndAction
|
|
100
85
|
| SetActiveNodesAction
|
|
101
86
|
| PressKeyAction;
|
|
@@ -3,7 +3,6 @@ import type { GestureState } from "./types";
|
|
|
3
3
|
export declare const createStore: () => Redux.Store<Redux.EmptyObject & {
|
|
4
4
|
input: import("./types").InputState;
|
|
5
5
|
keypad: import("./types").KeypadState;
|
|
6
|
-
pager: import("./types").PagerState;
|
|
7
6
|
gestures: GestureState;
|
|
8
7
|
echoes: import("./types").EchoState;
|
|
9
8
|
layout: import("./types").LayoutState;
|
|
@@ -13,7 +13,6 @@ declare export var createStore: () => Redux.Store<
|
|
|
13
13
|
...{|
|
|
14
14
|
input: $Flowgen$Import$_2e__2f_types.InputState,
|
|
15
15
|
keypad: $Flowgen$Import$_2e__2f_types.KeypadState,
|
|
16
|
-
pager: $Flowgen$Import$_2e__2f_types.PagerState,
|
|
17
16
|
gestures: GestureState,
|
|
18
17
|
echoes: $Flowgen$Import$_2e__2f_types.EchoState,
|
|
19
18
|
layout: $Flowgen$Import$_2e__2f_types.LayoutState,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { KeypadType } from "../../../enums";
|
|
2
|
+
declare const defaultKeypadType = KeypadType.EXPRESSION;
|
|
3
|
+
declare const keypadForType: {
|
|
4
|
+
readonly FRACTION: import("../../../types").KeypadLayout;
|
|
5
|
+
readonly EXPRESSION: import("../../../types").KeypadLayout;
|
|
6
|
+
};
|
|
7
|
+
export { keypadForType, defaultKeypadType };
|
|
@@ -0,0 +1,14 @@
|
|
|
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$_2e__2e__2f__2e__2e__2f__2e__2e__2f_types from "../../../types";
|
|
8
|
+
import { KeypadType } from "../../../enums";
|
|
9
|
+
declare var defaultKeypadType: KeypadType.EXPRESSION;
|
|
10
|
+
declare var keypadForType: {|
|
|
11
|
+
+FRACTION: $Flowgen$Import$_2e__2e__2f__2e__2e__2f__2e__2e__2f_types.KeypadLayout,
|
|
12
|
+
+EXPRESSION: $Flowgen$Import$_2e__2e__2f__2e__2e__2f__2e__2e__2f_types.KeypadLayout,
|
|
13
|
+
|};
|
|
14
|
+
declare export { keypadForType, defaultKeypadType };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import type { Cursor, KeyHandler, Popover, Echo } from "../types";
|
|
1
|
+
import Key from "../../../data/keys";
|
|
2
|
+
import { LayoutMode, KeypadType } from "../../../enums";
|
|
3
|
+
import GestureManager from "../gesture-manager";
|
|
4
|
+
import type { Cursor, KeyHandler, Popover, Echo } from "../../../types";
|
|
6
5
|
export interface InputState {
|
|
7
6
|
keyHandler: KeyHandler | null;
|
|
8
7
|
cursor: Cursor | undefined;
|
|
@@ -12,17 +11,9 @@ export interface KeypadState {
|
|
|
12
11
|
keypadType: KeypadType;
|
|
13
12
|
active: boolean;
|
|
14
13
|
}
|
|
15
|
-
export interface PagerState {
|
|
16
|
-
animateToPosition: boolean;
|
|
17
|
-
currentPage: number;
|
|
18
|
-
dx: number;
|
|
19
|
-
numPages: number;
|
|
20
|
-
pageWidthPx: number;
|
|
21
|
-
velocityTracker: VelocityTracker;
|
|
22
|
-
}
|
|
23
14
|
export interface GestureState {
|
|
24
15
|
popover: Popover | null;
|
|
25
|
-
focus:
|
|
16
|
+
focus: Key | null;
|
|
26
17
|
gestureManager: GestureManager;
|
|
27
18
|
}
|
|
28
19
|
export interface EchoState {
|
|
@@ -50,7 +41,6 @@ export interface LayoutState {
|
|
|
50
41
|
export interface State {
|
|
51
42
|
input: InputState;
|
|
52
43
|
keypad: KeypadState;
|
|
53
|
-
pager: PagerState;
|
|
54
44
|
gestures: GestureState;
|
|
55
45
|
echoes: EchoState;
|
|
56
46
|
layout: LayoutState;
|