@khanacademy/math-input 0.7.1 → 1.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.
Files changed (176) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/actions/index.d.ts +31 -0
  3. package/dist/actions/index.js.flow +40 -0
  4. package/dist/components/compute-layout-parameters.d.ts +38 -0
  5. package/dist/components/compute-layout-parameters.js.flow +49 -0
  6. package/dist/components/corner-decal.d.ts +12 -0
  7. package/dist/components/corner-decal.js.flow +15 -0
  8. package/dist/components/echo-manager.d.ts +26 -0
  9. package/dist/components/echo-manager.js.flow +29 -0
  10. package/dist/components/empty-keypad-button.d.ts +13 -0
  11. package/dist/components/empty-keypad-button.js.flow +23 -0
  12. package/dist/components/expression-keypad.d.ts +22 -0
  13. package/dist/components/expression-keypad.js.flow +32 -0
  14. package/dist/components/fraction-keypad.d.ts +21 -0
  15. package/dist/components/fraction-keypad.js.flow +30 -0
  16. package/dist/components/gesture-manager.d.ts +74 -0
  17. package/dist/components/gesture-manager.js.flow +82 -0
  18. package/dist/components/gesture-state-machine.d.ts +105 -0
  19. package/dist/components/gesture-state-machine.js.flow +118 -0
  20. package/dist/components/icon.d.ts +15 -0
  21. package/dist/components/icon.js.flow +18 -0
  22. package/dist/components/input/__tests__/test-math-wrapper.d.ts +8 -0
  23. package/dist/components/input/__tests__/test-math-wrapper.js.flow +14 -0
  24. package/dist/components/input/cursor-handle.d.ts +1 -1
  25. package/dist/components/input/cursor-handle.js.flow +1 -1
  26. package/dist/components/input/drag-listener.d.ts +13 -0
  27. package/dist/components/input/drag-listener.js.flow +19 -0
  28. package/dist/components/input/math-input.d.ts +5 -4
  29. package/dist/components/input/math-input.js.flow +5 -4
  30. package/dist/components/input/math-wrapper.d.ts +110 -0
  31. package/dist/components/input/math-wrapper.js.flow +125 -0
  32. package/dist/components/input/scroll-into-view.d.ts +11 -0
  33. package/dist/components/input/scroll-into-view.js.flow +20 -0
  34. package/dist/components/keypad/button-assets.d.ts +4 -3
  35. package/dist/components/keypad/button-assets.js.flow +3 -3
  36. package/dist/components/keypad/button.d.ts +2 -4
  37. package/dist/components/keypad/button.js.flow +2 -4
  38. package/dist/components/keypad/keypad-page-items.d.ts +16 -12
  39. package/dist/components/keypad/keypad-page-items.js.flow +21 -12
  40. package/dist/components/keypad-button.d.ts +52 -0
  41. package/dist/components/keypad-button.js.flow +79 -0
  42. package/dist/components/keypad-container.d.ts +40 -0
  43. package/dist/components/keypad-container.js.flow +58 -0
  44. package/dist/components/keypad.d.ts +31 -0
  45. package/dist/components/keypad.js.flow +40 -0
  46. package/dist/components/many-keypad-button.d.ts +15 -0
  47. package/dist/components/many-keypad-button.js.flow +17 -0
  48. package/dist/components/math-icon.d.ts +16 -0
  49. package/dist/components/math-icon.js.flow +19 -0
  50. package/dist/components/multi-symbol-grid.d.ts +14 -0
  51. package/dist/components/multi-symbol-grid.js.flow +16 -0
  52. package/dist/components/multi-symbol-popover.d.ts +12 -0
  53. package/dist/components/multi-symbol-popover.js.flow +15 -0
  54. package/dist/components/navigation-pad.d.ts +14 -0
  55. package/dist/components/navigation-pad.js.flow +16 -0
  56. package/dist/components/node-manager.d.ts +53 -0
  57. package/dist/components/node-manager.js.flow +65 -0
  58. package/dist/components/popover-manager.d.ts +13 -0
  59. package/dist/components/popover-manager.js.flow +15 -0
  60. package/dist/components/popover-state-machine.d.ts +75 -0
  61. package/dist/components/popover-state-machine.js.flow +83 -0
  62. package/dist/components/provided-keypad.d.ts +8 -7
  63. package/dist/components/provided-keypad.js.flow +8 -7
  64. package/dist/components/styles.d.ts +6 -0
  65. package/dist/components/styles.js.flow +13 -0
  66. package/dist/components/svg-icon.d.ts +12 -0
  67. package/dist/components/svg-icon.js.flow +15 -0
  68. package/dist/components/tabbar/icons.d.ts +3 -2
  69. package/dist/components/tabbar/icons.js.flow +3 -2
  70. package/dist/components/tabbar/item.d.ts +1 -2
  71. package/dist/components/tabbar/item.js.flow +1 -2
  72. package/dist/components/tabbar/tabbar.d.ts +3 -3
  73. package/dist/components/tabbar/tabbar.js.flow +3 -3
  74. package/dist/components/text-icon.d.ts +13 -0
  75. package/dist/components/text-icon.js.flow +16 -0
  76. package/dist/components/touchable-keypad-button.d.ts +30 -0
  77. package/dist/components/touchable-keypad-button.js.flow +35 -0
  78. package/dist/components/two-page-keypad.d.ts +20 -0
  79. package/dist/components/two-page-keypad.js.flow +30 -0
  80. package/dist/components/velocity-tracker.d.ts +48 -0
  81. package/dist/components/velocity-tracker.js.flow +54 -0
  82. package/dist/es/index.js +938 -1061
  83. package/dist/es/index.js.map +1 -1
  84. package/dist/fake-react-native-web/text.d.ts +2 -1
  85. package/dist/fake-react-native-web/text.js.flow +2 -1
  86. package/dist/fake-react-native-web/view.d.ts +3 -2
  87. package/dist/fake-react-native-web/view.js.flow +3 -2
  88. package/dist/index.d.ts +1 -1
  89. package/dist/index.js +992 -1095
  90. package/dist/index.js.flow +1 -4
  91. package/dist/index.js.map +1 -1
  92. package/dist/store/echo-reducer.d.ts +5 -0
  93. package/dist/store/echo-reducer.js.flow +14 -0
  94. package/dist/store/index.d.ts +46 -1
  95. package/dist/store/index.js.flow +64 -1
  96. package/dist/store/input-reducer.d.ts +7 -0
  97. package/dist/store/input-reducer.js.flow +16 -0
  98. package/dist/store/keypad-reducer.d.ts +9 -0
  99. package/dist/store/keypad-reducer.js.flow +18 -0
  100. package/dist/store/layout-reducer.d.ts +21 -0
  101. package/dist/store/layout-reducer.js.flow +30 -0
  102. package/dist/store/pager-reducer.d.ts +13 -0
  103. package/dist/store/pager-reducer.js.flow +22 -0
  104. package/dist/store/shared.d.ts +6 -0
  105. package/dist/store/shared.js.flow +13 -0
  106. package/dist/store/types.d.ts +57 -0
  107. package/dist/store/types.js.flow +63 -0
  108. package/dist/types.d.ts +50 -0
  109. package/dist/types.js.flow +61 -0
  110. package/package.json +2 -2
  111. package/src/actions/{index.js → index.ts} +5 -5
  112. package/src/components/__tests__/{gesture-state-machine_test.js → gesture-state-machine.test.ts} +5 -1
  113. package/src/components/__tests__/{two-page-keypad_test.js → two-page-keypad.test.tsx} +0 -2
  114. package/src/components/{corner-decal.js → corner-decal.tsx} +6 -5
  115. package/src/components/{echo-manager.js → echo-manager.tsx} +29 -24
  116. package/src/components/{empty-keypad-button.js → empty-keypad-button.tsx} +17 -10
  117. package/src/components/{expression-keypad.js → expression-keypad.tsx} +27 -25
  118. package/src/components/{fraction-keypad.js → fraction-keypad.tsx} +21 -16
  119. package/src/components/{gesture-manager.js → gesture-manager.tsx} +10 -4
  120. package/src/components/{gesture-state-machine.js → gesture-state-machine.ts} +50 -4
  121. package/src/components/{icon.js → icon.tsx} +12 -14
  122. package/src/components/input/cursor-handle.tsx +1 -1
  123. package/src/components/input/{drag-listener.js → drag-listener.ts} +4 -0
  124. package/src/components/input/math-input.tsx +10 -9
  125. package/src/components/input/{math-wrapper.js → math-wrapper.ts} +10 -6
  126. package/src/components/input/{scroll-into-view.js → scroll-into-view.ts} +5 -15
  127. package/src/components/keypad/button-assets.tsx +4 -5
  128. package/src/components/keypad/button.tsx +2 -5
  129. package/src/components/keypad/index.tsx +1 -1
  130. package/src/components/keypad/keypad-page-items.tsx +34 -13
  131. package/src/components/{keypad-button.js → keypad-button.tsx} +42 -37
  132. package/src/components/{keypad-container.js → keypad-container.tsx} +41 -23
  133. package/src/components/{keypad.js → keypad.tsx} +31 -23
  134. package/src/components/{many-keypad-button.js → many-keypad-button.tsx} +8 -6
  135. package/src/components/{math-icon.js → math-icon.tsx} +7 -6
  136. package/src/components/{multi-symbol-grid.js → multi-symbol-grid.tsx} +8 -8
  137. package/src/components/{multi-symbol-popover.js → multi-symbol-popover.tsx} +5 -6
  138. package/src/components/{navigation-pad.js → navigation-pad.tsx} +7 -6
  139. package/src/components/{node-manager.js → node-manager.ts} +16 -4
  140. package/src/components/{popover-manager.js → popover-manager.tsx} +13 -16
  141. package/src/components/{popover-state-machine.js → popover-state-machine.ts} +21 -2
  142. package/src/components/prop-types.js +1 -67
  143. package/src/components/provided-keypad.tsx +14 -12
  144. package/src/components/{svg-icon.js → svg-icon.tsx} +5 -6
  145. package/src/components/tabbar/icons.tsx +4 -2
  146. package/src/components/tabbar/item.tsx +1 -3
  147. package/src/components/tabbar/{tabbar.stories.js → tabbar.stories.tsx} +10 -1
  148. package/src/components/tabbar/tabbar.tsx +3 -3
  149. package/src/components/{text-icon.js → text-icon.tsx} +7 -6
  150. package/src/components/{touchable-keypad-button.js → touchable-keypad-button.tsx} +19 -16
  151. package/src/components/{two-page-keypad.js → two-page-keypad.tsx} +13 -9
  152. package/src/components/{velocity-tracker.js → velocity-tracker.ts} +14 -4
  153. package/src/fake-react-native-web/text.tsx +2 -1
  154. package/src/fake-react-native-web/view.tsx +3 -3
  155. package/src/index.ts +1 -4
  156. package/src/store/echo-reducer.ts +58 -0
  157. package/src/store/index.ts +14 -425
  158. package/src/store/input-reducer.ts +55 -0
  159. package/src/store/keypad-reducer.ts +62 -0
  160. package/src/store/layout-reducer.ts +133 -0
  161. package/src/store/pager-reducer.ts +141 -0
  162. package/src/store/shared.ts +12 -0
  163. package/src/store/types.ts +65 -0
  164. package/src/types.ts +69 -0
  165. package/tsconfig.tsbuildinfo +1 -1
  166. package/src/components/app.js +0 -73
  167. package/src/demo.js +0 -9
  168. package/src/native-app.js +0 -85
  169. /package/src/components/__tests__/{node-manager_test.js → node-manager.test.ts} +0 -0
  170. /package/src/components/{compute-layout-parameters.js → compute-layout-parameters.ts} +0 -0
  171. /package/src/components/input/__tests__/{context-tracking_test.js → context-tracking.test.ts} +0 -0
  172. /package/src/components/input/__tests__/{mathquill_test.js → mathquill.test.ts} +0 -0
  173. /package/src/components/input/__tests__/{test-math-wrapper.jsx → test-math-wrapper.ts} +0 -0
  174. /package/src/components/keypad/{button.stories.js → button.stories.tsx} +0 -0
  175. /package/src/components/{styles.js → styles.ts} +0 -0
  176. /package/src/components/tabbar/__tests__/{tabbar_test.js → tabbar.test.tsx} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,9 +1,26 @@
1
1
  # @khanacademy/math-input
2
2
 
3
+ ## 1.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 4c03a43d: Convert math-input to TS, changing the API in the process
8
+
9
+ ### Patch Changes
10
+
11
+ - 22c5d564: Remove the use of React.FC<> and use types named Props/State in more components
12
+
13
+ ## 0.7.2
14
+
15
+ ### Patch Changes
16
+
17
+ - 8e8d85cd: Fix imported React types in a couple of files
18
+
3
19
  ## 0.7.1
4
20
 
5
21
  ### Patch Changes
6
22
 
23
+ - 1f062e98: Bump all package versions since the build settings have been updated
7
24
  - 406edf6b: Extract strings to dist/string.js instead of dist/strings.
8
25
 
9
26
  ## 0.7.0
@@ -0,0 +1,31 @@
1
+ import type { KeypadConfiguration, KeyHandler } from "../types";
2
+ export declare const dismissKeypad: () => {
3
+ type: string;
4
+ };
5
+ export declare const activateKeypad: () => {
6
+ type: string;
7
+ };
8
+ /**
9
+ * Configure the keypad with the provided configuration parameters.
10
+ */
11
+ export declare const configureKeypad: (configuration: KeypadConfiguration) => {
12
+ type: string;
13
+ configuration: KeypadConfiguration;
14
+ };
15
+ export declare const setPageSize: (pageWidthPx: number, pageHeightPx: number) => {
16
+ type: string;
17
+ pageWidthPx: number;
18
+ pageHeightPx: number;
19
+ };
20
+ export declare const removeEcho: (animationId: any) => {
21
+ type: string;
22
+ animationId: any;
23
+ };
24
+ export declare const setKeyHandler: (keyHandler: KeyHandler) => {
25
+ type: string;
26
+ keyHandler: KeyHandler;
27
+ };
28
+ export declare const setCursor: (cursor: any) => {
29
+ type: string;
30
+ cursor: any;
31
+ };
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Flowtype definitions for data
3
+ * Generated by Flowgen from a Typescript Definition
4
+ * Flowgen v1.21.0
5
+ * @flow
6
+ */
7
+ import type { KeypadConfiguration, KeyHandler } from "../types";
8
+ declare export var dismissKeypad: () => {|
9
+ type: string,
10
+ |};
11
+ declare export var activateKeypad: () => {|
12
+ type: string,
13
+ |};
14
+ /**
15
+ * Configure the keypad with the provided configuration parameters.
16
+ */
17
+ declare export var configureKeypad: (configuration: KeypadConfiguration) => {|
18
+ type: string,
19
+ configuration: KeypadConfiguration,
20
+ |};
21
+ declare export var setPageSize: (
22
+ pageWidthPx: number,
23
+ pageHeightPx: number
24
+ ) => {|
25
+ type: string,
26
+ pageWidthPx: number,
27
+ pageHeightPx: number,
28
+ |};
29
+ declare export var removeEcho: (animationId: any) => {|
30
+ type: string,
31
+ animationId: any,
32
+ |};
33
+ declare export var setKeyHandler: (keyHandler: KeyHandler) => {|
34
+ type: string,
35
+ keyHandler: KeyHandler,
36
+ |};
37
+ declare export var setCursor: (cursor: any) => {|
38
+ type: string,
39
+ cursor: any,
40
+ |};
@@ -0,0 +1,38 @@
1
+ /**
2
+ * An algorithm for computing the appropriate layout parameters for the keypad,
3
+ * including the size of the buttons and whether or not to render fullscreen,
4
+ * taking into account a number of factors including the size of the screen, the
5
+ * orientation of the screen, the presence of browser chrome, the presence of
6
+ * other exercise-related chrome, the size of the input box, the parameters that
7
+ * define the keypad (i.e., the number of rows, columns, and pages), and so
8
+ * forth.
9
+ *
10
+ * The computations herein make some strong assumptions about the sizes of
11
+ * various other elements and the situations under which they will be visible
12
+ * (e.g., browser chrome). However, this is just a heuristic--it's not crucial
13
+ * that our buttons are sized in a pixel-perfect manner, but rather, that we
14
+ * make a balanced use of space.
15
+ *
16
+ * Note that one goal of the algorithm is to avoid resizing the keypad in the
17
+ * face of dynamic browser chrome. In order to avoid that awkwardness, we tend
18
+ * to be conservative in our measurements and make things smaller than they
19
+ * might need to be.
20
+ */
21
+ export declare const computeLayoutParameters: ({ numColumns, numMaxVisibleRows, numPages }: {
22
+ numColumns: any;
23
+ numMaxVisibleRows: any;
24
+ numPages: any;
25
+ }, { pageWidthPx, pageHeightPx }: {
26
+ pageWidthPx: any;
27
+ pageHeightPx: any;
28
+ }, { deviceOrientation, deviceType }: {
29
+ deviceOrientation: any;
30
+ deviceType: any;
31
+ }, { navigationPadEnabled, paginationEnabled, toolbarEnabled }: {
32
+ navigationPadEnabled: any;
33
+ paginationEnabled: any;
34
+ toolbarEnabled: any;
35
+ }) => {
36
+ buttonDimensions: any;
37
+ layoutMode: "FULLSCREEN" | "COMPACT";
38
+ };
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Flowtype definitions for data
3
+ * Generated by Flowgen from a Typescript Definition
4
+ * Flowgen v1.21.0
5
+ * @flow
6
+ */
7
+ /**
8
+ * An algorithm for computing the appropriate layout parameters for the keypad,
9
+ * including the size of the buttons and whether or not to render fullscreen,
10
+ * taking into account a number of factors including the size of the screen, the
11
+ * orientation of the screen, the presence of browser chrome, the presence of
12
+ * other exercise-related chrome, the size of the input box, the parameters that
13
+ * define the keypad (i.e., the number of rows, columns, and pages), and so
14
+ * forth.
15
+ *
16
+ * The computations herein make some strong assumptions about the sizes of
17
+ * various other elements and the situations under which they will be visible
18
+ * (e.g., browser chrome). However, this is just a heuristic--it's not crucial
19
+ * that our buttons are sized in a pixel-perfect manner, but rather, that we
20
+ * make a balanced use of space.
21
+ *
22
+ * Note that one goal of the algorithm is to avoid resizing the keypad in the
23
+ * face of dynamic browser chrome. In order to avoid that awkwardness, we tend
24
+ * to be conservative in our measurements and make things smaller than they
25
+ * might need to be.
26
+ */
27
+ declare export var computeLayoutParameters: (
28
+ x: {|
29
+ numColumns: any,
30
+ numMaxVisibleRows: any,
31
+ numPages: any,
32
+ |},
33
+ x: {|
34
+ pageWidthPx: any,
35
+ pageHeightPx: any,
36
+ |},
37
+ x: {|
38
+ deviceOrientation: any,
39
+ deviceType: any,
40
+ |},
41
+ x: {|
42
+ navigationPadEnabled: any,
43
+ paginationEnabled: any,
44
+ toolbarEnabled: any,
45
+ |}
46
+ ) => {|
47
+ buttonDimensions: any,
48
+ layoutMode: "FULLSCREEN" | "COMPACT",
49
+ |};
@@ -0,0 +1,12 @@
1
+ /**
2
+ * A small triangular decal to sit in the corner of a parent component.
3
+ */
4
+ import * as React from "react";
5
+ import type { StyleType } from "@khanacademy/wonder-blocks-core";
6
+ type Props = {
7
+ style: StyleType;
8
+ };
9
+ declare class CornerDecal extends React.Component<Props> {
10
+ render(): JSX.Element;
11
+ }
12
+ export default CornerDecal;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Flowtype definitions for data
3
+ * Generated by Flowgen from a Typescript Definition
4
+ * Flowgen v1.21.0
5
+ * @flow
6
+ */
7
+ import * as React from "react";
8
+ import type { StyleType } from "@khanacademy/wonder-blocks-core";
9
+ declare type Props = {|
10
+ style: StyleType,
11
+ |};
12
+ declare class CornerDecal extends React.Component<Props> {
13
+ render(): React$Node;
14
+ }
15
+ declare export default typeof CornerDecal;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * A component that renders and animates the selection state effect effect.
3
+ */
4
+ import * as React from "react";
5
+ import { EchoAnimationTypes } from "../consts";
6
+ import type { Key } from "../data/keys";
7
+ import type { Border, Bound } from "../types";
8
+ type EchoPropType = {
9
+ animationId: string;
10
+ animationType: keyof typeof EchoAnimationTypes;
11
+ borders: Border;
12
+ id: Key;
13
+ initialBounds: Bound;
14
+ };
15
+ type EchoManagerProps = {
16
+ echoes: ReadonlyArray<EchoPropType>;
17
+ onAnimationFinish?: (animationId: string) => void;
18
+ };
19
+ declare class EchoManager extends React.Component<EchoManagerProps> {
20
+ _animationConfigForType: (animationType: any) => {
21
+ animationDurationMs: any;
22
+ animationTransitionName: any;
23
+ };
24
+ render(): JSX.Element;
25
+ }
26
+ export default EchoManager;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Flowtype definitions for data
3
+ * Generated by Flowgen from a Typescript Definition
4
+ * Flowgen v1.21.0
5
+ * @flow
6
+ */
7
+ import * as React from "react";
8
+ import { EchoAnimationTypes } from "../consts";
9
+ import type { Key } from "../data/keys";
10
+ import type { Border, Bound } from "../types";
11
+ declare type EchoPropType = {|
12
+ animationId: string,
13
+ animationType: $Keys<typeof EchoAnimationTypes>,
14
+ borders: Border,
15
+ id: Key,
16
+ initialBounds: Bound,
17
+ |};
18
+ declare type EchoManagerProps = {|
19
+ echoes: $ReadOnlyArray<EchoPropType>,
20
+ onAnimationFinish?: (animationId: string) => void,
21
+ |};
22
+ declare class EchoManager extends React.Component<EchoManagerProps> {
23
+ _animationConfigForType: (animationType: any) => {|
24
+ animationDurationMs: any,
25
+ animationTransitionName: any,
26
+ |};
27
+ render(): React$Node;
28
+ }
29
+ declare export default typeof EchoManager;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * A keypad button containing no symbols and triggering no actions on click.
3
+ */
4
+ import * as React from "react";
5
+ import GestureManager from "./gesture-manager";
6
+ interface ReduxProps {
7
+ gestureManager: GestureManager;
8
+ }
9
+ declare class EmptyKeypadButton extends React.Component<ReduxProps> {
10
+ render(): JSX.Element;
11
+ }
12
+ declare const _default: import("react-redux").ConnectedComponent<typeof EmptyKeypadButton, import("react-redux").Omit<React.ClassAttributes<EmptyKeypadButton> & ReduxProps, "gestureManager">>;
13
+ export default _default;
@@ -0,0 +1,23 @@
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 GestureManager from "./gesture-manager";
10
+ declare interface ReduxProps {
11
+ gestureManager: GestureManager;
12
+ }
13
+ declare class EmptyKeypadButton extends React.Component<ReduxProps> {
14
+ render(): React$Node;
15
+ }
16
+ declare var _default: $Flowgen$Import$react_2d_redux.ConnectedComponent<
17
+ typeof EmptyKeypadButton,
18
+ $Flowgen$Import$react_2d_redux.Omit<
19
+ {| ...React.ClassAttributes<EmptyKeypadButton>, ...ReduxProps |},
20
+ "gestureManager"
21
+ >
22
+ >;
23
+ declare export default typeof _default;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * A keypad that includes all of the expression symbols.
3
+ */
4
+ import * as React from "react";
5
+ import type { KeypadLayout } from "../types";
6
+ import type { CursorContext } from "./input/cursor-contexts";
7
+ interface ReduxProps {
8
+ currentPage: number;
9
+ cursorContext?: CursorContext;
10
+ dynamicJumpOut: boolean;
11
+ }
12
+ interface Props extends ReduxProps {
13
+ extraKeys?: ReadonlyArray<string>;
14
+ roundTopLeft: boolean;
15
+ roundTopRight: boolean;
16
+ }
17
+ export declare const expressionKeypadLayout: KeypadLayout;
18
+ declare class ExpressionKeypad extends React.Component<Props> {
19
+ render(): JSX.Element;
20
+ }
21
+ declare const _default: import("react-redux").ConnectedComponent<typeof ExpressionKeypad, import("react-redux").Omit<React.ClassAttributes<ExpressionKeypad> & Props, "currentPage" | "cursorContext" | "dynamicJumpOut">>;
22
+ export default _default;
@@ -0,0 +1,32 @@
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 type { KeypadLayout } from "../types";
10
+ import type { CursorContext } from "./input/cursor-contexts";
11
+ declare interface ReduxProps {
12
+ currentPage: number;
13
+ cursorContext?: CursorContext;
14
+ dynamicJumpOut: boolean;
15
+ }
16
+ declare type Props = {
17
+ extraKeys?: $ReadOnlyArray<string>,
18
+ roundTopLeft: boolean,
19
+ roundTopRight: boolean,
20
+ } & ReduxProps;
21
+ declare export var expressionKeypadLayout: KeypadLayout;
22
+ declare class ExpressionKeypad extends React.Component<Props> {
23
+ render(): React$Node;
24
+ }
25
+ declare var _default: $Flowgen$Import$react_2d_redux.ConnectedComponent<
26
+ typeof ExpressionKeypad,
27
+ $Flowgen$Import$react_2d_redux.Omit<
28
+ {| ...React.ClassAttributes<ExpressionKeypad>, ...Props |},
29
+ "currentPage" | "cursorContext" | "dynamicJumpOut"
30
+ >
31
+ >;
32
+ declare export default typeof _default;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * A keypad that includes the digits, as well as the symbols required to deal
3
+ * with fractions, decimals, and percents.
4
+ */
5
+ import * as React from "react";
6
+ import type { KeypadLayout } from "../types";
7
+ import type { CursorContext } from "./input/cursor-contexts";
8
+ interface ReduxProps {
9
+ cursorContext?: CursorContext;
10
+ dynamicJumpOut: boolean;
11
+ }
12
+ interface Props extends ReduxProps {
13
+ roundTopLeft: boolean;
14
+ roundTopRight: boolean;
15
+ }
16
+ export declare const fractionKeypadLayout: KeypadLayout;
17
+ declare class FractionKeypad extends React.Component<Props> {
18
+ render(): JSX.Element;
19
+ }
20
+ declare const _default: import("react-redux").ConnectedComponent<typeof FractionKeypad, import("react-redux").Omit<React.ClassAttributes<FractionKeypad> & Props, "cursorContext" | "dynamicJumpOut">>;
21
+ export default _default;
@@ -0,0 +1,30 @@
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 type { KeypadLayout } from "../types";
10
+ import type { CursorContext } from "./input/cursor-contexts";
11
+ declare interface ReduxProps {
12
+ cursorContext?: CursorContext;
13
+ dynamicJumpOut: boolean;
14
+ }
15
+ declare type Props = {
16
+ roundTopLeft: boolean,
17
+ roundTopRight: boolean,
18
+ } & ReduxProps;
19
+ declare export var fractionKeypadLayout: KeypadLayout;
20
+ declare class FractionKeypad extends React.Component<Props> {
21
+ render(): React$Node;
22
+ }
23
+ declare var _default: $Flowgen$Import$react_2d_redux.ConnectedComponent<
24
+ typeof FractionKeypad,
25
+ $Flowgen$Import$react_2d_redux.Omit<
26
+ {| ...React.ClassAttributes<FractionKeypad>, ...Props |},
27
+ "cursorContext" | "dynamicJumpOut"
28
+ >
29
+ >;
30
+ declare export default typeof _default;
@@ -0,0 +1,74 @@
1
+ /**
2
+ * A high-level manager for our gesture system. In particular, this class
3
+ * connects our various bits of logic for managing gestures and interactions,
4
+ * and links them together.
5
+ */
6
+ import GestureStateMachine from "./gesture-state-machine";
7
+ import NodeManager from "./node-manager";
8
+ import PopoverStateMachine from "./popover-state-machine";
9
+ declare class GestureManager {
10
+ swipeEnabled: boolean;
11
+ trackEvents: boolean;
12
+ nodeManager: NodeManager;
13
+ popoverStateMachine: PopoverStateMachine;
14
+ gestureStateMachine: GestureStateMachine;
15
+ constructor(options: any, handlers: any, disabledSwipeKeys: any, multiPressableKeys: any);
16
+ /**
17
+ * Handle a touch-start event that originated in a node registered with the
18
+ * gesture system.
19
+ *
20
+ * @param {TouchEvent} evt - the raw touch event from the browser
21
+ * @param {string} id - the identifier of the DOM node in which the touch
22
+ * occurred
23
+ */
24
+ onTouchStart(evt: TouchEvent, id?: any): void;
25
+ /**
26
+ * Handle a touch-move event that originated in a node registered with the
27
+ * gesture system.
28
+ *
29
+ * @param {TouchEvent} evt - the raw touch event from the browser
30
+ */
31
+ onTouchMove(evt: TouchEvent): void;
32
+ /**
33
+ * Handle a touch-end event that originated in a node registered with the
34
+ * gesture system.
35
+ *
36
+ * @param {TouchEvent} evt - the raw touch event from the browser
37
+ */
38
+ onTouchEnd(evt: TouchEvent): void;
39
+ /**
40
+ * Handle a touch-cancel event that originated in a node registered with the
41
+ * gesture system.
42
+ *
43
+ * @param {TouchEvent} evt - the raw touch event from the browser
44
+ */
45
+ onTouchCancel(evt: TouchEvent): void;
46
+ /**
47
+ * Register a DOM node with a given identifier.
48
+ *
49
+ * @param {string} id - the identifier of the given node
50
+ * @param {node} domNode - the DOM node linked to the identifier
51
+ * @param {string[]} childIds - the identifiers of any DOM nodes that
52
+ * should be considered children of this node,
53
+ * in that they should take priority when
54
+ * intercepting touch events
55
+ * @param {object} borders - an opaque object describing the node's borders
56
+ */
57
+ registerDOMNode(id: any, domNode: any, childIds: any, borders: any): void;
58
+ /**
59
+ * Unregister the DOM node with the given identifier.
60
+ *
61
+ * @param {string} id - the identifier of the node to unregister
62
+ */
63
+ unregisterDOMNode(id: any): void;
64
+ /**
65
+ * Enable event tracking for the gesture manager.
66
+ */
67
+ enableEventTracking(): void;
68
+ /**
69
+ * Disable event tracking for the gesture manager. When called, the gesture
70
+ * manager will drop any events received by managed nodes.
71
+ */
72
+ disableEventTracking(): void;
73
+ }
74
+ export default GestureManager;
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Flowtype definitions for data
3
+ * Generated by Flowgen from a Typescript Definition
4
+ * Flowgen v1.21.0
5
+ * @flow
6
+ */
7
+ import GestureStateMachine from "./gesture-state-machine";
8
+ import NodeManager from "./node-manager";
9
+ import PopoverStateMachine from "./popover-state-machine";
10
+ declare class GestureManager {
11
+ swipeEnabled: boolean;
12
+ trackEvents: boolean;
13
+ nodeManager: NodeManager;
14
+ popoverStateMachine: PopoverStateMachine;
15
+ gestureStateMachine: GestureStateMachine;
16
+ constructor(
17
+ options: any,
18
+ handlers: any,
19
+ disabledSwipeKeys: any,
20
+ multiPressableKeys: any
21
+ ): this;
22
+
23
+ /**
24
+ * Handle a touch-start event that originated in a node registered with the
25
+ * gesture system.
26
+ * @param {TouchEvent} evt - the raw touch event from the browser
27
+ * @param {string} id - the identifier of the DOM node in which the touch
28
+ * occurred
29
+ */
30
+ onTouchStart(evt: TouchEvent, id?: any): void;
31
+
32
+ /**
33
+ * Handle a touch-move event that originated in a node registered with the
34
+ * gesture system.
35
+ * @param {TouchEvent} evt - the raw touch event from the browser
36
+ */
37
+ onTouchMove(evt: TouchEvent): void;
38
+
39
+ /**
40
+ * Handle a touch-end event that originated in a node registered with the
41
+ * gesture system.
42
+ * @param {TouchEvent} evt - the raw touch event from the browser
43
+ */
44
+ onTouchEnd(evt: TouchEvent): void;
45
+
46
+ /**
47
+ * Handle a touch-cancel event that originated in a node registered with the
48
+ * gesture system.
49
+ * @param {TouchEvent} evt - the raw touch event from the browser
50
+ */
51
+ onTouchCancel(evt: TouchEvent): void;
52
+
53
+ /**
54
+ * Register a DOM node with a given identifier.
55
+ * @param {string} id - the identifier of the given node
56
+ * @param {node} domNode - the DOM node linked to the identifier
57
+ * @param {string[]} childIds - the identifiers of any DOM nodes that
58
+ * should be considered children of this node,
59
+ * in that they should take priority when
60
+ * intercepting touch events
61
+ * @param {{...}} borders - an opaque object describing the node's borders
62
+ */
63
+ registerDOMNode(id: any, domNode: any, childIds: any, borders: any): void;
64
+
65
+ /**
66
+ * Unregister the DOM node with the given identifier.
67
+ * @param {string} id - the identifier of the node to unregister
68
+ */
69
+ unregisterDOMNode(id: any): void;
70
+
71
+ /**
72
+ * Enable event tracking for the gesture manager.
73
+ */
74
+ enableEventTracking(): void;
75
+
76
+ /**
77
+ * Disable event tracking for the gesture manager. When called, the gesture
78
+ * manager will drop any events received by managed nodes.
79
+ */
80
+ disableEventTracking(): void;
81
+ }
82
+ declare export default typeof GestureManager;