@khanacademy/math-input 8.1.2 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/components/input/cursor-contexts.d.ts +9 -9
  3. package/dist/components/input/math-wrapper.d.ts +4 -4
  4. package/dist/components/input/mathquill-helpers.d.ts +1 -1
  5. package/dist/components/input/mathquill-instance.d.ts +1 -1
  6. package/dist/components/input/mathquill-types.d.ts +2 -2
  7. package/dist/components/key-handlers/handle-arrow.d.ts +2 -2
  8. package/dist/components/key-handlers/handle-backspace.d.ts +1 -1
  9. package/dist/components/key-handlers/handle-exponent.d.ts +2 -2
  10. package/dist/components/key-handlers/handle-jump-out.d.ts +2 -2
  11. package/dist/components/key-handlers/key-translator.d.ts +2 -2
  12. package/dist/components/keypad/button-assets.d.ts +1 -1
  13. package/dist/components/keypad/keypad-button.d.ts +1 -1
  14. package/dist/components/keypad/keypad-pages/extras-page.d.ts +2 -2
  15. package/dist/components/keypad/keypad-pages/fractions-page.d.ts +9 -0
  16. package/dist/components/keypad/keypad-pages/geometry-page.d.ts +1 -1
  17. package/dist/components/keypad/keypad-pages/numbers-page.d.ts +1 -1
  18. package/dist/components/keypad/keypad-pages/operators-page.d.ts +1 -1
  19. package/dist/components/keypad/keypad.d.ts +4 -3
  20. package/dist/components/keypad/mobile-keypad.d.ts +3 -3
  21. package/dist/components/keypad/shared-keys.d.ts +3 -3
  22. package/dist/components/keypad/utils.d.ts +2 -0
  23. package/dist/components/keypad-legacy/compute-layout-parameters.d.ts +1 -1
  24. package/dist/components/keypad-legacy/empty-keypad-button.d.ts +1 -1
  25. package/dist/components/keypad-legacy/gesture-manager.d.ts +3 -3
  26. package/dist/components/keypad-legacy/gesture-state-machine.d.ts +1 -1
  27. package/dist/components/keypad-legacy/keypad-button.d.ts +2 -1
  28. package/dist/components/keypad-legacy/multi-symbol-grid.d.ts +1 -1
  29. package/dist/components/keypad-legacy/multi-symbol-popover.d.ts +1 -1
  30. package/dist/components/keypad-legacy/node-manager.d.ts +1 -1
  31. package/dist/components/keypad-legacy/store/actions.d.ts +1 -1
  32. package/dist/components/keypad-legacy/store/types.d.ts +3 -3
  33. package/dist/components/keypad-legacy/touchable-keypad-button.d.ts +3 -3
  34. package/dist/components/keypad-switch.d.ts +1 -1
  35. package/dist/components/prop-types.d.ts +12 -0
  36. package/dist/components/tabbar/tabbar.d.ts +2 -2
  37. package/dist/components/tabbar/types.d.ts +1 -1
  38. package/dist/data/key-configs.d.ts +2 -2
  39. package/dist/es/index.js +848 -240
  40. package/dist/es/index.js.map +1 -1
  41. package/dist/index.d.ts +1 -0
  42. package/dist/index.js +848 -240
  43. package/dist/index.js.map +1 -1
  44. package/dist/types.d.ts +6 -5
  45. package/package.json +6 -6
  46. package/src/components/input/cursor-contexts.ts +9 -9
  47. package/src/components/input/math-input.tsx +12 -12
  48. package/src/components/input/math-wrapper.ts +7 -3
  49. package/src/components/input/mathquill-helpers.ts +3 -5
  50. package/src/components/input/mathquill-instance.ts +1 -1
  51. package/src/components/input/mathquill-types.ts +5 -2
  52. package/src/components/key-handlers/handle-arrow.ts +4 -3
  53. package/src/components/key-handlers/handle-backspace.ts +3 -2
  54. package/src/components/key-handlers/handle-exponent.ts +4 -5
  55. package/src/components/key-handlers/handle-jump-out.ts +4 -5
  56. package/src/components/key-handlers/key-translator.ts +6 -5
  57. package/src/components/keypad/__tests__/keypad-button.test.tsx +44 -3
  58. package/src/components/keypad/__tests__/keypad-v2-mathquill.test.tsx +4 -3
  59. package/src/components/keypad/__tests__/keypad-v2.cypress.ts +2 -32
  60. package/src/components/keypad/__tests__/keypad.test.tsx +46 -0
  61. package/src/components/keypad/__tests__/test-data-tabs.ts +21 -0
  62. package/src/components/keypad/button-assets.tsx +761 -60
  63. package/src/components/keypad/keypad-button.stories.tsx +4 -2
  64. package/src/components/keypad/keypad-button.tsx +2 -3
  65. package/src/components/keypad/keypad-mathquill.stories.tsx +3 -2
  66. package/src/components/keypad/keypad-pages/extras-page.tsx +3 -2
  67. package/src/components/keypad/keypad-pages/fractions-page.tsx +125 -0
  68. package/src/components/keypad/keypad-pages/geometry-page.tsx +2 -1
  69. package/src/components/keypad/keypad-pages/numbers-page.tsx +2 -1
  70. package/src/components/keypad/keypad-pages/operators-page.tsx +2 -1
  71. package/src/components/keypad/keypad.stories.tsx +17 -2
  72. package/src/components/keypad/keypad.tsx +56 -22
  73. package/src/components/keypad/mobile-keypad.tsx +10 -3
  74. package/src/components/keypad/shared-keys.tsx +5 -28
  75. package/src/components/keypad/utils.ts +30 -0
  76. package/src/components/keypad-context.ts +1 -1
  77. package/src/components/keypad-legacy/compute-layout-parameters.ts +1 -1
  78. package/src/components/keypad-legacy/echo-manager.tsx +1 -1
  79. package/src/components/keypad-legacy/empty-keypad-button.tsx +1 -1
  80. package/src/components/keypad-legacy/gesture-manager.ts +4 -4
  81. package/src/components/keypad-legacy/gesture-state-machine.ts +1 -1
  82. package/src/components/keypad-legacy/keypad-button.tsx +2 -1
  83. package/src/components/keypad-legacy/many-keypad-button.tsx +2 -1
  84. package/src/components/keypad-legacy/multi-symbol-grid.tsx +2 -1
  85. package/src/components/keypad-legacy/multi-symbol-popover.tsx +2 -1
  86. package/src/components/keypad-legacy/node-manager.ts +1 -1
  87. package/src/components/keypad-legacy/store/actions.ts +1 -2
  88. package/src/components/keypad-legacy/store/index.ts +1 -1
  89. package/src/components/keypad-legacy/store/types.ts +3 -4
  90. package/src/components/keypad-legacy/touchable-keypad-button.tsx +3 -3
  91. package/src/components/keypad-legacy/two-page-keypad.tsx +1 -1
  92. package/src/components/keypad-switch.tsx +2 -1
  93. package/src/components/{prop-types.js → prop-types.ts} +1 -0
  94. package/src/components/tabbar/tabbar.tsx +4 -2
  95. package/src/components/tabbar/types.ts +1 -0
  96. package/src/data/key-configs.ts +4 -3
  97. package/src/full-math-input.stories.tsx +36 -4
  98. package/src/index.ts +1 -0
  99. package/src/types.ts +6 -6
  100. package/tsconfig-build.tsbuildinfo +1 -1
  101. package/dist/components/common-style.js.flow +0 -27
  102. package/dist/components/input/cursor-contexts.js.flow +0 -26
  103. package/dist/components/input/cursor-handle.js.flow +0 -28
  104. package/dist/components/input/drag-listener.js.flow +0 -19
  105. package/dist/components/input/math-input.js.flow +0 -153
  106. package/dist/components/input/math-wrapper.js.flow +0 -54
  107. package/dist/components/input/mathquill-helpers.js.flow +0 -56
  108. package/dist/components/input/mathquill-instance.js.flow +0 -24
  109. package/dist/components/input/mathquill-types.js.flow +0 -362
  110. package/dist/components/input/scroll-into-view.js.flow +0 -20
  111. package/dist/components/key-handlers/handle-arrow.js.flow +0 -12
  112. package/dist/components/key-handlers/handle-backspace.js.flow +0 -14
  113. package/dist/components/key-handlers/handle-exponent.js.flow +0 -12
  114. package/dist/components/key-handlers/handle-jump-out.js.flow +0 -14
  115. package/dist/components/key-handlers/key-translator.js.flow +0 -10
  116. package/dist/components/keypad/button-assets.js.flow +0 -12
  117. package/dist/components/keypad/index.js.flow +0 -8
  118. package/dist/components/keypad/keypad-button.js.flow +0 -18
  119. package/dist/components/keypad/keypad-pages/extras-page.js.flow +0 -13
  120. package/dist/components/keypad/keypad-pages/geometry-page.js.flow +0 -11
  121. package/dist/components/keypad/keypad-pages/numbers-page.js.flow +0 -11
  122. package/dist/components/keypad/keypad-pages/operators-page.js.flow +0 -15
  123. package/dist/components/keypad/keypad.js.flow +0 -37
  124. package/dist/components/keypad/mobile-keypad.js.flow +0 -57
  125. package/dist/components/keypad/shared-keys.js.flow +0 -20
  126. package/dist/components/keypad-context.js.flow +0 -18
  127. package/dist/components/keypad-legacy/compute-layout-parameters.js.flow +0 -21
  128. package/dist/components/keypad-legacy/corner-decal.js.flow +0 -15
  129. package/dist/components/keypad-legacy/echo-manager.js.flow +0 -20
  130. package/dist/components/keypad-legacy/empty-keypad-button.js.flow +0 -23
  131. package/dist/components/keypad-legacy/expression-keypad.js.flow +0 -34
  132. package/dist/components/keypad-legacy/fraction-keypad.js.flow +0 -33
  133. package/dist/components/keypad-legacy/gesture-manager.js.flow +0 -97
  134. package/dist/components/keypad-legacy/gesture-state-machine.js.flow +0 -118
  135. package/dist/components/keypad-legacy/icon.js.flow +0 -18
  136. package/dist/components/keypad-legacy/index.js.flow +0 -7
  137. package/dist/components/keypad-legacy/keypad-button.js.flow +0 -80
  138. package/dist/components/keypad-legacy/keypad-container.js.flow +0 -63
  139. package/dist/components/keypad-legacy/keypad.js.flow +0 -40
  140. package/dist/components/keypad-legacy/many-keypad-button.js.flow +0 -17
  141. package/dist/components/keypad-legacy/math-icon.js.flow +0 -19
  142. package/dist/components/keypad-legacy/multi-symbol-grid.js.flow +0 -16
  143. package/dist/components/keypad-legacy/multi-symbol-popover.js.flow +0 -15
  144. package/dist/components/keypad-legacy/navigation-pad.js.flow +0 -16
  145. package/dist/components/keypad-legacy/node-manager.js.flow +0 -60
  146. package/dist/components/keypad-legacy/popover-manager.js.flow +0 -15
  147. package/dist/components/keypad-legacy/popover-state-machine.js.flow +0 -77
  148. package/dist/components/keypad-legacy/provided-keypad.js.flow +0 -38
  149. package/dist/components/keypad-legacy/store/actions.js.flow +0 -90
  150. package/dist/components/keypad-legacy/store/echo-reducer.js.flow +0 -10
  151. package/dist/components/keypad-legacy/store/index.js.flow +0 -22
  152. package/dist/components/keypad-legacy/store/input-reducer.js.flow +0 -13
  153. package/dist/components/keypad-legacy/store/keypad-reducer.js.flow +0 -13
  154. package/dist/components/keypad-legacy/store/layout-reducer.js.flow +0 -13
  155. package/dist/components/keypad-legacy/store/shared.js.flow +0 -14
  156. package/dist/components/keypad-legacy/store/types.js.flow +0 -53
  157. package/dist/components/keypad-legacy/styles.js.flow +0 -11
  158. package/dist/components/keypad-legacy/svg-icon.js.flow +0 -15
  159. package/dist/components/keypad-legacy/text-icon.js.flow +0 -16
  160. package/dist/components/keypad-legacy/touchable-keypad-button.js.flow +0 -59
  161. package/dist/components/keypad-legacy/two-page-keypad.js.flow +0 -31
  162. package/dist/components/keypad-legacy/z-indexes.js.flow +0 -13
  163. package/dist/components/keypad-switch.js.flow +0 -15
  164. package/dist/components/tabbar/icons.js.flow +0 -14
  165. package/dist/components/tabbar/index.js.flow +0 -8
  166. package/dist/components/tabbar/item.js.flow +0 -19
  167. package/dist/components/tabbar/tabbar.js.flow +0 -18
  168. package/dist/components/tabbar/types.js.flow +0 -12
  169. package/dist/data/key-configs.js.flow +0 -10
  170. package/dist/data/keys.js.flow +0 -122
  171. package/dist/enums.js.flow +0 -54
  172. package/dist/fake-react-native-web/index.js.flow +0 -8
  173. package/dist/fake-react-native-web/text.js.flow +0 -19
  174. package/dist/fake-react-native-web/view.js.flow +0 -29
  175. package/dist/index.js.flow +0 -24
  176. package/dist/types.js.flow +0 -91
  177. package/dist/utils.js.flow +0 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @khanacademy/math-input
2
2
 
3
+ ## 9.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 0993a46b: Don't generate Flow types
8
+
9
+ ### Minor Changes
10
+
11
+ - 87aadc43: Surface event from `onClickKey` callback
12
+ - b93f9f74: Added new Mobile Fraction Keypad View to the V2 Keypad
13
+
14
+ ### Patch Changes
15
+
16
+ - 302ca7f7: Fix type for parameters of `moveOutOf` event.
17
+ - afb14cff: Add eslint rule to make type imports consistent
18
+ - 19054322: Tweak to capital letter icon buttons
19
+ - ce5e6297: Upgrade wonder-blocks deps to package versions without Flow types
20
+ - 196d2a39: Add icons for all letters
21
+
3
22
  ## 8.1.2
4
23
 
5
24
  ### Patch Changes
@@ -9,12 +9,12 @@
9
9
  * now, we show the dismiss button rather than allowing the user to jump out of
10
10
  * the radical.
11
11
  */
12
- export declare const CursorContext: {
13
- readonly NONE: "NONE";
14
- readonly IN_PARENS: "IN_PARENS";
15
- readonly IN_SUPER_SCRIPT: "IN_SUPER_SCRIPT";
16
- readonly IN_SUB_SCRIPT: "IN_SUB_SCRIPT";
17
- readonly IN_NUMERATOR: "IN_NUMERATOR";
18
- readonly IN_DENOMINATOR: "IN_DENOMINATOR";
19
- readonly BEFORE_FRACTION: "BEFORE_FRACTION";
20
- };
12
+ export declare enum CursorContext {
13
+ NONE = "NONE",
14
+ IN_PARENS = "IN_PARENS",
15
+ IN_SUPER_SCRIPT = "IN_SUPER_SCRIPT",
16
+ IN_SUB_SCRIPT = "IN_SUB_SCRIPT",
17
+ IN_NUMERATOR = "IN_NUMERATOR",
18
+ IN_DENOMINATOR = "IN_DENOMINATOR",
19
+ BEFORE_FRACTION = "BEFORE_FRACTION"
20
+ }
@@ -1,6 +1,6 @@
1
- import Key from "../../data/keys";
2
- import { Cursor } from "../../types";
3
- import { MathFieldInterface } from "./mathquill-types";
1
+ import type Key from "../../data/keys";
2
+ import type { Cursor } from "../../types";
3
+ import type { MathFieldInterface } from "./mathquill-types";
4
4
  /**
5
5
  * This file contains a wrapper around MathQuill so that we can provide a
6
6
  * more regular interface for the functionality we need while insulating us
@@ -31,7 +31,7 @@ declare class MathWrapper {
31
31
  */
32
32
  setCursorPosition(x: number, y: number, hitNode: HTMLElement): void;
33
33
  getCursor(): any;
34
- contextForCursor(): "NONE" | "IN_PARENS" | "IN_SUPER_SCRIPT" | "IN_SUB_SCRIPT" | "IN_NUMERATOR" | "IN_DENOMINATOR" | "BEFORE_FRACTION";
34
+ contextForCursor(): import("./cursor-contexts").CursorContext;
35
35
  getSelection(): any;
36
36
  getContent(): string;
37
37
  setContent(latex: string): void;
@@ -1,5 +1,5 @@
1
1
  import { CursorContext } from "./cursor-contexts";
2
- import { MathFieldCursor, MathFieldInterface } from "./mathquill-types";
2
+ import type { MathFieldCursor, MathFieldInterface } from "./mathquill-types";
3
3
  export declare function getCursor(mathField: MathFieldInterface): MathFieldCursor;
4
4
  export declare function isFraction(node: any): boolean;
5
5
  export declare function isNumerator(node: any): boolean;
@@ -1,4 +1,4 @@
1
- import { MathQuillInterface, MathFieldConfig } from "./mathquill-types";
1
+ import type { MathQuillInterface, MathFieldConfig } from "./mathquill-types";
2
2
  export declare const mathQuillInstance: MathQuillInterface;
3
3
  /**
4
4
  * Creates a new [MathField](http://docs.mathquill.com/en/latest/Api_Methods/#mqmathfieldhtml_element-config)
@@ -1,4 +1,4 @@
1
- import Key from "../../data/keys";
1
+ import type Key from "../../data/keys";
2
2
  export interface MathQuillInterface {
3
3
  L: "L";
4
4
  R: "R";
@@ -148,7 +148,7 @@ export type MathFieldConfig = {
148
148
  handlers?: {
149
149
  edit?: (mathField: MathFieldInterface) => void;
150
150
  enter?: (mathField: MathFieldInterface) => void;
151
- moveOutOf?: (mathField: MathFieldInterface) => void;
151
+ moveOutOf?: (direction: MathQuillDirection, mathField: MathFieldInterface) => void;
152
152
  upOutOf?: (mathField: MathFieldInterface) => void;
153
153
  downOutOf?: (mathField: MathFieldInterface) => void;
154
154
  deleteOutOf?: (direction: MathQuillDirection, mathField: MathFieldInterface) => void;
@@ -1,3 +1,3 @@
1
- import Key from "../../data/keys";
2
- import { MathFieldInterface } from "../input/mathquill-types";
1
+ import type Key from "../../data/keys";
2
+ import type { MathFieldInterface } from "../input/mathquill-types";
3
3
  export default function handleArrow(mathField: MathFieldInterface, key: Key): void;
@@ -1,4 +1,4 @@
1
- import { MathFieldInterface } from "../input/mathquill-types";
1
+ import type { MathFieldInterface } from "../input/mathquill-types";
2
2
  /**
3
3
  * Selects and deletes part of the expression based on the cursor location.
4
4
  * See inline comments for precise behavior of different cases.
@@ -1,3 +1,3 @@
1
- import Key from "../../data/keys";
2
- import { MathFieldInterface } from "../input/mathquill-types";
1
+ import type Key from "../../data/keys";
2
+ import type { MathFieldInterface } from "../input/mathquill-types";
3
3
  export default function handleExponent(mathField: MathFieldInterface, key: Key): void;
@@ -1,5 +1,5 @@
1
- import Key from "../../data/keys";
2
- import { MathFieldInterface } from "../input/mathquill-types";
1
+ import type Key from "../../data/keys";
2
+ import type { MathFieldInterface } from "../input/mathquill-types";
3
3
  /**
4
4
  * Advances the cursor to the next logical position.
5
5
  */
@@ -1,4 +1,4 @@
1
- import Key from "../../data/keys";
2
- import { MathFieldUpdaterCallback } from "../input/mathquill-types";
1
+ import type Key from "../../data/keys";
2
+ import type { MathFieldUpdaterCallback } from "../input/mathquill-types";
3
3
  declare const keyToMathquillMap: Record<Key, MathFieldUpdaterCallback>;
4
4
  export default keyToMathquillMap;
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import Key from "../../data/keys";
2
+ import type Key from "../../data/keys";
3
3
  type Props = {
4
4
  id: Key;
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { KeyConfig, ClickKeyCallback } from "../../types";
2
+ import type { KeyConfig, ClickKeyCallback } from "../../types";
3
3
  import type { StyleType } from "@khanacademy/wonder-blocks-core";
4
4
  export type KeypadButtonProps = {
5
5
  coord: readonly [number, number];
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import Key from "../../../data/keys";
3
- import { ClickKeyCallback } from "../../../types";
2
+ import type Key from "../../../data/keys";
3
+ import type { ClickKeyCallback } from "../../../types";
4
4
  type Props = {
5
5
  extraKeys: ReadonlyArray<Key>;
6
6
  onClickKey: ClickKeyCallback;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import type { ClickKeyCallback } from "../../../types";
3
+ import type { CursorContext } from "../../input/cursor-contexts";
4
+ type Props = {
5
+ onClickKey: ClickKeyCallback;
6
+ cursorContext?: typeof CursorContext[keyof typeof CursorContext];
7
+ };
8
+ export default function FractionsPage(props: Props): JSX.Element;
9
+ export {};
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ClickKeyCallback } from "../../../types";
2
+ import type { ClickKeyCallback } from "../../../types";
3
3
  type Props = {
4
4
  onClickKey: ClickKeyCallback;
5
5
  };
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ClickKeyCallback } from "../../../types";
2
+ import type { ClickKeyCallback } from "../../../types";
3
3
  type Props = {
4
4
  onClickKey: ClickKeyCallback;
5
5
  };
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ClickKeyCallback } from "../../../types";
2
+ import type { ClickKeyCallback } from "../../../types";
3
3
  type Props = {
4
4
  onClickKey: ClickKeyCallback;
5
5
  preAlgebra?: boolean;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- import Key from "../../data/keys";
3
- import { ClickKeyCallback } from "../../types";
4
- import { CursorContext } from "../input/cursor-contexts";
2
+ import type Key from "../../data/keys";
3
+ import type { ClickKeyCallback } from "../../types";
4
+ import type { CursorContext } from "../input/cursor-contexts";
5
5
  import type { SendEventFn } from "@khanacademy/perseus-core";
6
6
  export type Props = {
7
7
  extraKeys: ReadonlyArray<Key>;
@@ -14,6 +14,7 @@ export type Props = {
14
14
  logarithms?: boolean;
15
15
  basicRelations?: boolean;
16
16
  advancedRelations?: boolean;
17
+ fractionsOnly?: boolean;
17
18
  onClickKey: ClickKeyCallback;
18
19
  sendEvent?: SendEventFn;
19
20
  };
@@ -1,8 +1,8 @@
1
- import { StyleType } from "@khanacademy/wonder-blocks-core";
2
1
  import * as React from "react";
3
2
  import ReactDOM from "react-dom";
4
- import Key from "../../data/keys";
5
- import { Cursor, KeypadConfiguration, KeyHandler, KeypadAPI } from "../../types";
3
+ import type Key from "../../data/keys";
4
+ import type { Cursor, KeypadConfiguration, KeyHandler, KeypadAPI } from "../../types";
5
+ import type { StyleType } from "@khanacademy/wonder-blocks-core";
6
6
  /**
7
7
  * This is the v2 equivalent of v1's ProvidedKeypad. It follows the same
8
8
  * external API so that it can be hot-swapped with the v1 keypad and
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { ClickKeyCallback } from "../../types";
3
- import { CursorContext } from "../input/cursor-contexts";
4
- import { TabbarItemType } from "../tabbar";
2
+ import type { ClickKeyCallback } from "../../types";
3
+ import type { CursorContext } from "../input/cursor-contexts";
4
+ import type { TabbarItemType } from "../tabbar";
5
5
  type Props = {
6
6
  onClickKey: ClickKeyCallback;
7
7
  selectedPage: TabbarItemType;
@@ -0,0 +1,2 @@
1
+ import { CursorContext } from "../input/cursor-contexts";
2
+ export declare function getCursorContextConfig(cursorContext?: typeof CursorContext[keyof typeof CursorContext]): import("../../types").NonManyKeyConfig | null;
@@ -19,7 +19,7 @@
19
19
  * might need to be.
20
20
  */
21
21
  import { DeviceOrientation, LayoutMode } from "../../enums";
22
- import { GridDimensions, WidthHeight } from "./store/types";
22
+ import type { GridDimensions, WidthHeight } from "./store/types";
23
23
  type ComputedLayoutProperty = {
24
24
  buttonDimensions: WidthHeight;
25
25
  layoutMode: LayoutMode;
@@ -2,7 +2,7 @@
2
2
  * A keypad button containing no symbols and triggering no actions on click.
3
3
  */
4
4
  import * as React from "react";
5
- import GestureManager from "./gesture-manager";
5
+ import type GestureManager from "./gesture-manager";
6
6
  interface ReduxProps {
7
7
  gestureManager: GestureManager;
8
8
  }
@@ -3,12 +3,12 @@
3
3
  * connects our various bits of logic for managing gestures and interactions,
4
4
  * and links them together.
5
5
  */
6
- import * as React from "react";
7
- import Key from "../../data/keys";
8
- import { ActiveNodesObj, LayoutProps } from "../../types";
9
6
  import GestureStateMachine from "./gesture-state-machine";
10
7
  import NodeManager from "./node-manager";
11
8
  import PopoverStateMachine from "./popover-state-machine";
9
+ import type Key from "../../data/keys";
10
+ import type { ActiveNodesObj, LayoutProps } from "../../types";
11
+ import type * as React from "react";
12
12
  type Options = {
13
13
  swipeEnabled: boolean;
14
14
  };
@@ -1,4 +1,4 @@
1
- import Key from "../../data/keys";
1
+ import type 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.
@@ -2,7 +2,8 @@
2
2
  * A component that renders a keypad button.
3
3
  */
4
4
  import * as React from "react";
5
- import { BorderDirection, KeyType } from "../../enums";
5
+ import { BorderDirection } from "../../enums";
6
+ import type { KeyType } from "../../enums";
6
7
  import type { Border, NonManyKeyConfig, IconConfig } from "../../types";
7
8
  import type { StyleType } from "@khanacademy/wonder-blocks-core";
8
9
  interface ReduxProps {
@@ -3,7 +3,7 @@
3
3
  * symbols provided. Up to four symbols will be shown.
4
4
  */
5
5
  import * as React from "react";
6
- import { IconConfig } from "../../types";
6
+ import type { IconConfig } from "../../types";
7
7
  type Props = {
8
8
  focused: boolean;
9
9
  icons: ReadonlyArray<IconConfig>;
@@ -2,7 +2,7 @@
2
2
  * A popover that renders a set of keys floating above the page.
3
3
  */
4
4
  import * as React from "react";
5
- import { KeyConfig } from "../../types";
5
+ import type { KeyConfig } from "../../types";
6
6
  type Prop = {
7
7
  keys: ReadonlyArray<KeyConfig>;
8
8
  };
@@ -1,4 +1,4 @@
1
- import { LayoutProps, Bound } from "../../types";
1
+ import type { 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
@@ -1,4 +1,4 @@
1
- import Key from "../../../data/keys";
1
+ import type Key from "../../../data/keys";
2
2
  import type { Bound, KeypadConfiguration, KeyHandler, Cursor, ActiveNodesObj } from "../../../types";
3
3
  type DismissKeypadAction = {
4
4
  type: "DismissKeypad";
@@ -1,7 +1,7 @@
1
- import Key from "../../../data/keys";
2
- import { LayoutMode, KeypadType } from "../../../enums";
3
- import GestureManager from "../gesture-manager";
1
+ import type Key from "../../../data/keys";
2
+ import type { LayoutMode, KeypadType } from "../../../enums";
4
3
  import type { Cursor, KeyHandler, Popover, Echo } from "../../../types";
4
+ import type GestureManager from "../gesture-manager";
5
5
  export interface InputState {
6
6
  keyHandler: KeyHandler | null;
7
7
  cursor: Cursor | undefined;
@@ -4,10 +4,10 @@
4
4
  * touch events globally) opaque to the KeypadButton.
5
5
  */
6
6
  import * as React from "react";
7
- import Key from "../../data/keys";
8
- import { KeyType } from "../../enums";
9
- import GestureManager from "./gesture-manager";
7
+ import type Key from "../../data/keys";
8
+ import type { KeyType } from "../../enums";
10
9
  import type { Border, IconConfig, KeyConfig } from "../../types";
10
+ import type GestureManager from "./gesture-manager";
11
11
  import type { StyleType } from "@khanacademy/wonder-blocks-core";
12
12
  interface SharedProps {
13
13
  borders?: Border;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { StyleType } from "@khanacademy/wonder-blocks-core";
2
+ import type { StyleType } from "@khanacademy/wonder-blocks-core";
3
3
  type Props = {
4
4
  onElementMounted?: (arg1: any) => void;
5
5
  onDismiss?: () => void;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * React PropTypes that may be shared between components.
3
+ */
4
+ import PropTypes from "prop-types";
5
+ export declare const keypadElementPropType: PropTypes.Requireable<PropTypes.InferProps<{
6
+ activate: PropTypes.Validator<(...args: any[]) => any>;
7
+ dismiss: PropTypes.Validator<(...args: any[]) => any>;
8
+ configure: PropTypes.Validator<(...args: any[]) => any>;
9
+ setCursor: PropTypes.Validator<(...args: any[]) => any>;
10
+ setKeyHandler: PropTypes.Validator<(...args: any[]) => any>;
11
+ getDOMNode: PropTypes.Validator<(...args: any[]) => any>;
12
+ }>>;
@@ -1,6 +1,6 @@
1
- import { StyleType } from "@khanacademy/wonder-blocks-core";
2
1
  import * as React from "react";
3
- import { TabbarItemType } from "./types";
2
+ import type { TabbarItemType } from "./types";
3
+ import type { StyleType } from "@khanacademy/wonder-blocks-core";
4
4
  type Props = {
5
5
  items: ReadonlyArray<TabbarItemType>;
6
6
  selectedItem: TabbarItemType;
@@ -1 +1 @@
1
- export type TabbarItemType = "Geometry" | "Operators" | "Numbers" | "Extras" | "Dismiss";
1
+ export type TabbarItemType = "Geometry" | "Operators" | "Numbers" | "Fractions" | "Extras" | "Dismiss";
@@ -1,5 +1,5 @@
1
- import { KeyConfig } from "../types";
2
- import Key from "./keys";
1
+ import type { KeyConfig } from "../types";
2
+ import type Key from "./keys";
3
3
  declare const KeyConfigs: {
4
4
  [key in Key]: KeyConfig;
5
5
  };