@khanacademy/math-input 4.1.1 → 4.3.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 (99) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/components/input/math-wrapper.d.ts +1 -1
  3. package/dist/components/input/math-wrapper.js.flow +1 -1
  4. package/dist/components/input/mathquill-instance.d.ts +14 -3
  5. package/dist/components/input/mathquill-instance.js.flow +18 -3
  6. package/dist/components/input/mathquill-types.d.ts +30 -6
  7. package/dist/components/input/mathquill-types.js.flow +33 -7
  8. package/dist/components/key-handlers/handle-arrow.d.ts +3 -0
  9. package/dist/components/{input/key-handlers → key-handlers}/handle-arrow.js.flow +2 -2
  10. package/dist/components/{input/key-handlers → key-handlers}/handle-backspace.d.ts +1 -1
  11. package/dist/components/{input/key-handlers → key-handlers}/handle-backspace.js.flow +1 -1
  12. package/dist/components/key-handlers/handle-exponent.d.ts +3 -0
  13. package/dist/components/{input/key-handlers → key-handlers}/handle-exponent.js.flow +2 -2
  14. package/dist/components/{input/key-handlers → key-handlers}/handle-jump-out.d.ts +2 -2
  15. package/dist/components/{input/key-handlers → key-handlers}/handle-jump-out.js.flow +2 -2
  16. package/dist/components/key-handlers/key-translator.d.ts +4 -0
  17. package/dist/components/{key-translator.js.flow → key-handlers/key-translator.js.flow} +3 -3
  18. package/dist/components/keypad/index.d.ts +8 -16
  19. package/dist/components/keypad/index.js.flow +10 -22
  20. package/dist/components/keypad/keypad-button.d.ts +12 -0
  21. package/dist/components/keypad/keypad-button.js.flow +18 -0
  22. package/dist/components/keypad/keypad-pages/extras-page.d.ts +9 -0
  23. package/dist/components/keypad/{operators-page/basic-relations-buttons.js.flow → keypad-pages/extras-page.js.flow} +3 -3
  24. package/dist/components/keypad/keypad-pages/geometry-page.d.ts +7 -0
  25. package/dist/components/keypad/{operators-page/logarithms-buttons.js.flow → keypad-pages/geometry-page.js.flow} +1 -3
  26. package/dist/components/keypad/keypad-pages/numbers-page.d.ts +7 -0
  27. package/dist/components/keypad/{operators-page/pre-algebra-buttons.js.flow → keypad-pages/numbers-page.js.flow} +1 -3
  28. package/dist/components/keypad/keypad-pages/operators-page.d.ts +11 -0
  29. package/dist/components/keypad/{geometry-page/index.js.flow → keypad-pages/operators-page.js.flow} +5 -4
  30. package/dist/components/keypad/shared-keys.d.ts +9 -0
  31. package/dist/components/keypad/{numbers-page/types.js.flow → shared-keys.js.flow} +4 -1
  32. package/dist/es/index.js +763 -878
  33. package/dist/es/index.js.map +1 -1
  34. package/dist/index.d.ts +3 -1
  35. package/dist/index.js +740 -878
  36. package/dist/index.js.flow +6 -1
  37. package/dist/index.js.map +1 -1
  38. package/package.json +2 -3
  39. package/src/components/input/__tests__/test-math-wrapper.ts +2 -5
  40. package/src/components/input/math-input.tsx +10 -14
  41. package/src/components/input/math-wrapper.ts +23 -49
  42. package/src/components/input/mathquill-helpers.ts +11 -11
  43. package/src/components/input/mathquill-instance.ts +57 -2
  44. package/src/components/input/mathquill-types.ts +43 -7
  45. package/src/components/{input/key-handlers → key-handlers}/handle-arrow.ts +6 -6
  46. package/src/components/{input/key-handlers → key-handlers}/handle-backspace.ts +19 -17
  47. package/src/components/{input/key-handlers → key-handlers}/handle-exponent.ts +8 -5
  48. package/src/components/{input/key-handlers → key-handlers}/handle-jump-out.ts +15 -10
  49. package/src/components/{key-translator.ts → key-handlers/key-translator.ts} +43 -28
  50. package/src/components/keypad/__tests__/{KeypadButton.test.tsx → keypad-button.test.tsx} +7 -5
  51. package/src/components/keypad/__tests__/keypad-v2-mathquill.test.tsx +231 -0
  52. package/src/components/keypad/__tests__/keypad-v2.cypress.ts +19 -6
  53. package/src/components/keypad/index.tsx +73 -49
  54. package/src/components/keypad/{button.stories.tsx → keypad-button.stories.tsx} +2 -1
  55. package/src/components/keypad/keypad-button.tsx +128 -0
  56. package/src/components/keypad/keypad-mathquill.stories.tsx +24 -26
  57. package/src/components/keypad/keypad-pages/extras-page.tsx +34 -0
  58. package/src/components/keypad/keypad-pages/geometry-page.tsx +33 -0
  59. package/src/components/keypad/keypad-pages/numbers-page.tsx +84 -0
  60. package/src/components/keypad/keypad-pages/operators-page.tsx +116 -0
  61. package/src/components/keypad/shared-keys.tsx +78 -0
  62. package/src/index.ts +6 -1
  63. package/tsconfig-build.tsbuildinfo +1 -1
  64. package/dist/components/input/key-handlers/handle-arrow.d.ts +0 -3
  65. package/dist/components/input/key-handlers/handle-exponent.d.ts +0 -3
  66. package/dist/components/key-translator.d.ts +0 -4
  67. package/dist/components/keypad/button.d.ts +0 -12
  68. package/dist/components/keypad/button.js.flow +0 -18
  69. package/dist/components/keypad/extras-page/index.d.ts +0 -10
  70. package/dist/components/keypad/extras-page/index.js.flow +0 -15
  71. package/dist/components/keypad/geometry-page/index.d.ts +0 -9
  72. package/dist/components/keypad/keypad-page-items.d.ts +0 -26
  73. package/dist/components/keypad/keypad-page-items.js.flow +0 -40
  74. package/dist/components/keypad/numbers-page/index.d.ts +0 -10
  75. package/dist/components/keypad/numbers-page/index.js.flow +0 -18
  76. package/dist/components/keypad/numbers-page/types.d.ts +0 -4
  77. package/dist/components/keypad/operators-page/advanced-relations-buttons.d.ts +0 -8
  78. package/dist/components/keypad/operators-page/advanced-relations-buttons.js.flow +0 -13
  79. package/dist/components/keypad/operators-page/basic-relations-buttons.d.ts +0 -8
  80. package/dist/components/keypad/operators-page/index.d.ts +0 -10
  81. package/dist/components/keypad/operators-page/index.js.flow +0 -18
  82. package/dist/components/keypad/operators-page/logarithms-buttons.d.ts +0 -8
  83. package/dist/components/keypad/operators-page/pre-algebra-buttons.d.ts +0 -8
  84. package/dist/components/keypad/operators-page/types.d.ts +0 -6
  85. package/dist/components/keypad/operators-page/types.js.flow +0 -12
  86. package/src/components/keypad/__tests__/Button.test.tsx +0 -51
  87. package/src/components/keypad/button.tsx +0 -108
  88. package/src/components/keypad/extras-page/index.tsx +0 -27
  89. package/src/components/keypad/geometry-page/index.tsx +0 -89
  90. package/src/components/keypad/keypad-page-items.tsx +0 -118
  91. package/src/components/keypad/numbers-page/index.tsx +0 -136
  92. package/src/components/keypad/numbers-page/types.ts +0 -4
  93. package/src/components/keypad/operators-page/advanced-relations-buttons.tsx +0 -33
  94. package/src/components/keypad/operators-page/basic-relations-buttons.tsx +0 -33
  95. package/src/components/keypad/operators-page/index.tsx +0 -94
  96. package/src/components/keypad/operators-page/logarithms-buttons.tsx +0 -33
  97. package/src/components/keypad/operators-page/pre-algebra-buttons.tsx +0 -37
  98. package/src/components/keypad/operators-page/types.ts +0 -6
  99. /package/src/components/keypad/{keypad-pages.stories.tsx → keypad-pages/keypad-pages.stories.tsx} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @khanacademy/math-input
2
2
 
3
+ ## 4.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - cf29ed88: Update layout of MathInput's keypad
8
+
9
+ ## 4.2.0
10
+
11
+ ### Minor Changes
12
+
13
+ - d497118e: MathInput exports tools for generating MathFields, replacing the need for direct MathQuill access
14
+
15
+ ### Patch Changes
16
+
17
+ - e7d21b67: Add keypress logic from MathInput to key translator
18
+ - eceb4510: Updated aria-labels to be more descriptive and tests that used aria-labels.
19
+
3
20
  ## 4.1.1
4
21
 
5
22
  ### Patch Changes
@@ -9,7 +9,7 @@ import { MathFieldInterface, MathFieldCursor } from "./mathquill-types";
9
9
  declare class MathWrapper {
10
10
  mathField: MathFieldInterface;
11
11
  callbacks: any;
12
- constructor(element: any, options?: {}, callbacks?: {});
12
+ constructor(element: any, callbacks?: {});
13
13
  focus(): void;
14
14
  blur(): void;
15
15
  /**
@@ -17,7 +17,7 @@ import { MathFieldInterface, MathFieldCursor } from "./mathquill-types";
17
17
  declare class MathWrapper {
18
18
  mathField: MathFieldInterface;
19
19
  callbacks: any;
20
- constructor(element: any, options?: {||}, callbacks?: {||}): this;
20
+ constructor(element: any, callbacks?: {||}): this;
21
21
  focus(): void;
22
22
  blur(): void;
23
23
 
@@ -1,3 +1,14 @@
1
- import { MathQuillInterface } from "./mathquill-types";
2
- declare const _default: MathQuillInterface;
3
- export default _default;
1
+ import { MathQuillInterface, MathFieldConfig } from "./mathquill-types";
2
+ export declare const mathQuillInstance: MathQuillInterface;
3
+ /**
4
+ * Creates a new [MathField](http://docs.mathquill.com/en/latest/Api_Methods/#mqmathfieldhtml_element-config)
5
+ * instance within the given `container`.
6
+ *
7
+ * An optional configuration callback can be provided to customize
8
+ * the created MathField. A default configuration is passed to this
9
+ * callback which can then be adjusted as needed. The configuration
10
+ * returned from this callback is used to create the MathField.
11
+ * This allows callers to do minimal configuration as only configs
12
+ * that vary from the default need to be provided.
13
+ */
14
+ export declare function createMathField(container: HTMLDivElement | HTMLSpanElement, configCallback?: (baseConfig: MathFieldConfig) => MathFieldConfig): import("./mathquill-types").MathFieldInterface;
@@ -4,6 +4,21 @@
4
4
  * Flowgen v1.21.0
5
5
  * @flow
6
6
  */
7
- import { MathQuillInterface } from "./mathquill-types";
8
- declare var _default: MathQuillInterface;
9
- declare export default typeof _default;
7
+ import * as $Flowgen$Import$_2e__2f_mathquill_2d_types from "./mathquill-types";
8
+ import { MathQuillInterface, MathFieldConfig } from "./mathquill-types";
9
+ declare export var mathQuillInstance: MathQuillInterface;
10
+ /**
11
+ * Creates a new [MathField](http://docs.mathquill.com/en/latest/Api_Methods/#mqmathfieldhtml_element-config)
12
+ * instance within the given `container`.
13
+ *
14
+ * An optional configuration callback can be provided to customize
15
+ * the created MathField. A default configuration is passed to this
16
+ * callback which can then be adjusted as needed. The configuration
17
+ * returned from this callback is used to create the MathField.
18
+ * This allows callers to do minimal configuration as only configs
19
+ * that vary from the default need to be provided.
20
+ */
21
+ declare export function createMathField(
22
+ container: HTMLDivElement | HTMLSpanElement,
23
+ configCallback?: (baseConfig: MathFieldConfig) => MathFieldConfig
24
+ ): $Flowgen$Import$_2e__2f_mathquill_2d_types.MathFieldInterface;
@@ -2,17 +2,40 @@ import Key from "../../data/keys";
2
2
  export interface MathQuillInterface {
3
3
  L: "L";
4
4
  R: "R";
5
- MathField: (mount: HTMLDivElement, options: any) => MathFieldInterface;
5
+ MathField: (mount: HTMLDivElement | HTMLSpanElement, config: MathFieldConfig) => MathFieldInterface;
6
6
  }
7
+ type MathQuillDir = "L" | "R";
8
+ export type MathFieldConfig = {
9
+ spaceBehavesLikeTab?: boolean;
10
+ leftRightIntoCmdGoes?: string;
11
+ restrictMismatchedBrackets?: boolean;
12
+ sumStartsWithNEquals?: boolean;
13
+ supSubsRequireOperand?: boolean;
14
+ charsThatBreakOutOfSupSub?: string;
15
+ autoSubscriptNumerals?: boolean;
16
+ autoCommands?: string;
17
+ autoOperatorNames?: string;
18
+ maxDepth?: number;
19
+ substituteTextarea?: () => HTMLElement;
20
+ handlers?: {
21
+ edit?: (mathField: MathFieldInterface) => void;
22
+ upOutOf?: (mathField: MathFieldInterface) => void;
23
+ moveOutOf?: (dir: MathQuillDir, mathField: MathFieldInterface) => void;
24
+ };
25
+ };
7
26
  export interface MathFieldInterface {
8
- write: (input: string) => void;
9
- cmd: (input: string) => void;
10
- keystroke: (input: string) => void;
11
- typedText: (input: string) => void;
27
+ focus: () => MathFieldInterface;
28
+ blur: () => MathFieldInterface;
29
+ write: (input: string) => MathFieldInterface;
30
+ cmd: (input: string) => MathFieldInterface;
31
+ keystroke: (input: string) => MathFieldInterface;
32
+ typedText: (input: string) => MathFieldInterface;
12
33
  latex: (input?: string) => string;
13
34
  moveToDirEnd: (direction: "L" | "R") => void;
14
35
  select: () => void;
15
36
  clearSelection: () => void;
37
+ cursorAtRightEnd: () => boolean;
38
+ cursorAtLeftEnd: () => boolean;
16
39
  __controller: any;
17
40
  }
18
41
  export declare enum MathFieldActionType {
@@ -22,4 +45,5 @@ export declare enum MathFieldActionType {
22
45
  MQ_END = 0
23
46
  }
24
47
  export type MathFieldCursor = any;
25
- export type MathQuillUpdaterCallback = (mathQuill: MathFieldInterface, key: Key) => void;
48
+ export type MathFieldUpdaterCallback = (mathField: MathFieldInterface, key: Key) => void;
49
+ export {};
@@ -8,17 +8,43 @@ import Key from "../../data/keys";
8
8
  export interface MathQuillInterface {
9
9
  L: "L";
10
10
  R: "R";
11
- MathField: (mount: HTMLDivElement, options: any) => MathFieldInterface;
11
+ MathField: (
12
+ mount: HTMLDivElement | HTMLSpanElement,
13
+ config: MathFieldConfig
14
+ ) => MathFieldInterface;
12
15
  }
16
+ declare type MathQuillDir = "L" | "R";
17
+ export type MathFieldConfig = {|
18
+ spaceBehavesLikeTab?: boolean,
19
+ leftRightIntoCmdGoes?: string,
20
+ restrictMismatchedBrackets?: boolean,
21
+ sumStartsWithNEquals?: boolean,
22
+ supSubsRequireOperand?: boolean,
23
+ charsThatBreakOutOfSupSub?: string,
24
+ autoSubscriptNumerals?: boolean,
25
+ autoCommands?: string,
26
+ autoOperatorNames?: string,
27
+ maxDepth?: number,
28
+ substituteTextarea?: () => HTMLElement,
29
+ handlers?: {|
30
+ edit?: (mathField: MathFieldInterface) => void,
31
+ upOutOf?: (mathField: MathFieldInterface) => void,
32
+ moveOutOf?: (dir: MathQuillDir, mathField: MathFieldInterface) => void,
33
+ |},
34
+ |};
13
35
  export interface MathFieldInterface {
14
- write: (input: string) => void;
15
- cmd: (input: string) => void;
16
- keystroke: (input: string) => void;
17
- typedText: (input: string) => void;
36
+ focus: () => MathFieldInterface;
37
+ blur: () => MathFieldInterface;
38
+ write: (input: string) => MathFieldInterface;
39
+ cmd: (input: string) => MathFieldInterface;
40
+ keystroke: (input: string) => MathFieldInterface;
41
+ typedText: (input: string) => MathFieldInterface;
18
42
  latex: (input?: string) => string;
19
43
  moveToDirEnd: (direction: "L" | "R") => void;
20
44
  select: () => void;
21
45
  clearSelection: () => void;
46
+ cursorAtRightEnd: () => boolean;
47
+ cursorAtLeftEnd: () => boolean;
22
48
  __controller: any;
23
49
  }
24
50
  declare export var MathFieldActionType: {|
@@ -28,7 +54,7 @@ declare export var MathFieldActionType: {|
28
54
  +MQ_END: 0, // 0
29
55
  |};
30
56
  export type MathFieldCursor = any;
31
- export type MathQuillUpdaterCallback = (
32
- mathQuill: MathFieldInterface,
57
+ export type MathFieldUpdaterCallback = (
58
+ mathField: MathFieldInterface,
33
59
  key: Key
34
60
  ) => void;
@@ -0,0 +1,3 @@
1
+ import Key from "../../data/keys";
2
+ import { MathFieldInterface } from "../input/mathquill-types";
3
+ export default function handleArrow(mathField: MathFieldInterface, key: Key): void;
@@ -4,8 +4,8 @@
4
4
  * Flowgen v1.21.0
5
5
  * @flow
6
6
  */
7
- import Key from "../../../data/keys";
8
- import { MathFieldInterface } from "../mathquill-types";
7
+ import Key from "../../data/keys";
8
+ import { MathFieldInterface } from "../input/mathquill-types";
9
9
  declare export default function handleArrow(
10
10
  mathField: MathFieldInterface,
11
11
  key: Key
@@ -1,4 +1,4 @@
1
- import { MathFieldInterface } from "../mathquill-types";
1
+ import { 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.
@@ -4,7 +4,7 @@
4
4
  * Flowgen v1.21.0
5
5
  * @flow
6
6
  */
7
- import { MathFieldInterface } from "../mathquill-types";
7
+ import { MathFieldInterface } from "../input/mathquill-types";
8
8
 
9
9
  /**
10
10
  * Selects and deletes part of the expression based on the cursor location.
@@ -0,0 +1,3 @@
1
+ import Key from "../../data/keys";
2
+ import { MathFieldInterface } from "../input/mathquill-types";
3
+ export default function handleExponent(mathField: MathFieldInterface, key: Key): void;
@@ -4,8 +4,8 @@
4
4
  * Flowgen v1.21.0
5
5
  * @flow
6
6
  */
7
- import Key from "../../../data/keys";
8
- import { MathFieldInterface } from "../mathquill-types";
7
+ import Key from "../../data/keys";
8
+ import { MathFieldInterface } from "../input/mathquill-types";
9
9
  declare export default function handleExponent(
10
10
  mathField: MathFieldInterface,
11
11
  key: Key
@@ -1,5 +1,5 @@
1
- import Key from "../../../data/keys";
2
- import { MathFieldInterface } from "../mathquill-types";
1
+ import Key from "../../data/keys";
2
+ import { MathFieldInterface } from "../input/mathquill-types";
3
3
  /**
4
4
  * Advances the cursor to the next logical position.
5
5
  */
@@ -4,8 +4,8 @@
4
4
  * Flowgen v1.21.0
5
5
  * @flow
6
6
  */
7
- import Key from "../../../data/keys";
8
- import { MathFieldInterface } from "../mathquill-types";
7
+ import Key from "../../data/keys";
8
+ import { MathFieldInterface } from "../input/mathquill-types";
9
9
 
10
10
  /**
11
11
  * Advances the cursor to the next logical position.
@@ -0,0 +1,4 @@
1
+ import Key from "../../data/keys";
2
+ import { MathFieldUpdaterCallback } from "../input/mathquill-types";
3
+ declare const keyToMathquillMap: Record<Key, MathFieldUpdaterCallback>;
4
+ export default keyToMathquillMap;
@@ -4,7 +4,7 @@
4
4
  * Flowgen v1.21.0
5
5
  * @flow
6
6
  */
7
- import Key from "../data/keys";
8
- import { MathQuillUpdaterCallback } from "./input/mathquill-types";
9
- declare var keyToMathquillMap: { [key: Key]: MathQuillUpdaterCallback };
7
+ import Key from "../../data/keys";
8
+ import { MathFieldUpdaterCallback } from "../input/mathquill-types";
9
+ declare var keyToMathquillMap: { [key: Key]: MathFieldUpdaterCallback };
10
10
  declare export default typeof keyToMathquillMap;
@@ -1,23 +1,15 @@
1
- import * as React from "react";
1
+ /// <reference types="react" />
2
2
  import Key from "../../data/keys";
3
3
  import { ClickKeyCallback } from "../../types";
4
- import { TabbarItemType } from "../tabbar/types";
5
- import { NumbersPageOptions } from "./numbers-page/types";
6
- import { OperatorsButtonSets } from "./operators-page/types";
7
4
  export type Props = {
8
5
  onClickKey: ClickKeyCallback;
9
6
  trigonometry?: boolean;
10
7
  extraKeys: ReadonlyArray<Key>;
11
- } & OperatorsButtonSets & NumbersPageOptions;
12
- type State = {
13
- selectedPage: TabbarItemType;
8
+ multiplicationDot?: boolean;
9
+ divisionKey?: boolean;
10
+ preAlgebra?: boolean;
11
+ logarithms?: boolean;
12
+ basicRelations?: boolean;
13
+ advancedRelations?: boolean;
14
14
  };
15
- type DefaultProps = {
16
- extraKeys: Props["extraKeys"];
17
- };
18
- export default class Keypad extends React.Component<Props, State> {
19
- state: State;
20
- static defaultProps: DefaultProps;
21
- render(): React.ReactNode;
22
- }
23
- export {};
15
+ export default function Keypad(props: Props): JSX.Element;
@@ -4,29 +4,17 @@
4
4
  * Flowgen v1.21.0
5
5
  * @flow
6
6
  */
7
- import * as React from "react";
8
7
  import Key from "../../data/keys";
9
8
  import { ClickKeyCallback } from "../../types";
10
- import { TabbarItemType } from "../tabbar/types";
11
- import { NumbersPageOptions } from "./numbers-page/types";
12
- import { OperatorsButtonSets } from "./operators-page/types";
13
9
  export type Props = {|
14
- ...{|
15
- onClickKey: ClickKeyCallback,
16
- trigonometry?: boolean,
17
- extraKeys: $ReadOnlyArray<Key>,
18
- |},
19
- ...OperatorsButtonSets,
20
- ...NumbersPageOptions,
10
+ onClickKey: ClickKeyCallback,
11
+ trigonometry?: boolean,
12
+ extraKeys: $ReadOnlyArray<Key>,
13
+ multiplicationDot?: boolean,
14
+ divisionKey?: boolean,
15
+ preAlgebra?: boolean,
16
+ logarithms?: boolean,
17
+ basicRelations?: boolean,
18
+ advancedRelations?: boolean,
21
19
  |};
22
- declare type State = {|
23
- selectedPage: TabbarItemType,
24
- |};
25
- declare type DefaultProps = {|
26
- extraKeys: $PropertyType<Props, "extraKeys">,
27
- |};
28
- declare export default class Keypad extends React.Component<Props, State> {
29
- state: State;
30
- static defaultProps: DefaultProps;
31
- render(): React.Node;
32
- }
20
+ declare export default function Keypad(props: Props): React$Node;
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ import { KeyConfig, ClickKeyCallback } from "../../types";
3
+ import type { StyleType } from "@khanacademy/wonder-blocks-core";
4
+ export type KeypadButtonProps = {
5
+ coord: readonly [number, number];
6
+ keyConfig: KeyConfig;
7
+ onClickKey: ClickKeyCallback;
8
+ action?: boolean;
9
+ secondary?: boolean;
10
+ style?: StyleType;
11
+ };
12
+ export declare const KeypadButton: ({ coord, keyConfig, onClickKey, style, secondary, action, }: KeypadButtonProps) => React.ReactElement;
@@ -0,0 +1,18 @@
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 { KeyConfig, ClickKeyCallback } from "../../types";
9
+ import type { StyleType } from "@khanacademy/wonder-blocks-core";
10
+ export type KeypadButtonProps = {|
11
+ coord: [number, number],
12
+ keyConfig: KeyConfig,
13
+ onClickKey: ClickKeyCallback,
14
+ action?: boolean,
15
+ secondary?: boolean,
16
+ style?: StyleType,
17
+ |};
18
+ declare export var KeypadButton: (x: KeypadButtonProps) => React.Element<any>;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import Key from "../../../data/keys";
3
+ import { ClickKeyCallback } from "../../../types";
4
+ type Props = {
5
+ extraKeys: ReadonlyArray<Key>;
6
+ onClickKey: ClickKeyCallback;
7
+ };
8
+ export default function ExtrasPage(props: Props): JSX.Element;
9
+ export {};
@@ -4,10 +4,10 @@
4
4
  * Flowgen v1.21.0
5
5
  * @flow
6
6
  */
7
- import React from "react";
7
+ import Key from "../../../data/keys";
8
8
  import { ClickKeyCallback } from "../../../types";
9
9
  declare type Props = {|
10
+ extraKeys: $ReadOnlyArray<Key>,
10
11
  onClickKey: ClickKeyCallback,
11
- placeholder?: boolean,
12
12
  |};
13
- declare export var BasicRelations: (x: Props) => React.ReactElement;
13
+ declare export default function ExtrasPage(props: Props): React$Node;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { ClickKeyCallback } from "../../../types";
3
+ type Props = {
4
+ onClickKey: ClickKeyCallback;
5
+ };
6
+ export default function GeometryPage(props: Props): JSX.Element;
7
+ export {};
@@ -4,10 +4,8 @@
4
4
  * Flowgen v1.21.0
5
5
  * @flow
6
6
  */
7
- import React from "react";
8
7
  import { ClickKeyCallback } from "../../../types";
9
8
  declare type Props = {|
10
9
  onClickKey: ClickKeyCallback,
11
- placeholder?: boolean,
12
10
  |};
13
- declare export var Logarithms: (x: Props) => React.ReactElement;
11
+ declare export default function GeometryPage(props: Props): React$Node;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { ClickKeyCallback } from "../../../types";
3
+ type Props = {
4
+ onClickKey: ClickKeyCallback;
5
+ };
6
+ export default function NumbersPage(props: Props): JSX.Element;
7
+ export {};
@@ -4,10 +4,8 @@
4
4
  * Flowgen v1.21.0
5
5
  * @flow
6
6
  */
7
- import React from "react";
8
7
  import { ClickKeyCallback } from "../../../types";
9
8
  declare type Props = {|
10
9
  onClickKey: ClickKeyCallback,
11
- placeholder?: boolean,
12
10
  |};
13
- declare export var PreAlgebra: (x: Props) => React.ReactElement;
11
+ declare export default function NumbersPage(props: Props): React$Node;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { ClickKeyCallback } from "../../../types";
3
+ type Props = {
4
+ onClickKey: ClickKeyCallback;
5
+ preAlgebra?: boolean;
6
+ logarithms?: boolean;
7
+ basicRelations?: boolean;
8
+ advancedRelations?: boolean;
9
+ };
10
+ export default function OperatorsPage(props: Props): JSX.Element;
11
+ export {};
@@ -4,11 +4,12 @@
4
4
  * Flowgen v1.21.0
5
5
  * @flow
6
6
  */
7
- import * as React from "react";
8
7
  import { ClickKeyCallback } from "../../../types";
9
8
  declare type Props = {|
10
9
  onClickKey: ClickKeyCallback,
10
+ preAlgebra?: boolean,
11
+ logarithms?: boolean,
12
+ basicRelations?: boolean,
13
+ advancedRelations?: boolean,
11
14
  |};
12
- declare export default class GeometryPage extends React.Component<Props> {
13
- render(): React.Node;
14
- }
15
+ declare export default function OperatorsPage(props: Props): React$Node;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { ClickKeyCallback } from "../../types";
3
+ type Props = {
4
+ onClickKey: ClickKeyCallback;
5
+ multiplicationDot?: boolean;
6
+ divisionKey?: boolean;
7
+ };
8
+ export default function SharedKeys(props: Props): JSX.Element;
9
+ export {};
@@ -4,7 +4,10 @@
4
4
  * Flowgen v1.21.0
5
5
  * @flow
6
6
  */
7
- export type NumbersPageOptions = {|
7
+ import { ClickKeyCallback } from "../../types";
8
+ declare type Props = {|
9
+ onClickKey: ClickKeyCallback,
8
10
  multiplicationDot?: boolean,
9
11
  divisionKey?: boolean,
10
12
  |};
13
+ declare export default function SharedKeys(props: Props): React$Node;